AI modding
Which race do you like most? What do you like - what you don't like? Discuss it here.
posted on May 29th, 2019, 5:34 pm
I'm almost finished with my mod and my build lists are a lot more optimized than those of stock FO. I've also dabbled in the AI personalities (mostly the a2_hard_agressive one since that seems the one most used for battles during skirmishes).
I can get more massive fleet battles and a generally more aggressive AI using the parameters below, but still the AI often sits in its base with huge fleets, until once in a while all the AIs decide to attack each other at the same time, but this can easily take 15 minutes of them doing nothing... Does anyone have any tips on how I can improve this?
#include "newdefault.aip"
int MAX_EXEC_ATTACK_BASE = 100;
int MAX_EXEC_ATTACK = 100;
int MAX_EXEC_DEFEND = 2;
int MAX_EXEC_ESCORT = 0;
int MAX_EXEC_EXPLORE = 3;
int MAX_EXEC_RESOURCE = 1;
int MAX_EVAL_ATTACK_BASE = 100;
int MAX_EVAL_ATTACK = 100;
int MAX_EVAL_DEFEND = 1;
int MAX_EVAL_ESCORT = 0;
int MAX_EVAL_EXPLORE = 2;
int MAX_EVAL_RESOURCE = 1;
int attack_troops_priority = 950000;
int attack_region_priority = 300000;
int defend_priority = 100;
int attack_enemy_base_priority = 450000;
int exploration_priority = 4500;
int escort_priority = 250;
int resource_priority = 1250;
int perimeter_priority = 500;
int min_attack_force = 8;
int min_defense_force = 2;
int min_escort_force = 0;
int min_perimeter_force = 2;
int min_exploration_force = 2;
int max_attack_force = 128;
int max_defense_force = 8;
int max_escort_force = 0;
int max_perimeter_force = 8;
int max_exploration_force = 2;
int distance_from_home_priority_modifier = 300;
int distance_from_enemy_priority_modifier = -10;
double max_matching_force_ratio = 10;
//double fleetAIRatio = 0.4;
int avoid_danger_priority_modifier = -200;
I can get more massive fleet battles and a generally more aggressive AI using the parameters below, but still the AI often sits in its base with huge fleets, until once in a while all the AIs decide to attack each other at the same time, but this can easily take 15 minutes of them doing nothing... Does anyone have any tips on how I can improve this?
#include "newdefault.aip"
int MAX_EXEC_ATTACK_BASE = 100;
int MAX_EXEC_ATTACK = 100;
int MAX_EXEC_DEFEND = 2;
int MAX_EXEC_ESCORT = 0;
int MAX_EXEC_EXPLORE = 3;
int MAX_EXEC_RESOURCE = 1;
int MAX_EVAL_ATTACK_BASE = 100;
int MAX_EVAL_ATTACK = 100;
int MAX_EVAL_DEFEND = 1;
int MAX_EVAL_ESCORT = 0;
int MAX_EVAL_EXPLORE = 2;
int MAX_EVAL_RESOURCE = 1;
int attack_troops_priority = 950000;
int attack_region_priority = 300000;
int defend_priority = 100;
int attack_enemy_base_priority = 450000;
int exploration_priority = 4500;
int escort_priority = 250;
int resource_priority = 1250;
int perimeter_priority = 500;
int min_attack_force = 8;
int min_defense_force = 2;
int min_escort_force = 0;
int min_perimeter_force = 2;
int min_exploration_force = 2;
int max_attack_force = 128;
int max_defense_force = 8;
int max_escort_force = 0;
int max_perimeter_force = 8;
int max_exploration_force = 2;
int distance_from_home_priority_modifier = 300;
int distance_from_enemy_priority_modifier = -10;
double max_matching_force_ratio = 10;
//double fleetAIRatio = 0.4;
int avoid_danger_priority_modifier = -200;
posted on May 30th, 2019, 4:57 pm
I don't know your level of familiarity with the game or AI, but one question I start with is do you have a scout available from the start so the AI can go see what's out there? Make sure you start with a scout or build a scout very early and make sure you can rebuild the scout if it's destroyed early on otherwise the AI will get stuck and do nothing.
Next here are some resources that should help:
http://guide.fleetops.net/guide/modding ... telligence right here on FO.
https://sites.google.com/a/starbase34.n ... /hierarchy. Click the + by Artificial Intelligence and read through the 5 drop downs.
https://www.fleetops.net/forums/modific ... ding-12191. An AI thread I started here at FO as well while doing my research/modding.
In my opinion the "int_max_eval" values should be higher than the "int_max_exec" values. I personally keep the "exec" values below 5 so that the AI isn't dividing up it's forces to attack 50 targets at once.
The developer notes stated the priority values only range from -99999 to 99999 to having 200000 as a value may not be recognized properly? I'm still constantly testing this as the AI still plays.
From Starbase 34:
double max_matching_force_ratio = 0.8;
A goal will only be executed if ships with enough force have been committed to the goal. The amount of force committed to a goal is the total maximum shield strength of each craft multipled by the attack_power of the craft. This force amount must exceed the same computation of enemy ships in the cell times the max_matching_force_ration below. For example, if the ratio is set to 0.8, then only goals in which the AI can match 80% of the enemy threat will be executed.
Freyr's note; "attack_power" for each ship is set in the ODF file.
You have your max_matching value at 10 which is probably throwing its calculations off as a value of 1.0 would be 100%. I'd lower yours vastly and test. These are all just my opinions from extensive testing and I don't claim to be the expert, but I'm happy to help and maybe someone can find something new.
Next here are some resources that should help:
http://guide.fleetops.net/guide/modding ... telligence right here on FO.
https://sites.google.com/a/starbase34.n ... /hierarchy. Click the + by Artificial Intelligence and read through the 5 drop downs.
https://www.fleetops.net/forums/modific ... ding-12191. An AI thread I started here at FO as well while doing my research/modding.
In my opinion the "int_max_eval" values should be higher than the "int_max_exec" values. I personally keep the "exec" values below 5 so that the AI isn't dividing up it's forces to attack 50 targets at once.
The developer notes stated the priority values only range from -99999 to 99999 to having 200000 as a value may not be recognized properly? I'm still constantly testing this as the AI still plays.
From Starbase 34:
double max_matching_force_ratio = 0.8;
A goal will only be executed if ships with enough force have been committed to the goal. The amount of force committed to a goal is the total maximum shield strength of each craft multipled by the attack_power of the craft. This force amount must exceed the same computation of enemy ships in the cell times the max_matching_force_ration below. For example, if the ratio is set to 0.8, then only goals in which the AI can match 80% of the enemy threat will be executed.
Freyr's note; "attack_power" for each ship is set in the ODF file.
You have your max_matching value at 10 which is probably throwing its calculations off as a value of 1.0 would be 100%. I'd lower yours vastly and test. These are all just my opinions from extensive testing and I don't claim to be the expert, but I'm happy to help and maybe someone can find something new.
posted on May 31st, 2019, 10:16 am
Thank you for your reply.
Actually your thread here on the forum was my primary source for experimenting with the AI, along with the fleet ops guide itself.
I found the AI doesn't really scout more when you give it dedicated scout ships (with scout=1 in the odf) and is happy to use other ships as scouts, but maybe that's because of my goal settings? I also do see the AI sending freighters across the map often so I guess those probe enemy defenses as well.
I'll look into the max_force_matching and max_exec parameters and see what they do, thanks! So much of this stuff is trial and error so I really appreciate hearing from someone who has experimented with this before.
P.S. do you think it's a good idea to have fractions as attack_power values in the odf files so the AI better knows it can overpower 10 weak ships with 7 strong ships? Or do non-integer values mess with the AI?
Actually your thread here on the forum was my primary source for experimenting with the AI, along with the fleet ops guide itself.
I found the AI doesn't really scout more when you give it dedicated scout ships (with scout=1 in the odf) and is happy to use other ships as scouts, but maybe that's because of my goal settings? I also do see the AI sending freighters across the map often so I guess those probe enemy defenses as well.
I'll look into the max_force_matching and max_exec parameters and see what they do, thanks! So much of this stuff is trial and error so I really appreciate hearing from someone who has experimented with this before.
P.S. do you think it's a good idea to have fractions as attack_power values in the odf files so the AI better knows it can overpower 10 weak ships with 7 strong ships? Or do non-integer values mess with the AI?
posted on May 31st, 2019, 5:03 pm
Agreed. I keep testing and trying new things (over 100 games now) and each one seems to have a different result. Some better than others.
As for attack_power, I would just set them to 1. If your ship has shield hitpoints of 500 and an A_P of 1 the AI would think it's attack value is 500. if your hitpoints are 500 and it's A_P is .5 then it thinks it's value is only 250.
I think it's attack_power * shield hitpoints NOT attack_power / hitpoints. Again I'm not the expert and could be wrong, but have done lots of testing.
Another aspect is the intrinsic_value setting. I have mine set to 0 for any ship with offensive weapons and leave the intrinsic_value setting to important things like stations. Your ships are to go kill the enemy base. You'd use the defense priorities to defend so in my opinion you want your and the AI's ships to go crush every base you don't want them parrying ship to ship with everyone else over and over. Just build up your fleet and go kill their base. The AI in this game is not the best at strategy.
As for attack_power, I would just set them to 1. If your ship has shield hitpoints of 500 and an A_P of 1 the AI would think it's attack value is 500. if your hitpoints are 500 and it's A_P is .5 then it thinks it's value is only 250.
I think it's attack_power * shield hitpoints NOT attack_power / hitpoints. Again I'm not the expert and could be wrong, but have done lots of testing.
Another aspect is the intrinsic_value setting. I have mine set to 0 for any ship with offensive weapons and leave the intrinsic_value setting to important things like stations. Your ships are to go kill the enemy base. You'd use the defense priorities to defend so in my opinion you want your and the AI's ships to go crush every base you don't want them parrying ship to ship with everyone else over and over. Just build up your fleet and go kill their base. The AI in this game is not the best at strategy.
posted on June 3rd, 2019, 12:23 pm
With the help fo your tips I've made a lot of progress: the AI now takes a lot more initiative, cleans up weaker opponents more quickly and doesn't keep as many ships idle.
I'm quite happy with the results, so thank you for your help!
For anyone reading this later:
I've gave all the combat ships an intrinsic value of 0, and all the non-combat ships and stations a value of 1, except for turrets, they only have a value of 0.05 since my AIs build a lot of them inside their bases and this tended to draw in enemy fleets all the way to the center of a base instead of chewing inward from the outside. Starbases and turrets have attack power of 0.5, all combat ships get 1.
I have the following values in the aggressive AIP files:
#include "newdefault.aip"
int MAX_EXEC_ATTACK_BASE = 3;
int MAX_EXEC_ATTACK = 3;
int MAX_EXEC_DEFEND = 2;
int MAX_EXEC_ESCORT = 0;
int MAX_EXEC_EXPLORE = 3;
int MAX_EXEC_RESOURCE = 1;
int MAX_EVAL_ATTACK_BASE = 10;
int MAX_EVAL_ATTACK = 10;
int MAX_EVAL_DEFEND = 1;
int MAX_EVAL_ESCORT = 0;
int MAX_EVAL_EXPLORE = 4;
int MAX_EVAL_RESOURCE = 1;
int attack_troops_priority = 300000;
int attack_region_priority = 150000;
int defend_priority = 100;
int attack_enemy_base_priority = 950000;
int exploration_priority = 45000;
int escort_priority = 250;
int resource_priority = 1250;
int perimeter_priority = 500;
int min_attack_force = 8;
int min_defense_force = 2;
int min_escort_force = 0;
int min_perimeter_force = 2;
int min_exploration_force = 2;
int max_attack_force = 128;
int max_defense_force = 8;
int max_escort_force = 0;
int max_perimeter_force = 8;
int max_exploration_force = 2;
int distance_from_home_priority_modifier = 300;
int distance_from_enemy_priority_modifier = -10;
double max_matching_force_ratio = 1.0;
//double fleetAIRatio = 0.4;
int avoid_danger_priority_modifier = -200;
I'm quite happy with the results, so thank you for your help!
For anyone reading this later:
I've gave all the combat ships an intrinsic value of 0, and all the non-combat ships and stations a value of 1, except for turrets, they only have a value of 0.05 since my AIs build a lot of them inside their bases and this tended to draw in enemy fleets all the way to the center of a base instead of chewing inward from the outside. Starbases and turrets have attack power of 0.5, all combat ships get 1.
I have the following values in the aggressive AIP files:
#include "newdefault.aip"
int MAX_EXEC_ATTACK_BASE = 3;
int MAX_EXEC_ATTACK = 3;
int MAX_EXEC_DEFEND = 2;
int MAX_EXEC_ESCORT = 0;
int MAX_EXEC_EXPLORE = 3;
int MAX_EXEC_RESOURCE = 1;
int MAX_EVAL_ATTACK_BASE = 10;
int MAX_EVAL_ATTACK = 10;
int MAX_EVAL_DEFEND = 1;
int MAX_EVAL_ESCORT = 0;
int MAX_EVAL_EXPLORE = 4;
int MAX_EVAL_RESOURCE = 1;
int attack_troops_priority = 300000;
int attack_region_priority = 150000;
int defend_priority = 100;
int attack_enemy_base_priority = 950000;
int exploration_priority = 45000;
int escort_priority = 250;
int resource_priority = 1250;
int perimeter_priority = 500;
int min_attack_force = 8;
int min_defense_force = 2;
int min_escort_force = 0;
int min_perimeter_force = 2;
int min_exploration_force = 2;
int max_attack_force = 128;
int max_defense_force = 8;
int max_escort_force = 0;
int max_perimeter_force = 8;
int max_exploration_force = 2;
int distance_from_home_priority_modifier = 300;
int distance_from_enemy_priority_modifier = -10;
double max_matching_force_ratio = 1.0;
//double fleetAIRatio = 0.4;
int avoid_danger_priority_modifier = -200;
posted on June 3rd, 2019, 4:41 pm
It might be easier if you just release all of the AI Files you've edited and ship and station ODF files as well for FleetOps has way to many Ship and Station ODF files for users to edit to your AI Specs to get this ("your") better AI. I know I don't have the time to edit all of those files but would love to have a better AI.
So do you have any plans to release these edited files?
(re-release these edited files might be the best way to say that)
So do you have any plans to release these edited files?
(re-release these edited files might be the best way to say that)
posted on June 3rd, 2019, 5:03 pm
JanB wrote:With the help fo your tips I've made a lot of progress: the AI now takes a lot more initiative, cleans up weaker opponents more quickly and doesn't keep as many ships idle.
I'm quite happy with the results, so thank you for your help!
For anyone reading this later:
I've gave all the combat ships an intrinsic value of 0, and all the non-combat ships and stations a value of 1, except for turrets, they only have a value of 0.05 since my AIs build a lot of them inside their bases and this tended to draw in enemy fleets all the way to the center of a base instead of chewing inward from the outside. Starbases and turrets have attack power of 0.5, all combat ships get 1.
I have the following values in the aggressive AIP files:
#include "newdefault.aip"
int MAX_EXEC_ATTACK_BASE = 3;
int MAX_EXEC_ATTACK = 3;
int MAX_EXEC_DEFEND = 2;
int MAX_EXEC_ESCORT = 0;
int MAX_EXEC_EXPLORE = 3;
int MAX_EXEC_RESOURCE = 1;
int MAX_EVAL_ATTACK_BASE = 10;
int MAX_EVAL_ATTACK = 10;
int MAX_EVAL_DEFEND = 1;
int MAX_EVAL_ESCORT = 0;
int MAX_EVAL_EXPLORE = 4;
int MAX_EVAL_RESOURCE = 1;
int attack_troops_priority = 300000;
int attack_region_priority = 150000;
int defend_priority = 100;
int attack_enemy_base_priority = 950000;
int exploration_priority = 45000;
int escort_priority = 250;
int resource_priority = 1250;
int perimeter_priority = 500;
int min_attack_force = 8;
int min_defense_force = 2;
int min_escort_force = 0;
int min_perimeter_force = 2;
int min_exploration_force = 2;
int max_attack_force = 128;
int max_defense_force = 8;
int max_escort_force = 0;
int max_perimeter_force = 8;
int max_exploration_force = 2;
int distance_from_home_priority_modifier = 300;
int distance_from_enemy_priority_modifier = -10;
double max_matching_force_ratio = 1.0;
//double fleetAIRatio = 0.4;
int avoid_danger_priority_modifier = -200;
A couple things (again my opinions) it's really hard to get the AI to do too much, but as you're finding I've had good results and bad. for the "int MAX_EVAL settings I personally think you want those high. The DEV notes say 1000 is the max so I have mine at 1000. You'll never build 1000 structures, but at least the AI can evaluate every structure built instead of only 10 like you have. I think it should be able to evaluate every structure then say attack the 3 most important.
As for turrets I have my intrinsic_value on those at 0. I want the AI to go around turrets and not waste time attacking them and lose ships. I have gotten the AI to avoid them before, but most of the time the AI happily marches ships right into them. This behavior is puzzling. The AI has no sense of self-preservation. The DEV notes say the line "int avoid_danger_priority_modifier" is not yet calculated. I think this is true since the AI rarely exhibits the sense of mind to stay out of danger. I don't even build or have the AI build turrets. They're expensive and a ship is better utilized. Just my preference though.
As for each star base I have tried with and without intrinsic_value and have had mixed results. I want my AI to wipe out the base as soon as possible. Then all that firepower is gone and you can mop up all the yards and research stations, etc. Again this has all happened with mixed results. I've gotten the AI to keep it's ships just outside the range of the starbase weapons a few times, but again mostly the AI simply walks it's ships in a line past the star base and they all get shot to pieces.
My AI is also building battleships a couple minutes into the game as I don't waste much time with lower level ships. When I get a chance I'll post an AI file of mine and a build list for example. It's nice to see someone else working on this. Maybe you'll have better results to share? Ah, just read again yours is for stock FO so my stock A2 build list won't matter. Anyway, keep the tests coming. Makes me want to keep working on the AI as well.

posted on June 3rd, 2019, 8:50 pm
Funny, I was actually trying to get the fleets to be less "cowardly": they withdrew from turrets and bases most of the time. Right now watching 3 vs 2 and 3 vs 3 AI games (all merciless AIs) they seem to take advantage of weak spots and local numerical superiority quite well and from hat I've seen I actually think the low eval values make them pool their fleets together with their allies for joint attacks. In the 3 vs 2 games the stronger side quickly overwhelm one of the enemy bases together and then go after the other one. After all the time I had spent tweaking the AI before I had not expected to see this kind of progress but it happened. It's also nice to see the different factions are kind of balanced when it comes to AIs playing against each other. I do that with different relative shield strengths you need different AIP parameters.
I'll be releasing my mod soon, probably within a couple of weeks. You're welcome to pick that apart for inspiration. It's an FO mod but "feels" more like Armada 1 (but with Cardassians
). I've cut down on the number of ship/station classes and special weapons but there's a moderate rock-paper-scissors system between ship and station types. The smaller/early ship classes are still useful even in late game and fleets don't get ripped apart by stationary defenses in seconds. Human players will rely on relatively small fleets, but the AI builds more than in stock FO.
I'll be releasing my mod soon, probably within a couple of weeks. You're welcome to pick that apart for inspiration. It's an FO mod but "feels" more like Armada 1 (but with Cardassians

posted on June 28th, 2019, 6:23 pm
Who is online
Users browsing this forum: No registered users and 6 guests