3 ms·
The author seems to be amused by ECS idea in general and doesn't go too deep into the questions surrounding it (like, safe parallel processing of systems). I wo
by kvark 11y ago
The author seems to be amused by ECS idea in general and doesn't go too deep into the questions surrounding it (like, safe parallel processing of systems). I wonder what are these 25 scrapped designs/architectures that they tried...
- bitwize 11y agoSystems operating on the same frame can run in parallel with a simple double buffering scheme. That is, have two copies of the game state: one "current" and one "next"; and all updates go to the "next" copy. After the current frame is rendered, the buffers switch roles: next becomes the new current and current becomes the new next. That way, the "current" view of the game state never changes and multiple threads can work with it in parallel. Race conditions may still occur if multiple systems update the same bit of data in "next" but if your systems are well divided then this is unlikely or irrelevant and may be mitigated using locks with far less resource contention than everybody updating the same state vector they're reading. Double buffering is easy to do in an ECS; not so much with the time-honored LOO (List of Objects) architecture.
- agentultra 11y agoNaughty Dog also presented some stuff at GDC this year wrt. parallelizing their game-engine using "fibers"[0]. It sounded a lot like present implementations of co-routines with some hardware support for swapping stacks around to different cores on the PS4 processor. It appears that such a design could mitigate most resource sharing issues with traditional threads. [0] http://gdcvault.com/play/1022186/Parallelizing-the-Naughty-Dog-Engine http://gdcvault.com/play/1022186/Parallelizing-the-Naughty-D...