Master of Orion

Master of Orion

Unofficial Code Patch Steam Workshop
Ben 8 Feb, 2021 @ 11:32am
AI is too passive
So I've knocked up a fair few hours using the standard game, UCP, 5X and my MOO2 mod and one thing I have noticed in all of it is that the AI is far too placid.

For instance, on extreme/impossible with ridiculous bonuses for the AI, I can just expand out a little, research and build defenses and declare war on every empire .... nothing really happens. The AI only seems to want to engage when it has overwhelming odds, which doesn't make for engaging strategy.

I miss older games on the harder difficulties where an AI opponent would have no chance of beating you, but will still suicide against you so that it weakens you and gives the other AIs a higher chance.

Even when I attack, an opponent has twice the fleet strength than me in total but will still just sit there while I lay waste to their systems because it's chances of winning are too low ... not realizing that if it doesn't fight back it's low chance will be 0% fairly soon.

I've had a look at the backend AI, and it appears to be down to some variables, one of them is ENGAGE_CHANCES_LOW_RISK = 0.7f and some other functions such as ShouldEngage, so under some of these conditions it seems that it will only engage if it has a 70% chance of winning based on the simulated attack, in some cases 55%-70% chance, and defending 30% chance.

What doesn't help these calculations is that I think it is based on a particular fleet, which doesn't help when the AI has a tendency of not combining them.

Have you tried playing about with these variables for UCP? Might be worth a few hours of testing (happy to do so) as the AI is probably the only real let down on the game - it expands fine, builds fine based on its racial preferences ... it just sucks by not attacking without high probability wins.
< >
Showing 1-9 of 9 comments
WhatIsSol  [developer] 8 Feb, 2021 @ 1:01pm 
AI aggressive is definitely something I have spent hours if not days on tweaking. It is much approved over the base game, but far from finished.

I have played with those variables. One of the issues is the fleet combat chance calculations are fairly bad. This was making the AI send in super small fleets that would just lose over and over again. So I want to say I actually bumped them up a bit to avoid that. Since only by attacking with overwhelming forces did it have a chance of winning. But in almost every UCP release that chance calculation is getting better. Could be I need to turn those settings back down and give it try, at some point I’m sure I will.

The AI also tends to be more aggressive on smaller maps (medium or less). It really makes a difference as the calculation of free systems up to grab makes the AI focus more on non-combat expansion.

One of the things I really need to correct is the AI fleet deployment. Even with all of the above, it will decide that of its 1,000 ships, 30 can take out the target. It will then send 30 ships while the other 970 will just sit there doing nothing. Lowering those engage chances can actually make this situation worse.

The AI is also incapable of building over its Command Limit even if it has the funds to do so – that needs looked at.
WhatIsSol  [developer] 8 Feb, 2021 @ 2:21pm 
I was actually recalling wrong, rechecked those win percent numbers and I only tweaked them a bit for defense and when fighting Antarans/Monsters/Orion. Looks like for all other combat it expects a 0.55 chance of winning which is the same as the base game.

Tweaking them when the AI is actively at war to make it more likely to attack might be something interesting to try out.
Ben 8 Feb, 2021 @ 3:02pm 
Interesting to hear your experience with it - yeah the chance calculations can be quite accurate sometimes, but I have seen it say Terrible and then my fleet proceeds to cream the other fleet in the autocalc ... and vice versa.

Might be worth lowering the chance to 45% - doesn't sound like much but is still fairly high and will likely do some serious damage to a players fleet.

Funnily enough, I just had a test game where my recently colonized planet just got attacked - I left it open with no defenses so the AI does attack given a likely win. They attacked with a battleship and 2 cruisers around turn 90, and the system next to it had my home world ....

I was hoping they would attack that to make it interesting but they didn't. Shame really because in reality, even though the odds were probably a coin toss, they had 8 systems to my 1, so they would have hurt me and in 10-15 more turns if they had lost could have rebuilt and likely won if they attacked again.

I'll have to look at GetSimulatedCombatResult and see how it works it all out - be interesting to see.
Ben 8 Feb, 2021 @ 3:05pm 
Originally posted by WhatIsSol:
The AI is also incapable of building over its Command Limit even if it has the funds to do so – that needs looked at.

Probably reasonable, increasing command points multiplier in the difficulty settings is probably the easy way around that though? Otherwise you risk hard coding the AI to build huge/endless amounts of ships, which could get out of hand.
WhatIsSol  [developer] 8 Feb, 2021 @ 6:34pm 
It is just one of those things that has been of interest to check out. If the AI is generating +1,000 BC or has 35,000 BC in the bank, building up extra temporally forces for an attack makes sense.

But yes constraint would be needed and the simplest solution would definitely be to just increase the AI command point advantage.

There are also lots of mods that negatively effect the AIs ability to play. Diverse specials is one of them that is really popular, and the AI just has no clue how to deal with the different planetary specials.

I tend to play this game most with just two mods: the Unofficial Code Patch and my personal mod. Do not get my wrong there are some really great other mods out there that add a lot to the game, but I tend to work on this game more than I just play a game on it and I prefer to work with a reduced mod set. It just makes debugging stuff easier for me.

At the moment the hardest difficulty in my opinion in this game would be the extreme difficulty setting, on a small circle galaxy, with the max number of AIs, and playing a random base race.

Increasing the galaxy size or changing the galaxy type results in a weaker less aggressive AI.

I almost always turn Pirates off, since they are annoying at best, and almost a cheat at worse for the player.

Custom races just make the game too darn easy.

Well, at the moment that is my suggestion if you want the most aggressive AI possible in this game.

But the AI is most certainly a work in progress.
Last edited by WhatIsSol; 8 Feb, 2021 @ 6:35pm
Ben 9 Feb, 2021 @ 5:17am 
Originally posted by WhatIsSol:
It is just one of those things that has been of interest to check out. If the AI is generating +1,000 BC or has 35,000 BC in the bank, building up extra temporally forces for an attack makes sense.

Makes sense given it could use the excess to build up reserves and take the hit economically - that said it might be a detriment if it can then use those reserves to buyout replacement ships if it does take a hit on its fleet. Assume it currently does build to the max command points available at the moment?

Originally posted by WhatIsSol:
It just makes debugging stuff easier for me.
Yeah best way to do it really.

It's a shame on the pirates ... created to be an annoyance to the player and confuses the AI, whereas they could have done something with it i.e. bribe them to blockade/attack other empires, have them reduce income in a system when they park themselves at an asteroid field rather than blindly blockading/attacking etc.

It's funny with the AI - it makes logical sense to not attack someone unless you have an edge, but in reality people take chances. In MOO2 on Impossible I would get hemmed by constant attacks - sure they wouldn't win but it meant I couldn't expand as I was wasting resources and time stopping them while the AI continued to expand.

Spying is also noticeably harder in the older MOO on impossible - early on the AI can steal a lot of your military tech thanks to the bonuses they receive, making their repeated attacks get tougher and tougher, wearing you out. Shame we can't provide bonuses to the AI for security, training and mission risk in CTS on higher difficulties; bit of an oversight by the devs.

I used to think giving bonuses to AI was an easy out for poor AI programming, but in reality if you're having to program if statements for the AI you kinda need to if you want to keep up with the creativity of the human mind on harder difficulties - I've yet to see games like these use proper adaptive/learning AI.
Last edited by Ben; 9 Feb, 2021 @ 5:17am
WhatIsSol  [developer] 9 Feb, 2021 @ 10:20am 
Buying out replacement ships for the AI is harder than it is for the player. The AI can not bulk build. But yes keeping extra cash around for replacements in general is probably better.

Agreed that there are some missed difficulty settings. The AI probably should get some Spy Bonuses for attack and defense. Course the AI logic for spies just stinks in general so at some point that needs an overhaul.

Leader advancement is really bad as well as the AI just picks a random one to gain on levelup.

I also think disposition changes should be made. Ones like making it harder to gain disposition with the AI and thus harder to maker deals, get treaty's. Etc.

Having the AI maybe be more likely to ally with other AIs might be an interesting change.

Some of this leads to the AI being more out to get the player, something the original developers where against. On normal or lower I agree with them, but people do play the higher difficulties for a challenge.
WhatIsSol  [developer] 13 Feb, 2021 @ 3:00pm 
Add.0.0.6.3: New Difficulty Setting "espionage_multiplier_bonus". This effects the AI's security level and offensive spy rating. The goal is to make the AI's spies more effective on harder difficulty levels.

Add.0.0.6.3: New Difficulty Setting "disposition_multiplier_bonus". This effects the AI's initial disposition with non-AI races. It will also factor into all disposition changes between AI and non-AI races. The goal is to make the AI's start with a lower initial disposition and to make it harder to positively gain disposition with the AI based on harder difficulty levels.
Ben 21 Feb, 2021 @ 4:40am 
Originally posted by WhatIsSol:
Having the AI maybe be more likely to ally with other AIs might be an interesting change.

Agree, think that would make it interesting. They seem to war with each other and ignore the player, can make it too easy. Fine on normal or lower difficulty, but higher you'd expect the AI to want to win against you.

One thing I was disappointed with in new MOO is when an opponent wins the galactic vote - before you could oppose it and go to war with the whole galaxy, which is pretty intense.

Originally posted by WhatIsSol:
Some of this leads to the AI being more out to get the player, something the original developers where against. On normal or lower I agree with them, but people do play the higher difficulties for a challenge.

Completely agree. I can see why they went that route, some fun of the old ones was to create an overpowering empire and easily smash the others ... but having more options just increases the replay value.

On 0.0.6.3 ... sounds great, thanks for all the effort you put into it!
< >
Showing 1-9 of 9 comments
Per page: 1530 50