Author Topic: Civilian Industries  (Read 43113 times)

Offline StarKeep

  • Jr. Member Mark II
  • **
  • Posts: 79
Re: Civilian Industries
« Reply #45 on: March 04, 2020, 11:18:09 am »
I'd need your save in order to figure out what went wrong; as theres nothing obviously sticking out.

Offline StarKeep

  • Jr. Member Mark II
  • **
  • Posts: 79
Re: Civilian Industries
« Reply #46 on: March 05, 2020, 09:44:34 am »
Updated the download link with a new version of the dll that should work on the latest update for people having issues.

Offline StarKeep

  • Jr. Member Mark II
  • **
  • Posts: 79
Re: Civilian Industries
« Reply #47 on: March 06, 2020, 12:27:06 pm »
Updated the fixed dll to remove a left over debug line that spammed your chat log. Whoops.

Thanks to Mike007 on Discord for reporting.

Offline WolfWhiteFire

  • Full Member Mark II
  • ***
  • Posts: 195
Re: Civilian Industries
« Reply #48 on: March 12, 2020, 03:45:26 pm »
How exactly do you download and enable this mod? I have it in C:\Program Files (x86)\Steam\steamapps\common\AI War 2\XMLMods\Civilian Industry unzipped, however when I actually try playing the game the faction does not appear in the lobby, so I am wondering if I stored it in the wrong location.

Offline ArnaudB

  • Jr. Member Mark II
  • **
  • Posts: 76
Re: Civilian Industries
« Reply #49 on: March 13, 2020, 08:20:25 am »
so I am wondering if I stored it in the wrong location.
Yes, you did.

Extract the file in : "C:\Program Files (x86)\Steam\steamapps\common\AI War 2" instead

The folder in XML mod must be "SKCivilianIndustry" and not "Civilian Industry". The "Gamedata" folder must merge with the game's Gamedata folder (which is what happens if you do "extract here" on the .rar in "C:\Program Files (x86)\Steam\steamapps\common\AI War 2"

Do that and check "add faction" in the lobby after booting the game, if Civilian Industry show up. Do tell if it worked.

Offline WolfWhiteFire

  • Full Member Mark II
  • ***
  • Posts: 195
Re: Civilian Industries
« Reply #50 on: March 14, 2020, 03:49:13 pm »
It worked, thanks for the help.

Offline ArnaudB

  • Jr. Member Mark II
  • **
  • Posts: 76
Re: Civilian Industries
« Reply #51 on: March 20, 2020, 05:33:03 am »
I am working on using the mod more, though it puzzles me a few times.

Part of it is the delay to see changes. From what I understand it civilian buildings takes priority over military station for cargo-ships, so Militia Heartquarters can take several minutes or more before a cargo ship arrives to start production. I think each heartquarter produces different ships for military like civilian, but it might be by planet for military.

I noticed pretty much all trade stations are maxed out at 24XX/2500 on their resources, even in a completely secure environnement. It might make the battlestations trade post sort of redundants. Though, there are less cargo ships everywhere which used to be a sort of problem. I do like the new mini-cargo ships, it's cute and make the planet less visually busy.

The ship caps on the heartquarter kind of confuses me. I think the cap increase when you have more of a resource available(ie, more trade post of that resources). Though with cargo ships having difficulties bringing the goods sometimes, it led to me building 4 trade posts on a planet 5 hops away from the homeworld, with the heartquarter on the homeworld at 0/324 sniper for over 30min so far (though it might have built a few at some point?). Anyway, I think the more trade post boosting ship cap is what is happening but I am unsure if there are others factors.

I am still experimenting so I haven't gone far with the military various boosters to boolster cap. As far as I can tell, I need to build wide initially to get more planets boosting more caps and allowing the civilian patrols of each planet to reinforce their neighbors at need. Then when I get enough energy, I should build tall in a cluster with 2-3 battlestation to get crazy-high cap everywhere and use that both for defense and overwhelming defense. We'll see.

Logistical Station on pretty much every planet seems to be a given with Civilian Industry. It allows the cargo ships to move faster as well as the patrols, gives me the best defensive options against raid, while pumping enough energy to get by. Also because science needs to go wide since the first two tech levels are a significant boost to all civilian forces, I need all kinds of tech, meaning investing in a single type of station is the superior option. A focus on light hull might be better too, since it upgrades cargo ships though I don't know if it just makes them tougher or also boost their cargo size.


In term of offensive use, I use the the battlestations forces as reinforcement, with my main fleets taking the brunt of the damage and initial attack when invading a planet. It's easier to refill the main fleets but the civilian battlestation-fleet can adds significant firepower when clearing a world. It certainly helps that in my last game I got a focus on long-range civilian with Steel giving me Concussion ships.

Performance wise, things seems a lot better than they use to be. I am playing a 200 hundred planets game to test it so we'll see how that evolves.

Edit: After focusing on a save where I slowly went from one to four planet I seem to get where the problem lies with Cargo being "slow" to get resources around. It looks like they spend a lot, like a lot, of time loading/unloading trade posts in order to get 100/100 of each resource loaded before going to a military post/base/Etc...

So, they "unload" at a trade post lacking a specific kind of good, then load up... except that in some case in the process of "loading up" they go to another trade post because "it's lacking in X and Y resources" among 3-5 different resources. But then the trade post where they loaded up is empty again... so they start taking out resources from the post they just refilled and go back to "solve" the shortage on the earlier one. A vicious cycle.

If you cheese RNG to have only a single type of resources (or use just the homeworld early on) the cargo ships perform incredibly well.
« Last Edit: March 20, 2020, 09:35:51 am by ArnaudB »

Offline StarKeep

  • Jr. Member Mark II
  • **
  • Posts: 79
Re: Civilian Industries
« Reply #52 on: March 29, 2020, 05:42:38 am »
@ ArnaudB Appreciate that, been doing a bit of work on trade logic based on that feedback, and some feedback from discord, and the results in testing have been promising.

Civilian Industries - V 0.5.5 - Trade Regulations
Save Compatible

Time for more of everyone's favorite: Trade logic improvements.
Improvements this time: Absolute priority for militia buildings, better resource spreading, and the removal of some hard caps.

Removed the global 3 hop limiter for the assignment of Cargo Ships to Routes.
-Plus, this will make them more willing to expand into new territory.
-Plus, stations that would previously fail to start a route that is entirely valid will now look further to find cargo ships to fulfill their request.
-Negative, this may result in some Cargo Ships becoming suicidal in their attempts to deliver their precious cargo.
--This was a previous limiter added to assist with late game lag. Due to the many improvements since its addition however, the positives for removing it outweigh the negatives.

(Potentially) fixed a bug that resulted in all of your planets gaining the ability to build buildings that only Battlestations should.
-This was an extremely odd bug, still not quite sure how it could happen.

Updated a bit of the pathfinding logic to have slightly less redundant orders given.

Civilians will now Tachyon Burst planets if 90% of the remaining ships have cloaking.
-This can only occur a maximum of once per 30 seconds.

You will now be granted vision of any planets that the Civilians are actively attacking.

Civilians will now consider all hostile planets hostile, not just those owned by the ai.

Offline StarKeep

  • Jr. Member Mark II
  • **
  • Posts: 79
Re: Civilian Industries
« Reply #53 on: March 29, 2020, 02:42:15 pm »
Civilian Industries - V 0.5.6 - Stop Being Lazy
Save Compatible

Militia Ships no longer have 24/7 union regulated breaks.

Due to an oversight, whenever the player was previously attacking an adjacent planet, they would nearly always wait until you're finished.
-This has been fixed and they are now always back on the clock.

They will now attempt to clear out Unarmed Guardposts before leaving planets.
-In some cases, they may leave them if a more powerful target appears elsewhere, but they should return back to finish the job later if this occurs.

Offline StarKeep

  • Jr. Member Mark II
  • **
  • Posts: 79
Re: Civilian Industries
« Reply #54 on: March 29, 2020, 05:29:34 pm »
Mini Update
Removed the planet vision portion of 0.5.5's update due to a bug.

Offline ArnaudB

  • Jr. Member Mark II
  • **
  • Posts: 76
Re: Civilian Industries
« Reply #55 on: March 31, 2020, 04:44:34 am »
I took the last update for a spin on a straightforward single diff7 AI.

First thing I noticed was that cargo ships do (in 5.6) work better. They supply local heartquarters a lot better, the civilian fleet defended... correctly. I  did notice a huge struggle for them to cap out either my stations ships or the civilian ones ships/turrets, which could be either because I kept expanding and a 4h game is very fast. I also built tall, meaning that many civilian ships were low-Marks and thus likely died easy. On the other hand this was a basic Ai7 that was wholly outmatch.

My heartquarters struggled to cap out though. It could be because I moved my fleets a LOT but at the same time I often had powerful positions and even on my planet with 4 trade posts and 1 military HQ, the (disruptive) ship never capped out at my HQ. I ultimately ended up using "distant scrapping" on my battlestation because the QoL of freeing turrets across multiple planets outweighted keeping the trade posts and HQs alive. They simply didn't refill fast enough to be helpful.

I made a bunch of trade posts like mentioned above on a single planet, 4 or so, since it seems having more trade posts increase the building speed of cargo ships (slightly). It still was never enough to drop any trade post below 2450-2500. I am leery of buffing too much supplying times balance-wise, but some way for the player to speed up supplying might be nice. As it's, even with complete domination of the galaxy (the AI only killed one of my station once) the transfer-supply rates are too low.
Maybe some way for the player to boost either cargo ships numbers or their loading/unloading speed? Maybe trade posts/stations could use their excess resources (when at 2500) to contribute to cargo building, or maybe for performance they could make a "Train" that would perform like a cargo ship but much better, something for the player to protect.

Defence-wise I found the civilians pretty helpful though raid means you need to build exclusively logistical over economic stations since raiders are hard to stop from killing stations. It also makes protecting capturables a much tougher task, so hacking is better on higher difficulties (not 7, but multiple 7 or 9, yes.)
Even with 4 trade posts contributing for disruptium I had numerous civilian stations low enough on resource to have 2/10 Pike turrets.

I added three saves of that game below, in case it's useful for data gathering.

*

On a useful note, I found how to prevent scrapping distant trade posts and others things by looking at the Major Data Center data.  You just need to add the following line to their entity data:

is_critical_infrastructure="true"

Like this:

Code: [Select]
<entity name="TradePost" display_name="Trade Post" copy_from="TradeStation" tags="CivilianIndustryEntity,TradePost"
                build_sidebar_categories_i_am_part_of="MilitiaBuildings"
                special_entity_type="NPCFactionCenterpiece"
                description="A military funded trade post. Upgraded by Economic and Logistic Command and Metal Generation Tech."
                hull_points="250000" shield_points="500000"
                metal_cost="500000" energy_consumption="100000"
                visuals_scale_multiplier="5" size_scale="5"
                tech_upgrades_that_benefit_me="CommandEconomic,CommandLogistical,MetalGeneration"
is_critical_infrastructure="true"
    >
        <metal_flow purpose="SelfConstruction" throughput="500"/>
    </entity>
[/s]
Further testing showed this didn't work again, though it weirdly worked once. Odd.

Good luck and thank you for your great work!
« Last Edit: March 31, 2020, 10:31:10 am by ArnaudB »

Offline shoter

  • Newbie
  • *
  • Posts: 1
Re: Civilian Industries
« Reply #56 on: March 31, 2020, 08:23:11 am »
Hello Starkeep,

You have very nice mod out there and I would like to help you out with this mod.
The problem is that your mod does not have any license on Github nor project structure known for C# and therefore it is hard to help you with that. I think ti would be better to upload whole project structure along with .sln and .csproj instead of just putting .cs files.

Thanks for great mod,
Shoter

« Last Edit: March 31, 2020, 08:30:02 am by shoter »

Offline StarKeep

  • Jr. Member Mark II
  • **
  • Posts: 79
Re: Civilian Industries
« Reply #57 on: March 31, 2020, 03:27:03 pm »
@ ArnaudB - I do think I've figured that out. The changing of trade logic from main thread to background thread means that they only increment the build counter whenever the background thread is finished. This essentially means that unlike before, when it would send requests for more ships when needed every second, it can take up to 2, at some points, to do so currently. Simple enough fix is to have the background thread update the request counter and the main thread spawn based on it.

@ Shoter - Yeah, the github was mostly created as a way to showcase how the mod does what it does to hopefully inspire others to make their own mods, and was started before I was really aware of how Github really worked. It has basically been something that I started out learning programming with nearly a year ago, and has been constantly modified as I've learnt more from either it or classes.
Between my inexperience in programming and how often I have to break down and rebuild sections of the mod as a result of this, I would recommend against helping me for your sanity's sake; but I'll look into updating the Git with a proper license and the full project regardless.
« Last Edit: March 31, 2020, 03:36:46 pm by StarKeep »

Offline StarKeep

  • Jr. Member Mark II
  • **
  • Posts: 79
Re: Civilian Industries
« Reply #58 on: March 31, 2020, 11:13:44 pm »
Civilian Industries - V 0.5.7 - Requests in Triplicate
Save Compatible

Cargo Ship requests are now completed in bulk.
-Whenever the Grand Station fires a spawning event, it will spawn a varying amount of cargo ships, based on the amount of demand for them.

Maximum exports for a resource production station increased from 2 per generated to 5 per generated.
-Aka, previously, something that generated 7 per second could export up to 14 routes. It would now export up to 35.
-This will make them more aggressively drain resources from stations, especially as they fill up.
-Note that this is the cap if they are at 2500/2500 resources. They will put out fewer requests the fewer resources they have.
-May result in some shortages here and there; but thats better than the alternative of having resources sitting around doing nothing.

Grand Station no longer displays build timers.
-This has lost its purpose due to it no longer being a passive over time occurence.

Fixed an Index was out of range Exception.
-Thanks to ussdefiant60 on Discord for the report.

Trade Post energy cost reduced to 50k.

Protector Balancing
-I apparently undershot pretty much everything, considering how long it takes these to come off the production line.

Crackerjack
-Fire rate 6 -> 3
-Shots per Salvo 1 -> 3

Thunderstrike
-Base knockback 3000 -> 5000
-Area of Effect 1500 -> 2000

Paladin
-Base shield radius 10x -> 6x

Brick Breaker
-Rate of fire 3 -> 1
-Base damage 700 -> 1000

Hurricane
-Base damage 300 -> 800

Excalibur
-Base damage 335 -> 1500
-Shots per salvo 30 -> 50

Grim Reaper
-Base damage 100 -> 500

Wildfire
-Size reduced by ~14%.
-Grenade base damage 60 -> 800
-Grenade shots per salveo 5 -> 8

Tangler
-Vine Piercer base damage 300 -> 800

Orchestrator
-Base planetary speed boost 200% -> 120%
-Planetary speed boost increase per mark 25% -> 5%

Offline StarKeep

  • Jr. Member Mark II
  • **
  • Posts: 79
Re: Civilian Industries
« Reply #59 on: April 03, 2020, 06:27:27 pm »
Civilian Industries - V 0.6.0 - Warring Companies
Saves Mostly Broken
-They will load, but some odd side effects may occur.

Civilian Industries can now be added to minor faction teams.
-They require a friendly stationary building and friendly strength superiority on a planet before they will spawn in.

Civilians will now expand to and protect Trade Posts you place on neutral or hostile planets.

Civilian ship capacity now scales with Trade Station count rather than AIP.

Fixed a bug where units were always spawning in at mark 1 instead of their intended mark.

Trade Post base count 5 -> 3
Protector Shipyards count no longer increases with tech
Protector Shipyards energy 100k -> 125k
Militia Barracks base count 3 -> 1
Militia Barracks energy 50k -> 75k

Civilian Warbird Frigates
-Targets per salvo 16 -> 4
-Damage per shot 560 -> 2240
--Should help with their ability to stunlock entire fleets.

Added a new Melee, Raid, and Technologist turret.
-The Kinetic Spike turret, mid ranged shield-piercing weapon and a single tractor beam
-The Blitz Cannon turret, long ranged weapon that deals bonus damage to high health targets
-The Techno Babble turret, mid plinky weapon and tachyon coverage
« Last Edit: April 03, 2020, 06:30:26 pm by StarKeep »