Brad Wardell's site for talking about the customization of Windows.

By beta 5, it should be pretty clear that GalCiv III is an entirely different beast from GalCiv II.  This post won’t go into the game play differences, which are pretty vast. This is about something a little more dear to many of our hearts: modding.

Why GalCiv II was the way it was

The thing about GalCiv II that I would like you guys to understand is that I wrote nearly all the economic, diplomatic, AI and other code personally.  I enjoyed doing it but it also meant that *I* wrote it. It wasn’t data driven in any way.  If I wanted the Drengin to focus more on getting some tech, I modified C++.

GalCiv III, by contrast, has a much bigger team and while I designed (or helped design) the high level way that the economic, diplomatic and AI works, I didn’t program it.  And since the talented folks on the team are aware that we will be making GalCiv III expansions into the next decade, the entire thing is data driven.  This is good news for modders.

Your first mod

If you hit the ~ key you can bring up the game’s console. From there, you can type “soak” (no quotes) and “fow”.  Soak has the AI play itself once you hit the turn button. fow unhides everything.

In GalCiv II, if the AI was doing something stupid, well, too bad. Because you’d have to wait for me to fix it and between my various opium walkabouts and general laziness who knew how long that would take? But in GalCiv III, you can make the AI better the same way I am, through changing the data.

What makes the AI decent?

Right now, in beta 5, I’d say the AI is…adequate for most people. Which is to say, it’s not very good by my standards or the standards of those reading this post.  This isn’t due to the AI being badly written, it’s all about data and strategy.  

So what makes an AI in a strategy game decent?

  1. Having a focused tech path
  2. Knowing what techs it must get
  3. Understanding timing attacks (i.e. by this point you should have X)
  4. Being good at macro strategies (building out, expanding).
  5. Being good at micro strategies (make this planet do this, make that planet do that)
  6. Being good at having good ships and at the right time.
  7. Focusing your attack on one player at a time and not attack everyone
  8. Organizing the tip of your spear to be as sharp as possible (no death trains)
  9. Focus its spending on what its current strategy is effectively.
  10. Build a network of friends diplomatically and make good trade.

 

At this stage, the AI gets an F at 1, and F on 2, and F on 3, a B on 4, an A on 5, a C on 6, a B on 7 and a B on 8 a D on 9 and a C on 10.

This might be a bitter pill for some of you but for release, we only need to get everything up to a C. If we do that, the AI will satisfy nearly everyone.  Post-release, me and you guys will likely work together in ways we can only dream of to bring all these to an A.

Where GalCiv III beta 5 currently falls down:

  1. What to spend its money on
  2. What techs to pick

These are not “AI” as much as scripted strategy based on playing.  It’s purely data driven.

The Terran Alliance: Techs

First 100 turns the Terran Alliance needs these techs:

  1. Xeno Industrialization
  2. Planetary Improvement
  3. Soil Enhancmeent
  4. Environmental Engineering
  5. Interstellar Travel
  6. Orbital Manufacturing
  7. Orbital Speiclaization
  8. Zero Gravity Construction
  9. Weapon Systems
  10. Defense Systems
  11. Universal Translators
  12. Xeno Commerce

Now, a player can try to b-line over to Invasion tech but unless you’re playing on a really small galaxy, that’s not idea.

 

Modding the Terrans: Techs

So open up TerranTechDefs.xml.  You can find those techs and find AICategoryWeight.  Make these numbers big across the board because they are strategic. The higher you make them, the harder it is to trade for them so keep that in mind.  I’m going to make mine all worth 25 in every category.

Modding the Terrans: Personality

Now open up FactionDefs.xml and look for the Terran Alliance.  You can see the AI category weights which align up nicely with the ratings on different techs. So you can pretty obviously see what techs matter to the Terrans. 

image

These are great numbers.  Unfortunately, I’ve learned something about random number generators.  Do you know what the difference between a 12 and a 14 is as far as random is? Nothing.  If we want the players to really play differently (differently as far as the player is concerned) we’ll need to make these numbers a bit more extreme.  How extreme? That’s the fun: Try it for yourself and find out.

Here are my numbers:

image

So I made the scale from 0 to 25. As long as you’re consistent (your range is basically the dice roll size).  I like to have very distinct differences in the numbers.

Test #1: First 100 turns

So before, after 300 turns, none of the AI had even medium sized ships.

Let’s see how the two sides are doing now.

Terran Flag Ship:

image

Attack of 20, defense of 18. 63 HP.

For comparison, let’s look at what the Drengin has:

image

Attack of 12, defense of 18, 39 HP.

So clearly no match, one on one, with a Terran ship.  They’re both using rail guns oddly enough. Not sure if that’s a coincidence or not.

Terran techs after modification

  1. Xeno Industrialization
  2. Advanced construction
  3. Institutional Research
  4. Planetary Improvement
  5. Environmental Engineering
  6. agriculture ADaptation
  7. Xeno Biology
  8. Interstellar Travel
  9. Orbital Manufacturing
  10. Zero Gravity Construction
  11. Interstellar Logistics
  12. Weapon Systems
  13. Missile Weapons
  14. Beam Wapons
  15. Kinetic Weapons
  16. Militarization
  17. Defense Systems
  18. Shield Systems
  19. Armor Systems
  20. Universal Translator
  21. Xeno Commerce

So it got all the techs and then some.

However, not all these choices were good choices.  It should have picked a single weapon system to focus on.

Drengin techs (unmodified)

Let’s look at what the Drengin have (their tech tree is whatever is already in beta 5)

  1. Xeno Exploitation
  2. Xeno Slavery
  3. Persuaive Research
  4. Planetary Exploitation
  5. Agreiculture
  6. Enviromental Engineering
  7. Interestellar Travel
  8. Orbital Manufacturing
  9. Interstellar Logistics
  10. Weapon Systems
  11. Beam
  12. Missile
  13. Kinetic
  14. Militarization
  15. Defense Systems
  16. Shield Systems
  17. Universal Translator
  18. Xeno Commerce

So some easy progress there.

Next up: Spending.


Comments (Page 1)
2 Pages1 2 
on Mar 28, 2015


Why GalCiv II was the way it was
The thing about GalCiv II that I would like you guys to understand is that I wrote nearly all the economic, diplomatic, AI and other code personally.  I enjoyed doing it but it also meant that *I* wrote it. It wasn’t data driven in any way.  If I wanted the Drengin to focus more on getting some tech, I modified C++.

Was this due to time/budget/manpower/performance constraints? Or maybe it just didn't occur that people would be interested in tinkering with ai? In any case I'm glad to see a new design with fewer restrictions.

Does the new ai design (and the access that it gives to players) present any challenges in providing the illusion of personality? It seems as though it would be easier to provide individual flavor to each race if they were designed individually instead of produced by manipulating data within a centralized system. I'm not a programmer, however, so pardon my ignorance.

on Mar 28, 2015

Mostly it was a manpower constraint.  Since I was writing all that, I didn't have time to monkey around with data driving it.

on Mar 29, 2015

Hey Brad:

Just to introduce I'm the author of the AI Improvement Mod for Distant Worlds and a long time fan of Stardock games.  Hell I'm still playing Sins of a Solar Empire Rebellion thanks to the amazing Star Trek Armada 3 Mod.

On the one hand I like what you've done to help Modders but I'm firmly in the "bitter pill" at release camp to hear that the goal is just a C.  We really need a game in 4X where the AI at release sets a benchmark for others to aspire to given how poor some recent 4X releases have been.  Endless Legend is a wonderful game but the AI at release was laughable and has frankly put me off playing again until there are a lot more improvements.

Could you advise in a little more detail what a C looks like?  For example, your post has a focus on the first 100 turns and has no weapons focus ... to me this is not a C it's an F.  I really hope you can set my mind at ease here a little bit.  Sure, a lot of AI optimisation will be needed after release, but it's reasonable to expect the AI to have a coherent strategy which lasts the whole game at release.

 

on Mar 29, 2015

Icemaniaa

Could you advise in a little more detail what a C looks like?  For example, your post has a focus on the first 100 turns and has no weapons focus ... to me this is not a C it's an F.

 

Brad said in his original post, "However, not all these choices were good choices.  It should have picked a single weapon system to focus on."  So that will be at least one of the things they'll be fixing to improve the tech picking to a C.

on Mar 29, 2015

The_Poena

Brad said in his original post, "However, not all these choices were good choices.  It should have picked a single weapon system to focus on."  So that will be at least one of the things they'll be fixing to improve the tech picking to a C.

Sure but that is the tip of the Iceberg when it comes to what a "C" would look like.  Brad may not want to reveal too much to us humans but as a result of Brad's post I'm seriously considering waiting a while before playing the game or at least waiting for reviews that give the AI a good look.  I'd like to hear the AI's ship designs are intimately linked with their selected research strategies.  I'd like to hear there are many other areas where the AI will focus as appropriate to the race / strategy beyond weapons etc.  I'd like to hear that strategy applies to the whole game not just the first 100 turns.  And so on.  I'm not asking for adaptive AI, I'm not asking for neural networks, I'm not asking for an AI that can beat experienced 4X gamers without bonuses ... I'm not asking for anything that is unreasonable.  I just want the AI to have a well developed full game strategy that avoids obvious stupidity e.g. failing to upgrade fleets, fleet suicide missions etc.

 

 

 

 

 

 

on Mar 29, 2015

Point 1:  

Number 10 talks about the AI making friends.  

One particular aspect I think will make a huge difference at larger game sizes as the number of factions increases.   First, that the AI be able with reasonable frequency  to form alliances (the higher end  of "friends") and that second they are able to coordinate attacks with their allies against a common enemy(s).   This characteristic alone would make single player or co-op play in a big galaxy a high level challenge.    

Of course in my experience the human player knows how to form alliances but their value is undermined because there doesn't seem to be a way to get the ally to seriously cooperate.   This has been a problem with every 4x game I know of.   You can bribe someone to declare war on a third party in some games, for example, but does it really mean anything significant will happen?     Perhaps if that were possible, getting the AI to do the same with each other would fall into place more easily.   It's a tough problem but a big issue, imo.

Point 2:    

I think the greater accessibility of modders to AI behaviour (as I understand the post) is terrific because they will find ways to make the AI tougher, plus the attitude that the developers will work with the community to help improve the AI as the game evolves is likewise a very good thing.    Couple that with Frogboy's forthright presentation of what he thinks the situation is at present and I believe we have a nice trifecta going forward.

My 2c.

 

on Mar 29, 2015

Icemaniaa

Hey Brad:

Just to introduce I'm the author of the AI Improvement Mod for Distant Worlds and a long time fan of Stardock games.  Hell I'm still playing Sins of a Solar Empire Rebellion thanks to the amazing Star Trek Armada 3 Mod.

On the one hand I like what you've done to help Modders but I'm firmly in the "bitter pill" at release camp to hear that the goal is just a C.  We really need a game in 4X where the AI at release sets a benchmark for others to aspire to given how poor some recent 4X releases have been.  Endless Legend is a wonderful game but the AI at release was laughable and has frankly put me off playing again until there are a lot more improvements.

Could you advise in a little more detail what a C looks like?  For example, your post has a focus on the first 100 turns and has no weapons focus ... to me this is not a C it's an F.  I really hope you can set my mind at ease here a little bit.  Sure, a lot of AI optimisation will be needed after release, but it's reasonable to expect the AI to have a coherent strategy which lasts the whole game at release.

 

Hi there.

In my view, a C means that the game is challenging, even to core players, if they turn up the difficulty beyond normal.

Obviously the goal is to always get it as good as possible. But it would not make any sense to delay the game so that 10% of the user base is satisfied. It would be like insisting on play by email in the base release.

GalCiv II, plain jane, on release was barely a C on release.   The truth is, a well written AI on its own will only get you up to a D.  You have to spend hours playing the game and optimizing strategies and there's no substitute for experience on that.

on Mar 29, 2015

Hi Icemaniaa and Brad or Frogboy

Well I certainly want as good AI as Brad can create, my past experience with almost all games AI except the ones Brad designed himself like GC2, and a few exceptions like MOO2  are that the AI is usually nothing but a hidden set of advantages and boosts for the AI.  I mean basicly the AI with a large enough advantage can stop you from winning with all it's production ships / armies etc.  but it can't win the game itself as late game it has no clue and just bumbles around in circles.  

Ice - I found that particularly true of Stardrive whose AI i thought was dumber than a brick.

Ps.  Brad please get them to fix the metaverse for GC2 - I still enjoy the game even if it only has a "C" AI

on Mar 29, 2015

From a beta tester perspective, what should we do to help the development of the best AI for release? Just feedback about strange behavior or suggestions for improvement in particular areas? I'm guessing some of both--but how can we communicate in a way that it is helpful for you? What specific measures can we take to help?

on Mar 29, 2015

Fascinating read!  I like the more course granularity of the AICategoryWeight you did, Brad.  It makes sense to me to have distinct consistent steps in the math.

on Mar 30, 2015

Is there an overview of the available debug commands like “soak” and “fow”?

They helped me a lot in making my custom races competitive when played by AI.

on Mar 30, 2015
@Brad
 
Please understand I’m just really nervous after some recent 4X entries.  I appreciate your background and passion for AI and share it in my own line of work.  C is fine at release with your definition of it, I just hope we’ll really have a C, and a few more specifics without giving too much away would help put my mind at ease.
 
1.       Can you confirm that your definition of C includes the full game not just the first 100 turns?  I’m hoping the 100 turns in your post was just providing an example.  Omega777 had an interesting observation about late game AI for Gal Civ 2 (I haven’t played it for a long time) which indicated this maybe a weakness.
 
2.       As you know the Ultimate Edition of Gal Civ 2 had some AI issues.  I assume key areas like this will be thoroughly checked and there will be no repeat for Gal Civ 3? 
 
3.       Obviously there is a very intensive period of AI development ahead in the near future to get to a C from where we are now.  I hope you have sufficient time for that with your other responsibilities?  Do you have someone focused on the AI in the team?
 
4.       With respect to the need to play the game plenty to get to a C or above … well of course.  Is there a need to ask for more AI specific feedback from the community and internal testers that are currently playing the game right now then? 

I'm hoping these are all easy answers!
 
@trumpeter87
 
From a Beta testing perspective spending plenty of time just watching the AI will help per the commands Brad has provided.  Anybody should be able to provide observations about really silly AI behaviour.  For example the AI suiciding fleets in battles they have no chance of winning.  Or failing to upgrade.  Or failing to respond to obvious player tactics.  These are the things that often get noticed first by new players/reviewers and really should be resolved to achieve a D, far less a C, IMO.
 
After that that I would suggest that feedback about the AI having a consistent and coherent strategy is key.  That strategy may not be optimal for the situation, we can't expect adaptive AI at a C level, but an AI taking a smorgasboard approach is always very easy to defeat.  Are their ship designs aligned with their research strategy?  Does the AI have some clear areas is focusing on a particular weapon are those weapons used effectively on it’s designs?  Is the AI targeting a particular victory type and taking actions consistent with that goal?  Etc.
 
Beta testers can also look for simple changes that can have a big impact on AI performance.
on Mar 30, 2015

Ice - I did not make this clear but in saying the AI bumbles around in circles and can't win late game - I was referring to just about any war / or / 4x or civ style game and not to GC2 specifically.

About 10 yeas ago in designing a scenario for Carriers at War using their construction set I got a taste of what designing an AI involved - this is in a static map of the south pacific in WWII for Aircraft carriers for those unfamiliar. ( an Australian company SSI who you are probably familiar with Ice ) 

The complexities involved in whether a Japanese task force would press on or turn back were amazing. Multiple conditions it had to pass and if it failed one it would abort.  This was all to make an unpredictable AI that would provide a challenge and not just blindly and stupidly suicide it's precious Carriers.  This involved only 2 factions allies and axis.

Anyway things may have advanced or be using a far different  system.  But how they can manage it in a huge universe with 10 different factions and hundreds of possible ship combinations in late game is way beyond me.  And possibly beyond them ( and here I mean all game companies ) as well despite marketing claims.  

 

 

 

on Mar 30, 2015

Hey Omega, it must be I'm Spartacus I take it!  I wasn't sure until that post.  Thanks for that clarification, I'm interested in Brad's response on the late game in any case, given the 100 turns in the OP.  It's reasonable to expect a C AI to focus on appropriate victory conditions and adopt a suitable strategy rather than bumbling along.

Your Stardrive example earlier was a good one and hopefully not relevant to GC3.  I only played two games of Stardrive, the second on Brutal difficulty and it was a cakewalk ... I didn't even both with ship design ... and so I just couldn't get immersed in the game as a result. 

I can certainly see Fleet Decision involves many variables but there are many AI methods available.  Unfortunately that was not something I could mod with Distant Worlds.

on Mar 30, 2015

Yeah Ice - I figured you'd know from evil Spock and the Stardrive reference - my Omega777 ID is from 2006 when I first appeared here after buying GC1 and 2.

However I'd guess the farther the game progresses the harder it is to have any kind of relevant AI as the variables increase expodentially.

I have got to find the time to try Distant Worlds -and then your modifications - owned it now for about a year without even trying.

Of course I've owned Sins of a solar empire for over  3 years and have not tried it either

 

 

2 Pages1 2