• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
londer

object-oriented vs. data-oriented design?

9 posts in this topic

which one of these paradigms is better to follow in gamedev? or maybe both in combination?
1

Share this post


Link to post
Share on other sites
If you're familiar with object oriented-designs there should really be no reason for switching to data-oriented desings until you actually find a valid reason to do so, there's no reason to trouble yourself with adapting to a new paradigm or to try and combine the two if you don't have any problems with the paradigm you're currently using.

Data-oriented designs are all about shifting your focus from code to data, and they are often used to restructure code and data layout so they are more 'cache-friendly'. If you don't have any bottlenecks with data updates there's probably no reason for you to trouble yourself with trying to switch to a data-oriented design.

So basically, stick with what you know best. If what you know best one day doesn't cut it anymore for the problem you're trying to solve (and I think it'll be a long while before that day comes), consider switching to another approach.
2

Share this post


Link to post
Share on other sites
[quote name='londer' timestamp='1353364353' post='5002476']
which one of these paradigms is better to follow in gamedev? or maybe both in combination?
[/quote]

Use what's most appropriate for the problem you're trying to solve. It may be difficult to know which solution is "more appropriate" if you don't have the requisite experience. You can often use pure DoD and avoid OOP but you might have to work much harder to get the result you want. The same can be said of the other direction, but the cost of "work much harder" might appear to you in a different way. One may just be awkward to write the code for or you may have to write excessive amounts of code. The other may obscure the purpose of code unnecessarily or require extreme amounts of detailed knowledge to be able to use properly.

Data oriented designs can lend itself to very high performance code, but you need to do it correctly. OOP can make things more convenient, but you may end up with a monstrous hierarchy with strange dependencies. And you may have poor performing code.

Understand your tools well and use them wisely.
1

Share this post


Link to post
Share on other sites
I actual practice something I always thought of as "data oriented design" ... but it is not the same thing as what these other posters (and probably the OP) are talking about. When modeling and then designing my program, I feel in my heart that the "data" is the only true thing that absolutely has to exist in a computer. everything else are fictions invented for the programming. And as I model, I focus on the inherent association between different pieces of data among the "objects" in my model. I have a very "data model" oriented approach as I'm starting out. Usually even drawing up simplified ERD style diagram for the objects in my system. Then I attach the most fundamental API to these, based on the data they wrap and how they should "protect" it or what useful features they can expose. As I flesh out more and more functionality among the classes / objects in my hierarchy when I get confused in the mess of abstraction or complexity I may have created, I go back to basics and ask "which class owns the data?", "what do I need to do to that data?", "what methods should I add to do this?" - and "who should own that method?". And the "who should own" is usually based on what data is needed to drive the logic of the method.

For instance a generic "Board" class wouldn't know how to setup a chess game, because a board doesn't know the rules or pieces of chess. But a "ChessBoard", "ChessGame", "ChessGameEngine", etc ... would all be acceptable places to put this logic. Even though the data being written is probably "owned" by a "Board" object, the logic of doing so is not ... "Chess" is a board game, hence a client of the concept of a board.

Now my last sentence sounds all OO right? ... and it is ... but I got to that design from a data first process, that ENDS in OO, but doesn't start there.
1

Share this post


Link to post
Share on other sites
What's interesting to me is pointers applying to this:

If a lot of different parts of your program need certain data, You should try to seperate the data into the certain parts of it those classes need. Then, if there actually is shared data, you'll need a pointer. Now here's the problem: Which class actually holds the data? And to solve this, all I have to do is think:

Which class will need more (Ex: You have a Soundmanager Class and a SoundPlayer class. The Soundmanager class keeps track of sounds size, length, type, etc. while SoundPlayer plays it. Which one will need more of the actual data? Soundmanager, while all Soundplayer wants is the audio file, it doesn't care about the rest of the stuff you tie to itj.)
Which class will use it the most.

Now, you may say: But why can't Soundplayer just have the audio file and Soundmanager have the data. Well, how do you think SoundManager calculates the data? But wait: If all I want is for Soundmanager to have the data points, then I could just have SoundManager keep the actual audio file while Soundmanager uses a pointer to the file to get the information and store it. Problem Solved!

Many beginners don't see the importance of pointers, however they become needed when you have shared data (And dynamically allocated memory, however unless you're in a cutting edge game you generally don't need to utilize this because of the increase in size and decrease in cost of RAM.)
0

Share this post


Link to post
Share on other sites
... I'll just upvote hodgman.

[quote name='Xai' timestamp='1353464961' post='5002832']
Now my last sentence sounds all OO right? ... and it is ... but I got to that design from a data first process, that ENDS in OO, but doesn't start there.
[/quote]

There is a distinction to be made between "Data Oriented" and "Data Driven"; I think your post describes the latter, which is basically a facet of good OOD. Edited by Goran Milovanovic
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0