Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Call To Power II > CtP2-Creation/AI/Mods/Scenarios > Looking for that perfect governor
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
Arkay is offline Arkay
Settler

May 2005
time: 05:33
  Old Post 08-06-2005 21:49
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Looking for that perfect governor Help yourself to an AD-FREE life

Hi, all! I'm new to the forums and I've recently reinstalled ctp2. (because I love stacked combat and public works) I like the game, but after a while it gets tedious to fill every queue with a newly discovered building since I run public works at 0% and just have idle cities produce infrastructure. I'd like to just turn that over to the governor, but it tends to produce units I dont like, buildings I dont want, and tile improvements all wrong.

I'm looking to mod the mayor (just for me not for ai's) to do the following:
-build only the buildings I want (no units)
-build infrastructure when it's done and check every 5 turns or so if a new building is ready
-not change any orders I've manually put in (I think it already does this)
-build tile improvements/terraform like I want (or if it's too hard, just not change any tiles)

Also less critically but conveniently:
-have a setting to produce capitalization instead of pw when idle
-have a setting to produce attack units instead of pw when idle
-Sell buildings I dont want (for captured cities or when all tech is researched)
-Manage happiness and possibly other specialists
-rush buy stuff if I have enough gold sitting around
-Maaaaaaybe trust it to build exactly the right garrison

Thats my dream, but right now I'm just starting and I'm having trouble wading through the text files and slc files to find out where to even start.

Could someone direct me to where the guv' decides what to produce and what tiles to improve?

Oops, edit: Right now I mostly play regular patched ctp, but I think I may start playing with the apolyton mod soon

Last edited by Arkay on 08-06-2005 at 21:56

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:33
  Old Post 10-06-2005 20:29 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Get a bigger avatar today!

I think changes such as these would need more than simply text file alterations - this would need to be done by altering the source code. Getting a better governer is something I've had at the back of my mind that I'd like to try to implement, but I doubt I'll be doing so at any time soon. It might be a substantial task, or it might turn out to be surprisingly simple - I suspect the UI side would be the biggest problem.

Nevertheless, some changes to the game data files might have an impact, for example the build lists, which are, IIRC, somewhere in gamedata\ai.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:33
Post  Old Post 10-06-2005 21:10 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Support Apolyton, buy Call to Power 2

quote:
Originally posted by J Bytheway
Getting a better governer is something I've had at the back of my mind that I'd like to try to implement, but I doubt I'll be doing so at any time soon. It might be a substantial task, or it might turn out to be surprisingly simple - I suspect the UI side would be the biggest problem.


Actual the user interface is the easiest part, the big problem is the part inside the game. Modified governor code is already inside the playtest version. You can use the the optimize speacalist button to check how well the AI does on assigning specealists. However the behaviour is far from optimal and has some inconsitencies. I am already happy that the AI can now grow its not growing cities with the help of specialists.

But to get the AI really doing what it should do is a huge task, one problem is that they weree no means to estimate all the falues if you do this and that for instance adding one farmer.

quote:
Originally posted by J Bytheway
Nevertheless, some changes to the game data files might have an impact, for example the build lists, which are, IIRC, somewhere in gamedata\ai.


The only thing you can change about the governor behaviour via the text files are the build queues nothing else. In fact the different governors are just the build queues.

-Martin

Arkay is offline Arkay
Settler

May 2005
time: 05:33
  Old Post 11-06-2005 03:28
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Support Apolyton buy from Amazon

My progress so far:
Based on a tutorial I put this code in scenario.txt
//part of the governor project
//Files modded: scenario, APOL_strategies, APOL_Improvement_lists
//buildlistsequences, buildingbuildlists
HandleEvent(NextStrategicState) 'ChangeHumanMayorStrategy' pre {

int_t db_index;

int_t ss_priority;

db_index = StrategyDB(STRATEGY_GOOD_GOVERNOR);

ss_priority = 500;



if (db_index >= 0 && IsHumanPlayer(player[0])) {

ConsiderStrategicState(player[0], ss_priority, db_index);

}

}

Followed by this code in APOL_strategies.txt at the end which I modified from the default strat

//part of the governor project
STRATEGY_GOOD_GOVERNOR {

// amount of public works (materials) to keep in reserve
PublicWorksReserve 9000000

// only consider building best n tile improvements
MaxEvalTileImprovements 50

// rounds to wait before fixing roads
TimeToFixRoads 2

// rounds to wait before fixing polluted tiles
TimeToFixPollution 2

// stored PW must exceed cost to fix + threshold
FixPollutionThreshold 1000

// bonus for building road tile improvements
RoadUtilityBonus 300

// bonus for building production tile improvements
ImproveProductionBonus 1

// bonus for building growth tile improvements
ImproveGrowthBonus 300

// bonus to apply to cells with goods
ImproveGoodBonus 75

// bonus for growth improvements in smallest 20% of our cities
ImproveSmallCityGrowthBonus 100

// bonus for production improvements in most productive 20% of our cities
ImproveLargeCityProductionBonus 1

// ordered list of terrain improvements that increase growth
ImproveGrowthList IMPROVEMENT_LIST_GROWTH2

// ordered list of terrain improvements that increase production
ImproveProductionList IMPROVEMENT_LIST_PRODUCTION
}

The high public works keeps the guv from messing around with tile improvements, but in games where I've put the reserve low, it doesn't seem to use the growth2 list to pick improvements. (As a test I set it to just mega mines and it builds other things) I'm also not sure if any of the other parameters I changed have any effect?

I was able to change what the guv builds by hijacking the science building build list (I wanted to nab the wonder list but it kicked up a fuss when I put buildings in the wonders txt) I think it also accepted mods to the building build sequence, but I got an error when I tried to make an entirely new build list (not even a sequence, just a list)

In effect this satisfies my desire for what buildings the governor builds (minus needing to replace a list to do it) with one important exception:

I cant get a guv to build infrastructure from a build list or a list I've manually created and loaded. (I think this is a widely known problem) and even if I could I wouldnt know how to have it stop every once in a while to look for new buildings.

I'm sad to hear we may never get a guv to manage citizens, but I will be trying to set the %citizens to 0 (or 1 if it doesnt like that) I'm going to poke around the slic code in apol pack they used to get the ai to build economic things and see if I can teach it to terroform/improve. If anyone has ideas for getting governors to start/stop infrastructure I'd love to hear about it.

Now a couple questions about apol pack: What is that deal at the start when the second settler goes crazy? it's hard to move him away from the first city. Also I lost the ability to terraform desert. Whats up with that? And where does the ai get all those huge stacks of units in your territory so early in the game? Yeesh!

edit: oh and one more thing.. any idea how I could get the governor code to load mid-game? Based on how I have it now it seems to only change when I start a new game.

Last edited by Arkay on 11-06-2005 at 04:11

Arkay is offline Arkay
Settler

May 2005
time: 05:33
  Old Post 15-06-2005 05:27
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Hope for progress! Support Apolyton, buy Alpha Centauri

Oo! Oo! I was just toying around with the compimpsforAI slic code and I'm confident I can write a seperate routine to place tile improvements for the player. (Thanks goes to the original coder for this routine, Martin Gühmann) I was thinking of using a threshold system, where more lavish improvement projects could be undertaken as the player's stockpile of PW increases. At low thresholds, imps could put put on deserving spots right next to city borders. After a bit more stockpiling, improvements could be put on tiles anywhere in city limits. Next, undesirable terrains could be replaced. Then old improvements could be replaced by the newest best ones. Finally, all terrain could be modified to the optimum type if you had a bunch of excess pw's. A short, easy-to-understand section of declarations at the start could allow players to customize their favorite terains and desired thresholds.

But for now, I'm curious: if you could have an automated terrain placing system, what would you want it to do for you? How do you normally handle your own tile improvements? As a side note, I dont think I could get it to place roads intelligently, but the rest could be helpful once a person's empire gets huge. Please send a couple ideas my way

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:33
  Old Post 15-06-2005 19:01 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Help yourself to an AD-FREE life

I generally place food improvements on the inner ring when the city has size at least 3, and then commerce improvements in all outer rings, when they are at full usage.

Maquiladora is offline Maquiladora
Emperor

Jun 2001
time: 05:33
  Old Post 15-06-2005 19:53 Visit Maquiladora's homepage!
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

An ideal mayor for me would place all food improvements, terraform everything to plains and use quite a few scientist specialists, until it becomes more profitable to use lots of Shopping Malls/Drilling Platforms on outer rings for science and no more specialists.

I doubt this is really very flexible though, applying the same rules to every city wouldnt work. Like in cities close to mountains it would require a whole different plan, such as mining, very quick growth, and not using scientists.

Arkay is offline Arkay
Settler

May 2005
time: 05:33
  Old Post 01-07-2005 07:43
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Some snags Support Apolyton, buy Alpha Centauri

Things are progressing well, overall (just a little slow) but I have hit a couple of snags. Does anyone know how to find out what a city's production is? Once someone has the proper techs a city will have an empty queue if someone puts capitalization or infrastructure in the queue and I'd like to have a slic routine to create pw or gold in an idle city depending on need. This will eliminate one of the key bits of busywork: switching cities between infrastructure and new buildings as they become available.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:33
Post  Old Post 01-07-2005 18:16 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Support Apolyton, buy Alpha Centauri

Well the easiest way is to remove capitilsation and infrastructure from the build lists sequences. That way the builds units to strengthen its millitary.

-Martin

Arkay is offline Arkay
Settler

May 2005
time: 05:33
  Old Post 21-07-2005 06:37
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

Just a little status update: right now CTP2 is out of style with me (SMAC, baby!) and I'm not working on it, but I may pick up again in the future. Also, sadly, I was playing a game with pollution and realized it was completely neccesary to manage your own specialists, as the governor does not do a good enough job. Since the specialists cant be managed by macro, this means that it is no longer feasible to make an automatic governor. Thus the scope of my project has changed from an auto-governor to an automatic tile improvement and terraforming system.

Happily, I have found a couple features that break up the monotony that I was concerned with. Under the F2 production menu, all cities can be sorted by a few properties: most importantly time to production completion and item being built. From this menu, multiple cities can be selected at once and production can be hurried (a grand total is available right on the screen) or the production queues can be changed. The production menu change is a little obtuse: you can only completely overwrite a queue by making a queue and pressing the overwrite button, or by loading a pre-made queue (which also overwrites everything in favor of the loaded queue)

Changing the queue of 10 or more cities can cause a stall of 1-60 seconds depending on number of cities and queue complexity, but it's still tons better then editing the queue of all cities one by one. For example: If it is later in the game and 47 of your 60 cities are producing an orbital science facility and you discover arcologies, you can select those 47 cities by sorting by the production item, then make a build queue that has the orbital station and then the arcologies in it and select overwrite. Wait while it chugs away for a bit and presto! The queues are modified without 10 minutes of micro, and you didnt lose any production to a switch.

You can try making a 'master list' that you just load up at all your peacetime cities once one of them goes empty, but the list has trouble with prerequisites. That is, it would queue an acadamy, but not a university (because it's not buildable without an acadamy) and then a mill or something like that, and you may lose some production if the mill is being built and you reload the list which would switch it to a universtiy.

I may still try to write a routine that gives empty cities the right amount of pw or gold if they are empty and you have the right tech, but this is slightly less important to me now that I have noticed infrastructure only gives half as much as 100% pw tax. These days I dont usually rely on finishing all projects in my top cities and then using infrastructure instead of a pw tax for that reason.

I do actually have a pretty-much working version of the auto tile-improver. It doesnt work exactly as I'd like but it's pretty good. Its for the apolyton pack, so if anyone has any interest I could upload the current version.

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:33.
Apolyton Time is 00:33.
    top of page
Rate This Thread:
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0424 seconds (90.78% PHP - 9.22% MySQL) with 30 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net