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:57 am]
NudeRaider -- https://staredit.net/381600/ You have 5 minutes, then you can only edit your posts.
[04:05 pm]
NudeRaider -- DarkenedFantasies
DarkenedFantasies shouted: you eat lots of beans
:lol:
[11:30 am]
NudeRaider -- I would like 3000 minerals, please
[2026-4-16. : 7:32 pm]
Zoan -- I got $2000 bonus. I would like 2000 minerals, please
[2026-4-16. : 4:15 am]
DarkenedFantasies -- you eat lots of beans
[2026-4-16. : 3:46 am]
IskatuMesk -- how do i get gas
[2026-4-15. : 11:43 pm]
Moose -- you don't
[2026-4-15. : 10:06 pm]
Zoan -- how do i get minerals
[2026-4-14. : 11:45 pm]
ClansAreForGays -- Anyone wanna played Skewed StarCraft?
[2026-4-14. : 12:07 am]
Vrael -- NudeRaider
NudeRaider shouted: Vrael ranting still is though
you're a gentleman and a scholar, thank you
Please log in to shout.


Members Online: Zycorax