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

OK, was the dropped link right before you screen shotted and exited? I'm just working through the re-hitch method now, think I can make it more robust. This is a huge help!
There was a dropped link just before I exited, I think that screenie was from the first time though. I took a few of them during re-linking the dropped links and trying again.
Link to comment
Share on other sites

OK, got you. My program flow is a little shaky, I had a lot of problems finding the right instances of parts to recreate the joints with, and there was an issue with the re-hitch doing so multiple times, which will have really hammered your setup with that many trailers. I'll re-think it, though the version I've just posted may well help

Link to comment
Share on other sites

Still a bit flaky for general release, just a few more things to sort out before I tentatively send them out into the wild.

Challenge accepted, Darren, though I think I got away lightly with the way the tracked trailers behave!!

Link to comment
Share on other sites

Haha, all in good time, Brutal!

No, it'll be part of KF, loler - it fits right in with rover parts. Since the last update, it's now much easier to release incremental updates with new parts as nothing will break.

Link to comment
Share on other sites

That's Puzzoverlord's collisionFX plugin, J.R.

Well, it functions, but I haven't managed to stop the scraping sound, or the index out of range message. I feel a major reorganisation and refactoring may be in order! It could certainly be improved by making better division between a collider hit and a wheel collider hit, though that aspect still confuses me in the code. Its seems to check for collision, then check if there's a wheel in the part. The spark check is just against whether or not you're on the PQS collider, which is cunning.

Link to comment
Share on other sites

Just a small note: I noticed that the small wheel and skid weights look kinda unbalanced. The Skid weighs 0.5, that is as much as a small fuel tank! Compared to the stock small wheel for example weights 10x less! Perhaps that needs some balancing!

Link to comment
Share on other sites

Remember that symmetry is rotational about the Y axis in KSP. It is not mirror symmetry. Unless you're using some of my tricks and making life very tricky ;)

The invisible objects are set to the wheelcollidersignore layer, which is why they're invisible. Best practice is to use separate GO's and primitive (box, capsule, sphere) colliders as children of the mesh (if it moves).

Also, pay attention to the transform directions with your LookAt constraints. Make sure Unity is set to Local and Pivot mode, rather than Global or Centre. They want to rotate around X, with Z looking at the target object. I tend to leave these until last, or it can get quite confusing. If the suspension isn't moving, make sure it's a child of suspensionTraverse.

Otherwise, nice work!

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

That's Puzzoverlord's collisionFX plugin, J.R.

Well, it functions, but I haven't managed to stop the scraping sound, or the index out of range message. I feel a major reorganisation and refactoring may be in order! It could certainly be improved by making better division between a collider hit and a wheel collider hit, though that aspect still confuses me in the code. Its seems to check for collision, then check if there's a wheel in the part. The spark check is just against whether or not you're on the PQS collider, which is cunning.

Wait, are you saying you haven't touched pizza's source? From what I've figured out, the wheel collision part (for the stock module only) is just to differentiate between the parameter for what sound to play. In my recompile I just let the KF wheels use their impact sound effect (defined in the CollisionFX config) but remapped the sound file to one more appropriate (the tire skid sound, I think) and it worked pretty good for impacting with the ground. Actual skidding is a little hard to achieve in KSP due to the way the wheels never really tend to lock while allowing the craft to slide. Instead it either flips or the wheel continues to turn slightly. The only thing I managed to do was stop the sparks from showing. That's it. My only idea now is that somehow the dust relies on the spark configuration to display properly, otherwise I see no reason why it wouldn't function. There is, however, another problem I had in where the plugin determines if the part is allowed to slide, or whatnot. I didn't see how that function actually did anything other than toggle whether or not the sound effect could be played, if defined, but I can't help wondering if somehow the sound is related to the particle and, if stopped, the particles will also refuse to emit.

It is all very confusing though. Some extra commenting and documentation in-line would be really nice.

Link to comment
Share on other sites

No, I played with the code. So far I just added a KSPField bool as an extra "do we want sparks in this part" and added an if() statement into the code. There seems to be something more at stake, though, or I wouldn't get the index out of range error that I haven't been bothered to hunt down thus far.

Link to comment
Share on other sites

Hmm, well, I don't know about the index thing, but there's a lot of stuff in there that specifically looks for the sparks being turned on for and effect to happen. I've been steadily finding all of those checks and adding another check for my parameter I added for adding only the dust and nothing more. I have yet to test tonight's edit of the code (while I was pretending to pay attention in DBA class) but I may have nailed it down further.

Still, at least you actually have the dust being emitted. All I managed to do is somehow make the sounds work, but none of the effects.

UPDATE: alright, so I decided it was getting too complicated to filter between scrapeSparks and dustEffects. So, I created a new field that I called "effectsOn" which defaults to true. "scrapeSparks" and "dustEffects" both default to true as well. This way, if you want everything turned on, you only have to define the module name and any sound effects that are needed. Maybe I'll try and default the sounds if I ever get this other stuff working so you only need to define them to override the default. As I have it now, instead of if/then checks against either/or (all variations of them, really annoying to set up) the two effect types, now it only checks initially for "effectsOn" to determine if it should allow collisions on that part to be handled by this mod or not. Only then does it check for the other two. The only way you get both sparks (and the sounds/lights to go with them) and the dust at the same time is if they both equal true (default), otherwise the effect that is false will be omitted.

Now, keep in mind I have yet to test this so no celebrating just yet. I'm feeling good about it though; it's the cleanest the code has looked since I started working on it a week or so ago. I'll keep y'all posted.

Edited by Gaalidas
Link to comment
Share on other sites

Update: Success... sorta. I got the dust to spawn, without the sparks or the scraping noises. However, I also got spammed with NullRefs due to, as far as I can tell, the definition for the "scapeSound" being null. I may have fixed that, will check later. If not, I also have an empty audio file on standby that I can define as the scape sound for the wheels. Next up will be trying to make it work on wheels that do not use the KF module type, but I may just leave that up to the original author of the mod to figure out in his own time. I only use KF wheels now anyway. All of this comes with no "index out of range" issues.

I'm still curious as to how you did it and why you were getting that error, but that's less urgent now.

- - - Updated - - -

I made the video, have fun:

Now THAT was epic. I was so glad when you showed off the action groups and the water repulsor parts. I was also impressed by the quality of the video. That's a rare thing, even with the higher-profile video posters. It really felt like it was right here on my monitor. Better, actually, since I cannot use shadows while still being able to move.

the good news is that the sparks should be fixed soon, if I can get the null refs under control. This is all assuming we can do a re-release of the mod, or package the edited version with KF... that stuff is all foreign to me. What I'd love to do, however, is find a way to keep the sparks for certain situations such as really hard impacts and/or the screw-drive when on hard surfaces.

Contrary to the original mod, I also switched out the water spray effect (just a different color for the dust when on the water) from the desert-dust to the arctic dust. I have yet to test this out at all, but I think it might look a bit better. I've also done an experimental definition for dust on Duna, using the desert dust preset, since the original mod had no settings for dust on non-Kerbin surfaces.

Good stuff coming in the future.

Link to comment
Share on other sites

That's brilliant, Space Scumbag! Thank you!

I'm thinking the best way to tackle CollisionFX is to get it 100% sorted, then do a pull request. Watching that video made me realise that the effects for wheels should be scalable, as the smaller tracks and wheels produce far too much dust. I'll have another go at my version over the weekend.

Dust colours for other planets sounds great, that's something I noticed myself. One thing that did occur me, was maybe it's possible to sample the actual colour of the terrain and make some assumptions based on that. I've not investigated that yet, though.

Link to comment
Share on other sites

lo-fi, is it possible that a wheel part has 2 wheel colliders? my test weren't positive in this aspect, so I don't know how to deal with multiple two-wheel part :/

also my some of my wheels get broken just after launch, any experience with that kind of behaviour (changed braking.... and crash stuff in cfg so dunno what might be the cause)

Link to comment
Share on other sites

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