Sorry guys, might not be much visual demos today (I may share some older work though).
This is because i'm working on the RTS part of drone commander today.
One of the things that is really hard with an RTS, or any kind of tactics game is "How do you manage all those unit's interactions?"
Imagine you had 50 units, the enemy had 50 units.
What happens if one of your unit touches another?
What happens if one of your units touches theirs?
What happens if one of their units touches their own?
Now do this again for bullets, buildings and so on.
That means the computer would have to do a LOT of checking every second.
Rather than go through every single permutation, a simpler way is to get every unit, bullet and building to 'report their position'.
Hi, i'm attack drone alpha, i'm currently in quadrant 2B.
Now the computer simply checks all quadrants, is there another unit in 2B? Nope? Ok, no more checks for that unit needed.
This is known as spacial partitioning:
Split the map up into cells, and just check each cell, if there are more than one unit in that cell - then assume they are touching.
Mr Adam McMurchie
2024-03-14 21:49:18 +0000 UTCCneaus Fechine
2024-03-14 21:30:11 +0000 UTC