Scenes vs xml configuration

So, I want to be able to configure each level of my game via xml -specifying placement of meshes (roads and buildings), powerups etcs.



BUT at the moment I’m unsure if I should be configuring meshes within a scene defined in blender?



How should I approach this? Should I build a scene in blender for each level? Or should I use my own proprietry xml file to define this information (other game specific config is also needed)



Many thanks!

Whatever fits you best, both approaches are possible.

As its best to convert mesh/model data to j3o files first it makes sense storing the information there right away as j3o files represent a whole scenegraph with all its configuration. So why create it from an xml file when you can directly store all information in the j3o?

i done this, but i dont use it :smiley:

for example

[java]<objects>

<object id="loginsceneobj1" src="/Models/xml/tree1.xml" rotation="2.5" x="1" y="1" z="6" terraininfluenced="true"/>

<object id="loginsceneobj2" src="/Models/xml/tree2.xml" rotation="80.1" x="-22" y="10" z="6" terraininfluenced="true"/>

<object id="loginsceneobj3" src="/Models/xml/stone.xml" rotation="80.8" x="-12" y="20" z="6" terraininfluenced="true"/>

<object id="loginsceneobj4" src="/Models/xml/wall_pikes.xml" rotation="80.8" x="-32" y="30" z="6" terraininfluenced="true"/>

</objects>

[/java]

where object xml contains information about object too(becouse j3o cant have all informations what i need).



i use servers to send information about where are objects, and just load xml files contains additional informations for j3o and path for loading j3o(or more of them for one object - somethin like character + weapon / armor / etc).



so you can do everything what you need. You must just work, dont be lazy :slight_smile:



remember SDK give you tool to create scenes too, so if you dont need to create your own way, use it!

@oxplay2 said:
(becouse j3o cant have all informations what i need).

That is nonsense, j3o can store way more information than OgreXML, its the complete scene graph with all UserData, Spatials, Meshes etc etc etc.

I would think that XML would be the way to go. Not all objects in a scene have a visual component… but still have physical attributes (like coords, etc)



For instance:



A spawn point has no graphical representation, however does have coords, a spawn list (of potential NPCs), default pathing info, etc, etc.



How would one go about using the scene composer for this type of information? Atm, I build out zones by reading in XML configuration files for:



Zone attributes

Points of interest for AI pathing helpers

NPC lists

Spawn points

Item and loot tables

Harvest spawn points



And the list continues… Since nothing exists prior to random spawning (handled by spawn points), I don’t see how I could use the scene composer for this.

I do not disagree that using separate data makes sense, most probably you would end up using a proper database anyway. For that you can also use the assetManager, as said the loader can later be changed w/o changes in the game code. I was just saying that you can store anything in a j3o. Also you might want some visual cues when you edit the spawn points or whatever anyway, so why not join this part with the visual editing? Their location will always depend on the actual level layout (which you will most probably want to edit visually at least to a certain degree). Look for example how I do spawn points with the SceneComposer for my game here: http://hub.jmonkeyengine.org/groups/free-announcements/forum/topic/powermonkey/#post-159693

1 Like

@normen Ok… now that’s cool



If I wasn’t such a tard, I would be doing that. Why can’t you be bigger, brain??