#Fancy Fuel Tanks DEVBLOG
1 messages · Page 3 of 1
It doesn't seem like I've written stuff for many fuel tanks
Here's a funny one for a snack container:
"@title = AT-CRS "Bieg Macks" Storage Unit
@manufacturer = AtomicTech Inc.
@description = After a minor mistake in which the Experimental Storage Unit was mistakenly filled with Snacks, it quickly became apparent that this mistake had turned into a viable product. Rated for Launch on AtomicTech Inc. and Yuanzi Jishu Co. rockets and even capable of crash landing in cases of energency."
energency or emergency?
energency
obviously
kerbals dont have emergencies
everything always goes as planned
alright, lets check this out
THEN im gonna go to bed
(thats like the 5th time ive said that)
this is perfect
its gorgeous.
alright off to bed i go
tonight i finalize atomictechs textures and spacepeacocks
then i make 5 more fuel tanks by friday
Night CVUSMO!
No, that part of a MM patch
Night!
i couldn't sleep..
@quartz dagger hows that base look to you?
Looking good!
hows that?
wanted to make it fit in a bit more with ksp2 so its like a giant baguette
without
Change the name and make a ion engine
engines will take a bit longer. right now getting a library of new fuel tanks made
Alr
Dang that looks good
I’m sure there will be many ion engine mods eventually, but if i understand correctly CVUSMO is just designing (beautiful!!) tanks to work with the current stock engines :p
CV-421
Wow cool
Thank you. I wanted a small tank ball thing but different looking
think this worked out good
gotta fix the metallic map again but its in game
satisfying af
alright time to watch a movie and take a break.
-2x methalox tanks
-2x hydrogen tanks```
hm need to figure out a way to make these creases go away. i changed the UV map to something neater as spheres are really awkward to add anything resembling a square to
gonna need a different UV map
hmm
separate it into rings
or better
well that can work, the problem is warping
you should make a seam where you know theres gonna be texture changes in the texture
make a seam here
interesting idea
that way it's split into two sections and you can tell which is which, also reduces warping
the warping is what im trying to fix
see?
so in the 3d view it looks fine, in game it was warped and i was confused. THEN i looked at the map and iwas like "son of a"
are u gonna add such details to the top portion?
then its ok to leave the top portion warped
which is ironic
do that seam that i told you and it will work
i was looking at maps of earth to figure out how to unwrap a sphere lol
lmao so the whole "which earth map is better"
let me get how the game unwraps the sputnik a sec
but i guess it wont be much help because they have an uniform color, so its ok to have seams
hm
this is simply so it looks better as i noticed warping
otherwise this fuel tank woudl be done

hm
so now i just need to make the bottom a square
nailed it @dreamy escarp
yeah, wait i'll draw
ok appreciate it
finally starting to understand why uv maps are so important and how to actually do them
you gotta think that, the bigger something is the mroe detail it will have
and im ghessing the big rectagle is the sphere, so you want loads of detail there
also, it being small doesnt mean that it will be blurry, cuz you're working with 4k textures
so its a bit hard for things to get blurry xD
its just a game of getting the rectangle as close to the edges as possible now
thats true. this is 4096
you should leave some space tho, not much, i like to work with 10px from the edge
edges sometimes can look wierd after compressed
heh i mean thats good, i'd maybe leave a bit more
not much
thats good
It is!
theres a bit more to it than just resizing and stuff
but thats a bit more complex, mostly textel density and uv direction
but if you're just texturing you shouldnt worry about that
it gets more complex than that??
good lawd lol
cries
hm
well
its the material thats making it do that hm
its not!
f
in these cases
usually changing this and tweaking things fixes stuff
there's still the seams see?
and make it look like its part of the design
thats waht i was thinking of doing
unless you draw the normals and ocolor by hand
which is not impossible but 
yeah maybe down the road
for now im good with it
best UV map ive made so far i appreciate the wisdom and the help

or maybe a bit greenish/blusih
what ull do is
thats the nails layer
to the layer that the foil is on
thi sis the layer that has the welds
the metal foil layer
right click on the layer and white mask
k
then you click on the mask
and paint black near the seam
basically this will say to the layer "Dont apply here"
you can use ie .5 on the brush to say "only apply 50% here"
so you'll probably have to create a gradient between black and white
black being on the seam
so im adding a gradient to the layer
you have to draw the gradient yourself
with the brush
what you can do is
change the brush opacity to .1 (or 10% i dont remember what the brush uses)
and set the brush color to black
and do several passes until it looks ok
hm ok
you can even hide the weld to see if it looks ok w/o it
it might even solve your issue
more like this a sec
what material are u using?
just so i can recreate in substance
ill send it to you
that works too
lemme know once you download it so i can delete that
downloaded!
sweet
can't seem to import this, what material u used to make that foil look?
i can just drop it here, doesnt need to be exact
i dont seem to have that 
i think you can export it
or better
rightclick, show in explorer
send me that
ok a sec i'll record it
so, basically, by doing several passes above, with diffrent brush sizes, you can make a gradient
do you have any youtube people you'd suggest watching that cover substance painter?
only on the parts that i didnt blend obviously lmao
no 
most of my substance painter knowledge comes from photoshop knowledge
photoshop and basic image editing knowledge
lol
ideally you want the seam to be at 0
i gotta finish watching the video
this is what 0 looks like
i used the same opacity throuout the video
its like making a layer transparent in photoshop
ahh i totally undrestand now what im trying to achieve
Imagine knowing photoshop instead of having minimal knowledge in GIMP
very drastic but yeah
correction: i use gimp not photoshop
put that in your pipe and smoke it
the wled is still on no?
you need ot hide
so turning off the metal foil thats what i see
that!
it takes whats in the weld and adds roughness to the edges
now thats because of the other materials on your layers
they also change height and normal
which is what's making your part look diffrent in that region
this is the only layer on now
oh
do i need to change the color of this layer since it has a whitemap?
no
no!
its not even using the color thing
it might not be your problem tho, lets see
6
you deffinetly sill have something altering your height
disable taht too
check if it will be awhite smooth ball
disable the metal foil layer
oh ok xD
yeah hmm wierd
do something
enable it
and paint with 100% opacity on the seam
with black
yeah
the problem is that it wasn't at 0 on the seam
what i'll advise you to do is
start with what you have here
and paint with white
to blend
so basically you'll do the inverse
also you can enable the other layers (except the weld and grunge)
yes!!
thats the key
the seam has to be at 0
or close enought to where you dont see any height diffrence
sheesh
didnt blend everything, just a small portion
this comes mostly to how much work ur willing to put on it
remember that these parts dont get looked at this close
lmao
so no need to be 100% perfect
i basically made the seam white and covered it with the weld
for now ill stick with the welds
but its good to udnrestand how to blend so i can do that with other fuel tanks
if you're gonna cover it with weld
you dont need it to be that perfect
the weld will hide it anyway
yup. that thing where i mess up my layers KEKW
helps if you set the value of metallic to 1 LUL
i dont think that that part should have a top stack node
oh lmao
as a way to compare the two
i need to make it radially mounted though
thats for sure
still more to learn but proud of it
its not perfect and as i keep making more parts ill get better
i find it more fun to make parts and stuff than to play the game right now lol
itll change once we have science mode and other stuff
Halfway there!! Four tanks done, four to go!
to do:
-2x hydrogen tanks (small and medium)
-2x xenon tanks
Remote: Error: File FFT/addressables/StandaloneWindows64/defaultlocalgroup_assets_all_49877dee47fed53486878efcb00b0621.bundle is 356.86 MB; this exceeds GitHub's file size limit of 100.00 MB
Remote: Error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
To https://github.com/cvusmo/FFT
Error: dev -> dev (pre-receive hook declined)
failed to push some refs to 'https://github.com/cvusmo/FFT'```
@upper summit do I need to use the Large FIle Storage thing?
You can split up each part into its own bundle I think w/ addressables, but that isn't ideal
thus me not putting the addressable on github
ah
so you only add the addressables when you release and package it
good to konw
know
im making hydrogen tanks a small and medium that don't have shiny gold things.
thiknking of adding a nuclear symbol to them not sure
time for sleep
hmm
simple, the paint looks good hmmm
some more texturing to do and detailing but thinking of going with this for the small/medium hydrogen tanks
i like it
i thought it was be nice and subtle
not sure if i need to add anything in the primary paint area (red)
or keep it like that
do you make those in photoshop and then import?
ah never used that
tbf never had to write anything on the parts
i wanted to add LH2 to the tank to signify that it's liquid hydrogen
so i did then i got the idea to add #leeks as a easter egg lol
two part: the tank leaks and obvs you know about the #leeks in ksp2
@dreamy escarp how did i screw up my paintmap?
son of a beee
those are the two layers i was using to be painted
where did i screw up in my texture bake?
wait
ur using
detail+ to paint the paintmaps?
theres dedicated layers
on the group below that
you should paint on those
those layers are meant for height details
like the text u put
or any other extra detail that is not a nail or a metal edge
ohh
that explains that
so basically just use the paintmap Accent to paint the areas i want to paint
i keep forgetting little things
I know its simple. Thank you!
xD yeah its all labeled and ready
So that you dont have to change pretty much anyhting
i just overthink things and forget the little details
but learning so maybe one day ill know waht im doing lol
ta da. thanks. super easy i just forgot to use the paintmap correctly LUL
well its invisible. weird
weird. something in my addressables is broken af
I didn't setup the Module_Drag properly which is why it went invisible.
feel like the outer texture is off
the inside tank looks amazing
figured out what ill do
section it off into quadrants. add 2 deep lines, 1 top and 1 bottom. then add some hexagon bolts
got a lot done! feeling good
3x Methalox Fuel Tanks
1x Xenon Fuel Tank
3x Hydrogen Fuel Tanks
to do:
2x monopropellant
1x xenon
but now that i thnkni about
that shouldnt be the issue
hmm wierd
can you show me the textures?
also ahve u baked the maps?
hmm wierd it looks right
oh i see
i think
your uv unwrap is not optimal
yeah its most probably that
a sec i'll draw
look at the diffrence in porportions
in unity the engine doesnt have to compress your image so it looks ok
but once you export it via addressables it has to compress
you can mitigate that by removing the compression
let me just open unity to show how
thats all i have to do really is clean up the base paint
theres some areas that aren't painted fully that make it look weird. i may just add a weld to it
to add contrast between the top and bottom
oh
that
probably double check on substance painter
if they are fully painted
i thought the problem was another lmao
mb
just a few minoir touchups and its good to go
obviously as i keep doing this ill get better
but for now im happy with how it looks. i also need to get my attach nodes fine tuned
huh for those
i have to talk w cheese on a way to automate this
but just add points on blender
they'll export to unity
then you just have to copy their positions
how to remove compression
if you ever need
Prerelease version of unity tools that has an attach node component you can add to gameobjects and an auto generate node definitions button on the root part
That's super cool!
You’re a legend for finishing this in what, only a week? Respect💪
More tanks will come. I want to make 2 models for each fuel type with custom sizes and standard sizes
but in a week learned a lot and i think they're decent looking. i will need help identifying any issues. ie. how do they look in space, in the dark, any weird texture stuff you see, and how do they attach? (do they clip, hows the radially attach etc)
that way I can release 0.2.0 next Friday and fix those issues
Fancy Fuel Tanks DEVBLOG
Ill definitely be playing around with them this week, i’ll let you know if i find anything :)
@dreamy escarp any advice? i was going to ask in CKAN but not sure how responsive they are
ohhh... this sob hasn't uploaded and i get
@quartz dagger https://github.com/cvusmo/FFT/releases/tag/v0.1.0 for now you can get it here
im working on getting it on spacedock and ckan but spacedock being weird
zero idea why its being dumb but well see
never uploaded a parts mod before so not sure if it works the same way
I’m not home today so wont have acces to my pc until this evening (UTC), it’ll probably already be on Spacedock by then but thanks anyway :p
Figured it out
now i just wait for 0.5 GB to upload
gonna lose my mind
I super compressed it
i dont know if it will look good in game
have u tested it?
that amount of compression will probably screw your textures
it worked
oh
hm
it worked but i didnt pay attention to textures
well f
are you able to download it off spacedock and export the file?
normal compressed file
f
so you said my textures are too big. theyre 4096x4096 in unity
do i need to make them 2048x2048?
you actually should lower the texture's resolution
I mean you dont need to
but the parts are small, they dont really need 4k textures i think
you should look at their textel density
Learn how to use Texel Density in Blender with this tutorial.
Texel Density Checker 3 https://mrven.gumroad.com/l/CEIOR
00:00 Intro
02:21 Checking Teel Density in Blender
05:55 Setting Teel Density
09:22 More Practical Example Setup
12:08 Foreground Objects
15:48 Foreground Objects 2
18:33 Background Objects
20:40 A Bit of Admin
23:44 Texture ...
oh lawd
with Texel Density Checker you can: Calculate Texel Density for model for different texture size (512px - 4096px) or with custom size and aspect ratioRescale UV for getting texel density what you wantUse Interactive Checker MaterialCopy TD from Active to Selected objectsVizualize Texel Density with Vertex ColorsVisualize UV Islands with Random V...
i dont recall what the KSP2 parts have but i think its somewhere around 300-500
small parts having about 350
so thats not polys?
basically its like
how many pixels are in each face of your mesh
if the face is small you dont need 1000 pixels on it
k
another question, it shouldnt have any issues uploading .5 GB to spacedock should it?
heh spacedock is a bit buggy with big files
i had to try about 6 times before i could upload the latest SORRY update
wich is 200mb
oh
thats gonna be a problem
for later mods
but by then we should hopefully have official support
tbf i dont know if its file size or what it is 
but imagining uploading KERN when its complete
gotta brief with Hebaru about it
no worries
damn
first im going to downsize these textures
do i want compression at None or High?
GPU Instancing on/off?
dont worry about those
I have some set on and some set off
so ill turn them all off
ah that was it
490 MB with 4k textures
19.5MB with 512x512 textures
2k
your mod should go to about 150mb
or maybe a bit more
or maybe less? im not sure which one it will be
at lesat i can keep 4k on my pc lol
yeah lmao
even though its quite unnoticeable
later we're gonna add a way for you to distribute diffrent resolutions
but in my head it matters
for those who want
thats cool
again, i dont mind testing things out and helping make sure things work
i havent used the new KSP2 unity tools cheese gave me
i wanted to get this released first
then mess with it
whats nice is i make these textures at 4k so when they downsize they still keep a lot of their quality. if i make them in 2048x2048 and upscaled them it would be a bit weird looking
i guess majority of players play at 1080p or 1440p though
yeah thats what im saying
4k is really not needed
even in 4k monitors you barely see a diffrence
"not" needed
4k is always needed with my monster setup
LOL
again, this is just things in my head that make me feel better
mixed with a very very horrible understanding of how textures work
so this week ive learned a lot about texturing
imagine this
You have a 4k monitor, The part occupies at most 500x500 pixels on the screen
xD
oh
if you zoom in sure
thats sad
but i dont think that ksp2 has such a zoom xD
ive got 3x 4k monitors 💚
time to make a zoom mod
do u play racing games on it?
bro you deserve my setup the things you could make with it would be insane
i play a lot of sim games but mainly like microsoft flight sim, star citizen more flying than driving
well damn sure is worth it!
it is 100%
you cam probably see like 140º on the game right?
for those games it must be pretty helpful
but im also retired and wanting to learn how to do all of this so hopefuly modding leads to something part time down the road o rsomething idk im just happy and enjoying things
probably could if i wanted to
and if the game supported it
well, ur learning 3d modelling and programming so for sure you can have a part time with those
that would be cool but no rush. just wanna make dope mods for ksp2 for now and have fun learning all of this
down the road ill ask you for advic eon part time stuff but thats down the road
not bad at 2048x2048
its insane the difference between 2048 and 4096
but i get it its literally 2x larger
if all of them were at 4k, with 11 parts, it would be like 800mb
Well
not 2x larger
and you gotta remember that each pixel stores 4bytes of information
so its 4x more pixels
and i think 16x more information?
Incorrect
please correct me cuz i dont know much about this lmao
OH WHAT THE FUCK
i just noticed
that what i searched
is not correct
4x more pixels because 4096x4096 is double in both directions and 4x more info because pixels directly correlate to info
ohh
so its actually 4x larger? makes sense because @ 2048 the file is .1GB and at 4095 file was .5GB
google gave me screen resolutions instead of texture ones
thx for the knowledge ma'am 
cheese is a genius
she is indeed
wanting a script that will check the fuel level/change in mass to kick off the particle vfx to show it cooling and then turn it off
public class CoolingVFX_Module : MonoBehaviour
{
public float Mass = 5.0f; // maximum particle effect to trigger.
public Transform Target; // target object
public bool IsInRange()
{
if (Target == null) return false;
// Compare the fuel to the target with the Mass of the rocket? How do I do that I've only found Vector3.Distance?
return Vector3.Distance(transform.position, Target.position) <= Mass;
}
}
public class ParticleController : MonoBehaviour
{
public CoolingVFX_Module Module; // Reference to the module script.
public ParticleSystem ParticleEffect; // Reference to the particle system.
void Update()
{
if (Module == null || ParticleEffect == null) return;
if (Module.IsInRange())
{
if (!ParticleEffect.isPlaying)
{
ParticleEffect.Play();
}
}
else
{
if (ParticleEffect.isPlaying)
{
ParticleEffect.Stop();
}
}
}
}```
Why do a null check, in what cases can it be null?
I've just got in the habit to null check things because of Toggle Notifications
but the nullcheck would be pointless then? just wondinerg how i could make it check the fuel level as it changes
cause the point of it was to say "Hey check the mass and as it changes lets start the particle effect at 1 and scale it to 0. start at 1 when its 99% full and then when it reaches 80% full it reaches a value of 0."
using UnityEngine;
using KSP.Modules;
public class CoolingVFX_Module : MonoBehaviour
{
{
public float MassThreshold = 1000.0f;
public Module_ResourceCapacities ModuleResource;
public bool IsOverMassThreshold()
{
float currentMass = ModuleResource.GetMass();
return currentMass >= MassThreshold;
}
}
}
I get it. I need to access the actual module and then use it to check things. Now to figure out how the game tracks mass. Is it from the Resource Capacities Module or Core Parts Data? hm
@lunar peak have you found anything in the code that calculates the deltaV of components?
Specifically:
dV capacity
current dV
remaining dV
dV requirements
Basically, what is calculating the dV in the game?
I think it's obvious but not 100% SURE. I'm looing at the class DeltaVCalc
this is what i've come up with:
using UnityEngine;
using KSP.Sim;
using KSP.Game;
using KSP.Module;
using KSP.Sim.DeltaV;
using KSP.Sim.VesselDeltaVComponent;
using KSP.Sim.DeltaVPropellantInfo;
using KSP.Sim.DeltaVPartInfo;
public class CoolingVFX_Module : PartModule
{
public const string COOLANT_NAME = "LiquidOxygen"; // Updated to actual coolant name
private VesselDeltaVComponent vesselDeltaVComponent;
private const float VFX_OFF_THRESHOLD = 0.8f; // VFX is turned off
private float VFXIntensity = 1f; // Initialize VFXIntensity at full
public override void OnStart(StartState state)
{
base.OnStart(state);
if(state == StartState.Editor) return;
// find the VesselDeltaVComponent vessel.
vesselDeltaVComponent = this.vessel.GetComponent<VesselDeltaVComponent>();
}
public void FixedUpdate()
{
if(vesselDeltaVComponent == null) return;
// total mass of the vessel from the VesselDeltaVComponent
double totalVesselMass = vesselDeltaVComponent.EngineStageSet.StartMass;
// total amount of the coolant in the vessel
double totalCoolantAmount = part.Resources.Get(PartResourceLibrary.Instance.GetDefinition(COOLANT_NAME).id).amount;
//current fuel level
float fuelLevel = (float) (totalCoolantAmount / totalVesselMass);
// Update VFX intensity based on fuel level
VFXIntensity = fuelLevel > VFX_OFF_THRESHOLD ? 1f : 0f;
// totalVesselMass and totalCoolantAmount = update cooling VFX
UpdateCoolantVFX(totalVesselMass, totalCoolantAmount, VFXIntensity);
}
void UpdateCoolantVFX(double mass, double coolantAmount, float vfxIntensity)
{
// Replace with actual logic to update the visual effects.
Debug.Log("Updating cooling VFX with mass: " + mass + ", coolantAmount: " + coolantAmount + ", VFX intensity: " + vfxIntensity);
}
}
hot damn i think i figured it out
public class ParticleController : MonoBehaviour
{
public CoolingVFX_Module Module;
public PA.ParticleField.Samples.ParticleSystemToggler ParticleToggler;
void Update()
{
ParticleToggler.SetSystemOff(!Module.ActivateVFX());
}
}
using UnityEngine;
using KSP.Sim;
using KSP.Game;
using KSP.Module;
using KSP.Sim.DeltaV;
using KSP.Sim.VesselDeltaVComponent;
using KSP.Sim.DeltaVPropellantInfo;
using KSP.Sim.DeltaVPartInfo;
public class CoolingVFX_Module : PartModule
{
public const string FUEL_NAME = "LiquidOxygen";
private VesselDeltaVComponent vesselDeltaVComponent;
private const float VFX_OFF_THRESHOLD = 0.8f;
private float VFXIntensity = 1f;
public override void OnStart(StartState state)
{
base.OnStart(state);
if(state == StartState.Editor) return;
vesselDeltaVComponent = this.vessel.GetComponent<VesselDeltaVComponent>();
}
public void FixedUpdate()
{
if(vesselDeltaVComponent == null) return;
double totalVesselMass = vesselDeltaVComponent.EngineStageSet.StartMass;
double totalFuelAmount = part.Resources.Get(PartResourceLibrary.Instance.GetDefinition(FUEL_NAME).id).amount;
float fuelLevel = (float) (totalFuelAmount / totalVesselMass);
VFXIntensity = fuelLevel > VFX_OFF_THRESHOLD ? 1f : 0f;
UpdateCoolingVFX(totalVesselMass, totalFuelAmount, VFXIntensity);
}
void UpdateCoolingVFX(double mass, double fuelAmount, float vfxIntensity)
{
Debug.Log("Updating cooling VFX with mass: " + mass + ", fuelAmount: " + fuelAmount + ", VFX intensity: " + vfxIntensity);
}
public bool ActivateVFX()
{
return VFXIntensity == 1f;
}
}
@lunar peak I'm looking at manuever node controller to get an understanding of how to modify dV.
Label NodeMaxIndexValue;
Label TotalDvValue;
Label DvRemainingValue;
Label StartTimeValue;
Label DurationValue;
Label ProgradeDvValue;
Label NormalDvValue;
Label RadialDvValue;
Label NodeTimeValue;
Label OrbitsLabel;
Label PreviousApValue;
Label PreviousPeValue;
Label PreviousIncValue;
Label PreviousEccValue;
Label PreviousLANValue;
Label PreviousEncounterBody;
Label PreviousEncounterLevel;
Label PreviousTransitionStart;
Label PreviousTransitionEnd;
Label NextApValue;
Label NextPeValue;
Label NextIncValue;
Label NextEccValue;
Label NextLANValue;
Label NextEncounterBody;
Label NextEncounterLevel;
Label NextTransitionStart;
Label NextTransitionEnd;```
anything in here that would help me calculate the totalvesselmass?
```cs
private double GetTotalVesselMass()
{
double totalMass = 0;
foreach (Part p in this.vessel.parts)
{
totalMass += p.mass;
}
return totalMass;
}```
StageStartFuelMass(int stage) and StageEndFuelMass(int stage, double endMass = -1.0): These two methods calculate the start and end mass of the fuel in a given stage.
GetCurrentFuelMass(int stage): This function returns the current fuel mass for a given stage.
ResetStageFuelMass(int stage): This method resets the fuel mass for a given stage.
GetStageFuelMassItem(int stage, out DeltaVPartInfo.PartStageFuelMass partStageFuelMass): This function gets the fuel mass item for a particular stage and returns it as out.
CalculateMassValues(): This function calculates mass values for the vessel part.
CalculateStagingValues(): This method calculates the activation and decouple stages for the vessel part.
FindParentStageRecursive(IDeltaVPart PartRef): This function finds the parent stage recursively for a given part reference.
FindDecouplerParent(IDeltaVPart inPart, out IDeltaVPart decouplerParent): This function finds the decoupler parent of a given part reference.
JettisonInStage(int stage): This method checks if the part will be jettisoned in a given stage.
GetStageStartMass(int stage) and GetStageEndMass(int stage): These two methods return the start and end mass for a given stage.
The PartStageFuelMass class is a nested class which holds information about the fuel mass and resources of a particular stage for a vessel part.
The PartResources class is another nested class within PartStageFuelMass, which deals with managing and tracking the resources consumed at a particular stage.```
yeah sort of
CalculateMassValues is already calculated with VesselDeltaVComponent apparently
private double GetTotalVesselMass()
{
VesselDeltaVComponent vesselDeltaVComponent = this.vessel.GetComponent<VesselDeltaVComponent>();
if (vesselDeltaVComponent == null) return 0;
double totalDryMass = 0;
double totalPropellantMass = 0;
foreach (var partInfoKeyValuePair in vesselDeltaVComponent.PartInfo)
{
DeltaVPartInfo partInfo = partInfoKeyValuePair.Value;
totalDryMass += partInfo.DryMass;
// current stage of the part
int currentStage = partInfo.ActivationStage;
// current fuel mass for the stage
DeltaVPartInfo.PartStageFuelMass partStageFuelMass;
if (partInfo.GetStageFuelMassItem(currentStage, out partStageFuelMass))
{
totalPropellantMass += partStageFuelMass.StartMass; // or EndMass, depending on the context
}
}
double totalMass = totalDryMass + totalPropellantMass;
return totalMass;
}```
I can't seem to calculate the mass as it changes during fligth though
This is what I've got so far for my first custom module
using KSP.Iteration.UI.Binding;
using KSP.Modules;
using KSP.Sim;
using KSP.Sim.DeltaV;
using UnityEngine;
public class CoolingVFX_Module : Module_ResourceCapacities
{
public const string FUEL_NAME = "LiquidOxygen";
private const float VFX_OFF_THRESHOLD = 0.8f;
private float VFXIntensity = 1f;
[SerializeField]
private ParticleSystem _coolingFX;
public void FixedUpdate()
{
if (this.vessel == null) return;
double totalVesselMass = GetTotalVesselMass();
double fuelMass = GetFuelMass(FUEL_NAME);
Debug.Log($"Total vessel mass: {totalVesselMass}");
Debug.Log($"Fuel mass: {fuelMass}");
float fuelLevel = (float)(fuelMass / totalVesselMass);
VFXIntensity = fuelLevel > VFX_OFF_THRESHOLD ? 1f : 0f;
UpdateCoolingVFX(VFXIntensity);
}
private double GetTotalVesselMass()
{
return this.vessel.GetTotalMass();
}
private double GetFuelMass(string fuelName)
{
double totalFuelMass = 0;
foreach (Part part in this.vessel.Parts)
{
foreach (PartResource resource in part.Resources)
{
if (resource.resourceName == fuelName)
{
totalFuelMass += resource.amount * resource.info.density;
}
}
}
return totalFuelMass;
}
private void UpdateCoolingVFX(float VFXIntensity)
{
if (VFXIntensity > 0 && !_coolingFX.isPlaying)
{
_coolingFX.Play();
}
else if (VFXIntensity <= 0 && _coolingFX.isPlaying)
{
_coolingFX.Stop();
}
}
}
Not sure if I'm doing it correctly. Two questions:
- Does it need to be an addressable in my Scripts?
- Anyone know how to get the current value of the vessels mass?
The goal is VERY simple:
private const float VFX_OFF_THRESHOLD = 0.8f;
private float VFXIntensity = 1f;
Then all it does is say "hey when the wetmass reaches 0.8 we turn the VFXIntensity off and it scales from 1 to 0 as the mass changes from 1 to 0.8
But I need sleep my brain is all foggy. I'll get back to working on this tonight
Any feedback would be appreciate ❤️
AYYY I think i have something very close to working. BUt i also may be doing this wrong.
Modify dV in what sense? MNC modifies the delta V of a Node using a call to Node Manager. This isn't about vessel delta V (what your engines are able to give you), but rather about the deltaV needed for a maneuver node. I suspect looking at MNC isn't going to help you much for that.
Sad.
I simply need to figure out how to calculate the mass of the vessel as the resource (fueltype) lowers
I appreciate the response and FP and MNC are looking dope!
I don't think you need to calculate it, I think you need to find what to call where the game calulates it for you. Surely the game does need it, so surely it's there and that will be the right way to get it.
That's true. It's probably very simple and I'm going way too in depth on it
Have you taken a look at the ActiveVessel?
It has thigns like fuelCapacity and FuelPercentage, and totalMass.
I'll take a look at it after Leagues Cup and WWC
Also taking a break from looking at all the code. Weird going from unity back into an IDE to write C#
You can get the activeVessel with activeVessel = GameManager.Instance?.Game?.ViewController?.GetActiveVehicle(true)?.GetSimVessel(true); or possibly just activeVessel = Game.ViewController?.GetActiveVehicle(true)?.GetSimVessel(true);
These return an object that's type VesselComponent.
VesselComponent is defined in KSP.Sim.impl in the VesselComponent.cs file
That's what I was trying to use qas the VesselComonent 🤣
Overcomplicated it. But it makes sense. I'll mess around with it tonight and get it working. Thanks for the help!
@dreamy escarp what modules did you use when making LFO? I think its going to be very similar to that since I'm adding a particle effect to a part.
Its not in the game
Bu try particle data or smth
Hm I'm able to get the particle effect in the game. Just need a figure out how to turn it on/off
i dont think they have a controller for amount of fuel
i'll deffinetly add one for LFO tho since the tank frost shader will need it
If yoy figure out how to do that before me please let me know 🙏 I've got a basic controller wrote to just make sure the particle effect stops after its duration reaches 0
In the VFXContextVariable, the context variables available are:
camera_distance
camera_view_direction
derived_effect_tint
derived_normalized_thrust
derived_normalized_thrustdistance
derived_raycast_distance
derived_situation
derived_total_explosion_potential
derived_vertical_deviation
env_atm_density
env_atm_temperature
env_biome
env_celestial_body
env_gravity
part_attachnode_position
part_attachnode_size
part_explosion_potential
part_fuel_quantity
part_relative_velocity
part_surface_area
part_surface_distance
part_temperature
vessel_distance_from_spawn
vessel_throttle
vessel_thrust_magnitude
For the VFXParameter, the parameters that can be modified are:
collision
color_over_lifetime
emission_burst
emission_rate_over_distance
emission_rate_over_time
gravity_modifier
limit_velocity_over_lifetime
shape_scale
size_over_lifetime
start_color
start_lifetime
start_size
start_speed
subemitters
trails
triggers```
^^^^--- this is VERY useful. I was able to create a decreasing exponential function to track the fuel quantity. we'll see if it works
hm. gotta tweak some stuff
good news is it does stop the particle effect from playing
What category should the tanks be in? I cant seem to find them, even after reinstalling the mod about 5 times😅
check the mod status on SpaceWarp's mod list
Alrighty
Is there something wrong with FFT?
I couldent find them either @quartz dagger
@surreal loom can't seem to find your parts
Not showing up
Somehow v0.1.1 only had the addressables. Basically half the mod was missing in 0.1.1
now they're all present
Cool will try again
lmao all good
also dont ship your pdb with the mod
i mean you can but its of no use to the player
sorry my fault, I forgot the tags, (ksp1 has auto tagging)
yeah i saaw
? is there a ksp1 mod named FFT?
these tags
im super confused by what you're saying on tags missing
on ckan I approved the mod without the tags.
ohh
im prepping v0.1.2
pushing it to spacedock now
sorry for screwing that up
No problem look forward to useing these ty for the mod
Happy to be making it. I'll be adding a lot more to the mod. Friday 0.2.0 will come out which will add a cooling VFX to the fuel tanks
its uploading on spacedock now but you can go to git and just download the .zip file
That's what I get for going a few days with 4 hours of sleep lol
File Explorer no likey windows
what do you mean?
My task bar broke and file explorer is killing itself
weird
@haughty bough & @quartz dagger when you install the mod, please take a screenshot in the OAB and post it here so I have peace of mind that its actually working
i appreciate it and thank you for letting me know
In the VFXContextVariable, the context variables available are:
camera_distance
camera_view_direction
derived_effect_tint
derived_normalized_thrust
derived_normalized_thrustdistance
derived_raycast_distance
derived_situation
derived_total_explosion_potential
derived_vertical_deviation
env_atm_density
env_atm_temperature
env_biome
env_celestial_body
env_gravity
part_attachnode_position
part_attachnode_size
part_explosion_potential
part_fuel_quantity
part_relative_velocity
part_surface_area
part_surface_distance
part_temperature
vessel_distance_from_spawn
vessel_throttle
vessel_thrust_magnitude
For the VFXParameter, the parameters that can be modified are:
collision
color_over_lifetime
emission_burst
emission_rate_over_distance
emission_rate_over_time
gravity_modifier
limit_velocity_over_lifetime
shape_scale
size_over_lifetime
start_color
start_lifetime
start_size
start_speed
subemitters
trails
triggers```
@surreal loom yup all good
Awesome!
enjoy! let me know any weird things you find as i know there's probably some issues with the attach nodes or something
Will do
I am once again not home, so will take a bit but will do!
That's my secret. I'ma lways home
i was going to sleep but here i am working on the particle system 
Cvusmo can you later give me some insight on what controllers you want?
ie
Total Fuel amount
Total Mass
Fuel Type
for the particle system
yup brain is thinking
ive got a creative way thats working
here
it's not perfect but it does scale it down via time
but instead of time i want to scale it to stop the particle effect when the fuel reaches 0.8 out of 1
look you can do that with ur current setup
so the scale for the Cooling VFX is 1 to 0. 1 when Fuel is at 1 and 0 when Fuel is at 0.8
thats what i was thinking i could do
just learning how these all work in unity
the curve should be 1,1 0.8,0
and ive looked at module_cooling but hard to tell how itll work. i assume itll use radiators primarily
ohh
so i need to make that curve match what im wanting
exactly
is emission_rate_over_time correct?
tue curve says
at 100% of fuel i want 100% of opacity
tbf idk
then at 80% fuel
i want 0% opacity
1,1
0.8, 0
In the VFXContextVariable, the context variables available are:
camera_distance
camera_view_direction
derived_effect_tint
derived_normalized_thrust
derived_normalized_thrustdistance
derived_raycast_distance
derived_situation
derived_total_explosion_potential
derived_vertical_deviation
env_atm_density
env_atm_temperature
env_biome
env_celestial_body
env_gravity
part_attachnode_position
part_attachnode_size
part_explosion_potential
part_fuel_quantity
part_relative_velocity
part_surface_area
part_surface_distance
part_temperature
vessel_distance_from_spawn
vessel_throttle
vessel_thrust_magnitude
For the VFXParameter, the parameters that can be modified are:
collision
color_over_lifetime
emission_burst
emission_rate_over_distance
emission_rate_over_time
gravity_modifier
limit_velocity_over_lifetime
shape_scale
size_over_lifetime
start_color
start_lifetime
start_size
start_speed
subemitters
trails
triggers```
thats everything i could use
can i add a second curve intot he function?
or like this?
i really like the ksp.vfx stuff, very convenient
oh so this is adjusting the opacity of the vfx
i mean i think it is
i havent messed with that
im talking from experience with the curve system
i trust you always
how my brain is looking at this is that i need to decrease the curve downward to decrease the fuel level
so it scales and says "okay when the fuel is here."
so now i know what the coordinates are for, time and the value of fuel quantity
or the other way around, but i think its the way you said
but yeah, the coordinates dont necessarely mean what it says there xD
so value is the x axis, and time is the y
yup!
its like any other function
but unity calls it time and value cuz its mostly used for animations
f(x) = x(1/2)... i think thast the function i was thinking of
its not saving the curve
oh i see
okay this is cleaner
now to setup a trigger
hm
In the VFXContextVariable, the context variables available are:
camera_distance
camera_view_direction
derived_effect_tint
derived_normalized_thrust
derived_normalized_thrustdistance
derived_raycast_distance
derived_situation
derived_total_explosion_potential
derived_vertical_deviation
env_atm_density
env_atm_temperature
env_biome
env_celestial_body
env_gravity
part_attachnode_position
part_attachnode_size
part_explosion_potential
part_fuel_quantity
part_relative_velocity
part_surface_area
part_surface_distance
part_temperature
vessel_distance_from_spawn
vessel_throttle
vessel_thrust_magnitude
For the VFXParameter, the parameters that can be modified are:
collision
color_over_lifetime
emission_burst
emission_rate_over_distance
emission_rate_over_time
gravity_modifier
limit_velocity_over_lifetime
shape_scale
size_over_lifetime
start_color
start_lifetime
start_size
start_speed
subemitters
trails
triggers```
prepping a hotfix. 0.1.4 >>> making fuel crossfeed an option on all fuel tanks instead of setting it so it's not an option to crossfeed.
Is the shader the same shader that lux made, just now part of KSP2 unity tools?
Idk atm, ask lux
yup
the same
It looked like it I just wanted to make sure. Uhhh as far as this script to autogenerate attach nodes, when I use it my core part data looks like this:
@upper summit / @dreamy escarp
Ohh yeah, luxstice ran into that yesterday
ahh okay. i was like "its missing the gizmo thing. weird"
Wait ... yeah the assembly definition is messed up somehow
after i auto generate, nothing is actually generated for attach nodes:
I tested both of these on my machine lol
lol
i trust you i just wanna make sure i understand how it works and if im doing something wrong because 99% sure its user error
but in the odd chance that something is amiss, i wanted to let you be aware
I think I know the issue
maybe you tried to use the stripped assmebly and forgot the change back?
Its the attachnode script being under the same thing as all the editor tools, as thats meant to be an editor assembly
Dont know why it didnt yell at me though
Alright gimme a few mins to do something
appreciate it cheese!
@surreal loom can you click the game asmdef and screenshot the inspector for it?
That seems correct
might be the script not being in the editor folder
this
i can move it and see
Try this first?
When do you get this error by the way?
when i go to build BUT now its working. its buillding
when id go here to do a new build it threw the error but the one you just sent me worked and built it
I literally just made a new assembly definition thats it
new asmdef references ig?
Yeah, I made an editor specific one in the editor folder
ah, fair
I dont use asmdef refs
i dont even know what an asmdef ref is
@surreal loom does it generate the attach nodes as well?
no thats whats weird
wait, how does your part hierarchy look?
Alright and which one of those has the AttachmentNode script on them
all of the models have the AttachmentNode script on them (i think) i havent put the actual script ON them. so i may be doing that wrong
all i did is import the package, and then click auto generate attachnodes
save the new json etc
Wait...
Did you not add any components to the gameobjects that represent the attachment nodes?
thats what ive always had on the models (well adding the VFX stuff now)
and the gameobject that had teh attachment nodes was the collider
Cuz my testing looks like this, with top and bottom being empty game objects with the script on them
ohh
example
well, the parent of the parts CV401 is what had the attachment nodes
so the top/bottom/srfAttach were part of that gameobject
in the core part data
you need to have empty transforms/gameobjects for the attachment nodes
thats cool
all good. i had feeling i wasnt doing it correct but in the odd chance something was wrong wanted you to be aware
appreciate the help. this is pretty cool
cheese
idk if you know enought from blender
but i think we can make it so that it exports from blender the nodes
idk how to do it either
but it would be way easier for artists as well
i can look into it
there is way too much information that goes into a node for that
i say this cuz its easier to get it pixel perfect on blender since you can get the median point of various vertexs
so the corect steps looks like this:
- add the gameobjects for the attach nodes
- click autogenerate
well tbh most of it its not needed
you can still create the transform in blender can you not?
add the attachment node scripts to the game objects first
you only need the Node ID, Node Symmetry group, and thats pretty much it
yes and export, thats true, but im talking a way to auto add the attachment node script
its just an extra helper tho
just food for though, cuz i am thinking of making a blender addon
liek what KSP1 has for .mu files
#1090450560114761749 btw
mb 
And @surreal loom when you add the script, if you have attach node gizmos turned on, you should see the attach node while selecting the gameobject
neat
only comment i have for future features for this is to add the Module_ToggleCrossfeed so instead of Crossfeed being automatic for a fuel tank, it can be switched on/off by players
not sure how that would look or work, but i have to uncheck the Crossfeed and then add the module. thats what ive figured out, though there may be a way to do it better idk
im gonna double check the attach node and where it auto generated them lol
i must have done something wrong again. hm
ill get working on this later on today