Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 

 Home / 3D Theory & Graphics / Space simulation...how to organize the scene? Account Manager
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
Alberto

July 18, 1999, 04:57 PM

Hi all

I'm finishing my 3D engine...
So now I want write a space simulation game like Tie-Fighter but...
How to organize objects in the scene?(very large space and a lot of static objects)
BSP or something like?(...nooo I think :)
There's some common techniques to do it?

thanks for your time

ciao
Alberto

PS: I'm sorry about my rude english

 
Sid

July 23, 1999, 05:59 PM

Alberto wrote:
>>I'm finishing my 3D engine...
>>So now I want write a space simulation game like Tie-Fighter but...
>>How to organize objects in the scene?(very large space and a lot of static objects)
>>BSP or something like?(...nooo I think :)
>>There's some common techniques to do it?

Sounds like you might want an octree. Any good graphics text will describe octrees, or there are plenty of articles online as well.

 
Alberto

July 24, 1999, 07:30 AM

thanks you for your reply

I'm studing octrees and it seem the right solution! (for static objects)
but how manage dynamic objects visibility like space ships?
can I use octrees for dynamic objects? how?

thanks for your time :)
Alberto

 
Raven

July 24, 1999, 05:45 PM

>>I'm studing octrees and it seem the right solution! (for static objects)
>>but how manage dynamic objects visibility like space ships?
>>can I use octrees for dynamic objects? how?

You don't need to modify anything. When an object moves you have to check if the octree for it is still valid. If it isn't you have to update the affected nodes from scratch, and the nodes neighbours, not the entire octree. You could get inventive and make something up but this is a rather simple process that isn't processor intensive so it should work fast enough, and your code will be manageable. I have never used octrees in real code so i can't help you here.

But, I think octrees are rather overkill. In a space simulation you need some braindead visibility scheme since the only real gain from a vis scheme is when large ships obscure small combat groups with a lot of polys. Just subdivide your space into a fixed resolution grid, small enough for capitol ships to occupy 6-10 squares, but large enough so that you can still easily and quickly maintain it. Then use simple raycasting for vis. Tweak the grid resolution so that it'll be optimal. To maintain dynamic objects with this is a peace of cake! What you really need for space simulations to help speed things up is an LOD scheme. A ton of fighters in the background eat up a lot of polygon rendering resources. But if they can be represented by boxes when they are very far, the whole squadron's polygon count won't amount to a single fighter. That would be cool, and the difference will be undetectable since they are the size of a pixel. LOD will depend on distance, framerate and number of ships on screen. You can even do dynamic LOD tesselation if you feel up to it(ala ROAM)

Hope this helps,
- Raven

 
Raven

July 24, 1999, 05:45 PM

>>I'm studing octrees and it seem the right solution! (for static objects)
>>but how manage dynamic objects visibility like space ships?
>>can I use octrees for dynamic objects? how?

You don't need to modify anything. When an object moves you have to check if the octree for it is still valid. If it isn't you have to update the affected nodes from scratch, and the nodes neighbours, not the entire octree. You could get inventive and make something up but this is a rather simple process that isn't processor intensive so it should work fast enough, and your code will be manageable. I have never used octrees in real code so i can't help you here.

But, I think octrees are rather overkill. In a space simulation you need some braindead visibility scheme since the only real gain from a vis scheme is when large ships obscure small combat groups with a lot of polys. Just subdivide your space into a fixed resolution grid, small enough for capitol ships to occupy 6-10 squares, but large enough so that you can still easily and quickly maintain it. Then use simple raycasting for vis. Tweak the grid resolution so that it'll be optimal. To maintain dynamic objects with this is a peace of cake! What you really need for space simulations to help speed things up is an LOD scheme. A ton of fighters in the background eat up a lot of polygon rendering resources. But if they can be represented by boxes when they are very far, the whole squadron's polygon count won't amount to a single fighter. That would be cool, and the difference will be undetectable since they are the size of a pixel. LOD will depend on distance, framerate and number of ships on screen. You can even do dynamic LOD tesselation if you feel up to it(ala ROAM)

Hope this helps,
- Raven

 
This thread contains 5 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.