Jump to content
  • Advertisement
Sign in to follow this  
grill8

Questions/Ideas about scene management and the updating of objects.

This topic is 3262 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I have some questions/ideas about scene management and the updating of objects. I am building a 3D game engine, and so far for scene management I have an octree that is used to maintain cullable entities such as objects, spotlights, and point lights. This works well for culling renderables (and lights) etc. but I am now needing to further this in several ways. Updating objects in the world should be simplified and reduced in a similiar manner as octree culling reduces the number of objects to render. I.e. if objects were rendered linearly than it would take a LOT more time than culling and then rendering. This same concept (I believe) can and should be applied to the updating (changing position etc.) of objects. If all objects in the world were updated linearly this could take a LONG time compared to some form of update processing reduction. My initial thoughts on this topic are as follows: Step 1) Dissect the world into cubes (called zones) and maintain some form of data structure that tracks the neighboring zones of a given zone. Step 2) Maintain a list of the updatable objects contained in or intersecting a given zone. Step 3) When an object moves, see if it is in the same zone, or if it has moved into a neighboring zone and change zones accordingly. Step 4) Track which zone the viewer/avatar is in at any given time. Step 5) Each frame update the updatable objects in the zone the avatar is in. Step 6) To update the objects NOT in the same zone as the avatar, do so but not EVERY frame. To be precise, the farther away (neighbor zone wise) a zone is relative to the avatar the less frequently you need to update that zone. For example, adjacent zones to the current zone the avatar is in would be updated say ... every 100 milliseconds, zones 2 zones away every 500 millisecons, 3 zones away every 1000 milliseconds etc. These are just numbers but the idea stays the same ... you are reducing the processing required to update objects by updating the closer ones more frequently than those that are farther away. In addition, zones can be turned completely on/off (say the objects inside a castle that don't require updating unless you are inside the walls or such) or if it is passed some threshold as far as distance goes. Basically, I am just trying to figure out a way to effectively update a large 3D world effectively withouth linearly updating all objects which obviously would be inefficient. Thoughts? Jeremy

Share this post


Link to post
Share on other sites
Advertisement
Update -

My new thoughts on the subject are as follows:

This is for single player only.

Step 1)
Create a series of radii with the first large enough to encompass the viewer/view frustum with a bit of padding, and each successive radii substantially larger. These determine spheres of larger and larger radii around the viewer.

Step 2)
Once every frame you would cull the octree using the SMALLEST radius and update those objects.

Step 3)
Once every ... say ... 20 frames you would ALSO cull using the next largest radius and update those objects (not also in the smaller radius) divided evenly over the next 20 frames.

Step 4)
Once every ... say ... 100 frames you would ALSO cull using the NEXT largest radius to that one and update those objects (not also in the next smaller radius) divided evenly over the next 100 frames.

Step 5)
Objects who are farther away than the LARGEST radius are simply not updated.

How does that sound?
Jeremy

[Edited by - grill8 on October 13, 2009 11:04:54 PM]

Share this post


Link to post
Share on other sites
What you describe in the first post is grid-based optimization, which is fairly common and definitely works well, especially for many mobile objects.

One thing though, you mention in step 3 "When an object moves, see if it is in the same zone,". Objects have volume, so when implementing you will need to allow for objects to be in multiple zones, such as when they are straddling the line between 2 grid squares or if they are on the intersection between 4 grid squares. And that is assuming that most objects are smaller than grid sectors.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!