8 ms·
And the notion that a garbage collector should ever be part of a game engine (or anywhere near it) is frankly baffling to me. .. unless you're making some turn
by RayDonnelly 8y ago
And the notion that a garbage collector should ever be part of a game engine (or anywhere near it) is frankly baffling to me.
.. unless you're making some turn based thing.
- RayDonnelly 8y agohttps://youtu.be/NF6kcNS6U80?t=1000 https://youtu.be/NF6kcNS6U80?t=1000
- pjmlp 8y agoMy games development experience is quite irrelevant, however Tim Sweeney and John Carmack might know a thing or two about game engines. "The Next Mainstream Programming Languages: A Game Developer's Perspective" by Tim Sweeney http://www.cs.princeton.edu/~dpw/popl/06/Tim-POPL.ppt http://www.cs.princeton.edu/~dpw/popl/06/Tim-POPL.ppt https://wiki.unrealengine.com/Garbage_Collection_Overview https://wiki.unrealengine.com/Garbage_Collection_Overview "Considering that 8 bit BASICs of the 70s had range checked and garbage collected strings, it is amazing how much damage C has done." John Carmack - https://twitter.com/id_aa_carmack/status/329210881898606593 https://twitter.com/id_aa_carmack/status/329210881898606593 Quakecon 2013 keynote section about GC https://www.youtube.com/watch?v=1PhArSujR_A&feature=youtu.be&t=1443 https://www.youtube.com/watch?v=1PhArSujR_A&feature=youtu.be...
- undefuser 8y agoHonestly, this is a poor argument. While both Tim Sweeney and John Carmack are legends of the gaming industry, their opinions are still should be taken with a pinch of salt. Here's why: both Unreal Engine 3 and Unreal Engine 4 are giant OOP behemoths that powers sluggish games and sluggish editors. They consume a rediculous amount of memory, especially in large projects. Even in the slides you linked, they admitted that there is no obvious way to optimize the engine or scale it over multiple cores, because its performance suffers from death by a thousand cuts. Recently Epic spent a huge amount of time trying to optimize their garbage collector, which, arguably, without it they could have better spent the man hours elsewhere. And then there's the new network replication blueprint which is designed to overcome OOP performance issue. And Tim Sweeney swears by OOP. All of these while the industry is moving more and more towards Data Oriented design. Regarding John's tweet, an interesting question was that could he have built the successful Doom games with BASIC? Most likely no.
- pjmlp 8y agoWell, I would gladly like to know which other game engines, using beautiful Data Oriented design, free of OOP cruft and GC as you put it are able to beat Unreal at this. "A Star Wars UE4 Real-Time Ray Tracing Cinematic Demo" https://www.youtube.com/watch?v=lMSuGoYcT3s https://www.youtube.com/watch?v=lMSuGoYcT3s "Siren Real-Time Performance" https://www.youtube.com/watch?v=9owTAISsvwk https://www.youtube.com/watch?v=9owTAISsvwk After all, it should be relatively easy to challenge such giant bloated sluggish behemoth OOP engine. As for BASIC, probably. If John made use of a proper BASIC compiler for MS-DOS like PowerBasic, nee TurboBasic, with the right set of compiler flags. Naturally it would also have its share of inline Assembly, just like Doom, as every owner of "Zen of Assembly Language" first edition knows that C and C++ compilers for MS-DOS weren't the speed daemons developers nowadays taken them for. You should spend some time learning how AMOS used to be loved on the Amiga Demoscene back in the day.
- undefuser 8y agoNot surprised to see such things created with Unreal because they have loads of money and man power to throw at problems. But then again the 2 examples you show does not really fairly represent anything, because the raytracing demo uses super expensive Nvidia hardware that not many people can touch, the second demo also requires specific mocap hardware and there's only one character active in the whole scene. Data oriented is still relatively new, give it some time. But I would say if Unreal 4 was written with data oriented design in the first place, it would have been much better, at least performance wise. Even if it is a mixture of OOP and DOD, no one says you cannot do that. It was a lost opportunity. Working with it right now is a pain, really. After all, if the engine's performance is already so great, why did they need to spend so much time fixing performance problems in their latest releases? If you want to see what data oriented design can do, with regards to games, you can check out Unity's lastest show of their beta ECS and Job systems. And their custom C# compiler called Burst. Essentially sidestepping the Garbage collector, compile away many of C# safety features, like bounds check, under specific conditions. While processing entities in straight array iteration fashion. All in the name of performance, undoing the damages caused in the past. I guess you know that newer generations of CPUs require effective use of the cache as well as multithreading to extract the full power out. At least Unity technologies should be applauded for trying to do that, and for trying to bring it to the mass. I'm pretty sure that many game engines do use data oriented design to some capacity, especially those that used to run on PS3. But just because they are not available off-the-shelf, no source code to look at, doesn't mean they don't exist. Off the top of my head is Insomniac Games, arguably successful studio which is also a strong advocate of DOD. All this is to say that there are times when even the legends hold questionable beliefs, which we should take with a grain of salt.
- peterashford 8y agoI'm not sure if you were making a point about Java... but: you can effectively run Java without GC. If collection pauses are an issue you can preallocate everything and ensure no significant GC at runtime.