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
In the map I'm working on there are
computer controlled air units following a given patrol route. They are to attack every enemy that comes into range.
The principle works fine, but I do not order them every trigger loop because the attack would become choppy since I'm using hypertriggers. So now it sometimes happens that the first 3 units of a group of 6 enter the waypoint and are ordered to the next, but the last 3 come right after the order and thus
patrol back the path until the next order thus weakening the group.
I understand this can be improved by bigger waypoints or shorter delays between the orders. But both have disadvantages: shorter delay ->
choppier battles; bigger locations ->
edges of the given path are cut offSo is there a way to completely avoid the mentioned
(red) drawbacks or do I have to live with balancing it until all requirements are adequately met?
Let me try to figure out what you are saying. There are 6 air units that patrol to a location. 3 of them reach the location earlier than the other 3, the last 3 miss it and patrol back before the order happens again.
Are the air units invincible? If so, you could add a trigger for each waypoint that makes each air unit stop when reaching the waypoint. Then you could add a condition for the regular waypoint order trigger that only issues the order if ALL 6 are in the location.
None.
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
6 units, 3 lagging behind was only an example. There are any number of units, different types and they can spawn at any place on the map, fly to the nearest waypoint (possibly join up with other units there) and from there follow the path until its end.
And they are not invincible (which doesn't make any difference anyways)
I might be missing something, but it seems to me that you could just switch from patrol to attack since that's basically what it's doing.
None.
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
The point is comp units on attack order ignore enemies until being fired upon. Thats why I need to use patrol.
IC. You could make a system that detects when a new unit enters the location, then give the patrol order to all units in it.
None.
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
Thats what I'm doing (sort of). But with delay. If I ordered them constantly while within that location battles would be choppy there.
EDIT: The problem is that they can be anywhere on the map and are ordered to the nearest waypoint...
But you made me find new ideas... to complex to explain now... I'll experiment first and post if I found something useful.
Post has been edited 1 time(s), last time on Nov 10 2007, 4:56 am by NudeRaider.
An artist's depiction of an Extended Unit Death
Let me try to figure out what you are saying. There are 6 air units that patrol to a location. 3 of them reach the location earlier than the other 3, the last 3 miss it and patrol back before the order happens again.
Are the air units invincible? If so, you could add a trigger for each waypoint that makes each air unit stop when reaching the waypoint. Then you could add a condition for the regular waypoint order trigger that only issues the order if ALL 6 are in the location.
That's what I was thinking. But if you can't use a numerical check, you could say, put a location in the path right before the location (If I need to elaborate this just give the word). Therefore you could order them to patrol to their next destination if no unit is in the location prior to the waypoint location
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
That's what I was thinking. But if you can't use a numerical check, you could say, put a location in the path right before the location (If I need to elaborate this just give the word). Therefore you could order them to patrol to their next destination if no unit is in the location prior to the waypoint location
Oh, don't focus your efforts too much on forming groups. I'd like to have all units follow the path and fight with as few interruptions as possible. Even if there IS a unit a few cm behind, the first shouldn't wait for it, but also the 2nd should not fly back - just follow the path without dertours.
If ALL units would fly an extra circle at the waypoint it would be ok (id it isn't avoidable).
Controlling where the units spawn is part of the game. So if you placed your spawns correctly they join up and form a (virtual) group, which is good.
On the other hand when you didn't place the spawns well the "penalty" should be that your units get killed 1 by 1.
I have an idea.
Try having a smaller waypoint location and less of a delay timer.
I'm thinking a 1x1 location and a 0 delay.
This will in effect make sure that they will NEVER go backwards in their patrol.
The location should also be small enough where they will move into it, out of it, and then be free to attack again without much stutter.
Downsides: If they are attacked when they leave the 1x1 location, they might be drawn back over the location and told to patrol again elsewhere.
I'm thinking less is more in this situation, if you don't want 50 air units converging on one single square,
you could distribute 3 or 4 small locations and direct them randomly to them.
This would require some testing to see how it works in practice.
Hugel
None.
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
I have an idea.
[...]
Hugel
This was part of my idea too. But it wasnt enough. To understand that you would have to see the exact path relative to the gigantic locations that order the units from anywhere to the nearest waypoint.
Suffice to say that the waypoints are not at the edges of the gigantic locations (this has to be that way). Which means as soon as they leave the waypoint they are only in the gigantic location. It takes some seconds until they reach the next location. And when in that moment the order comes, they fly back.
The solution here were locations that are like rails. Since the paths are only horizontal and vertical (90° turns) I placed very slim loctions (0,5 x 15-20) between the waypoints. Directly after (in the trigger below) a unit gets the order from the gigantic location to fly back all units in the rails are ordered to the correct next waypoint, overwriting the previous wrong order within ms.
Could someone understand that? O.o Hard to explain it without a picture.
Well, however, thanks for your ideas, which helped me find the solution.
There is no need to spread units. The above system works fine even if 10 units reach the waypoint the same time.