[epiar-devel] Infinite Canvas

Christopher Thielen cthielen at gmail.com
Wed Jan 20 15:49:26 PST 2010


>>> 2)  How long do we need to keep track of Sprites?  If a ship is 10 quadrants away from the player, do we really need to run the full AI loop for that ship?  Alternatively, we need to keep the AI loops running for ships in nearby Quadrants so that the player can't just hop into the next quadrant for a while and then.  Could we just delete ships as they cross quadrant boundaries?  One idea would be to add a screen flash every time the player enters a quadrant, then delete all sprites in the old quadrant and create sprites in the new quadrant.  Also, how should ships be removed?  Simply blink them away?  Make them land on a planet?  Make sure ships are outside of the players' views before deleting them?
>> 
>> We don't need to have a real running universe unless it's computationally easy. One idea is to have AI sprites very far away simply updated 1/2x as often or 1/16 as often as sprites on screen.
> 
> I think that this is possible, I'll look into it.  The idea of just freezing distant systems rather than deleting them is appealing, but I bet that it would cause memory issues down the road.

A combination of freezing/slowing and faking traffic should do. The only real concern is what to do about things that are supposed to happen far away, e.g. pirate attacks a ship. If only the pirate is in existence due to a special sprite flag, what's he going to attack?

>> The flashing between quadrants is no good. We should simply ensure planets aren't visible at the edge of quadrants and if any ships are on-screen when the player switches quadrants, we'll switch the sprites to the new quadtree too. This requires the quadtrees allow for some sprites somewhat outside its coordinates temporarily. Does that make sense?
> 
> I agree, no flashing between quadrants.  I don't think we need it anyway.  The current infinity branch has planets and ships at the edge of a quadrant and it works just fine.  I think that we can do can do visibility based removal.
> 
> The QuadTree becomes useless if there are sprites outside of it since it can't reasonably cull out of searches.  The current infinity branch implementation doesn't need this though, since the range checking crosses Quadrant boundaries 'seemlessly'.

Can two quadtrees overlap, or perhaps have you already come up with a way of handing off on-screen or near-screen sprites to the player's next quadtree should he breach that gap?


More information about the epiar-devel mailing list