GameDev: Stupid AI tricks I

Published on Sunday, April 26, 2015 By Frogboy In GalCiv III Dev Journals

For those of you interested in game development, this will be part of a series of how we address “stupid” AI mistakes.  What I’ll be showing in this series are AI mistakes along with what I did to address them.  Feel free in the comment section to include saved games and other examples that you think are worthwhile. 

Just to be sure, “stupid” means exactly that.  Stupid != “non optimal” (“I can’t believe the AI chose a factory over a research building as their 5th improvement on Centi III” is not stupid. But “I can’t believe the AI gave me its home planet in exchange for some beads” would be).

Case #1: Space beads


What’s happening?


When you add an item to the trade screen, the game appraises the value of it.


In the case of a peace treaty, it simply looks at my power vs. their power.  This is a good start but it needs much much more.

So what kinds of things should the AI take into account?

  1. Who started the war.  Which it does (the grudge factor).
  2. The faction power difference. It does this but its weight isn’t related to the weights of things like tech.  This is a very tricky balancing act of course.
  3. How long they’ve been at war.
  4. The personalities at war (are you their primary enemy? if so, they are a lot less likely to want peace).
  5. Do they currently have you by the throat? By that I mean, do they have transports and war ships in your territory? If so, that should matter.

This is, by no means, a complete list but a pretty decent start.

So my first change here is going to be that I don’t want to look at My power minus their power alone. I want to look at the RATIO.  Even if I have 50 and they have 100, a 50 difference doesn’t seem like much. But it is a 2X difference.

However, you can’t go by ratios alone because early game, you can easily get “double” or more of someone else’s power just by building a couple impressive ships.  So we need a combination.

We also need to look at relative costs too.

In this example: Me asking for peace is worth –180 points.  That is meaningless without knowing how much other stuff is valued.

But the tech is valued at 750. WOW! The crappy ship is only 77.

The techs are probably pretty well balanced at this stage and crappy ships really aren’t worth very much.  It’s the treaty that isn’t valued enough.

So let’s go look back at the treaty valuation.

First I’m going to add:

FixedDecimal primaryEnemy = m_primaryOpponentID;

This way, I can penalize the player if the AI has really dislikes them.



In the file GalCiv3AIDefs.xml (anyone can monkey with this) I’m going to change the NegativePeaceTreatyRelation value from 12 to 120.


The Drengin’s power is 254. Mine is 193. That’s a difference of 60.  Ultimately, the cost on this gets modified by a derivative of that value which ultimately comes out to 3 which is why it’s only –180.  They declared war on us, they’re more powerful but they don’t really hate us.  But given that a crappy tech is worth 750 we need to put these values into their place.  Or in other words, –180 should really be more like –1800. 

It also turns out that the Drengin don’t consider me their primary enemy (which is nice) so they should be willing to give me peace for a price.  They just shouldn’t be willing to give me peace cheaply.

Moreover, peace treaties need to be weighted to be similar in value to other items as a starting basis:

So instead of the mod value being 1 I’m changing it to 10.


So let’s make these changes…



Ok. Better. We’ve been at war for 45 turns and I’m not their primary enemy.  3 techs should be enough to buy him off.



“Your gift will be gladly received.”


The Drengin would never say that.  This is where modders will have some fun because this is all data driven. So let’s go fix that.

Open up Flavortext.xml in an XML editor (I use visual studio). Find that corny text.


So that’s the generic response if I’m giving them stuff that is worth more than what they’re giving me in return.

Let’s add some new ones right now.


So if they’re stronger than I am, they’ll have a bit more arrogance.

But still, we’re at war and this is the Drengin we’re talking about. Let’s go further.


Okay, so now the speaker is stronger, and we’re at war so I’ll have them be a bit more cocky.


NOT Drengin-y enough. BTW, you can make your own flavor texts and share them. These fields that you see here auto fill.

Just create a file called say “MyOwnFlavors.xml”  with this at the top:


We include that .xsd file in the game directory to help modders.


Let’s make this text even better.


There. And I even gave it 2 different text options to draw from. I could add more but I’m lazy.  But modders can and I hope will go crazy with this stuff.

Founders: Share your bugaboos!

Published on Sunday, April 26, 2015 By Frogboy In Galactic Civilizations III

We're nearing the end of the pre-release development of Galactic Civilizations III.  While dev will continue on this game for at least the next 7 years (hence, the choice to require 64-bit, etc.).  I want to make sure you guys are happy with the 1.0 launch!

To that end, let me know what your bugaboos are. That is, things in the game that you would like to see fixed before release.

Below is MY list of bubgaboos I've already started working on:

  1. Stupid alien conversation stuff.  Aka "pap".  When I talk to aliens, I want them to feel unique.  
  2. Lighting. Some things are just too dark. 
  3. The fleet window.  I double click on a fleet, show me the whole fleet, not just 3 represenatives.
  4. AI not terraforming enough.
  5. AI doesn't have "cheap" versions of their ships.
  6. Minor races behaving not so minor


What are some of yours?

Stupid AI tricks! Post them here!

Published on Saturday, April 25, 2015 By Frogboy In Galactic Civilizations III


I'm on a plane back from showing GalCiv III ff to the game sites.mgreat fun! 

This week, I want to nail down remaining stupid AI behaviors.  if you see something, comment here on what it is and link me to a saved game.  I'll then look at it and then report how I fixed or changed what it does so you and others can comment.


Galactic Civilizations III: Everything you want to know and then some

Published on Sunday, April 19, 2015 By Frogboy In GalCiv III Dev Journals

Introductions: The oldest actively developed space strategy game series

Galactic Civilizations is the oldest actively developed space strategy game in the world.  The last version, Galactic Civilizations II: Twilight of the Arnor, was released over 7 years ago and remains to this day the highest rated (by Metacritic average) space strategy game of all time.  The series has sold over 5 million copies since its inception back in 1992.

Suffice to say, Galactic Civilizations III has a lot to live up to.

The Premise: What kind of civilization would you make?

In the year 2178 humans have built a colony ship that has left Earth. Galactic Civilizations asks the question: “Now what?”


Earth has developed faster-than-light travel and a constructed a colony ship.

As the leader of a now space-faring civilization, you have a lot of interesting decisions to make.  For example, the galaxy isn’t empty. You will have to contend with other civilizations who have their own agendas. 

Will you build up a strong military? How much should be invested into R&D? What about your culture? Do you want to trade with these aliens? Do you want to help them fight their wars directly or give them stuff and keep your hands clean? When you find new planets, what do you do if there’s already a pre-industrial society living there? What about dealing with disease carried from new worlds? Galactic Civilizations puts these questions in front of the player.

Every game is different. It is the ultimate sandbox game.

The basics

  • Title: Galactic Civilizations III
  • Developer: Stardock Entertainment
  • Release Date: May 14, 2015
  • Genre: 4X strategy
  • Platform: 64-bit PC Windows 7, 8, 10. DirectX 10 or better.
  • Price: $49.99


What’s new in Galactic Civilizations III?

While a lot of work has been done to make Galactic Civilizations III approachable and familiar to those who have played the previous game, the new version is completely new from the ground up.  The effort has focused on making the game a richer, more immersive game experience without making the game feel overly complex.

The major new features over previous versions include:

  1. Ideology. Rather than rhetorically ask “What kind of civilization do you want to be?” GalCiv III also makes it a game mechanic. Your choices will give you access to ideology based abilities. Your benevolence or at the other end, malevolence greatly affect what your civilization is capable of doing.
  2. Much Much Much better colony management.  In previous games, every planet had a planet rating (a number). This number determined how many improvements you could build on that planet.  In GalCiv III, where you build your improvements matters due to adjacency bonuses. This often involves making some tough choices on what you want to build on a particular tile. 
  3. A whole new scope.  Previous games supported up to 16 opponents.  Thanks to the move to 64-bit and multi-core AI design, players can now play on map sizes that are up to 8 times larger than the previous size and play against up to 128 opponents.  Multicore processing has allowed these AI players to take their turn in less than a tenth of a second each.
  4. Multiplayer. For the first time ever, Galactic Civilizations can be played multiplayer. The game will include several balanced multiplayer maps, saved multiplayer games and many other features that make the game quite enjoyable for online/LAN play.
  5. Prototypes. The galaxy now has strategic resources that can be claimed and enable the construction of “one of a kind” ships, improvements and other unique abilities that can give that player a significant advantage.
  6. More sophisticated fleet combat. Galactic Civilizations III introduces the concept of “ship roles”.  Players can (optionally) design their ships, choose what role they have (support, assault, escort, etc.). These roles have very specific rules in how they act in combat.  Players can view the battles and watch the subtle (or not so subtle) ways ships behave based on their role to better design new ships and assemble better thought out fleets. 
  7. Play as any civilization with their own tech tree. While the last GalCiv II expansion introduced this concept, GalCiv III takes it to a whole new level with each civilization being a vastly different gameplay experience. Unique technology trees, colony improvements, ships, AI behaviors and even the ability to create your own civilizations and ships that you can share with others.



Ideology tree

Other improvements

The minor list of features is really too long to list.  A lot of the improvements in Galactic Civilizations III stems from the general improvements that games have seen from better hardware.  So for example, the game is much more sophisticated in terms of the number of factors that go into a stat (like say planetary approval or population growth) but is actually more approachable because of the use of “chicks” (smart, clear, tool tips) that make it clear how a given stat is derived.


“chicks” are advanced tool tips that allow the player to conveniently see what a given item does. This allows us to make the game a lot more sophisticated while keeping it approachable.  In GalCiv II, we had to keep everything very straight forward in order to keep the game from becoming too complicated.

Overall, many of the minor improvements can be lumped into a much better user experience.  It is the best Galactic Civilizations game yet.


A Game Play Example

Earth expands



Heading towards Alpha Centuari

When I originally designed Galactic Civilizations I was (and still am) a huge fan of another 4X game that often ended with the player sending a colony ship out into space.  Back in 1991, when I started working on this, I wanted to know what happened next.  So in our example, our colony ship is heading off to Alpha Centauri. 

Now, I could have chosen to play as any of the other alien races or made my own, for this example, I’m playing as the humans of Earth.


A year later, my colony ship has reached Proxima Centauri.

However, another civilization was once on this planet.


So what should we do? Let’s be pragmatic about this. The researchers who volunteer know the risks.


Proxima. Where I choose to build matters. For example, the tile selected has caverns on it which would make the planet a lot better to defend against invasions if I place a military improvement there.  This early on, I don’t have one. But on the other hand, it’s adjacent to the colony capital which means anything I build there will get a boost. Do I save that tile for later or use it now to get a short-term benefit?


By choosing the pragmatic path for our researchers, I gained enough ideology points to choose an item on the ideology grid. I choose the one that gives me some constructors.

Turn 5: Exploration


It is time to research technologies. Each race gets their own scientist and tech tree. One big change to GalCiv III is that we have technology ages.  This gates different techs without us having to have a super complex tech dependent tree. For example, you can’t just b-line to planetary invasion anymore because invading another planet is a pretty big logistical and engineering feet. So planetary invasion is in the Age of War which requires 12 total technologies to have been research prior.


I turns out aliens don’t speak English after all.  The Altarians look suspiciously similar to humans.


Humans found a second colony around Tau Ceti. It is called Kryseth. A swamp planet.


We also decide it’s time to research a Universal Translator.


This opens up the opportunity to trade.


Turn 20: Economics


Earth has sent its first freighter to an Altarian planet. The ship, filled with the spice “ginger” is much appreciated.


The GalCiv III economy system is all new. Much deeper and yet more straight forward.  By having trade, I can turn down my taxes.


The humans have also started mining a rare material from the asteroid belt between Mars and Jupiter.

Turn 30: Diplomacy


The next alien race we meet are called the Thalan. Their leader, Hithesius, thinks humans look disgusting.


The Thalan have a lot of weaponry. The Earth has never even considered arming its ships yet. Is this a mistake? Worse, the Thalan don’t want to trade us weaponry.


Now that there are 3 civilizations in contact with each other, things start to get..complicated. Right now, everyone is getting along fine.


Our pragmatism is a major issue for the Altarians. But otherwise, the humans and Altarians get along well.

Turn 40: Tension & Challenge


The third race the humans meet are called the Drengin Empire. They will not be our friends.


Technology allows players to create new tiles. Where you place them is important. In this case, adding a tile in India will allow for a factory to be biuld that gains the benefit of having 2 other factories and the Terran capital adjacent to it. 

As a side note: The game randomly decided that Hong Kong is the capital of future Earth for this game. Smile


Thus, when a factory is placed here, the adjacent factories gain a level and this factory is instantly a level 3 factory.


By being level 3, it produces 15% more goods than it would have otherwise.


Only 12 years after the start of the colony race (2200) the 4 major space-faring civilizations meet about establishing a United Planets. With the Thalan’s support, the Terran Alliance becomes the home for this new organization.


The Drengin Empire is already interested in conquering.  The Earth passes on this so-called “opportunity”.


The Earth and its colonies have focused on building a powerful economy rather than a military. As this graph shows, the humans are the leaders in total production.


The notification system keeps us up to speed on galactic events. Thus, the Terran Alliance is aware the Drengin are attacking our friends, the Thalan and their shipyard is busy building attack ships.


Speaking of shipyards, one of the cooler new features of Galactic Civilizations III is that ship construction has been separated from planets. This means that having a large empire of colonies doesn’t mean a bunch of tedious ship building prompts. You can build a few shipyard and have your colonies feed them.


A shipyard has sponsors who send manufacturing resources to it. The Terrans get to have a lot more than other races (normally you can only have 5 sponsors). This greatly reduces micromanagement late game.



Turn 75: Paths to victory

While conquest is, admittedly, the most common way people try to win.  For this example, the Terran Alliance are going to try for a cultural victory.  This is where your culture spread so completely through the galaxy that your soft power becomes irresistable.


Early on, the humans found a relic of the Precursors. This relic gives the possessor an intangible effect on ones culture. Since this is a game, it results in a 10% bonus to all cultural improvements which is pretty huge.


Terran mining operations continue to grow.


To pull of this strategy, the Terran government, in a meeting in Hong Kong (of course) agrees that surveillance of the various wars is needed.  To that end, a new sensor beacon is designed and built to be sent out to watch over everyone.


Earth has built up nicely.


Turn 100: Cultural Conquest

GalCiv III is serious about having its other winning conditions be viable.  Cultural conquest is not easy.  Here’s why:


First, if you are focusing mostly cultural influence you are not going to have a big military. Therefore, gaining points at diplomacy matters. There is an entire part of the tech tree dedicated towards building diplomacy points. You must gain these faster than their annoyance with you.


Second, you must research technologies that give you more influence and place them in the right spots. Getting back to one of the improvements in GalCiv III are the chicks showing why my influence per turn is 2.0 and how that grows over time. You can see the various elements that contribute to it clearly.


Third, you literally have to advertise your culture by building cultural starbaes in your target’s territory. This will expand your influence but will make them that much unhappier. Thus, the pressure remains on that civilization to keep improving their diplomatic skill.



As you can see, the Drengin is now well within my sphere of influence and is slowly rebelling.


Thus, putting resources on improving ones diplomacy is crucial. But that’s also effort not being placed on weaponry.


Another change from GalCiv II is the careful balancing of what exactly is power.  Even though the Terrans have no military power, they are still looked upon as the most powerful in the galaxy. How is this?


This is why.  Would-be opponents will measure one’s potential military power and make a guess on how quickly that potential could be turned into actual power.


Once a civilization becomes close to another civilization, they are open to becoming an ally.


Turn 150



We still have a ways to go to win. But progress is rapid.

I’ll leave it here for now.  What will happen? Will the Drengin Empire allow me to simply dominate the galaxy due to my diplomatic smoothness? Should the Terrans use their new-found alliance to try to defeat them? Can I convince the Altarians to join the Thalan and the Terrans in an alliance? Or will something unforeseen plunge the galaxy into war?


The Drengin don’t like us but our diplomatic skill has been enough to keep them at bay (along with our implied potential power).


With our alliances, the Terrans could have become a formidable military power as well through technology trading.

How will you rule the galaxy?

The Terran Alliance have chosen a path of pragmatism and diplomacy.  Other paths could have been taken. Military power. Technological victory. Ascension into a higher state of being. Diplomatic Alliance (which the Terrans are pretty close on).

That is what has always made Galactic Civilizations unique. It is a strategy game but it is also a sandbox game designed to let you create your own epic story on what your civilization would do.

I hope you’ve enjoyed this. Please feel free to ask any questions in the comments section.

GalCiv III: Drengin/Human Wars III!

Published on Saturday, April 18, 2015 By Frogboy In GalCiv III Dev Journals

It. Is. On!

Our story so far…

As an AI test, I see how well the Drengin do in what would normally be a multiplayer game. I have this map where I play as the Terran Alliance run by those crazy primates from Sol 3 (aka Earth) from the year 2245.

My opponent are those brutal, skin eating bastards from Drengi who recently wiped out their own sub-species the Korath because, they’re just that nasty.

In the previous tests, it’s been a sad sad story of me just wiping out the stupid AI.  But now a month of heavy duty AI coding has gone in.  Let’s see how they do.


First off. I’m turning off FOW.  I’m doing this to better view what they’re doing.  So we can all see what’s going on.

Second, I’m playing on normal. So the AI gets no advantages, bonuses, etc. whatsoever.  So overall, as the human, I have a slight advantage.

Starting Locations

In this corner the humans get their watery planet that they have ironically named Earth.


The main stats:

  • Manufacturing: 7.7
  • Research: 8.3
  • Net taxes paid in: $6.7
  • Approval: 50%


Now, let’s look at that polluted crap hole called Drengia.


The main stats:

  • Manufacturing: 12.5
  • Research: 10.8
  • Net taxes paid in: 0
  • Approval: 40%

So they’ve already adjusted their spending and rush built a work camp.  The Drengin are naturally disconent because, again, their home is a crap hole.

Turn 0


This is the whole map.  The AI cannot win through attrition here. It has to play intelligently.  There’s no opportunity here for shenigans since I can see everything it is doing every turn.  The goal isn’t to be fair but to see how well the AI plays.

Early Choices

I am going to play as Benevolent.


I chose to rush colony ships a bit faster than the Drengin so I take an early lead in planets: 4 to 3. 

The AI makes a mistake: Tries to colonize Mars.  I don’t have an API yet that lets me make a good judgment (without hard coding which we’re avoiding) on whether a planet is too far in someone else’s influence to bother with.

Expand: Complete

By turn 30, all the planets are filled. How we doing?


They’ve caught up in power.

And in total production:


Exploit and Exterminate:

But I have planetary invasion and in fact, I have 9 techs they don’t have. They only have 3 I don’t have.

I am also going to see how much I can exploit the game’s influence system.  Have we balanced this properly?

AI mistakes

The AI should be able to take notice that I have invasion tech and start putting defenders in orbit. Instead, they’re building constructors

Which is a shame because I’m totally going to exploit it.


And so I do. And they die.

Where did  they go wrong?

That’s easy. We intentionally make it easy for a player to see what techs other players have. It’s vital. And the AI simply didn’t respond to the fact that I had invasion tech.  They should have switched to building some defenses. If they had done that. It would have been a very different game.


The rematch

After a day of coding I think I’ve gotten them to be much better in the area of situational awareness.  I am confident I can beat them in a fair fight but I expect to have to work a bit more.

Let’s find out:

Turn 0:


This time I’m optimizing from the start so it’ll be even harder on the AI.  I’m going to b-line to warfare and conquer them.

  • Manufacturing: 6.7
  • Research: 17.7
  • Net taxes paid in: 0
  • Approval: 50%



  • Manufacturing: 12.5
  • Research: 10.8
  • Net taxes paid in: 0
  • Approval: 40%

Now, the thing to remember here is that the particular game I’m playing is not representative of a normal game. I am b-lining in tech so I have my tech way up at 18.  Plus, the Drengin tend to focus more on manufacturing. 

The other thing to remember is that the Drengin are not as good as the humans economically but are really good later game with their fleets (they pay slightly less in maint). This means that in a short game, I have a slight advantage by picking Terrans.  Once I’m satisfied with the AI, I’ll probably do Terran vs. Terran games.

Exploit and Exterminate!

I got invasion in only 36 turns. I bought up research centers instead of taking an extra planet.


This means we both have equal numbers of planets (4 to 4).

and this time..


The Drengin have started building token defenses just in case.  The system is actually reasonable accurate in that it can tell whether I’m in range of their planets (i.e. if someone is off on a huge map they won’t care as much).


He’s definitely keeping an eye on me.


Here we come…


The Drengin have a Mark II defender class ship (they call the Tho-Altha) in orbit. That…is unfortunate.

Let’s take a look at the home worlds..


  • Manufacturing: 17.3
  • Research: 18.2
  • Net taxes paid in: 6
  • Approval: 58%

The Drengin are putting some effort on getting some money.


  • Manufacturing: 23.1
  • Research: 11.8
  • Net taxes paid in: 1
  • Approval: 51%

We are relatively even.  The AI is being punished a little because approval doesn’t currently matter as much as it probably should. The AI is taught to keep its approval decent.  I think eventually high approval will translate to production bonuses.

Too late


He saw the threat but was too slow to do anything about it.  He had defenders on his border planets but not back at his core worlds.  Admittedly, lack of FOW made that possible.


I won’t be able to get Kona though.

Meanwhile, I took one of his other planets.Not sure what happened to that ship that he had.  I know the AI can get a little aggressive in decommissioning “old tech”.


What he does have are pretty decent ships. His battle cruiser is giving my battle master a work out.


However, and this is where GalCiv III shines: I have a Prototype ship called the Sherman. Prototype ships are the result of owning special resources. In this case, I have an anti-matter resource.


Anyway, it’s only a matter of time.  I need to get the AI to surrender at this stage since it’s hopeless.

What mistakes did they make?

The first one is something that might be a bug. One of its shipyards lost its sponsors because they were in my territory.

The second issue is that the AI probably should have a cheaper defender ship. It shouldn’t be about having a great defender but rather an inexpensive one that does the job. Will have to think more on it.












GalCiv III: April 2015 status report!

Published on Wednesday, April 15, 2015 By Frogboy In Galactic Civilizations III


We will shortly be releasing a new Beta 5 build. Mostly a stability and performance update for players.  

We are starting to reach the end of the line for launch of Galactic Civilizations III and having to begin making those tough decisions on what will be in the base game and what will be in a free update and what will be in a future expansion.

Free updates: A better anti-piracy strategy

For those of you not familiar with Stardock, we like to support our games with free updates. It's our version of anti-piracy: reward our customers with lots of free additions.  We're reading the forums and writing down suggestions and requests from players on things we can add after release. Much of this comes in the form of user interface improvements to make managing your empire easier.  But we have other goodies as well in mind that we'll be talking about after release.

Computer AI

AI doesn't get the love from gamers that I think it should. Thankfully, we really appreciate that you guys care about it. I'm biased but it is one of the areas you will likely notice the most significant changes over the coming month.  Even this week it is massively better (and faster) than what was initially in beta 5.

Tonight I'm trying to get it better at research technologies. The trick is to do it without scripting.  I did make a lot of progress on getting it to build ships more intelligently without scripting which should become apparent in beta 6.

Playability and features

We're starting to get close to feature complete. Beta 6 will be "feature complete". After that, it's just bug fixing and optimization as we await release day.  Getting the graphs and end-screen might be a bigger deal for me than most people. I use those graphs heavily to gauge AI performance.  Similarly, the improved mini map (you can see it in the above screenshot) helps determine how well the random map generator is doing at creating interesting maps.


As I mentioned elsewhere, I've gotten AI time to less than a quarter second per turn on a reasonable system per player. The bad news is that if you have 100 players, that's 25 seconds per turn.  The good news is that I think I can make this much better over time for those who have at least 4 cores on their CPU.  The more cores, the faster it'll get. There's just no cheap way to do some of the AI stuff we want to do without the AI cheating like crazy.


We do plan to release the game with free launch weekend DLC which will go to everyone who has already bought the game and the people who buy it opening week. It's just ship design bling (nothing functional) but a special token of gratitude to you guys who have made this game possible.  


While most people don't play this game multiplayer. We have spent a great deal of time on it and we want to make sure we don't choke at the end.  I hope to get some 1 on 1, 2 vs. AI and a 4 person FFA series of maps in that we can play together online.  Some of the new Metaverse features should be making it in so that we can hopefully get rankings and other goodies out there either by release or shortly after.

The Campaign

While GalCiv III is, at its heart, a sandbox game in which the player is asked: What kind of insterstellar civilization would you make? The campaign continues the story of the rise (GalCiv I), the fall (GalCiv II) and the crusade (GalCiv III) of humanity into the galaxy.

For those of you just joining us here's a super brief synopsis:

GalCiv I: Humans develop a new stardrive technology that allows ships to travel FTL on their own which starts a space race to colonize the galaxy. They are resisted by a race called the Thalan who claim to have come back in time to stop the humans from destroying everything in the future through a violent crusade.

GalCiv II: The Drengin Empire, gradually losing the colonization race to the humans, starts seeking out ancient relics left by the Precursors and inadvertently open a pocket universe freeing super advanced aliens called the Dread Lords who begin destroying everyone.

The humans and their allies manage to defeat the Dread Lords only to be overwhelmed by the Drengin Empire who had been lying in wait. A human fleet retrieves an artifact that puts a shield around Earth and escapes into the pocket universe.

...10 years have passed...

GalCiv III: The Drengin have earth surrounded but cannot break through because of the force shield surrounding Earth. The Drengin presume, wrongly, that the humans are simply cowering behind that shield.  Meanwhile, the Terran fleet that disappeared into the pocket universe has returned, armed to the teeth with Precursor weaponry.



GalCiv III - Surreal AI work

Published on Wednesday, April 15, 2015 By Frogboy In GalCiv III Dev Journals

For those of you who haven't been following Stardock these last few years, it has helped found a series of new studios out in the Maryland and Austin areas.

In Towson Maryland, we have 3 studios located in the same building which is where I am today working on the GalCiv AI.

The people who make up the new start-up studios include many of the leads of Civ IV and Civ V.  So as I'm writing the AI, I am literally feet away from Brian Wade (Civ V AI) and Soren Johnson (Civ III and Civ IV AI).  Together, we can compare notes on different effective strategies for getting the funnest and most challenging AIs going.

Today's work is dealing with technological research that the AI should do.  I've already handled much of the strange ship building decisions (you'll see those improvements in beta 6).   But making sure that the AI makes good strategic choices without scripting it is a real challenge and being able to ask questions of other AI developers has been a real pleasure.


GalCiv III: Weekend update

Published on Sunday, April 12, 2015 By Frogboy In GalCiv III Dev Journals

It was a totally awesome weekend for GalCiv AI and perf progress.

There is a lot new in GalCiv III over GalCiv II but one of the most obvious is the number of players and the galaxy size the game supports.

GalCiv II topped out with 16 players. That was a lot for back then when you’re dealing with a non-cheating, sophisticated computer AI that has to design its own ships and planets.

But GalCiv III tops out with 128 players.  That’s 8 times more players than GalCiv II and the map sizes (or more importantly, the number of planets) tops out at around 8 times more as well if you’re really wanting an insane game.

Thankfully, our CPU power has increased by a factor of 6 since then. But that power is a bit deceptive because most of that power comes from multiple cores.  In 2006, the high end machines had 2 cores which GalCiv II made the most of.  Today’s machines have more and we do our best to utilize them. 

Turn Time focus

The most interesting way to get perf improvements is to throw everything we have at it.  In this case, play a game on an insane galaxy with 100+ players.  On Beta 5 (the build you have) each turn took on my monster box 95 seconds by turn 5.  That’s unplayable IMO.

So why was it so slow? Things that are fine with 10 players quickly break down as you add more.  But even at 10 players, those inefficiencies are there.  By the time we finished this evening, we had gotten that time to 24 seconds.  That’s still really long but we’re going to have to soon make tough choices between non-cheating, smart AI and performance. 

The good news is that there’s still a lot of room for improvement between now and release.  On a more reasonable map size, the next beta update should be a pretty spectacular improvement.

AI Focus

The analytics on strategy games show that most people don’t really appreciate good AI. But we know our core customers care about it and that helps motivate me to make sure the AI is as good as I can make it in the time available.  I look at GalCiv III as the starting point as I am sure I’ll get schooled by other players.  But this weekend saw some massive improvements to the way the AI fights wars and detects threats.

The AI improvements were one of the reasons I decided to dive into the performance issue so much.  The things I’m doing are expensive and while I am pretty familiar with how to limit the scope of an AI call, it’s still expensive to do a proper threat evaluation.

Not this week but next week I’ll get started on the diplomacy AI. I’ll be asking for your feedback on possible exploits and such to look out for.


The stability on the largest maps is still really tough. It’s made a lot of progress recently but it still has a ways to go.  It’s not particularly complicated it’s a matter of optimizing and compressing data to handle those really really really large maps. 

As a practical matter, if you have less than 4GB of memory you should probably not be going beyond large.  The large map size in GalCiv III is really big. The bigger ones are gratuitous but are also being made with the knowledge that in a few years, 16GB and 32GB will be a thing. 

That said: We are focusing a great deal of effort in optimizing memory use.

GalCiv III: Hanging out this weekend

Published on Thursday, April 09, 2015 By Frogboy In GalCiv III Dev Journals

Hey guys!

I’m going to be hard core on the GalCiv III AI this weekend.

For those of you just checking in, I put together a long laundry list of new functions I need to improve the AI. In the old days (when I was younger) I would have written those functions myself but now I’m old and fat and lazy and my far more talented colleagues can put together something a lot less hackish.

So this weekend, I’ll be using these new APIs to vastly improve the AI.  The weather around here is going to stink so if you’re going to be indoors anyway, let’s hang out (virtually).  Just let me know where you guys think is best (Reddit is fine for example) and I’ll be doing streams of what I’m working on and we can chat about how we can get the word out on this game more before it ships and anything else you’d like to chat about.

The Reddit hangout link:

UPDATE: You can also visit  



674 pages 1 2 3 4 5 6 7 8 9 10 Next