Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Direction from One Point to Another
Direction from One Point to Another
This topic is locked. You can no longer write replies here.
Oct 11 2009, 10:51 pm
By: Falkoner  

Oct 11 2009, 10:51 pm Falkoner Post #1



Okay, here's the problem, I have 2 units on the map, both different units, (not like it matters much anyway), and what I need to do is detect which direction the second unit is relative to the first, like is it up and to the right, etc, so does anyone have any ideas for a conservative but fast system?

Currently I have only 2 ideas, both of which aren't as conservative/fast as I'd like, here they are:
1. Have long map-length locations for horizontal and vertical, and then send out devourer mobile grids in all directions, centering the long locations on the outermost devourers until both locations touch the other unit, then I know which direction it is based on which two directions it took for the long locations to touch it.

2. Make a small mobile grid around first unit, create an observer and order it to the second unit, see which location the observer goes to.

Any other ideas?



None.

Oct 11 2009, 11:08 pm rockz Post #2

ᴄʜᴇᴇsᴇ ɪᴛ!

Drop locations all over the map. The less precise you need to be, the easier it is. (40 locations used, accuracy within 40 squares on a 256x256 map) Obviously this one can be improved with some preplaced burrowed units, and only use 1 location.
Alternatively, do some not so precise x/y calculations with ~10 horizontal and vertical locations each on each unit (40 locations used, accuracy within 13 squares on a 256x256 map).



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Oct 11 2009, 11:10 pm Falkoner Post #3



This needs to be somewhat precise, within 5 or so squares of the destination location, also, using burrowed units isn't an option, because about 50% of my map is covered in water(this is Mystic Islands RPG), and observers aren't an option because they would block mobile grids(In my second one I actually plan on using a cloaked/stacked zergling).

Any others? :P



None.

Oct 11 2009, 11:14 pm Vrael Post #4



You could simply store the direction with use of quickly putting a burrowed unit under each of the two end points. Its obviously completely useless if you're trying to do some calculations with death counts or something, but if you need to order a unit in that direction later you'll have the direct positions of the origin and destination stored in the burrowed units.

Can we detect the intersection of two locations in any way? If we could then you could use a long thin vertical on one unit and a long thin horizontal on the other and find the intersection... but I don't think that works.



None.

Oct 11 2009, 11:20 pm Falkoner Post #5



I don't need to store their locations, I need to figure out the distance between the two points, and for that I first need to know which direction the second point is in(at least to do it quickly, anyway).



None.

Oct 11 2009, 11:37 pm Kaias Post #6



You could use Inverted locations to track the two units' movements, and thereby know their coordinates (see attachment). That way, the difference could be found by a mere binary count off.

A more grotesque method would be to center a location on both of the units, create a scourge over one and order it to the other. Mobile grid two locations to the right and below to see which direction the scourge went. It would take only 1 loop (the scourge would be briefly visible though) with precise location measurements.

One way to find out which on was leftmore easily by creating two identical (unique) burrowed units under these two units, centering a location on said burrowed units and seeing which of the two units is in that location. Finding which of them is upmore would be a lot more heinous.

Obviously map resources are an issue here. You could always use a Location Grid and get all the benefits of it if you're willing to put a bit of effort into it.



None.

Oct 11 2009, 11:47 pm Falkoner Post #7



Okay, Kaias, you were the one who I thought might have a more elegant solution, but I see there really is none, so I'll go with my second idea, it should work the best. A mod can lock this now :)



None.

Oct 12 2009, 12:07 am Kaias Post #8



Quote from Falkoner
Okay, Kaias, you were the one who I thought might have a more elegant solution, but I see there really is none, so I'll go with my second idea, it should work the best. A mod can lock this now :)
Frankly there is no Starcraft mechanic that would easily allow for detecting which unit is above the other. I also didn't notice your number 2 (as you probably guessed since I suggested the exact thing).

However, I can improve on the movement idea. Use the burrowed unit method to detect which unit is leftmost, then left shift two locations from the two units and mobile grid a location below one of them and create/order the scourge from there (I say below because it is the easiest direction to mobile grid); this way the detection is completely invisible. It would cost just as many locations, as well (one to left shift, one to be the proper size to quickly detect the scourge movement direction), and that is only if you want it to be detected within 84 milliseconds.



None.

Oct 12 2009, 12:10 am Falkoner Post #9



Well, I don't really need to do it out of sight if I'm using an observer, also, I plan on using a permacloaked ground unit to do it, so it doesn't mess up any other possible mobile grids.



None.

Oct 12 2009, 12:16 am Kaias Post #10



Quote from Falkoner
Well, I don't really need to do it out of sight if I'm using an observer, also, I plan on using a permacloaked ground unit to do it, so it doesn't mess up any other possible mobile grids.

Using an observer on screen is both tacky and still visible and left shifting solves the mobile grid problem. Using a permacloaked ground unit is a mistake unless there are no possible obstructions between the two units, since ground units are subject to pathfinding.

Edit: You can even bypass the slowdown caused by the burrowed unit method for detecting leftmost by doing the same thing upshifted. That issue is rather minor though, since you aren't doing it constantly.

Post has been edited 1 time(s), last time on Oct 12 2009, 12:22 am by Kaias.



None.

Oct 12 2009, 12:35 am rockz Post #11

ᴄʜᴇᴇsᴇ ɪᴛ!

Hmm, I don't have the patience to understand this, but this might work for you.
http://www.staredit.net/maplantis/index.php?sid=29ed2156c4;map=31



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Oct 12 2009, 12:51 am Falkoner Post #12



Kaias, you're right, pathfinding issues will be bad, however, I cannot use observers, because they cannot possibly mess up my mobile grids.

rockz, too trigger intensive for my liking, I know how it works, and this can be done much simpler.

My final solution: Use burrowed units underneath(Kaias' suggestion) to detect which one is leftmost, and I'll also use a long vertical location, in case they're on the same X coordinate, and then just use a devourer mobile grid to figure out the top or bottom, (I have a pretty efficient way of covering large distances with devourers), and that should do it :) Also, I need to figure out the distance, so I can get that at the same time as I'm figuring out whether it's high or low :)



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[2024-5-02. : 1:19 pm]
Vrael -- IM GONNA MANUFACTURE SOME SPORTBALL EQUIPMENT WHERE THE SUN DONT SHINE BOY
[2024-5-02. : 1:35 am]
Ultraviolet -- Vrael
Vrael shouted: NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
Gonna put deez sportballs in your mouth
[2024-5-01. : 1: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: eksxo