Netcode progress
May 18, 2024 • 2 min
- May 13: breakthrough! How client implements event update rollback now: undo the event updates (state changes) from now back to the server message's tick. Then apply the server's state from its event update. Then I gather all the flags that the undone event updates would have generated (flags are like there is a flag for bullet timer). If passed to the enemy update function or shape update function, a flag will enable the corresponding section of code that mutates the corresponding state variable. Then the client simulates forward in time for that enemy's shape and enemy component only and with those flags. This makes sure the enemy does a rollback and then only partially simulates (i.e. it only simulates things that were undone in the rollback). This might not always work so I may have to tweak it, i.e. if changing something that had no flag was actually necessary because the rollback enabled some flag that wouldn't have been there otherwise.
- May 15: portals implemented in mp (roughly), asteroid spawning fixed. School level working nicer in mp. Pid controller roughly fixed in mp.
- May 16: improve Lua cache with #define table if enabled. Trying to fix performance bottle neck. Also got macOS compile to work again.
- May 17: compiling on macOS to try to profile the multiplayer code with Xcode. In the process found that serialization or deserialization is not working on macOS properly. Trying to debug it by making a new unit test.
- May 18: cancellable run later system introduced for packet delays but it will be useful in the future for a lot of things.
- Summary:
- Lots of things need work with regards to event update replay.
- Experimenting with resimming per enemy by using flags that select which state should be changed while the enemy "thinks".
- macOS wip unit tests for multiplayer.