I'm just curious if I'm missing some arcane oddity with the way waypoints work. I've included a snippit of the trigger I'm using below. I've tried changing up the order of waypoints and targets, having only one waypoint, many waypoints etc.
Attack waves themselves work fine, but setting waypoints causes some issues. Most of the time, the AI will completely bypass the waypoints, and head straight to the attack destination. Occasionally, the AI will head most of the way to the attack destination, ignore the waypoint, then fall back to the gather point without ever attacking. Strangely.... every single time this happens ONE zergling breaks off from the main group and attacks while the rest retreat.
I'm at an absolute loss over what is causing this. I have no weird pathing problems, I've tried changing the locations of the waypoints and attack destinations, just to simple little areas in order to test, I've also tried adjusting the amount of time given for the attack to be performed, etc. Any help would be greatly appreciated.
Waypoints need to be added after you have set the target for the wave. Makes sense, right? Right?! No?!
"Arcane" is the right word to use when talking about attack waves (how does that "add unit type to wave" function know what player should add it? Magic!).
I'm fairly certain I tried that as well, in fact I know I did, but I will try getting it to work in a vacuum with your advice. Maybe something else was messing it up when I tried it that way. I'll post back either way.
Edit: Got it to work in one scenario, I think I may have figured out what my issue was... Will post back soon once I confirm.
This still results in the zerg moving to the first waypoint, (backwater rear path) then retreating back to their gather point, but sending one ling to the attack target, (without going to the second waypoint) I'm totally at a loss at the moment, is it not possible to set two waypoints for one attack wave?
The issue is, it's very difficult to test if the problem is unrelated to having two waypoints. Because I'm trying to get the zerg to go - around - their target and attack from the other side. If I just use one waypoint, more or less no matter where I put it, it's going to cause them to go through their target to get there (negating the waypoint entirely) or cause them to go to it and then double back.
Okay. So what I learned was, first of all, remember to turn off other triggers when attempting to test something in a vacuum... I had a redirect trigger on, incase the player changes bases, that... wasn't turning itself off, but this actually didn't solve the problem, though it wasn't helping at all.
More importantly:
The AI will consider a waypoint reached when the first member of an attack wave reaches the point
The AI will recalculate it's route to the next waypoint using the CENTER of the attack wave unit group
This created the problem for me. The zerglings were much faster than the accompanying hydralisk, when they reached the first point, the hydralisk lagging behind threw the center of the group off, and after recalculating, the AI decided the fastest route to the second waypoint was THROUGH the target. It was trying to get to the waypoint all along, adding a third waypoint, between the first and second fixed the problem. I've spent way too long trying to fix this, but hopefully this helps someone else out.
You can actually add units between setting all the points and sending the attack wave. When you set the units doesn't seem to matter, but that's how I do it. I call an action that sets the wave's target and waypoint information before every attack wave add unit/send statement. This let's me make sure that they units are attack the proper area.
Hopefully people who run into the weird issue of one unit being too far ahead, and your waypoints being in a spot between two paths will be able to find my findings useful, haha.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Edit: Problem solved below.
I'm just curious if I'm missing some arcane oddity with the way waypoints work. I've included a snippit of the trigger I'm using below. I've tried changing up the order of waypoints and targets, having only one waypoint, many waypoints etc.
Attack waves themselves work fine, but setting waypoints causes some issues. Most of the time, the AI will completely bypass the waypoints, and head straight to the attack destination. Occasionally, the AI will head most of the way to the attack destination, ignore the waypoint, then fall back to the gather point without ever attacking. Strangely.... every single time this happens ONE zergling breaks off from the main group and attacks while the rest retreat.
I'm at an absolute loss over what is causing this. I have no weird pathing problems, I've tried changing the locations of the waypoints and attack destinations, just to simple little areas in order to test, I've also tried adjusting the amount of time given for the attack to be performed, etc. Any help would be greatly appreciated.
Trigger Snippit:
PS. I've also tried making the attack location a point instead of a player group, with no change in the results.
Waypoints need to be added after you have set the target for the wave. Makes sense, right? Right?! No?!
"Arcane" is the right word to use when talking about attack waves (how does that "add unit type to wave" function know what player should add it? Magic!).
@Tolkfan: Go
I'm fairly certain I tried that as well, in fact I know I did, but I will try getting it to work in a vacuum with your advice. Maybe something else was messing it up when I tried it that way. I'll post back either way.
Edit: Got it to work in one scenario, I think I may have figured out what my issue was... Will post back soon once I confirm.
Edit 2: Well.... I got "a" waypoint to work,
This still results in the zerg moving to the first waypoint, (backwater rear path) then retreating back to their gather point, but sending one ling to the attack target, (without going to the second waypoint) I'm totally at a loss at the moment, is it not possible to set two waypoints for one attack wave?
The issue is, it's very difficult to test if the problem is unrelated to having two waypoints. Because I'm trying to get the zerg to go - around - their target and attack from the other side. If I just use one waypoint, more or less no matter where I put it, it's going to cause them to go through their target to get there (negating the waypoint entirely) or cause them to go to it and then double back.
PROBLEM SOLVED!
*/Plays victory fanfare/*
Okay. So what I learned was, first of all, remember to turn off other triggers when attempting to test something in a vacuum... I had a redirect trigger on, incase the player changes bases, that... wasn't turning itself off, but this actually didn't solve the problem, though it wasn't helping at all.
More importantly:
This created the problem for me. The zerglings were much faster than the accompanying hydralisk, when they reached the first point, the hydralisk lagging behind threw the center of the group off, and after recalculating, the AI decided the fastest route to the second waypoint was THROUGH the target. It was trying to get to the waypoint all along, adding a third waypoint, between the first and second fixed the problem. I've spent way too long trying to fix this, but hopefully this helps someone else out.
1. Add units to attack wave
2. Set target point
3. Set way points
4. Set gather point
5. Send attack wave
@Terhonator: Go
You can actually add units between setting all the points and sending the attack wave. When you set the units doesn't seem to matter, but that's how I do it. I call an action that sets the wave's target and waypoint information before every attack wave add unit/send statement. This let's me make sure that they units are attack the proper area.
Hopefully people who run into the weird issue of one unit being too far ahead, and your waypoints being in a spot between two paths will be able to find my findings useful, haha.