Brad Wardell's Blog


Playing with numbers in GalCiv II in-depth

Published on Monday, March 20, 2006 By Brad Wardell In GalCiv Journals

So how exactly does/should production work? Here's how it will work in v1.1 which will seem pretty much the same to people who aren't really into the numbers but will be a major improvement to people who follow stats.

On your planets you build factories and research labs.  These factories and labs produce industrial units and technology units.

Your spend rate determines what % of your factories and research are to be funded. In addition, the 3 sliders funnel that funding in to military, research, and social production.

What affects production?

You also have a number of bonuses that come into play:

1) Special tiles will add a bonus to the given factory or lab's production level.

2) Starbases can assist factories and labs by cranking up their production by a %.

3) Planetary bonuses (from events) can increase research or manufacturing.

4) Your civilization ability in research, social production, and military production can have an impact as well.

Half of your bonuses (2, 3, 4) you are not charged for. You simply get them for free. Yay.

The code: (for those interested)

CalcCommerce().  This function looks at your factories and multiplies that by any special buildings (like a manufacturing capital). It then takes into account things like whether there's a United Planets issue involved (like the galactic prison).

CalcTechnologyProduction().  This function looks at the total value of the labs and other research providing buildings, multiplies that by any buildings that increase research production by a % (like a technology capital) and puts it together.

CalcResearchProductionBonus(). This function looks at CalcTechnologyProduction() and then returns how much bonus research you get from your ability, whether the planet has rings (10% bonus),  whether there's some other event in action, etc.

CalcProductionBonus(). Same as ResearchProductionBonus except it looks at industry related bonuses.

Sins of the past

Galactic Civilizations II's system was a carry over from the original game (2003) in which the various abilities, values, etc. were morphed based on play testing.  And in the case of things like morale which generates your approval rating, your morale ability is literally added to your approval rating at a rate of Morale Ability to the .90 power. Why? Because from play testing that was the most fun in how the various buildings and abilities worked.

But sticking with production and research, which is the real nuts and bolts, the idea here is to streamline this so that the mechanics are straight forward and easy to understand.  I also want to add tool tips that spell out this stuff if there's time.  If you have the non-English version of Galactic Civilizations II you may want to switch to the English version for 1.1 until the new text is translated.

Real world examples

So for spread sheet gurus, what can we expect in the terms of numbers? In the game I'm in I have two planets: Haven and Vizzard II.

My spend rate is 100%. And all my money is going into research. Haven is my capital and has 3 labs. The planet has a 12% research bonus due to an event. I have a bunch of starbases around it that double my factories and lab production. What should it look like?

I'm only charged for half the bonus production (so half the starbases, half the planet, and half the ability). So even though I'm getting 134 research per week from Haven, I'm only being charged for 94 of it. Yay. The other 40 of it is "free".  Where did that number come from? Well, the base production on Haven is 54 (24 + 30).  My total research is 134. 134 - 54 is 80.  So 40 of that extra research is free and the other 40 I'm charged for.  The original 54 I'm charged for so 54 + 40 = 94.

To the average player, this is a bunch of either "who cares" or "This is so complicated".  The system isn't really designed to be spread sheeted this way and in GalCiv 1, few people did.  But enough people had a huge outcry that they couldn't just spreadsheet this stuff that we ended up in a situation where we needed to be able to put this stuff together in a way that people could understand.

Eventually I get something like this:

If this all looks confusing and such, don't worry about it.  It should look confusing and complicated to most people.  But to people who really get into the numbers, this is what I think many of them were looking for. Very clean, straight forward economics, albeit with a lot of modifiers involved but at least it's knowable.

Where things get really a pain in the rear is when you deal with the new social wastage elimination.  Should unused social production get to get all those nice military bonuses? That is, if I've got say 50 social production going but I'm not building anything, should that 50ip's get all the bonus modifiers and become say 100 military production? 

After a weekend of playing it both ways, I decided on no.  That social production is transferred to your total military production on the planet but it doesn't get all the bonuses. There has to be something to benefit the player who runs their economy well, otherwise we might as well just get rid of the economic system entirely and just have it a be a mindless grind of cranking out ships.

The other tough question is whether your base social production should get bonuses and all that good stuff and then have that magnified amount be transferred over to your military.  Again, after playing it for awhile, it just seemed incredibly cheesy that a player could see their ships get cranked out really fast because they had picked a high social production value. It also seemed counter intuitive.

Here's how I tried to game the system with a 2% Military and a 98% social:

So what Haven ended up getting in terms of military production was 1 from its base and 2 (rounds up on bonuses) on the bonus for a total of 3 natural military production from the 2% ratio.  Then the 52 from the base output from social spending is transffered over for a total of 56 military spending.

You can imagine some of the cheesy scenarios I went through though.  In one case, I had something like 300 military production because I got the bonuses from the social production and then that production got re-bonused when it was transferred over.  And at that point the entire game mechanic starts to fall apart.

In extreme cases there will probably be some slight round off error. It's unavoidable when you're taking 50% of 3 (for instance).  But you get the idea.

Damned if you do and...

What's ironic about all this work on streamlining this is that you will have more people who like the fuzzy stuff and argue the game has no "soul".

We could have just used flavor text on the abilities and saved ourselves a lot of trouble and had one group be happier with things like:

Military Production Ability:

( ) Basic
( ) Industrious
( ) Magnificient

And let the user "imagine" what those values meant other than "something really cool".

Master of Orion 2 had a bit of both. "Fantastic Traders" instead of Trade Bonuses.  And "Charismatic" instead of a set Diplomatic Ability.

I think if there's a Galactic Civilizations III that you'll see the abilities evolve into something that has elements of this.  It's important to note that Galactic Civilizations preceded Master of Orion in terms of a public release (original OS/2 version) so when someone thinks that GalCiv is really a "MOO clone" they don't realize how far back the game goes.

My view on this kind of thing is that games have to evolve over time and good games integrate features from proven successes. Otherwise, the game designer's just being obtuse IMO.

Playing with numbers

Published on Sunday, March 19, 2006 By Brad Wardell In GalCiv Journals

One of the things that bugs me and bugs others is that some of the numbers, especially for abilities, get morphed when they're factored into your production. That's from play balancing and such.

But now that the game's been out a couple weeks, we have been able to play around with the values based on how people play.

For instance: Abilities.

The way research, social production, and military production are going to work is that players will see X% increase in their production.  Half of that production will be "free" (i.e. won't be charged) and the other half won't.

But to go along with that, we're going to tweak the starbase mining modules as well as the starting abilities.  But this way, players will see a much more direct correlation between what they're picking and what they're seeing.

Another area we're going to be tweaking is how much factories and labs produce. We're going to "nerf" these a bit. But before anyon panics, understand that the buildings are doing less because the abilities are providing more of a bonus AND because social production now goes into military production.  The effect of that is that we're seeing units getting cranked out a lot faster. So we're trying to keep the pacing the way people like it and not have things go crazy.

While in the starbase module area, we're going to make some tweaks to influence modules. First, resources will lose a bit of their power on their own but the abilities (like I mentioned) are more important. So not much of a net change there.  However, the first influence module you add will be very expensive.  However, after that, they'll be free.  It's just tedious going through a bunch of piddly "pay X" modules where X is not very large.  In addition, we're going to decrease the # of modules a bit but make the remaining one more powerful.  The effect should be that it'll require slightly fewer constructors to get your cultural conquest going. 

Overall, the goal is to streamline some of the statistical game mechanics so that you can focus on your strategies and less on number crunching.  We'll have a beta of this out this week and you'll be able to give us some feedback on those numbers.

But I do want this build (1.1) to be the build that we stop playing with these numbers so that people (fan sites, wiki pages, etc.) can table-ize this stuff.

Weekend AI work..

Published on Saturday, March 18, 2006 By Brad Wardell In GalCiv Journals

Work log on AI for this weekend.

1) Adjust AI strategy for when g_pGalaxy->abGameOptions[GAME_OPTION_DISABLE_TECH_TRADING] == TRUE

2) Regarding speed of ships.  Player ignusss writes:

This is now my understanding of how the AI uses his different military shipclasses:
Tiny:
Fighter: No engines. Attacker.
Small:
Defender: No engines. Defending planets.
Heavy Fighter: No engines. Attacker.
Escort: Multiple engines (often see them with two). Defending transports.
Medium:
Frigate: 0-1 engines. Attacker.
Cruiser: 0 engines (at least I don't remember having seen any). Attacker? Defender? Maybe both?
Large:
Battleship: 1 engine (haven't seen any with no engines yet). Attacker.

No engines on defender is IMO fine. I have no opinion on no engines on fighter because I never build those. Heavy fighter would benefit from an engine though since the AI otherwise wouldn't have any fast attack ships before Medium hulls. Cruisers are okay as planetattackers if they have faster attackers screening their advance, would also be good defenders, otherwise probably not much use.
Now frigates should IMO always have one extra engine but they don't.

Here are the Drengins different generations of frigates that I could see in my current game (he has lots of old ships left as you can see):
gen. weapons. defense. speed
M2-2. missile+2.
M2-11. mass+2. 1*warp=+3
M3-4. mass+3
M4-1. beam+6. armor+1. 1*warp=+3
M4-10. mass+4. armor+1,shields+1. 1*warp=+3
M5-3. mass+5,beam+2. shields+2
M6-2. missile+8,beam+4. shields+2
M7-1. missile+12,mass+1. armor+2. 1*warp=+3

Sometimes he skips the extra engine in favour of more weapons/defense which is dumb if I'm correct about cruisers, because then it becomes identical to one.
I've noticed that the Terrans in the same game builds incredible many frigates, almost exclusive. This makes them IMO much more dangerous than the Drengin whom also builds lots of heavy fighters and cruisers. Even though the terrans military is much smaller.
And the terrans frigate M7-2 is so much fun
mass+24 (3 nanorippers) armor+2 speed+3
Almost as good as my best medium hull, the Death Dealer:
beam+24 (2 psyonic beam), armor+2, speed+6

I also noticed something odd with Drengins latest transport M5-3. It has 3 ion drives, 3 adv. troop mods and 1 extended support. It could have had 3 warp drives instead of the ion drives because they are both size 10 on a cargo hull which would have made his transports 6 parsecs faster per turn.

This is a good analysis overall of the AI's typical design desisions.  He also notes how different AIs have different strategies.  The Terran Alliance tends to go for larger, but fewer, ships.

The issue isn't so much the need for extra engines but better engine technology sot hat the engines aren't so big.  That's what I'm going to be testing.

3) Regarding planet use: Brillig writes:

Planet utilization:

The AI should place much higher priority on putting the appropriate building on special tiles. I would argue that nothing, no Galactic Wonder/Trade Good/Super Project is better than having a factory on a 700% bonus production tile, for example. The same for a 700% research tile (although I've never seen one). With regard to 300% tiles, the difference is a little softer. Personally, I would never put anything but the appropriate building on one of these tiles either (except for the food bonus tile).

I think the AI should begin to keep track of a parameter which I call the "state of colonization". This refers to how much of the galaxy has been claimed - it should be possible to come up with an AI estimate for this even without cheating based on using the galaxy map to look at influence.


No manufacturing/economic/research capital should ever be built on a poor (low PQ) world. As Brad said the AI isn't scripted, I believe it should be able to project, based on it's current situation, how the worlds under it's control will look like when fully developed. It should place the capitals based on that projection, with the likelyhood of actually doing the construction based on how close the "state of colonization" is to complete. Once a capital is built, the AI should have a bias toward building the appropriate structures (e.g. factories for a manufacturing capital) on that world. A small bias is probably fine, I don't think we need to see a fourteen factory+manufacturing capital world.

I agree with this.  However, I'm constrained by the APIs I have.  For instance, if the AI is putting super projects on 700% production tiles, then that's a bug. That should never happen.  The only time a super project or whatever might go on a special tile might be on a food tile.

But since people are seeing this, I'm putting in checks to try to understand why that would happen.

4) Regarding starbase placement.

Different AIs have very very different ways of handling their starbases.  Some of them are not nearly as good as others.  The Terran Alliance probably has the most sophisticated AI for handling this at this time.  I'm going to be improving all this  and trying to upgrade the other AI players as well.

Hopefully we'll see a much more effective use of starbases.

 

5) Tech Researching.

Each AI has its own values on what should be researched.  Based on feedback, I'm going to be adjusting these and seeing how much things improve in AI vs. AI games. This is going to be time consuming though to since what is the best techs and what order is tough. Moreover since the AI isn't scripted, there is no "Research this, then this, then this." Ironically, sentient human players are more likely to have scripted "research build orders" than the computer players.  Hopefully, human players will start putting their brain SDKs available for download.

6) AI fleet organization and concentration

I'm going to upgrade a couple of the AIs to send their fleets on patrol of their territory.  This should spread our their forces a bit and make them less vulnerable to human player tactics.

7) Working on AI to be better at dealing with enemy starbases.  One of the things that some people need to recognize about AI development is that it's easy to sit there and say "They AI should take out those military starbases." Well Duh.   But in the AI code, I'm dealing with weightings, numbers, priorities, and APIs that have to interpret my preferences.  For instance, as the AI designer, I want the AI to go after those starbases.  And I want the AI to recognize that it may have to sacrifice ships to wear it down. But at the same time, I don't want a death train of ships uselessly hitting a starbase either.  So much of what's been mentioned are things I agree with, it's just a matter of tweaking it so that it does it more.

So if I say if(pShip->IsStarBase) ulAttackPriority*=1.25 and that's not enough to get it to go after starbases effectively then it's a matter of chyanging it to say 1.50 or 2.0. 

Now before someone asks, no, we can't just have a file of weightings that people coudl tweak themselves.  I mean, yes, we could, but it would take a lot of time and different AI personalities have different methods. You'd end up with a situation where you'd be choosing between getting aI updates from us or relying on modders and my not so humble opinion is that you're probably better off with me doing the updates than relying on modders teaking values on a static AI.  After all, if I realize something's amiss, I can create new code to deal with it.

 

WindowFX 3 preview!

Published on Saturday, March 18, 2006 By Brad Wardell In WinCustomize News

If you have Object Desktop make sure you try out the WindowFX 3 (2.89 is the current one).  We're gearing up for WindowFX 3 and it has some pretty cool stuff.  It will require a good video card in order to make the most use of and right now it works a bit better on ATI cards than nVidia cards.

First thing is that it has a much cleaner interface including a wizard to guide new users through the process so that they know what it can and can't do and recognize what might be overdoing it (i.e. turning on every effect at once may not be a good idea)

 

We had this feature in before Windows Vista added it. Mouse over previews of what's in the taskbar.

 

   

Similarly, new alt-tab options for displaying currently running windows live.

 

This is probably one of my favorites - a bunch of new, subtle open and close animations that work very nicely.

We're still putting the final touches on WindowFX 3.  It's very cool but it isn't for everyone as you need a decent hardware set up to make the most out of it and you need to be savvy enough to know what features you'll want to use and which ones you don't (i.e. different people will want different effects -- some people might want shadows under their windows, others might want swaying windows, others may want to mix and match).

If you don't have Object Desktop, you can get it at www.objectdesktop.com

WindowBlinds 5.01 Preview...

Published on Saturday, March 18, 2006 By Brad Wardell In WinCustomize News

Lots of little tweaks coming up in WindowBlinds 5.01.  One little change is wallpaper handling in which users can easily access wallpapers from anywhere on their computer and display them in a single UI.

We expect to have 5.01 out in the next week or two.

First 1.1 Screenshots out

Published on Saturday, March 18, 2006 By Brad Wardell In GalCiv II News

Click on the link below to see some screenshots of what we've got going. The first beta of 1.1 should show up late next week with any luck.

1.1 will be a free update for all registered Galactic Civilizations II owners.

GalCiv II v1.1 Dev log

Published on Saturday, March 18, 2006 By Brad Wardell In GalCiv Journals

The team is busily working on v1.1.  I thought I'd show you some screenshots of what we've got done so far.  Probably a beta of this will be made public next week.

March 18, 2006:

The 3 features here we think will make people happy. Still tweaking the wording.

But basically you'll have control over whether tech trading is allowed. Blind exploration means you don't get to see the influence of a civilization until you've explored sectors that they're in. And minor races control whether they're in the game or not.

 

A couple things new on the ship design screen. First, you can now rotate components on the fly in the X, Y, and Z axis.  Pretty excited about that. You can even resize components after the fact once they're on. You can also rotate them after the fact.

What you can't see in the screenshot is that you can now pan with the left-click drag so managing much larger ships is much easier now. It should really free up how ships are made.

Sick of messing with what's in a given tile? The Fleet Manager is a whole new screen designed to let you organize what's in a particular tile. Still a work in progress.

1up.com review arrives

Published on Friday, March 17, 2006 By Brad Wardell In GalCiv II News

 Ultra reviewer Bruce Geryk has completed his review of Galactic Civilizations II for 1Up.com  Bruce spent nearly a month playing the game before putting together a review to make sure it was thorough.

The review covers the major points of the game and like others, focuses in on the ship design aspect. 

He also observes that the game puts a lot of effort into being an open ended, create your own epic type game but laments that the game does not include multiplayer (and we admit, not having a final shoot out between Bruce Geryk and Tom Chick for ultimate mastery of the galaxy would have been cool -- then again, last time we checked, Mr. Geryk was interned in one of Tom Chick's gulags after the The Political Machine). 

In the end, he concludes:

Thanks to the great A.I., there's no question of the game's longevity. Because the game doesn't have copy protection or perform a CD check, you can easily install it to your laptop and home computer without violating a license. That's just the physical component of the game's ease of use and accessibility. The gameplay component of those qualities makes this the best space strategy game in over a decade.

Visit 1up.com to read the whole thing.

Gaming Nexus Review

Published on Friday, March 17, 2006 By Brad Wardell In GalCiv II News

Tyler Sager over at Gaming Nexus has put up his Galactic Civilizations II review.   Tyler Sager has a long track record for strategy game reviews. I started reading his reviews back when he wrote for Gamepen.

In the review, Tyler takes aim at the ship designer and computer AI as his favorite parts of Galactic Civilizations II.  On a personal note, as I mentioned I've followed Tyler's reviews for some years now. 

While ratings are not terribly useful for other than providing a crude gauge of a game's quality (the infamous "7 to 9" scale that many lament), it is worth noting that the 95/100 rating he gave Galactic Civilizations II may be the highest rating he's ever given a game. It's certainly the highest I've ever seen him give a game in the 5 years I've followed his reviews. "W00t" as they say.

 

The new ad

Published on Friday, March 17, 2006 By Brad Wardell In GalCiv II News

Some people requested a high resolution version of the new advertisement for Galactic Civilizatiosn II that should start showing up in Computer Gaming World, PC Gamer, and Computer Games Magazine.  Click the thumbnail to get it. It should be high enough resolution that you can print it to a poster if you want.