Jump to content
  • Advertisement
Sign in to follow this  
Morley

Storing Map Data

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

So I'm working on my own engine. I have all the rendering going fairly well so now I'm working on a basic world editor.

To create maps using the editor, I would like to save the coordinates of each object in to a file so that I might be able to redundantly use the 3D objects to lower the overall size of the game and to provide a better way for my rendering system to work (through prefabs)

Here's the problem: I don't know how to effectively store the data in a readable format at run time and load time. Should I use XML or try and figure how to make my own file type?

Opinions and discussion? Well aware that parsers are no fun in writing, but I expect this to be the most effective way. (Unless you has an alternative :) )

Any links to resources (specifically for this application) would be appreciated!

Morley

Share this post


Link to post
Share on other sites
Advertisement
Do whatever's easiest -- all that matters is that you can read and write it. There's no real magic in defining a file format.

Generally you'll want to have a format that is optimized or at least convenient for how your engine loads data. If XML is easy for you, then use XML. the primary strike against XML in general is that it more or less assumes that the data is hierarchical, that it can be very verbose, and that its usually several times, perhaps an order of magnitude, less space-efficient than binary formats. JSON and YML are some other structured markup languages that are easy, well-supported by libraries, and less verbose than XML. The advantage of these formats is that they can easily be read and edited with text-processing tools (including Diff and source control), while binary formats usually require specialized tools.

You could also adopt another standard format by importing it directly (say .fbx for 3D scenes) -- but the difficulty there is that some of these formats are poorly documented, if at all, designed for editing (rather than being specialized for "final" assets, as you may want), and you often can't really extend them if you want to be able to use all the normal tools.

Share this post


Link to post
Share on other sites
I have been very satisfied using JSON (I use jsoncpp) to store entity / prefab data.
I am not very interested in YAML for the time being. XML is a future option but I don't think it will buy me anything short term.

I store geometry data in binary only.
Everything is planned to ship in binary. I am having consistent difficulties in adopting well known formats, they often come with some rough corners.

Share this post


Link to post
Share on other sites
Thanks for the input guys!

I believe I'll have to be baking to .obj(or other natively supported format) for storing the actual models, but I suppose I'll be looking in to JSON and YAML for storing Map Data.

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!