Tralfagar

[1.2.0] Newbier Newb's Revamp of Civilian Population

Recommended Posts

10 hours ago, Tralfagar said:

@Lord Coriolis Glad to hear it's working.  Eventually, I'll write a script to remove Civilians from the admin building but for now, they're extremely useful for debugging purposes.

For your questions:

1)  Right now, there is not, except for editing the part file.  I have a parameter (populationGrowthModifier) within the CivilianDockGrowth/CivilianSpawGrowth module.  For dock growth, it is a proportionality constant.  Increasing it will give a 1:1 increase.  For spawning, that is the exponential rate for increase/decay (the rate first exponentially increases and then exponentially decreases after half-full).  Increasing it will cut the time until the population reaches maximum capacity.  For spawning, you can include more modules that have CivilianSpawGrowth (i.e. more apartments).  Since the function essentially goes from 0-100% capacity, adding more housing acts as a scaling factor.

Actually, I meant forcing more to spawn in the astronaut complex, but I can definitely work with this, thanks.

Share this post


Link to post
Share on other sites
1 hour ago, Tralfagar said:

@Deimos Rast N there are not supposed to be.  My text editor is probably creating backups.  I'll take care of it when I can access wifi.

personally I prefer the backup copies - they have much more interesting stuff in them! (nothing salacious, don't worry, just more modules, resources, etc).

Share this post


Link to post
Share on other sites

@Deimos Rast

Do you mean you like the quantity of life support?  The modules should be roughly the same (save the extras I left in by mistake for TAC/USILS).

Share this post


Link to post
Share on other sites

compare Hydroponics_Large.cfg vs Hydroponics_Large.cfg~ backup. The first is just a battery, the second actually has a resource converter.

Share this post


Link to post
Share on other sites

Gosh I'm giving out all my rep's! :P

No but in all seriousness this is why I love KSP and, more specifically, its community. Because people are so 'free' with their code/information that everyone can better the game one way or another! Cheers to you Tralfagar, and the entire KSP community in general! :D

//Ron

Share this post


Link to post
Share on other sites

@Deimos Rast Ah I see what you mean now.  I took the extra resources (food, water, O2, CO2...) out by default because Stock doesn't make use of them as there's no stock life support.  There's a MM config to add them back in if TACLS is installed and another to add say supplies/fertilizer if USILS is installed.  It seemed more straightforward (aka easier) to add them once, than delete them every time I want to add a new life support mod.  One thing I've gained from programming is an extreme dissatisfaction with copy/paste code.

That said, I haven't played Stock in a *long* time other than testing this, so I'm flying by the seat of my pants here.  If adding those resources makes a better game play experience, I can add them in.

@ronnie4444 Thank you!  But more than anything, it's other mod authors (namely @michaelhester07 and @rabidninjawombat) who deserve that praise.  And (perhaps more importantly) @tomf for putting together the new API Documentation.  Seriously, that's a godsend.

Edited by Tralfagar

Share this post


Link to post
Share on other sites

So, some quick notes on this so far. I haven't tested mechanics as I blew up my ram on the first attempt. Not sure what I need to trim out. 

Thats more of a side note, as generally I am seeing potential. First, parts are a little hard to find. The Netherdyne manufacture grouping would be good to keep I think. Second, the drill elements being kept, but tuned to old EL, while you embrace other USI, is an issue. I have copies ones modified to USI productions and usage that could be good. Number 2, I like the original hydroponic models and general concepts. And thought to reincorporating them in some way?

Share this post


Link to post
Share on other sites

@CraftyDwarf Thank you very much for the feedback!  This is still definitely a work in progress.  For your points:

1)  I agree keeping Netherdyne will help keep parts more organized.  During development, I used a new (temp) name to keep track of things but it looks like I missed a few.  I'll have them reverted to Netherdyne in the next version.

2)  I'm not sure what you mean.  I'll check the configs on ExtraPlanetary Launchpads and USI.  If you already have configs, I'd be happy to take a look at them!

3)  What hydroponic models/concepts are you referring to?  When I transferred the modules over, I moved the modules/resources into a TAC Life Support Module Manager config.  Did I miss some?  I haven't made any changes to the actual models/assets.

 

In general, I would say expect an update with the above and background civilian growth within the next couple of days.  The background processing is wrapping up.

 

EDIT:  My programming time this last week was essentially non-existent.  Update is still coming but have to work around pre-existing obligations.

Edited by Tralfagar

Share this post


Link to post
Share on other sites

@trafalgar

1) Good news

2) I will see about  attaching the configs to the github, its a bnch of them, so it may be a few a day.

3) The version I downloaded, all tthe original hydroponics/space farms from civilians were missing. Just all of them.

Note: On the config changes I mention, the laser drills pull substrate, yes, but also MetalOre instead of MetallicOre, and not to mention, to really cooperate, there need to be the full USI minable list. RareMetals, ExoticMinerals, there is like 8 basic materials. USI also has a Hydrates, which can be made into water or polymers. As a double resource, it will have special needs when you build a mining and refing core. I have guessed on the values to mine bbased on other drills, and the fact the netherdyne models (especially the Mega) are supposeed to deliver more.

Share this post


Link to post
Share on other sites

@CraftyDwarf can you confirm that there is a folder in /GameData/CivilianPopulationRevamp/Parts/Hydroponics?  And check the version in /GameData/CivilianPopulationRevamp/CivilianPopulationRevamp.version?

I think you may have version 0.0.3 instead of 0.0.4.

Share this post


Link to post
Share on other sites

yes I found the hydroponics elements. Here is a config of one of the drills I mentioned.

PART
 {

    name = pipeNetwork

    module = Part

    author = Hester


MODEL
  {

    model = NetherdyneAerospace/CivilianManagement/Assets/laserDrill
    //texture = Decal00 , UmbraSpaceIndustries/Kolonization/Assets/Decal07
        //texture = Decal00 , UmbraSpaceIndustries/Kolonization/Assets/Decal07

    //texture = Decal00_GLOW ,UmbraSpaceIndustries/Kolonization/Assets/Decal07_GLOW

}

rescaleFactor = 1

node_attach = 1.2, 0, 0, 1, 0, 0, 2


    TechRequired = advScienceTech

    entryCost = 5000
    
    cost = 16500

    category = Utility

    subcategory = 0

    title = Netherdyne Laser Drill

    manufacturer = Netherdyne Aerospace

    description = Extract Planetary Resources with the power of Lasers!

    attachRules = 1,1,1,1,1

    // --- standard part parameters ---

    mass = 2.5

    dragModelType = override

    maximum_drag = 0

    minimum_drag = 0

    angularDrag = 0

    crashTolerance = 7

    breakingForce = 200

    breakingTorque = 200

    maxTemp = 5000
    
    MODULE

    {

        name = ModuleResourceHarvester

        HarvesterType = 0

        Efficiency = 4
    
        ResourceName = Substrate

        ConverterName = Substrate Drill
    
        StartActionName = Start Substrate Drill

        StopActionName = Stop Substrate Drill

        INPUT_RESOURCE

        {
    
            ResourceName = ElectricCharge

            Ratio = 24

        }

    }

    MODULE

    {

        name = ModuleResourceHarvester

        HarvesterType = 0

        Efficiency = 4

        ResourceName = Water

        ConverterName = Water Drill

        StartActionName = Start Water Drill

        StopActionName = Stop Water Drill

        INPUT_RESOURCE
    
        {

            ResourceName = ElectricCharge

            Ratio = 24

        }

    }


        MODULE
        {
            name = ModuleResourceHarvester
            HarvesterType = 0
            Efficiency = 4
            RecipeInputs = ElectricCharge,6
            ResourceName = MetallicOre
            ConverterName = MetallicOre Drill
            StartActionName = Start MetallicOre Drill
            StopActionName = Stop MetallicOre Drill
            INPUT_RESOURCE
            {
                ResourceName = ElectricCharge
                Ratio = 24
            }
        }    
        
        MODULE
        {
            name = ModuleResourceHarvester
            HarvesterType = 0
            Efficiency = 4
            RecipeInputs = ElectricCharge,6
            ResourceName = Uraninite
            ConverterName = Uraninite Drill
            StartActionName = Start Uraninite Drill
            StopActionName = Stop Uraninite Drill
            INPUT_RESOURCE
            {
                ResourceName = ElectricCharge
                Ratio = 24
            }
        }

        MODULE
        {
            name = ModuleResourceHarvester
            HarvesterType = 0
            Efficiency = 4
            RecipeInputs = ElectricCharge,6
            ResourceName = RareMetals
            ConverterName = RareMetals Drill
            StartActionName = Start RareMetals Drill
            StopActionName = Stop RareMetals Drill
            HarvestThreshold = 0.05
            INPUT_RESOURCE
            {
                ResourceName = ElectricCharge
                Ratio = 24
            }
        }        
        
    MODULE
    {
        name = ModuleResourceHarvester
        HarvesterType = 0
        Efficiency = 4
        ResourceName = Minerals
        ConverterName = Mineral Drill
        StartActionName = Start Mineral Drill
        StopActionName = Stop Mineral Drill
        INPUT_RESOURCE
        {
            ResourceName = ElectricCharge
            Ratio = 24
        }
    }
    MODULE
        {
            name = ModuleResourceHarvester
            HarvesterType = 0
            Efficiency = 4
            RecipeInputs = ElectricCharge,6
            ResourceName = ExoticMinerals
            ConverterName = ExoticMinerals Drill
            StartActionName = Start ExoticMinerals Drill
            StopActionName = Stop ExoticMinerals Drill
            HarvestThreshold = 0.05
            INPUT_RESOURCE
            {
                ResourceName = ElectricCharge
                Ratio = 24
            }
        }    
    MODULE
    {

        name = ModuleAnimationGroup

        deployAnimationName = Deploy

        activeAnimationName = Drill

        moduleType = Drill

    }

}

Share this post


Link to post
Share on other sites

@Smart Parts Wanter haha no I am most certainly not.  This is my first time working with Git(and C#...and modding...and "theoretical" programming).

To answer your question, no.  Source can be discarded (I actually need to figure out how to separate the GameData and Source folders because I feel like I'm wasting bandwidth).  It contains my source code which should not be used unless you want to take a look at the inner workings of the mod.

Just in case you're new to modding KSP, you should have a folder within the KSP folder called GameData which if it's a new install will contain only a folder called "Squad".  In my mod, I also have a folder called GameData.  You'll take the contents of my GameData folder and drop them in KSP's GameData folder.  So when you're done, it should contain "Squad", "CivilianPopulationRevamp", "Community Resource Pack", and "ModuleManager".

Edited by Tralfagar
clarity

Share this post


Link to post
Share on other sites

Let me just say I'm super happy to see something like this in the works. I was excited to see a civilian pop revival for 64-bit, but seeing this new version with the features I had hoped for has me over the moon (Pol)! I haven't been able to give it a try yet (I'm still on 1.1.2 and the spawn bug is an issue), but I can't help imagining all the fun I can have with this, Galactic Neighborhoods, Deepfreeze, kOS, and MORE.

Keep up the good work, and thanks again.

Edited by riskyjubles

Share this post


Link to post
Share on other sites

Good to hear and I hope both of you enjoy it.  Wanted to give an update on my progress (or lack thereof).  I've been slowly working on this mod, but personal and professional life have been interfering, as well as my inexperience with C#.  I found a proof-of-concept solution to a problem that had been bugging me for a while.  Turns out strings and doubles aren't passed by reference directly, but if they are nested in a class, they can be.  So background processing should be able to work without a problem as long as I can alter the values protoVessels/ResourceSnapshots.

But unfortunately now I need to figure out how to program C# for KSP on Windows.  Hopefully it's easier than on Linux.  Ideally, I want to include the drill updates (above), and background processes for the KSP 1.2 version that will be coming out soon.  Unless someone finds a game-breaking oversight, in which case I'll add whatever fixes I currently have done.

Edited by Tralfagar

Share this post


Link to post
Share on other sites

Happy to hear that someone took up the mantel again! Hope you will have as much fun modding it as we will have playing it!

Any idea regarding a more "slim" version of it, which would add more stock alike modules which fit into the regular sizes and inflate in orbit? I know that launchpad would help, but I am frustrated with continued crashes due to having 20+ mods at any give time and would rather like to inflate some space stations in this Mod too!

Share this post


Link to post
Share on other sites

@GalacticAC Right now, I'm just focusing on the plugin aspect.  I have some experience in 3D modeling, but mostly for engineering applications, not exporting into a game system.  If it is anything like learning the ins/outs of writing plugins for KSP, it's a lost more headache than I'm ready for right now.  There are at least 1 of each size that will fit in the stock 2.5 m fairings IIRC.

That said, if anyone reading this knows how to model and wants to do it, I'd hardly say no!

Share this post


Link to post
Share on other sites

@Tralfagar Thank you for keeping this mod alive. I'm new to it but it looks like fun.

Edited by Starfire70

Share this post


Link to post
Share on other sites

Hi I have a question,

What is the aspects of using this with USI Life support? I mean, do i still need to resupply a station in space? if so, is there a way to tweak the gardens and green houses to make them 100% recycling and self sustained to stop resupplying stations (would be nasty when you want a deep space tourist station :( )

thanks for your response

Edited by Jiraiyah

Share this post


Link to post
Share on other sites

@Jiraiyah the stations should be self-sufficient (or nearly so).  It is about 16 supplies/Kerbal/Kerbal day, right?  Right now, I believe I have the habs set up for 100 days at maximum capacity.  I think the green houses are sized to keep up with a maximum of 50 or 60 Kerbals at the largest size per Greenhouse.

You will still need to bring in either supplies or mulch + fertilizer but you should have plenty of time to do so (about 3-ish months).  If you notice something off, let me know!

Share this post


Link to post
Share on other sites
7 hours ago, Tralfagar said:

@Jiraiyah the stations should be self-sufficient (or nearly so).  It is about 16 supplies/Kerbal/Kerbal day, right?  Right now, I believe I have the habs set up for 100 days at maximum capacity.  I think the green houses are sized to keep up with a maximum of 50 or 60 Kerbals at the largest size per Greenhouse.

You will still need to bring in either supplies or mulch + fertilizer but you should have plenty of time to do so (about 3-ish months).  If you notice something off, let me know!

 

@Tralfagar Well, that is exactly my problem, take a look at my ksp :D

bb8dcdd2a07646c19de211111adf951a.png

f0d2946db1224e589301d40e6e2ec1e1.png

What I'm gonna do in my play series, is to send tourist/space stations all over this monstroucity of galaxy map and each one of the nice planets will have their tourist stations, meaning, they will be years away from kerbin, that is why, i need a 100% self sastaining space colony that would recycle the resources 100% both for tourists (if they need any) and the kerbals that normally need life support without needing to sending up anything later down the road because well, sending resources to a station that is hundred years away from you is not possible :P the only other option would be to somehow find a way to use usi's colonization system to produce that mulch and fertilizer from ISRU missions but again, that would mean i would need to maintain colony after colony all over the map !

Share this post


Link to post
Share on other sites

OPM and that Valentine planet mod are honestly the only ones that have ever really caught my interest... I guess that speaks to the quality of those mods! :wink:

I would imagine that it might be worth it to have the tech tree offer upgrades to what must be supplied vs what can be generated/maintained via habitat recycling/growth and ISRU. Low entry tech would require stations to supply large amounts of resources with restock missions. Upgraded tech would permit more and more to be recycled or grown or processed on the habitat, and the top level tech tree would unlock full ISRU based upkeep.

I guess that's how I'd think to handle it if I were doing it. I absolutely love that Civilians are now full-fledged Kerbals. I've not run anything of this new version at all. Truth is, I haven't actively played KSP since 1.0.4, and that was only light play (Mun, Minmus, and probes to Eve and Duna), since 0.90... I've been spending the past year and half working on physical projects (A custom mechanical keyboard, and a KSP instrument panel/controller that I'm building into my desk). The wait for 1.1 and the hardware projects pretty much put me into 100% wait mode. (Also Fallout 4, LOL :rolleyes:)

This is high on my list of desired mods, for the simple fact, that I miss my old "Silent Running" station! I like green in space! :D

I also miss the old school 8m biodome, and 25m stanford torus... That pack broke in the transition to 1.0... I think attachment nodes and thermal stuff is what broke. Sad to see that one go.

Edited by richfiles

Share this post


Link to post
Share on other sites

One brief nitpick: the dock-growth function is hard-coded to ask for Kerbin, the Mun, and Minmus, which means it only works in stock (ish) solar systems.  I'm okay with living without civilian dock growth in my RSS install, but it would be a better pattern to instead query if FlightGlobals.currentMainBody.isHomeWorld (in which case, set the growth to 1) or FlightGlobals.currentMainBody.orbit.referenceBody.isHomeWorld (in which case, set it to 1/2, or maybe get extra-sophisticated and do some math on the semiMajorAxis relative to the planet's Radius -- and be sure to have a null check in here, as I'm pretty sure the Sun's orbit or orbit.referenceBody is null).

Share this post


Link to post
Share on other sites
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.