PDA

View Full Version : Level editor



jonny2027
06-20-2013, 03:34 AM
Hi All,

I am quite new to OpenGL and 3D development. I have done a few tutorials and built a room using quads however i was wondering what is the easiest way to go about building full levels e.g multiple rooms and corridors without hard coding the actual vectors.

Any help would be great.

Thanks

Jonathan

tonyo_au
06-20-2013, 07:27 AM
You could look at using some sort of XML text file to hold the descriptions. There is an open source library to read these files called TinyXML

thokra
06-20-2013, 10:01 AM
Well, there are a host of file formats for the description of 3D scenes. For instance, game developers will often define their own proprietary format tailored specifically to their needs. There are however, industry-standard formats like COLLADA which are open and widely supported. Content exported to such formats is created in various tools, e.g. Blender or 3D Studio Max.

You can always specify your own format and, for instance, write an export script for an existing tool, e.g. a python script for blender, that exports directly to your format and then write import code used by your application to process scene contents at runtime.

GClements
06-20-2013, 11:00 AM
Whether you define your own format or use an existing format, bear in mind that a game needs data for more than just rendering, e.g. collision, path-finding, trigger regions for scripts, etc.

For complex scenes, you can't just render everything every frame, you need some sort of culling system so that you only render parts you might be able to see. This often relies upon data which is stored as part of the level. But with modern hardware, you could probably render an entire Quake level without needing any form of culling.

If you just want to take the next step beyond hard-coded data, the Wavefront OBJ format is very simple and can be written by most modelling software. Searching for "OpenGL" and "OBJ" will provide many hits (of varying quality; it's popular "my first OpenGL-related blog post" material).

carsten neumann
06-20-2013, 12:46 PM
Yes, unfortunately since OBJ supports different indices for each vertex attribute it does not directly map to OpenGL. Of course there is no end of threads explaining solutions on this forum ;) ;)