Jump to content

[1.0.x] [V1.9f] Kerbal Foundries wheels, anti-grav repulsors and tracks


lo-fi

What to work on next?  

1,282 members have voted

  1. 1. What to work on next?

    • More wheels
      123
    • More tracks
      453
    • Rover bodies
      241
    • Landing gear
      137
    • Landing legs
      108
    • Something completely different
      193


Recommended Posts

It's awesome to see you guys lo-fi and Shadowmage cooperating :)

From the performance point of view it's great that you will be able to choose wheel collider type since some people might want better behaviour on rough terrain / when driving on other vehicles / objects. Whereas others (such as me :)) will seek maximum performance and wheel colliders that take least amount of cpu resources in scenarios with 100+ wheels and multiple vehicles :) (inb4 megabases :))

Link to comment
Share on other sites

10 hours ago, riocrokite said:

It's awesome to see you guys lo-fi and Shadowmage cooperating :)

From the performance point of view it's great that you will be able to choose wheel collider type since some people might want better behaviour on rough terrain / when driving on other vehicles / objects. Whereas others (such as me :)) will seek maximum performance and wheel colliders that take least amount of cpu resources in scenarios with 100+ wheels and multiple vehicles :) (inb4 megabases :))

Shadowmage is doing some amazing work, for sure. I'm struggling with a back problem, which means I'm not able to sit for extended periods and is holding me up somewhat! 

There's certainly some opportunity for performance optimization. Static wheels could probably be made to skip large parts of their update routines, which would save some processing cycles. 

I ought to look into Ferram's multi thread thing and see if that's possibly any use too, but that's a way away. 

As ever, thanks for keeping the faith!

Link to comment
Share on other sites

On Saturday, June 18, 2016 at 0:48 PM, lo-fi said:

Shadowmage is doing some amazing work, for sure. I'm struggling with a back problem, which means I'm not able to sit for extended periods and is holding me up somewhat! 

There's certainly some opportunity for performance optimization. Static wheels could probably be made to skip large parts of their update routines, which would save some processing cycles. 

I ought to look into Ferram's multi thread thing and see if that's possibly any use too, but that's a way away. 

As ever, thanks for keeping the faith!

Ouch, hope you get well soon; back problems are never any fun.

 

Still have not been able to find any truly workable solutions for bump-stop or sticky-friction setups. 

My current line of investigation is on using actual colliders for these purposes; for bump-stop/over-compression prevention they work well for stopping the compression, however I have not yet found a way to derive what suspension force should be used in such situations (have some ideas to investigate though).  For sticky friction they also work well; the problem then becomes how to allow the suspension to still function; they could potentially be 'lowered into place' when sticky friction needs to be enabled (thus effectively disabling the suspension)... the problem then is detecting when they should be removed and the suspension (and dynamic friction) restored.  However, using real colliders does appear to be the best solution for 'locked suspension' for landing gear and the like.

The other problem that I'm encountering, as far as implementation in KSP is concerned, is regarding damping ratios.  Anytime I set up the damper coefficient to be anything close to 'critically damped' the entire system begins jittering and oscillating; this problem does not manifest in my test cases in the Unity-Editor, so I'm thinking that it is being caused by the fixed-joints between the wheel parts and the fuselage part(s).  Will be putting together some jointed-rigidbody vehicle test cases in the Unity editor to see if I can duplicate the problem there, and how/where best to solve it.

At least the friction model seems to work well for dynamic friction, and the suspension works well for the most part :)   (still some quirks regarding instant-compression resulting in very large forces... but apparently this is also a problem with the U5/physx wheel-collider setup....).

Link to comment
Share on other sites

Okay... so more investigation:

Can confirm that the oscillation problems as seen in KSP are caused by the physics joints between the wheel part and the body, specifically when the wheel-parts' rigidbody mass is a small fraction of the mass of the main body part (as is typical for wheels...).  Anytime damping approaches critical (c > ~0.6) it begins a harmonic feedback cycle that results in oscillations.  This could, in theory, be solved by better integration methods (smaller time-step for wheel physics/spring/damper integration)... however that kind of setup is not available to scripts.

Indeed, testing at 1000hz (timestep of 0.001), and everything is buttery smooth even at critical damping (c >=1 ) with vastly disproportionate masses between the wheel rigidbodies and the fuselage rigidbody.  Sadly, the default of 50hz (step of 0.02) is simply not accurate enough to prevent these problems at the mass ratios present between normal fuselage and wheel parts.

So, with this knowledge, it is looking like a purely force-based approach (for suspension) is not going to work out well.  That leaves us with trying to come up with some sort of joint-based solution; this could be both good and bad...  Good in that it may offer more proper solutions to some of the problems, bad in that my knowledge on joints is limited and my experiences with them have not endeared me to them at all.

At least we know what direction to start investigating next; sadly this renders a good portion of the work done to-date as unusable.  Not starting completely from scratch... more like restarting at step 2 1/2...

Link to comment
Share on other sites

2 hours ago, Shadowmage said:

Okay... so more investigation:

Can confirm that the oscillation problems as seen in KSP are caused by the physics joints between the wheel part and the body, specifically when the wheel-parts' rigidbody mass is a small fraction of the mass of the main body part (as is typical for wheels...).  Anytime damping approaches critical (c > ~0.6) it begins a harmonic feedback cycle that results in oscillations.  This could, in theory, be solved by better integration methods (smaller time-step for wheel physics/spring/damper integration)... however that kind of setup is not available to scripts.

Indeed, testing at 1000hz (timestep of 0.001), and everything is buttery smooth even at critical damping (c >=1 ) with vastly disproportionate masses between the wheel rigidbodies and the fuselage rigidbody.  Sadly, the default of 50hz (step of 0.02) is simply not accurate enough to prevent these problems at the mass ratios present between normal fuselage and wheel parts.

So, with this knowledge, it is looking like a purely force-based approach (for suspension) is not going to work out well.  That leaves us with trying to come up with some sort of joint-based solution; this could be both good and bad...  Good in that it may offer more proper solutions to some of the problems, bad in that my knowledge on joints is limited and my experiences with them have not endeared me to them at all.

At least we know what direction to start investigating next; sadly this renders a good portion of the work done to-date as unusable.  Not starting completely from scratch... more like restarting at step 2 1/2...

Well, even if it's step 2.5, it still sucks. But you've still found generally useful info in the exploration, and I for one can use that info about masses and oscillations due to simulation frequency.  I'm personally surprised by how few dead-ends there've been in the work you and @lo-fi have done.  But my expectations are probably fairly pessimistic.  :-)

Link to comment
Share on other sites

Fear not - this is where my knowledge comes into play. I've probably got more experience than anyone in the KSP modding community when it comes to joints. I'd stopped that bit of my approach as it was appearing that yours was leading us to a solution, but I'll pick it back up. Squad struggled with wheels attached to small parts, and implemented some hack workaround which I'll try to dig up. We knew this would be difficult!

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

By the way, any estimates regarding the difficulty of porting old KF parts to the new system? Do they need more numbers, more modeling work, et cetera? Just trying to get an idea as to how much past the release of the new system one might look for the KF parts again.
Also, how does the implementation look for parts with multiple wheels, as in tracks or single steering parts with multiple suspensions?

Link to comment
Share on other sites

On 18/06/2016 at 8:42 AM, riocrokite said:

 

Ignore the blank quote, stupid forum wouldn't let me remove on mobile. 

Soon. Can't tell until we've completed the new collider, so it's done when it's done. 

Link to comment
Share on other sites

15 hours ago, lo-fi said:

Fear not - this is where my knowledge comes into play. I've probably got more experience than anyone in the KSP modding community when it comes to joints. I'd stopped that bit of my approach as it was appearing that yours was leading us to a solution, but I'll pick it back up. Squad struggled with wheels attached to small parts, and implemented some hack workaround which I'll try to dig up. We knew this would be difficult!

Indeed, and thanks :)

I think the friction model implementation is very workable, even at the standard 50hz.  And all that is needed for that to work is to know the down-force, which can be derived from the suspension compression and spring stiffness values.  The suspension-sweep setup should also still be usable with a joint-based implementation.  Most of the rest of the framework / code structure should be re-usable with a joint setup

So, all told, not too much code/time/effort has been lost; in actuality the suspension was one of the first, easiest, and fastest things that were implemented; probably a couple/few hours effort.  So perhaps not as tragic as I had thought at first.

Anyhow, I'm going to be heading out of town (camping trip) for most of the next week.  If there is anything you would like me to do with the existing code, please let me know.  I'll be around through tomorrow night, so have a bit of time to cleanup anything that is needed.  Don't strain/stress/break yourself any further though; if you need more time for recovery, by all means take it :)  The code will still be there when you (and I) return.

Link to comment
Share on other sites

1 hour ago, Shadowmage said:

Indeed, and thanks :)

I think the friction model implementation is very workable, even at the standard 50hz.  And all that is needed for that to work is to know the down-force, which can be derived from the suspension compression and spring stiffness values.  The suspension-sweep setup should also still be usable with a joint-based implementation.  Most of the rest of the framework / code structure should be re-usable with a joint setup

So, all told, not too much code/time/effort has been lost; in actuality the suspension was one of the first, easiest, and fastest things that were implemented; probably a couple/few hours effort.  So perhaps not as tragic as I had thought at first.

Anyhow, I'm going to be heading out of town (camping trip) for most of the next week.  If there is anything you would like me to do with the existing code, please let me know.  I'll be around through tomorrow night, so have a bit of time to cleanup anything that is needed.  Don't strain/stress/break yourself any further though; if you need more time for recovery, by all means take it :)  The code will still be there when you (and I) return.

Cheers dude, I'll see what I can so. Figured the grip model doesn't care what creates the suspension, and something I've not worked on at all. Minor setback.

I know I can get the joint based suspension working - it's just a matter or tweaking it. Tempted to re-release the repulsors first, as the don't need a grip model but could server as a useful "open beta" type test of the suspension while we finesse the grip stuff.

 

Have a great trip!

Link to comment
Share on other sites

I would try to test them out well if you do, I loved the repulsors, One of my favorites for messing with high speed ground vehicles, even though I -loved- the treads and the like for more practical stuff, the repulsors are just -fun- to mess with

Link to comment
Share on other sites

I'd be up for trying to break things again.  I've got more ideas in mind this time than previously, and I'm thinking some of them will put Kerbal Foundries to the test.  Especially because I'm being tormented by not being able to use enough wheels with stock KSP...

Link to comment
Share on other sites

hey hows the update going. has the 1.1.3 update helped in fixing the wheels/ i have been reading this forum for a while and saw you guys were getting close to cracking it it would be nice to know that wheels can now be fixed lol, i cant be bothed going back so far to see what i have missed so if you guys can fill me in on what the process has been going that would be nice thankS

Thanks

xD

FireStriker

Link to comment
Share on other sites

22 minutes ago, xD-FireStriker said:

hey hows the update going. has the 1.1.3 update helped in fixing the wheels/ i have been reading this forum for a while and saw you guys were getting close to cracking it it would be nice to know that wheels can now be fixed lol, i cant be bothed going back so far to see what i have missed so if you guys can fill me in on what the process has been going that would be nice thankS

Thanks

xD

FireStriker

Sorry, I can't be bothered writing a catch up for you.

Link to comment
Share on other sites

2 hours ago, xD-FireStriker said:

hows the update going

It seems to be going apace. Shadowmage has the friction sensible, lo-fi's suspension looks promising, et cetera.

2 hours ago, xD-FireStriker said:

has the 1.1.3 update helped in fixing the wheels

Probably not. 1.1.3 doesn't look like it's fixing wheels very much, and certainly not in the radical way the KF team are working on. 1.2 sounds like it might help with stock, what with the update from U5.2 to U5.4, but again, not much help for KF, since they're working basically from scratch.

Link to comment
Share on other sites

1 hour ago, 0111narwhalz said:

It seems to be going apace. Shadowmage has the friction sensible, lo-fi's suspension looks promising, et cetera.

Probably not. 1.1.3 doesn't look like it's fixing wheels very much, and certainly not in the radical way the KF team are working on. 1.2 sounds like it might help with stock, what with the update from U5.2 to U5.4, but again, not much help for KF, since they're working basically from scratch.

ok thanks 

Link to comment
Share on other sites

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