View unanswered posts | View active topics It is currently 30 Nov 2024, 11:59



Reply to topic  [ 18 posts ] 
 AI Recommendation ... scripting and other misc. things 
Author Message
Ensign
Ensign
User avatar

Joined: 15 Nov 2006, 01:00
Posts: 119
I've finally got an attempt at an Alpha for my building changes that effect all 6 races. So far the AI isn't doing too bad but it can be better.

I'd like to start a discussion thread to see if we [as a group] can come up with some good ideas for future AI releases.

I'll get the ball rolling with some observations and suggestions:

1. The AI builds more farms [and fewer factories & universities] than it should.

2. In the early turns the AI should probably concentrate on getting to at least L2 farms ASAP. This will allow them to "buy" early upgrades without having to employ more people as farmers.

3. The AI probably needs to learn how to buy upgrades to its universities. This will allow them the extra few turns of research boost that can make a differenece.

4. The AI might not have a high enough priority on special buildings. For example it was Tech 4 for a while but never got around to building Rotharian Organic Regenerators which could help cut the number of people manning farms by 33%.

5. If the algorithm can be tweaked so it built things more effectively then that would be great. If not then scripting the AI's first 50-100 turns wouldn't be a bad move.

6. Having an option in the game creation menus to allow the AI to "cheat" may not be bad. In BotF you could start the AI off at a higher tech level than you and that worked fairly well. However it might not be a bad idea to think about possible bonuses that the AI could get if the player wanted it to cheat.


26 Mar 2007, 01:37
Profile
Ensign
Ensign
User avatar

Joined: 15 Nov 2006, 01:00
Posts: 119
Ver == Alpha 0.51 [with Khaorons] // I figure that I'll try to keep AI observations in one thread.

1. Giving the AI the smarts to know when to scrap buildings would be a good improvement for future Alphas. In a game at roughly turn 200 both the Khaorons and Rotharians had 20+ Level 6 or L7 farms.

2. The AI empires should distribute their workers better. In a recent game both the Rotharians and Khaorons were producing about 1000 more food per turn than needed. I suspect using these workers for mining, industry, etc. would be a far better use.

3. In a recent game the Khaorons had Tech 7 farms & research labs but only had tech 2 industry. IIRC the Rotharians had a more normal set of tech levels on their buildings.

4. How do the AI empires play when there are no minors? If the AI worked well when there were no minors then I imagine that it would work great when minor races were added back in.


15 Apr 2007, 14:21
Profile
Combat Engineer
Combat Engineer
User avatar

Joined: 18 Jul 2005, 01:00
Posts: 1001
*cough* http://supremacy.pbwiki.com/AI%20in%20BOTFII *cough*

Convince Mtrobel to add it to the sharepoint site ;) that way anyone else can add there view point, though this is more broad then what you've discussed above.

regards Wolfe

_________________
Image


15 Apr 2007, 20:19
Profile
Ensign
Ensign
User avatar

Joined: 15 Nov 2006, 01:00
Posts: 119
The discussion and ideas that are thrown around are good and should be considered by the design team.

I was wanting to keep my focus a little more narrow here though and cover observations and suggestions based on what I was seeing with BotE.

FYI: Even with its flaws the AI seems to be doing a pretty good job at being competitive. I'd hate to see what it can do once it figured out how to do planet management ....


15 Apr 2007, 20:44
Profile
Fleet Admiral
Fleet Admiral
User avatar

Joined: 26 Jul 2006, 01:00
Posts: 166
Location: Germany
Quote:
1. Giving the AI the smarts to know when to scrap buildings would be a good improvement for future Alphas. In a game at roughly turn 200 both the Khaorons and Rotharians had 20+ Level 6 or L7 farms.

Thats right. At the moment the AI can't scrap their own buildings. Later the AI should do this too.

Quote:
2. The AI empires should distribute their workers better.

I tested a lot with distributing the workers right. I think the AI does a good job. Sometimes you can make it better, but the AI decides the right way very often.

Quote:
3. In a recent game the Khaorons had Tech 7 farms & research labs but only had tech 2 industry. IIRC the Rotharians had a more normal set of tech levels on their buildings.

Okay. There is no really algo, which decides which upgrade the AI should choose. At the moment the AI is choosing one of the available upgrades randomly.

Quote:
4. How do the AI empires play when there are no minors?

I hope good ;-)


16 Apr 2007, 18:49
Profile WWW
Ensign
Ensign
User avatar

Joined: 15 Nov 2006, 01:00
Posts: 119
SirPustekuchen wrote:
Quote:
2. The AI empires should distribute their workers better.

I tested a lot with distributing the workers right. I think the AI does a good job. Sometimes you can make it better, but the AI decides the right way very often.


In my most recent game both the Rotharians and Khaorons were producing about 1000 more food per turn than needed. IIRC the Rotharians were also producing way too much energy.

I suspect though that this isn't as big of an issue as I earlier thought. Once you tell the AI how to scrap properly I think that most of the other issues that I saw will be self-correcting.

===================================================

Deciding what to build/scrap/update/etc. and when isn't an easy problem in general. What I've used before is some pre-defined ranges for how "most" planets should look. This works very well to keep the home planets in line but it's not as good when it comes to other worlds that don't have the same sort of resources that the homewolrds have.

In BotE I will often overmine some planets with one type of resource and transport [or "stock market"] spare resources to planets that don't have those resources available. Getting the AI to do this in a controlled manner isn't going to be as easy as it sounds.


16 Apr 2007, 22:17
Profile
Ensign
Ensign
User avatar

Joined: 15 Nov 2006, 01:00
Posts: 119
I was looking through some save games recently because I couldn't explain why I wasn't WAYY behind the other powers because I was in a terrible starting position and I noticed something I can't explain.

Even though the Khaorons and Rotharians seemed to be the two most powerful [militarily] empires around they had pretty bad morale in their empire and I can't explain why.

Around turn 150 or so both empires had decent morale [most planets between 103 and 115 morale which is OK]. Around turn 200 that morale had falled to around 103 mostly. Around turn 250 it had fallen to 75-96. Around turn 300 it had fallen to 35-75 for the native member planets.

I didn't notice any "prison farms" or similar structures that would normally give you negative morale. Is it possible they AIs are building things that cause the negative morale during this time frame???? Do morale hits from combat losses hurt MUCH more than victories so if an empire only wins 60% of its encounters it still will have poor morale?

Any ideas?


10 Jun 2007, 06:12
Profile
Fleet Admiral
Fleet Admiral
User avatar

Joined: 26 Jul 2006, 01:00
Posts: 166
Location: Germany
Quote:
Do morale hits from combat losses hurt MUCH more than victories so if an empire only wins 60% of its encounters it still will have poor morale?

I think that is the reason! The AI builds buildings with nagative moral values too. But not very often. If a system has low moral, the AI starts "Martial Law" in the affected systems.


12 Jun 2007, 19:56
Profile WWW
Ensign
Ensign
User avatar

Joined: 15 Nov 2006, 01:00
Posts: 119
SirPustekuchen wrote:
Quote:
Do morale hits from combat losses hurt MUCH more than victories so if an empire only wins 60% of its encounters it still will have poor morale?

I think that is the reason! The AI builds buildings with nagative moral values too. But not very often. If a system has low moral, the AI starts "Martial Law" in the affected systems.


From what I could tell "most" of the planets in those empires had big morale problems even though [militarily] they were quite powerful and should win their fair share of space battles.

Is there a way I can tell if the AI built any negative morale buildings?


12 Jun 2007, 22:59
Profile
Fleet Admiral
Fleet Admiral
User avatar

Joined: 26 Jul 2006, 01:00
Posts: 166
Location: Germany
No, there is no way.

I have to check it by myself. Maybe there is a little bug for the empires controlled by the AI.


12 Jun 2007, 23:34
Profile WWW
Ensign
Ensign
User avatar

Joined: 15 Nov 2006, 01:00
Posts: 119
SirPustekuchen wrote:
Quote:
Do morale hits from combat losses hurt MUCH more than victories so if an empire only wins 60% of its encounters it still will have poor morale?

I think that is the reason!


Perhaps then morale bonuses & penalties from combat should be handled a little differently?

Perhaps we could keep track of all of the ship-to-ship battles an Empire has and have a game-wide modifier instead of a battle by battle modifier. This way the morale modifier would be based more on the total number of ships & value lost in combat vs. the total number & value of enemy ships killed in combat.

Example. Lets say on turn 100 you have first contact with an enemy and you lost 1 scout. At this point you haven't lost much so you'd only take a minor morale hit. Now lets say on turn 105 you lost another scout ship. You would take another minor morale hit that would be cumulative with the first hit. Now lets say that on turn 110 your main fleet wiped out 10 enemy destroyers and took no losses -- you should get a significan morale boost from this. Now lets say on turn 111 you lose another probe and take a minor morale hit.

At this point [even though you've lost 75% of all battles and you've lost your most recent battle] your morale status for ship-to-ship battles should be clearly positive.

Now if we can weigh the above results based on time then that system would be even better [or at least make more sense on paper] because people tend to react more to things that have occurred recently and will not value things that have occurred in the past as much.

I have a system & implementation in mind if you'd like to discuss this aspect further.


13 Jun 2007, 15:12
Profile
Fleet Admiral
Fleet Admiral
User avatar

Joined: 26 Jul 2006, 01:00
Posts: 166
Location: Germany
I have different moral values for different combats. But in the current version I only use the moral value for "normal" combats. There is no choise between moral values for little, normal or big combats. In later version I'll implement this feature so you get less moral problems when you lose little combats. I only don't really know how I decide which combat is normal or big or little? Maybe you have any idea?


14 Jun 2007, 17:44
Profile WWW
Ensign
Ensign
User avatar

Joined: 15 Nov 2006, 01:00
Posts: 119
SirPustekuchen wrote:
I have different moral values for different combats. But in the current version I only use the moral value for "normal" combats. There is no choise between moral values for little, normal or big combats. In later version I'll implement this feature so you get less moral problems when you lose little combats. I only don't really know how I decide which combat is normal or big or little? Maybe you have any idea?


If you use discrete categories instead of some type of continuous function then I imagine:

1. Small -> less than 5% of your forces

2. Normal -> (5% to 25% of your total forces) AND ((5% or more of the enemy forces) OR (an enemy force that is at least equivalent in power to 5% of your total forces))

3. Big -> (More than 25% of your total forces) AND ((more than 25% of the enemy forces) OR (an enemy force that is at least equivalent in power to 25% of your total forces))

--------------------------------------------

Honestly the above numbers are just guesses at what wouldn't be too bad.

--------------------------------------------

This may be a STUPID question but, basically, how does morale work. I know what happens when a planet has 175 morale [that's not the question].

What I'd like to know is:
1. How do one time bonuses to morale effect your planets over time?
2. How do buildings with continuous +1 bonuses work over time?


14 Jun 2007, 18:59
Profile
Fleet Admiral
Fleet Admiral
User avatar

Joined: 26 Jul 2006, 01:00
Posts: 166
Location: Germany
Your suggestions sounds very good. Maybe I'll implement it this way.

Here is the answer of your question:
Code:
if (m_iMoral <= 30) m_iMoral -= 4;
else if (m_iMoral <= 40) m_iMoral -= 3;
else if (m_iMoral <= 50) m_iMoral -= 2;
else if (m_iMoral <= 60) m_iMoral -= 1;
else if (m_iMoral <= 120 && m_iMoral >= 110) m_iMoral -= 1;
else if (m_iMoral <= 150 && m_iMoral >= 120) m_iMoral -= 2;
else if (m_iMoral <= 175 && m_iMoral >= 150) m_iMoral -= 3;
else if (m_iMoral <= 190 && m_iMoral >= 175) m_iMoral -= 4;
else if (m_iMoral <= 200 && m_iMoral >= 190) m_iMoral -= 5;
I hope you understand the little code block. Moralboni from buildings or onetime boni are added to the moralvalue (m_iMoral) of your systems. Than there is a little check, if the moral is between some values. Too high or too low moralvalues have the effect, that the moralvalue decreases. So you need a lot of moralbuildings or a buildings with more than +5 moral per round to reach a 200 moralvalue in your systems.


16 Jun 2007, 10:42
Profile WWW
Crewman
User avatar

Joined: 15 Sep 2007, 01:00
Posts: 16
So, my Coalition is in the SE corner of the map, the Omega Alliance is to the west and the Rotharians are north. There's something resembling a neutral zone in between us all, but the Rotharians keep trying to build an outpost that would give them a way south into my empire. They keep sending (unescorted) transport ships to the same sector and I keep shooting them down.

At some point I colonize a nearby system, and it already has an outpost, so the afore-mentioned sector turns blue. However, the Rotharians still send transport ships to that sector, and when they arrive and can't build, they just... sit there.

I'm assuming the AI just keeps telling them to build an outpost there even though it can't, because it seemed so single-mindedly focused on that sector the whole time.


29 Oct 2007, 14:59
Profile
Fleet Admiral
Fleet Admiral
User avatar

Joined: 13 Nov 2006, 01:00
Posts: 2111
Location: Germany
you're right. this needs to be amended.


29 Oct 2007, 15:08
Profile WWW
Lieutenant
Lieutenant
User avatar

Joined: 11 Jul 2005, 01:00
Posts: 493
:lol: Just how many transports piled up in that sector?

_________________
You ain't seen nothen yet.


29 Oct 2007, 23:40
Profile
Crewman
User avatar

Joined: 15 Sep 2007, 01:00
Posts: 16
It was just one or two of them at a time.


30 Oct 2007, 03:16
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 18 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by STSoftware.