• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Massed squads having movement problems

Status
Not open for further replies.
Level 13
Joined
Oct 12, 2016
Messages
769
I've got a test map for some squad based combat stuff.
It's going all fine in small scale, but once a large number of squads (6 - 10+) are present, funny things happen like:
- Random movement
- No movement
- Nearby squads being given separate commands, but either not responding or sharing the same command

Now, I know it's probably the JASS, and I'll admit: my knowledge in it is limited.
The squad system is nicked (literally) from Em! and Mechanical Man, whom I will credit, and of which is modified and reorganised greatly.

So, what I'm asking is:
  • Can anyone identify the problem, refine it, and demonstrate it through the test map attached?
Or:
  • Can anyone offer a different kind of squad-based system that can be used in version 1.29+ of Warcraft 3? (not for WEX, sharpcraft, etc... I've looked at other systems in the spell section, and I want to be able to save and operate them in the original editor)
I'm also willing to sit down and discuss things in discord or through conversations. I'll credit and +rep people who help solve this.
Additional information that may be handy:
- Squad leaders have mana to indicate squad size, the Reinforce ability is triggered for squad reinforcements
- Squad leaders and units are all set as variables
- Squad movement triggers are all in the "Squad" catagory
- Squads are controlled by a dummy player that's 6 player numbers above the controller (variable: TranslatePlayerNumber)
 
Level 13
Joined
Jul 15, 2007
Messages
763
I had a quick look at the map and the most consistent observation i made was that if there are multiple (10+) squads in an area (about a screen's worth) that are all currently pursuing a command (attack, move, patrol) then i would see squad movement become very disorganized. Eventually members of a squad could end up being separated by distance if you tried to move them out and then issued a stop command later. I am inclined to think this is a pathing limitation on WC3's end and not so much your coding.
(Also issuing a stop or hold position command under these circumstances caused a massive lag spike).

That said even when using pointbreak and having 243/100 food i couldn't reproduce your problems of "Nearby squads being given separate commands, but either not responding or sharing the same command". I would say "Random movement" occurs when pathing gets congested and "No movement" is a possibility when you can separate squadron members via crappy pathing after issuing a stop command. When stop/hold position is ordered there should be a check to make sure your other squadron members are actually near their leader.

After some more thought one thing you should keep in your mind is that a computer player can only handle ~75 units before unit movement becomes impaired. I think your squadron system is really nice, but once a lot of squadrons for any particular player exist, their performance will drop pretty quickly. Given that squadrons contain 9 units (8 owned by a dummy player), 10 squadrons sounds like the moment you can expect the dummy player's AI to go into meltdown.
 
Level 13
Joined
Oct 12, 2016
Messages
769
Hm.
Do you think reducing collision sizes would help, and/or smaller squad sizes?
I'd prefer not to do that, but performance is an issue. I kinda like the feeling of epicly large battles.

Also, would larger, more open terrain help?
 
Level 13
Joined
Jul 15, 2007
Messages
763
I think less collision sizes would help, though like you say this would make your epic large battles feel a bit... compact.
Smaller squad sizes would also help and would be better option, but all that does is delay the problem.. instead of issues around 10 squadrons you'll get them at 20 squadrons or whatever.

As an idea you could make it so squads "don't stick together" in combat unless directly told to (or as a toggle ability), otherwise you may always end up with situations with multiple squads trying in vain to move through each other.
 
Level 13
Joined
Oct 12, 2016
Messages
769
like you say this would make your epic large battles feel a bit... compact.
Yea, I was testing it out and noticed that. With a collision size of 16, they don't clip into each other.
With 12 or 8, they get very bunched up.
I could just keep ranged units with a collision of 12, that seems to work for units moving through those squads.
I'm trying out smaller squad sizes and reducing the food limit to ensure this. Now, I just need to see how this works in a real game.
I think there's also a real value I can adjust for when squad members get too far apart, hmm.

EDIT:
After playing around with things and adjusting it, simply reducing squad sizes was enough. That and adjusting real values for regrouping squads, while limiting food use.
 
Last edited:
Status
Not open for further replies.
Top