• 🏆 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!

Ordered Units' Priority

Status
Not open for further replies.
Level 8
Joined
Aug 13, 2018
Messages
338
When you order a unit to attack-move a point, what's the ordered unit's priority?(For attacking)
Just think you want to create a map with a lot of walls, if attacking units prefer to attack nearest building,
may be them destroy all round walls, this takes a lot of time.(I know if one building attack them ther prefer to attack it instead of other buildings but it's very bad that every building can attack, a attacking gold mine heh)
I want to create some thing like "Clash of Clans" mobile game, I want to help me. What system I must use to units don't attack walls unless they have to. It's possible?
 
Level 8
Joined
May 21, 2019
Messages
435
I want create a building that units don't attack it unless have to as walls.
It's impossible in wc3?
Targeting priorities are based on attack type vs enemy armor type, combined with other parameters, such as prioritizing offensive units over non-combat units.
The thing is though, I am fairly certain that a unit would attack any enemy that enters its field of vision, if that's the only thing in it. It may extend this attack search somewhat, but it will definitely start attacking even non-combat structures, if they are encountered on their way to a target location.

The best way to solve this, is to make the walls neutral passive, and then use a blocking system to detect pathing blocks, and issue a command to attack the nearest wall when a block is detected. This way, walls are never attacked unless it's needed.
 
Level 3
Joined
Aug 6, 2019
Messages
74
This makes it even easier to make the walls incapacitated and other structures incapacitated, with a sacrifice of 0.01 damage
 
Level 8
Joined
May 21, 2019
Messages
435
Thanks a lot but how to use a blocking system?
Most of the mazing tower maps have such systems. Line tower wars, Wintermaul, etc.
They're fairly complex, and their default behavior is to destroy a blocking tower. However, they may serve as inspiration.

I am not a big "Clash of Clans" player, but as far as I recall, the bases are based in the center when you invade people, so that would be a 360 degree angle for entry, right?
What you need to do is separate units into groups based on behavior states, and then change all walls to neutral passive.
Then you check if units are advancing or not. If a unit is advancing, there's no need to do anything, just let it move towards the base.
If a unit is not advancing, and isn't currently attacking an enemy unit, you will order it to attack a nearby wall.
If a unit attacking a nearby wall is attacked, you will check to see if it can fight the attacking unit. If it fails to do so, you will put it into a group of units that will continue attacking a blocking wall until it is destroyed. This will make melee units consistently attack blocking walls when they can't fight the enemy, while ranged units will swap to attacking enemies if possible.
The trick is to run a few periodic checks for what the units options are at any given time, and then keep track of the units status using unit groups.

This is a fairly complex system, but it would be able to AI the priority on walls very very well.
 
Level 8
Joined
May 21, 2019
Messages
435
How to check it and what will happen if I use armor changes for targeting?
You can check if a unit is advancing, by checking its position in between intervals.
An advancing unit, should by default be a unit that is neither actively damaging, nor being actively damaged. So in other words, a unit that is moving.
You know that if a unit that isn't attacking/being attacked isn't moving, that it isn't advancing because it can't move. This leaves the conclusion, that the advancing unit has come to a halt due to a wall, so, the unit is then ordered to attack the nearest wall, and is moved to the "attacking wall" group.
 
Level 8
Joined
Aug 13, 2018
Messages
338
I think for my map it's not necessary to order units to attack only one wall, it's acceptable to destroy 2 or even 3 walls and then attack buildings, I just don't want when units see a lot walls nearby, destroy all of them and with changing armor types I can do this.
This is good enough for my map and I don't feel I must set a perfect system for this.
Thanks
 
Status
Not open for further replies.
Top