Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: FPS Death is not a !!FUN!! way for a fortress to end.  (Read 2607 times)

ayy1337

  • Bay Watcher
    • View Profile
Re: FPS Death is not a !!FUN!! way for a fortress to end.
« Reply #15 on: January 15, 2023, 09:20:59 pm »

Can we not divide the play area into invisible shapes, with overlapping shapes on their borders?  As long as the shapes are bigger than how far creatures can see, can we not then reduce the number of checks needed by only going through a list of creatures in the shape?

That's more complicated and memory intensive than just finding the (square) distance between two points, even at O(N2). You've got to update those regions each time a unit moves. Add the overhead of finding and removing the unit from the proper vector once you've determined a unit has left the region.

A more comprehensive region system would have other benefits though tbf
Logged
Pages: 1 [2]