in0finite / SanAndreasUnity

Open source reimplementation of GTA San Andreas game engine in Unity
https://discord.gg/p6jjud5
MIT License
2.13k stars 352 forks source link

Implement better world loading system #58

Closed in0finite closed 3 years ago

in0finite commented 4 years ago
slapin commented 4 years ago

Implement spatial search structures like KDtrees and use radius search to find objects of interest, so no need to iterate over all of them?

On Tue, Oct 15, 2019 at 8:57 PM in0finite notifications@github.com wrote:

  • Don't sort divisions
  • Don't iterate through that many map objects each frame
  • New system will not do any iterations, except when focus point changes it's current division
  • Split all map objects into layers, where each layer contains map objects with certain LOD
  • ...

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/GTA-ASM/SanAndreasUnity/issues/58?email_source=notifications&email_token=AAABPU5JBWLATGXTHWF2C3TQOX77HA5CNFSM4JBAACJ2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HR6HRMQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABPU7SFQY5BGXCC73LSQDQOX77HANCNFSM4JBAACJQ .

in0finite commented 4 years ago

The problem is that every map object has it's own draw distance. So, one object can have 200, and the other can have 1500. So, you can't use a single radius.

slapin commented 4 years ago

Well, in this case you might need to employ circle for each object and use BVH (bounding volume hierarchy) structure around them and do radius searches?

On Wed, Oct 16, 2019 at 3:25 AM in0finite notifications@github.com wrote:

The problem is that every map object has it's own draw distance. So, one object can have 200, and the other can have 1500. So, you can't use a single radius.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

in0finite commented 4 years ago

I don't know much about those algorithms, but I came up with algorithm which does it all in constant time, except for situations when a focus point changes a division.

in0finite commented 3 years ago

implemented in #110