- Joined
- Jul 10, 2007
- Messages
- 6,306
So lately I've been working on indexing projectiles in wc3, but I've run into a couple of problems.
The design I've decided upon creates a queue for each unit on the map and queues up each attack they do. Because attacks on a specific target/coordinate typically happen in order, this design actually works. The only problem I have is if there is if a unit fires a slow projectile, runs in front of it, and then fires again at the exact same target. Upon impact, it'll treat projectile 2 as projectile 1 and projectile 1 as projectile 2.
Keep in mind when I say projectiles, I am talking about warcraft 3 projectiles, not custom projectiles. There is no way to actually reference these projectiles. My technique uses probability to determine which projectile actually hit a unit (also works on melee). The probability happens to be 100% in every case but the one I mentioned.
So, does anyone have any ideas for dealing with that last case, or should I just work on the system and say maps cannot have projectiles that move slower than the movement speed of the unit that fired it and a map cannot have attacks that shoot projectiles at differing speeds at the same target.
Tx.
The design I've decided upon creates a queue for each unit on the map and queues up each attack they do. Because attacks on a specific target/coordinate typically happen in order, this design actually works. The only problem I have is if there is if a unit fires a slow projectile, runs in front of it, and then fires again at the exact same target. Upon impact, it'll treat projectile 2 as projectile 1 and projectile 1 as projectile 2.
Keep in mind when I say projectiles, I am talking about warcraft 3 projectiles, not custom projectiles. There is no way to actually reference these projectiles. My technique uses probability to determine which projectile actually hit a unit (also works on melee). The probability happens to be 100% in every case but the one I mentioned.
So, does anyone have any ideas for dealing with that last case, or should I just work on the system and say maps cannot have projectiles that move slower than the movement speed of the unit that fired it and a map cannot have attacks that shoot projectiles at differing speeds at the same target.
Tx.