Jump to content

  • Log In with Google      Sign In   
  • Create Account


Storing Map Data


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Morley   Members   -  Reputation: 111

Like
0Likes
Like

Posted 26 January 2012 - 06:17 PM

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
Morley

Aspiring programmer, modeler and game designer.

Sponsor:

#2 Ravyne   Crossbones+   -  Reputation: 7116

Like
0Likes
Like

Posted 26 January 2012 - 07:38 PM

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.

#3 Krohm   Crossbones+   -  Reputation: 3049

Like
0Likes
Like

Posted 26 January 2012 - 11:42 PM

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.

#4 Morley   Members   -  Reputation: 111

Like
0Likes
Like

Posted 27 January 2012 - 06:35 AM

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.
Morley

Aspiring programmer, modeler and game designer.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS