Jump to content

[WIP] [1.11.x] Heavy Science - Development Thread


cyberKerb

Recommended Posts

kiBoMqg.png

Heavy Science is a mod I've always wanted. It adds mass to any Surface Samples experiments that Kerbals take from the various planets and moons in the Kerbol System. 

L3Gqeoql.png06YEgzfl.png

Reviews to date:

This Rocks! - Jeb

One of life’s sample pleasures - Bob

Background:

This mod is my attempt to bring together a jumble of ideas liked having in my gameplay, while also learning a bit of OO Programming. My original idea was built by cobbling together various other mods to get the gameplay result I was after. (I posted that idea in this forum thread)

I found it odd that surface samples didn't mass anything and could be 'transmitted' for 25% science for doing so. I sought out a mod that makes players lean more heavily to returning surface samples than just transmitting them, but didn't find one. I later found some forum posts also mentioning the idea. I figured I'd have a go and coding (I've only done VB before and Object Orientated stuff gets me quite lost at times)

Heavy Science (Core ideas)

  • Surface samples...

    • cannot be stored in command pods 
    • can only be stored in a specific container part which I can add to the craft when building it
    • cannot be transmitted for science (return only)
    • have mass and thus affects your return available Delta-V to get my Kerbals home
  • Adds 1 part to the game - Surface Sample Container with empty mass of 0.06t (60kg)
  • Surface samples will probably mass 150kg
  • I did the maths with this setup to check what happens if I were to grab 1 of all available surface samples in the stock game - including both splashed and landed variants. At 200kg each, it would all weigh a bit over a fully fuelled Orange tank (~40 ton) That should make for some fun shoving that around the system while playing a collect 'em all mission. :D 

Known Issue:

Not compatible with Kopernicus at all. Breaks it completely.

 

Download link - Github
 

Credits:
Big thanks to: The KSP developers for their efforts in supporting the KSP forum community as well and building this awesome game!

@Gaiden for suggestions on how to help refine the flexibility of the mod and not restrict the users desired game play.

@Rodger for the waffle cone and texture (Happens to be my favourite bit of the mod at the moment)

Licence:
I'm using Talisar Mk1 Cargo Bay as the Heavy Science Container. Heavy Science uses the same licence: (CC BY-SA 3.0)

Happy to hear anyone's feedback, suggestions and/or discussion about the mod :)

Edited by cyberKerb
Added Download link for Beta trial
Link to comment
Share on other sites

WoW!.... This sounds awesome!

Have you seen/looked at Mini-Sample Return Capsule to maybe get ideas from?... I cant tell from your description in the OP, whether you are talking about something like the above, or a more permanently attched part, that is meant to return with the whole vessel... (rather than a tiny, robotic return part)...

Have you seen the Kerbal Hacks Portable Science Crate ?? Maybe you could ask @Enceos if you could (at least temporarily), use THAT in your mod...??

Edited by Stone Blue
Link to comment
Share on other sites

12 minutes ago, Stone Blue said:

WoW!.... This sounds awesome!

Have you seen/looked at Mini-Sample Return Capsule to maybe get ideas from?... I cant tell from your description in the OP, whether you are talking about something like the above, or a more permanently attched part, that is meant to return with the whole vessel... (rather than a tiny, robotic return part)...

Thanks! I did see that mod while looking for something similar. @CobaltWolf has an awesome model and idea. I love the self contained nature of it. 

For the Heavy Science mod, (at least for the core part) you'd still have to bring the science back with you on your ship. The part I had in mind wouldn't survive reentry on it's own - think of it as just a big metal bucket to put rocks in it. There is the option to decouple the container is things get too "weighty" and you need to lose mass.

Having said that - once I'm done, there'd be nothing to stop you added my module to his part if you were so inclined.

Edited by wile1411
Link to comment
Share on other sites

No prob - For my personal test builds, I'm actually using a scaled down SC-62 container model made by @winn75 for the KIS mod. I've sent a message to him to see if I could use it in the pictures (but not in the mod). If I've not heard back in a couple of days, I'll probably stick the PartModule in a stock part to give example pictures that way.

Any model artists out there interested in jumping in before I make a murder of vertices and meshes with my own attempt?

Edited by wile1411
Link to comment
Share on other sites

I would think command capsules could at least have limited space depending on their size, with the container for use when you plan to make more than one surface stop or want to bring back more from that one stop (so like a command capsule can net you some science gain but a sample container is needed to get all the science)

Link to comment
Share on other sites

Sorry but I didn't quite understand your comment fully. Were you suggesting that the command capsules should have room for at least 1 surface sample? I like that idea and will probably modify the idea to that, rather than just a blanket no surface sample storage in crew compartments at all.

Link to comment
Share on other sites

5 minutes ago, wile1411 said:

Were you suggesting that the command capsules should have room for at least 1 surface sample?

I sort of developed that idea as I was typing but initially I just wanted to call into question your decision to not allow capsules to be used at all. I think ultimately the size of the storage space aboard a capsule should be left to the user, I just didn't want to be denied the ability to use a capsule if I wanted to. Mass transference would still function I would imagine as that's the basis for the mod so if a user wants to store more than 1 surface sample then they would suffer the consequences of having to get that mass back to KSC. I think though that a default setting of 1 surface sample would be good to ship with the mod.

It's basically a part thing. Mods like Kerbal Engineer and kOS come with their own parts to use but some people just like integrating stuff into existing parts. Personally I might edit down my capsule's life support or crew capacity in order to increase my ability to carry back surface samples. That's just a thing that should be left to the user. I just didn't want the mod to expressly forbid the ability to store surface samples in a capsule entirely.

Link to comment
Share on other sites

thanks for the good suggestion - I'll edit the OP and add that to the list of configurable items (once I lean how to do confignodes and read stuff from files :confused:)

No reason I can't have the defaults set to how I intend the mod to work. The config will let the user make up their own mind on how they want to use it.

Link to comment
Share on other sites

Any thoughts of the more ambitious Materials bay modification? My initial thought is that people won't like a stock part being modified, but I can't see how it would work without do exactly that. I didn't want to add even MORE science points to the game. I've seen a fair few comments on the forum saying the science tree is too easy to unlock and wondered what taking the points from both surface samples and the materials bay experiments and using them in a different experiment would do to game play.Still nutting this idea out though - very much subject to change.

Link to comment
Share on other sites

I vote modify both material bay and goo container. Wouldn't hurt to make it an optional setting though (if not too much work). The whole point of the mod is to reward returning stuff and things. Maybe even make a module that modders can add to their science parts to enforce returning?

Also, are you familiar with:

 

Link to comment
Share on other sites

I hadn't planned to mod the goo canister and I figured there needed to be something that you use for science in the early part of the game. For a stock game, once you get the Science Jr, you take that to all the different biomes and various situations resulting in science points pours in just through heading to the Mun and Minmus.

The point of the "surface sample=resource" idea is to give a player the desire a go off planet to get bigger rewards. And not just off to a moon, the driver here is there further you go, the bigger the reward. Admittedly there is already this driver built into the game with the science multipliers for different planets, I just thought this idea might further it be moving the available science points away from Kerbin part of space.

Yep - familiar with KerbalMass. I gave it a whirl and tried to get it to work with 1.1.3, but I couldn't get it to do what I wanted as a module to affect kerbals and science, so I had to build mine from scratch

Edited by wile1411
Link to comment
Share on other sites

  • 2 weeks later...

Update - 15 Aug 2016

I had this mod working up to a point where I had the functionality was where I wanted it, minus the auto-store function. I feel that he Auto-store option should be put on the backburner until after I've released a dev version to play with first. That way I can get more feedback of core functionality first.

However - the way I was doing was HOOOOORRIBLE from a coding point a view. I had a friend that knows OOP go through what I've done so far (I don't OOP,  I'm just winging it) and he pulled the most mod apart and now it's currently in a broken state until I work out how to fix it properly. I know that persistence of data is non existent after the re-code, so I'll need to investigate that further.

On the plus side, after looking at Firespitter, I got an idea of how textures work and pulled together enough examples to make textures change based on a KSPEvent button. Just need to change that so it fires based on a Surface Sample being loaded into a container. :)

Work for this week:

  • A round of refactoring the code (new term I've only just learned! :)) and bringing together all the rough examples into a single whole. The thing I want to getting working is using a Sample weight stored in a Mod config file through out the rest of the mod. This is so players can determine the mass per sample for their game play. The mod will ship with a default Kerbin weight of 110kg (0.11 mass per sample in game)
  • Finish off the Crew Capsule modicivations that restrict the number of surface samples storable in a crew capsule. This is either fixed at 0 (or a number set in the config file) or it can be variable be capsule via a slider up to 20 samples in case you don't want the limit. (weight per sample still applied regardless of what you set for these configs)
Link to comment
Share on other sites

  • 3 weeks later...

Update - 1st Sep 2016

Ho boy is this coding in KSP is definitely hard when starting cold. I seem to have chased my tail quite a bit, and progress is slow just on the Crew Capsule management of surface samples. Below is just my actions so far and various bugbears I've had writing the mod

  • Replaced the stock "Store Experiments (x)" button with my own, but had to run a process in the Update() function to keep the button visible at the correct time. 
    (I'm trying to avoid using Update() as much as possible as I don't like the idea of having something running EVERY frame even when not needed. I've limited it to only run while on EVA, but it still doesn't sit right with me.)
  • Replaced both the stock buttons for "Take Experiments (x)" and "Review Stored Data (x)", including working out what X was for each bottom (they're different) - only to realize all that work wasn't necessary and the stock buttons are fine.
  • Realized stock buttons and not 100% fine as they don't appear visible correctly on their own without the correct triggers.
  • Stock buttons don't appear/hide unless the stock "Store Experiments (x)" is triggered (which I've replaced *sigh*). Seeing as I'm not using that, I needed to manually set when the other buttons get shown / updated. That was annoying seeing as there isn't a complete set of events for when these to hide/show. So far I'm using the follow GameEvents triggers:
    • onCrewOnEva - Updating "Take Experiments (x)"
    • onCrewBoardVessel - Make "Review Stored Data (x)" and "Take Experiments (x)" visible if experiments stored
    • OnExperimentDeployed - Make "Review Stored Data (x)" and "Take Experiments (x)" visible
    • OnScienceRecieved - Recheck all buttons visibility status - ie do they have experiments in capsule somewhere.
    • There isn't a "FinishedTransmitting" event, so I'm constantly polling transmitters in the Update() cycle, but only while transmitting. This is all to detect when I can update the button labels / visibility when finished, cancelled  or returned due to insufficient power.

Next task is to show how this mod works in pictures (any other ideas appreciated) Current plan is to show 3 crew capsules setup like a set of balance scales. All the right click windows are open for the 3 command pods and having different crew count /sample count in the capsules.

Once the pictures are done, I'll take what I've learnt form the crew capsule work and refactor the code in the Surface Sample Container section. From there my only to-do I want to finish is getting the textures working via code. Once that's done, I'll release the first iteration of files for anyone interested in testing and feedback. I'm hoping it shouldn't more than a week or so if the textures code doesn't take too long. :) 

Link to comment
Share on other sites

Skipped over the scales idea as in practice it didn't convey the effect enough. (Maybe the samples need to weigh more? I'll leave that setting up the player changing the cfg file.)

Here's my rough/bad sample rocket with the mod working - I'm looking specifically at the last stage Delta/V as you don't normally bring a fully fuelled rocket and boosters back from a mission. :) Delta/V variations due to Crew and Science Sample weights only

No Crew 864m/s Uncrewed Rocket
With Crew 849m/s += 3 x 93.75KG
With Surface Samples 794m/s += 10 x 110KG

Empty Capsule
Y2MuYLv.png

With Crew
bDoHH7T.png

With Crew and 10 Samples
2UwQHrh.png

What happens when you try to board and there is no room for surface samples in the crew capsule:
sFwlKiJ.png

Center of Mass changing due to moving crewTwQOIQx.gif

 

 

Link to comment
Share on other sites

  • 4 months later...

Still mulling this mod over. Especially since the 1.2.2 release that added extra function I need to work out how to handle (specifically that funky "Collect All Data" button on the new Science Container)

I do need some advice from the community I think...

Getting ahead of myself, I need to work out how much complexity to add which directly affects mapping textures to biomes identifiers e.g.(MunSrfLanded) - specifically how many? Type? Colours? etc... Here's a summary of the range of details I'm thinking.

Easiest Option: (2 textures + Empty) = 1x Rocks + 1x Liquid

  • Downside: No variation per planet / moon. Blue liquid from the explodiumSea isn't that great.
  • Upside: Low texture file count

 

Easy Middle Ground: (15 textures + Empty) = 1 texture per Planet/Moon

  • Downside: No variation per biome. (eg IceCaps vs Canyons)
  • Upside: OK amount of variation, can distinguish the different

 

Overkill Option: (161 textures + Empty) = One for every biome including a few splashed & landed varients (not counting planet expansion packs)

  • Downside: Huge amount of texture files
  • Upside: Novelty of "gotta collect 'em all" / look nice for those players that want decorative pieces around stations / large crafts

Another element that adds to this complexity is where to get the textures from. I figure there isn't a way to easily tap into the planetary textures from the base game. I'm guessing my only option is to add new files for each one added for this mod.

Edited by wile1411
Link to comment
Share on other sites

  • 3 years later...

Despite multiple years passing, I'm still poking at this idea. I picked this up again a bout two weeks back and here's what I've got so far.

I'm using some of the code from @Ger_spaceAdvancedTextures mod to try this proof of concept. Essentially I want the games scatter models and surface textures to represent the 'surfaceSample' that a EVA kerbal has just stored in the container.

I also want to have it so if a player has the BG DLC, a scientist will have a chance to pick up the 'surface feature' models rather than just the scatter 'boulders'. The chance will increase as the Scientist levels up.

Below are all the textures and models related to Minmus that I could grab. I've also added a cactus and water from Kerbin to see if this works with odd shapes. I'm still investigating how to get surface textures & colors like the Minmus flats before I move further in the development.

rM3gmHyh.png 

Link to comment
Share on other sites

On 11/27/2020 at 12:01 AM, cyberKerb said:

 

Below are all the textures and models related to Minmus that I could grab. I've also added a cactus and water from Kerbin to see if this works with odd shapes. I'm still investigating how to get surface textures & colors like the Minmus flats before I move further in the development.

 

surface colors and textures are a bit complicated. it is stored in the shader of the surface PQS quad. Also the coloring is done by a triplanar shader with height information. I didn't found a way to get the exact height color from a position, except using a cam that takes a picture of the surface below. 
Also note: normal surface shaders combine textures and colors differently than what some the KSP surface shaders do, even when you get the textures and right color values, the result could be much to dark. 

Link to comment
Share on other sites

On 12/1/2020 at 7:57 PM, Ger_space said:

surface colors and textures are a bit complicated. it is stored in the shader of the surface PQS quad. Also the coloring is done by a triplanar shader with height information. I didn't found a way to get the exact height color from a position, except using a cam that takes a picture of the surface below. 
Also note: normal surface shaders combine textures and colors differently than what some the KSP surface shaders do, even when you get the textures and right color values, the result could be much to dark. 

Understatement of the year :)  (Above emphasis mine). Thanks for the info @Ger_space.!There's a good amount of stuff in that paragraph I have no idea about, but I knew this would be an up hill battle when I started. 

With the new KSP 1.11: Some Reassembly Required including an Engineer function revamp, maybe I could plead to @SQUAD to have something like this on their development roadmap for a Scientist revamp? :D 

To get it functional, I'm planning to assign a model, & material where I can. I can't think of much I can do with water (Laythe, Kerbin & Eve other than a sphere of water colored appropriately. Failing that, I'll assigned a mesh, texture, color & shader per biome. I'll also have the ROC samples (with assigned mesh and material) so they look as expected. That just leaves cometsample & asteroid sample. I'll probably just use the potatoroid mesh and material for both and hope I can just tweak the color of one of them.

Edited by cyberKerb
Link to comment
Share on other sites

Question for anyone following along...

I'm trying to work out what to represent each biome. So far, I've settled on using the default scatter boulder mesh with a random rotation when the surface sample collection situation was "SrfLanded". 

This make less sense for biomes that are all water like Eve's "Explodium Sea" or Laythe's  "The Sagen Sea" biomes. (where would you get the boulder?) I'm thinking I'll make certain biomes always have a sphere of water... The question, (finally) is which  biomes should be "strictly" a water surface sample when in SrfSplashed?

The idea I have for intermediate surface samples from biomes like "Shallows"/ "Shores" / anything you can get a surfacesample in SrfSplashed situation is to show the boulder, but have it sitting in the middle of shallow cylinder of water.  (sample below) Thoughts?
(Don't ask where the Kerbals got the Technology to capture / contain water like this)

kfNq8XNl.png

Link to comment
Share on other sites

The rock in liquid does suggest shallows to me. I've always thought of "Shores" as the beach area before the water - never thought to check just in the water - I'll have to check next time I have the game up. If it is the beach area a generic sand texture might help distinguish between shores and shallows but I think the rock in a bit of water does the job too.

Link to comment
Share on other sites

Decided against the rock in water. while it looks good on the launchpad, it makes no sense when it orbit with no gravity. I've opted to simplify it and just have a sphere of water for certain biomes (eg KerbinWater) for both landed & splashed. For others like shores / mountains (lakes) I'll leave it as a boulder for 'landed' the sphere of water for 'splashed'.

Progress Report
Managed to made good progress last week. I'm currently fine tuning how all the items are viewed when they spawn in the container. Even managed to work out to add a floating bob and and down animation included. Learnt all about 'lerp' & 'pingpong' with that one.

This week I've got the current items on my to-do:

  •  need to re-code where to grab the mesh/material for the breaking ground ROC scatter and test the whole thing still works when the DLC is not installed. 
  • work out the HSV color modification of scatter. Will be testing with both setting the "_Color" & "_TintColor" material properties.
  • look into how to add a conditional process to modify the color itself (to be a touch brighter) when the sample is a  bit dark.
  • Write a procedure to create a better grass mesh. Currently using a flattened box so the texture shown on both sides. (Done)
  • Want to add a few extra copies of things like cactus ,tree00, pine00 & grass, rather than just a singular item. Just so it looks more 'substantial' as a surface sample. I'd love to have them laying horizontal, but the mesh is transparent from that angle, so I guess I'll have to avoid that.
  • add a code link to the part rescale value so the sample rescales with the part if someone changes the cfg. (Done)

If all that gets done, I'll start sifting through the debris of my 2016 code that got pulled apart in a refactoring that never finished. That's the bit that handles the mass change and limiting the ScienceContainer to one SurfaceSample only.  I can't remember if I managed to work out how to stop the "Transfer All" function from snagging SurfaceSample though. 

Edited by cyberKerb
Link to comment
Share on other sites

Still having fun at the moment. Couldn't resist adding in the required icecream cone model. I've found how to display the Minmus flats surface textures. :) 

rJ3xDxFl.png

edit: Below is the updated version. Bumped the texture scale a bit, also used the cone supplied by @Rodger as a replacement to my tacky procedurally  generated one. Looks much more delish. :P 

06YEgzfl.png

Edited by cyberKerb
Link to comment
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.

×
×
  • Create New...