Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Pixel Perfect Mobile Grids Against the Border
Pixel Perfect Mobile Grids Against the Border
Dec 21 2009, 8:17 pm
By: TiKels  

Dec 21 2009, 8:17 pm TiKels Post #1



What im trying to do is make a direction detection system using only 2 locations that are "shifted locations".
If you do not know already, location shifting is a system in which you take a location and make its width/height twice that of the entire map, causing the center to always be on the top or left border when it is centered on a unit. I am using this to avoid the whole slowdown problem when u spam air units over units to detect direction. Also i want this system to be pixel perfect, meaning if i were to move my unit one pixel down/up/left/right it would detect it. Heres the probleM: i tried doing mobile grid systems on the border for the Up/down (Cuz i already have a system for left/right that will ONLY work for left/right) but on certain coordinates the units created wont always spawn on the exact same pixel (they spawn on one pixel and then are removed and spawn on another pixel directly Below or above, but which one i am not sure), without the unit im detecting even moving.
If i can find a way to use mobile grids against the border or find a new system, i will be a lot happier.
Please and thankyou for your help.
If u have questions please ask me because i am REALLY bad at explanations of systems and things.
TIK OUT YAH!



"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

Dec 21 2009, 9:03 pm Cinolt Post #2



I don't know how it would work with mobile grids, unless you're scanning the entire border. There are better methods to scan, though.

Location/trigger-wise, this method is probably the most efficient for direction detection that can span the entire map.



None.

Dec 21 2009, 9:09 pm Kaias Post #3



With mobile grids and only 2 locations the greatest definition of coordinates you can get is within 8 pixels. This is because displaced units are placed snap to 1/4th tile grid; without more locations to exact that coordinate, you can't get pixel perfect coordinates.



None.

Dec 21 2009, 9:11 pm TiKels Post #4



Wait what? let me clarify what i meant. Your unit = O mobile grid = # border = |

|65
|14 O
|23
You remove 1,3,4,5 and if there's a 6 or 2 in the horizontal location then you have moved up/down.
As i said the problem remains in the fact that there's a randomized (maybe) offset on certain coordinates where the location being centered on the unit moves up/down or the unit being spawned moves up/down, which shouldn't happen.
Edit:
@kaias: NOT pixel perfect coordinates but pixel perfect direction detection.
I achieved left/right pixel perfect direction detection via a very simple system using one location and two units.
It goes like this (i probably should have said this in the start):
You have an shifted inverted location measured to the size of a lurker center on the Unit u wish to detect the direction of. (What a mouthful!)
When the Unit moves the lurker would no longer be within the Shifted Inverted location, so you create another lurker within the location and run the action Remove one Zerg Lurker at anywhere. If the player had moved right, there would be a lurker still within the inverted location (the one you just created) if you moved left there is no lurker within the location. This will not work for up/down because of how SC picks units (Leftmost and then Oldest).
Edit2: I would LIKE to have like 2 locations, but having more is OK. The mobile grid offset thing is bad, but it shouldn't randomize where it spawns, I've run tests before and it was always consistant on where it places, (with offset i mean) instead of the FIRST unit moving up and down (which shouldn't happen as far as i know) With about 4 more locations i could fix the problem with the offset because the max offset being 4 pixels allows me to just measure if its within 4 pixels of one of the units.
Once again: The problem i am addressing is the fact that the initial unit being placed is not being consistent in its placing.

Post has been edited 2 time(s), last time on Dec 21 2009, 9:29 pm 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

Dec 23 2009, 2:01 pm JaFF Post #5



Quote from TiKels
You have an shifted inverted location measured to the size of a lurker center on the Unit u wish to detect the direction of. (What a mouthful!)
When the Unit moves the lurker would no longer be within the Shifted Inverted location, so you create another lurker within the location and run the action Remove one Zerg Lurker at anywhere. If the player had moved right, there would be a lurker still within the inverted location (the one you just created) if you moved left there is no lurker within the location. This will not work for up/down because of how SC picks units (Leftmost and then Oldest).
Edit2: I would LIKE to have like 2 locations, but having more is OK. The mobile grid offset thing is bad, but it shouldn't randomize where it spawns, I've run tests before and it was always consistant on where it places, (with offset i mean) instead of the FIRST unit moving up and down (which shouldn't happen as far as i know) With about 4 more locations i could fix the problem with the offset because the max offset being 4 pixels allows me to just measure if its within 4 pixels of one of the units.
Once again: The problem i am addressing is the fact that the initial unit being placed is not being consistent in its placing.
I read over this and it actually makes sense, so far. It will, of course, only work for units with constant speeds (no acceleration) and will accumulate error if the unit is slowed or had his speed boosted (stim).

I cannot think of a practical solution to your problem with the up/down detection.



None.

Dec 23 2009, 7:50 pm Cinolt Post #6



Accelerated units work fine with Left/Right in this system, same with any units traveling in different speeds. Why wouldn't it?



None.

Dec 23 2009, 8:35 pm FlashBeer Post #7



Couldn't you use pixel perfect coordinates for pixel perfect direction detection?



None.

Dec 23 2009, 9:30 pm JaFF Post #8



Quote from name:yoonkwun
Accelerated units work fine with Left/Right in this system, same with any units traveling in different speeds. Why wouldn't it?
If a unit moves at least one pixel, it detects movement in the correct direction. That's all it does. It has no way of detecting the distance travelled, hence, the only way to detect pixel coordinates accurately is if you know the speed of the unit - then, you just add/subtract the number of pixels you know it moves every time it moves. IF the speed is constant, that is.



None.

Dec 23 2009, 9:45 pm Cinolt Post #9



Quote from TiKels
@kaias: NOT pixel perfect coordinates but pixel perfect direction detection.




None.

Dec 24 2009, 11:32 am JaFF Post #10



Ah, sorry, I misunderstood what he meant. Well, there is rarely movemnt only in one coordinate. Perhaps settle on a less accurate detection for the up/down movement?



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:19 pm]
Vrael -- IM GONNA MANUFACTURE SOME SPORTBALL EQUIPMENT WHERE THE SUN DONT SHINE BOY
[01:35 am]
Ultraviolet -- Vrael
Vrael shouted: NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
Gonna put deez sportballs in your mouth
[01:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
[2024-4-30. : 7:43 am]
NudeRaider -- Vrael
Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
[2024-4-29. : 6:36 pm]
RIVE -- Nah, I'm still on Orange Box.
[2024-4-29. : 4:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[2024-4-29. : 12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[2024-4-29. : 11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
Please log in to shout.


Members Online: Vrael