Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Movement Detection Problems with Zealots
Movement Detection Problems with Zealots
Sep 20 2012, 2:24 am
By: samsizzle  

Sep 20 2012, 2:24 am samsizzle Post #1



Normally detecting movement is a breeze with most units. But when it comes to zealots it's a total pain in the ass. The problem is (I think) that the center of the collision box on zealots is not the same as the center of the unit (where locations are centered). This means using locations to detect movement is very inaccurate because the distance from the top edge of the location -> center is different from the bottom edge -> center. Resulting in things like footstep sounds being played less frequently while the unit is moving north.

I've tried various things including inverted locations, pixel locations etc etc. I know using EUDs to detect the move order would work perfectly, but I'm trying to avoid using EUDs if possible. So what I want to know is if anyone has a solution to this problem?



None.

Sep 20 2012, 3:03 am TiKels Post #2



You can do left/right movement detection by using a location that is both shifted and inverted. Shift it (make it twice the size of the map in the vertical axis) and invert it to the size (in the X axis) of the burrowed unit you will be creating at the shifted location.

Start of trigger cycle. The location should have been centered on the zealot the last trigger cycle (or the unit been created at it, etc etc).

1. Create one marker unit for player 1 at the shifted location and use move unit to move it to the shifted location to make sure it centers properly.
2. Re-center the shifted location on the zealot.
3. Create a second burrowed unit for player 1 at the shifted location.
4. Run the trigger "Remove one burrowed unit for player 1"

Next trigger:

If a burrowed unit is still in the location, he moved right, if there is not one in the location anymore, he moved left.

BAM HALFWAY THERE SAMSIZZLE.

The reason this works is that SC will always select the leftmost unit of a certain type to kill.

The reason it only works for left/right is because for up/down detection it selects the most recent (or oldest? i forget) if it's the same X value.

Post has been edited 1 time(s), last time on Sep 20 2012, 3:08 am by TiKels.



"If a topic that clearly interest noone needs to be closed to underline the "we don't want this here" message, is up to debate."

-NudeRaider

Sep 20 2012, 8:59 pm Cinolt Post #3



This problem can be solved with Kenoli analysis (a pivotal technique in the science of StarCraft mapology).

From DatEdit:


The unit's boundaries, with locations being centered at 0,0 (the sign of the vertical axis should be reversed):


The horizontal dimension is easy, just a horizontal inverted location of size 11+11=22:


No matter how much the unit is horizontally displaced, even by one pixel, the Bring condition will return false.

The problem is the vertical dimension. A vertical inverted location of size 5+13=18:


The Bring condition returns true only when the unit moves exactly 4 pixels up, which is obviously not useful.

Let's try another location size 5+5=10. Bring returns true when there is no displacement, however there are false positives for slight displacements upward, so this alone is not reliable for pixel-accurate displacement detection:


The location does, however, detect displacement downward perfectly, and we can introduce a second vertical location 6+6=12 to account for upward displacement as so:


But with a displacement of exactly 13-5=8 pixels upward we find another false positive:


This can be accounted for by using the fact that when odd-sized locations are centered (all locations so far were even-sized), the larger half is placed on the positive end (negative end on the graph). Therefore we can eliminate this false positive by increasing the size of the first vertical location by 1:


This is good enough for just displacement detection, however utilizing more locations in this manner allows one to know how far a unit has been displaced, and is the basis for Kenoli's method for tracking unit coordinates.

Post has been edited 2 time(s), last time on Sep 20 2012, 9:05 pm by yoonkwun.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[03:33 pm]
O)FaRTy1billion[MM] -- o sen is back
[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.
Please log in to shout.


Members Online: Roy