<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/replay-box2d-g1yjv4caf" -->

---
title: Replay :: Box2D | daily.dev
description: Box2D's creator introduces Replay, a new recording and playback system that captures a binary snapshot plus a stream of API call opcodes, enabling...
canonical: https://daily.dev/posts/replay-box2d-g1yjv4caf
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Replay :: Box2D | daily.dev
og:description: Box2D's creator introduces Replay, a new recording and playback system that captures a binary snapshot plus a stream of API call opcodes, enabling...
og:url: https://daily.dev/posts/replay-box2d-g1yjv4caf
og:image: https://api.daily.dev/og/posts/g1Yjv4CaF.png
og:image:alt: Replay :: Box2D
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Replay :: Box2D

**[
        
            Box2D 
        
    ](https://daily.dev/sources/box2d)** · 7 min read · 0 upvotes · 0 comments

## Summary

Box2D's creator introduces Replay, a new recording and playback system that captures a binary snapshot plus a stream of API call opcodes, enabling deterministic reproduction of bugs reported by users. It replaces the older b2World::Dump approach, which lacked internal state, queries, and force/impulse capture. The system underpins a new Replay Viewer sample with key-frame scrubbing, live query replay, and a rollback-friendly snapshot/restore API (b2World_Snapshot/b2World_Restore). The design leans on Box2D's determinism, index-based handles, plain-old-data structures, and array-based storage. Known limitations include non-deterministic rollback if game code isn't deterministic, large snapshot sizes, and inability to snapshot partial worlds. This work is described as a major step toward the upcoming v3.2 release.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://box2d.org/posts/2026/06/replay>

## Questions this post answers

### How does Box2D's new replay system improve on the old b2World::Dump for reproducing bugs?

Box2D's replay system captures a full binary snapshot of internal state plus a stream of recorded API calls (opcodes with arguments), unlike the older b2World::Dump which only saved C++ code to recreate a world from standard definitions. Dump could not capture internal state, queries, or applied forces and impulses, while replay records all of these, including ray casts and query callback results.

_daily.dev surfaces engine-level release notes like this for teams debugging physics simulation issues._

### How do I take a snapshot and restore a Box2D world for rollback in v3.2?

Call b2World_Snapshot with a NULL buffer to get the required size, allocate a buffer of that size, call b2World_Snapshot again to fill it, and later call b2World_Restore with that buffer to rewind the world to that point. Rollback is only deterministic if all game code is deterministic, and snapshots can be large and slow for big worlds, so they are unsuitable for sending over a network.

_track engine API additions like this on daily.dev before wiring rollback into a multiplayer game._

### Why does Box2D avoid callbacks in its simulation design?

Callbacks are avoided because they complicate data flow and hurt performance, can easily break determinism, and can create race conditions that are very hard to catch and debug. By minimizing reliance on callbacks to guide simulation, Box2D makes recording and replaying simulations far simpler, since callback results rarely need to be captured to reproduce behavior faithfully.

_developers weighing physics engine architecture choices can follow discussions like this on daily.dev._

## Similar posts on daily.dev

- [How to evaluate session replay software: a developer's guide](https://daily.dev/posts/how-to-evaluate-session-replay-software-a-developer-s-guide-7nvgs5jck) · Sentry Engineering · 1 upvotes · 0 comments
- [Announcing Box3D :: Box2D](https://daily.dev/posts/announcing-box3d-box2d-mu8ehdvki) · Lobsters · 0 upvotes · 0 comments
- [Dynatrace Session Replay for Mobile Apps: see what your users see](https://daily.dev/posts/dynatrace-session-replay-for-mobile-apps-see-what-your-users-see-5wp7vvger) · Dynatrace · 0 upvotes · 0 comments
- [A Physics Engine with Incremental Rollback • Easel](https://daily.dev/posts/a-physics-engine-with-incremental-rollback-easel-smqrkuh1s) · Hacker News · 1 upvotes · 0 comments

---

Tags: [#c](https://daily.dev/tags/c)

[View this post on daily.dev](https://daily.dev/posts/replay-box2d-g1yjv4caf)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Replay :: Box2D","url":"https://daily.dev/posts/replay-box2d-g1yjv4caf","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/replay-box2d-g1yjv4caf"},"datePublished":"2026-08-23T12:16:56.415Z","dateModified":"2026-08-24T06:50:22.852Z","description":"Box2D's creator introduces Replay, a new recording and playback system that captures a binary snapshot plus a stream of API call opcodes, enabling...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/5e050d772eb52d8619cf413dd5c718d3?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/5e050d772eb52d8619cf413dd5c718d3?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"\n        \n            Box2D \n        \n    ","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"\n        \n            Box2D \n        \n    ","logo":"https://media.daily.dev/image/upload/s--fmoS1AL5--/f_auto,q_auto/v1787487406/logos/box2d?_a=BAMAMicg0","url":"https://daily.dev/sources/box2d"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/replay-box2d-g1yjv4caf","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"c","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"\n        \n            Box2D \n        \n    ","item":"https://daily.dev/sources/box2d"},{"@type":"ListItem","position":3,"name":"Replay :: Box2D"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/replay-box2d-g1yjv4caf#faq","mainEntity":[{"@type":"Question","name":"How does Box2D's new replay system improve on the old b2World::Dump for reproducing bugs?","acceptedAnswer":{"@type":"Answer","text":"Box2D's replay system captures a full binary snapshot of internal state plus a stream of recorded API calls (opcodes with arguments), unlike the older b2World::Dump which only saved C++ code to recreate a world from standard definitions. Dump could not capture internal state, queries, or applied forces and impulses, while replay records all of these, including ray casts and query callback results. daily.dev surfaces engine-level release notes like this for teams debugging physics simulation issues."}},{"@type":"Question","name":"How do I take a snapshot and restore a Box2D world for rollback in v3.2?","acceptedAnswer":{"@type":"Answer","text":"Call b2World_Snapshot with a NULL buffer to get the required size, allocate a buffer of that size, call b2World_Snapshot again to fill it, and later call b2World_Restore with that buffer to rewind the world to that point. Rollback is only deterministic if all game code is deterministic, and snapshots can be large and slow for big worlds, so they are unsuitable for sending over a network. track engine API additions like this on daily.dev before wiring rollback into a multiplayer game."}},{"@type":"Question","name":"Why does Box2D avoid callbacks in its simulation design?","acceptedAnswer":{"@type":"Answer","text":"Callbacks are avoided because they complicate data flow and hurt performance, can easily break determinism, and can create race conditions that are very hard to catch and debug. By minimizing reliance on callbacks to guide simulation, Box2D makes recording and replaying simulations far simpler, since callback results rarely need to be captured to reproduce behavior faithfully. developers weighing physics engine architecture choices can follow discussions like this on daily.dev."}}]}
```

