The AI in GalCiv II Part 5

Summary of so far this holiday season..

It's been a productive holiday season. ;)  The AI that existed in Beta 5 (public) is dead. It's gone now. And it won't be remembered fondly. Not by me at least.  It functioned.  But the fact is, in a game that has no multiplayer the standard of quality on AI should be very very high. 

It isn't enough for a game AI to be challenging.  The AI needs to be more than that.  It needs to play like a human being.  Much of what I've done this holiday is go through and play the game over and over and think of different ways human beings would play the game.  Then I've tried to replicate that.  We want a player to feel like they're playing someone else on-line (minus the disconnects and swearing).

Here's what I've checked in so far:

There are a bunch of important changes in this that will have a significant impact on gameplay.

Here is what has been changed:

+ Various bug fixes

+ Various new helper functions

+ New function: CalculatePrimarySectorToConquer(). AI creates a set of sectors that it wants to conquer. It also creates a set of sectors it wants to protect as a priority.

+ Modified base ship design to put more effort into range.

+ New AI ship class: Scout

+ AI designs scouts

+ AI evaluates whether it can “trust” another player based no their past behaviors.

+ AI looks to see if someone is culturally attacking them.

+ AI looks for military threats (like someone massing forces).

+ AI looks to see if there are hostiles in sector and if so, avoids sending transports there IF it knows about the ships.

+ AI no longer “knows” where good planets are. Non-Terran AI knows where planets are and is better at scouting. Terran AI has to send scouts blindly.

+ AIIsPlanetKnown() determines whether the AI knows what’s going on on a given planet.

+ AIIsShipKnown() determines if the AI knows about the existence of a given ship.

+ AIFindUndefendedPlanet() gets a sector ID and looks to see if it knows about any undefended planets.

+ AIIsSectorFocus() checks to see if a given sector is of interest to the AI.

+ Continued (and failing) attempt to get the AI to build key planetary improvements on its planets.

+ AI builds scouts

+ Tweaks to what kinds of ships the AI will build to be “smarter”

+ THE END OF THE COLONY RUSH. Colony rushes were wrecking the AI economy because colonies now have a significant upfront cost.  Now, the AI will take a break from colonizing in order to build up what they have so that their economies stay strong.

+ Smarter choices when building ships.  AI was going broke in cases due to buying ships.

+ AI temporarily no longer leases any ships

+ AISetDestination() modified to use new SDS/AI classes.

+ SDS/AI uses new AI functionality (discussed below)

+ AIFindColonyDestination()

+ AI can only colonize planets it knows about.

+ AIFindConstructorDestination()

+ AI will try to bail out colonies that are under alien influence through its own influence starbases.

+ Various fixes so that the AI will intelligently find a new destination after its first destination changes (or is destroyed) mid-turn.

+ AI designs escort ships

+ AI now builds escorts

+ AIFindEscortDestination()  will take escorts and look for transports to escort so that they have some defense.

+ Transports are now designed with more speed in mind.

+ Transports will run away from hostile ships.

+ AIFindTransportDestination() looks for planets to conquer. Totally new tactics than old system.

+ AIFindScoutDestination() looks for destination for scouts. Terran AI has to send it to stars, non-Terran AI will send it to planets since it can see planets thanks to starting with Stellar Cartography.

+ AIFIndMilitaryDestination() totally new way of deciding which ships to go after. It’s MUCH smarter.

+ AI at higher levels uses rally points, sends ships to rally points and then builds fleets there.

+AIFindMyColonyUnderAlienINnfunce() finds a colony that is under serious risk of alien influence and returns it so that it can be countered.

+ Fixed some bugs with AI accidentally looking at Local Player (the human player) instead of the player passed in.

+ Changed the way approval rating on colony is calculated so that tax rate isn’t tied to population anymore.  Population causes unhappiness and tax rate does but they are not intermixed.

+ Fixed bug where population would grow until approval was at 30% but population would start shrinking at 40% so you would have weird jumping in population.

+ Changed (now that the manual is printed) how much money different government types give: 10% for Republic, 20% for Democracy, 30% for Federation.  Before you just got ridiculous amounts of money.

+ BUG ALERT: There are cases where ships are not being destroyed so you end up with ships on the map that have 0 hitpoints. Same as in planets. Not sure what the cause is but it was wreaking havoc so I put in a TEMPORARY hack fix into RemoveAIShipsFromPLanet() or whatever it’s called so that if a ship has no hitpoints and the ship is not marked as destroyed that II destroy the ship. This needs to be fixed correctly.

+ Lowered cost of upgrading ships.

+ Made whether a given player can see an object part of the base game object class.

+FindClosestLocalTransport(Parameters).  Depending on the parameters, will find a transport in the current sector.

+FindCLosestUndefendedEnemeyPlanet(Parameters). Looks throughout the galaxy for an undefended planet based on the parameters you give it.

+ScanSector() Tells the AI to scan around them to catalog what planets and ships they currently know about and put it together into a list.

+ Tons of tweaks to make the AI better at targeting specific ships and focusing its military might effectively.

+ AI won’t just willy nilly send its ships off to the next battle, they’ll stick around even after your defenses are gone until the transports have come and conquered. Only applicable at higher difficulty levels. Naturally with our luck all this work (which was significant) will get ignored in reviews since many reviewers play the game at beginner and don’t’ see the AI really in action.

+ Tons of tweaks and adjustments to how the AI plays out its strategies.

+ AI will sometimes report to the player that it knows what the player is up to. I.e. you mass up ships next to its planets and the report window may say “We know what you’re doing”.  IF there’s time, I’d like to have it come up with a snarky “Well duh, we play strategy games too” type dialog.

+ AI detects ship massing and will silently try to prepare itself for attack. It pains me to have all this counter-reaction going in and the human player may not ever even be aware that the AI is aware of the old “I’ll stick a bunch of big ships and transports next to their planets/cities/whatever and then suddenly attack” trick.

+ Engines use less size

+ Life support uses less size

+ Initial colony maint cost lowered from 25 to 20.

+ Cleaned up starbase modules so that they follow more logically.  Also, battle stations is required to get any of the other starbase defense ones (was getting annoyed wading through all the modules all the time).

There's still more to do, but not that much more.  The key modules are now in.

31,164 views 20 replies
Reply #1 Top
Lots of cool stuff on the list there We going to see this new AI in a final beta build before it all gets locked down?
Reply #2 Top
Frogboy,

What are your thoughts on a SDK like civ 4 is doing? Players could then improve/make their own AI modules.
Reply #3 Top

Not really doable as our AI is strictly C++ and linked in.  I'd love to see something that lets players tweak various variables but that woudln't be available for release.

There won't be any more public betas at this point.

Reply #4 Top
Sorry there aren't anymore betas.
Must we buy the D/L version from the pre-sellers only? or will we be able to purchase directly from StarDock when you do the final release?
Reply #5 Top
Love these AI updates! Now if only stardock would take over the Civ franchise
Reply #6 Top

SSG Geezer, when the game comes out, you can either purchase it at retail or you can purchase it directly from us.

As for the Civ franchise, personally I think Civ IV shows that they know what they're doing. Civ IV IMO is the best game of 2005.

Reply #7 Top
Well I finally pre-ordered the game tonight. Now I just gotta wait another two months and hope I don't go crazy in the meantime!
Reply #8 Top
Functions like AIIsPlanetKnown() and AIIsShipKnown() seem to indicate that the AI has to explicitly "cover its eyes" in order not see game elements that are hidden by fog of war. I've been thinking about the same problem, and I've been wondering if you have considered creating some kind of "fogged" world state that the AI can use directly, without this explicit masking? That seems more elegant but also a lot more work...
Reply #9 Top
Just to be clear Brad - are we saying we don't get to play with any more improved de-bugged versions of BalCiv2 now until it is relesed I beleive in Feb06?
Reply #10 Top
Bit Disapointed there won't be a final A.I enhanced public beta.It would help pre-order sales immensely having all these guys praise the military A.I.
Reply #11 Top
If the AI actually does what it says here it will do... than this AI will be one of the best to date. And this is the major expectation from a strategy game!
Reply #12 Top

Just to be clear Brad - are we saying we don't get to play with any more improved de-bugged versions of BalCiv2 now until it is relesed I beleive in Feb06?

Yes. There will be no further public betas of GalCiv II.

Reply #13 Top
Will GalCiv 2 take advantage of duel processors since they are becoming cheaper? Also will you be tweaking the Civ4 AI any in your spare time? It would be interesting to see what changes you would have made with civ4 AI. But I'm sure you'll be too busy with GC2 to give too much time with civ4.
Reply #14 Top

Functions like AIIsPlanetKnown() and AIIsShipKnown() seem to indicate that the AI has to explicitly "cover its eyes" in order not see game elements that are hidden by fog of war. I've been thinking about the same problem, and I've been wondering if you have considered creating some kind of "fogged" world state that the AI can use directly, without this explicit masking? That seems more elegant but also a lot more work...

It's the same thing for the human.  Every pixel on the screen is in an known/unknown state. Same for ships and planets.  The diffrence is that the human ones are visual and handles by the drawing routines, but it's the same concept.

Reply #15 Top

Just to be clear Brad - are we saying we don't get to play with any more improved de-bugged versions of BalCiv2 now until it is relesed I beleive in Feb06?

Only users with Diplomat access or higher will have access to the gammas. Diplomat access is based on feedback and such on th eforums (Some people have veteran access which means they're close to getting diplomat access).

Specifically, the gammas are handed to those who have demonstrated an ability to get us very fast, reliable, and effective bug reports and such.

Reply #16 Top

Will GalCiv 2 take advantage of duel processors since they are becoming cheaper? Also will you be tweaking the Civ4 AI any in your spare time? It would be interesting to see what changes you would have made with civ4 AI. But I'm sure you'll be too busy with GC2 to give too much time with civ4.

GalCiv II automatically uses dual processors because the game is multithreaded.  SAme for dualcore. 

As for Civ IV, that's really up to Firaxis.  The Civ IV AI is really quite good IMO.  I've not been able to beat Civ 4 at any level higher than monarch yet (though I haven't had a lot of time to play it as you can imagine).

Reply #17 Top
Well, maybe for Galciv 3, AI will be built as dll's?

Looks very good though, can't wait for release, almost don't want to play the latest beta because now I know it can't compare to what isn't released.
Reply #18 Top
Looks very good though, can't wait for release, almost don't want to play the latest beta because now I know it can't compare to what isn't released.


Keep playing and submitting bug reports and tweak suggestions, the more feedback Stardock gets the better the final release will be and the quicker ny problem get patched up in the future.
Reply #19 Top
I love what i've read....If you could only do Master of Orion 4 afterwards, we would have two fantastic series again....
Reply #20 Top
OMG! Noo... Gal Civ is the anti-MOO . I do share your sentiment though, praise Stardock and praise Gal Civ 2.