Sign in to follow this  
deadstar

Questions on spacial partitioning and level editors

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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])

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this