Questions on spacial partitioning and level editors

Started by
5 comments, last by OrangyTang 15 years, 11 months ago
Hi all, I have a few questions on where to go next with my engine. I have just finished implementing a brushes system - I can create levels using planes, boxes, cylinders and spheres. Do I need a spacial partitioning method, like BSP or octrees? What problems would I run into just having a level file detailing all the brushes, their sizes and positions, textures and UV coords, without making use of spacial partitioning? My next question is on implementing a level editor. I would like to create a 3D map editor, making use of my engine's code base, using a cross platform solution such as Qt or wxWidgets, and C++ is my language of choice. I have some money for a book, but books on tools development seem scarce. 'Game Engine Toolset Development' by Graham Wihlidal is one of the very few I could find, but it's based on C# and .NET, and I wouldn't be very willing to learn another language. Are there any books on tools development using C++? Thanks for your time

"The right, man, in the wrong, place, can make all the dif-fer-rence in the world..." - GMan, Half-Life 2

A blog of my SEGA Megadrive development adventures: http://www.bigevilcorporation.co.uk

Advertisement
Quote:Original post by deadstar
Do I need a spacial partitioning method, like BSP or octrees? What problems would I run into just having a level file detailing all the brushes, their sizes and positions, textures and UV coords, without making use of spacial partitioning?


You may not run into any issues with small levels but bigger levels would likely give you performance issues, you need at the very least a portal system in order to cull out what gets drawn and what doesn't as well as what objects might collide.

BSPs are very efficient for collision broad phase, not so much for culling what gets rendered nowadays, but you can develop a system that uses both BSPs and portals or visibility areas.

Quote:Original post by deadstar
My next question is on implementing a level editor. I would like to create a 3D map editor, making use of my engine's code base, using a cross platform solution such as Qt or wxWidgets, and C++ is my language of choice. I have some money for a book, but books on tools development seem scarce.

'Game Engine Toolset Development' by Graham Wihlidal is one of the very few I could find, but it's based on C# and .NET, and I wouldn't be very willing to learn another language. Are there any books on tools development using C++?


Sorry, I don't know of any books on tool development, I guess thats something that is so specialized, there is really not a "wrong" way to do it, you have to learn to use your tools and implement the functionality you need.
Thanks for the reply. The game I'm creating consists of both outdoor scenery (Farcry style island setting), and indoor. I have the book 'Ultimate 3D Game Engine Design & Architecture', and I've just looked up portals. It explains portals have little use for outdoor scenery, and hints at the use of Octrees for outdoor/terrain based environments.

Which should I choose for a game that mixes both indoor and outdoor?

"The right, man, in the wrong, place, can make all the dif-fer-rence in the world..." - GMan, Half-Life 2

A blog of my SEGA Megadrive development adventures: http://www.bigevilcorporation.co.uk

Quote:Original post by deadstar
Thanks for the reply. The game I'm creating consists of both outdoor scenery (Farcry style island setting), and indoor. I have the book 'Ultimate 3D Game Engine Design & Architecture', and I've just looked up portals. It explains portals have little use for outdoor scenery, and hints at the use of Octrees for outdoor/terrain based environments.

Which should I choose for a game that mixes both indoor and outdoor?


I would suggest both actually. Use portals (and BSPs if so inclined) for your indoor geomery (buildings, walls, corridors,etc), and use an Octree for your outdoor terrain, you can have your building's AABB inside the external Octree, such that you use the portal system when the camera is inside the AABB and the octree when it is outside.
Thanks, I'll start reading up on them.

How would it integrate with the level editor? I know in editors like UnrealED you have to 'build' the BSP, what exactly does this do and what info would be saved to the level file about it? Does it apply to Octrees/Portals?

As for my level editor, I've opted to finish my GUI system and have an internal editor in-game.

"The right, man, in the wrong, place, can make all the dif-fer-rence in the world..." - GMan, Half-Life 2

A blog of my SEGA Megadrive development adventures: http://www.bigevilcorporation.co.uk

Quote:Original post by deadstar
How would it integrate with the level editor? I know in editors like UnrealED you have to 'build' the BSP, what exactly does this do and what info would be saved to the level file about it? Does it apply to Octrees/Portals?


Well I am not familiar with UnrealED, but I suppose what it does is create the BSP tree, split polygons and so on.

To integrate this into your level editor you can go about it in different ways, you can start with an octree with terrain in it and then insert premade BPS based geometry into it, placing on the terrain and so on.

Or you could "mark" what is meant to be partitioned with the BSP algorithm what with the octree algorithm and what is to be a prop object, starting player location, etc.

PS: try the Torque Game Engine Demo, Torque works exactly the way you want your engine to work, check the in-game level editor to get some inspiration (it comes up by pressing one of the F keys in the demo game, but forgot which [smile])
Quote:Original post by deadstar
My next question is on implementing a level editor. I would like to create a 3D map editor, making use of my engine's code base, using a cross platform solution such as Qt or wxWidgets, and C++ is my language of choice. I have some money for a book, but books on tools development seem scarce.

I'd suggest investing the money in a book about the GUI toolkit you're going to use. A level editor will need a broad range of widgets and a large chunk of gui code, and a book to help you through the stickier bits comes in very handy.

This topic is closed to new replies.

Advertisement