Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411613 Posts in 69390 Topics- by 58447 Members - Latest Member: sinsofsven

May 09, 2024, 07:49:59 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)More C++ bashing: Data-oriented design in game programming
Pages: 1 [2]
Print
Author Topic: More C++ bashing: Data-oriented design in game programming  (Read 8313 times)
GoGo-Robot
Level 0
**



View Profile WWW
« Reply #20 on: November 01, 2009, 04:26:25 AM »

It's all about knowing when to use each type of design. Yes, you could use data-oriented for everything, but surely the best solution is to use it for lower level areas which have a large amount of data to process (e.g. physics, rendering) and use OOP for the higher level, more conceptual parts, which aren't going to require a huge amount of calculations (e.g. game objects), which are used more for game world management. If you design your interfaces to each area correctly, then it should not matter how the underlying data is processed.

I think it's always going to be easier for a person to look and and understand something using OOP, as they can picture a single instance of the object and how it can be interacted with. As always, it's a trade off between how easy a program is to understand and how fast the program runs, so it's a case of knowing when you need to use data-oriented in high performance areas, and when you can use OOP to improve understandability of your code, and reduce the time it takes to write, debug and share.

Data-oriented design is just another tool you should be aware of, and the only way to know when you need to use it is through experience, the same as OOP. You need to consider what's right for you and, more importantly, the project.

Edit: Oh, and I don't see how this is C++ bashing. Also, the whole 60fps/30fps debate isn't really for this thread.
Logged

LemonScented
Level 7
**



View Profile
« Reply #21 on: November 01, 2009, 02:32:53 PM »

I think maybe it's only when you see performance problems that are cpu bound that you need to profile your game and then see if cache misses are a big problem in your case.

This is deeply wise, and I am in full agreement.

post

This, too. Sums up my thoughts more eloquently than I have been able to. There's nothing wrong with the approach described in the article, if you take into account the fact that a big part of writing good code is all about choosing the right tools for a particular job. I think the article perhaps put my back up a bit by overstating the usefulness or applicability of the approach, implying that we should all ditch OOP for this new paradigm, which is clearly bollocks. I say this with huge respect for Noel Llopis, and I'm sure he'd agree that data-oriented design not a silver bullet - he just worded the article as if he thought it might be one.
Logged

Pages: 1 [2]
Print
Jump to:  

Theme orange-lt created by panic