Creation of a very diplomatic, peaceful, expansionistic AI: (Long post) |

I am seeking to create the beginnings of an AI which will do the what the subject title suggests. I have always thought there was a place for not only extremely aggressive, warlike AI's but also those that formed alliances and expanded only defending themselves and their allies. Now with the multi empire alliance feature and the impressive treaty options, hopefully we can script the AI to really be a political animal 
Thus far I have been using trial and error and having altered the following, I would like your opinions:
Firstly from the basic political CSF File, compiled afterwards.
set lng_Political_Message_Score_Percent_For_Demanding_Tone := 40
set lng_Political_Message_Score_Percent_For_Pleading_Tone := 150
set lng_Politics_Max_Anger_To_Accept_Treaty := 75
set lng_Politics_Max_Anger_To_Counter_Treaty := 85
set lng_Politics_Max_Anger_To_Accept_Alliance := 50
set lng_Politics_Max_Anger_To_Counter_Alliance := 60
set lng_Politics_Max_Anger_To_Accept_Gift := 90
set lng_Politics_Max_Anger_To_Trade := 90
set lng_Politics_Min_Anger_To_Declare_War := 90
set lng_Politics_Min_Anger_To_Break_Treaty := 99
set lng_Politics_Max_Anger_To_Propose_Treaty := 80
set lng_Politics_Trade_Value_Percent_For_Enemy := 140
set lng_Politics_Trade_Value_Percent_For_Friend := 80
set lng_Politics_Min_Score_Pct_Diff_To_Surrender := 500
set lng_Politics_Min_Score_Pct_Diff_To_Give_Enemy_Gift := 140
set lng_Politics_Min_Score_Pct_Diff_To_Give_Friend_Gift := 150
set lng_Politics_Min_Score_Pct_Diff_To_Accept_Enemy_Demand := 150
set lng_Politics_Min_Score_Pct_Diff_To_Accept_Friend_Demand := 110
set lng_Politics_Max_Concurrent_Requests_To_Honor_From_One_Player := 3
set lng_Politics_Max_Time_To_Honor_A_Request := 15
set lng_Politics_Percent_Chance_To_Propose_Treaty := 60
All these values have been increased to be more diplomatic, the AI will nearly always accept gifts, it can be traded with easily and will hardly ever declare war.
Can values go over 100 and mean anything?
Always its going to offer treaties much, much more often and get into alliances much easier.
This is meant for a late teens or 20 player galaxy, obviously it can be abused by other players or relied on to be quite peaceful, its strength will come in the fact it will form many strong relations with other empires.
Change 2, to the Script_AI_Politics file, compiled for the new AI with the csf file.
New bit of code:
if (ship_count > 0) then
set anger_sev := Sys_Trunc(ship_count * 0.05) + 1
Old bit of code:
if (ship_count > 0) then
set anger_sev := Sys_Trunc(ship_count * 0.20) + 1
What I think this will do is make the AI 75% less bothered about people having ships in its space.
This is the first step in making it like sharing space with other races, yes an odd trait but I think you'll agree an interesting one in a more crowded galaxy. I might even make this calculation add a positive value to the relationship!
I am looking at the state change file to perhaps make the AI defend more often than attack (I know you can do this in the standard csf file) and build up its forces rather than send out small waves. Turtling if you will.
Also just glancing at it now, I might tweak the Alliance_Voting script to have the AI keep trying and trying to get its enemies into a large alliance, thus luring them into agreements and outsmarting certain AI's 
I really, really like the potential of designing an AI to battle other AI's people have made. I liked it in SEIV and now the options we have at our disposal are really immpressive.
Militarially I have altered:
set lng_Max_Defense_Systems := 6
set lng_Min_Time_Between_Attacks := 3
set lng_Pct_Chance_To_Start_New_Attack := 30
set lng_Max_Time_To_Stay_In_Attack_State := 15
set lng_Max_Explorers := 8
set lng_Percent_Of_Satellites_To_Keep_On_Planet := 20
set lng_Percent_Of_Mines_To_Keep_On_Planet := 10
set lng_Max_Ships_To_Retrofit_At_The_Same_Time := 5
set lng_Max_Defense_Systems, Not sure what this does quite honestly, more defensive ships or more defensively overall?
I wanted to set the AI to attack when it needed to and keep up the fight as long as it needs, hence the relatively low attack time and high length, not sure if this will help or hinder it.
Obviously more max explorers are good, colony ships and such I believe? It seems so further down the csf file when it lists them again:
ase ai_state
AI_STATE_EXPLORE_AND_EXPAND:
set lng_Max_Explorers := 7
AI_STATE_INFRASTRUCTURE:
set lng_Max_Explorers := 5
...etc...
Again an increase in the number of colony ships and a desire to expand I hope.
case ai_state
AI_STATE_EXPLORE_AND_EXPAND:
set lng_Overall_Spending_Pct_Vehicle_Construction := 80
set lng_Overall_Spending_Pct_Facility_Construction := 20
set lng_Overall_Spending_Pct_Unit_Construction := 0
AI_STATE_INFRASTRUCTURE:
set lng_Overall_Spending_Pct_Vehicle_Construction := 20
set lng_Overall_Spending_Pct_Facility_Construction := 80
set lng_Overall_Spending_Pct_Unit_Construction := 0
AI_STATE_ATTACK:
set lng_Overall_Spending_Pct_Vehicle_Construction := 80
set lng_Overall_Spending_Pct_Facility_Construction := 0
set lng_Overall_Spending_Pct_Unit_Construction := 20
AI_STATE_DEFEND:
set lng_Overall_Spending_Pct_Vehicle_Construction := 80
set lng_Overall_Spending_Pct_Facility_Construction := 0
set lng_Overall_Spending_Pct_Unit_Construction := 20
AI_STATE_NOT_CONNECTED:
set lng_Overall_Spending_Pct_Vehicle_Construction := 60
set lng_Overall_Spending_Pct_Facility_Construction := 30
set lng_Overall_Spending_Pct_Unit_Construction := 10
endcase
end
These values are extreme I know but intended to put the AI into overdrive when it decides it needs something, i'm not sure if it will work as intended yet though.
Basically when its exploring/attacking/defending it churns out more ships, when it needs to build infrastructure it does that and when it needs units to attack/defend it does that also, except it does all these things more so, at the expense of a balanced development.
Suggestions and corrections are appreciated.
Can’t contribute much
Can’t contribute much but am very interested in watching this one and learning how to tweak the AI as variety of AI as well as its ability to resist human players is an important element to the game.
I am watching and learning

maran wrote:Thanks for the
, good to see people are reading this.
(Again, please ignore the less than or equal to text, the forum deletes the rest of my post if I use the real syntax)
A) Reading yes, understanding not so much.
B) Quote my text to see something: < and > can work just find in posts, unlike their base symbols. Even <= and >=!
_______________________
There are 10 types of people in the world:
Those that understand binary, and those that don't.

A Comment
Well, if comments are welcome...
How about a version of the AI that can handle smaller maps?
Or a "mod" that is nothing but stock but "trained" to give only improved AIs so I can just unzip and play? 
_______________________
There are 10 types of people in the world:
Those that understand binary, and those that don't.
Shields are 'technically' not better than armor
If you do the math, shields protect less for their weight. A level 1 armor plate provides 25 pts of protection, and a lvl 1 shield generator provides 100 pts of protection. But do not be decieved, a lvl 1 armor plate takes up 5kt of space, but lvl 1 shield generator takes up 30kt. For the same amount of tonnage, you can fit six armor plates for every one shield generator. That means for 30kt of space, you can either have 150 armor points or 100 shield points. Even at lvl 100, the armor is still better if you do the math. But armor is only 'technically' better if you do not take into consideration that every time you take damage to your armor, it msut be repaired, but shield points automatically regenerate from battle to battle. For maximum effectiveness, you need to look at your playing style and what the ship is designed to do. If you always keep a repair ship in your fleet, it can easily repair the 5kt it takes for each armor plate. But if you do not like having repair ships, you must send the ship home to a spaceyard to get it fixed. Also, if you are designing a defense ship, then armor would most likely be better because you would almost always be close to a friendly space yard and your top priority would be having a larger short-term advantage than a smaller long-term advantage. When deciding between armor and shields you must also consider mixing the two together. You may decide to have shields for the many skirmishes an attack ship may have, but also put on some armor for when the battle gets tough and you have to be able to take some heavier hits.
I usually put on a ratio of armor and shields depending on these factors and what role the ship is playing. If I am designing a defensive ship, or I have a readily available source of repairs, (such as a repair ship travelling with the fleet) It is usually about 2:1 (armor:shields). If the ship is about longevity, or repeated battles, (such as would happen with ships that penetrate deep into enemy territory) I use a ratio of about 1:2. For all my other average attack ships, It is somewhere in-between depending on the factors.
You must also take into account wether or not your have shield regenerators, organic armor, or both. Organic armor is not as good at protecting the vitals when it comes down to pure defensive ratings, but if your ship is going to be taking lots of lighter damage over a period of time, instead of heavy hits during a breif moment, organic armor would be better suited because during those in-between times, it can regenerate some of its potential, gathering strength while you are not getting hit. It is the same with shield regenerators, except that they are to the extreme of organic armor because they provide no protection whatsoever other than their relatively measley hull structure. But if the enemy can reach your shield regenerators, what good are they? The shield regenerators MUST have time to be effectivem so if you have to take a lot of small hits in a large amount of time, shields+regenerators are your components. But if your ships are going to be taking heavy damage with relatively little time for your shield regenerators or organic armor to work, regular shields and armor would be advised.
I know this is not very helpful for an AI that cannot take all these into consideration, so my point is hopefully to be that you should use both instead of one or the other. One may be more effective in certain situations, but would you rather have one that is extremely effective in one way, but falls victim easily in another? You may have more of one than another depending on circumstances, but I believe you should not get rid of the other entirely.
Well, that was supposed to be a short post on why neither is the solution to everything. Then it turned into a full 3-page essay lecturing about how certaion ones were more useful in certain ways than others and how they inter-mesh with one another to be most effective.
Hope this helps you with your advanced AI, Maran.
P.S:
Does a massive, smack-you-in-the-face-long type of comment count as positive or negative?
EDIT: Editing a mistake in your post puts it at the bottom of all the posts???? Either that or rilbur used his magic to move his post up one...




, it might just stall the AI and mean it never attacks or it might make it build up till it can.
) lng_Max_Defense_Systems does, I came across this:
A few random comments...
There's a section in Script_AI_GlobalSettings.txt that determines the priority for different design types.
You can use values above 100 for anger etc. It's fairly rare that anger levels will get that high in practice though.
I wouldn't ever stick any of the spending percentages to 0.
-----
Space Empires Depot | SE:V Balance Mod