GGumby

[WIP] A noob's attempt at Maintaining and Rebalancing Civilian Populations

Recommended Posts

Im now resolute in making a full blown attempt at trying to update and maintain the Civilian population mod. The Primary issue being I have no formal knowledge of C# (although i have begun learning as of recent).I have no formal knowledge of the expansive KSP.API. Without your guy's help i'm probably going to meet some sort of wall. Regardless, im forced to piece together a puzzle by engineering missing pieces without formal knowledge of what pieces are missing in the first place.

I have been using the resources provided by the community in order to aid myself in fixing this thing up, but i seem to be falling short in terms of where to go when it comes to debugging whats actually inhibiting the mod from working at 100%. I will continue to formulate where i can look, but as far as code is concerned i'm at a loss as to what may or may not be completely broken or functional, though with my current knowledge of C# i am able to read the code with some confidence. With my IDE's and proper references i can know that it at least will build the .DLL Successfully, its moreso a problem of will ksp read the code properly, as i have heard there is a lack of inherent debugging you can do in ksp.

One thing i do know is that the original author's of the mod were setting up a GUI and have the ultimate framework in place for doing so, i cannot thank them enough for doing this as it gives me a firm foundation to continue growing a GUI from this and doesn't force me to reference other mods to find relevant classes to call from the API. though, it may be good for me to study the API in a little more depth to formulate a mental dictionary on where to find certain classes.

If anything, help and guidance would just be the greatest. Every little bit counts as i'm sort of unorthodoxally approaching modding.

Outline:

Add Animated suspension in the small habitat so that way you can ferry Civs from one location to another without having to facilitate  their resources, it will require 12,2 EC/s/4 Civs

Replace life support handling with TacLS life support handling (because they use NASA's math on real consumption rates)

Forcefully make kerbals grow over a period of time to facilitate population growth from low populations.(use "realistic" population growth functions, be it as simple as an exponential or a complex algorithm)(Recommendations welcome!)

Balance mod to make more sense when using mods like interstellar and EL, which are complimentary in nature.(Recommendations welcome!)

Balance mod to where larger objects are encouraged over smaller ones for habitation but larger objects increase dramatically in mass per tier. (small, Medium, large)

Add Variable start location compatibility and realistic sol config as i plan for it to be based on distance. Current math kerbin = x, moon = x/10, Minmus = x/50, where x is CivilianDockGrowthRate. New math: CivilianDockGrowthRate/Megameter from starting body. Realistic sol will multiply the denominator by 10.

Any Feedback i can get in terms of balancing is invaluable so keep it coming my way!

Known Issues:

Spoiler

 

?x? = Uncertain

Listed by fix priority:

Biospheres dont properly facilitate their alleged capacity

Kerbals don't make love. *Ahem* the population doesn't grow over a period of time. 

Civs dont consume/produce resources when there is no food. (probably gonna take a look at the TAC-LS system. But somehow keep it to where normal Kerbs don't need LS)

 

 

Current Progress & End of day Reports:

Spoiler

 

5/20/2016: Tinkering

Decided to experiment/ practice with code today as well as familiarize myself with some logic hierarchies and some API. Looked into how im going to introduce animated suspension. Instead of still having to feed Civs, i reckoned it could just require power for simplicity's sake. They will be treated as a separate resource that requires power to maintain. No power, no Civs. might make it hurt reputation like killing a tourist.

5/19/2016: Publication Resource Handling

Mod is officially published and managed 50-ish downloads within the first 5 hours (mod published at 7 p.m. EST).

I've formally made the decision to make use of TAC-LS systems, if possible. I want to keep the ability to keep non-civs to be independent of the Life support which i believe is possible.

5/19/2016: First working Version

5/19/2016: Well a little over the course of 48 hours and with the help of some great people :wink: i was able to successfully rebuild the mod into a working version. This may not seem like much, but to me, its means just a whole bunch! 

5/18/2016: Revival

[Fixed] Thanks @JPLRepo and @BetaguyGZT! {currently the .dll s aren't aren't talking to the parts, however the university IS generating education.}

 

Special thanks:

@DStaal

 @BetaguyGZT

 @JPLRepo

Thanks for Stopping by! :cool: Stop by often for updates under Outline.

Release Thread: [Here]

Edited by GGumby

Share this post


Link to post
Share on other sites

Hey Found my First Problem that i really need help with!

putting this comment here for relevance.

So where in the god emporer of mankind's holy name do i reference the ApplicationLauncher class?

ive referenced literally every .dll in the folder that i can, yet NOTHING has a reference for it! Ive refrenced C# Firstpass and it didn't do squat!

Edited by GGumby

Share this post


Link to post
Share on other sites

As someone who really enjoyed this mod, I'd love to see it working again. I apologize that it slipped through the cracks when I wasn't looking.

I've got Dev experience, so I can help. :D If I recall correctly, you're going to need MonoDevelop and Unity both to get this sorted. I could be mistaken on that particular point though. I don't recall Visual Studio being needed; but it's free now.

Unity attach to KSP (attachToProcess), then load the troubled mod up (likely need Module Manager too), see what the Assemblies Tab is saying (F12) and go from there. We'll walk this one through step-by-step. :) 

AppLauncher Class could mean literally anything. The game itself, the mod (most likely the troubled .dll) ... probably the entryPoint loop is saying 'hey man, version number mismatch is the first problem'. That's not uncommon with old mods that need updating.

Share this post


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

As someone who really enjoyed this mod, I'd love to see it working again. I apologize that it slipped through the cracks when I wasn't looking.

I've got Dev experience, so I can help. :D If I recall correctly, you're going to need MonoDevelop and Unity both to get this sorted. I could be mistaken on that particular point though. I don't recall Visual Studio being needed; but it's free now.

Unity attach to KSP (attachToProcess), then load the troubled mod up (likely need Module Manager too), see what the Assemblies Tab is saying (F12) and go from there. We'll walk this one through step-by-step. :) 

AppLauncher Class could mean literally anything. The game itself, the mod (most likely the troubled .dll) ... probably the entryPoint loop is saying 'hey man, version number mismatch is the first problem'. That's not uncommon with old mods that need updating.

Ill get the software setup tonight but its pretty darn early here. im gonna sleep before the people that go to work in the morning wake up :wink:

I really am estatic that someone is willing to help me along, i haven't heard much all night!

Edited by GGumby

Share this post


Link to post
Share on other sites
2 hours ago, GGumby said:

Hey Found my First Problem that i really need help with!

putting this comment here for relevance.

So where in the god emporer of mankind's holy name do i reference the ApplicationLauncher class?

ive referenced literally every .dll in the folder that i can, yet NOTHING has a reference for it! Ive refrenced C# Firstpass and it didn't do squat!

Try the first sticky post the the very same sub-forum as you have this thread... The ApplicationLauncher class is in KSP.UI.Screens inside the Assembly-CSharp dll.. which you should have as a reference in your project.

 

Share this post


Link to post
Share on other sites
5 minutes ago, JPLRepo said:

Try the first sticky post the the very same sub-forum as you have this thread... The ApplicationLauncher class is in KSP.UI.Screens inside the Assembly-CSharp dll.. which you should have as a reference in your project.

 

8 minutes ago, BetaguyGZT said:

No worries. :) It's not a race.

Also, ApplicationLauncher.Instance.RemoveModApplication(CivPopButton) 

^^^

That is a small piece of GUI code that has "ApplicationLauncher" out of context, just as an example.

Edited by GGumby

Share this post


Link to post
Share on other sites

It was updated for KSP 1.1, and I supplied the info, but perhaps not so obvious... it is in KSP.UI.Screens

So you need a

using KSP.UI.Screens;

You should familiiarise yourself with this thread as it contains info about 1.1 changes which supercede older posts.

 

Share this post


Link to post
Share on other sites
3 minutes ago, JPLRepo said:

It was updated for KSP 1.1, and I supplied the info, but perhaps not so obvious... it is in KSP.UI.Screens

So you need a


using KSP.UI.Screens;

You should familiiarise yourself with this thread as it contains info about 1.1 changes which supercede older posts.

 

Thanks JPL after i read your other post alittle more in depth, i collected that information myself! I should listen to "telesense?" alittlemore it recommended me some of those options as a fix for the out of context class, ive now found the fix with your help!

Gonna have to put sleep off alittle bit longer :D

Edited by GGumby

Share this post


Link to post
Share on other sites
2 minutes ago, GGumby said:

Thanks JPL after i read your other post alittle more in depth, i collected that information myself! I should listen to "telesense?" alittlemore it recommended me some of those options as a fix for the out of context class, ive now found the fix!

NP :cool:

Share this post


Link to post
Share on other sites

now, to replace all that Regolith scripting i deleted and to fix its references as well. 

For the most part it works, the only real issue ive observed is that there isnt really any handling over time because Regolith was an ISRU Framework for resource handling. If you have any good suggestions on what i can replace that with, be my guest. Its just that is alot of backbone mathwork that much of the software is based off of seemingly.

Edited by GGumby

Share this post


Link to post
Share on other sites

How about using TAC Life Support? That's got a new maintainer, and needing a shot in the arm to sorta give it a Mission. :) Makes sense, really ... 

Aside from that, there's some standalone code that works right in the configs from LBSI that I hacked for my own purposes for Life Support after TAC-LS stopped working .. and I'm great with .cfg code. I'll be happy to contribute it, but I'd rather use the TAC-LS way because it's cleaner, less bulky and it's scale-able to fit the specific part.

Up to you ... and I don't wanna bogart your turf. :D 

Share this post


Link to post
Share on other sites
5 minutes ago, BetaguyGZT said:

How about using TAC Life Support? That's got a new maintainer, and needing a shot in the arm to sorta give it a Mission. :) Makes sense, really ... 

Aside from that, there's some standalone code that works right in the configs from LBSI that I hacked for my own purposes for Life Support after TAC-LS stopped working .. and I'm great with .cfg code. I'll be happy to contribute it, but I'd rather use the TAC-LS way because it's cleaner, less bulky and it's scale-able to fit the specific part.

Up to you ... and I don't wanna bogart your turf. :D 

sounds good, I most certainly want to look into that!

but i like the idea that the original mod author had, where you dont need tacls as a dependancy and you essentially begin growing VatBabies as kerbals. it helps appeal to that audience who doesnt want to deal with managing a LS system in a more casual or easy playthrough.

Tell ya what, there isnt a problem with having a fork with tacls as a dependency but im just certain it would be doing the exact same thing just messier. messier with legacy not tacls dep.

Oh btw i just got #region regolith working and the new .dll compiled so im going to test it now will update with results!

Edited by GGumby

Share this post


Link to post
Share on other sites

Awesome! I was editing my post with the idea that maybe Regolith doesn't need to be working as a plugin, since Civilians could be treated as Resources that increase and decrease depending on certain maths that can be handled right in the .cfg files (most likely ... needs a bit of research). But you got it going, so yeah. :D 

My help with the configs is quite available if you would like it. No need to fork, I might pick up another orphaned mod (BioMass) if it hasn't been already. That was another favourite of mine in the 0.90 days.

Share this post


Link to post
Share on other sites

Its working BTW!!!

also, why not fork? I can put it on CKAN and Spacedock and allow everyone else to use the updated version. Plus i plan on changing how things are ordered in the tech tree so that way you dont have 15 workshop productivity with only a single kerbal. I would very much like that to happen later on down the road in the tech tree. and same goes with reactors. I wanna base reactor balancing based on a compromise between interstellar and stock tech trees. I dont want interstellar to be necessarily too under powered compared to the easy reactors in this. Also to balance it against EL which is a complimentary mod where the drills here are kinda funky. (i have to do more research to balance the drills)

New Development, doesnt seem like recruiting a new kerbal works?

NVM it works.

Share this post


Link to post
Share on other sites

Naah, I don't steal thunder. It's not right. :) I'm completely happy using your version, and how your vision of the mod should be going forward. Forking it would feel too much like the "too many Chiefs, not enough Tribesmen" mentality. If you choose to accept any one (or more than one) of my ideas, you'll let me know and I'll be pleased to help out if you want the help. It's all above-board with me. :) 

Share this post


Link to post
Share on other sites
26 minutes ago, BetaguyGZT said:

Naah, I don't steal thunder. It's not right. :) I'm completely happy using your version, and how your vision of the mod should be going forward. Forking it would feel too much like the "too many Chiefs, not enough Tribesmen" mentality. If you choose to accept any one (or more than one) of my ideas, you'll let me know and I'll be pleased to help out if you want the help. It's all above-board with me. :) 

Looks like i will need you in the future! ill need you to create a realistic solarsystem config for the mod once the math and logic is in place for adaptive start positions.(for now i must rest)

Edited by GGumby

Share this post


Link to post
Share on other sites

No problem. I'm getting my RSS Mods situated now, in fact. I had an idea about simulating a SpaceX-launched Europa and Enceladus Orbiter and Sampler Mission set, so I wanted to see how it would pan out. :wink: 

Share this post


Link to post
Share on other sites

I have and will have a few habitation related parts you can use If your interested. Not quite done yet, but it gives me a good excuse to make a actual greenhouse. :D

Share this post


Link to post
Share on other sites
4 hours ago, SpaceMouse said:

I have and will have a few habitation related parts you can use If your interested. Not quite done yet, but it gives me a good excuse to make a actual greenhouse. :D

The problem isn't parts, its mostly script, i have actually yet to clarify  ?Biospheres dont properly facilitate their alleged capacity?

But i defenately want to look into what you got, im thinking about adding a couple of buildings alot later on down the road to increase the need for more buildings!

my main concern is that it might conflict with the current art style.

Edited by GGumby

Share this post


Link to post
Share on other sites

As a non-modder who's read a bit reading over this:

First off, on Regolith: Squad hired RoverDude to essentially re-implement Regolith in stock - so you should be able to convert that code over to using the stock resource model.

Secondly: I actually like the +15-for-one-Kerbal part.  :wink:  It's a mainstay of my early build stations - when I'm still limited by the number of Kerbals I have on staff.  It's bulky and awkward to use, plus it holds only one Kerbal, so later on I start trading in for larger parts with lower multipliers - but higher total productivity, and they integrate better into ship designs.  Up to you how you want to balance it, but I'd argue it's moderately well balanced as is - and if you added a high electric consumption you could balance it a bit better without losing the part altogether.  (I'll also admit that part of the balance to me is a CLS config for it: I've got one limiting you from passing through it - you can only enter or exit from one side.  Makes stacking them or anything else with it much harder.)

Share this post


Link to post
Share on other sites

Hey GGgumby!  Glad to see you are reviving this. :D  

I wish i had time to maintain it but , unfortunatly, im worknig full time + running a small buisness and taking classes.  

I assume your updating from my version, and not updating all the way from MichaelHesters .25 version?  (based on the screenshot from your release thread i see one of the parts i threw in :P) 

But if you need any of my work in progress models/textures/code, im happy to send them to you.   

Your also welcome to use any and all pictures/screenshots/logo's from my thread :D    

Edited by rabidninjawombat

Share this post


Link to post
Share on other sites
24 minutes ago, DStaal said:

As a non-modder who's read a bit reading over this:

First off, on Regolith: Squad hired RoverDude to essentially re-implement Regolith in stock - so you should be able to convert that code over to using the stock resource model.

Secondly: I actually like the +15-for-one-Kerbal part.  :wink:  It's a mainstay of my early build stations - when I'm still limited by the number of Kerbals I have on staff.  It's bulky and awkward to use, plus it holds only one Kerbal, so later on I start trading in for larger parts with lower multipliers - but higher total productivity, and they integrate better into ship designs.  Up to you how you want to balance it, but I'd argue it's moderately well balanced as is - and if you added a high electric consumption you could balance it a bit better without losing the part altogether.  (I'll also admit that part of the balance to me is a CLS config for it: I've got one limiting you from passing through it - you can only enter or exit from one side.  Makes stacking them or anything else with it much harder.)

well my thing is if your using EL then you probably using KAS and KIS, At which point you can make alot of them and connect them altogether. of course im thinking of a groundbase where you have that flexibility. Or am i just not understanding how EL workshops work?

Share this post


Link to post
Share on other sites

Nah, I think you have that right.  I tend not to do that, for a couple of reasons.  One, they don't fit with my normal base parts (UKS and Planetary Base Systems); two, leaving construction equipment around my base slows down my computer.  My construction setups tend to be mobile, so I can move them when I'm done building a base.  Three, it doesn't really solve the CLS issue - to move around I have to EVA my Kerbals.  (Which is easier on the ground, but still more awkward than an internal transfer.)  Four, I can get higher productivity per part count in other ways - and even on ground bases that's important.

Where I tend to use it is in my first orbital build station - I only have a couple of usable engineers at that point, so they need all the help they can get.  Past that, I tend to go with other parts, even as is.  As I said - my inclination to balance it would be to add EC use - it's an automated factory by description, so all of that has to run off of something.  Then you have to worry about how to power it, instead of how to staff it.  Which is a different challenge, but not necessarily an easier one.

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.