Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualOlof Hedman

Posted 14 October 2012 - 06:30 AM

Not on XNA RPG starter kit, but in genaral.
If the only difference between the objects is the data, it makes sense to write that class just once, and initialize it with different data.
The class itself would take that data in the constructor, so you could just have an init function initializing all your items.
But it makes sense though to keep the data separate in a file, for easy tweaking without having to recompile the game.
The style is called data driven programming.

For example when concentrating on game design, its useful to just focus on the data.

With xml you can define any kind of data, its human readable, and it's easy to write a parser for, using any of the available xml libraries. No need to invent something of your own design.
Maybe the biggest gain is though when your team expands, and it might not even be the same person responsible for the code and the data.
Also, maybe your graphics guy wants to help tweak the game data too, he will likely feel much more comfortable changing a few values in a text file, and just relaunch the game, instead of having to install the build environment and fiddle around in source files.

#1Olof Hedman

Posted 14 October 2012 - 06:02 AM

If the only difference between the objects is the data, it makes sense to write that class just once, and initialize it with different data.
The class itself would take that data in the constructor, so you could just have an init function initializing all your items.
But it makes sense though to keep the data separate in a file, for easy tweaking without having to recompile the game.
The style is called data driven programming.

For example when concentrating on game design, its useful to just focus on the data.

With xml you can define any kind of data, its human readable, and it's easy to write a parser for, using any of the available xml libraries. No need to invent something of your own design.
Maybe the biggest gain is though when your team expands, and it might not even be the same person responsible for the code and the data.
Also, maybe your graphics guy wants to help tweak the game data too, he will likely feel much more comfortable changing a few values in a text file, and just relaunch the game, instead of having to install the build environment and fiddle around in source files.

PARTNERS