Home Crush your enemies... and create an EMPIRE!!! Space Empires V -- BUY NOW!!!

User login

  • Create new account
  • Request new password

Navigation

  • news
    • archive
    • blogs
    • books
    • forums
    • recent posts
    • groups
  • image galleries
  • projects & downloads
  • search
  • create content
  • news aggregator

Search

Who's online

There are currently 4 users and 132 guests online.

Online users

  • Twad
  • bladeer
  • Caius
  • Hearteater

Languages

  • English English
  • French French

Browse archives

« May 2008  
Mo Tu We Th Fr Sa Su
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
Home » news » forums » Support & Feedback » Scenarios & Mods » SE:V MODs

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

maran's picture
Submitted by maran on Thu, 2006-11-30 18:11. SE:V MODs

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 Smiling

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 Smiling

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.

‹ Ground combat mod Weapon sound effects ›
» login or register to post comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Captain Kwok's picture
Mod Designer

A few random comments...

Submitted by Captain Kwok on Thu, 2006-11-30 23:01.

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

» login or register to post comments
maran's picture

Hmm it had crossed my mind

Submitted by maran on Fri, 2006-12-01 03:57.

Hmm it had crossed my mind that a value of 0 might mean the AI deletes or loses any spending it already had in projects when it switched over strategies, is that what you mean?

Regardless I suppose 1% spending, in a large empire, is still worth having though. Thanks for the suggestion.

I was wondering in your exploration of the AI, what exactly does the variable below mean:

lng_Max_Defense_Systems

Is this defensive ships per system or how seriously the AI takes breaches of defense per system or something else, like an overall defense vs attack rating for the AI.

Just spotted something, In the Script_AI_Global_setting file it has:

// AI_Set_Political_Anger_For_Wars

case lng_AI_Categorization
AI_CATEGORY_PEACEFUL:
set lng_Politics_Anger_From_War_Status_Per_Turn := 5
set lng_Politics_Anger_From_Treaty_Status_Per_Turn := -350
set lng_Politics_Anger_From_Known_Status_Per_Turn := -200
set lng_Political_Message_Score_Percent_For_Demanding_Tone := 30
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 := 99
set lng_Politics_Max_Anger_To_Trade := 90
set lng_Politics_Max_Anger_To_Propose_Treaty := 70
set lng_Politics_Min_Anger_To_Declare_War := 110
set lng_Politics_Min_Anger_To_Break_Treaty := 100
set anger_amt := 7

Are these values just used for a state of war and if so are the:

AI_CATEGORY_NEUTRAL:
AI_CATEGORY_AGGRESSIVE:

For the moderate and aggressive minister styles?

Otherwise they would seem to negate or be negated by the same variables used in the csf file.

» login or register to post comments
maran's picture

Greetings if your following

Submitted by maran on Fri, 2006-12-01 08:41.

Greetings if your following this or have just dropped by, I am now addicted to poking around in the code, a nice place to be Smiling

Focusing on the Script_AI_GlobalSettings:

I made an addition of this line to the possible function calls of the

// AI_Set_Political_Anger_Severity_Time

call lst_Politics_Severity_Amount.add(0)
call lst_Politics_Severity_Memory_Time.add(1).

Basically to have completely neutral AI reactions to events, which imho is a nice option to be able to play around with.
Personally I think extremely violent or peaceful races should view things like this:

call lst_Politics_Anger_Log_Type.add(LOG_TYPE_GROUND_COMBAT_OFFENSE_LOST)
call lst_Politics_Anger_Log_Severity.add(1)

As a neutral 0 rather than plus 1 anger addition, indeed my peaceful race won't ever become more angry if they lose a ground combat fight. Smiling

Things like this can be edited to make more sense from a peaceful races point of view

call lng_Politics_Alliance_Elements_Allowed_Type.add(ALLIANCE_RULE_TYPE_CANNOT_USE_VIRAL_WEAPONS)
call lng_Politics_Alliance_Elements_Allowed_Value.add(1)
call lng_Politics_Alliance_Elements_Allowed_Max_Anger.add(15 + anger_mod)

call lng_Politics_Alliance_Elements_Allowed_Type.add(ALLIANCE_RULE_TYPE_SHARE_COMBAT_REPORTS)
call lng_Politics_Alliance_Elements_Allowed_Value.add(1)
call lng_Politics_Alliance_Elements_Allowed_Max_Anger.add(30 + anger_mod)

A peaceful race is going to probably want their allies not to use Viral weapons more than they want shared combat reports, thus tweaking the max anger for this is quite easy.

On an unrelated note two Interesting discoveries....:

» login or register to post comments
maran's picture

Firstly, if

Submitted by maran on Fri, 2006-12-01 08:48.

Firstly,

if (sys_long_Game_Date (less than or equal to) (Sys_Get_Game_Start_Date() + 50)) then
set lng_Politics_Max_Anger_To_Propose_Treaty := lng_Politics_Max_Anger_To_Propose_Treaty - 10
endif

I think this reads that in the first 50 turns its actually 10 anger points harder for the AI to propose a treaty or am I reading that wrong.
Regardless I have altered that to be + 10 also, which if I am right, should make it even easier for this AI to go for a treaty.

set anger_amt := 5, this variable seems to be a nice galciv like addition to the AI's thinking.

In the code below it means that the more players/empires, that the AI is at war with, the more it can ignore disliking someone when it seeks peace. I believe it could be expanded to include code to automatically ask for treaties, perhaps this could be replicated just by uping the chance of the AI offering a treaty in the main csf AI file.

set lng_Politics_Min_Anger_To_Declare_War := lng_Politics_Min_Anger_To_Declare_War + (anger_amt * num_wars)
set lng_Politics_Min_Anger_To_Break_Treaty := lng_Politics_Min_Anger_To_Break_Treaty + (anger_amt * num_wars)
set lng_Politics_Max_Anger_To_Propose_Treaty := lng_Politics_Max_Anger_To_Propose_Treaty - (anger_amt * num_wars)

More to report later, i've tweaked a good 50 values in addition to whats here.

-EDIT For some reason the forum is cutting my post off when using the actual (sys_long_Game_Date less than or equal to syntax...

Consult the great SEV Wiki

» login or register to post comments

Can’t contribute much

Submitted by evilginger on Fri, 2006-12-01 14:52.

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

» login or register to post comments
maran's picture

Well things are going well,

Submitted by maran on Sat, 2006-12-02 08:56.

Thanks for the encouragement Smiling, good to see people are reading this.

Well things are going well, the AI is operating as intended and indeed better than the average AI's, showing a clear advantage as the game progresses. I have portraits in place and I am trying my hand at a ship set. I've even begun to tweak the AI for a second opponent, less expansionist but more defensive of its territory.

Does anyone know if the values in the racename_main_script.csf file are rechecked as the game goes along.

I have added this bit of code near the start where the main variables for the race is set, just below the code, set lng_Politics_Max_Time_To_Honor_A_Request.

if (sys_long_Game_Date (less than or equal to) (Sys_Get_Game_Start_Date() + 50)) then

set lng_Politics_Percent_Chance_To_Propose_Treaty := 60

endif

if (sys_long_Game_Date > (Sys_Get_Game_Start_Date() + 50)) then

set lng_Politics_Percent_Chance_To_Propose_Treaty := 30

endif

set str_Politics_Speech_Datafile_Filename... etc

(Again, please ignore the less than or equal to text, the forum deletes the rest of my post if I use the real syntax)

I did this hopefully to make the AI less annoying. As initially it offers loads of treaties and after 20 or so turns I was becomming annoyed with it. At first this is fine, it will make plenty of treaties with those it meets at first contact but eventually it becomes pointless to have it offering treaties so much, as its gained all it can from its immediate neighbours (And will probably hurt its relations with those races which keep refusing.) This code can hopefully be made more advanced as time goes on, with it applying only to races its just met and thus being able to be controlled more.

If this isn't going to work I can put this code into the statechange file or some other bit of code which is accessed as the game is running, perhaps tweak the treaty offering directly.

So my question is, is the racename_main_script.csf accessed after the game has been set up or is it loaded once and then thats it.

Thanks in advance

---

Consult the great SEV Wiki

» login or register to post comments
maran's picture

Much to report, I am

Submitted by maran on Sat, 2006-12-02 11:04.

Script_AI_StateChange.txt

So many questions but I am learning fast Smiling

// Should_We_Continue_Attack

// Is the Target System we want to attack too well defended?
if (retval) then
if (gbl_ai_state_attack_system > 0) then
if (gbl_ai_state_date_entered_current_state > 3) then
set enemy_strength := lst_AI_Enemy_System_Strengths.Get(gbl_ai_state_attack_system)
set our_strength := lst_AI_Our_System_Strengths.Get(gbl_ai_state_attack_system) + lst_AI_Ally_System_Strengths.Get(gbl_ai_state_buildup_system)
if (enemy_strength > our_strength) then
set retval := FALSE
endif
endif
endif
endif

I am wondering about a way to make this a higher value. Is there any way to know if I should put +1 or +100 here.

set enemy_strength := lst_AI_Enemy_System_Strengths.Get(gbl_ai_state_attack_system)

If I can add a few numbers to it, the right numbers, it may make the AI attack a bit less often and thus achieve my goal of the AI building up its forces rather than attacking when it 'thinks' its ready.
But its a maybe at this point Eye-wink , it might just stall the AI and mean it never attacks or it might make it build up till it can.

I was thinking -
set enemy_strength := lst_AI_Enemy_System_Strengths.Get(gbl_ai_state_attack_system) + (lst_AI_Enemy_System_Strengths.Get(gbl_ai_state_attack_system) / 2)

This should mean it will onky attack targets when it has at least 50% more strength than its victim, not attacking an empire at near equal strength and thus giving even a human player a harder time when it does.

Okay this is where the lng_Max_Defense_Systems come into play.

When the AI is deciding its state, that is what its going to do next, it when it comes to defending, it checks this:

AI_STATE_DEFEND:
call Compute_Defend_Systems()
if (not Enemy_In_Territory_Or_Nearby()) then
set new_ai_state := AI_STATE_INFRASTRUCTURE
endif

Which in turn calls this...

(cutting my post off again, one moment)

» login or register to post comments
maran's picture

Calls this function.

Submitted by maran on Sat, 2006-12-02 11:16.

// Compute_Defend_Systems

call gbl_lst_ai_state_defend_systems.clear()

set list_count := lst_AI_Defense_Location_System.count()
if (list_count > 0) then
for index := 1 to list_count do
set def_system := lst_AI_Defense_Location_System.Get(index)
if (gbl_lst_ai_state_defend_systems.Indexof(def_system) (greater than or equals to) 0) then
if (gbl_lst_ai_state_defend_systems.count() (less than) lng_Max_Defense_Systems) then
call gbl_lst_ai_state_defend_systems.Add(def_system)

(End statements...)

What I am trying to work out is, does lng_Max_Defense_Systems mean that the AI will defend more or less, in essence.
After some study, I am guessing it means how many systems will it give defend orders to.

If this is true and I assume it is Now their are two possible things that can happen if I set lng_Max_Defense_Systems any higher.

1, the AI splits fleets so thinly that no defense gets done (unlikely)

or

2, the AI doesn't use this to judge its fleet composition and just uses it set the amount of defend orders it will undertake.

So as I am after a defensive AI it would make sense to gamble that this will work and set the lng_Max_Defense_Systems really high.
This should make the computer defend first, attack second and even when its losing a war, the opponent will have a harder time beating it down.

Script_AI_Orders_Ships.txt

After poking around trying to find out what the infamous (to me Sticking out tongue) lng_Max_Defense_Systems does, I came across this:

if (our_strength (Greater or Equal too) (enemy_strength * 0.75)) then (defend)

I believe, again a best guess, that this means the AI will attack a target (in defense) if it assess it has 75% or more of its strength.
Though with a player, this is simply not enough. Added to the fact it probably assess a players ship/fleet etc, to be weaker than it is.

I have altered it to read 130%, like my AI's attack orders now do. Lets hope it helps overall, it should save it a few ships.

// Defense (of defend systems)
if (not orders_given) then
set list_count := lst_AI_Defense_Location_System.count()
if (list_count > 0) then
set found_sys := 0
set found_sect := 0
set found_obj_id := 0
set index := 0
loop
set index := index + 1
set enemy_strength := lst_AI_Defense_Location_Strength.Get(index)
set sys_loc := lst_AI_Defense_Location_System.Get(index)
if (gbl_lst_ai_state_defend_systems.Indexof(sys_loc) > 0) then
if (our_strength >= (enemy_strength * 1.3)) then
set found_sys := sys_loc
set found_sect := lst_AI_Defense_Location_Sector.Get(index)
set found_obj_id := lst_AI_Defense_Location_Ship_ID.Get(index)
endif

Thoughts?

---

Designing an advanced, diplomatic AI + shipset
Consult the great SEV Wiki

Ignore this till I fix the code so the forum can show it...

» login or register to post comments
Rilbur's picture

maran wrote:Thanks for the

Submitted by Rilbur on Sat, 2006-12-02 11:43.

maran wrote:
Thanks for the encouragement Smiling, 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.

» login or register to post comments
maran's picture

True it can be confusing but

Submitted by maran on Sat, 2006-12-02 12:00.

True it can be confusing but even if only a few modders take away a few values from this in a search in the future, at least I have helped someone. I am finding reading is the only way to eventually understand the code, that and more reading... Eye-wink

When I am done I will post a readme with the race, showing a more simple version of what I have done, to point people in the right direction. I'll also be able to update the section i've done in the wiki a bit. If someone ask's i'll probably let them get a copy of all the files to use for themselves and further improve the AI.

Thank you for the syntax correction, unfortunately I can't edit the main post I need to, probably because of the formatting caused. Never mind, from now on at least I can avoid such errors.

The AI is about 75% ready for alpha testing anyway, I would like a shipset to put with it but I am no artist unfortunately and my attempts so far have been rather poor. So if you have a few ships you'd like to pair with a diplomatic AI let me know!

I could release an alpha version when I have some more information on upgraded ship designs. That is when people have posted the tricks they use to beat the AI:

http://www.spaceempires5.com/en-US/node/1687

Hint hint, if anyone has a moment. Smiling

Now on to the facilities and technology lists, most importantly upgrading shipyards and more early researching....

---

Designing an advanced, diplomatic AI + shipset
Consult the great SEV Wiki

» login or register to post comments
maran's picture

Script_AI_ColonyType:Added

Submitted by maran on Sat, 2006-12-02 16:08.

Script_AI_ColonyType:

Added 70% more research colonies at the expense of a 3 tenth reduction in resupply colonies and a 2 tenth reduction in military and intel.

The code was:

pct := num_colonies / total_colonies
if (pct <= 0.10) then

But now its (with all of it shown for clarity):

if (new_colony_type = "") then
set num_colonies := Sys_Get_Number_Of_Colony_Types_In_Empire(sys_long_Player_ID, AI_STR_COLONY_TYPE_RESEARCH)
set pct := num_colonies / total_colonies
if (pct <= 0.17) then
set new_colony_type := AI_STR_COLONY_TYPE_RESEARCH
endif
endif

We have been discussing facilities here:

http://www.spaceempires5.com/en-US/node/1688

But for the short of it, we have been looking at a way to force the Ai to upgrade more often and build units slightly more often.

The current build order in, Script_AI_Construction, seems to indicate that a fixed order of building exists:

ITEM_TO_CONSTRUCT_FACILITY:

ITEM_TO_CONSTRUCT_SHIP_DESIGN:

ITEM_TO_CONSTRUCT_UNIT_DESIGN:

ITEM_TO_CONSTRUCT_UPGRADE_FACILITY:

I am not sure on this yet but if its the case it would explain why the AI's facilities are hardly ever upgraded and unit numbers low. The code I posted in that link should sort it out, its basically a reordering of this list depending on a date interval using the statement:

sys_long_game_Date := (Sys_Get_Game_Start_Date() +1)

Well using a few variables which count when initially set by this statement. I have set it to be 25 turns with the usual order then 10 turns swapping the list to be:

ITEM_TO_CONSTRUCT_UPGRADE_FACILITY:

ITEM_TO_CONSTRUCT_UNIT_DESIGN:

ITEM_TO_CONSTRUCT_SHIP_DESIGN:

ITEM_TO_CONSTRUCT_FACILITY:

Which in effect makes upgrading a priority, these values can be tweaked, probably to be short intervals.

Feedback appreciated!

---

Designing an advanced, diplomatic AI + shipset
Consult the great SEV Wiki

» login or register to post comments
maran's picture

Captain Kwok's balance mod

Submitted by maran on Mon, 2006-12-04 07:15.

Captain Kwok's balance mod has been used for the inspiration in some ship building priorities but more importantly in its script_AI_colonytypes.txt which he was kind enough to message me about Smiling

I won't tell you all his secrets as you can download the balance mod source files and look at them yourself:

http://www.captainkwok.net/balancemod.php

But suffice to say he has a code which chooses if the AI should build mineral/farming or refining colonies based on how good that planet is at providing that resource, making the AI much more intelligent in this regard.

All I have done is alter this slightly by limiting the amount of resource buildings which can be built, (adding the percent back in) to 25% for mining, 15% for farming, 15% for organics. With Captain Kwok's new code for finding optimal planets, this should be more than enough.
I've also tweaked the code to allow for rare times where the planets have the same value of two resources (I can send you the code if you wish kwok, just a >= rather than a > Smiling )

This has allowed me to increase research colonies to 30% of the AI's empire, giving them a 200% value of what they were, this should make the AI even more competitive with the players technology pace. 30% More intel buildings and such have been also been added, which brings me on to Intelligence:

Script_AI_Intelligence.txt

Setting what targets an AI will choose for its intel operations I have altered:

if ((Sys_Empire_Politics_At_War_With_Player(

Rather than

if ((Sys_Empire_Politics_Is_Player_Enemy

This will mean the defensive AI will not annoy its neighbours by trying to steal tech from them, perfect for a more diplomatic AI and lets face it the AI always has one war going on mid game anyway.

Due to the fact I have increased the amount of AI facilities the AI will build, I have altered its defense from:

// Pick how much we should use for defense.
set def_pct := (num_wars * 20) + (num_enemies * 10)
if (def_pct > 50) then

// def_pct is the defense percent of the total intel available

to:

set def_pct := 40
set def_pct := def_pct + (num_wars * 10) + (num_enemies * 2)
if (def_pct > 100) then
set def_pct := 99
endif
if (def_pct < 50) then
set def_pct := 50
endif

The AI will always have some defense from opportunist players/AI's who are friendly but want a quick steal, they already build 30% more Intel facilities to make up for it.
If the AI is really threatened by many wars and many enemies it can put its defensive spending all the way to the top and 'turtle'.

This is where I will make the first distinction with the two AI's I am creating:

One is diplomatic/peaceful
The other is diplomatic/neutral

The Tarsus Defensive AI will be set to 99% Intel defense, less facilities to be built
The Rimworld Coalition AI will be set to around 50% Intel defense, more facilities to be built

For now they will both stay like this till I am ready to separate them.

Comments, suggestions?

---

Designing an advanced, diplomatic AI + shipset
Consult the great SEV Wiki

» login or register to post comments
maran's picture

Status Report on Main

Submitted by maran on Tue, 2006-12-05 17:54.

Status Report on Main AI:

Tarsus AI:
Playing at 200%+ score/strength of regular AI's (50% More with the new research changes I sincerely hope)

Done to alpha standard:
Diplomacy, Expansion, Research output and Order, Intelligence, General Behavior, Build Priorities and fleet makeup, Portraits, Flags, 50% Speech, colony types and classification, a lot more I have forgotten.

Still to do:
Combat behavior, ship designs, testing, shipset, 50% speech.

Done some very initially tweaking to the tech tree, its not perfect but I moved a lot of clutter lower down the AI's tech tree list, thus increasing the priority of the upper technologies. Its going to have a few bugs in I am sure at first but it will play out better than it did for the standard AI.

Script_AI_Research.txt

The AI has 'ages' for its technology, that is it does all the first age or group of technologies to the required level's and any critical technologies it needs for ship designs, then moves on to the second age.

So to work with this I have also added some pre-age technologies to increase the speed at which the AI colonises and hopefully force it to expand quicker. Thus the research tree begins like this:

//New Prior 1st Age

set lng_Research_Age_Max_Level := 5
call Add_Tech_Area("Sensors", 5)
call Add_Tech_Area("Applied Research", 3)
call Add_Tech_Area("Space Yards", 1)

//New Prior 2nd Age

set lng_Research_Age_Max_Level := 2
call Add_Tech_Area("Military Science", 2)
call Add_Tech_Area("Physics", 1)
call Add_Tech_Area("Shields", 1)
call Add_Tech_Area("Light Hull Construction", 1)

// 1st Age
set lng_Research_Age_Max_Level := 1

call Add_Tech_Area("Light Hull Construction", 5)
call Add_Tech_Area("Intelligence Services", 1)
call Add_Tech_Area("Point - Defense Weapons", 1)
call Add_Wanted_Tech_Areas_For_Designs(3)

// 2nd Age
set lng_Research_Age_Max_Level := 5
call Add_Tech_Area("Shields", 3)
call Add_Tech_Area("Space Yards", 2)
call Add_Tech_Area("Mathematics", 1)
call Add_Tech_Area("Applied Research", 4)

In the txt file, the second age continues here in depth but you get the idea.

Applied research is used early to get the full bonus from it, as is maths. Sensors are critical to the AI as it operates now, as its colony ships will not move unless they find a planet to colonise, so you end up with a bottleneck of colony ships waiting to move out.

I have been led to believe here:

http://www.spaceempires5.com/en-US/node/1687

That shields are greater than armor generally speaking, so the AI will research shields much faster than it did previously, all special technologies have been moved downwards at the benefit of more fundamental technologies, this I hope should make the weaknesses of the AI less noticeable and the enhance its core strengths. All expensive technologies are being moved downward till the AI can afford to spend pts on them mid game.

Hull technologies are now researched to the point where they become better than a level 5 of the class below, otherwise I didn't really see the point in wasting time researching it.

As always comments welcome, even if their less than positive Eye-wink

--

Designing an advanced, diplomatic AI + shipset
Consult the great SEV Wiki

» login or register to post comments
Rilbur's picture

A Comment

Submitted by Rilbur on Mon, 2007-01-01 00:43.

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? Laughing out loud
_______________________
There are 10 types of people in the world:

Those that understand binary, and those that don't.

» login or register to post comments

Shields are 'technically' not better than armor

Submitted by Destroyer224 on Mon, 2007-01-01 13:39.

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:

Quote:
As always comments welcome, even if their less than positive

Does a massive, smack-you-in-the-face-long type of comment count as positive or negative? Laughing out loud

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...

» login or register to post comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Now on STEAM

Now on STEAM!Space Empires V via STEAMSpace Empires IV via STEAMSTEAM online by Valve Corporation

Popular content

Today's:

  • Defence vs. Attack and other Combat related questions...
  • Sphärenwelt
  • Why Retrofit is limited to +50% per order?
  • Babylon 5 Wars SEV Mod Update
  • Balance Mod Neutral Races

All time:

  • Space Empires V and VI: Expansions and the Future: Tell the Company What's on Your Wish List
  • Space Empires V
  • Gritty Galaxy Fleet Clash
  • Damn Dirty Bugs/Annoyances
  • Space Empires V: General Thoughts, Observations, and Suggestions

Last viewed:

  • Living Crew vs. Master Computer
  • Resource buildings ratio, Resource Converter, Monolith Facilities and Stellar Manipulation
  • Coming Soon, Mobile Mod!
  • SEV Proportions Mod
  • So Where the @#$% is...
(c) Strategy First, Inc. All rights reserved.