Author Topic: [MOD] StarGov v0.6.1 for SR 1.2.1.2  (Read 4773 times)

seronis

  • Distracted
  • ***
  • Posts: 338
  • Karma: +25/-0
    • View Profile
    • Steam Profile Link
[MOD] StarGov v0.6.1 for SR 1.2.1.2
« on: July 31, 2012, 04:45:18 PM »
StarGov is meant to be a simple and efficient set of governors for vanilla Star Ruler, helping to offset some of the micromanagement and provide information to the player.

Quote from: ReadMe.txt
      All govs attempt to maintain 12mil population surplus so that building a new structure
      will not result in an offline building from lack of workers. If this threshold is not
      met then the next building constructed will be a city. If enough population has not yet
      been born to meet current worker demands the gov will wait to construct buildings so as
      not to use resources from the galactic bank when it wont have any benifit.
      
      Non-military govs will not build OR tear down planetary weapons, shields, engines or
      bunkers. The govs will take those buildings into account when determining population
      requirements and if the player has built so many that its impossible for the gov to
      meet worker requirements they will post a clickable message in the top status bar that
      will zoom in to the planet, giving the player a chance to make adjustments. Ship Yards
      are only built if there will be a half dozen slots remaining after construction so that
      the shipyard is useful. Once a planet has all its slots built up the shipyard will be
      torn back down to construct something else. Use Renovate gov if you wish to keep it.
      
      No governor will tear down farms unless 3 criteria are met. The empire has to control at
      least 12 planets. The galactic bank must be recieving more food than it's sending to other
      planets. The galactic bank must have enough food in storage to feed the empire for 1 to 2
      minutes if every single farming world is destroyed. Non-farming planets will also build 1
      to 2 farms if any of those criteria are not met. If you like math the threshold formula is:
         NumPlanets * squareRoot(CityLevel) * 500
      This means if your cities are tech 1 you will need 500 food per planet. If your cities are
      tech 16 you need 2000 food times your number of planets.
      
      All planets capable of exporting metal, electronics or advance parts will tear down extra
      space ports not required. Farming planets (only) also take into account food production.
      If a planet has an empty slot and does not have enough export capacity they will build a
      port. They will not tear down other buildings specifically to do this. Planets with 14 or
      more slots will avoid tearing down a single cargo bay in order to keep enough resources
      on hand to do renovations quickly if the player built one.
      
      The Metal Mining gov prioritizes a strip mining layout. Removes structures not related to
      this task. Will not build but will allow player built ammo depots to stay on world as long
      as their metal requirements are met with local production. Will attempt to keep enough
      cities to maximize the work rate bonus to make most efficient use of slots.
      
      The Research gov focuses on science labs and will tear down production buildings. If the
      planet has ore reserves it will also build mines to export the metal but always ensures it
      has twice as many science labs as mines ensuring its primary purpose is not neglected. It
      will not build bonus cities to improve work rate multiplier.
      
      The Farming gov builds farms and also removes production buildings. It has the exact same
      behavior as the Research gov in regards to building mines. It will not build fuel depots
      but will leave player built depots that have enough local grown food to meet demands.
      
      The Economic gov will build 2 science labs on the galactic capital but will remove them on
      any other planet. It attempts to build a number of Mines, Electronics Factories and AdvPart
      Factories to export those resources in a 6/3/2 ratio. As ore runs out on a planet it will
      continually tear down factories and rebuild mines as needed to maintain this production
      ratio. As long as at least 1 each of mines/elecfac/advpfacs are on planet it will build
      additional cities to take advantage of the work rate multiplier for effecient use of slots.
      
      The Renovation gov will never build or tear down structures. As with the vanilla version it
      will only renovate. This version just prioritizes which buildings get renovated first when
      multiple buildings need upgraded, and it does so in the following order: 
         Ports, Yards, City, SciFac, Farm, Metl, Elec, Advp, Cargo, all other.
      It will queue up to 1 of each of those buildings each time the gov runs, and if it doesnt
      have at least 3 buildings queued it will look at your logistical and military buildings to
      queue a few of them.
      
      The Electronics gov will focus on making electronics. It will maintain the fewest number of
      mines to accomplish this task and will remove advp factories and spare mines. It will build
      cities to take advantage of work rate multiplier.
      
      The Advanced Parts gov will focus on exporting advps. It will maintain the fewest number of
      mines and elec factories to avoid having to import. It will build cities to take advantage
      of work rate multiplier.
      
      The Luxuries gov is in charge of managing Goods and Luxuries factories on your planet. It
      is aware of ore reserves and will build mines but does not attempt to take advantage of
      the work rate multiplier with bonus cities. If your Goods and Luxuries needs are being met
      and there are spare slots, the gov will build science facilities instead. It will also periodically
      check your rates of production and consumption and tear down those sci facs when you are
      in need of more Goods/Luxuries factories. If no slots are available it will also convert your
      Luxury factories into Goods factories as a last resort.
      
      The Shipyard gov is designed to maximize resource import from the bank for on-planet
      construction. It will build 1 shipyard for every 8 slots the planet has available for buildings.
      It will take ore reserves into account to manage mines and bonus cities to maximize ore
      extraction and remove them as appropriate. It will maintain enough cargo bays so that the
      planets entire import rate from space ports can be taken advantage of each second. All of
      the planets spare slots will go to space ports to maximize that import rate.

github project
github downloads
« Last Edit: February 03, 2013, 07:54:40 PM by seronis »
Any code/mods I post on this site should be considered Public Domain. Borrow it, steal it, shred it into little pieces to your hearts content. I dont require credit but I appreciate bug fixes and suggestions.

seronis

  • Distracted
  • ***
  • Posts: 338
  • Karma: +25/-0
    • View Profile
    • Steam Profile Link
Re: [MOD] StarGov for SR 1.2.1
« Reply #1 on: August 01, 2012, 04:19:25 PM »
-merged with first post-
« Last Edit: January 29, 2013, 06:03:00 PM by seronis »
Any code/mods I post on this site should be considered Public Domain. Borrow it, steal it, shred it into little pieces to your hearts content. I dont require credit but I appreciate bug fixes and suggestions.

MyrddinE

  • Newbie
  • *
  • Posts: 4
  • Karma: +1/-0
    • View Profile
Re: [MOD] StarGov 1.0r2 for SR 1.2.1
« Reply #2 on: August 08, 2012, 09:21:34 PM »
You mention a couple times that you shoot for the optimum mix of cities to factories. Spyre2000 indicates that 'optimum' is 'equal amounts' (so for 16 empty slots, optimum is 8 cities, 8 factories), but the code I'm looking at doesn't seem to aim for that. What is optimum, as determined by your governers?

seronis

  • Distracted
  • ***
  • Posts: 338
  • Karma: +25/-0
    • View Profile
    • Steam Profile Link
Re: [MOD] StarGov 1.0r2 for SR 1.2.1
« Reply #3 on: August 08, 2012, 09:33:57 PM »
Optimum is equal amount with the largest number.  if you have  (totally random) 3/7/2 for mines/elec/advp  optimum production would be 7 cities.  There are a few instances where the ratio is better if you have 1 fewer city than you do the highest number of factories, the difference is very small.
Any code/mods I post on this site should be considered Public Domain. Borrow it, steal it, shred it into little pieces to your hearts content. I dont require credit but I appreciate bug fixes and suggestions.

Panpiper

  • Sentient
  • **
  • Posts: 172
  • Karma: +12/-0
    • View Profile
Re: [MOD] StarGov 1.0r2 for SR 1.2.1
« Reply #4 on: August 08, 2012, 11:48:24 PM »
Optimum is equal amount with the largest number.  if you have  (totally random) 3/7/2 for mines/elec/advp  optimum production would be 7 cities.  There are a few instances where the ratio is better if you have 1 fewer city than you do the highest number of factories, the difference is very small.

Seriously? So if I have 4 metal mines, 4 electronics and 3 advanced parts, my 'optimum' number of cities is only four?  That can't be right.

Edit: In fact I just tested this. I took a planet (geothermal) that had 9 cites along with 3 metal, 4 electronics and 2 advanced parts (for a total of 9 factories). That world was producing at a metallurgy tech of ~7-8 a gross total of; 859 advanced parts, 2.32K electronics and 6.51K metal. I then destroyed 4 cites leaving 5, and built 4 more factories, bringing the number to 5 metal, 5 electronics and 3 advanced parts. The world then produced a gross total of; 736 advanced parts, 1.66K electronics and 6.20K metal, decidedly less on all counts.
« Last Edit: August 09, 2012, 12:05:16 AM by Panpiper »

seronis

  • Distracted
  • ***
  • Posts: 338
  • Karma: +25/-0
    • View Profile
    • Steam Profile Link
Re: [MOD] StarGov 1.0r2 for SR 1.2.1
« Reply #5 on: August 09, 2012, 06:13:03 AM »
Never read that post. Just did some testing on my own using the formulas used in the code and a spreadsheet. And looking at my spreadsheet seems what I did is only effective when comparing cities against ONE production building type, not the combined total.  Ooops =-)

Thanks for the info.
Any code/mods I post on this site should be considered Public Domain. Borrow it, steal it, shred it into little pieces to your hearts content. I dont require credit but I appreciate bug fixes and suggestions.

MyrddinE

  • Newbie
  • *
  • Posts: 4
  • Karma: +1/-0
    • View Profile
Re: [MOD] StarGov 1.0r2 for SR 1.2.1
« Reply #6 on: August 09, 2012, 08:59:31 PM »
I would love to use your governer, once you update it to match the correct optimum. :-) Saves me from doing this myself (which was what I was trying to do when you helped me in the other thread).

seronis

  • Distracted
  • ***
  • Posts: 338
  • Karma: +25/-0
    • View Profile
    • Steam Profile Link
Re: [MOD] StarGov 1.0r2 for SR 1.2.1
« Reply #7 on: August 09, 2012, 11:50:03 PM »
Well to be honest I might still end up keeping this 'mostly optimum' selection.  Its still massively better than xml govs but doesnt remove all the need for the player to learn how the economy works.  To me it just seems that if a governor is TOO perfect you make the PLAYER obsolete and it becomes a battle of AIs. Not fun to me.

For right now id suggest you try out Jyins Ministry mod too.  Reading his code is what got me interested in making my own govs and he has gotten active again lately and been doing more updates faster than I can.  I have several nice plans on my grande 'todo' list but I also have a short attention span and am a slow coder.  I love my final results it just takes me forever to get there =-)

Also never miss an opportunity to 'do it yourself'. I have as much fun tweaking tiny things as I do playing.  And one of the reasons im so slow modding is i boot up SR to test out a tiny change (maybe even only some debugging output) and get caught up and finish playing the whole game. Then forget what i was testing and have to do it again.
Any code/mods I post on this site should be considered Public Domain. Borrow it, steal it, shred it into little pieces to your hearts content. I dont require credit but I appreciate bug fixes and suggestions.

MyrddinE

  • Newbie
  • *
  • Posts: 4
  • Karma: +1/-0
    • View Profile
Re: [MOD] StarGov 1.0r2 for SR 1.2.1
« Reply #8 on: August 12, 2012, 08:50:00 PM »
I'm sorry, but your reasoning doesn't make sense at all... either the ministers are doing what you want, or you can't use them... there is no real middle ground. If the ministers are not being efficient, then you can't use them... if you can't use them, then there's no point in having ministers. There are many other valuable and intelligent choices to make in the game that are not related to the mix of cities to factories... making the ministers choose efficient production over inefficient is a simple choice.

seronis

  • Distracted
  • ***
  • Posts: 338
  • Karma: +25/-0
    • View Profile
    • Steam Profile Link
Re: [MOD] StarGov 1.0r2 for SR 1.2.1
« Reply #9 on: August 12, 2012, 09:09:37 PM »
-snip: obsolete post-
« Last Edit: February 03, 2013, 05:40:52 PM by seronis »
Any code/mods I post on this site should be considered Public Domain. Borrow it, steal it, shred it into little pieces to your hearts content. I dont require credit but I appreciate bug fixes and suggestions.

seronis

  • Distracted
  • ***
  • Posts: 338
  • Karma: +25/-0
    • View Profile
    • Steam Profile Link
Re: [MOD] StarGov 0.2r1 for SR 1.2.1.2
« Reply #10 on: January 17, 2013, 11:11:54 PM »
-snip: obsolete post-
« Last Edit: February 03, 2013, 05:41:00 PM by seronis »
Any code/mods I post on this site should be considered Public Domain. Borrow it, steal it, shred it into little pieces to your hearts content. I dont require credit but I appreciate bug fixes and suggestions.

seronis

  • Distracted
  • ***
  • Posts: 338
  • Karma: +25/-0
    • View Profile
    • Steam Profile Link
Re: [MOD] StarGov v0.2.0 for SR 1.2.1.2
« Reply #11 on: January 22, 2013, 07:56:43 AM »
-snip: obsolete post-
« Last Edit: February 03, 2013, 05:41:07 PM by seronis »
Any code/mods I post on this site should be considered Public Domain. Borrow it, steal it, shred it into little pieces to your hearts content. I dont require credit but I appreciate bug fixes and suggestions.

seronis

  • Distracted
  • ***
  • Posts: 338
  • Karma: +25/-0
    • View Profile
    • Steam Profile Link
Re: [MOD] StarGov v0.3.0 for SR 1.2.1.2
« Reply #12 on: January 29, 2013, 06:17:23 PM »
-snip: obsolete post-
« Last Edit: February 03, 2013, 05:41:14 PM by seronis »
Any code/mods I post on this site should be considered Public Domain. Borrow it, steal it, shred it into little pieces to your hearts content. I dont require credit but I appreciate bug fixes and suggestions.

cause792

  • Sentient
  • **
  • Posts: 147
  • Karma: +21/-0
    • View Profile
    • Mirage Shipset
Re: [MOD] StarGov v0.3.0 for SR 1.2.1.2
« Reply #13 on: January 30, 2013, 06:09:05 AM »
Research governor got stuck into a rebuild loop. the planet had 25 slots, and he kept building 4 th  metal mine, than instantly tearing it down and starting a new one. After I stopped him and build a research lab instead of the mine, he was fine. This was in the 0.2xx version.

I really like these governors. They make the AI beat me to the ground, witch is very welcome.
Check out my Mirage shipset for Star ruler and Galactic Armory.
link under my name.

seronis

  • Distracted
  • ***
  • Posts: 338
  • Karma: +25/-0
    • View Profile
    • Steam Profile Link
Re: [MOD] StarGov v0.3.0 for SR 1.2.1.2
« Reply #14 on: January 30, 2013, 08:16:57 AM »
-snip: obsolete post-
« Last Edit: February 03, 2013, 05:41:43 PM by seronis »
Any code/mods I post on this site should be considered Public Domain. Borrow it, steal it, shred it into little pieces to your hearts content. I dont require credit but I appreciate bug fixes and suggestions.

seronis

  • Distracted
  • ***
  • Posts: 338
  • Karma: +25/-0
    • View Profile
    • Steam Profile Link
Re: [MOD] StarGov v0.4.0 for SR 1.2.1.2
« Reply #15 on: January 30, 2013, 10:32:28 AM »
Quote
v0.3.0
   metal mining gov rebalanced and tested
   - no longer allows fuel depots to remain
   - no longer builds ammo depots
   - will only tear down player built ammo depots when not enough metal produced locally
   - no longer builds cargo bays
   - only allow single player built cargo bay to remain on planets with 14+ slots
   ammo depot:
   - cost to produce ammo is now static
   - mass now directly tied to construction cost
   - storage capacity reduced slightly
   - labor cost no longer static
v0.4.0
   mine teardown loops fixed on Farming/Res gov
   farming gov rebalanced and tested
   - added to ai allowed list
   - only allow single player built cargo bay to remain on planets with 14+ slots
   - only tear down player built fuel depots when not enough food produced locally
   fuel depot:
   - cost to produce fuel is now static
   - mass now directly tied to construction cost
   - storage capacity reduced slightly
   - labor cost no longer static
« Last Edit: January 30, 2013, 03:56:47 PM by seronis »
Any code/mods I post on this site should be considered Public Domain. Borrow it, steal it, shred it into little pieces to your hearts content. I dont require credit but I appreciate bug fixes and suggestions.

seronis

  • Distracted
  • ***
  • Posts: 338
  • Karma: +25/-0
    • View Profile
    • Steam Profile Link
Re: [MOD] StarGov v0.5.0 for SR 1.2.1.2
« Reply #16 on: February 02, 2013, 04:07:16 PM »
Quote
v0.5.0
   luxuries gov updated
   - mine teardown loop fixed
   - efficiency determines :
   -   max mines allowed
   -   max sci facs allowed
   -   reaction time for swapping buildings
   - added to AI allow list
   - cargobay behavior matches other govs
Any code/mods I post on this site should be considered Public Domain. Borrow it, steal it, shred it into little pieces to your hearts content. I dont require credit but I appreciate bug fixes and suggestions.

seronis

  • Distracted
  • ***
  • Posts: 338
  • Karma: +25/-0
    • View Profile
    • Steam Profile Link
Re: [MOD] StarGov v0.5.0 for SR 1.2.1.2
« Reply #17 on: February 02, 2013, 04:11:23 PM »
In my personal opinion the 'balanced' gov is obsolete in favor of an economic gov.  Along with updating the Elec and AdvP govs, next update im considering having the balanced gov just use the economic.  Anyone have any suggestions of how it could possibly be differentiated and be useful?  Im open to suggestions if so.
Any code/mods I post on this site should be considered Public Domain. Borrow it, steal it, shred it into little pieces to your hearts content. I dont require credit but I appreciate bug fixes and suggestions.

seronis

  • Distracted
  • ***
  • Posts: 338
  • Karma: +25/-0
    • View Profile
    • Steam Profile Link
Re: [MOD] StarGov v0.6.1 for SR 1.2.1.2
« Reply #18 on: February 03, 2013, 07:46:40 PM »
Quote
v0.6.1
   Elec / Advp govs updated
   - added to AI allow list
   - cargobay behavior matches other govs
   - reprioritized port teardowns
   Surplus metal mine considerations tweaked on all govs
   New Shipyard gov:
   - added to AI allow list
   - Builds 1 fuel and ammo depot
   - Builds 1 shipyard per 8 planet slots
   - Builds mines based on efficiency rating
   - maintains minimal cargo bays needed to manage max spaceport import rate each second
   - uses all other slots for spaceports for maximum resource import from bank
   Default ('balanced') gov now redirects to Economic gov
« Last Edit: February 03, 2013, 07:54:16 PM by seronis »
Any code/mods I post on this site should be considered Public Domain. Borrow it, steal it, shred it into little pieces to your hearts content. I dont require credit but I appreciate bug fixes and suggestions.

cause792

  • Sentient
  • **
  • Posts: 147
  • Karma: +21/-0
    • View Profile
    • Mirage Shipset
Re: [MOD] StarGov v0.6.1 for SR 1.2.1.2
« Reply #19 on: February 04, 2013, 02:13:36 AM »
You are working too fast!  I didn't even have a chance to run the latest build ;D.

- Default ('balanced') gov now redirects to Economic gov

I thought that balanced was a planet that did and exported a bit of everything(including food and luxuries), and even had some research; where as economic was geared to maximise export of just metal/elec/advparts.
Check out my Mirage shipset for Star ruler and Galactic Armory.
link under my name.

seronis

  • Distracted
  • ***
  • Posts: 338
  • Karma: +25/-0
    • View Profile
    • Steam Profile Link
Re: [MOD] StarGov v0.6.1 for SR 1.2.1.2
« Reply #20 on: February 04, 2013, 04:05:36 AM »
True, but it spreads itself so thin in what its trying to do, that nothing it DOES do is efficient. Well the vanilla XML govs weren't efficient to begin with either. As it is ALL my scripted govs are more food aware than vanilla so they wont tear down spare farms until you have a substantial surplus so having 'balanced' factor in additional farms isnt a help. The luxury gov automates balancing between Goods and Luxuries to get just what you need and will even build sci facs if you have spare planet slots so having a few too many planets assigned to that gov doesnt cost you anything.

All in all, in my opinion just having more intelligent govs overall makes the original 'balanced' gov obsolete. I have a hard time considering something balanced that is inefficient by its nature. Also the economic gov will build 2 sci facs on the galactic capital, and maintain 2 farms instead of the 1 farm that all the govs do on regular planets. That pretty much does all the early game diversifying I've ever required in my own games.

Right now im wondering if i should bother making the Forge and Outpost govs. The forge gov in the XML settings is almost the same as the shipyard world, with a difference of it will try to produce some of its electronics and advance parts locally instead of importing from the bank.  With the slots split between the two tasks you dont have room for the extra cities to take advantage of the work rate bonus so you end up being significantly slower than just a shipyard world.  The outpost gov is also based on the shipyard except it also builds planetary cannons. ALL of my govs will leave player built military buildings  (shields, engines, cannons) alone and work around them so if all you want is a cannon just queue one. Dont need a whole gov for that.

So the vanilla versions of those two govs arent worth scripting. Now how I set those govs up on my own I might do. My Forge and Outpost style worlds are both based on orbital stations. I do a forge world that is similar to a metal mining world but has only 1 spaceport to handle Imports. All manufacturing and export is done with stations.  My outpost worlds are maxed out on spaceports for importing and use orbital ship construction.

Might think on this one a little. More feedback always welcome of course =-)
Any code/mods I post on this site should be considered Public Domain. Borrow it, steal it, shred it into little pieces to your hearts content. I dont require credit but I appreciate bug fixes and suggestions.

Azalrion

  • Delusional
  • ****
  • Posts: 1325
  • Karma: +147/-1
  • Memory Murderer
    • View Profile
Re: [MOD] StarGov v0.6.1 for SR 1.2.1.2
« Reply #21 on: February 04, 2013, 04:14:14 AM »
Don't forget that forge worlds will survive blockades much better than shipyard worlds and so do have a usage. Or at least that was their intended purpose and outpost the same thing except providing a constant set of planet based weapons which don't need to rely on having the resources available when they are blockaded.
GA - Mod Team
GA Forums

cause792

  • Sentient
  • **
  • Posts: 147
  • Karma: +21/-0
    • View Profile
    • Mirage Shipset
Re: [MOD] StarGov v0.6.1 for SR 1.2.1.2
« Reply #22 on: February 04, 2013, 10:10:09 AM »
Do your governors build the orbital manufacturing stations by themselves? That would blow my mind... and if that is the case you may want to include a few governors (or few scripts to existing governors)that would mid game shift most of the resource production off planet.
Check out my Mirage shipset for Star ruler and Galactic Armory.
link under my name.