Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (495)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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 3433 times)
0 Members and 1 Guest are viewing this topic.
Offline desertrock

Senior Newbie





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

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
Offline Breakfast

Senior Member




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
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
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Breakfast

Senior Member




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 »

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.

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

here are some shotz:
pic1pic2pic3
Offline ChrisM

JGO Coder


Medals: 3
Projects: 1
Exp: 14 years


Luke...END OF LINE


« 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?

Smiley

-Chris

Offline desertrock

Senior Newbie





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

cool that you like it  Cheesy

Quote
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

holger

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

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Dwinin (28 views)
2014-09-12 09:08:26

Norakomi (57 views)
2014-09-10 13:57:51

TehJavaDev (74 views)
2014-09-10 06:39:09

Tekkerue (37 views)
2014-09-09 02:24:56

mitcheeb (57 views)
2014-09-08 06:06:29

BurntPizza (44 views)
2014-09-07 01:13:42

Longarmx (28 views)
2014-09-07 01:12:14

Longarmx (34 views)
2014-09-07 01:11:22

Longarmx (34 views)
2014-09-07 01:10:19

mitcheeb (40 views)
2014-09-04 23:08:59
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org 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‑gaming.org
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!