Posted: Mon Jun 27, 2011 1:34 am Post subject:
Advanced AI tactics
I'll be posting some interesting AI mechanics / tactics in this topic as I make progress with the AI. The first one is APC attacks on units, harvesters in this case. Normally APCs operate on buildings only, so this takes a bit of a hacky way.
The Nod AI will benefit from this tactic alot, it will be using subterranean APC attacks on harvesters, vehicles and infantry, in addition to attacking specific buildings.
Other interesting things coming up soon are AI and mines, each side makes use of their mines in different ways. The AI will also be using sensor arrays both in defence and offense, so don't expect to hide under a stealth generator for the entire match anymore _________________ QUICK_EDIT
Are you saying that APC only attack buildings? Your video looks like you dropped off the troops near the harvestor, deployed and then attack. The scripting will allow you to attack whatever you want them to. _________________ I am authorized to send out the TMP Studio, PM ME IF YOU WANT IT And check this out, these were sent to me for help with terrain and zdata help along with TMP Studio/Builder
Well spotted, Nikademis.
I'm glad that he didn't mention that in the post, or you wouldn't have added anything to the topic by posting.
SuperJoe, this is rather good. What other plans do you have for your AI? Can we expect to see the AI making more use of other things - carryalls and the like? QUICK_EDIT
This is cool SuperJoe. Maybe you should also try to let them enter the transport again, after they have killed the target or a certain amount of time is over.
Or create separate teams, let the passengers keep attacking and the APC drive back home (should be more useful for Nod so the SubAPC isn't always going only on a suicide mission) _________________ SHP Artist of Twisted Insurrection: Nod buildings
This is cool SuperJoe. Maybe you should also try to let them enter the transport again, after they have killed the target or a certain amount of time is over.
Or create separate teams, let the passengers keep attacking and the APC drive back home (should be more useful for Nod so the SubAPC isn't always going only on a suicide mission)
The best thing would have been to get them to attack a single harvester, then re-enter the APC, attack the next harvester, re-enter APC, etc. Unfortunately the team will keep attacking until you have no harvesters / refineries left. I did get them to re-enter the APC after they have finished their mission (all harvs / refs dead), but I can't get them to go back to their own base. I've tried multiple scripts but afaik there is no script to call them back home. So instead I made them re-enter the APC and move on to attack enemy factories next.
I also couldn't get the APC to go back to base after deploying the infantry. There is the TeamType key TransportsReturnOnUnload=yes, but every single original Westwood APC team has the key, yet the APCs never return home. Also the hacky way of getting the APC to deploy troops next to a unit (not a building) doesn't use the script action Unload (8,n), so I haven't been able to separate the APC from the infantry, they all remain in the same team. However I'm still testing this and hope I can get the whole team or APC to go back to base once they are done, it would certainly look "intelligent"
Orac wrote:
SuperJoe, this is rather good. What other plans do you have for your AI? Can we expect to see the AI making more use of other things - carryalls and the like?
I am definitely looking into making AI use carryalls. Probably need some more AI-only-hack-vehicles, but that seems to be the case for anything smarter... _________________ QUICK_EDIT
Joined: 18 Jun 2005 Location: Dordrecht, the Netherlands
Posted: Mon Jun 27, 2011 5:14 pm Post subject:
Iirc, Nod Sub APC's sometimes do return to the base, but this may be my memory failing on me though.
Anyways, I'm interested in how you made this. I assume it has something to do as this:
-create team
-load in APC
-APC 'attacks' (read as: moves to) enemy harvester
-APC unloads inf
-another attack order is given
-repeat
Am I correct if I say it is something like that? QUICK_EDIT
Well spotted, Nikademis.
I'm glad that he didn't mention that in the post, or you wouldn't have added anything to the topic by posting.
SuperJoe, this is rather good. What other plans do you have for your AI? Can we expect to see the AI making more use of other things - carryalls and the like?
Is this a flame? I have made an AI file before and he hasn't accomplished anything new that hasn't been done before. IMJ........Maybe people don't try to create AI files....I have created some that worked so well it ticked me off, getting whipped in 15 min by the 4 AI teams can be frustrating... _________________ I am authorized to send out the TMP Studio, PM ME IF YOU WANT IT And check this out, these were sent to me for help with terrain and zdata help along with TMP Studio/Builder
Joined: 13 Feb 2007 Location: C:\Westwood\ TechLevel=12
Posted: Tue Jun 28, 2011 3:45 am Post subject:
Using sensor arrays in offense role... Did get my AI to do that also leting the AI use the pre-charged EMP Tank is fun but can piss you off when the go after Harvester... _________________
Iirc, Nod Sub APC's sometimes do return to the base, but this may be my memory failing on me though.
Anyways, I'm interested in how you made this. I assume it has something to do as this:
-create team
-load in APC
-APC 'attacks' (read as: moves to) enemy harvester
-APC unloads inf
-another attack order is given
-repeat
Am I correct if I say it is something like that?
It really does attack the harvester since you can't order units to move to another unit, only to move to buildings. Also no unloading script is used, it unloads the infantry when it attacks (AI only copy of APC in rules.ini).
Nikademis Von Hisson wrote:
Is this a flame? I have made an AI file before and he hasn't accomplished anything new that hasn't been done before. IMJ........Maybe people don't try to create AI files....I have created some that worked so well it ticked me off, getting whipped in 15 min by the 4 AI teams can be frustrating...
I said that under normal circumstances an APC cannot be sent to go after a unit and deploy the infantry to attack it. You have to create a separate AI-only vehicle for it in rules.ini. At least this was the only way I could get it to work. Or adjust the default APC but then it will display an attack cursor.
Allen wrote:
Using sensor arrays in offense role... Did get my AI to do that also leting the AI use the pre-charged EMP Tank is fun but can piss you off when the go after Harvester...
I have a similar attack team for the Forgotten AI, they will deploy some floaters to create EMP blasts, while the rest of the floaters (who themselves are immune to EMP) finish off the harvester. Quite annoying but that's what a smart AI is supposed to be. _________________ QUICK_EDIT
Joined: 13 Feb 2007 Location: C:\Westwood\ TechLevel=12
Posted: Tue Jun 28, 2011 7:55 pm Post subject:
SuperJoe wrote:
I said that under normal circumstances an APC cannot be sent to go after a unit and deploy the infantry to attack it. You have to create a separate AI-only vehicle for it in rules.ini. At least this was the only way I could get it to work. Or adjust the default APC but then it will display an attack cursor.
Giving the APCs the abitly to deploy by deploy to fire is not a bad thing. I would give the APCs a GuardRange=0.
GuardRange=0 is also a good thing to add to Player EMP tanks. Its not funny when you own EMP Tank tries to attack and deploys in group of 20 friendly Titans. The AI got most of them... _________________
Giving the APCs the abitly to deploy by deploy to fire is not a bad thing. I would give the APCs a GuardRange=0.
GuardRange=0 is also a good thing to add to Player EMP tanks. Its not funny when you own EMP Tank tries to attack and deploys in group of 20 friendly Titans. The AI got most of them...
That is why I made separate AI only copies of the APCs so they wouldn't display an attack cursor. Even with GuardRange=0 I believe they will fire if an enemy unit opens fire on them. An APC firing will empty it even for human players.
Though creating AI-only copies of APC and EMP tank has some issues, the water version of APC voxel is tied to [APC] unit name specifically I think. Also there can only be one unit with the EMP tank logic, but that could be solved with this (I've made an AI-only version of the EMP tank with this logic, though I'm currently not using it). Though maybe having the EMP tank display an attack cursor is not really that bad thing, I guess it could make sense that you can order it to attack someone to release the blast. But human players might exploit it by making it retaliate and thus release the blast even when you don't want to.
I found one issue with Amphibious APC having a fake weapon. If you go over water with it, the game will instantly crash. This happens for both human and AI players. To get around it I gave the AI version of the APC MovementZone=Crusher instead of AmphibiousCrusher, so it never goes over water. This crash might happen with Hovering APCs too, though I didn't test it. _________________ QUICK_EDIT
Joined: 13 Feb 2007 Location: C:\Westwood\ TechLevel=12
Posted: Wed Jun 29, 2011 11:50 pm Post subject:
Okay...
I gave the Amphibious APC Primary=Minigun, GuardRange=0 and DeployToFire=yes. One APC was in Guard and the other was in Area Guard both did not retaliate if attacked. They did crush my Inf I put them right next to the APC and let them fire on it.
I also did not get a game crash if I ran the APC over water like you got. _________________
I gave the Amphibious APC Primary=Minigun, GuardRange=0 and DeployToFire=yes. One APC was in Guard and the other was in Area Guard both did not retaliate if attacked. They did crush my Inf I put them right next to the APC and let them fire on it.
I also did not get a game crash if I ran the APC over water like you got.
I meant a human controlled APC with primary and DeployToFire will retaliate and empty its crew once fired upon by an enemy unit. It doesn't help if it has GuardRange=0 and NoAutoFire=yes. This is why I gave AI its own copy of the APC, and also so the human version doesn't display the attack cursor. It's not a huge issue, but it could be exploited by firing on the APC to force the crew out (when you aren't looking and unable to manually stop it).
EDIT: OK scratch that, it can be stopped with a fake weapon that has Damage=0 (though the warhead verses should still be at least 1% so it will be able to target everything). So the only oddity in it is the attack cursor, though you could say it makes sense since you could order the APC with a group of other units to attack something, and it will deploy the infantry out near the target (depending on fake weapon range). Dunno if the fake weapon trick will work with the mobile EMP since its primary weapon is hardcoded stuff (MobileEMPulseWeapon).
Luckily the water crash seems to have been caused by having turret=yes on the APC. Had it on to allow the APC to quickly deploy in any direction without facing the enemy, but it seems it's not really needed, the APC deploys in all directions even without it. _________________ QUICK_EDIT
Joined: 13 Feb 2007 Location: C:\Westwood\ TechLevel=12
Posted: Thu Jun 30, 2011 2:01 am Post subject:
SuperJoe wrote:
Allen wrote:
Okay...
I gave the Amphibious APC Primary=Minigun, GuardRange=0 and DeployToFire=yes. One APC was in Guard and the other was in Area Guard both did not retaliate if attacked. They did crush my Inf I put them right next to the APC and let them fire on it.
I also did not get a game crash if I ran the APC over water like you got.
I meant a human controlled APC with primary and DeployToFire will retaliate and empty its crew once fired upon by an enemy unit. It doesn't help if it has GuardRange=0 and NoAutoFire=yes. This is why I gave AI its own copy of the APC, and also so the human version doesn't display the attack cursor. It's not a huge issue, but it could be exploited by firing on the APC to force the crew out (when you aren't looking and unable to manually stop it).
Luckily the water crash seems to have been caused by having turret=yes on the APC. Had it on to allow the APC to quickly deploy in any direction without facing the enemy, but it seems it's not really needed, the APC deploys in all directions even without it.
The NoAutoFire key prob is not fisnihed in TS. However I did stop the human APC from retaliating when fired on. I gave the APC a dummy weapon that has Damage=0 and a Warhead that has Verses=0%,0%,0%,0%,0%.
The player still gets the attack cursor but given with the Weapon and Warhead listed below the only way the APC will unload the inf is by normal or if the player has the APC "Attack" to force it to unload.
A EMP Tank armed with APCDEPLOYDUMMY.... A: As a Player unit will not retaliate if fired on. B: As AI unit it will attack if place in Area Guard. C: As a AI unit placed in Guard the EMP Tank dose not retaliate if fired on. _________________
That's irrelevant... It confuses us...not crashes our games
AI editing is pretty simple all in all (check Banshees AI tutorials here on PPM), but the ai.ini file just appears very cluttered and messy, which can put off people who are not familiar with it. To keep it in check, I always work with only a few AI teams at a time in a temporary AI file. Once I've tested them and made sure they work as intended, I just cut & paste them into the final AI file, and move onto test the next one.
Another way to keep it simple is to use DCoders AI Editor, described here. _________________ QUICK_EDIT
I've been trying to get the AI to better protect its harvesters. Since there is no way to make a team simply follow harvesters around (at least to my knowledge, I tried messing with the follow friendlies command without any success), I tried an alternative method. I have 2 special structures that are placed in the map editor to each player's spawn locations. They tell the AI where the nearest tiberium fields are. Then the AI sends a defensive team to both locations, something like this:
The problem with this is that every single map needs to be edited to include the special "structures" so that the AI knows where to send the defenders. It also makes the random map generator bit useless since the AI will build the harvester defenders, then just leave them idle in the base.
Should the AI use these type of tactics, or should it just focus more on attacking the player (offense is the best defence)? Building the teams takes quite of a bit of credits and time, which is again off from the offensive side. I guess the teams could have less units, but I think they would start to lose their purpose if the player could just destroy the defenders with a couple of units, then proceed to kill the harvesters. _________________ QUICK_EDIT
In view of the difficulties, unless you implement Morpher's AI scaling = different AI tactics idea, I would stick with "offence as the best defence" by default. Why? Because of the aforementioned difficulties, because of convention, and because, arguably, it is the most immediately challenging approach and hence sensible front for presenting the mod to players. QUICK_EDIT
Joined: 28 Apr 2009 Location: Auckland, New Zealand
Posted: Sat Sep 17, 2011 11:51 pm Post subject:
I'm gonna be honest, I don't bother attacking AI harvesters because A) when you do it brings a whole enemy armada against you B) The replace them faster than I can destroy them. I prefer to go for their refineries. _________________ Beta Tester for Mental Omega 3.0
Plus it means theyre just standing on the Tiberium, blocking the Harvester.
They were using a script which made them scatter every few minutes, so the tiberium would eventually become available. Regardless, I dropped this idea in favor of a harvester defence team, a team made up of fast units that rush out to defend any harvesters under attack. Once they have defended a harvester they actually start following it around, which is pretty neat.
I'm also trying to make Nod AI build more weed-eaters (by default they only build one). Got them working half-way, they move to veins and harvest them, but then refuse to get back to the waste facility to unload. Need to mess around with the script some more. _________________ QUICK_EDIT
Joined: 18 Jun 2005 Location: Dordrecht, the Netherlands
Posted: Thu Sep 22, 2011 4:47 pm Post subject:
SuperJoe wrote:
I'm also trying to make Nod AI build more weed-eaters (by default they only build one). Got them working half-way, they move to veins and harvest them, but then refuse to get back to the waste facility to unload. Need to mess around with the script some more.
The same problem you have when you let the AI create harvesters via AI.ini: they won't auto-harvest like in RA2. QUICK_EDIT
I'm also trying to make Nod AI build more weed-eaters (by default they only build one). Got them working half-way, they move to veins and harvest them, but then refuse to get back to the waste facility to unload. Need to mess around with the script some more.
The same problem you have when you let the AI create harvesters via AI.ini: they won't auto-harvest like in RA2.
Harvesters created via AI.ini triggers work with script action 49,0 (Repeat Until Success). But unfortunately weed eaters don't work with it. I've got them to move to veins and harvest with 11,9 (Harvest), but they stop working once they are full. Still trying to find a way to make them return and unload. It would seem the Harvest script action was intended for weed eaters all along, it has probably caused alot of confusion over the years. _________________ QUICK_EDIT
I tried pretty much every combination of script actions and some rules.ini changes, but I can't get the extra weed eaters to work. They go to harvest veins and then get stuck when full. I think it's impossible to order them to move to next script action from Harvest (tested by making the next script action a speech bubble, which never appeared), thus they are just stuck trying to harvest.
But then I remembered this crappy old method I originally used to make seperate AI harvesters work. It isn't needed for harvesters anymore, but turns out it can be used to make extra weed eaters work. Can't believe the method turned out to be useful nearly 2 years later _________________ QUICK_EDIT
Just an update to this old thread, I finally finished the AI mine code. Each faction will use mines differently (gas mines aren't that good in your own base, while EMP mines aren't much use far out in the field). The mine placement is pretty well randomized by having multiple different AI mine units, different AI mine teams with different targets to attack, and trigger that builds only 1 or 2 of these teams at a time. The AI will be likely to build mines at the early stages of a match, but will be less and less likely to replace them later on.
As an example, I just lost 5 tanks to 2 well placed anti-armour mines at the end of a bridge. I'm sure the AI intended to put them right there, luck had nothing to do with it! _________________ QUICK_EDIT
Bumping old tread
man i would love to see your AI in action. i think its more fun to beat a AI when its borderline smarter playing than just spamming the battlefield with units doing suicide runs.
Screeny please. _________________ Link to a document to see what mods i have and/or working on or working with
Click QUICK_EDIT
Managed to create a fairly non buggy method for AI air raids (making AI attack with aircraft is way harder than it should be...). The AI will now come for your con.yard, warfactory and refineries with a large number of aircraft (e.g. 6 Orca Bombers). They will do this attack only rarely, but if you cut back on your AA defences it could cripple you pretty badly. Think of it as a scare tactic - just the possibility of the bombing raids happening kind of forces you to prepare for it. _________________ QUICK_EDIT
Joined: 18 Jun 2005 Location: Dordrecht, the Netherlands
Posted: Sun Jan 13, 2013 5:35 pm Post subject:
SuperJoe wrote:
Managed to create a fairly non buggy method for AI air raids (making AI attack with aircraft is way harder than it should be...). The AI will now come for your con.yard, warfactory and refineries with a large number of aircraft (e.g. 6 Orca Bombers). They will do this attack only rarely, but if you cut back on your AA defences it could cripple you pretty badly. Think of it as a scare tactic - just the possibility of the bombing raids happening kind of forces you to prepare for it.
I'm interested to know how you made the AI only use this attack rarely. Mostly when I make the AI use air units, they will spam air attacks because they can produce air units really fast with the multiple factory clone bug the AI profits from (ie AI has 5 airpads, builds 1 Orca Bomber, he gets 4 clones free and is ready to attack instead of having to build 4 more). This is one of the main reasons I always try to stay away from heavy AI air attacks as they always become extremely annoying when happening once every 1-2 minutes. QUICK_EDIT
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum