• Advertisement
Sign in to follow this  

Saving and loading the different maps to and from external files

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

Hey all,

After designing a global structure for my program, I am now trying to figure out which resourses I will need.
The program's static core will be written in C++.

I want to save different maps in external files, for obvious reasons. A map file should not only contain the coordinates of, for example, a door, but also a link to a function call in a Lua file, when a specific trigger is caused. An example map with only one object:

Object: Door
Position_x: 2345
Position_y: 3345
OnOpen: door7654.lua->OnOpen()
OnClose: door7654.lua->OnClose()

Every object in a map will have it's own Lua file with it's own functions. This way it will be easy to create a map maker. The Lua function will handle the trigger.

The question I have is:
Is there a file type that is suitable for this?

I find it an ugly idea to just take a .txt file and type in text like this, and then create my own reader for it. I am sure there are many file types ready for me.

Thanks in advance,

Aart Stuurman

Share this post


Link to post
Share on other sites
Advertisement

The question I have is:
Is there a file type that is suitable for this?

Lua itself makes a very reasonable data description language.

Share this post


Link to post
Share on other sites
The question I have is: Is there a file type that is suitable for this?
Maybe JSON. Or YAML. Or XML. Or perhaps lua itself like edd notes.
But I still don't understand what's the real deal with those text files. I'd just write everything in binary. Last time I had looked at the text description of a level script it was like 5000 lines long.

Share this post


Link to post
Share on other sites
Okay thanks. I will try some of those and look into some articles on binary maps.

-Aart

Share this post


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

  • Advertisement