Staredit Network > Forums > SC1 UMS Theory and Ideas > Topic: Exact Coordinate Detection
Exact Coordinate Detection
Mar 26 2012, 1:14 am
By: jjf28  

Mar 26 2012, 1:14 am jjf28 Post #1

Cartography Artisan

A short shoutbox convo reminded me I had this; I'll put a polish on this thread, the map, and the theory once I run into a nice chunk of time

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:
Coordinate Detection.scx
Hits: 13 Size: 51.68kb



TheNitesWhoSay - Clan Aura - github

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Mar 27 2012, 6:23 pm JaFF Post #2



The idea is theoretically sound. Perhaps you're not in the golden age of mapping but it's definitely good to tease your brain with such stuff.



None.

Jun 13 2012, 7:20 am Jack Post #3

>be faceless void >mfw I have no face

Just saw this for the first time. Very clever to use the way locations centre on other locations so you don't need units on the 4tile alleyway. I might use this in my map, as opposed to the unit scan I was using previously (fewer locations, more units).



Red classic.

"In short, their absurdities are so extreme that it is painful even to quote them."

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[05:02 am]
Oh_Man -- whereas just "press X to get 50 health back" is pretty mindless
[05:02 am]
Oh_Man -- because it adds anotherr level of player decision-making where u dont wanna walk too far away from the medic or u lose healing value
[05:01 am]
Oh_Man -- initially I thought it was weird why is he still using the basic pre-EUD medic healing system, but it's actually genius
[03:04 am]
Ultraviolet -- Vrael
Vrael shouted: I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
With the modern EUD editors, I don't think they're calculating nearly as many offsets as you might imagine. Still some fancy ass work that I'm sure took a ton of effort
[12:51 am]
Oh_Man -- definitely EUD
[09:35 pm]
Vrael -- I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
[09:35 pm]
Vrael -- that is insane
[09:35 pm]
Vrael -- damn is that all EUD effects?
[2024-5-04. : 10:53 pm]
Oh_Man -- https://youtu.be/MHOZptE-_-c are yall seeing this map? it's insane
[2024-5-04. : 1:05 am]
Vrael -- I won't stand for people going around saying things like im not a total madman
Please log in to shout.


Members Online: jjf28