Jump to content
  • Advertisement
Sign in to follow this  
Lord_Danny

Data Driven Game Programming

This topic is 2508 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys,

can someone tell me how a Data-Driven programming can be an advantage? As far as I know, Data-Driven programming means that I load in a text file with a set of varibles that can be used in the game? How can this be useful? Can someone give me an example in a situation where a game will be better off by doing Data-Driven Programming?

Thanks

Share this post


Link to post
Share on other sites
Advertisement
Well, if you're making a platform game and you want to have different levels then a data driven program is really handy. Because you can generalise a level class and then load the specifics from the datafiles. That way you don't need to program each level independently.


while( game is running ){
if( change level )
load( level) // loading data from data file
input( level )
logic( level )
render( level )
// and everything else in your game loop.
}


So a data driven model cleans up your code a lot and you don't need to hardcode everything. It can also be used for other things except levels. You can have a list of spells in one file and if you want to add another you can just edit the file add a new one and you're finished. This also saves time with compiling, you don;t need to recompile if some data has changed.

Those are some benefits I can think of. Hope this helped you

Sepii

Share this post


Link to post
Share on other sites
It's the ability to change things about your game without having to modify the game code itself. Let's say your game has 10 different weapons. You should detail all your weapon data in files loaded by your program. That way, when testing, if your shotgun doesn't have enough force, just modify the file, and run the game.

Or, you have a load of enemies, and you can load them from these files, and make changes to their core data on-the-fly.

I personally use xml to store this information, and use tinyxml to parse it for me

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!