Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Direction continuation
Direction continuation
Jul 5 2008, 6:38 pm
By: Kaias  

Jul 5 2008, 6:38 pm Kaias Post #1



Does anyone know of a good way of keeping units along their current trajectories?

For instance, if I wanted an observer to move from my unit to an enemy unit but continue past the location on him, what would be the best way of going about this? (Units being in any given spot at any time, of course) After giving some thought into it, the only plausible thing I could come up with is to make a mobile grid around the target, detect where the observer is before it hits and then tell it to move within the grid according to previous location. This could be a real pain though, and I'm guessing pretty inaccurate.

Got anything better?

Edit: While I'm here, may as well ask if there is a way to slow down air units like you can ground



None.

Jul 5 2008, 7:30 pm Falkoner Post #2



Nah, the mobile grid method is really the best way, and I think it will be quite accurate. Of course, if more than one observer can be hitting him at a time, that may be a problem, can more than 1 hit him at a time?



None.

Jul 5 2008, 8:44 pm JaFF Post #3



Quote from Falkoner
Nah, the mobile grid method is really the best way, and I think it will be quite accurate. Of course, if more than one observer can be hitting him at a time, that may be a problem, can more than 1 hit him at a time?
Quite accurate? Are you kidding? The grid gives only 8 possible directions (16 if you make it a 5x5). The most accurate way is to follows these steps:
1. Detect the coordinate of the unit the ovserver is flying from
2. Detect the coordinate of the unit the observer is moving to
3. Calculate the X and Y difference between them using binary countoffs.
4. Add those X and Y differences to the unit's coordinates (any unit from the two) until you leave the 'arena'.
5. Order the observer to move to the coordinate calculated in the previous step by using either mobile grids or location grids, or a combination of those.

Of course there is a question of this being rational... is what you're trying to do really essential for your map? If yes, then use it; if not don't use it or use the so-so accurate methose Falkoner posted.

Also forgot to say that with my method, you can handle any amount of observers heading at the same player, as long as you do all the desctibed actions for every observer.



None.

Jul 5 2008, 9:06 pm Kaias Post #4



I'll use the coordinate system, if I find more use for them in other things.



None.

Jul 6 2008, 2:23 am Bolshevik Post #5



quick question, what are the triggers for the grid system?



None.

Jul 6 2008, 2:38 am Kaias Post #6



Quote from Bolshevik
quick question, what are the triggers for the grid system?
http://www.staredit.net/?p=tutorials&tut=47

Then you'd just have to do some math to find your trajectory (Or is this what you wanted to know?)



None.

Jul 6 2008, 2:42 am CecilSunkure Post #7



Quote from JaFF
Quote from Falkoner
Nah, the mobile grid method is really the best way, and I think it will be quite accurate. Of course, if more than one observer can be hitting him at a time, that may be a problem, can more than 1 hit him at a time?
Quite accurate? Are you kidding? The grid gives only 8 possible directions (16 if you make it a 5x5). The most accurate way is to follows these steps:
1. Detect the coordinate of the unit the ovserver is flying from
2. Detect the coordinate of the unit the observer is moving to
3. Calculate the X and Y difference between them using binary countoffs.
4. Add those X and Y differences to the unit's coordinates (any unit from the two) until you leave the 'arena'.
5. Order the observer to move to the coordinate calculated in the previous step by using either mobile grids or location grids, or a combination of those.

Of course there is a question of this being rational... is what you're trying to do really essential for your map? If yes, then use it; if not don't use it or use the so-so accurate methose Falkoner posted.

Also forgot to say that with my method, you can handle any amount of observers heading at the same player, as long as you do all the desctibed actions for every observer.


Allright thats the math part.. but can you detect where the observer is heading/is with EUD's, and order the unit to move to the new coordinates? If not, would you have to grid your entire map with locations?



None.

Jul 6 2008, 2:44 am Falkoner Post #8



Yeah, that's the same problem I noticed, also, I realized that if you want to make it more accurate, you could do a ground unit grid, providing the ground units are placeable.



None.

Jul 6 2008, 8:32 am JaFF Post #9



Not necessairly a ground unit grid. You can make the X and Y coordinate axis with pre-placed units for both coordinate detection and setting the final destination location (first travel on one of the axis and then move with a mobile grid from there).



None.

Jul 6 2008, 1:02 pm Clokr_ Post #10



You could try to implement something like this http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm
It is a very simple algorithm which draws a line given its source and destination points. I think it only uses additions and substractions (no multiplications or divisions).

Although the map could become very complex.



?????

Jul 6 2008, 1:58 pm Ahli Post #11

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

lethal_illusion just showed me a map where he used that.
maybe you should ask him :bleh:




Jul 6 2008, 11:23 pm Kaias Post #12



Quote from Kaias
While I'm here, may as well ask if there is a way to slow down air units like you can ground
Anyone?



None.

Jul 7 2008, 11:16 am NudeRaider Post #13

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from Clokr_
You could try to implement something like this http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm
It is a very simple algorithm which draws a line given its source and destination points. I think it only uses additions and substractions (no multiplications or divisions).

Although the map could become very complex.
You'd still have the problem where your ending point is - the point the unit you're trying to intercept is flying to.




Jul 7 2008, 12:41 pm Clokr_ Post #14



Yeah, of course. If there's no other method you could let it fly for a given amount of time then use its current position as the end point. It would be quite accurate.



?????

Jul 7 2008, 7:47 pm Falkoner Post #15



Yeah, you can get it accurate, just not THAT accurate.

Quote
While I'm here, may as well ask if there is a way to slow down air units like you can ground

Not really, the only ways I know of make the player have to reselect it or keep clicking rapidly to make it move at all.



None.

Jul 16 2008, 3:39 am Zombiechao Post #16



(WARNING UNTESTED)I got a good idea but it'd only work for drones scvs and probes. Center a 1 pixel big location on a power up (that the drone carries) and order the drone to move to it. The drone will never reach it because the drone carries the power up in front of it. It is like a carrot on stick.



None.

Jul 16 2008, 4:17 am FoxWolf1 Post #17



Quote from Zombiechao
(WARNING UNTESTED)I got a good idea but it'd only work for drones scvs and probes. Center a 1 pixel big location on a power up (that the drone carries) and order the drone to move to it. The drone will never reach it because the drone carries the power up in front of it. It is like a carrot on stick.

I tested this with a drone and a crystal, and it doesn't work. Nice idea, though.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[09:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[07:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[06:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
[03:33 pm]
O)FaRTy1billion[MM] -- o sen is back
[2024-4-27. : 1:53 am]
Ultraviolet -- :lol:
[2024-4-26. : 6: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.
[2024-4-26. : 6: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
[2024-4-26. : 6: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?
[2024-4-26. : 6:49 pm]
Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
[2024-4-26. : 6:48 pm]
Vrael -- On this Topic, I could definitely use some Introductions.
Please log in to shout.


Members Online: jun3hong