Advertisement Jump to content
Sign in to follow this  
dworm

what you suggest for manipulating data in a game? (c#)

This topic is 1837 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

ok first of all im a beginner with no experience in game programming.

im still learning and making tutorials every day in my process to understand c#

 

ok here is my question, what is the "best" (or most convenient) way to handle game data?

for example i have a classic battlefield which is basically a n X n square, is it convenient to use sql or just an array is enough and more fast?

 

what if i have dynamic database? for example if i make an RTS(no im not even thinking of making one, dont worry :D ) the unit list would be changing in number (when i create or destroy them) and maybe even changing in data (upgrade units, damage them etc)

is in this case best to go sql or again just a simpler solution would be enough?

 

what you suggest as general rule of thumbs for a general basic enviroment(map+ entities+entities stats) ?

Share this post


Link to post
Share on other sites
Advertisement

first, if you wanna update these infomation(unit lost, damage change, hp change...) you can just do it in your game, no need to save them into database.

second, sometime you want to save these infomation(player want to save game) you can save them to text file, or binary file, database system is not needed.

in case i dont understand your question :D and you really want to save your data while game is running. i think it's impossible. because every frame, your game changes(unit move, fight, ....) and you must query EVERY frame, which intensely rape your fps.

Share this post


Link to post
Share on other sites

first, if you wanna update these infomation(unit lost, damage change, hp change...) you can just do it in your game, no need to save them into database.

second, sometime you want to save these infomation(player want to save game) you can save them to text file, or binary file, database system is not needed.

in case i dont understand your question biggrin.png and you really want to save your data while game is running. i think it's impossible. because every frame, your game changes(unit move, fight, ....) and you must query EVERY frame, which intensely rape your fps.

 

thnx very much this answer a good part of the question, so basically you say querying is too heavy for a game and it can be easily handed elseway

 

ok i think i got it but then what should i use? is the same thought applied to LINQ ?

Share this post


Link to post
Share on other sites
I'm sure not. My advice right now: learn the language more, learn about file handling, how it works and what you can do with it and forget about databases.
That is an own topic which you should first handle after you understand how programming works in is simplest ways!

Share this post


Link to post
Share on other sites

well i never thought of stopping to learn the basics i miss or even to keep learning to improve the (few) things i know

 

i just wanted some objective to look forward instead of just keeping to learn and learn abstract stuff...

 

but thnx anyway for your suggestions

Share this post


Link to post
Share on other sites

Personally, most of my experience is actually database experience, and unless you are able to think a lot better in databases and use those to define your objects or components if you are doing component entity design, I agree that skipping the database would be best. I haven't actually worked on an MMO, but that would be the best reason to use a database from my own understanding.

 

Programming is not just the language, but the concepts that make the language possible. If you want something dynamic I actually recommend XML for the save format, as it is easy to learn and use and very dynamic. Just make sure to properly define each item that goes in so that you can parse it out.

 

Otherwise, I recommend reading up on data structures to get an idea of ways people store things and why they do.

Share this post


Link to post
Share on other sites

thnx

im keeping to read stuff on msdn and around about this topic in these days

 

its just that i wanted to "unabstract" a bit my learning experience trying to focus on something a bit more concrete cause you know it gets boring after weeks of reading new stuff you only try to understand and memorize, sometime you feel the need to try and *do* something even if i get this might be a long step atm

Share this post


Link to post
Share on other sites

Sounds like you want to read about and learn to use the various containers provided by the language.  For C# see:

 

http://msdn.microsoft.com/en-us/library/system.collections.generic(v=vs.110).aspx

 

This also requires learning how to use generics (otherwise known as templates in the C++ world).

 

Those collections/containers allow you to add and remove items from them dynamically.

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!