Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

ed091maf

Storing level data

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

well this is quite simple,
make three base classes TUnit TTile and TBullet, now derive all Units from TUnit etc...
if you use a linked list for the units, you save them like this

TUnitfleet::save(char*filename)
{
ofstream data(filename,ios::binary)
TUnit *P=items
TUnit hulp;
while (P!=NULL)
{
hulp.X=P->X;
hulp.Y=P->Y;
//etc.


data.write((char*) &hulp,sizeof(hulp));
P=P->NEXT;
}
}

load is vice verca !
you do the same for tiles and bullets

if you don't succeed, Email me. I'll sent you the code of my save/load routine

happy coding

Aries...

------------------
Programming is an art

Share this post


Link to post
Share on other sites
Advertisement
ill take a look at that code if you could email it to me...im currently working on loading, saving routines.....thanx in advance

Share this post


Link to post
Share on other sites
Guest Anonymous Poster

Check out Wotsit's file format site:

http://www.wotsit.org/

Look under the game format section, and get the files listed
under C&C and warcraft, if you into those kind of games. They
contain very detailed listings describing how they save their
map data and level data.

Some interesting stuff.

Cronus

Share this post


Link to post
Share on other sites
I am developing RTS tilebased game. Now i'd like to ask some people that have already done such kind of games, what is one of the most efficient ways of storing data of your level? Are there any references in the internet?


Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!