Why Nostr? What is Njump?
2025-04-04 12:07:36

Lianna (on Mastodon) on Nostr: #Gamedev question: If I want to manually program a collision system for a lot of ...

#Gamedev question:

If I want to manually program a collision system for a lot of units, think like in an #RTS, and the only info I have is a list of units containing each their X and Y coordinates as well as their collision box diameter, how would I go about doing that?

Do I iterate through every single unit every frame to check whether the destination they'd move to this frame overlaps with ANY of the other units, meaning iterating through n² units per frame?

That's an exponential effort!
Author Public Key
npub1srpz50umhhcvy3w4w9uc29qskjzfwaj0egt0hkuyv0jyddv9eedqcdkqac