Greetings!
I've created a new sub-forum here dedicated to talking about GalCiv III AI. Because of our forum system, active posts here will float up to the top so you can see this post from the main forum too.
A big welcome to GalCiv III fans or future AI game developers!
## AI Background ##
GalCiv III is the first of the GalCiv games where I didn't write the initial AI for. This has turned out to be a good thing, something that we will all benefit from for years. But in this section, we'll talk about what this means.
Unlike the previous GalCiv AI's, this one is data driven. That means most of its intelligence is derived from XML files in the game directory. The team implemented the AI as a huge library of APIs that use this data and make very simple decisions with it. Because the game is 64-bit and because each AI player gets its own thread, there is a huge amount of built in potential to do some amazing stuff.
In late March of 2015, I finished up my main work on Sorcerer King and began to look at the AI for GalCiv III. The primary strengths in the AI are what I just described. However, it has some weaknesses too which revolve mostly around not being very good at PLAYING the game.
To use the Chess metaphor, the GalCiv III AI at the 0.80 level (March 2015) knew how to play the game. It just didn't know how to play it well yet. That's where I came in. My pre-release work consisted on making the AI more skilled in playing actual humans.
If I were to rate the GalCiv AIs over the years, and this rating changes a bit based on how I"m feeling that day I'd rate them as follows where 1 is brain dead and 10 is the absolute best AI a game can have.
GalCiv OS/2: 8
GalCiv I for Windows: 7
GalCiv II: Dread Lords: 6
GalCiv II: Dark Avatar: 8
GalCiv II: Twilight 7
GalCiv III: 1.0: 6
## AI Expectations ##
Anyone who has had to deal with me on forums knows that I have very limited patience for arm-chair AI designers. I'm old and cranky. If you're participating in these discussions, here are a few ground rules you need to understand:
1. Nearly all players play at either beginner or easy. And by nearly all, I mean 90%. This has always been the case and will always be the case. So feedback or suggestions that involve affecting those players negatively or spending a vastly disproportional sum of money and time on some AI idea just isn't helpful
2. Unless you've programmed AI, feedback suggesting new APIs isn't really helpful. Every AI discussion always has people suggesting things like "The AI should be able to detect threats" or "The AI needs to build better fleets" or "The AI should reinforce planets that are endangered" as if these features weren't in the game before I showed up. That's the most basic stuff. The aI fails to do those things because something else happened and our job is to figure out what happened that kept it from doing those things.
3. Extreme exploits aren't going to be fixed. Most people who win the game are taking advantage of some level of exploit. That is fine and we can, on a case by case basis, determine which ones we should address. I tend to fix exploits that are too tempting to ignore. If the AI is making bad trades, for instance, that's something that should be fixed. But if someone has figured out that they can kite some unit in tactical battle for 45 minutes doing 1 damage per turn until the monster is dead I"m not going to fix that kind of thing. Kite away, my friend.
4. My near time objective is to get the GalCiv III AI up to a 7 and later an 8. It is extremely unlikely I'll be able to get it to a 9 on my arbitrary scale because it's not commercially viable and I've never seen a game reach anywhere close to a 9 and only one commercial strategy game has reached an 8 besides Dark Avatar. Most PC strategy games are less than a 6 and provide their challenge through actual cheating AI which is much cheaper and often more fun for players anyway.
5. Understand what cheating really is. If you get a handicap at bowling or golf you are not cheating. If you get to walk up and kick down the pins you are. People throw around the term "Cheating" so lazily now that it's having a negative impact on the incentive to actually make good AI. The AI in GalCiv does't cheat with 1 exception: On the higher difficulties it doesn't have FOW (and even that is something I'm looking to get rid of). Giving an AI a handicap (i.e. every credit it makes is matched by another 0.25 credits) is not cheating, it's a handicap. If the community ever reached a consensus that giving the AI a handicap is cheating AND felt the AI was dumb then it would make more sense to just have the AI actually cheat (i.e. just give the AI whatever units, weapons, techs, etc. it needed based on the difficulty level, much easier to code).
## AI Weaknesses in 1.0 ##
The biggest problem I'm dealing with in the 0.80 to 1.03 AI of GalCiv III is that all its thinking is empire wide. I cannot control spending on a per planet basis. I do not have access the shipyard building a ship. I am making decisions for an empire without any local knowledge. As a result, the bigger the map, the weaker the AI gets.
The second biggest issue is related and has to do with the ships. The AI doesn't currently have access to the ships in a way that lets me work with them based on on their location. I've alw2ays written the AIs in GalCiv as a gamer and less as a programmer. So, in my mind, I always thought of fleets as having a geographical duty. That isn't the case in GalCiv. As a reuslt, it has a lot tougher time coordinating ships into coherent local "Stuff. The bigger the map, the worse it gets.
Now, before someone says "How can you have crazy sized maps and an AI that can't 'handle' it" I'll bring you back to expectation #1. The AI handles it just fine for nearly all players. It's for people who are really good at strategy games that can overcome this and it's not an all or nothing thing (The AI, with enough handicaps, can overcome this weakness).
Nearly every weakness in the 1.0 AI boils down to a lack of local awareness (that is, letting planets, ships, shipyards, think locally instead of globally). The AI would do great as a federal politician...
## Rolling up our sleeves ##
I have a bunch of low hanging fruit that I intend to address in GalCiv 1.1, 1.2, and 1.3. Let's talk about those first:
1. Eliminate the AI's all seeing FOW vision. This will actually make the AI substantially smarter on bigger maps. This seems counter intuitive until you see the weaknesses I pointed out. It's better for the AI to only "see" stuff that actually matters so that it's not sending ships across the map or building starbases where it has no business doing so.
2. Making the AI more aware of ZOC. Remember, the AI gets annoyed when units and starbases are in its ZOC. The AI makes no distinction between meat and silicon. As a result, the AI often ends up with war with each other because of this which reduces the AI's focused strength.
3. Pre-war build up. This is something I'll be working with the Civ IV and Civ V AI developers on. This is something they're good at that I haven't done as much on. So I'll be implementing some of those systems (not source code of course, I'm just going to talk to them about it) into the AI.
4. Localized tactics. This will be a major bit of work but we will start dividing up the galaxy into theaters and have the AI start thinking of its empire and strategically vital interests as theaters rather than the current system which defines 2 theaters: Theater of focus (where it is concentrating its forces) and everything else.
## How you can help ##
Helpful: Telling me dumb things you saw the AI do that made you able to beat it is helpful. Very helpful in fact. Any mistake that would allow you to win regardless of the handicap.
Not helpful: Things that could be addressed just as easily with a handicap. The AI doesn't build up its planets well. This is on our list. But it's actually not that important since that can be addressed with handicaps.
Really helpful: Saved LATE games with descriptions of what you are seeing. Maybe the AI isn't defending its planets well. Maybe it's sending out crappy fleets. Maybe its fallen way behind militarily. Maybe its ships are crappy. These are things that I'm interested in.
Thanks all and cheers!
OK, I realize this is off topic, but what the heck after a 45 year career in government contracted and private industry science (about 10 different business entities depending on how you count) I will flatly state that this comment is 100% wrong. Smart people who are complimented are encouraged to perform better in every single case I ran into. In many cases people who didn't seem to be all that smart, if complimented for doing something well, would turn around and surprise everyone with something better. I can't believe I was just lucky.
I don't know if you were being humorous or what, but I needed to say that. Even in jest, I don't like the idea of discouraging compliments for hard working smart people, like the folks at Stardock, it's anathema to me. It was a great pleasure of my career to have people work for me and "overachieve" and to work for others and do likewise. (At least that is what they told me, in the latter case).
Introduction,
I always play on normal because that is the intended game and I play for immersion. Gc2's twilight normal was more like a hard and easy seemed normal which is why I feel most played on below normal levels. It is very possible allot of people like to immerse into the game and see how the galaxy develops over long periods of play. The problem I find when playing a crush them all style is, I know how its gonna end. It's gonna be me or one of them,,,,, boring to me and not much replay value or exciting stories to tell friends.
I am not very versed in how AI works code wise. I'm more like the philosopher scientists bring in to get another view point. In short I might see the elephant in the room but someone else needs to get the math down to prove it.
I know the biggest thing that separates us from most animals and machines is that we can predict the future and that is were the player outshines AI and the lesser creatures of our world. In short I don't expect much from an AI as being strategic <no consciousness> but it can be very reactive on the right here right now level.
Now to the meat,
Just from observation It seems the AI sends ships to a "space" rally point first or just a destination. This may be why single ships are always flying around scattered and never grouping up.
Possibly having the AI send its ships to its planets, ship yards, and star bases first. Then when the ships are needed, war time, They can now group up and go to a destination as a fleet. It feels like the AI is getting ahead of its self in that manner by trying to deploy a fleet before it even is a fleet. This way the planets and so forth are already defended by default to hamper back stab tactics of players.
@ marigoldran this is not an attack and I hope its not bad to suggest another game here but since allot of people like to use this game as a standered then; You sound like you would really enjoy Moo2 on impossible without removing or playing the spy races because that seems exactly what you are asking for. Turn 50 darlok steels plasma cannon, sells it to the klackons, Klackon refit their 100's of ship with plasma cannons that can be made in 2 turns, your allies the trillain all of a sudden decide your weaker now and declare war, game over, restart. Awesome platform but the AI only had one objective in which made diplomacy harshly broken. If you didn't kill the darlock, elerians and pscilons right off the bat it would bite your butt hard mid game on impossible. It was so harsh you would eventually know if you were going to win just by which races were in your reach or by what planet you start on in the 1st turns.
The back stabbing gang up perimeters you are asking for should only be for a conquest only selection for victory or on the highest setting. Not a base game perimeter because then it makes diplomacy and 100's of races pointless to even have in the game.
...So what's another game with 8/10 in AI?
Anyway, we're all sane people and understand you won't spend thousands of workhours so that 100 people in the world could get their fight with AI on highest possible difficulty with minimal handicap. All I want is no easy exploits. Sane diplomacy and geopolitics. Good appraisal of situations. All this basis that makes AI adequate. What I really hate is a situation where AI handicap doesn't matter cause you can beat it using the same exploits on any difficulty (see Civ5).
I've played a few games against "Genius" level AI opponents (one step below the max) and have noticed a few things the AI consistently does poorly, apart from the obvious planet specialization problems.
1) Small Fleets: the AI seems to either be unable to group its ships or to severely undervalue doing so. I often see 8 or 9 fleets of 2-3 ships each, which are all mowed down without losses by my own fleet of 6 ships. Even thoughtlessly-composed fleets with essentially random contents would be a huge step up from individual ships. Having the AI rally ships to some location under its control, and then waiting for a certain fleet size (even a semi-random size based on current logistics ability, so that there will be *some* large fleets) before deploying to the warzone would improve things enormously. I have even seen the AI split large fleets (usually in orbit of a planet) into smaller fleets, or come across stacks of individual ships in the same tile that are nonetheless not in any fleet. In addition to being ineffective, this is not very fun to fight against--I want to see my best fleets square off against my opponent's best fleets, not click a hex repeatedly after waiting for each fast combat to finish.
2) FOW problems: There are a number of ways to exploit the AI's ability to see the entire map. For example, I can tell which systems contain habitable planets by watching the direction AI colony ships try to move. I can also manipulate the movement of enemy fleets by allowing an unarmed ship to float nearby out of movement range. A lot of this would be fixed by making the AI aware of only what it can actually see, which is something I know the devs are working on.
And, some things that are probably not "low-hanging" fruit:
3) The AI seems to weigh in-game calculations of civilization power (esp. military power) too highly, and these metrics are calculated in ways that are not useful. In a recent game I stopped military production to watch an AI Krynn player's reaction--once they had achieved slightly more than twice my own military power, they declared war. That "military power" seems to result from a count of ship hulls by size or maybe a count of raw firepower/defense points; either way it does not seem to take into account other technologies. In my game, despite being so far behind in "military power", my ships were able to trivially defeat all the Krynn fleets. It's hard to guess at the underlying mechanics here, but it seems that the contribution of short-range, high firepower kinetic ships is overvalued when calculating military power, and that other supporting technologies (move speed, tactical move/evasion, accuracy boosters, logistics, etc.) are not considered.
4) Declaring war, then doing nothing: the AI seems to often declare war when it is unable to actually prosecute a war. This seems especially common against aggressive AIs that are currently engaged with other opponents--they declare on me (usually due to excessive military weakness), and then nothing happens because their ships are all elsewhere. This seems to happen too often for it to be the result of some simulated diplomacy between AIs. This might be difficult to implement, but I think it would help to have the AI behave as though it were at war for several turns before actually declaring war; this is essentially how I operate as a human player.
The biggest single issue by far, though, is the small fleets allowing the AI to be defeated piecemeal by an inferior force. Changing this would make a big difference in the "feel" of the game
As much as I agree with a lot of the points marigoldran makes, I can't help but ignore every post because I am tired of the ALL CAPS YELLING.
I literally just scroll by when I see all caps. For the two or three posts that didn't have that there were some interesting nuggets. Real shame.
Here's a lategame save on an immense map (godlike AI) with some really poor defensive behavior: Link
I'm fighting the Drengin, but they're still stuck building constructors and colony ships (presumably because there are still a lot of uncolonized planets). Meanwhile, none of the other AIs are reacting to my massive military buildup (later, I would declare war on the Yor, and they still had barely any military - I'm now ripping apart their unarmed constructors and colony ships with 367-move strike carriers).
Evidently, the AI needs to place much higher emphasis on defense and reactive military buildup.
I have been thinking about this, AI is more than ship battles. Diplomacy needs to be seriously addressed also for the AI to reach a 7 level honestly otherwise the computer will always loose the game at the diplomacy table long before any war starts.We need deeper trading personalities, where some races are more open traders , other more closed. Yet the computer doesn't really trade between themselves as well as the human. So the human gets a big edge here in the game.Where the computer weighs the pro and cons of a trade more deeply (especially tech trades) . Other aspects in diplomacy not all resources are equal in value but the computer treats them all too equally so it will take that +%5 mil bonus early game as equal value as the +5% luxury tax item. which doesn't make sense thenOr I can snag that colony ship just before it colonizes that planet when it should cost more if the colony ship is a turn or two away from colonization. Perhaps not all the ships or planets or resources should be on the trade list, the AI can choose not to put all its resources on the table, based on trading personality for example Dregin would keeps its best miltary ships and techs off the table. ETCAlso perhaps when trading tech, make it progressively slightly more expensive for the more tech at once traded.
What IS IT that makes the AI so easy to EXPLOIT?
Think about that. I already have the answer. Airayn sees it too.
An example of in-game diplomacy with the AI:
YOR: I hate you. Notice the -12 modifier on my diplomacy screen signifying how much I hate you. I'M GOING TO INVADE YOU SOON.
Human: Um, yes. That is in fact a major problem. Could I, um, look at how many colonies you have and how many ships you have with which to invade me?
YOR: Of course. In the meantime also take a look at what military techs I have so you know EXACTLY what to build to COUNTER ME.
Human: Yes, yes, that is quite impressive and terrifying. I don't even HAVE any military techs. Could I please have some of yours?
YOR: What would you give me back in return?
Human: Um... 8 Snuggler colonies?
YOR: We're YOR. We're a race of synthetic creatures. WE DON'T SNUGGLE.
Human: Um... so it's a deal?
YOR: This sounds like a great idea. Here is all of my military techs in return for 8 SNUGGLER COLONIES.
Human: Thank you very much. Um, could I offer you some Monsantium deposits so that you would instead attack the Altarians?
YOR: We're synthetic creatures. We don't need food.
Human: So it's a deal?
YOR: Definitely. Deal.
Human: So... uh... are you still going to attack me?
YOR: No, I'm too busy attacking the Altarians. Also your military tech is too good now. I still hate you though. Notice the -12 diplomacy modifier on my diplomacy screen signifying how much I hate you.
To add to the diplomacy comments, another easily exploitable flaw is that you can buy a whole bunch of stuff from the AI in exchange for strategic and trade resources (and on larger maps, you have a LOT of those to trade), then declare war, which cancels the ongoing deals. I did this to the Yor in my current game, and got about 6 or 8 techs basically for free.
I think the AI shouldn't be willing to accept resource trades unless they have a significantly positive relationship with you.
My feeling is that the AI doesn't value speed highly enough. i have rarely seen it field fleets that move faster than 6-8 speed. In contrast I don't build warships with move of less than 15 (which is still too slow for my liking). Speed matters because the ships can then engage multiple targets in one turn. It is also much easier to move beyond defences and then attack the soft underbelly of the empire.
i like the game but currently I don't feel the AI is really much of a challenge. But I think it has potential, please keep up the hard work, it is much Appericated.
@marigoldran Frog Boy is awesome and he is listening very much. I respect him very much, the fact he has opened this thread is a gift in itself. Many developers would be: here is what you get and nothing more. You have good ideas, but you just need to relax a bit in presenting them. As a former developer I can tell you the development cycle and coding cycle is longer and slower than people realize.It will take months to implement changes and there will be major hurdles to over come. Pace the feedback so it is easier to implement changes. Look for the improvements that might be easier to implement.Also the game still has to be balanced for the average gamer which limits the field a bit in what can get implemented. Most people don't want an intricate game, they want a simple game they can beat with the illusion of challenge. We always have to remember FrogBoy and the team are human. They have a living to make and the margins here are never as high as the ideals and hopes we have for the dream.GCIII has the potential to be a extremely powerful long term game, which is why I see you are passionate about the advice, but we have to be patient with the process in hand also.Thanks to the whole GCIII teams and thanks Frogboy for your efforts in producing a strong AI. It makes the game much more fun and long term if the AI has strength and additional punch / tricks at the genius / godlike level instead of only extra resources.@Frogboy and Team: Thank you very very much for your hard work and openness. As a player of GCII / III and gamer I appreciate your doing your best to make a great AI in this game.
We'd make a pretty reasonable "good cop, bad cop" tag team.
OK, I realize this is off topic, but what the heck after a 45 year career in government contracted and private industry science (about 10 different business entities depending on how you count) I will flatly state that this comment is 100% wrong. Smart people who are complimented are encouraged to perform better in every single case I ran into. In many cases people who didn't seem to be all that smart, if complimented for doing something well, would turn around and surprise everyone with something better. I can't believe I was just lucky. I don't know if you were being humorous or what, but I needed to say that. Even in jest, I don't like the idea of discouraging compliments for hard working smart people, like the folks at Stardock, it's anathema to me. It was a great pleasure of my career to have people work for me and "overachieve" and to work for others and do likewise. (At least that is what they told me, in the latter case).
You are correct. I am in programming. When I try my best and am told that sucks, especially when the told me to "figure it out", I get mad. When I am told it was good, but needs some modification, I try harder. When I am told it was really good, I really try on the next task.
People who beat you for no good reason are a reason to leave.
Agreed.
So if I have the galactic civ 2 ultimate from steam am I ablue to play that rated 8 dark avatar AI?
One question that should be asked....how much should a negative mod effect war at all?
There's an old expression, "all politics all local". Other than the occasional monarchy where a king gets so offended by something he declares war, nations declare war for strategic reason.
The negative mod for weakness makes sense, but otherwise a negative mod should affect your desire to trade....maybe influence that you trade better with neighbors that don't like me, but it shouldn't necessarily drive someone to war.
One question that should be asked....how much should a negative mod effect war at all?There's an old expression, "all politics all local". Other than the occasional monarchy where a king gets so offended by something he declares war, nations declare war for strategic reason.The negative mod for weakness makes sense, but otherwise a negative mod should affect your desire to trade....maybe influence that you trade better with neighbors that don't like me, but it shouldn't necessarily drive someone to war.
The relationship is supposed to factor in how the inhabitants of that empire think about you, and it's hardly unheard of for one nation to declare war on another because their inhabitants hate each other. Mutual distrust is a significant factor in a lot of war declarations, and things like border tension and opposing ideologies can increase mutual distrust.
So I don't have a problem with relationship values affecting war probabilities - I just wish they also played a bigger role in how much the AI is willing to trade with you.
Yes, well, unfortunately the human doesn't play by any of those rules. It's like demanding the AI to play "nice" while the human can troll all he wants. And I can guarantee you: THE HUMAN WILL TROLL.
The AI would get a lot more accolades if it was just programmed to be a Machiavellian bastard, and in return lower the amount of bonuses AI gets at the higher difficulty levels.
How about this: Benevolent races are relatively trustworthy. Malevolent and Pragmatic? Not so much. In fact the Malevolents might declare war on you FOR NO REASON AT ALL because, well, they're malevolent.
Personally I think the "Diplomacy Screen" is misnamed.
It should instead be called "The Trolling Land," because that's where the human gets to troll the AI.
The problem is that after a while it gets boring to troll the AI. You sort of wish the AI would troll right back. That's why Portal was such a popular hit.
Thanks for making this thread Brad, I've been wanting to take a good look at what kind of improvements can be made to the AI either as mods or simply suggestions for you guys, this is great!
That said, I play against Genius AI with the occasional Godlike to give a bit of a late-game challenge, so a lot of what I'm likely to want isn't going to be relevant for most of the player-base I suspect.
Jjust to clear things up, in light of this:
What do these lines in the AIDefs.xml mean?
<FreeWarTechChance>0.10</FreeWarTechChance>
<FreeIdeologyPointsChance>.10</FreeIdeologyPointsChance>
<FreeIdeologyPointsAward>10</FreeIdeologyPointsAward>
marigoldran,
We all get it you don't like the way the AI is and you've been very vocal on how one can exploit the AI and the game. At this point please try to be part of a solution instead of the problem. If you don't like something it does, instead of complaining or calling the AI/Stardock names please follow what Frogboy asked for and forward saves and specific failures on what you're seeing the AI do. I know you have the other post which you posted screenshots and we get it that you figured out how to colony rush. If you want to amaze me, play an insane map with 80+ AI on Godlike and get more than 25 colonies by turn 50. (without cheating). Then continue to actually win the game so I can see your amazing metaverse score.
Seilore
Has anyone managed to do that? In the metaverse, has anyone managed to win an insane map by conquest against 20+ AI in under 40 hours of play? I thought it would take too long and the game would crash, according to the bug reports I'm reading.
The point is I would ABSOLUTELY LOVE to play an insane map with 20-30 AI, where the goal is to get a conquest or diplomatic victory... as would many other people, EXCEPT THE GAME WOULD TAKE TOO LONG TO FINISH and halfway through you'll be BORED TO TEARS. I believe one of your reviewers tried that, and mentioned that it was too much for him because the game got too tedious (I can provide a link if you want).
Hence my vocal complaints. If you could, um, address some of these issues such as empire management on the larger sized maps, I'll be MORE THAN HAPPY to take up on your offer (though not 80 AIs. That would probably crash your game).
The basic problem is that it's pretty much IMPOSSIBLE to finish a game with conquest or diplomacy on some of the super sized maps such as Insane given the tediousness of it all. If you want to amaze me and various others who bought the game, please provide SOLUTIONS to some of the problems I and many others are mentioning. I've provided some basic outlines- in other words I AM trying to contribute to a solution.
There are many great features available to you once you register, including:
Sign in or Create Account