3 ms·
I've skimmed over the book and I think it definitely needs more code examples and before and afters, because whatever little code I saw is unconvincing. In fac
by blub 7y ago
I've skimmed over the book and I think it definitely needs more code examples and before and afters, because whatever little code I saw is unconvincing.
In fact, when developing I don't want to think too much about mere data, I want to see the algorithms and data structures and even the overall program logic. Having to worry about each individual struct member, and whether those are used properly and kept in sync is a pain and is throwing away the brilliant idea of encapsulation.
The chapter on "managers" reads like a caricature of poor OOP practices, I don't quite understand how it's become a best practice in data-oriented design :)
All in all, this seems like a clumsy way of designing things.
- drainyard 7y agoThere's plenty of good talks and literature on the subject and why it is applicable to game development, but also more generally. This talk by Mike Acton (Formerly Insomniac now Unity): https://www.youtube.com/watch?v=rX0ItVEVjHc https://www.youtube.com/watch?v=rX0ItVEVjHc I recommend this talk all the time, since it is the one that got me convinced to look into DoD seriously. Also: More Mike Acton (now at Unity): https://www.youtube.com/watch?v=p65Yt20pw0g https://www.youtube.com/watch?v=p65Yt20pw0g Stoyan Nikolov “OOP Is Dead, Long Live Data-oriented Design”: https://www.youtube.com/watch?v=yy8jQgmhbAU https://www.youtube.com/watch?v=yy8jQgmhbAU Overwatch Gameplay Architecture and Netcode (More specifically about ECS): https://www.youtube.com/watch?v=W3aieHjyNvw https://www.youtube.com/watch?v=W3aieHjyNvw The main argument is that you work with data so you should care about data. All a program does is take some input, do something with it, and give you an output. If you structure your program around this mindset, a lot of problems become much simpler. Concurrency is one thing that becomes much simpler to reason about now that you understand how your data is managed and moved around. Realisations that most of the time you have multiple of something and very rarely do you have a single thing. So having a lot of small objects of the same type each doing some work within their deep call-stack, rather than running through an array of them and doing the work you need to do. I disagree that encapsulation is a brilliant idea _in general_, because it promotes hiding data, and hiding data is not inherently good. There's obviously cases, where there is internally critical, but since all your state is simply tables of data, your program is just choosing to represent that data in some way, which can make it easier to centralize a bug early. There's obviously pros and cons, but I don't think you should discount the possibility of it being a good idea just because it questions ideas that seem standard.