Help me with maps please

Started by
7 comments, last by orphankill 16 years, 6 months ago
Ok, so first let me say everyone on this forum has been a great help so far. I've really become motivated to make my first game because of the people here who have helped me work my way around problems that stopped me before. Just felt that it needed to be said. On to my next problem! Maps. I cannot find a good tutorial anywhere. I just want a way to make a level for my first person shooter, and load it into my game. I'm very proficient with the Call of Duty map editor, but that saves maps into a non-recognized format, (by DirectX) as I would expect. I have 3ds Max. The most I've accomplished is making a square and loading into my game. Yay. I don't want to spend too much time making a level in 3dsmax because everytime I do and try to export it as an X file it just refuses to load in my game or the mesh viewer. Someone please help me get started!
Advertisement
3DS max 9 for level/world design?

You could write your own level editor using the same engine as the game. You could even let the player edit the map (link!).

A level is generally not a big mesh; it is a collection of objects and their properties. The level editor should let you place 3d models, lights, sound sources, action regions and set their properties like friction and weight for the 3d objects. Sometimes it’s good idea to have a build in height map generator but the level editor doesn’t need to be modeling tool.
The level editor saves the transformation matrixes of the objects and their properties, position of the lights, their color, intensity,… into a file and you read it in the game.
If you need a simple map just for prototyping you could even use a human readable text file to store the data, something like
3d object: model = box.x , position=<10.0,2.0,1.0> ;light: type: point light, posion = <0.0,10.0,0.0>, color=<255,200,255>, intensity=10;start posion: <0,0,0>
You could even use XML and some free library to parse the data. Later you can write a level editor that saves to the same file format.

You could also try Freeworld3D but I have never used it.

[Edited by - Kambiz on October 13, 2007 5:47:00 PM]
OOOOOOOO:):):)
You just made things so much clearer you don't even know!

I think I will buy freeworld for my level editing, and use max for my level modeling. Does anyone know how to manually import freeworld save files, or is that documentation that I will receive upon purchase?
Quote:Original post by Kambiz
A level is generally not a big mesh...
Quote:Original post by orphankill
...and use max for my level modeling...
Take care! "Level editors" usually employ some special format to encode engine-specific data. It's often necessary to retrieve a "data structure" such as plane information, hull data and such. Doing this from arbitrary meshes as produced by DCC tools can be really tricky. If you check most games up to a few years ago, DCC meshes are used only for special purposes (player models and decorative meshes mostly).
Quote:Original post by Kambiz
If you need a simple map just for prototyping you could even use a human readable text file to store the data, something like
3d object: model = box.x , position=<10.0,2.0,1.0> ;light: type: point light, posion = <0.0,10.0,0.0>, color=<255,200,255>, intensity=10;start posion: <0,0,0>
Maybe take a look at http://www.gamedev.net/community/forums/topic.asp?topic_id=455546 .
It's a bit of another business, but the bottom line is that you should NOT use human readable formats. Human readable formats need parsers. Parsers take some time to write, are prone to bug and tend to be a real pain in evolving. When you consider all the time needed for a good parser you figure out it's just better to walk the few prototype files in a hex editor (with FP mangling) than dealing with those monsters.

Human readable files also have a terrible drawback: they cannot easily express complex references. Take for example C, in which you need to prototype (or define) functions before you use them. This means you need a path in your parser to deal with those cases... and things start to go awry.

By contrast, machine-readable is way faster to work, much more compact, can be procedurally generated with ease. Yes, it's harder to debug but when writing a good parse can take a few weeks, writing a disassembler takes a few days at worse...
Quote:Original post by Kambiz
You could even use XML and some free library to parse the data. Later you can write a level editor that saves to the same file format.
Please, don't use XML as your storage format. XML is meant to be an interchange format. It's terribly inefficient for storage purposes. Not a single commercial game I know of uses it massively for high-volume data, although some use them for scripting or GUI...

Previously "Krohm"

With parser generator like ANTLR or a combination of tools like lex, yacc and memphis one can generate a good parser in few hours. I use zipped lua scripts to store configurations. My configurations are small but the lua interpreter wouldn’t have any problem with much bigger files.
I’m not a fan of XML but I cannot see any reason not to use it as a level description format. Many free parsers are available and if the file gets too big you can always compress it. I store all of the game data in a 7zip file and use PhysicsFS to read them.

Quote:Human readable files also have a terrible drawback: they cannot easily express complex references. Take for example C, in which you need to prototype (or define) functions before you use them. This means you need a path in your parser to deal with those cases... and things start to go awry.

And how would you solve this problem with a binary format? The way the data are stored in binary and text aren’t that different, in a text file format you are just writing the string representation instead of the actual bits.

[Edited by - Kambiz on October 14, 2007 8:14:18 AM]
Freeworld allows me to export in either XML, ASCII, or Ogre3D. According to you guys, 1 nay sayer on XML, 1 go ahead. What about the other 2 formats? Which would you recommend and how do I import them?
Irrlicht 0.6 FreeWorld Terrain Loader Tutorial
This tutorial could help you get started...
I couldn’t found anything about the XML and ASCII file format used by freeWorld but you can just open the files and see how they look like.
Any special trick to get freeworld working?
Downloaded the demo, everytime i create a new project it closes after ~2sec
I haven't had any such problem with freeworld. I now have the full version purchased and it's working fine. Thanks for the tips everybody.

This topic is closed to new replies.

Advertisement