Hacker News new | ask | show | jobs
by kfarr 1739 days ago
Thanks Dustin for the awesome writeup! Event-based also seems easier to animate in a 3D engine (pseudocode is simply "move that entity x units in y seconds") compared to constantly updating positions based on the simulation which is more akin to relatively complicated multiplayer gaming challenges to keep multiple entities in sync.
1 comments

Thanks for reading! I think rendering vehicles following each other would still require asking the simulation for positions, unless you replicate the logic in the "Exact positions" section. How would multiplayer synchronization factor in? That's an issue when multiple different clients in a network are all sending input to move something. Here we just have a single thread on one machine running the simulation. The simulation state could be broadcast over a network and rendered elsewhere, and there's still not any synchronization problems, because there's one source of truth.
Ah you're right, the vehicle queuing behavior is more complicated than the peds and I hadn't read that in enough detail.

Yes, agreed the state could be broadcast and that would not be nearly as complicated as multiplayer sync'ing.