Data format: storing world object information

hi,

i’ve posted the following message before a couple of days to the old board. now that the old one is locked i’ll give my post another try:

i’ve finished work on my terrain rendering system.
it’s working quite well, and now i want to to populate the terrain with objects like landingpads, turrets, etc. i’m thinking about having an object-map which equals in size to the heightmap. this object map is basically an image holding coloured points that are representing the
object locations. this approach would require an editor to manage the object locations and attributes.
when saving the object map, i would parse the image an create mabey some kind of xml-format that includes all the assigned object-information.
then it would be easy to load the object map into
my terrain-app.

i just started programming in java and j3d and the terrain system soaked up a lot of my spare time the last couple of month :wink:

any help is appreciated…
thnx in advance…

holger

If you’re going to go from image to XML format to image to map, why not just use an XML document and go from that to locations on your map. This has the advantages that Java has excellent XML handling capabilities and maps very neatly to object data structures. It sounds like removing the image level is kind of an application of occam’s razor.

hi breakfast!

thnx for the reply. i think i didn’t expressed my thoughts very well in my initial post.
sorry, i’m no native speaker…
i thought about an editor to display the terrain-heightmap. then i have second image
layered above the height-image which is used to store the coloured points i
mentioned above. this would give me the possibility to set the points (which are substitutions for objects in my virtual world) to the locations on my terrain. this would be a intuitive way to edit/create an object map. now, when i’ve finished editing i would write a xml-format. i just had to parse the
height-map and the object-image to get information about:

  • the type (e.g. landingpad, turret etc) of the object. which is the color of the point in the object-image

  • the location in the world. which is the x,y position of the coloured point, z would be the value of the x,y point on the underlying height-map.

then i would write the xml-file, which contains this gatherd information.
reading this information back in my terrain-app and assign the values should be no
problem.

so basically this would be image to xml for writing/creating and xmt to object instance for reading.
i just want to now if this would be a suitable approach. or is there an easierer
way to go?

many thnx in advance…

holger

I think it is unnecessary for your image to do anything apart from match the location of user added objects with the shape of the ground. In this case, it’s existence is more a matter for the display element of the editor, which then converts everything to the storage format when editing is complete. While it is being edited you may as well keep all the objects being added in memory rather than trying to parse them back from the object image which still sounds a little difficult to me. If you are editing a huge area which will be too much to fit into memory at once then it may be easier to edit parts of it until you have something easier to handle.

any screenshots available?

[quote]In this case, it’s existence is more a matter for the display element of the editor, which then converts everything to the storage format when editing is complete.
[/quote]
yes, that’s what i’m thinking about.
do you mean this is a suitable approach?

[quote]any screenshots available?
[/quote]
here are some shotz:
pic1pic2pic3

Looks awesome! Any chance we can get a compiled copy for the code/app demo of the site?

:slight_smile:

-Chris

cool that you like it :smiley:

[quote]Any chance we can get a compiled copy for the code/app demo of the site?
[/quote]
no problem. give me a couple of days that i can put all the stuff needed into a zip.
i’ll let you know when it’s ready…

note: the implementation of the demo is far from
optimal, just a collection of hacks ;D

holger