We factor out a common simulation abstraction for the 3 or 4 places where we simulate the game: server, client reconciliation, and client prediction (twice). To combat the performance issues caused by duplicating our game state too many times, we added checkpointing to our entity management, reducing clones in exchange for state-handling complexity: now we have to mark objects as
dirty before modifying them. Finally, we re-enabled the shooting system…but not our bullet physics.
- This session’s optimization hinges on a checkpointing mechanism that adds some complexity. We’re pretty sure it will come back to bite us. Some tools/libraries we discussed to deal with this:
- Immutable.js: https://github.com/immutable-js/immutable-js
- Rust mutable and immutable variables: https://doc.rust-lang.org/stable/book/ch03-01-variables-and-mutability.html
- We had a brief discussion on whether to use “type” or “interface” for object types. In recent versions of TypeScript, the difference between them ends up being really small: https://stackoverflow.com/a/37233777