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.
[01:53 am]
Ultraviolet -- :lol:
[06:51 pm]
Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
[06:50 pm]
NudeRaider -- Vrael
Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
sounds like moisture control is often a pressing concern in your city
[06:50 pm]
Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
[06:49 pm]
Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
[06:48 pm]
Vrael -- On this Topic, I could definitely use some Introductions.
[06:48 pm]
Vrael -- Perhaps that utilizes cutting-edge technology and eco-friendly cleaning products?
[06:47 pm]
Vrael -- Do you know anyone with a deep understanding of the unique characteristics of your carpets, ensuring they receive the specialized care they deserve?
[06:45 pm]
NudeRaider -- Vrael
Vrael shouted: I've also recently becoming interested in Carpet Cleaning, but I'd like to find someone with a reputation for unparalleled quality and attention to detail.
beats me, but I'd make sure to pick the epitome of excellence and nothing less.
[06:41 pm]
Vrael -- It seems like I may need Introductions to multiple companies for the Topics that I care deeply about, even as early as Today, 6:03 am.
Please log in to shout.


Members Online: Roy, Oh_Man, Risingvge