St4rdust

KSP Loading... Preview: Grip Pads

Recommended Posts

Posted (edited)
34 minutes ago, steve_v said:

I know, I know, and I don't disagree. I've just been watching KSP accumulate quick not-really-fixes for a long time, and they never seem to get sorted out properly, just plastered over with more quick-fixes and buried under a mountain of "shiny new stuff" hype.
I'm not claiming to know better than anyone, and I sure don't know how to fix this stuff myself or I would have done so already. It's just frustrating the number of years I've been waiting and hoping for this game to loose it's early-access jank and stop shipping new bugs with every release.

Yeah I know the feel.

Though I'm quite sure I have a rough idea of how to fix it from the code PoV and a good idea of how to fix it from the UX PoV (or at least I sat in a uni room and listened to someone talk about UX for several years).
The odds of things changing are incredibly slim sadly. Especially so because there is no incentive to give us something for free. Something which becomes even more obvious when you consider the 'fix' of actually using a proper PhysicMaterial is what they sold us with the grippy pad.

Maybe I'm being overly cynical though and Squad will do a polish-run over base KSP for 1.8. We'll see.

Edited by Jognt

Share this post


Link to post
Share on other sites
Posted (edited)
36 minutes ago, steve_v said:

stop shipping new bugs with every release.

A bugless release is a near impossibility for any software product.  There are entire YouTube channels devoted to finding and exploiting bugs and glitches in AAA titles by top tier studios.  I'm not saying we haven't seen some slipshod shenanigans in the past, I'm just saying don't set the bar too high on your expectations, there.

Edited by MaxPeck

Share this post


Link to post
Share on other sites
23 minutes ago, Jognt said:

Maybe I'm being overly cynical though and Squad will do a polish-run over base KSP for 1.8. We'll see.

I'm definitely being cynical, but I'm not convinced on the "overly". If history is any guide 1.8 will be more part revamps, fixes for the DLC, or more DLC. I'd love to be proven wrong, but it's not-happened time and time again.
 

Just now, MaxPeck said:

I'm just saying don't set the bar too high on your expectations

I'm not asking for a bug-free game (though I can think of a good number of software products that are effectively bug-free), I'm asking that regressions get fixed before release, and if they can't be for some reason, at least not left to rot for years under a pile of DLC hype.
My expectation isn't perfection, it's "Don't break existing systems, and if by some unavoidable scenario you do, please make fixing them a priority. If an old bug in a core system has been annoying players for years, deal with it before introducing more stuff."

Input devices on GNU/Linux haven't worked at all since 1.4:  Regression, unfixed.
The brokenness of wheels has been a thing since 1.1: Regression, unfixed.
Surface bases have been sliding around, or sinking into terrain, or jumping off the ground forever: Longstanding oft complained about bugs, still not properly fixed.
Need I continue? I have plenty more...

Share this post


Link to post
Share on other sites
38 minutes ago, MaxPeck said:

A bugless release is a near impossibility for any software product.  There are entire YouTube channels devoted to finding and exploiting bugs and glitches in AAA titles by top tier studios.  I'm not saying we haven't seen some slipshod shenanigans in the past, I'm just saying don't set the bar too high on your expectations, there.

You are right of course. 

But (yes, there’s a but ;)), some of these problems are very low hanging fruit. 

Let me turn it around: The new BG grip pads use custom set PhysicMaterial settings. That’s 2-4 numbers (bounciness, grip while moving, grip while stopped) and 2 variables (whether to add, average, or use the min/max value between two objects that touch). 

This has been in the code for quite a while but was just never given a custom value for parts. 

How cynical would you become when you learn that you can get a part with these few lines added to their CFG for x dollars when the wheels and landing legs already in the game would function much better with the same few extra lines?

Remember: the underlying ‘module’ code is standard Unity engine stuff. It’s in the stock game where it gives every part the same value. The only thing between proper legs/wheels and you, are those few CFG lines. 

It makes me very cynical :/

Since Squad has access to the models themselves, they could even just select the ‘feet’ on the legs and give those a custom physicmaterial.

Is it asking for perfection to want them to do this for the parts they already sold us?

Share this post


Link to post
Share on other sites

Don't forget that increasing the grip of the landing legs would also mean increasing the chance of tipping over if you attempt to land without perfectly cancelling all your horizontal velocity first. 

These things almost always involve trade offs between realistic physics, fun gameplay (different people will have different expectations here), performance (simulating physics in one millisecond timesteps would probably improve realism even without other other changes, but would probably be much too cpu intensive for more than a tiny part count rocket/lander) and developer time.

Share this post


Link to post
Share on other sites
Posted (edited)
10 hours ago, AVaughan said:

Don't forget that increasing the grip of the landing legs would also mean increasing the chance of tipping over if you attempt to land without perfectly cancelling all your horizontal velocity first. 

These things almost always involve trade offs between realistic physics, fun gameplay (different people will have different expectations here), performance (simulating physics in one millisecond timesteps would probably improve realism even without other other changes, but would probably be much too cpu intensive for more than a tiny part count rocket/lander) and developer time.

 

This is false. The PhysicMaterial module specifically has two values for friction: Dynamic and Static. 

The Dynamic value determines grip while moving. 

The Static value determines grip while stationary. 

This makes it quite easy to keep the dynamic value at its default 0,4 but increase the Static value to something like 0,8. 

And presto. Once stopped, it’s a LOT less likely to slide. But while moving, it’s not going to tip over because a leg slightly touched the surface. 

Again: the code already exists. It’s literally just the values for the part CFG that are missing custom values. (Which means they all get the default 0,4 value.)

Here’s the API docs from KSP itself: https://www.kerbalspaceprogram.com/api/class_physic_material_definition.html

Its not a difficult compromise or hard to code. It’s right there. 

Edit: and here’s the official Unity documentation about what the PhysicMaterial class is for: https://docs.unity3d.com/Manual/class-PhysicMaterial.html

Edit2: the only thing preventing me from releasing a mod that fixes the stock landing legs friction is legal access to the model to tick the PhysicMaterial box for the ‘feet’. 

Do you still think it’s a matter of ‘too complex to solve in a game’?

Edited by Jognt

Share this post


Link to post
Share on other sites
7 minutes ago, Jognt said:

Its not a difficult compromise or hard to code. It’s right there.

Is it also easy to Module Manager config in? Or is it not in the part config?

Share this post


Link to post
Share on other sites
Posted (edited)
18 minutes ago, 5thHorseman said:

Is it also easy to Module Manager config in? Or is it not in the part config?

It should be easy to MM patch. Just check the Breaking Ground grip pads. 

Doing it this way applies it to the whole part though which isn’t a problem for small dedicated parts like those pads.

In order to give a specific part of a model a different grippiness ( like the feet on landing legs) you have to select the ‘feet’ and add it during import into unity afaik. So only Squad can (legally) do/distribute that. 

Edited by Jognt

Share this post


Link to post
Share on other sites
12 minutes ago, Jognt said:

Doing it this way applies it to the whole part though which isn’t a problem for small dedicated parts like those pads.

I don't really see an issue with the entire landing leg having high friction. If they're touching the ground it doesn't really matter if I'm sliding or not :)

Sadly, I looked in both landing leg and grip pad configs, and don't see anything related to friction. Drag? Yes. Friction? No. :/

Share this post


Link to post
Share on other sites
Posted (edited)
3 minutes ago, 5thHorseman said:

I don't really see an issue with the entire landing leg having high friction. If they're touching the ground it doesn't really matter if I'm sliding or not :)

Fair enough. If you give it a try, could you let me know the results?

I’m strangely hoping it doesn’t work this easily. Because it’d mean cynical me was wrong and I prefer being wrong over losing hope in humanity :(.

edit: if you’re running Kopernicus... You could give all planets a PhysicMaterial Static friction of 1. Any kerbal left on there would be stuck like a fly on .. fly tape. 

Or turn the moon into an ice skating ring. (Oh wait, that’s almost just the default setting)

Edited by Jognt

Share this post


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

The Dynamic value determines grip while moving. 

The Static value determines grip while stationary. 

So in that case, depending on how slow something needs to be moving before Unity/PhysX decides it is stationary, dynamic friction might not apply to cases where something lands on a slope and spends the next 20 minutes sliding to the bottom at 0.2 m/s.  

Share this post


Link to post
Share on other sites
11 minutes ago, AVaughan said:

So in that case, depending on how slow something needs to be moving before Unity/PhysX decides it is stationary, dynamic friction might not apply to cases where something lands on a slope and spends the next 20 minutes sliding to the bottom at 0.2 m/s.  

Don't forget: The surface of the planet you're on also has it's own PhysicMaterial.

How PhysicMaterials interact is also tweakable by a built-in setting. You can choose whether to average the values of the two contacting materials, add them up, use the highest number, or use the lowest number.

Here's the Unity description of Dynamic Friction:

Quote

A value of zero feels like ice, a value of 1 will make it come to rest very quickly unless a lot of force or gravity pushes the object.
- https://docs.unity3d.com/Manual/class-PhysicMaterial.html

So if something keeps moving to the point where Static Friction isn't applied, it's because the Dynamic Friction is set too low, or the method of combining them isn't right for the situation.

If you want to know why stuff in KSP likes sliding and why I'm so sure this can be remedied:

  • The default value KSP gives to PhysicMaterial (before Breaking Ground) is 0,4.
  • The method of combining them is PhysicMaterial.average

This means that you can make a surface look as rough as you want, and you can land the roughest looking lander on it. But internally they will always have a Friction coefficient of 0,4.... On a scale of 0 - 1....

Contrary to the subject of the game: It's not rocket science.

Share this post


Link to post
Share on other sites
Posted (edited)
10 hours ago, 5thHorseman said:

I don't really see an issue with the entire landing leg having high friction. If they're touching the ground it doesn't really matter if I'm sliding or not :)

Sadly, I looked in both landing leg and grip pad configs, and don't see anything related to friction. Drag? Yes. Friction? No. :/

Huh.. Was that 2nd line there initially? *scratches head*

This is the bit in the lGripPad.cfg that sets the PhysicMaterial for the grip pad:

MODULE
{
	name = ModulePhysicMaterial
	activePhysicMaterialName = MediumGrip
	PhysicMaterialName = MediumGrip
	PhysicMaterialName = HighGrip
	PhysicMaterialName = ExtremeGrip
	PHYSICMATERIALCOLORS
	{
		MATERIALCOLOR
		{
			name = MediumGrip
			color = 1,1,1
		}
		MATERIALCOLOR
		{
			name = HighGrip
			color = 0.63,0.63,0.63
		}
		MATERIALCOLOR
		{
			name = ExtremeGrip
			color = 0.38,0.38,0.38
		}
	}
}


Those PhysicMaterialName properties refer to the PhysicMaterial definitions in GameData\SquadExpansion\Serenity\Resources\PhysicsMaterials.cfg
Which look like this:

PHYSICMATERIAL_DEFINITION
{
  name = LowGrip
  displayName = #autoLOC_6011086 //Low Grip
  dynamicFriction = 0.1
  staticFriction = 0.1
  bounciness = 0
  frictionCombine = Maximum
  bounceCombine = Average
}


I've done some basic testing and this simple MM patch adds PhysicMaterial settings to the small landing legs (or rather, a cloned version of it)

+PART[miniLandingLeg]
{
	@name = miniLandingLegTest
	@title ^= :$: - Testing:
	@MODULE[ModuleWheelSuspension]
	{
		%autoSpringDamper = false
		%damperTweakable = 1.5
		%springTweakable = 3
	}
	MODULE
	{
		name = ModulePhysicMaterial
		activePhysicMaterialName = ExtremeGrip
		PhysicMaterialName = ExtremeGrip
		PhysicMaterialName = Default
		PHYSICMATERIALCOLORS
		{
			MATERIALCOLOR
			{
				name = ExtremeGrip
				color = 1,1,1
			}
			MATERIALCOLOR
			{
				name = Default
				color = 0.63,0.63,0.63
			}
		}
	}
}


You can ignore the ModuleWheelSuspension bit, that's just to set defaults to ease testing (placing and removing many legs and not having to manually tweak them all <3).

In my quick tests just now my rocket-propelled-rover-with-folded-legs-for-skids reached a staggering 6m/s on the stock legs, but didn't get much over 0.1m/s with the cloned+tweaked legs.
I added the Breaking Ground-added 'Default" material to the leg as well so I could confirm whether those are indeed the default settings (even when PhysicMaterial isn't explicitly defined) and for some strange reason that setting was equally grippy as the Breaking Ground-added ExtremeGrip setting..

So adding PhysicMaterial to existing parts is indeed a CFG tweak away from being a thing, but I think there is another  step to it. Maybe with regards to opening the model in Unity, but since I’m not a modeler, I can’t confirm that  

Squad however has the original models (and the legal rights to them) so making the legs (or even just the feet of the legs) grippy-er should be rather easy for them.

Squad. Pretty please with a cherry on top, polish these parts even though you're not getting new money for them? Please? Gesture of good will and such? Or is Take Two standing behind you so you don't spend time on not-making-money? Blink twice if so.

Edited by Jognt

Share this post


Link to post
Share on other sites

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.