Jump to content

[Plugin/Parts] Kerbal Foundries - Continuation [Latest: 1.9g]


Gaalidas

Recommended Posts

1 hour ago, lo-fi said:

#KSPModders?

I was in #kspofficial and just came back from dinner. I'm idling in #kspmodders if you want to drop by.

1 hour ago, lo-fi said:

yes, that's really annoying. I'm not paying £30 for a copy of a game I already own so I can get the 1.1 beta or whatever it is. Sorry folks, it'll have to wait.

It's ok. I never expected to get KF running again so fast. 1.1 is only a few weeks (two?) away, so I don't mind waiting that time.

Edited by *Aqua*
Link to comment
Share on other sites

http://www.chiark.greenend.org.uk/~damerell/games/ksp/tracks/ is some plots of the floatcurves for the long tracks. (Many other KF parts are similar). I thought these might be interesting, particularly with a view to where the unexpected behaviour of floatcurves without tangents explicitly specified has bitten.

The torque curve is interesting. Generally I expect an electric vehicle motor [1] to produce constant torque from zero to moderate speed, then to drop off smoothly in a roughly constant-power fashion. (The Mole Tracks seem to have a configuration intended to do this (but bitten by the floatcurve shape)). If that were the case the speed-0 torque might also be lower, reducing the tendency to do wheelies.

I also think the existing "torque ratio" setting might be augmented with a "maximum torque" setting, to allow a part to give full power at high speeds but not to give full torque when starting. (This is much less of a problem with an analogue throttle, but I think it's reasonable to expect people to want to rove with the keyboard).

The rolling resistance (and load coefficient on a heavy vehicle) term is large and imposes a maximum speed well below the 35 m/s the torque curve would suggest. (Yes, the rev limiter also imposes a limit, but it's close to the effective RR limit). I think this is why KF vehicles stop so quickly without using the brakes. Ordinarily I'd expect air resistance to dominate at high speeds [2], with a vehicle intended for use in an atmosphere able to coast for a long distance on an airless world.

A few questions:
Wheel diameters are one of the things "baked" into the .mu file, right? I'm not missing something when I reverse-infer them from speed and reported RPM? Likewise, I think maximum suspension travel is baked in?
As I understand it, the generated torque figure is then applied to each wheel in a track (and from the game engine point of view a "track" is just a collection of wheels mounted line astern). Perhaps instead the torque should be calculated per-track and divided up between grounded wheels? This would simulate tracked vehicles' improved traction on poor surfaces.
Might the default suspension spring strength (and the range thereof) usefully be set higher? I've just been having a play and I wish now I'd set it higher during my Elcano circumnavigations. Also, do we know what the units are? (They're N/m in Unity 5 but that would make the KF values absurdly small, so I guess it's different in Unity 4. For that matter, I've blithely assumed motorTorque was still Nm in Unity 4...).
Does KF expose or adjust the Unity wheel collider suspension target distance? I don't think so (rideHeight just adjusts the maximum travel).
What's the github commit corresponding to the last working release? I guess it's sometime in late 2015. I set out to compile my own adding extra telemetry output and immediately fell afoul of not knowing which commit to compile; I think the reports in January of it not working with wheels sinking into the ground are from people who built it from later commits.
 

[1] Very small motors on unkerballed probes might have different behaviour.

[2] Mind you, I am a cyclist; bicycles, like railway trains, have very low rolling resistance.

Link to comment
Share on other sites

I forgot to say - part of the point of this rambling post is I think KF might define an electrically driven vehicle motor not with a torque curve but with a maximum torque, maximum power (equivalent to ElectricCharge/s), and rev limit alone.

Link to comment
Share on other sites

OK, thanks for the thoughts!

Before we go any further, I ought to point out that the wheel collider model in Unity is crude at best. "torque" isn't even what it says on the tin - it seems to be simply force applied at the contact point, and does NOT take wheel diameter into account. Yes, the wheel diameter is baked into the .mu, but really it's only for setting suspension limit and RPM calculation and seems to have no bearing on just about anything else. The magic "torque" force is applied against the mass you set in the wheel colliders property, NOT against the mass of the attached rigidbody, and I've no idea how it works against KSP's drag model either(!). Modifying the suspension spring strength range is trivial enough, and I apologise for oversights in the torque curve setups lacking tangents. My "model" if you can call it that is little more than a "that'll do", so I appreciate your efforts.

I had some ideas about how to deal with some of the wheel collider deficiencies, as well as performance issues associated with grabbing the mass value of the vessel to feed to them, but it'll take me a little while to get back up an running. 

With all the subsequent shenanigans with DustFX and various other refactors, I'm totally lost myself and getting back up to speed as best I can. Give "https://github.com/KerbalFoundries/KF_plugin/commit/e7aaaaf74a54f74d3125d375517f20e7e20d44c6"  a go.

Link to comment
Share on other sites

1 minute ago, lo-fi said:

Before we go any further, I ought to point out that the wheel collider model in Unity is crude at best. "torque" isn't even what it says on the tin - it seems to be simply force applied at the contact point, and does NOT take wheel diameter into account. Yes, the wheel diameter is baked into the .mu, but really it's only for setting suspension limit and RPM calculation and seems to have no bearing on just about anything else. The magic "torque" force is applied against the mass you set in the wheel colliders property, NOT against the mass of the attached rigidbody, and I've no idea how it works against KSP's drag model either(!). Modifying the suspension spring strength range is trivial enough, and I apologise for oversights in the torque curve setups lacking tangents. My "model" if you can call it that is little more than a "that'll do", so I appreciate your efforts.

I had some ideas about how to deal with some of the wheel collider deficiencies, as well as performance issues associated with grabbing the mass value of the vessel to feed to them, but it'll take me a little while to get back up an running. 

With all the subsequent shenanigans with DustFX and various other refactors, I'm totally lost myself and getting back up to speed as best I can. Give "https://github.com/KerbalFoundries/KF_plugin/commit/e7aaaaf74a54f74d3125d375517f20e7e20d44c6"  a go.

I have no idea how to do interspersed quoting on this annoying new forum, so I'm afraid this is all in one go.

Torque - oh. Well, it's just as easy to work with contact patch force, it's just a silly name Unity picked if that's so. I guess I'll try and determine the units by driving a massive vessel up a steep hill slowly.

Thanks for the suggested revision. I'll give that a bash.

Link to comment
Share on other sites

27 minutes ago, damerell said:

I have no idea how to do interspersed quoting on this annoying new forum, so I'm afraid this is all in one go.....

Just hit the (+) next to "quote" for each person you wish to quote. A small bubble will appear in the lower right corner of your screen with a number for how many quotes you are about to use. When you have them all click the bubble and start typing.

Link to comment
Share on other sites

3 minutes ago, V8jester said:

Just hit the (+) next to "quote" for each person you wish to quote. A small bubble will appear in the lower right corner of your screen with a number for how many quotes you are about to use. When you have them all click the bubble and start typing.

That's how to multiquote.

Link to comment
Share on other sites

10 minutes ago, V8jester said:

Well, I'm going to put myself on the chopping block and show my ignorance again... (I genuinely don't know) What's the difference?

I mean to reply to a single post in several quoted chunks, as one used to do in BBcode by editing QUOTE tags in for each chunk.

Link to comment
Share on other sites

27 minutes ago, damerell said:

I mean to reply to a single post in several quoted chunks, as one used to do in BBcode by editing QUOTE tags in for each chunk.

Off topic for the mod.... but highlight a block of text that you intend to quote; hover the mouse over it for a second, and a 'quote this' widget will pop up.  Click it to quite the highlighted portion of the text.

 

 

Edited by Shadowmage
Link to comment
Share on other sites

16 minutes ago, damerell said:

I mean to reply to a single post in several quoted chunks, as one used to do in BBcode by editing QUOTE tags in for each chunk.

Oh! Yeah now I ge it. Yeah the new forum just doesn't seem as versitle as the previous one. Thanks for straightening me out and puting me back on the tracks again :)

Link to comment
Share on other sites

1.1's Wheels are definitely much improved over 1.0.5 and earlier. People are complaining because they are so used to the bad wheels... like the graphics too. :D

Might be good to include something like stock or FAR aerodynamic display but for Wheels in future KF.

Edited by nli2work
Link to comment
Share on other sites

@nli2work
Sadly the new wheel system isn't that good. For example here the wheels are somehow pressed through the runway collider (look at the main gear). I would have accepted it if they just explode if they are too stressed but clipping is a no-go IMHO. I hope Squad is still working on it. It's a pre-release so things might change again.

Edited by *Aqua*
Link to comment
Share on other sites

2 minutes ago, *Aqua* said:

@nli2work
Sadly the new wheel system isn't that good. For example here the wheels are somehow pressed through the runway collider (look at the main gear). I would have accepted it if they just explode if they are too stressed but clipping is a no-go IMHO. I hope Squad is still working on it. It's a pre-release so things might change again.

Well I have faith you guys will once again reinvent the wheel, and blow our minds with holy rolly awesomeness!

I just hope you don't land yourself in a padded room trying to undo everything they have done this time around.

Link to comment
Share on other sites

19 minutes ago, *Aqua* said:

@nli2work
Sadly the new wheel system isn't that good. For example here the wheels are somehow pressed through the runway collider (look at the main gear). I would have accepted it if they just explode if they are too stressed but clipping is a no-go IMHO. I hope Squad is still working on it. It's a pre-release so things might change again.

I think that's just less than optimal settings on the wheel modules. The suspension spring ratio is too low on the landing gears. and stress settings are probably too high. And the friction curves are probably less than optimal, they all seem to be set to the default curve in ModuleWheelBase. Plus the landing gears has no additional colliders in the wheels, not surprising you can easily press it through another collider. 

Plus KSP has no physics material. the run way has same surface properties as the grass next to it. So you might get 100% real world accurate simulation on the wheel itself, but the rest of the world in KSP is still bonkers. :D

Edited by nli2work
Link to comment
Share on other sites

In my local install I modified the current code to run in 1.1. If compiles without flaws (but without a lot of stuff like GUI etc.) and runs fine so far.

Unfortunately the UnityEngine.WheelCollider is so bugged that there's no real hope. I attached 4 small wheels to a simple rover (I posted a picture of it before) and KSP can't decide how to orient the craft (flickers really fast between two orientations). Because of that phantom forces are added to the craft which eventually flips the craft into the air. Also driving didn't work but steering somehow created a force pushing the rover to sideways.

Also I'm not sure if VP interferes (doesn't look like it but who knows?).

[LOG 17:31:24.154] [FLIGHT GLOBALS]: Switching To Vessel Untitled Space Craft ---------------------- 
[LOG 17:31:24.156] setting new dominant body: Kerbin
FlightGlobals.mainBody: Kerbin
[LOG 17:31:24.159] Reference Frame: Rotating
[LOG 17:31:24.207] Vessel assembly complete!
[LOG 17:31:24.208] all systems started
[WRN 17:31:24.248] [Kerbal Foundries - KFModuleWheel]: Default part orientation.
[LOG 17:31:24.249] [Kerbal Foundries - KFModuleWheel]: Version: 1.9.5939.31392
[LOG 17:31:24.252] [Kerbal Foundries - WheelUtils]: 1
[LOG 17:31:24.253] [Kerbal Foundries - WheelUtils]: -7.510319E-08
[ERR 17:31:24.254] WheelCollider requires an attached Rigidbody to function.

[LOG 17:31:24.254] [Kerbal Foundries - KFModuleWheel]: Destroying Bounds.
[WRN 17:31:24.257] [Kerbal Foundries - KFSuspension]: TS Corrector: 1
[WRN 17:31:24.261] [Kerbal Foundries - KFModuleWheel]: Default part orientation.
[LOG 17:31:24.262] [Kerbal Foundries - KFModuleWheel]: Version: 1.9.5939.31392
[LOG 17:31:24.263] [Kerbal Foundries - WheelUtils]: -0.9999999
[LOG 17:31:24.264] [Kerbal Foundries - WheelUtils]: -7.510319E-08
[ERR 17:31:24.264] WheelCollider requires an attached Rigidbody to function.

[LOG 17:31:24.265] [Kerbal Foundries - KFModuleWheel]: Destroying Bounds.
[WRN 17:31:24.266] [Kerbal Foundries - KFSuspension]: TS Corrector: 1
[WRN 17:31:24.267] [Kerbal Foundries - KFModuleWheel]: Default part orientation.
[LOG 17:31:24.267] [Kerbal Foundries - KFModuleWheel]: Version: 1.9.5939.31392
[LOG 17:31:24.268] [Kerbal Foundries - WheelUtils]: 1
[LOG 17:31:24.269] [Kerbal Foundries - WheelUtils]: -7.510319E-08
[ERR 17:31:24.270] WheelCollider requires an attached Rigidbody to function.

[LOG 17:31:24.270] [Kerbal Foundries - KFModuleWheel]: Destroying Bounds.
[WRN 17:31:24.271] [Kerbal Foundries - KFSuspension]: TS Corrector: 1
[WRN 17:31:24.272] [Kerbal Foundries - KFModuleWheel]: Default part orientation.
[LOG 17:31:24.273] [Kerbal Foundries - KFModuleWheel]: Version: 1.9.5939.31392
[LOG 17:31:24.274] [Kerbal Foundries - WheelUtils]: -0.9999999
[LOG 17:31:24.275] [Kerbal Foundries - WheelUtils]: -7.510319E-08
[ERR 17:31:24.275] WheelCollider requires an attached Rigidbody to function.

[LOG 17:31:24.276] [Kerbal Foundries - KFModuleWheel]: Destroying Bounds.
[WRN 17:31:24.277] [Kerbal Foundries - KFSuspension]: TS Corrector: 1
[LOG 17:31:24.283] [FlightIntegrator]: Reloaded drag cube for zeroed cube root part landerCabinSmall on vessel Untitled Space Craft
[LOG 17:31:24.311] [Kerbal Foundries - KFModuleWheel]: Part Count 13
[LOG 17:31:24.312] [Kerbal Foundries - KFModuleWheel]: Checking vessel mass.
[LOG 17:31:24.314] [Kerbal Foundries - KFModuleWheel]: colliderMass: 0.6025
[LOG 17:31:24.314] [Kerbal Foundries - KFModuleWheel]: Part Count 13
[LOG 17:31:24.315] [Kerbal Foundries - KFModuleWheel]: Checking vessel mass.
[LOG 17:31:24.316] [Kerbal Foundries - KFModuleWheel]: colliderMass: 0.6025
[LOG 17:31:24.317] [Kerbal Foundries - KFModuleWheel]: Part Count 13
[LOG 17:31:24.318] [Kerbal Foundries - KFModuleWheel]: Checking vessel mass.
[LOG 17:31:24.319] [Kerbal Foundries - KFModuleWheel]: colliderMass: 0.6025
[LOG 17:31:24.319] [Kerbal Foundries - KFModuleWheel]: Part Count 13
[LOG 17:31:24.320] [Kerbal Foundries - KFModuleWheel]: Checking vessel mass.
[LOG 17:31:24.321] [Kerbal Foundries - KFModuleWheel]: colliderMass: 0.6025
[LOG 17:31:24.339] [Kerbal Foundries - WheelUtils]: 1
[LOG 17:31:24.340] [Kerbal Foundries - WheelUtils]: -7.505278E-08
[LOG 17:31:24.341] [Kerbal Foundries - KFModuleWheel]: colliderMass: 0.6025
[LOG 17:31:24.342] [Kerbal Foundries - WheelUtils]: -0.9999999
[LOG 17:31:24.343] [Kerbal Foundries - WheelUtils]: -7.505278E-08
[LOG 17:31:24.344] [Kerbal Foundries - WheelUtils]: 1
[LOG 17:31:24.344] [Kerbal Foundries - WheelUtils]: -7.505278E-08
[LOG 17:31:24.345] [Kerbal Foundries - WheelUtils]: -0.9999999
[LOG 17:31:24.346] [Kerbal Foundries - WheelUtils]: -7.505278E-08
[LOG 17:31:24.721] Loading Depletion Nodes
[LOG 17:31:24.721] DepNodeCount:  0
[LOG 17:31:24.722] Loading Biome Nodes
[LOG 17:31:24.723] BiomeNodeCount:  0
[LOG 17:31:24.723] Loading Planet Nodes
[LOG 17:31:24.724] PlanetNodeCount:  0

......

[LOG 17:31:24.873] Cannot assign AudioClip 'KerbalFoundries/Sounds/wheel' to AudioFX
[LOG 17:31:24.875] Cannot assign AudioClip 'KerbalFoundries/Sounds/wheel' to AudioFX
[LOG 17:31:24.877] Cannot assign AudioClip 'KerbalFoundries/Sounds/wheel' to AudioFX
[LOG 17:31:24.879] Cannot assign AudioClip 'KerbalFoundries/Sounds/wheel' to AudioFX

(small bug, name's "wheel2")
 
.....
 
and that's it, nothing more

I'm not sure how to attach a rigidbody to a wheelcollider. The WheelCollider.AttachedRigidBody property is read-only.

I need to read the modder's info on 1.1 again.

Edited by *Aqua*
Link to comment
Share on other sites

3 hours ago, *Aqua* said:

@nli2work
Sadly the new wheel system isn't that good. For example here the wheels are somehow pressed through the runway collider (look at the main gear). I would have accepted it if they just explode if they are too stressed but clipping is a no-go IMHO. I hope Squad is still working on it. It's a pre-release so things might change again.

Ummm, Squad has said that the wheels are a work in progress.  This is a beta pre-release, don't expect everything to work.  The whole idea behind this was twofold:

  1. Allow a larger audience to test and report bugs
  2. Allow mod authors to get their mods updated

 They are aware of the issues, you can see for yourself at bugs.kerbalspaceprogram.com

 

Link to comment
Share on other sites

A few thoughts:

The new Squad wheel system won't handle tracks or any of the other more advanced features and parts I put in KF.

U5 wheel colliders are "odd", according to the reading I've done. But can be made to work.

Eddy's Vehicle Physics is, apparently, only $60. It's a tempting purchase to see what fixes he's made and squad will have bundled into KSP. Maybe a donation button to help cover the cost of this might be an option?

Working directly with wheel colliders in U5 to get used to the new behaviour may be fruitful. Dev cycle in KSP is so painfully slow, it's worth spending a little time on.

As I think I said before, I'm happy to handle this side of it. GUI, dust, release, support etc. I'll leave up to the rest of the team, if that's OK?

Link to comment
Share on other sites

49 minutes ago, lo-fi said:

As I think I said before, I'm happy to handle this side of it. GUI, dust, release, support etc. I'll leave up to the rest of the team, if that's OK?

So you're back?

cm-23138-050624abe3a9e6.jpeg

Ok, then I'll have a look at the new GUI and figure out how it can be done not using Asset Bundles. I've read that getting Asset Bundle GUIs and code working together only works in very simple cases.

I don't know complicated it will be to get Dust working again. IIRC Visual Studio mostly complains about missing RigidBody and Renderer properties. They are moved somewhere else. But without working wheels it'll be hard to debug. ;)

 

Quote

Eddy's Vehicle Physics is, apparently, only $60. It's a tempting purchase to see what fixes he's made and squad will have bundled into KSP. Maybe a donation button to help cover the cost of this might be an option?

I'm not sure about asking for money. I'd like to stay away from donating etc. because I fear it's going to become work instead of being a hobby.
But yes, someone has to pay for that (if you really need it).

Link to comment
Share on other sites

58 minutes ago, lo-fi said:

A few thoughts:

The new Squad wheel system won't handle tracks or any of the other more advanced features and parts I put in KF.

U5 wheel colliders are "odd", according to the reading I've done. But can be made to work.

Eddy's Vehicle Physics is, apparently, only $60. It's a tempting purchase to see what fixes he's made and squad will have bundled into KSP. Maybe a donation button to help cover the cost of this might be an option?

Working directly with wheel colliders in U5 to get used to the new behaviour may be fruitful. Dev cycle in KSP is so painfully slow, it's worth spending a little time on.

As I think I said before, I'm happy to handle this side of it. GUI, dust, release, support etc. I'll leave up to the rest of the team, if that's OK?

I'm willing to help with some of the grunt work. And I could chip in a few bucks. I'm just grateful you stuck around Lo-fi

Link to comment
Share on other sites

2 minutes ago, *Aqua* said:

So you're back?

Hehe. Yeah, at least until it's all working again :)

Point taken about asking for donations, but there's a fairly clearly defined "This is something that would be really useful - it costs this much", rather than an open ended "please buy me a coffee, thank you :)". Bit like a mini crowd fund, I guess.

I'll start messing in U5 getting to grips with the new colliders - I'll leave the other bits to you for the moment. You might find you have to assign the rigidbody instance from the part to the emitter or something silly like that. I used to just watch a few tutorials and mess about until it worked when faced with something like that.

Thanks @V8jester , appreciate it.

My plan is to build something in U5 that approximates a KSP craft with wheels that I can use for testing, complete with "parts" connected with physics joints and all that sort of jazz. It'll still be quicker than learning in KSP.

Link to comment
Share on other sites

Well, so far so good. I've made a crude (but working) car in U5 that approximates a KSP craft in its construction... which seems to be more than a lot of people before me have managed in U5.... Suspension behaves, it drives back and forth under command and the RPM readout seems to work fine. I'd even suggest that the grip model works much better than it used to! 10 (nameless units of torque) applied to a wheel of .5 radius accelerates much faster than with radius of 2, which is a step forward too.

I did have some funnies to start with, but that seems to be because the default values (particularly for suspension) are insane. No wonder people struggled. I may yet fall flat on my face, but I'm heartened by what I've seen so far.

Edited by lo-fi
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...