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.
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.
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.
I'll use the coordinate system, if I find more use for them in other things.
None.
quick question, what are the triggers for the grid system?
None.
quick question, what are the triggers for the grid system?
http://www.staredit.net/?p=tutorials&tut=47Then you'd just have to do some math to find your trajectory (Or is this what you wanted to know?)
None.
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.
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.
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.
You could try to implement something like this
http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithmIt 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.
?????
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
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
You could try to implement something like this
http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithmIt 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.
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.
?????
Yeah, you can get it accurate, just not THAT accurate.
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.
(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.
(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.