Starbases were a feature that was thought up by the beta team during the late GalCiv I beta.
As a result of the lateness, I never felt like the AI made very good use of starbases because ultimately, since I do the programming of the AI, I never felt like I did a very good job using starbases.
It was when we got saved games that I started to understand.
So here we are in late GalCiv II development and I'm trying to put in better starbase code. But it's still a challenge on what the "best" ways of using starbases.
In GalCiv, each computer players is its own C++ class. So the difference between the Drengin Empire and the Torians isn't just some stats. It's thousands of lines of C++ code difference. Part of that is to make the game more interesting. But part of it is to cover our butts. If one strategy doesn't work out so well, no problem, there's 9 others that should work. And at this stage, having written AI for this long, none of them are likely to have some major exploitation (certainly none that can't be easily remedied).
Coding effective AI for the starbases comes down to (I hope) 3 main things:
1) Having the AI make sure it gets all the galactic resources it can realistically get and defend.
2) Have the AI build star baes along its trade route lines.
3) Have starbaes build starbases around its planets that enhance military and production.
To effectively that's 3 very different paths for a starbase in terms of where it should go. Then it's just a matter of writing functions that aren't too CPU intensive to calculate where to go (since the AI doesn't have "eyes").
As a result of the lateness, I never felt like the AI made very good use of starbases because ultimately, since I do the programming of the AI, I never felt like I did a very good job using starbases.
It was when we got saved games that I started to understand.
So here we are in late GalCiv II development and I'm trying to put in better starbase code. But it's still a challenge on what the "best" ways of using starbases.
In GalCiv, each computer players is its own C++ class. So the difference between the Drengin Empire and the Torians isn't just some stats. It's thousands of lines of C++ code difference. Part of that is to make the game more interesting. But part of it is to cover our butts. If one strategy doesn't work out so well, no problem, there's 9 others that should work. And at this stage, having written AI for this long, none of them are likely to have some major exploitation (certainly none that can't be easily remedied).
Coding effective AI for the starbases comes down to (I hope) 3 main things:
1) Having the AI make sure it gets all the galactic resources it can realistically get and defend.
2) Have the AI build star baes along its trade route lines.
3) Have starbaes build starbases around its planets that enhance military and production.
To effectively that's 3 very different paths for a starbase in terms of where it should go. Then it's just a matter of writing functions that aren't too CPU intensive to calculate where to go (since the AI doesn't have "eyes").