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

Do these use electricity?

Also, maybe add a nice low humming noise, that has a higher over tone, like those new all electric harley davidson motor bikes. Some sweet noises, maybe if you could have them set to propel in any direction and you drive them like wheels, so you don't have to worry about RCS? Maybe even make a similar thing to them that uses the fuel RCS has, that gives them more oomph, so you can temporarily fly, but also use fuel, but if you don't fly too high/far the repulsors should keep you safe.

Driving them like wheels is a bad idea, if you haven't actually play with repulsors and drive some small "hovercraft" type vehicle like Florida's swamp boat/air boat, you can't have any idea how fun it is ! :cool: As you actually "brake" by turning to retrograde way or slowdown by turning +-90°, it's amazing !! Wheels are boring compare to that.

Also, just from judging the video, they seem a bit instant. Maybe if there was a 100-200ms delay, or some gradual force constantly being applied that took a slight amount of time, was to keep them up, it was seem more natural.

Not criticising this, it's beautiful, and amazing. Just adding some ideas :)

Good idea, something like stock jet engines lag on ignition/cooling down, with an emissive anim played forward/backward like heat anim and some sound.

Link to comment
Share on other sites

Just got a chance to look over this properly:

After some testing it looks like the colliders only get their values reset after they leave contact with the ground. Which...is weird.

Yes, that is strange.... I wonder if there's a good reason for that. It might explain the arbitrary nature of updates in KSP. I've noticed the value often gets updated if you drive around a bit, particularly off the side of the runway and back over. If you just sit there nothing ever happens. Maybe the simulation momentarily loses ground contact for a frame and that's when the update happens. I was hoping I could exploit this, but an enable/disablae wrecks everything.

As to the apply-a-counter-force option not working out for you, it does seem like this should be a proper way to do it. I think you were getting weird forces because of the " suspensionTravel" variable not staying where it's supposed to.

It took me a while thinking about this one, but it's actually wrong. The force method takes traction away from the outside wheel, as it tries to lift the lower side and push the higher side down and acts on the wheel as well. You might be tempted to think it would be a good thing, but result is rather variable (and strange!) turning characteristics. I'm not trying to build a simulation, but I hated the way things handled in KSP using that method. You need to increase the spring force on the outer side and lower it on the inner side for a dynamically effective method. This does apply a counter-rotational force to the vehicle, but the force acts upwards from the wheel contact with the ground in the opposite manner to applying a force to the whole vehicle as far as wheel contact is concerned. It's a subtle difference, but an important one...

suspensionTravel = (-mywc.transform.InverseTransformPoint(hit.point).y - mywc.radius) / mywc.suspensionDistance;

When I was testing the medium wheel, this line would return values between something like 1.06 and -0.06, and I think it should only return 0 -> 1?

Thanks, that's because I messed up a sign in that equation. I don't think that will have made much of an impact as the roll equation outputs a differential, but it's worth fixing.

I've not been able to actually test applying forces myself, but I hope this is promising research.

Thank you for your efforts, but I have a nasty feeling this one may be intractable with the limitations we have in the wheelcolliders. I might do some testing in Unity and ask on the Unity forum to see what else I can dig up. Certainly useful as it's made me think things through more thoroughly.

One other important thing you have highlighted is the list method which needs implementing.

Link to comment
Share on other sites

It took me a while thinking about this one, but it's actually wrong. The force method takes traction away from the outside wheel, as it tries to lift the lower side and push the higher side down and acts on the wheel as well. You might be tempted to think it would be a good thing, but result is rather variable (and strange!) turning characteristics. I'm not trying to build a simulation, but I hated the way things handled in KSP using that method. You need to increase the spring force on the outer side and lower it on the inner side for a dynamically effective method. This does apply a counter-rotational force to the vehicle, but the force acts upwards from the wheel contact with the ground in the opposite manner to applying a force to the whole vehicle as far as wheel contact is concerned. It's a subtle difference, but an important one...

So what needs to happen (for the outside turn wheels) is for the wheelcollider proper to be forced down with the same force as the attached rigid part is forced up. There is no net translation force on the vessel, the outside wheel increases its force on the ground, and the body of the vessel rolls towards the inside wheel. To check, this is the same net result as increasing the spring force? I think so.

I'm away from my development computer, but looking through the unity scripting API, there's an attachedRigidBody member of WheelCollider. I think for all intents and purposes that's the same as the main part collider. If you add a force to the attachedRigidBody and an equal and opposite to a force added to WheelCollder.collider (or whatever the actual wheelcollider is), this should produce the anti-roll behavio(u)r you're looking for. Of course, whether or not Unity lets you actually apply forces to these parts correctly is anyone's guess.

I hope this helps, and good luck.

If you need any help with lists, I can help, though they are pretty straightforward.

Edit:

I have a hard time judging dynamics (I don't know what the behavior should "feel" like), but here's a static test.

Javascript is disabled. View full album
Edited by kujuman
standby for testing results :D
Link to comment
Share on other sites

Hey low-fi, for that ground effect, ass seen in heligopters you should check out snjos firespitter thread. A long way back he showed some pogress of that, he also had an hover engine wip so you should wrte him a line :)

Link to comment
Share on other sites

ahh heligopters... the perfect merge between a helicopter and a...err... and a... okay, I've got nothing. What's a "gopter?" I should have thought about that more before posting. oh well, back to the "ol' drawin' board."

Link to comment
Share on other sites

Been having quite a bit of fun with the anti-grav units. The only 2 things I wish they had, and I discovered this while screaming along at nearly 200 m/s, would be an ability to float over water, and maybe a higher hover altitude. Smashing one's nose into the terrain at super high speed isn't exactly 'fun' and water is a definite hazard with these. But they're a lot of fun. Was sliding all around the KSC, I made a very-hard-to-control podracer with KAS and Quantum Struts, and I tried using 'em as landing gear for a plane with limited success. But I've enjoyed them so far.

Link to comment
Share on other sites

an ability to float over water, and maybe a higher hover altitude.

Water isn't going to happen. To quote lo-fi:

This isn't going to happen I'm afraid - closing. Making stuff float isn't too hard, but the game mechanic is not setup to allow colliders to recognise the water as something to collide with.

As for higher ride height, you should be able to set it.

Link to comment
Share on other sites

Been having quite a bit of fun with the anti-grav units. The only 2 things I wish they had, and I discovered this while screaming along at nearly 200 m/s, would be an ability to float over water, and maybe a higher hover altitude. Smashing one's nose into the terrain at super high speed isn't exactly 'fun' and water is a definite hazard with these.

One way is to add a repulsor/wheel in front/near the nose, I have also such "issue" when playing in the hills around the KSC. I have also suggest a repulsor designed to be surface attached on the bottom (kind of repulso-gear).

Hovering over water is a dead end cause of water nature in KSP.

Link to comment
Share on other sites

Fair enough on the water issue. I figured there'd be some reason why it is that lots of things just say "nope" when they touch water.

As for hover altitude, the current maximum setting isn't high enough for some of the craft I've been mucking about with. Flying off a small jump tends to smash up the vehicle on landing rather than decelerating it and catching it in a gentle hover.

Link to comment
Share on other sites

Water isn't going to happen. To quote lo-fi:
This isn't going to happen I'm afraid - closing. Making stuff float isn't too hard, but the game mechanic is not setup to allow colliders to recognise the water as something to collide with.

As for higher ride height, you should be able to set it.

Hum, the water height is perfectly known => body.Radius. I did not look into the code, but I don't see how hard that would be ...

Link to comment
Share on other sites

Hum, the water height is perfectly known => body.Radius. I did not look into the code, but I don't see how hard that would be ...

All of the parts (repulsor included) have a stock ModuleWheel which is a container for the WheelCollider and all of the physics associated with wheels. The custom PartModules attached to these parts modify that ModuleWheel. There may be a way to force the ModuleWheel to collide with the ocean's layer (though I think he'd have to do something like ocean.enableraycastcollisions), but a better bet would be to calculate and add an up force on the collider itself. This second way wouldn't get WheelHit information, but I don't think the repulsors use that method anyway.

So possible probably with enough work, but it's set up that way (AFAIK).

Edit:

A more hackish way that is so stupid it might work would be to dynamically create a collider at sea level under each wheel when over the ocean. I'm actually trying this now.

Edited by kujuman
Link to comment
Share on other sites

I leave you guys alone for a few hours.... :wink:

Hey low-fi, for that ground effect, ass seen in heligopters you should check out snjos firespitter thread. A long way back he showed some pogress of that, he also had an hover engine wip so you should wrte him a line :)

It works rather differently to my method... Which is basically just abusing the Unity physics objects and doesn't terrain follow as far as I know. Nice thought, though.

Been having quite a bit of fun with the anti-grav units. The only 2 things I wish they had, and I discovered this while screaming along at nearly 200 m/s, would be an ability to float over water, and maybe a higher hover altitude. Smashing one's nose into the terrain at super high speed isn't exactly 'fun' and water is a definite hazard with these. But they're a lot of fun. Was sliding all around the KSC, I made a very-hard-to-control podracer with KAS and Quantum Struts, and I tried using 'em as landing gear for a plane with limited success. But I've enjoyed them so far.

I've got some on the way which will help, as they track the terrain ahead and behind as well as below. Glad you're having fun, I'm still playing with the dynamics and how far I can push it without resorting to writing my own collider.. As I thin I mentioned before, the repulsors were born out of my work with wheels and a silly forum conversation. I had _no_ idea how popular they (or any of the bits I've been playing with) would be, I just posted up with the wheels because I thought it was a goofy enough to be fun(ny)! There are some custom collider projects in Unity, but I've seen none that are ready to be pugged in and 'just work' and I'm not experienced enough to write from scratch yet. Higher ride is rather unstable on smaller craft, so I've limited until I've got the new versions out.

Hum, the water height is perfectly known => body.Radius. I did not look into the code, but I don't see how hard that would be ...

All of the parts (repulsor included) have a stock ModuleWheel which is a container for the WheelCollider and all of the physics associated with wheels. The custom PartModules attached to these parts modify that ModuleWheel. There may be a way to force the ModuleWheel to collide with the ocean's layer, but a better bet would be to calculate and add an up force on the collider itself. This second way wouldn't get WheelHit information, but I don't think the repulsors use that method anyway.

So possible probably with enough work, but it's set up that way (AFAIK).

All absolutely true. I honestly have no idea how water works in KSP, and it's not documented. There are some bits in the API that deal with buoyancy, but that doesn't really help with running wheelcolliders across it - I don't believe there is appropriate collision material, or it's set to a layer the wheelcolliders ignore. If someone knows enough to get me started, I might be able to look into it, but for the moment I'm stumped :huh: I have a feeling this would be a 'write a collider from scratch' job - see above. Again, though, if someone can light the way I'm happy to look into it.

  • kujuman: I will get back you you re: anti roll. Requires a bit more thinking than after a few gins on a Monday night ;)

Link to comment
Share on other sites

Given that you always know the altitude of the ocean and you have a linecaster in the wheelcollider, it should be relatively trivial to determine where the wheel collider intersects with the altitude, and then generate a WheelHit artificially.

Link to comment
Share on other sites

A more hackish way that is so stupid it might work would be to dynamically create a collider at sea level under each wheel when over the ocean. I'm actually trying this now.

I kind of had that thought, but I had no real idea how to implement it. Interested to see if you can come up with something.

Link to comment
Share on other sites

I'm not sure you could go over water at all with any kind of fiddling. the only way you could do it is by having an invisible fixed path over the water (like how kerbcity puts static cities into the game) But remember, just because your craft is on a 'collider', doesn't mean your 'collider' is gonna float/move either.

let's not forget that planets are curved....even over water, so the 'platform' would have to move somewhat in 3 dimensions following only the surface of the water, otherwise you would eventually reach a point where you're below water or above it. It all just seems too technical and like it wouldn't work right or at all in the end.

people could always put thrusters on the side or underneath a craft and go over the water that way too. after all, if somethings got water to go over, its got an atmosphere to glide or fly through.

it could be more easily rectified with a separate 'flotation device' part that provides thrust, but that would still put geometry under the water somewhat, which would make transition from water to land probably difficult to impossible. the same goes for the transitions of using a 'collider' part to go from land to sea.

Edited by trekkie_
Link to comment
Share on other sites

Been having quite a bit of fun with the anti-grav units. The only 2 things I wish they had, and I discovered this while screaming along at nearly 200 m/s, would be an ability to float over water, and maybe a higher hover altitude. Smashing one's nose into the terrain at super high speed isn't exactly 'fun' and water is a definite hazard with these. But they're a lot of fun. Was sliding all around the KSC, I made a very-hard-to-control podracer with KAS and Quantum Struts, and I tried using 'em as landing gear for a plane with limited success. But I've enjoyed them so far.

For me it's that bold bit, that's 720Kmph or 450mph, it seems slow in KSP because of the featureless terrain and typical high view angle but if you put a camera on the craft near the ground it's a lot faster.

Link to comment
Share on other sites

I'm not sure you could go over water at all with any kind of fiddling. the only way you could do it is by having an invisible fixed path over the water (like how kerbcity puts static cities into the game) But remember, just because your craft is on a 'collider', doesn't mean your 'collider' is gonna float/move either.

let's not forget that planets are curved....even over water, so the 'platform' would have to move somewhat in 3 dimensions following only the surface of the water, otherwise you would eventually reach a point where you're below water or above it. It all just seems too technical and like it wouldn't work right or at all in the end.

people could always put thrusters on the side or underneath a craft and go over the water that way too. after all, if somethings got water to go over, its got an atmosphere to glide or fly through.

it could be more easily rectified with a separate 'flotation device' part that provides thrust, but that would still put geometry under the water somewhat, which would make transition from water to land probably difficult to impossible. the same goes for the transitions of using a 'collider' part to go from land to sea.

I think they're discussing a much more "hackjob" approach here, but one which has some serious merit. As far as I know, there are no "Death Valley's" in KSP, that is, dry land below sea level. Thus, as long as you know what sea level is defined as, it seems like it would be comparatively simple to create a conditional where the anti-grav collider treats sea level as solid ground, regardless of the actual ground level beneath. It would give the illusion of interaction with water without having to have the capacity to actually recognize water in any way.

Granted, I may be massively misunderstanding how colliders work, but at some point the system needs to be running a test to see where the ground is relative to the anti-grav unit, a test that should be possible to manipulate.

Something is wrong with the hover lifters. When I take my craft to the runway they randomly give out, and my craft is no longer balanced. Could you fix this?

I think you're running out of power. Check your electric charge first. The anti-grav units use a lot of electric charge relative to stock parts. (Understandably, but it can come as a surprise if you're not prepared for it)

Link to comment
Share on other sites

Oh, I know I was going really fast. I'm just saying, I was hurtling along at 200m/s and a little drop always proves fatal because there's no "gravitic cushion" to catch you. You drop below your hover height and the repulsors, or bits of your craft, hit the ground and break apart.

As for the water idea, it just made me think that if we could get the anti-grav working over water, I'd be interested in trying to ground/water-circumnavigate Kerbin.

I think the reason the repulsors have become so popular is because it's so Kerbal it actually makes sense. Here's a world where little green men blow themselves up trying to make it to space. A world where fusion reactors and gigantic batteries fit right in alongside those wooden parts you've strapped to the rocket, and yet here's a few small little pieces that help you fly across Kerbin (or Laythe, or the Mun, or Minmus) at stupidly high speeds in any random direction.

In other words: The repulsors are popular because it's something many people have wanted and few modders have gotten 'right' with their attempts. Some don't work, some act purely like hacked gravity. Yours work like wheels that go in every direction at once, yet manage to also be reasonably balanced by being power hungry.

Link to comment
Share on other sites

KillerRaccoon 1 point 3 hours agoDude. Wheels that can have a little slip angle, that looks so rad. My single biggest gripe with KSP is the runway wobbles from inelastic tires. I hope he makes some (attractive) lading gear as part of that mod.

your mod is getting alot of attention on reddit in /r/KerbalSpaceProgram that is one of the requests from a thread over there said i'd post it here so you could see it

Link to comment
Share on other sites

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