4 ms·
I've seen Jason Gregory talk about per frame arenas in Game Engine Architecture as a fundamental piece of how the Naughty Dog engines tend to work. Totally agr
by monocasa 7y ago
I've seen Jason Gregory talk about per frame arenas in Game Engine Architecture as a fundamental piece of how the Naughty Dog engines tend to work.
Totally agreed that they aren't required for shipping great console games (and they're really hard to use effectively in C++ since you're pretty much guaranteed to have hanging references if you don't have ascetic levels of discipline). This is mainly just meant as a "here's an example of how they can be used and are by at least one shop".
- foota 7y agoSeems like this could be handled with a wrapper type with runtime checks during debug? Like make any pointer to the per frame allocation be a TempPointer or something and then assert they're all gone with a static count variable of them? Then you just have to be cautious whenever you pass a reference to one or convert to a raw pointer. I don't think this would be too awful for performance in debug builds.
- monocasa 7y agoYeah, or a generation system where the pointer holds a frame count too that's asserted on deref. The point though is that it's a step back still from shared_ptr/unique_ptr by becoming a runtime check instead of compile time.