Shadowmage

[1.7.x] KSPWheel - Physics Based Alternate Wheel Collider [API Only]

Recommended Posts

@Shadowmage having a case of brain fade, need a refresh, what is the required position for the (in unity) wheelcollider and suspension for KSPWheel,  fully compressed, mid travel, or full extent?  I 've got  an old problem returned and I'm sure its related. Cheers

Share this post


Link to post
Share on other sites
28 minutes ago, SpannerMonkey(smce) said:

@Shadowmage having a case of brain fade, need a refresh, what is the required position for the (in unity) wheelcollider and suspension for KSPWheel,  fully compressed, mid travel, or full extent?  I 've got  an old problem returned and I'm sure its related. Cheers

The wheel collider transform should be located at the top of its travel.  It will raycast downward from that location.

The suspension transform should also be located at the top of its travel.  It will be moved downward along the config specified axis.  There is also an 'offset' value that can be applied in the KSPWheelSuspension config to accommodate other configurations.

        /// <summary>
        /// The visual offset to the suspension transform compared to its default location and the wheel-colliders location.
        /// Positive values offset the transform -upwards-, negative values offset the transform -downwards-.
        /// </summary>
        [KSPField]
        public float suspensionOffset = 0f;

(the wheel collider is the more important one to position correctly; it too can be offset in the config if absolutely needed, but prefer to have it correct in the model)

(also remember that any colliders along the suspension path need to be tagged/layered for WheelColliderIgnore)

Share this post


Link to post
Share on other sites

@Shadowmage Hi , and thanks for your cfg tweaks and pointers,  it becomes so much easier when you know the rules.  Actually it'd be fair to say once you've actually made a track from scratch a couple of times it becomes pretty straight forward.  I'd say, that the modelling is slightly more difficult than wheels,  dman you skinned mesh render :), but the rigging is much easier, if you have it right in your modelling ap , it'll be right in game .


So in the end I went a little mad, having numerous tracked vehicles in my mods collection . thanks once again for a very cool plugin.


S3GBjM7.png

Edit

PS

Whats going on with scaling , there's some dark magic at work there :)

 

Edited by SpannerMonkey(smce)

Share this post


Link to post
Share on other sites
1 hour ago, SpannerMonkey(smce) said:

Whats going on with scaling , there's some dark magic at work there :)

Yes, yes there is....

What aspect are you interested in? (geometry/mesh scaling, plugin code-side mathmatical scaling, or the odd scale factors that are applied for speed/torque/mass/etc?)

 

Glad to see you got it all figured out though, and that there will be another place where I can send people looking for more track parts :)

Share this post


Link to post
Share on other sites
1 hour ago, SpannerMonkey(smce) said:

@Shadowmage Oi, e obrigado por seus ajustes e ponteiros, torna-se muito mais fácil quando você conhece as regras. Na verdade, seria justo dizer que, uma vez que você tenha feito uma trilha do zero, isso se tornará bastante fácil. Eu diria que a modelagem é um pouco mais difícil do que rodas, dman você skinned mesh render :), mas o rigging é muito mais fácil, se você o tiver certo em seu modelagem ap, ele estará certo no jogo.


Então, no final, fiquei um pouco louco, tendo vários veículos rastreados na minha coleção de mods. obrigado mais uma vez por um plugin muito legal.


S3GBjM7.png

Editar

PS

O que está acontecendo com a escala, há alguma magia negra no trabalho lá :)

 

Update ? :D

Share this post


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

geometry/mesh scaling, plugin code-side mathmatical scaling

Yes exactly that,  making some assumptions based on using KF originals.   I made the tracks X width,  fully expecting that when scaled to Y , X  would be about right for that purpose. However ( assumptions ftw) when they are scaled to Y , X does not appear to equal X + Scale= expected Y.   It looks like   X + some percentage of scale    It's something to do with the SMR i'm sure , but don't know what. SO in short making assumptions with tracks leads to unexpected results,  so any assumption prevention, even if i do barely understand it :)  would be great.

Share this post


Link to post
Share on other sites

IF the following is true, the track will show up in-game at exactly the same size as modeled/displayed in UnityEditor:

1.) All transforms in the model are set to scale = 1,1,1 (most important for the root transforms and any direct children).  This is a critical but often omitted step during modeling.  Scale should only not equal '1' if the part has in fact been re-scaled through plugin code.  Edit:  In Blender this is done in object mode by hitting CTRL-A and selecting 'Scale' -- I'm not sure what the equivalent would be in Max.
2.) 'scale' and 'rescaleFactor' are listed as '1' in the part config.

 

So basically, model it to the precise size you want, and set all 'scale' values to 1, and you should get exactly the size you modeled.

Edit2:  If the above info doesn't help solve the problem, feel free to hit me up in PM and we can work out what will be needed to get it working for you.  There really is some 'weird' stuff that goes on regarding scaling (esp if 'scale' and 'rescaleFactor' are used, even more so if the model isn't done with scale=1 at the transform level...), but I'm sure that we can figure it out knowing the existing inputs and desired outputs.

Edited by Shadowmage

Share this post


Link to post
Share on other sites

SInce installing this or Foundries 2 via CKAN for KSP version 1.4.3 I feel I have been having a lot of issues with wheel/springs wobbling with stock wheels during takeoff with planes on runways. I'm also using Kerbal Konstructs and Kerbin SIde and about 100 other mods, so I am never sure exactly what is wrong or which mod did what, but I am uninstalling this for now and seeing if things improve....

Thanks for all your modding hard work though @Shadowmage

Share this post


Link to post
Share on other sites
2 hours ago, JoE Smash said:

I feel I have been having a lot of issues with wheel/springs wobbling with stock wheels during takeoff with planes on runways.

This mod does not touch the stock wheels in any way, so I do not see how it could possibly effect craft using only stock wheels.  Certainly there are possibilities for errors if combining both stock and modded wheels on the same craft (stock wheels are like voodoo, and don't play nicely with anything else), but if using only stock wheels, I really cannot think of anything that may cause interference.

If you happen to narrow down the cause, and it is KF/KSPWheel, please let me know and I will make note and investigate further.

Share this post


Link to post
Share on other sites
4 minutes ago, Shadowmage said:

This mod does not touch the stock wheels in any way, so I do not see how it could possibly effect craft using only stock wheels.  Certainly there are possibilities for errors if combining both stock and modded wheels on the same craft (stock wheels are like voodoo, and don't play nicely with anything else), but if using only stock wheels, I really cannot think of anything that may cause interference.

If you happen to narrow down the cause, and it is KF/KSPWheel, please let me know and I will make note and investigate further.

Thanks m8, I am most likely wrong....I am pretty new to the game and probably have far too many mods to know what is doing what to whom, lol.....

Right now I am trying to clean up my mod list and prune things I don't really use much or need right now.....

Thank you for your quick reply.....it appears I am not even clear on what some of my installed mods do, I thought this wheel mod did to wheels what FAR does to all aerodynamics....like KSPWheel alters all wheel collisions in the game, whether you are using new tank treads or old airplane landing gear.....so my bad....

Share this post


Link to post
Share on other sites

Hi the oddness in scaling , I'm pretty convinced now was false observation, 16 sets in and  things are a lot clearer and more predictable, and for that matter a whole lot easier to do.  The only remaining oddness being the suspension stiffness  or lack of it, it very much seems that the larger i make the tracks the lower I have to set the spring rate in order to avoid the ground pounding effect,  I think it's just a matter of setting the right balance on the wheel collider settings,  but I'm still not familiar enough to get i in the ballpark at first go
. SO yeah all going well, and moving into  the wild and wonderful


VbjeKOX.png

unscaled btw :)

Share this post


Link to post
Share on other sites
25 minutes ago, SpannerMonkey(smce) said:

Hi the oddness in scaling , I'm pretty convinced now was false observation, 16 sets in and  things are a lot clearer and more predictable, and for that matter a whole lot easier to do.  The only remaining oddness being the suspension stiffness  or lack of it, it very much seems that the larger i make the tracks the lower I have to set the spring rate in order to avoid the ground pounding effect,  I think it's just a matter of setting the right balance on the wheel collider settings,  but I'm still not familiar enough to get i in the ballpark at first go
. SO yeah all going well, and moving into  the wild and wonderful


VbjeKOX.png

unscaled btw :)

Looking a bit ogrish. Nyrath would be proud.

Share this post


Link to post
Share on other sites
8 minutes ago, TiktaalikDreaming said:

Looking a bit ogrish. Nyrath would be proud.

A quick google later,  yup , proud and perhaps delighted

Spoiler

( 800mm 7000kg shell :) )

52Oin2Q.png


 

Share this post


Link to post
Share on other sites

Heads up -- I will be putting out an updated KSPWheel for KSP 1.5 sometime this week/week-end.

Will mostly be a recompile, but there are a few additional features and configuration options that will be exposed:

  • Per-part friction curve configuration
  • Toggle in KSPWheelTracks module to flip track texture direction (currently manual only; will add auto-flip for symmetry parts in the future)
  • Expose per-wheel-collider 'collider type', to allow use of 'sphere colliders' in places where they would be appropriate.

Share this post


Link to post
Share on other sites
3 hours ago, Shadowmage said:

Expose per-wheel-collider 'collider type', to allow use of 'sphere colliders' in places where they would be appropriate.

Oooh... You mean it may one day be possible to make a Rover?

 

Share this post


Link to post
Share on other sites
18 minutes ago, JH4C said:

Oooh... You mean it may one day be possible to make a Rover?

LoL, not even sure what that video is referring to....

But I'm referring to the 'shape' of the collider used in the sweep-test -- rather than using a 'raycast', the system can now optionally do a 'sphere-cast' -- so the collision detection has 'volume' beyond just a single point.

Allows stuff like (very early video from when I was first developing the colliders;  I used 'sphere' colliders for a long time during development):

 

Share this post


Link to post
Share on other sites
4 hours ago, Nightside said:

The balloon rover in that video is from a great old British tv show called The Prisoner.

I used to watch The Prisoner all the time when I was a kid and I don't remember that damned balloon thing.

I am fairly certain the reason for that is that it must have traumatized the **** out of me so badly that I blanked the memory.

Share this post


Link to post
Share on other sites

1.6 Update News:

I will hopefully be releasing an updated/recompiled version over the weekend.  The current releases may or may not work properly under 1.6 (untested yet).  Chances are that if the plugin loads up that everything else will work fine.

If the current versions do work, you may continue to use them without fear of breakage when the official update is available; there are no scheduled changes to the plugin aside from potential bugfixes.

Share this post


Link to post
Share on other sites
Posted (edited)

Updated release is available:

https://github.com/shadowmage45/KSPWheel/releases/tag/0.13.10.29

Recompiled for KSP 1.6 + .version file updated; no other substantial changes.  See link for downloads.

I'll be doing a pass over the code in the next few weeks to see if I can track down and remedy the issue of excessive memory use/garbage generation.  Thinking it is in the dust/audio code somewhere, as the sim side of things looks clean from a mem-allocation perspective.

Edited by Shadowmage

Share this post


Link to post
Share on other sites

If I install KSPWheel mod. It will apply to the stock wheels?

Share this post


Link to post
Share on other sites
9 hours ago, Locob said:

If I install KSPWheel mod. It will apply to the stock wheels?

Not by default.  You can try the unsupported stock-parts patches, which can be found here (download the .cfg files, put them in a folder in your GameData) -- https://github.com/shadowmage45/KerbalFoundries2/tree/master/KerbalFoundries-Patches/Stock

But please keep in mind they are currently unsupported for a reason -- I haven't had time to review or fix issues with them in quite some time.  As far as I know they work, but I could not tell the extent of any issues that might be present.

Share this post


Link to post
Share on other sites
On 1/17/2019 at 11:49 AM, Shadowmage said:

download the .cfg files, put them in a folder in your GameData

I guess  after the mod in a separated folder,  like "GameData/newsuspension/files.cfg" seems simple enough. thanks!

I will let you know of problems for the case if you want to review it.

Edited by Locob

Share this post


Link to post
Share on other sites

@Shadowmage

I was wondering if it would be possible to have gear deployment optionally cost/use resources namely EC? Kinda of niche, but I use a failure mod which can result in loss of EC in batteries and/or EC generation from the engines. If it cost EC to deploy gear it would lead to an emergency landing scenario. Again a niche request but that what why I ask. Thanks!

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.