Beating a dead horse... Max/Blender simple level editor?
- JustinWalsh
- OGRE Retired Team Member

- Posts: 209
- Joined: Mon Sep 05, 2005 8:11 pm
- Location: Phoenix, AZ
- Contact:
Beating a dead horse... Max/Blender simple level editor?
I have been browsing these forums and the wiki for a solution. I am new to OGRE and have ran accross my next stumbling point. It seems there are thousands of ways to get mesh data into ogre, My question is pretty simple.
What would be the best way to go about a very simple level? So lets say i design a level/mesh in blender. Then i export to whatever format is best suited. All I really need in my levels for them to be levels, is an XYZ cordinate for each enemy in the level. This is about as simple of a game level as i can think of. So i read you can use dotScene and a custom DTD file to export other things. But i do not see an example of such a thing... Or am i better off just loading in a simple text file kinda like this...
BlueBaddie 300.0 200.4 0.0
GreenBaddie 300.0 200.4 0.0
and just loading a level full of enemies like so? Then make a custom tool for plotting baddies?
Sorry for beatinga dead horse that has already been beaten to death, but if i can do this in MAX or Blender instead of writing a custom tool, it makes my life 9billion times easier.
What would be the best way to go about a very simple level? So lets say i design a level/mesh in blender. Then i export to whatever format is best suited. All I really need in my levels for them to be levels, is an XYZ cordinate for each enemy in the level. This is about as simple of a game level as i can think of. So i read you can use dotScene and a custom DTD file to export other things. But i do not see an example of such a thing... Or am i better off just loading in a simple text file kinda like this...
BlueBaddie 300.0 200.4 0.0
GreenBaddie 300.0 200.4 0.0
and just loading a level full of enemies like so? Then make a custom tool for plotting baddies?
Sorry for beatinga dead horse that has already been beaten to death, but if i can do this in MAX or Blender instead of writing a custom tool, it makes my life 9billion times easier.
- jacmoe
- OGRE Retired Moderator

- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
I think your best bet is to create a level in Blender - for things like triggers and enemies you could place placeholder meshes and use a naming convention.
Then, when you are done exporting it to meshes and .scene, either modify the DSI importer, or make your own - and parse your level accordingly.
The .scene exporter is plain python, so you could make it write your custom xml directly, if you want to.
Another idea is to study the Logic Panel in Blender (IIRC).
Then, when you are done exporting it to meshes and .scene, either modify the DSI importer, or make your own - and parse your level accordingly.
The .scene exporter is plain python, so you could make it write your custom xml directly, if you want to.
Another idea is to study the Logic Panel in Blender (IIRC).
- JustinWalsh
- OGRE Retired Team Member

- Posts: 209
- Joined: Mon Sep 05, 2005 8:11 pm
- Location: Phoenix, AZ
- Contact:
Well for the first time in my life i got Blender to work with Python WOOT!
But i just toyed around with the idea, and using logic this seams pretty easy to place things...
Using the Logic Panel you can add properties to anything in blender
then in your exported scene using the standard scene exporter you get a section like so...
<node name="Cube">
<position x="0.000000" y="0.000000" z="0.000000"/>
<rotation qx="0.000000" qy="0.000000" qz="0.000000" qw="1.000000"/>
<scale x="1.000000" y="1.000000" z="1.000000"/>
<entity name="Cube" meshFile="Cube.mesh"/>
<userData>
<property type="STRING" name="Type" data="Entity"/>
<property type="STRING" name="Script" data="Testing"/>
</userData>
</node>
So it seams that there is much power to be unlocked as a level editor.
but will the userdata section compile into the final .scene file?
As far as loading goes, what is the most stable .Scene loader? I was thinking of modifying the dotsceeneoctree loader to account for my new data... Or maybe just use the octree and parse the file, then use my custom parser and run through the file again to set up my enemies triggers etc. Any suggestions as to the best way to load?
But i just toyed around with the idea, and using logic this seams pretty easy to place things...
Using the Logic Panel you can add properties to anything in blender
then in your exported scene using the standard scene exporter you get a section like so...
<node name="Cube">
<position x="0.000000" y="0.000000" z="0.000000"/>
<rotation qx="0.000000" qy="0.000000" qz="0.000000" qw="1.000000"/>
<scale x="1.000000" y="1.000000" z="1.000000"/>
<entity name="Cube" meshFile="Cube.mesh"/>
<userData>
<property type="STRING" name="Type" data="Entity"/>
<property type="STRING" name="Script" data="Testing"/>
</userData>
</node>
So it seams that there is much power to be unlocked as a level editor.
but will the userdata section compile into the final .scene file?
As far as loading goes, what is the most stable .Scene loader? I was thinking of modifying the dotsceeneoctree loader to account for my new data... Or maybe just use the octree and parse the file, then use my custom parser and run through the file again to set up my enemies triggers etc. Any suggestions as to the best way to load?
-
reimpell
- OGRE Contributor

- Posts: 570
- Joined: Mon Mar 01, 2004 10:35 am
- Location: Hamburg, Germany
- JustinWalsh
- OGRE Retired Team Member

- Posts: 209
- Joined: Mon Sep 05, 2005 8:11 pm
- Location: Phoenix, AZ
- Contact:
So lets say I just use the Generic Scenemanager and the DotSceneInterface to load up my mesh data into the world. Then Still using the DSI i load up any camera's etc. Now i Run a custom parser whoes purpose is to just look for the userData that is exported from blender to set up anything additional i might be useing this for? Would that be the method of choice? Or when makeing the exporter did you have something else in mind?
-
reimpell
- OGRE Contributor

- Posts: 570
- Joined: Mon Mar 01, 2004 10:35 am
- Location: Hamburg, Germany
- griminventions
- Halfling
- Posts: 52
- Joined: Sat Oct 29, 2005 7:02 am
- Contact:
-
Rackle
- Gnome
- Posts: 375
- Joined: Sat Jul 16, 2005 1:42 am
- Location: Montreal
I've started using the dotSceneOctree pluging from the ogreAddons. I used the code within ogreAddons/dotSceneOctree/samples/dotScene/include to create my own application.
I created my level with Blender, three corridors arranged in a U-shape. This information was exported with ogreNew/tools/blenderExport/ogreExport.py and ogreAddons/blenderSceneExporter/ogreDotScene.py.
The .xml scene (often called a dotScene or .scene file) was compiled with ogreAddons\dotSeneOtree\Tools\ExampleSceneConverter\bin\release\sceneConvert.exe to generate a .bin file.
My only problem was with the scale of things. I imported the robot.mesh into Blender with ogreAddons/blenderImport/ogre_import.py and found it to be 100 units high. So I made my walls 100 units high and my floors 400 units wide; these values are good enough to start with.
I created my level with Blender, three corridors arranged in a U-shape. This information was exported with ogreNew/tools/blenderExport/ogreExport.py and ogreAddons/blenderSceneExporter/ogreDotScene.py.
The .xml scene (often called a dotScene or .scene file) was compiled with ogreAddons\dotSeneOtree\Tools\ExampleSceneConverter\bin\release\sceneConvert.exe to generate a .bin file.
My only problem was with the scale of things. I imported the robot.mesh into Blender with ogreAddons/blenderImport/ogre_import.py and found it to be 100 units high. So I made my walls 100 units high and my floors 400 units wide; these values are good enough to start with.
- griminventions
- Halfling
- Posts: 52
- Joined: Sat Oct 29, 2005 7:02 am
- Contact:
That sounds cool, Rackle. Thanks for the pointers to each tool, that's especially useful. 
Do you have to split the mesh by hand to benefit from the octree? For instance, if you just create a huge mesh, it will render the whole thing (ie, the octree node will enclose all the geometry). But if you have placed smaller meshes within your halls, for example (ie, the way Unreal Tournament uses detail meshes), would those objects be separate octree child nodes and thus get culled properly? So would you create a separate mesh for each hall so that each hall would be placed in an individual node with its contents instead of one node with 3 halls and all the contents together? (Hope that makes sense.)
Hmm. I think I just need to understand how blender handles meshes and how that translates into Ogre nodes. I'm curious what amount of hand-tweaking is necessary to allow the octree to do its job.
Do you have to split the mesh by hand to benefit from the octree? For instance, if you just create a huge mesh, it will render the whole thing (ie, the octree node will enclose all the geometry). But if you have placed smaller meshes within your halls, for example (ie, the way Unreal Tournament uses detail meshes), would those objects be separate octree child nodes and thus get culled properly? So would you create a separate mesh for each hall so that each hall would be placed in an individual node with its contents instead of one node with 3 halls and all the contents together? (Hope that makes sense.)
Hmm. I think I just need to understand how blender handles meshes and how that translates into Ogre nodes. I'm curious what amount of hand-tweaking is necessary to allow the octree to do its job.
- jacmoe
- OGRE Retired Moderator

- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
- griminventions
- Halfling
- Posts: 52
- Joined: Sat Oct 29, 2005 7:02 am
- Contact:
- jacmoe
- OGRE Retired Moderator

- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
-
Oogst
- OGRE Expert User

- Posts: 1067
- Joined: Mon Mar 29, 2004 8:49 pm
- Location: the Netherlands
- x 43
- Contact:
For level editing I chose 3dsmax for my game and I made my own simple linked scene file-format for this. It is simply a text-file, like what was shown in the topic start. To get custom stuff like triggers, I added some custom objects to 3dsmax, so now 3dsmax knows what CRSound- en CRBoost-objects are and I can place them in my scene. Works well, I think, and I am sure all of this can be done in Python just as well.
The hardest part of doing this, was getting the Ogre-exporter to export all the single meshes in the scene from script-calls. This works now, so my own exporter calls the Ogre-exporter for every mesh in the scene.
The hardest part of doing this, was getting the Ogre-exporter to export all the single meshes in the scene from script-calls. This works now, so my own exporter calls the Ogre-exporter for every mesh in the scene.