AI attack changes in the upcoming release
PostPosted: 06 Jun 2014, 15:28
For the next KaM Remake release the way AI attacks work has been changed to be more like it was in the original game. The Dark Lord noticed that we had implemented AI attacks incorrectly in the KaM Remake, so hopefully this will make the original campaigns work better. But unfortunately it means that any maps with AI that were designed/tested for the KaM Remake might work incorrectly now.
1. Previously AI attacks had a parameter "Soldiers required", which meant the attack would occur when the AI had that many available soldiers. The parameter now means "Number of soldiers to attack" and has been renamed as such. So now this parameter tells the AI how many soldiers in total should go on the attack (before it was only used to trigger it). But the AI won't split groups so even if you set it to 1 the AI will still take a full group.
2. The parameter "Take all" previously meant the AI would attack with his entire available army (backline defence positions and idle soldiers). Now it means the AI will attack with the "Number of soldiers to attack" (see above) and choose that number of soldiers randomly from the available groups. The parameter has been renamed to "choose randomly"
So basically you only need to worry if:
1. You set "Soldiers required" (now "Number of soldiers to attack") to be different than the number of soldiers you actually want to attack (because previously it was only a trigger not the actual number to attack)
2. You used "take all" (now "choose randomly") and expected the AI to send its entire army rather than sending "Number of soldiers to attack" worth of groups
For those who are interested I made a description of AI attacks here, since it's kind of confusing:
https://code.google.com/p/castlesand/wiki/AI
I can add explanations of other AI things to that page if requested.
CASE STUDY: Invasion (aka Zombie Apocalypse) by Skypper
The dynamic script spawns groups around the map, and an AI attack causes them to immediately attack the player. The AI attack looks like this:
Type: Repeating
Soldiers required: 0
Groups: Take all
This worked in the past because "soldiers required" was just the trigger. Also "take all" meant every group would be ordered to attack. The change I would suggest is:
Type: Repeating
Number of soldiers to attack: 1
Groups: Choose randomly
The attack will be triggered whenever the AI has at least 1 idle soldier. The AI will send a group to attack every time the attack is launched (every 1.2 seconds), because it won't split groups in order to have 1 soldier. If Skypper requires the attack to be faster than 1 group every 1.2 seconds he could add the same attack multiple times.
For more information about the upcoming release (and a nightly build to test your changes in) please check this topic:
viewtopic.php?f=5&t=2229
If you have any questions please ask
1. Previously AI attacks had a parameter "Soldiers required", which meant the attack would occur when the AI had that many available soldiers. The parameter now means "Number of soldiers to attack" and has been renamed as such. So now this parameter tells the AI how many soldiers in total should go on the attack (before it was only used to trigger it). But the AI won't split groups so even if you set it to 1 the AI will still take a full group.
2. The parameter "Take all" previously meant the AI would attack with his entire available army (backline defence positions and idle soldiers). Now it means the AI will attack with the "Number of soldiers to attack" (see above) and choose that number of soldiers randomly from the available groups. The parameter has been renamed to "choose randomly"
So basically you only need to worry if:
1. You set "Soldiers required" (now "Number of soldiers to attack") to be different than the number of soldiers you actually want to attack (because previously it was only a trigger not the actual number to attack)
2. You used "take all" (now "choose randomly") and expected the AI to send its entire army rather than sending "Number of soldiers to attack" worth of groups
For those who are interested I made a description of AI attacks here, since it's kind of confusing:
https://code.google.com/p/castlesand/wiki/AI
I can add explanations of other AI things to that page if requested.
CASE STUDY: Invasion (aka Zombie Apocalypse) by Skypper
The dynamic script spawns groups around the map, and an AI attack causes them to immediately attack the player. The AI attack looks like this:
Type: Repeating
Soldiers required: 0
Groups: Take all
This worked in the past because "soldiers required" was just the trigger. Also "take all" meant every group would be ordered to attack. The change I would suggest is:
Type: Repeating
Number of soldiers to attack: 1
Groups: Choose randomly
The attack will be triggered whenever the AI has at least 1 idle soldier. The AI will send a group to attack every time the attack is launched (every 1.2 seconds), because it won't split groups in order to have 1 soldier. If Skypper requires the attack to be faster than 1 group every 1.2 seconds he could add the same attack multiple times.
For more information about the upcoming release (and a nightly build to test your changes in) please check this topic:
viewtopic.php?f=5&t=2229
If you have any questions please ask