# (game content) positionning objects in your scene

This topic is 4268 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi! - This thread isn't about matrices and such 3D positionning at all - I want to ask people out there: what method/software do you use to set positions in a world, say for example, the player's starting position ? Let's say you built your level using Max (which is just static geometry). I dont think you could just write down coordinates from Max down to a paper and copy them to your code, that would be a pain to position hundreds of objects. So do you deal with max script ? Do you have your own level editor (waow!), or do you use any third party level editor compatible with your level-mesh ? I was thinking of creating a basic object editor based on XML files. I could define a set of property, like for example life points, magic points, and so on. But how about position ? If the point of this thread isnt clear, I'll try to rephrase it. Thank you Janta

##### Share on other sites
The most common approach is to do level design in a custom level-editor tool; most of the time there are things you want to be able to do (like putting in traps, monsters, or whatever) that just aren't sensible to try and do from Max.

For really complicated games, it is also pretty common to export the geometry from Max into a temporary format, which is then used by a level editing system to do things like place objects or whatever. It's also fairly common for the actual game to use its own coordinate system quite separate from Max's, especially when the art is complicated and has to be baked down/mesh-optimized before use in the game itself.

Honestly, though, it largely depends on the game. If you're doing a 3D chess title and your Max scene consists of the chessboard, a level editor isn't really all that useful [wink]

##### Share on other sites
Thanks. To be honest I didnt expect to have to create a level editor ;) I'm not trying to create a chess game though, so I guess I wont cut it.

The thing I find quite difficult, despite I planned many aspect of my game engine, is that I cant test it until I get some data to feed it with, and I cant have data if I dont have a tool to create it, but if I want such a level editor, it would probably reuse the game engine part, and so on. I mean, It's like everything has do be done at the same time and I dont see how to adress that. Maybe adopting an incremental strategy insted of directly aiming at the hardest stuff from the begining.

BTW, I didnt get many replies. Is that because this thread ins not interesting (i can live with that ;) or because most people never get to the point of actually creating game content (I read that so many people are making 'their engine') ? Maybe I wont make it to that point either but I'm trying to think about it now nonetheless.

Maybe this topic would be more intersting if I extend it to a more general 'game content creation' question ?

Cheers,
Janta

##### Share on other sites
Remember that ultimately a level editor only exists to allow easy creation and editting of a data file. A good place to start would be manually writing a human-readable data file in your favorite text editor. INI or XML would be good formats to look at. You could have something like this:

world1.xml
<Entities>    <Entity name="House" model="House.x"  position="..." rotation="...">        <Entity name="West Door" model="Door.x" onclick="openDoor.py"  position="..." rotation="..."/>        <Entity name="East Door" model="Door.x" position="..." rotation="..."/>    </Entity>    <Entity name="Monster1" model="Robot.x" position="..." rotation="..."/>    <Entity name="Monster2" model="Robot.x" position="..." rotation="..."/>    <Entity name="Monster3" model="Banshee.x" script="ActCrazy.py" position="..." rotation="..."/></Entities>

Your game could then read the file and create the level. After you've perfected the file format and you're making good progress on your game, you could think about building a fancy level editor that manipulates your XML/INI files.

- Mike

##### Share on other sites
Quote:
 The thing I find quite difficult, despite I planned many aspect of my game engine, is that I cant test it until I get some data to feed it with, and I cant have data if I dont have a tool to create it, but if I want such a level editor, it would probably reuse the game engine part, and so on. I mean, It's like everything has do be done at the same time and I dont see how to adress that. Maybe adopting an incremental strategy insted of directly aiming at the hardest stuff from the begining.

The level editor doesn't need to use all the engine features, not from the beginning anyway. You must think what are the really essentials you need to make the tool work, not look good. If you need to place enemies in the map, the editor doesn't have to be able to render them using skeletal animation and whatnot, you can represent them with red boxes or something like that. You don't need to render the walls with bumpmapping, simple texturing will do. When you have a simple functional tool that allows you to create levels, you can test your engine. From there on, using the latest update of the engine in the editor is a piece of cake.

Another thought would be to first define your own format, and then write an importer for an already established format, for example Quake3 levels(it's not that hard). Using that, you can load Q3 levels and render them with your engine, so you'll have professional content to test it.

##### Share on other sites
Another simplistic approach is to use 'dummy-objects' in Max. Simply draw a box where you want your player to start, make sure the geometry of the box isn't exported but the transform is, and give it a unique name like "player_start". Then, in your importing code, just look for a node with name "player_start" and record it's transform (or position if you don't care about orientation).

##### Share on other sites
You could always make your level editor and the game engine be the same program.
Thats what I did, saves the work of making a separate program...
Basically level editing is a lot like the game itself where you move around in first person view, except you get the ability to extrude polygons from walls, drag vertices, etc.

##### Share on other sites
Alternatively you can use one of the level editors created for other programs, such as DeleD or GtkRadiant. There's even a game out there that uses the Aurora Toolkit from Neverwinter Nights for its level editing, iirc. The downside is that unless you can/will write an exporter, you will be locked into a file format that may not completely suit your needs.