Multi-Threaded Pipelined Game Engine Data Synchronization Questions
- by Douglas
Let's say I'm setting up a worker pool based game engine with pipelining. Let's say I have 4 stages in my pipeline as such:
Stage 1: Physics
Stage 2: AI/Input
Stage 3: Game Logic
Stage 4: Rendering
Now let's say that the physics detects a collision between a bullet and a character in stage 1. Two frames later the game logic may choose to remove that bullet from the simulation, however none of the other copies of the data for the other pipeline stages will get this information. How is this sort of thing and other things like it get handled? Do you generally make changes like this to every pipeline stage's data at the end of a frame?