Staredit Network > Forums > SC1 UMS Theory and Ideas > Topic: Generalized pixel perfect detection
Generalized pixel perfect detection
Nov 12 2009, 11:56 pm
By: scwizard
Pages: < 1 2 3 >
 

Nov 17 2009, 7:35 am scwizard Post #21



I disagree.

The fastest way to resolve this disagreement is to implement the map for a irregular unit size. (instead of a unit that has already been implemented).

Do the science vessel and detect its y pixel coordinate.

If it's easy to change the map to accommodate such, then changing it to demonstrate to me how I'm wrong would be faster than trying to convince me I'm wrong with an explanation.



None.

Nov 18 2009, 1:57 am Kenoli Post #22



Words words

Attachments:
UnitTracking(DT).scx
Hits: 20 Size: 46.32kb



None.

Nov 18 2009, 2:52 am Kaias Post #23



Quote from scwizard
I disagree.
You apparently don't understand how the map works. He takes advantage of the fact that locations of even pixel location lengths cannot perfectly center and therefore have 1 pixel further out on one side than the other. The very fact that irregular units are irregular makes it all the easier since the locations are already offset of the unit.

The beauty of his system is that it does what Pixel Coordinates can in far fewer triggers. Both methods can be tailored for any unit size, irregular or not.



None.

Nov 18 2009, 4:04 am scwizard Post #24



That only applies to units that are irregular, and have odd numbered pixels.

For units that are irregular and have even numbered pixels (such as a science vessel along the y) you need to do something completely different from both of the maps he posted.

Basically:
if up = down: use lethal's method
if isodd(up + down): use Kenoli's method
else: use a different method that has not been posted

Post has been edited 1 time(s), last time on Nov 18 2009, 4:14 am by scwizard.



None.

Nov 18 2009, 4:19 am Lethal_Illusion Post #25



Quote from scwizard
That only applies to units that are irregular, and have odd numbered pixels.

For units that are irregular and have even numbered pixels (such as a science vessel along the y) you need to do something completely different from both of the maps he posted.

Correct me if I'm wrong, but don't Dark Templars have an even number of pixels vertically?

I still don't see why my and Kenoli's systems won't work.



None.

Nov 18 2009, 4:30 am Kaias Post #26



If the unit is has an offset collision box then all you're doing is measuring the distance from the center of the unit. Whether the vertical length of the unit is even or odd doesn't matter at all.



None.

Nov 18 2009, 4:30 am scwizard Post #27



Whoops. Yeah I biffed there.

I'lll say what class of units Kenoli's system doesn't work for in a second, let me get my notebook.

EDIT: It says that Kenoli's method only works if down > up.



None.

Nov 18 2009, 4:39 am Kaias Post #28



Quote from scwizard
EDIT: It says that Kenoli's method only works if down > up.
Perhaps you should reconsult your notebook or at least try to explain why that should matter at all. I would hate to have to draw a diagram.



None.

Nov 18 2009, 4:44 am scwizard Post #29



Err, because if down > up then you get odd numbered values and there is no overlap in the output. The function is 1 to 1.

if down <= up then you get even numbered values, and thus overlap, and thus you don't have a 1 to 1 function.

Basically the same location will fit, whether the science vessel has moved down 3 pixels or up 15 pixels.

Therefore:
if up/right = down/left: use lethal's method
if up/right < down/left: use Kenoli's method
if up/right > down/left: use ???

EDIT: Wait that can't be right, or else Kenoli's method wouldn't work for a ghost. Lemme fix 1 sec.

Post has been edited 2 time(s), last time on Nov 18 2009, 4:54 am by scwizard.



None.

Nov 18 2009, 5:08 am Kaias Post #30



Quote from scwizard
Err, because if down > up then you get odd numbered values and there is no overlap in the output. The function is 1 to 1.

if down <= up then you get even numbered values, and thus overlap, and thus you don't have a 1 to 1 function.
I'm still trying to understand what you meant by this

Quote from scwizard
Basically the same location will fit, whether the science vessel has moved down 3 pixels or up 15 pixels.
Not all location sizes will register the same for science vessels displaced down 3 and up 15.
Edit: Actually I should actually think it all the way through / do the math before saying something like this

Post has been edited 1 time(s), last time on Nov 18 2009, 5:18 am by Kaias.



None.

Nov 18 2009, 5:12 am scwizard Post #31



Yeah Kenoli's method should work for everything.

My reasoning was flawed from the beginning. I got X wrong, so everything that followed from that was also wrong.

Post has been edited 1 time(s), last time on Nov 18 2009, 5:22 am by scwizard.



None.

Nov 18 2009, 5:26 am CecilSunkure Post #32



Quote from scwizard
Yeah Kenoli's method should work for everything.
DUN DUN DUN

I was about to tell you you had x wrong from the beginning, but you beat me to it.. Darn ;)

Just kidding :D



None.

Nov 18 2009, 6:25 am scwizard Post #33



Kenoli's DT map is slightly off. -1 should be y -16 not y -15.

y -15 is associated with -11 gas.

EDIT:
http://codepad.org/qnrrlBhg

I could expand this pretty easily to make a python script that would automatically generate pixel cord detection triggers for a unit.

Post has been edited 3 time(s), last time on Nov 18 2009, 12:01 pm by scwizard.



None.

Nov 18 2009, 1:37 pm Kenoli Post #34



Quote
http://codepad.org/qnrrlBhg

I could expand this pretty easily to make a python script that would automatically generate pixel cord detection triggers for a unit.




None.

Nov 27 2009, 7:14 am Cinolt Post #35



Quote from scwizard
Yeah Kenoli's method should work for everything.

Except for detecting Y coordinates on a Fenix Zealot, or maybe I'm doing something wrong. I've tested it extensively, I can't even go so far as to detect when it moved one pixel up or down. X coordinates on it work fine.

If somebody who understands his method can look at these triggers and tell me if I am doing something wrong, that'd be real helpful, because my map is at a hold until I can get a reliable pixel-perfect direction detection for this unit. I've stayed real close to his naming convention.

Also, in the first trigger, the locations are centered on the unit then the unit is moved down 1 pixel, simulating what would happen if it did move down one pixel.

Attachments:
UnitTracking(FenixZealot).scx
Hits: 5 Size: 45.71kb

Post has been edited 1 time(s), last time on Nov 27 2009, 6:22 pm by yoonkwun.



None.

Nov 27 2009, 7:23 am Kenoli Post #36



Seems to detect y+1 just fine.



None.

Nov 27 2009, 7:27 am Cinolt Post #37



Could you post the map in which you verified it was working if you edited it?

The one I posted doesn't work..



None.

Nov 27 2009, 8:23 am Kenoli Post #38



I just made a location to move the zealot down one pixel, and the trigger detected it.



None.

Nov 27 2009, 6:21 pm Cinolt Post #39



I take it back, I just slipped up somewhere. Probably because of how surprisingly long and tedious, of at least my method, it was, and how the pattern for the Y coordinate is different.

Here's triggers and locations for pixel-perfect coordinate/direction detection with a Fenix Zealot for anyone who wants to use this and save about 6 hours of time.

Attachments:
UnitTracking(FenixZealot).scx
Hits: 1 Size: 47.64kb



None.

Dec 5 2009, 12:11 pm Zhuinden Post #40



Why are you able to understand this? Is there any logic in how this works?



None.

Options
Pages: < 1 2 3 >
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[03:27 am]
m.0.n.3.y -- Maybe because it's an EUD map?
[03:27 am]
m.0.n.3.y -- Can't upload maps to the DB. Error says "The action you have performed caused an Error". Any word?
[07:46 am]
RIVE -- :wob:
[2024-4-22. : 6:48 pm]
Ultraviolet -- :wob:
[2024-4-21. : 1:32 pm]
Oh_Man -- I will
[2024-4-20. : 11:29 pm]
Zoan -- Oh_Man
Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
You should do my Delirus map too; it's a little cocky to say but I still think it's actually just a good game lol
[2024-4-20. : 8:20 pm]
Ultraviolet -- Goons were functioning like stalkers, I think a valk was made into a banshee, all sorts of cool shit
[2024-4-20. : 8:20 pm]
Ultraviolet -- Oh wait, no I saw something else. It was more melee style, and guys were doing warpgate shit and morphing lings into banelings (Infested terran graphics)
[2024-4-20. : 8:18 pm]
Ultraviolet -- Oh_Man
Oh_Man shouted: lol SC2 in SC1: https://youtu.be/pChWu_eRQZI
oh ya I saw that when Armo posted it on Discord, pretty crazy
[2024-4-20. : 8:09 pm]
Vrael -- thats less than half of what I thought I'd need, better figure out how to open SCMDraft on windows 11
Please log in to shout.


Members Online: CarpetCleaningWokin, Roy