Author Topic: [Released] Smart Gov v1.6 - 1.1.0.0, GA 1.8.1 and FRB 2.1.2 (Maybe 2.1.3b too)  (Read 24151 times)

Corellon

  • Sentient
  • **
  • Posts: 156
  • Karma: +13/-0
    • View Profile
Version 1.6 Released

Star ruler has some complex economic features such as production bonuses for mood and population, and the erudite AI knows how to manage them very well while the stock governors are apathetic following a never changing script.  This mod adds some intelligence to the governors letting them manage their planets to as close to optimum production possible.

What you get with stock is....

Underling: "What do we build next boss? A new city?"
Governor: "You have much to learn young one, we're going to build a mine there"
Underling: "But sir, we already have so many mines and so few people to work them they are running with minimum crews already"
Governor: "Are you questioning me?"
Underling: "No sir!, Just want to learn sir"
Governor: "All you need to know is in here" Holds up a book titled "Planetary governing for dummies"
Underling: (Mental facepalm)

Where with the mod, the governor will consider in multiple factors such as production, needs, export capability, population and decide on the best course of action and in the future when technology changes it will adjust accordingly.

If it's more effective to have a city for a production bonus then a resource producer then it builds the city, if the planet is full then it scraps the producer to build the city (it factors in the loss).
It will adjust production to optimize export so as much as possible is available to the galactic bank, if production is exceeding export capabilities then it will build more ports, if there is no room then it will scrap a city or a producer (whichever is least effective) and build a port.

Your economics level goes up? too much export capability? then it scraps the port to build a city or producer (whichever is better)

I hope I got all the kinks out and dealt with all scenarios, on balanced worlds it won't scrap a city though, I couldn't figure out how to do it without it looping.

Merged and improved on my Automated Defense mod so that planets will now build Military Platforms automatically and rebuild them if destroyed, no more finding worlds lost or undefended from whittling attacks while your occupied elsewhere, will automatically build Military Outposts every X minutes (Configurable and toggleable in the empire window)

Files:
 -Smart Gov.zip - 1.1.0.0 compatible version
 -BasicEffects.as - A modified version of the governor selection, not part of the mod but provided for those that want to try (unsupported though it works for me)

Attached to 2nd post , Untested, Unofficial rough-in's (Can anyone that plays GA tell me if the Smart Gov button in the empire window shows up properly?):

 - GA.Zip - Galactic Armory 1.8.1 version rough in(If anyone wants to test), for Orbitalshipyards should select the old shipyard planet governor still.
 - FRB.zip - FRB 2.1.2 version roughed in, highly untested and unofficial, looking for comments (Pretty sure it should work with 2.1.3b as well, can someone let me know?)
« Last Edit: September 25, 2011, 03:09:43 PM by Corellon »
My mod's/Scripts
Automated defense rebuilding: Here or Integrated into Smart Gov below
Smart Governor: Here
Build on all: Integrated into stock game

Corellon

  • Sentient
  • **
  • Posts: 156
  • Karma: +13/-0
    • View Profile
Release Log
« Reply #1 on: July 15, 2011, 05:17:00 PM »
Releases:
v1.6 - Released Sept 26
- Fixed a multiplayer only crash, in single player and on the host gametime starts at 1 where on the client it starts at 0
- Fixed a issue with non military outposts being retrofitted or scuttled and being rebuilt by the defense minister
- Fixed a issue where non military outposts were being counted towards the defense sat count

v1.5 - Released Sept 15 - GA Version Updated Sept 20 redownload if downloaded before then
- Incorporated hotfixes 1 and 2
- Fixed a issue with removing goods and lux on worlds, was checking for Euphoric instead of Eusocial (Sorry to those that play with Euphoric)
- Fixed a issue with cargo blocks and low food warning (In late game situations every planet would build nothing but farms at first because with 50M food storage would take a long time to get to the default 40% warning mark (changed to 10% (If you think should be higher let me know))
- Changed the GUI loadout displaying the number of Sats on a planet to only show on owned planets
- Changed the smart gov settings window to save on close (instead of on change, will prevent the issue were deleting the Stations per X would always set at 1 (Now if on close is empty or less then 1 will set back to the default of 30 (To prevent infinite building)))
- added a line in the window showing how many stations would be built with the entered Stations per X
- Fixed a issue with the GA version not counting defense stations that were built
- Updated FRB to 2.1.2 - Crude build, as always untested deep mining facilities are built and maintained for the long run game, not short term gain
- NEW GAME REQUIRED again since the build_queues.xml file is only read at the start of a new game and no other time.

v1.4 HOTFIX 2 - Released Aug 27
- Replaces the .xml file in the hotfix below
- Fixes a issue with building defense stations too early on governor's that aren't directly script controlled
- NEW GAME REQUIRED again since the build_queues.xml file is only read at the start of a new game and no other time.

v1.4 HOTFIX - Released Aug 26
-build_queues.xml file attached to the first post, fixes a issue with looping caused by low food situations on the planet, stock has some planets build ports instead of farms if food is low, but that doesn't do anything if the bank has no food in the first place.  Those planets will now build farms instead and will auto remove them when the situation is corrected. NEW GAME REQUIRED since the build_queues.xml file is only read at the start of a new game and no other time.

v1.4 - Released Aug 25
- Includes fix for null pointer warnings
- Fixed a shipyard loop for FRB and GA versions
- Added a check for emotionless trait and remove existing
- Fixed possible unwanted behavior when removing farms from worlds
- Will remove Planetary Capitals from the build queue when you take over a planet (since the colony ship builds one anyways)
- Added a option (Toggleable in the smart gov option window) to remove ships from the build queue when you take over a planet (Nothing I hate more then going over each planet I capture to clean the queue)

v1.3 HOTFIX - Released Aug 22 - updated ship.as attached to 1st post
- Fixed null pointer warnings that occurred but had no effect on gameplay (that I know of)
 
v1.3 - Released Aug 22
- Fixed a port balance issue on Metal, Elec and Adv part worlds (It was building 2x the number of ports needed for some reason)
- Added a GUI button to enable or disable the building of structures (New Button "Smart Gov" in the Empire window (Click the Empire Button))
- Fixed looping issues on Adv Part and Balanced worlds
- Fixed a City to Production balance issue which was the cause of the bug above but also caused more cities to be built then should have, bug from poor logic in a bug fix in 1.2.
- Added a Cargo block to each planet, for blockade storage and to speed build times
- Fixed a issue where planetary sat's didn't count properly
- Fixed a issue where research planets would build ports before a shipyard (slowing construction of ports)
- Fixed a GUI issue where it would display 0/1 sats when it should have been 0/0
- 1.0.9.0 support dropped due to new GUI modifications
-New Game Required (Due to changes in how defenses are tracked)

v1.2a - Released Aug 18 8pm
- Fixed looping issue in economic worlds
- Updated FRB version to 2.1.1
- Added support for Resource Base Factor setting (usually 0 but added support if someone changes (or a mod does))
- Updated script to (when using FRB) to use FRB's linear level gain not exponential that stock and GA use's

v1.2 - Released Aug 18 6am
- Fixed several issues in 1.1c, for some reason the FRB and Stock files combined when I saved
- All script errors in 1.9.0.0 version have been fixed, FRB version is still 2.1.0 don't want to tackle a update just yet sorry, but the scripts were fixed for that too.

v1.1c - Released Aug 15
- Fixed a potential city looping issue with shipyard worlds
- Fixed possible script error in GUI.as as it didn't have the right include references
- Game now adjusts to Level Curve factor instead of assuming 1.4
- updated GA version to 1.8.1
- Added FRB version 2.1

v1.1b - Released Aug 12
- 1.1.0.0 Support added
- 1.0.8.2 Support dropped
- 1.8 GA version coming up
- Basic effects.as updated to 1.1.0.0

v1.1a - Released Aug 11 - 11am
- Corrected Dead or rate from 10% to 20%

v1.1 - Released Aug 11 - 4am
- Optimized scripts and consolidated functions
- Fixed a bug with defense platforms not building as they should (Hopefully this time is final)
- Included a GUI display over each planet for the number of sats the would has and should have (debug feature but figured people may like, if not I can remove easy, or just delete the GUI folder)
- Fixed a issue with ships.as crashing
- Fixed a issue that caused the AI to use the smart gov.
- Fixed a issue with removing buildings to build a shield
- factor in weather ore remains or not for production
- if a gov type isn't explicitly handled by the script defenses will still be build and managed (as long as the required call exists in build_queues.xml)
- Ringworld bonuses integrated into all gov types, no need for separate ringworld govs
- Fixed imperial seat issue (Also caused by planets that already had large amounts of structures in existence when colonized)
- specialty planets(farms, sci) will build 3 extra ports to increase build speed and remove when full)
- added governor for shipyard worlds, used for planets with a dry dock orbiting it (Must manually design and build the drydock, but game will automatically rebuild if destroyed) float value called cargotoportratio that sets the cargo to port ratio, default is 1.5 cargo for each port (or 3 cargo for every 2 ports)
- Fixed a bug which causes excess farms to not be removed sometimes.
- Fixed a issue which caused stations to be built at 1 + every x minutes, instead of only on the x minute mark (no more stations being build at the start of the game)
- Added a tracking features so that stations build manually (Military outposts) count towards the min defense limit
- Fixed a issue where stations built with obsolete blueprints (or designs that later were superceded) failed to register as defense stations
- Fixed a issue where scrapping stations would cause the automated defense script to still count them as in existance
- Fixed a out of bounds error in ships.as

v1.0 - July 29
-Out of Beta
-Fixed Error with Military Outposts
-Optimized Script to reduce load
-Supports Stock Traits and Mood now
-Fixed shipyards going offline due to low population
-Will remove farms on non-farm worlds that are no longer needed (shortfall that caused the gov to build them has been corrected (Producing adequate surplus of food now))
-Farm worlds will build Military Outposts now too
-Fixed a population loop causing bug
-Implemented the ringworld governors again

v0.5 - July 27
-Smart Gov1900.zip is a 1.9.0.0 compatible version

v0.4 - July 23
-Looping fixes
-Port optimizations
-will automatically build Military Outposts every X minutes (Default is minperdef = 30, edit planet.as minperdef to change)
-merged auto defense rebuilding into mod to allow automatic building as well.

v0.3 - July 21
-Misc Optimizations
-Divide by Zero fix

v0.2 - July 18
-Increased tolerance between optimizing some buildings to avoid rapid or looping constructions
-Removed left over debug message about food
-Rough GA compatible version, should work but can't test myself.

v0.1 - July 15
- Original Release



Current FRB and GA versions attached below
« Last Edit: September 25, 2011, 03:10:38 PM by Corellon »
My mod's/Scripts
Automated defense rebuilding: Here or Integrated into Smart Gov below
Smart Governor: Here
Build on all: Integrated into stock game

Corellon

  • Sentient
  • **
  • Posts: 156
  • Karma: +13/-0
    • View Profile
Re: [WIP] Smart Gov
« Reply #2 on: July 15, 2011, 05:17:26 PM »
Code Obsolete, see the zip files for latest code.

-Reserved now for future use.
« Last Edit: July 21, 2011, 08:53:08 AM by Corellon »
My mod's/Scripts
Automated defense rebuilding: Here or Integrated into Smart Gov below
Smart Governor: Here
Build on all: Integrated into stock game

zoidburger

  • Newbie
  • *
  • Posts: 48
  • Karma: +1/-0
    • View Profile
Re: [WIP] Smart Gov
« Reply #3 on: July 17, 2011, 05:41:02 AM »
I tested this out, and it works like a charm! All my planets were churning out resources at maximum rate, and it let me put down the 'normal' erudite ai, hard. - not something I could do before. Performance seemed pretty impressive as well, I colonised every planet in the default 150 system galaxy (after flattening the ai ;D) and the game was still running fine, despite the impressive mound of code in use.

All I can say is, THANK YOU SO MUCH. This mod means I can mostly ignore frustrating, boring planet building and focus on the things in this game that are actually fun. Amazing work!

Corellon

  • Sentient
  • **
  • Posts: 156
  • Karma: +13/-0
    • View Profile
Re: [WIP] Smart Gov
« Reply #4 on: July 17, 2011, 07:49:45 AM »
Thanks, Glad it worked great for you, didn't run into any planet building and scrapping anything in a cycle? I couldn't test all combinations of planet size, tech levels and governors so even though I think I got it all I'd love to know if I missed something.

The code is a glob but tried to optimize it so as little of it is needed, most of the code isn't used in each pass and when there is nothing to do there are only 2 or 3 instructions run.
My mod's/Scripts
Automated defense rebuilding: Here or Integrated into Smart Gov below
Smart Governor: Here
Build on all: Integrated into stock game

Ragnarok

  • Distracted
  • ***
  • Posts: 281
  • Karma: +13/-15
    • View Profile
Re: [WIP] Smart Gov
« Reply #5 on: July 17, 2011, 09:21:06 AM »
Cant you just attach your ship.as file ? I cant get nether this nor your other one to work.

Corellon

  • Sentient
  • **
  • Posts: 156
  • Karma: +13/-0
    • View Profile
Re: [WIP] Smart Gov
« Reply #6 on: July 17, 2011, 11:11:24 AM »
Attached is the 2nd file now which is this mod with the automated defense rebuilding as well
My mod's/Scripts
Automated defense rebuilding: Here or Integrated into Smart Gov below
Smart Governor: Here
Build on all: Integrated into stock game

zoidburger

  • Newbie
  • *
  • Posts: 48
  • Karma: +1/-0
    • View Profile
Re: [WIP] Smart Gov
« Reply #7 on: July 17, 2011, 11:28:17 AM »
Thanks, Glad it worked great for you, didn't run into any planet building and scrapping anything in a cycle? I couldn't test all combinations of planet size, tech levels and governors so even though I think I got it all I'd love to know if I missed something.

Not that I noticed, but then I wasn't paying a lot of attention to build queues. When I have a bit of time, I'll go back and have another look. What I did notice is it looked like your 'ai' was using build_queues.xml for reference, seeing as it was still building a shipyard first on every balanced world *sigh*. But using that file's a damn good idea, it'll make things a lot easier to tweak. And it meant I could set a couple of planets to 'luxuries and goods planet' and ignore happiness for the rest of the game. I'm not sure tweaking for happiness even needs to be included.

Ragnarok

  • Distracted
  • ***
  • Posts: 281
  • Karma: +13/-15
    • View Profile
Re: [WIP] Smart Gov
« Reply #8 on: July 17, 2011, 12:53:31 PM »
Now i see why i cant get these to work. They are independent mods and you can only run one. If i wanted these to work with GA i would have to manually enter the script parts and adjust the locale. Perhaps this will be incorporated into GA ?!

zoidburger

  • Newbie
  • *
  • Posts: 48
  • Karma: +1/-0
    • View Profile
Re: [WIP] Smart Gov
« Reply #9 on: July 17, 2011, 02:31:05 PM »
I had another look, and there were indeed looping planets. Looking through about 10-20 planets, I found a balanced planet continually removing mines only to replace them, and an adv. parts planet that was doing the same with cities. If you want any more info, I can upload the save.

There was one significant annoyance though: later in the game I was being spammed with the message "Food: 12041.313" or some other number. Is this a debug thing? I go rid of it by filtering out 'etc' from being displayed.

Corellon

  • Sentient
  • **
  • Posts: 156
  • Karma: +13/-0
    • View Profile
Re: [WIP] Smart Gov
« Reply #10 on: July 18, 2011, 06:43:53 AM »
If you could attach the save that would be great I could find the circumstance that is causing it.

Sorry about the food spam, thought I removed all my debug messages, I used those to check for loops, sometimes the compiler did funky things and turned out to be a quirk on how it was done.

Shipyards: Yeah I have most planets build one otherwise the game wouldn't retrofit defenses properly, you could edit the script to remove it (have to edit the planet.as file, just change the check from < 1 to < 0).  The XML file is mostly used for compatibility with the AI, otherwise the AI would be affected by all these changes (if you want the AI to use this code too just remove the If emp.isAI() check)

It is for stock but don't think it should be hard to merge with GA, if I have the time over the week (I have to be out the next couple days) I'll try to do a quick merge myself for people.
My mod's/Scripts
Automated defense rebuilding: Here or Integrated into Smart Gov below
Smart Governor: Here
Build on all: Integrated into stock game

Corellon

  • Sentient
  • **
  • Posts: 156
  • Karma: +13/-0
    • View Profile
Re: [WIP] Smart Gov
« Reply #11 on: July 18, 2011, 07:13:21 AM »
Ok so I went and did a VERY rough merge with GA, 1.0.8.0 version, I don't play it so couldn't test, in theory it should work thought since no code overlaps just needed to merge the files.

Also updated the original files to remove the food spam as well as maybe fix the metal loop issue (I hope, i could find out the exact cause with the save but think the tolerance might have been too tight, it should have built a city instead of a mine but then after the mine was removed decided a mine was better then a city (to bad you can't remove and build in the same logic, but by the time the game processes the structure removed it's too late to build (or rather when you try to build it sees the planet as fill still so has to wait a loop))
My mod's/Scripts
Automated defense rebuilding: Here or Integrated into Smart Gov below
Smart Governor: Here
Build on all: Integrated into stock game

zoidburger

  • Newbie
  • *
  • Posts: 48
  • Karma: +1/-0
    • View Profile
Re: [WIP] Smart Gov
« Reply #12 on: July 18, 2011, 07:54:44 AM »
Ok, I've attached the save. I've pinned the two planets that were looping. There should be a good few others too, I had an enormous empire in that save :) Hope this helps!

Corellon

  • Sentient
  • **
  • Posts: 156
  • Karma: +13/-0
    • View Profile
Re: [WIP] Smart Gov
« Reply #13 on: July 21, 2011, 08:33:38 AM »
ZoidBurger:

A question for you since the building is going way beyond spec, did you start a new game or attempt to merge this with stock? Did you copy the mod as is, or did you attempt to edit build_queues.xml?

Reason I ask is because the planets that are looping are building things they shouldn't be building at all, which points to build_queues.xml being the problem.

That file is only loaded at the start of the game so any changes after are not in effect till a new game (why I asked if you started a new game, but since the script is running it looks like you did)

If you edited the file yourself the location of the line "<script call="planet::Loadgov" />" is very important, if you edited that file and it's not where it was in my version (with nothing else above it) the XML file overrides my script causing the loop (XML file builds mine, script sees city would be better and scraps mine, XML file kicks in before script and sees it's missing a mine and builds a new one, and repeat...)

if you didn't edit the file I'm not sure what's going on since there should be no way it's building general goods and such in the script and no way for the script to pass control back to the XML file.

Everyone else:

Updated to v0.3 which fixed a slight science facility miscalculation and subsequent errors
« Last Edit: July 21, 2011, 08:49:44 AM by Corellon »
My mod's/Scripts
Automated defense rebuilding: Here or Integrated into Smart Gov below
Smart Governor: Here
Build on all: Integrated into stock game

zoidburger

  • Newbie
  • *
  • Posts: 48
  • Karma: +1/-0
    • View Profile
Re: [Beta] Smart Gov v.03 - GA Compatible version being tested
« Reply #14 on: July 21, 2011, 12:27:49 PM »
A question for you since the building is going way beyond spec, did you start a new game or attempt to merge this with stock? Did you copy the mod as is, or did you attempt to edit build_queues.xml?

I copied it directly, and started it normally as a mod. If I'd edited it in any way I wouldn't have complained if things were going awry, and I certainly wouldn't have offered my savegame for debugging. No idea what could be going wrong. :-\ I was using version 1.0, with SR 1.0.8.2, but I imagine that's what you expected. If it's working on your PC, then it's probably fine. Next time I play I'll use your latest version and see if that fares any better.

XTRMNTR2K

  • Modder Extraordinaire
  • Delusional
  • ****
  • Posts: 1564
  • Karma: +178/-2
  • I aim to misbehave.
    • View Profile
Re: [Beta] Smart Gov v.03 - GA Compatible version being tested
« Reply #15 on: July 21, 2011, 12:57:49 PM »
@Corellon:
I haven't had the chance to test this mod myself, but I may be interested in releasing it as part of Galactic Armory 1.8, as well as the automated rebuilding of defenses. Would that be alright?

Corellon

  • Sentient
  • **
  • Posts: 156
  • Karma: +13/-0
    • View Profile
Re: [Beta] Smart Gov v.03 - GA Compatible version being tested
« Reply #16 on: July 21, 2011, 04:05:37 PM »
Zoid:

I'm not sure I'll do more debugging at a lower level but there is no circumstance that the script can move to the next step unless it's a AI or the planet is full.  For some reason those 2 planets are using a mix of the script and the default XML that is why I asked, it's behaving exactly as if the planet is stock. I'll do some further tests then, I couldn't tell on mine if you did or not because as I said the XML is only used at start, and the save game would use your XML file settings.

XTR:
If you'd like to then that's fine, I have aims to improve both of them still but in whatever form you'd like to use is fine.
My mod's/Scripts
Automated defense rebuilding: Here or Integrated into Smart Gov below
Smart Governor: Here
Build on all: Integrated into stock game

Corellon

  • Sentient
  • **
  • Posts: 156
  • Karma: +13/-0
    • View Profile
V0.4 Added

Fixes all issues in zoid's save except for the planet dupont... I think it's a bug / glitch itself as it's the only planet ignoring the script, half the time it doesn't even run the script.  I suspect maybe the script looped or error'ed originally and the engine killed it for the planet or something, It's ignoring the script completely sometimes (not even entering the script) so it's either a glitch from the previous version or a game error either way I'll investigate if it happens again till then I'll consider it fixed/isolated.

In planets.as is there is a new line:

const float minperdef = 30;

that will build 1 military platform every 30 minutes, change that to build quicker or slower (ring worlds build 10x more due to their size I figured)

There was also a slight math error dealing with ports causing a looping incident.

Further tests and comments are welcome
My mod's/Scripts
Automated defense rebuilding: Here or Integrated into Smart Gov below
Smart Governor: Here
Build on all: Integrated into stock game

Ragnarok

  • Distracted
  • ***
  • Posts: 281
  • Karma: +13/-15
    • View Profile
wow, the automated queuering of a defense platform is really nice. How did you do that ?

Corellon

  • Sentient
  • **
  • Posts: 156
  • Karma: +13/-0
    • View Profile
Once I had control over the planet production it wasn't too hard, since my previous ship mod rebuilt already built defenses and tracked what was already built it was just a simple change to track how many were needed and build them on the planets using a state for each planet to track how many were already existing (since I could count on the script rebuilding what got destroyed).

There may be a few odd ball circumstances where a planet could be taken over and the counters get confused but if your taking it back you should be able to adjust those manually anyways. 

As a bonus stations that aren't military platforms will be rebuilt and not counted, for example dedicated ship carrier stations, dry docks or artillery will be rebuilt if destroyed but not counted towards the defense count.

I've wanted to do this for a while but couldn't figure out how to do it without taking up too much processing power sorting every system in the galaxy, then yesterday I woke up and just knew how it needed to be done and it was a quick 5 minute edit.
« Last Edit: July 24, 2011, 07:00:23 AM by Corellon »
My mod's/Scripts
Automated defense rebuilding: Here or Integrated into Smart Gov below
Smart Governor: Here
Build on all: Integrated into stock game

zoidburger

  • Newbie
  • *
  • Posts: 48
  • Karma: +1/-0
    • View Profile
Fixes all issues in zoid's save except for the planet dupont... I think it's a bug / glitch itself as it's the only planet ignoring the script, half the time it doesn't even run the script.  I suspect maybe the script looped or error'ed originally and the engine killed it for the planet or something, It's ignoring the script completely sometimes (not even entering the script) so it's either a glitch from the previous version or a game error either way I'll investigate if it happens again till then I'll consider it fixed/isolated.

Weird. Perhaps it's an issue with the engine... Thanks for having a go, I wasn't expecting you to try any more debugging, but it looks like you were largely successful, nicely done!

CXX

  • Newbie
  • *
  • Posts: 35
  • Karma: +5/-10
    • View Profile
Bug report!
« Reply #21 on: July 29, 2011, 02:20:34 AM »
Corellon, your planet script needs more parentheses when calculating when to build Military Outposts. The order of operations is buggy, and caused constant station production in my new game. Try this instead:
if( curval < getGameTime() / (minperdef * 60) )

I'm considering modifying this script next week. I might add shipyard stations to shipyard worlds, or export stations to economic worlds. The latter may be slightly challenging. It's mostly easy for farm and metal planets, so long as planet import is much stronger than station export. Electronic planets could have electronic only export stations, and similar for AP worlds. Economic worlds are the most important late game but also the toughest. I need to figure out how not to starve supply while exporting all three resources.

Do you have any ideas on how to handle retrofitting? I set my M.O.s to auto retrofit, and that's bad enough as all stations vanish at once across my empire. It's even worse when the economy relies on stations and they all vanish.

Thanks.
« Last Edit: July 29, 2011, 02:25:36 AM by CXX »

Corellon

  • Sentient
  • **
  • Posts: 156
  • Karma: +13/-0
    • View Profile
Re: [Released] Smart Gov v1
« Reply #22 on: July 29, 2011, 09:00:04 AM »
CCX:

Thanks, I Missed that when at the last minute I changed the production from 1 every 30 minutes to a configurable value, script ran but didn't run it long enough to see the math error, I've fixed it now.

Retrofit should't remove all the stations if your using the ingame auto retrofit, it's designed only to retrofit on planets with a shipyard (why mine has a shipyard on all planet types) and a empty queue.  If it's your own script you would have to check if the planet has a empty queue or not before issuing the retrofit order, HulledObj@ ship.inOrbitAround(); gives you what it's orbiting.

I don't see how shipyard and export stations any harder to do then Military Outposts, in ship.as just check to see if it's a design name you want such as "Shipyard Dock" or "AdvPart Export" and if it is increment a new state something like "specialtysat" and on the planet build (if specialtysat < desired value)

Included the fixes into the just released v1 version, the optimization should further reduce CPU load in late game large empire games and the other bugs I came across have been fixed too.  Anything else you or anyone else notices going wacky would be appretiated.
« Last Edit: July 29, 2011, 01:06:10 PM by Corellon »
My mod's/Scripts
Automated defense rebuilding: Here or Integrated into Smart Gov below
Smart Governor: Here
Build on all: Integrated into stock game

Foraven

  • Delusional
  • ****
  • Posts: 1591
  • Karma: +102/-6
  • Fear the gauss weapons!
    • View Profile
Re: [Released] Smart Gov v1
« Reply #23 on: July 30, 2011, 01:34:41 AM »
Nice work you have done here. I want to ask though; did you code something to deal with blocades? I mean, some planets are not self sufficient (ie they have no food or resources making) thus are crippled if blocaded. They should reconsider what structures they have or should get, also avoid expenditures if they can't afford it with stockpiled resources.

You don't mind if i include it in FRB? That would do nicely with the new AI i have in.
Maker of FRB mod.

Corellon

  • Sentient
  • **
  • Posts: 156
  • Karma: +13/-0
    • View Profile
Re: [Released] Smart Gov v1
« Reply #24 on: July 30, 2011, 02:15:39 AM »
No didn't code in anything about blockades because I haves had a chance to play with them yet bu also because as you said if its blockaded importing is stopped which would make building new things such as farms impossible, though I might add a linje to not demolish anything if blockaded though since you mentioned it.

If you want to include it in frb your welcome to do so, I still have some ideas to optoimize further for v2 but might just turn to a full mod since I have AI and subsystem ideas. I should also factor in for the dead ore rate on planets too.  I'll see how things go on my next actual playthough and what AI ideas I can pull off.
My mod's/Scripts
Automated defense rebuilding: Here or Integrated into Smart Gov below
Smart Governor: Here
Build on all: Integrated into stock game

TheEddevilish

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: [Released] Smart Gov v1
« Reply #25 on: July 30, 2011, 06:19:44 AM »
Your mod is really great, and reduces the hassle of planet management so well! But is there a way of removing the automatic building of military outposts? It's a real drag early in the game to keep pausing their construction so the resources can go towards expansion. The minperdef value doesn't help here, because it's the initial outposts being built that annoy me most. Thanks!

Foraven

  • Delusional
  • ****
  • Posts: 1591
  • Karma: +102/-6
  • Fear the gauss weapons!
    • View Profile
Re: [Released] Smart Gov v1
« Reply #26 on: July 30, 2011, 10:10:38 AM »
No didn't code in anything about blockades because I haves had a chance to play with them yet bu also because as you said if its blockaded importing is stopped which would make building new things such as farms impossible, though I might add a linje to not demolish anything if blockaded though since you mentioned it.

Seem it now become more important to use cargo/storage space on planets now that they can be cut of from the galactic bank. Also, if they can afford to rebuild a farm or some metal mine, they should do so.

Quote
If you want to include it in frb your welcome to do so, I still have some ideas to optoimize further for v2 but might just turn to a full mod since I have AI and subsystem ideas. I should also factor in for the dead ore rate on planets too.  I'll see how things go on my next actual playthough and what AI ideas I can pull off.

Yeah, it's hard to stop once the ideas start flowing, the mod always blow out of it's box as we add new features :).
Maker of FRB mod.

Corellon

  • Sentient
  • **
  • Posts: 156
  • Karma: +13/-0
    • View Profile
Re: [Released] Smart Gov v1
« Reply #27 on: July 30, 2011, 02:28:52 PM »
Myself I'm not sure if I like the idea of the blockades, I like them in theory but the implementation relying on scale vs scale I don't like much. 

Realistically it's almost impossible to blockade a island and that's more or less a 2D space, space with the scale being much more vast and a 3D space where objects can approach from any vector means that something will always get through, maybe dwindle supply in ratio to the blockade strength but there is always going to be holes a smuggler or supply ship could get through.  The idea that you could build a empty large scale hull and cause a blockade is unrealistic to me, blockades rely on firepower and coverage to enforce.  I would rather see individual planets get blockaded when X ships have their orbit within range, to me that is more realistic to stopping import and export and also balances the blockade with stationary defenses rather then a single empty hull sitting at the edge of a system can blockade it.

At least some of my other Idea's seem possible, I have one more that I'm trying to figure out how to implement before I start putting something together but the plans so far seem entirely possible even if it might drastically change the game mechanics
« Last Edit: July 30, 2011, 02:30:31 PM by Corellon »
My mod's/Scripts
Automated defense rebuilding: Here or Integrated into Smart Gov below
Smart Governor: Here
Build on all: Integrated into stock game

Firgof

  • BMS Administrator
  • Delusional
  • *
  • Posts: 1531
  • Karma: +175/-4
    • View Profile
Re: [Released] Smart Gov v1
« Reply #28 on: July 30, 2011, 02:34:24 PM »
Blockades do rely on firepower.

Your empty hull will not be counted in the strength calculations; only ships with firepower do.
"Now it will punish you"

Corellon

  • Sentient
  • **
  • Posts: 156
  • Karma: +13/-0
    • View Profile
Re: [Released] Smart Gov v1
« Reply #29 on: July 30, 2011, 03:32:59 PM »
Ok then that's great to know, I was under the impression that it was scale from some other conversations, hadn't had the opportunity to look into it further, if that's the case then the automated defenses should balance the blockade ability unless they are out of range.

Still feel they should have to have the planet in weapons range for the blockade to take effect and perhaps a sliding scale based on the amount of coverage, maybe that's something I'll look at doing for another mod. I like the idea of blockade runners and laying siege if you can't outright destroy.
My mod's/Scripts
Automated defense rebuilding: Here or Integrated into Smart Gov below
Smart Governor: Here
Build on all: Integrated into stock game