I'm creating a map and doing some heavy modification to the units. I'm trying to make it a bit of a rock paper scissors type of attack setup. For instance, I want any flamethrower type of attacks to be deadly to regular infantry style units but virtually useless against armored vehicles. I'm utilizing the weapon bonuses against "Biological" or "Light" or "Armored" etc to make this happen (I hope that's the right path and correct me if there is a better way).
What I don't know how to do is make it so that the AI player automatically attacks units that are weak against it's own attacks and ignore (or even retreat from) units that it can do little or no damage to. How would I go about doing this?
I haven't got to this stage of my map, but i also would be interested in a way to override attack move behavior.
Right now, units just attack the closest, but I would love to have some kind of target awareness. For example;
2 Marines and 1 Marauder are fighting 2 marines and a tank. Both are attack moving towards each other. marines out front, tank and marauder behind their respective marines. Right now, all 3 units on both sides attack the marines. I would like the tank to start attacking the marauder the second it gets into range, as an example, and of course the marauder would attack the tank back, as their weapons are more useful against armored.
If this is not what you had in mind OP, disregard my post :)
So the goal here is to make it so if you and the AI battle and you bring something like a group of hellions and the computer brought zerglings the computer would retreat instead of attacking, because your side countered it's side, right?
I'd suggest looking through the AI and AI Advanced triggers. I don't know if something like this will be very easy to do, but if it does exist, it'll be in that set of triggers.
I haven't got to this stage of my map, but i also would be interested in a way to override attack move behavior.
Right now, units just attack the closest, but I would love to have some kind of target awareness. For example;
2 Marines and 1 Marauder are fighting 2 marines and a tank. Both are attack moving towards each other. marines out front, tank and marauder behind their respective marines. Right now, all 3 units on both sides attack the marines. I would like the tank to start attacking the marauder the second it gets into range, as an example, and of course the marauder would attack the tank back, as their weapons are more useful against armored.
If this is not what you had in mind OP, disregard my post :)
This is EXACTLY what I was looking to do.
@Timthetoolman Retreating isn't absolutely necessary. I just mainly want the AI to choose their targets a little better. Just like DarkShape said. The Marauders attack the tank and the Marines attack the infantry because their respective weapons are more effective against those targets.
I would only want to expand this to a possible retreating scenario if a lone Marine came across a lone Tank. The marine's weapons would be ineffective in my map and therefore it would be better to run than to die. But if I can't accomplish this, it doesn't really affect my map all that badly. The attack waves I will have the AI send are going to be mixed attack waves with a few tanks and a large squad of infantry so all I really care about is that the AI picks it's targets based off of strengths and weaknesses rather than whoever is closest.
I think I'm starting to get onto something but I'd like some insight into how this works and if I'm doing it properly.
I see under Advanced AI, that there is an action called "Tactical AI - Cast" which "Suggests"...(???) an order to a unit. There is also an action called "Tactical AI Flee" which keeps a unit at a certain distance away.
I created a Trigger that checks if the Unit Type of Triggering Unit is a Marine and if the Owner of Triggering Unit is Player 6 (the sole AI player in my case). Then I'm creating some If-Then Statements to check if the Unit Type of Attacking Unit is a Reaper. If it is a Reaper, I'm "Suggesting" that the Marine attack the Reaper. I'd repeat this step for all of the unit types I'm looking for, but tell the Marine to either Flee or Attack based on the unit.
The problem I foresee is that this could send the Marine into a schizo frenzy of running away and attacking various units as they attack. I'm not sure what "Suggest" means and if I can set a priority order. For instance if a Tank comes and attacks, I want the Marine to begin to Flee but if a Reaper attacks at the same time, I want the Marine to hold his ground and attack regardless of the Tank until the Reaper is destroyed, then he can run away. How would I go about setting priority levels for orders?
After much more looking, I'm finding out that my Trigger idea was a really bad idea.
Instead it looks like there is a bunch of stuff in the Data editor that might work. I see an area called "Target Finds" under the Advanced section in the Data Editor. If you look at the Blink options, they have some sort of setup that tells the unit to Blink away if it's about to die or Blink towards a unit if that unit is running away and a whole bunch of other stuff based on what's happening. It uses the "Validators" section to decide what to do when different variables are reached.
If anyone has experience with this area, please let me know. Otherwise I'll try to update this thread as I start to figure stuff out. There is also an area called "Target Sorts" which I haven't even looked into yet but I have a feeling there will be more in that area as well.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'm creating a map and doing some heavy modification to the units. I'm trying to make it a bit of a rock paper scissors type of attack setup. For instance, I want any flamethrower type of attacks to be deadly to regular infantry style units but virtually useless against armored vehicles. I'm utilizing the weapon bonuses against "Biological" or "Light" or "Armored" etc to make this happen (I hope that's the right path and correct me if there is a better way).
What I don't know how to do is make it so that the AI player automatically attacks units that are weak against it's own attacks and ignore (or even retreat from) units that it can do little or no damage to. How would I go about doing this?
So you have a battlefield with units attacking each other regardless of their damage they inflict to their target?
If you can't find a better solution, you can always use the "Attack 1 Unit from Unit Group = Enemy in Region"
Member since 2010. Made the -The Thing- [Revival] game. Nostalgic of the WC3 days.
@Vicboy: Go
I haven't got to this stage of my map, but i also would be interested in a way to override attack move behavior.
Right now, units just attack the closest, but I would love to have some kind of target awareness. For example;
2 Marines and 1 Marauder are fighting 2 marines and a tank. Both are attack moving towards each other. marines out front, tank and marauder behind their respective marines. Right now, all 3 units on both sides attack the marines. I would like the tank to start attacking the marauder the second it gets into range, as an example, and of course the marauder would attack the tank back, as their weapons are more useful against armored.
If this is not what you had in mind OP, disregard my post :)
So the goal here is to make it so if you and the AI battle and you bring something like a group of hellions and the computer brought zerglings the computer would retreat instead of attacking, because your side countered it's side, right?
I'd suggest looking through the AI and AI Advanced triggers. I don't know if something like this will be very easy to do, but if it does exist, it'll be in that set of triggers.
This is EXACTLY what I was looking to do.
@Timthetoolman Retreating isn't absolutely necessary. I just mainly want the AI to choose their targets a little better. Just like DarkShape said. The Marauders attack the tank and the Marines attack the infantry because their respective weapons are more effective against those targets.
I would only want to expand this to a possible retreating scenario if a lone Marine came across a lone Tank. The marine's weapons would be ineffective in my map and therefore it would be better to run than to die. But if I can't accomplish this, it doesn't really affect my map all that badly. The attack waves I will have the AI send are going to be mixed attack waves with a few tanks and a large squad of infantry so all I really care about is that the AI picks it's targets based off of strengths and weaknesses rather than whoever is closest.
I think I'm starting to get onto something but I'd like some insight into how this works and if I'm doing it properly.
I see under Advanced AI, that there is an action called "Tactical AI - Cast" which "Suggests"...(???) an order to a unit. There is also an action called "Tactical AI Flee" which keeps a unit at a certain distance away.
I created a Trigger that checks if the Unit Type of Triggering Unit is a Marine and if the Owner of Triggering Unit is Player 6 (the sole AI player in my case). Then I'm creating some If-Then Statements to check if the Unit Type of Attacking Unit is a Reaper. If it is a Reaper, I'm "Suggesting" that the Marine attack the Reaper. I'd repeat this step for all of the unit types I'm looking for, but tell the Marine to either Flee or Attack based on the unit.
The problem I foresee is that this could send the Marine into a schizo frenzy of running away and attacking various units as they attack. I'm not sure what "Suggest" means and if I can set a priority order. For instance if a Tank comes and attacks, I want the Marine to begin to Flee but if a Reaper attacks at the same time, I want the Marine to hold his ground and attack regardless of the Tank until the Reaper is destroyed, then he can run away. How would I go about setting priority levels for orders?
After much more looking, I'm finding out that my Trigger idea was a really bad idea.
Instead it looks like there is a bunch of stuff in the Data editor that might work. I see an area called "Target Finds" under the Advanced section in the Data Editor. If you look at the Blink options, they have some sort of setup that tells the unit to Blink away if it's about to die or Blink towards a unit if that unit is running away and a whole bunch of other stuff based on what's happening. It uses the "Validators" section to decide what to do when different variables are reached.
If anyone has experience with this area, please let me know. Otherwise I'll try to update this thread as I start to figure stuff out. There is also an area called "Target Sorts" which I haven't even looked into yet but I have a feeling there will be more in that area as well.