View Single Post
Re: Working on a game...
Old
  (#27)
mirv
Super Moderator
 
mirv's Avatar
 
Status: Offline
Posts: 152
Join Date: Apr 2004
Default Re: Working on a game... - 22-09-2006

Small news update (nobody minds me giving one I hope) - spatial tree is starting to stand. Memory footprint is about 3.7MB for handling 50,000 objects (400kB less for 32bit systems), however it doesn't handle dynamic memory too great - set the tree at startup, and don't put in more than it can handle basically. Startup for that many takes some time (12 or 13s, but that's including some texture loading) - so dynamically moving 50,000 objects in & around the tree may need some work.
Anyone know that if, in theory, replacing ~21 +/- operations with one square root and a couple of +/- operations is better? I've had it drilled into me so much to avoid square root functions that maybe I'm over-compensating.
edit -- it's not better, it's much slower.
edit2 -- no, I was wrong! turns out constraints on node spatial size were causing an unbalanced tree. Different algorithm using square roots allows tighter constraints and (I think...) a better tree, resulting in a load time of about 2s now.


mirv the Silly Fish.

Last edited by mirv; 22-09-2006 at 15:46.. Reason: found the answer
  
Reply With Quote