Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (636)
Games in Android Showcase (178)
games submitted by our members
Games in WIP (685)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Data format: storing world object information  (Read 3876 times)
0 Members and 1 Guest are viewing this topic.
Offline desertrock

Senior Newbie

« Posted 2002-10-16 18:45:15 »


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

Offline Breakfast

Senior Devvie

for great justice!

« Reply #1 - Posted 2002-10-16 19:45:50 »

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.
Offline desertrock

Senior Newbie

« Reply #2 - Posted 2002-10-17 10:47:05 »

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

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

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Breakfast

Senior Devvie

for great justice!

« Reply #3 - Posted 2002-10-17 18:14:06 »

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.
Offline snak

Senior Newbie

Eu não falo o português

« Reply #4 - Posted 2002-10-17 19:20:21 »

any screenshots available?
Offline desertrock

Senior Newbie

« Reply #5 - Posted 2002-10-18 18:53:44 »

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.

yes, that's what i'm thinking about.
do you mean this is a suitable approach?
any screenshots available?

here are some shotz:
Offline ChrisM

JGO Knight

Medals: 8
Projects: 1
Exp: 14 years


« Reply #6 - Posted 2002-10-18 19:22:20 »

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



Offline desertrock

Senior Newbie

« Reply #7 - Posted 2002-10-19 15:19:28 »

cool that you like it  Cheesy

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

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  Grin


Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Dwinin (59 views)
2015-11-07 13:29:08

Rems19 (72 views)
2015-10-31 01:36:56

Rems19 (63 views)
2015-10-31 01:32:37

williamwoles (101 views)
2015-10-23 10:42:59

williamwoles (87 views)
2015-10-23 10:42:45

Jervac_ (102 views)
2015-10-18 23:29:12

DarkCart (128 views)
2015-10-16 00:58:11

KaiHH (112 views)
2015-10-11 14:10:14

KaiHH (148 views)
2015-10-11 13:26:18

BurntPizza (162 views)
2015-10-08 03:11:46
Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48

Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!