Author Topic: Civilian Industries  (Read 35790 times)

Offline Draco18s

  • Resident Velociraptor
  • Core Member Mark V
  • *****
  • Posts: 4,251
Re: Civilian Industries
« Reply #15 on: January 09, 2020, 10:16:29 am »
I renamed a lot of the hooks to be a lot more clear, and that causes this to not compile properly anymore.  Sorry about that!  I know you have a lot of other things going on.

Code: [Select]
[Deprecated]
public void OldHook(){
  DoNewHookBetterName();
}

 :P

Then you can clean them out at major version milestones, but minor versions maintain compatibility.

Offline BadgerBadger

  • Arcen Volunteer
  • Hero Member Mark III
  • *****
  • Posts: 1,229
  • BadgerBadgerBadgerBadger
Re: Civilian Industries
« Reply #16 on: January 09, 2020, 12:24:37 pm »
Probably a bit of overkill for a single mod.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Civilian Industries
« Reply #17 on: January 09, 2020, 03:49:19 pm »
Yep it would be a good idea in the future, but for now there's only a single mod that is affected, as noted.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Draco18s

  • Resident Velociraptor
  • Core Member Mark V
  • *****
  • Posts: 4,251
Re: Civilian Industries
« Reply #18 on: January 09, 2020, 04:26:13 pm »
Yep it would be a good idea in the future, but for now there's only a single mod that is affected, as noted.

Sure, sure. :)

Offline StarKeep

  • Jr. Member Mark II
  • **
  • Posts: 79
Re: Civilian Industries
« Reply #19 on: January 23, 2020, 01:03:35 am »
Performance and You
Main Post Updated, Download Link Updated

Save Compatibility is pretty much impossible due to the performance overhauls in this patch. Sorry. Eventually I'll get better at future-proofing, but there was a need for quite the overhaul for performance's sake. I'm slowly getting better at programming though, and the dream of a patch-safe update is still alive and strong.

Code Revamped for better late game performance.
Certain changes may potentially cause desync in multiplayer. They, for all intents and purposes, shouldn't, but noting this here for my future self to come back and laugh at if it happens.The performance gain is enough for this to be worth it for the time being.

Goods removed.

Grand Station no longer imports or exports cargo.
Militia Stations now only requests resources from their local Trade Station, OR adjacent planet trade stations if theirs is destroyed.
They will never search beyond that point.
Trade Stations have increased capacity and resource generation.
You now start with a Trade Station on your home planet.
-All these changes basically mean that your trade network can splinter, but survive. You still need to have a few cargo ships arrive on a planet in the first place, but afterwards, they'll be able to (somewhat) defend themselves with local shipments to their militia bases.
-They will attempt to ferry resources between stations (and, in fact, will do so much better than before), but won't attempt to do so across the entire galaxy anymore.


Every resource is now tied to a tech type.
Each Outpost and Patrol Post will roll one random ship (or turret, if outpost) type that uses the respective resource's tech.
Expect a much, much larger variety in units now. No more uniform ship style, your civies will simply use what they can find.

Current barracks renamed to Patrol Posts.
Patrol Posts can only be built around mines and are limited by the mine count on each planet.
Each planet will attempt to fully cover all wormholes and mines on its planet over time, but they will prioritize threatened planets first.

Ship counts have been notably lowered across the board as a result of all these new resources allowing some fairly hefty unit combinations by mid to late game.
Intensity and AIP have much larger effects on the end ship capacity values.
A new building has taken the name Barracks, and can be manually built by the player on any planet they control.
The Barracks increases ship/turret counts of all militia buildings by 33% or 1, whichever is higher, on its planet, and all adjacent planets.
The come with a whopping 5 million build cost, take ages to finish, and will be a constant drain of 100k energy, so these are some late-game metal sinks for people who always find themselves stocked,
a mid game choice for people who want better automated defenses, or an early game investment for people who want to dream big.
Due to its low metal flow, you'll find yourself capable of building this long term without feeling the burn too bad.

The AI will now launch periodic Exogalactic attacks meant to raid various trade stations. They will attempt to do so in time with waves sent by the ai for coordinated strikes.

Patrol Post mobile forces will no longer attempt to aid you in fights you have an overwhelming advantage in, unless they have nothing else they think they can currently be doing.
AI Ship targeting priority updated so they will no longer focus cargo ships over absolutely everything else.
Outpost/Patrol Posts have had increased defensive stats to make up for them no longer marking up.
Outposts will attempt to build themselves further away from the command station, and won't be requested for wormholes that are within (very) close proximity of a command station.
Cargo Ships are now smaller, to help with clutter when they arrive at stations in bulk.

Offline StarKeep

  • Jr. Member Mark II
  • **
  • Posts: 79
Re: Civilian Industries
« Reply #20 on: January 23, 2020, 10:51:17 am »
Hotfix
Updated in Main Post
Save Compatible

Lowered the Scatter Wave scaling by a notable margin.

Fixed a bug that involved the Grand Station going MIA.

Fixed a bug that made Trade Stations and Grand Stations unkillable that was left in from testing.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Civilian Industries
« Reply #21 on: January 23, 2020, 12:26:21 pm »
Love that this is evolving! :)
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline StarKeep

  • Jr. Member Mark II
  • **
  • Posts: 79
Re: Civilian Industries
« Reply #22 on: January 23, 2020, 11:26:15 pm »
Civilian Industries - V 0.2.5 - Download Link Updated in Main Post
We now have a version in game. This is good, because it means I can support prior saves better.
This is bad, because I have no way to check for prior game versions.

So this'll break saves. But it'll be the last time for the 0.2 series.
For the forseeable future, expect every 0.0.X change to be save safe, 0.X.0 to be conditionally save safe, and X.0.0 change to bluescreen your computer.

Fixed a bug where Cargo Ships were not being correctly forgotten by the mod on death.

Overhauled Scatter Waves into Wormhole Raids.
-Every 15-30 minutes, the AI will launch an attack on a section of your trade network.
-You will be given a warning 60-120 seconds before the attack begins.
-This warning comes in the form of a bunch of wormholes appearing on planets around their primary target.
-Upon launching the attack, a large quantity of raid ships will attempt to rush down and kill every cargo ship on these planets.


Offline StarKeep

  • Jr. Member Mark II
  • **
  • Posts: 79
Re: Civilian Industries
« Reply #23 on: January 24, 2020, 08:36:25 pm »
Civilian Industries - V 0.2.6
Civilian Militia Ships
Download Link updated in main post

All Civilian militia ships are now pulled from a list (based on technology) of slightly modified vanilla designs.
No more randomly pulling from the game's tech list, as that kept capturing variations and oddities, such as Dyson units.
Patrol Posts and Outposts from prior versions will retain their old unit choices, but any time they acquire a new resource for the first time, it'll start using the new ship lists.

Due to missing turrets for some technologies, the following resources will produce a random civilian turret of another type instead:
Tungsten (Melee)
Radium (Raid)
Techrackum (Technologist)

Grand Station now has a 10 minute timer before it can be rebuilt if destroyed.
Trade Stations now have a 5 minute timer before being rebuilt after being destroyed.

Militia Barracks Energy Cost lowered to 50k.

Offline StarKeep

  • Jr. Member Mark II
  • **
  • Posts: 79
Re: Civilian Industries
« Reply #24 on: January 26, 2020, 12:36:31 am »
Civilian Industries - V 0.3.0 - Battlestation Commander
Download updated in main post.
Laying out some framework for the rest of 0.3.X, so saves are broken.

Added: Militia Headquarters - 1 Million Metal - 100k Energy - Each Battlestation/Citadel you control can create one
All units built by this will treat the Battlestation/Citadel as their focal point, allowing you to maneuver them around as needed.
Built units will always be built from the Headquarters, however, so moving too far away will result in long travel times unless you fork out the money to rebuild the HQ elsewhere.
Is much beefier than the traditional Patrol Post on account of it being funded by the military.

Added: Trade Post - 500k Metal - 50k Energy - Each Battlestation/Citadel you control can create one
Acts like a Trade Station for the planet, except it only generates 66% of what a normal trade station would.
Can be built on any planet, even hostile. Does not send Protection Requests, as it is military owned.
Is much beefier than the traditional Trade Station on account of it being funded by the military.

Militia Capital Ships renamed to Militia Construction Ships. Weapons removed.
Changed how strength is calculated for Raids.
Lowered the cost to build civilian ships and turrets by 50%.
Cargo Ships will now be requested faster as your civilians expand, to help them fill out fringe worlds faster.
Other misc trading logic tweaks.

Offline StarKeep

  • Jr. Member Mark II
  • **
  • Posts: 79
Re: Civilian Industries
« Reply #25 on: January 26, 2020, 02:50:33 pm »
Civilian Industries - V 0.3.1 - Bugfixes, Balance, and Trade
Download Updated in Main Post

In order to fix a bug involving unit stacking (which I had believed fixed, but failed), all unit counts have been lowered to 25% of their original values.
Eventually plan to do-away with the fleet system so I can manually keep track of ships, but that will be later down the line.
Expect many explosions as your old units get cut down to size on old saves.
(Some units may still stick around stacked from old saves. This is harmless other than them getting the extra stats from being stacked.)

Increased the Shield Radius of Militia HQ by ~100%.
Increased the number of Trade Posts that each Battlestation can build to 5.

The endless quest for better trade logic continues.
Further increase to how quickly your civvies can build new cargo ships in response to needs.
Dialed back the amount of cargo ships that each station can request somewhat, as I had slightly overtuned it last patch.
There will be much more demand, and much less supply, so whenever a trade station finally puts out its request, expect to see it swarmed by cargo ships.
Grand Station now displays percentage until next ship built instead of a flat value.
If a Cargo Ship fails to acquire at least 50% of a resource while loading, it will return to the Idle pool instead of attempting to path to its destination with no cargo.

Offline ArnaudB

  • Jr. Member Mark II
  • **
  • Posts: 76
Re: Civilian Industries
« Reply #26 on: January 27, 2020, 11:15:19 am »
Quite a lot that sounds good there. I'll try it soon.

A question regarding trade raid. Are they like Wormholes in that they can appear anywhere regardless of neutering or are they more limited? It isn't clear whether the raid wormhole is there as a warning of where they attack, or if it's a gate through which they come from.

What probably would make the most sense is for trade raider to attacks on AI planets that aren't captured, rather than heavily defended human planets, but we'll see.

I do hope that backline planets within neuteured clusters can be kept peaceful (save Wormholes invasion) with the Civilian Patrols' help and outposts. It's one thing that drew me to the mod, as otherwise CPA can draw even from neuteured worm and throw forces in the backline.

Need some testing to work it out.

Offline StarKeep

  • Jr. Member Mark II
  • **
  • Posts: 79
Re: Civilian Industries
« Reply #27 on: January 27, 2020, 07:26:53 pm »
Currently, ANY planet with a Trade Station is a valid raid target. I may add restrictions if they end up too potent, but the idea is for them to attack the juiciest spot.

Raids work by giving you a 60-120 seconds notification before it begins (varies between these times) which names it primary target, and spawns wormholes around the edge of the primary planet, and all planets adjacent to said planet.

In its current somewhat neutered state ( on account of the stacking issue ), they may struggle with defending against raids solo.

When buffed back up to their intended values, they (should) be able to knock off most raids solo before they take a command station, but expect the raid to eat some cargo ships here and there before they're killed. (They're picked from fast and/or stealthed raiding ships, so they're designed to munch cargo ships for dinner.)
« Last Edit: January 27, 2020, 07:41:50 pm by StarKeep »

Offline StarKeep

  • Jr. Member Mark II
  • **
  • Posts: 79
Re: Civilian Industries
« Reply #28 on: January 28, 2020, 11:46:42 am »
Civilian Industries - V 0.4.0 - The New Trade Order
Saves Broken - Main Post Download Updated

Goodbye saves, hello trades.
This patch fixes a multitude of issues with using the npc fleets feature and stacking.
I built a simple method of keeping track of all units, and restructured my threat code to work around it.
Initial results shows full functionality, but do let me know if you see any oddities.

As payment for breaking saves (again), enjoy a vastly revamped trade system.
These changes may potentially slow the game down more by late game, but tests up to 10 planets still showed optimal performance.
They are especially good at no longer glomping every single station that has even a slight suction of resources, causing a vortex of new requests.

Alongside this, the UI for... pretty much everything has been updated to be more readable.
Resources are now color coded, percentages are displayed for everything, and militia will now specify if they're building or simply stockpiling resources.

Militia Buildings now use the same cargo system as the rest of the mod.
-They used to use a minimal system baked into their militia data. More than likely for performance in the past, but swapping them over now is a net positive.

Militia Buildings will no longer request resources that they're full on.
-Minimal logic for this was previously in place, but failed to account for... many circumstances.

Militia Building request urgency lowers the more ships that are already enroute.
-This means that cargo ships will prefer trades with militia stations that don't already have another ship enroute.

Trade Stations will now have an ACTUAL export request cap. It will be equal to around 200% their resource generation.
-My previous method for detecting incoming ships was flawwed, and failed to take account for ships already docked. Whoops.

Cargo Ships will no longer glomp trade stations the moment they have any resources, and will rather trickle in as they detect it has enough goods to share.
-Glomps are fun and all, but not that good for the economy.

Cargo Ships are now much more likely to take more than one resource from trade stations.
-Expect to never actually see many resources, besides the produced one, in trade stations however, on account of any resource being depositied by one cargo ship immediately being picked up by another.

Offline ArnaudB

  • Jr. Member Mark II
  • **
  • Posts: 76
Re: Civilian Industries
« Reply #29 on: January 28, 2020, 03:59:40 pm »
Hum, likely still performance issues with the last mod. Too many "MoveManyToOnePoint" apparently, that ends up causing massive slowdown. It throw errors in some cases. Oddly enough the simulation still show 500% and above but ships move much more slowly.