Abstract: Allows you to store the exact coordinates of any unit in a counter
Requirements/Limitations
- Two 4-tile wide/tall alleys with no air units
- Around 40 triggers
- Around 28 locations
- If you run full-map coordinate checks every hyper-cycle, you'll probably encounter lag
- (for developers) patience and persistence
What you can do with it:
- Calculate the distance and angle between two units & create cool effects
- Cover larger areas than static grids with much fewer locations
- Combined with precise location placement, you can keep the coordinates of temporarily removed or displaced units without extra locations
- Many mathmatical applications
Here's what'll have to do for an explanation:
Basically, you check half the map, if it's not in that half, you know it's in the other half, so you can add half the width of the map to your X-coord, then you would check half the other side (moving the next location into position with mobile grids), if not in that, you could add a 4th the width of the map to your X-coord and move your next location into position, if not in that, you could add 1/8th the width of the map to your x-coord and move your next location into position and so on until you have checked the whole map.
Each successive location is half the size of the previous, so in the largest map possible you only need 13 locations (4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, and 1 width size locations) per dimension.
Each successive location gets moved into position based on whether the targeted unit was in, or not in the previous location.
If targeted unit is not in the Current Locations position
Next Location's position = Current Location's position + 3/4*(Size of Current Location) from center of current location
If targeted unit is in the Current Location's position
Next Location's position = Current Location's position - 1/4*(Size of Current Location) from center of current location
For your final few pixels you can't make precise movements, so you'll have to use more locations if you want to get this specific, but really all you have to do is center inverted of decreasing size on your last location till you've pinpointed your unit.
Current map: As far as the naked eye is concerned, this map returns the exact X (minerals) and Y (gas) of your marines tile about the whole 256 by 256 map, more area than static locations could possibly cover, it also runs the checks every cycle - which in a real game would be insane (alot of mobile gridding and bring checks are performed!)
Confusing stuff: It’s Y-coord seems to be off by 8 pixels, not sure exactly where this error is but I assume it’s in the distance my grids travel (trying to not correct for offset glitch & using the center of the map as an alleyway to slightly improve trigger efficiency), you can probably avoid this using numbers directly from precise location placement, and correcting for the offset glitch
Attachments:
TheNitesWhoSay - Clan Aura - github
Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.
Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.