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

Hi all,

LF Would it be possible to allow for multiple repulsors to be controlled by one RepulsorTest module? Or perhaps make it so that they are configurable in cfg the same way that you can add multiple wheels to one part in the Wheel module? In this case i would have no need for any adjustments apart from deploy retract. I am attempting to combine units to form a stable self contained platform and on deploy only one of the 4 units in this case deploy. May be a step to far within your framework, 'bout time i bit the bullet and have another look at this coding malarkey

Cheers

EDit ignore that, just looked at the cfg for repulsor test and see 3 wheels set up there. I shall persevere

Edited by SpannerMonkey(smce)
dummy
Link to comment
Share on other sites

Wow, seems like it's hit critical mass, I can't really keep up. People are talking about on Redit?? Busy for a few days IRL, and tidying up behind the scenes to speed the workflow.

We do seem to have a really good bunch of people discussing and contributing :)

Landing gear is on the list - I was going round Duxford museum on Sunday taking note of landing gear suspension designs. The air show was awesome too. Flush 'surface mount' repulsors will be available soon, they will mount like the linear RCS and come in a variety of sizes. I do have some ideas for a progressive 'cushion' effect too.

Multiple wheels on one part is easy, spanner. See the tracks in dev as well.

Speaking of which, having bypassed the tank steer mode of modulewheel, I now have properly controllable tracks. Rest of plugin now to write...

Apologies to anyone I've not got back to, I seem to be doing more communicating than creation at the moment :/

That and my mailbox is full _again_.

Link to comment
Share on other sites

I tried both a raycast method and the (what sounded like to me) crazy move-the-collider-under-you method. I had a hard time getting the right amount of force with the first method but the second method turned out surprisingly well...


public class OceanTest : MonoBehaviour
{
void Start()
{
FlightGlobals.ActiveVessel.rootPart.AddModule("ModuleWaterSlider");
}
}

public class ModuleWaterSlider : PartModule
{
GameObject _collider = new GameObject("ModuleWaterSlider.Collider", typeof(BoxCollider), typeof(Rigidbody));
float triggerDistance = 50f; // avoid moving every frame

void Start()
{
Log.Write("WaterSlider start");

var box = _collider.collider as BoxCollider;
box.size = new Vector3(200f, 5f, 200f); // probably should encapsulate other colliders in real code

var rb = _collider.rigidbody;
rb.isKinematic = true;

_collider.SetActive(true);

var visible = GameObject.CreatePrimitive(PrimitiveType.Cube);
visible.transform.parent = _collider.transform;
visible.transform.localScale = box.size;
visible.renderer.enabled = false; // enable to see collider

// Debug stuff
Action<Vector3, Color> createAxis = delegate(Vector3 axis, Color c)
{
var go = new GameObject();
go.transform.parent = _collider.transform;
go.transform.position = _collider.transform.position + axis * 25f;

var line = DebugVisualizer.Line(new List<Transform> { go.transform, _collider.transform }, 0.2f, 0.1f);
line.renderer.material = ResourceUtil.LocateMaterial("DebugTools.XrayShader.shader", "Particles/Additive");
line.renderer.material.color = c;
};


createAxis(Vector3.up, Color.red);
createAxis(Vector3.right, Color.blue);
createAxis(Vector3.forward, Color.green);

UpdatePosition();
}



void UpdatePosition()
{
Log.Write("Moving plane");

var oceanNormal = part.vessel.mainBody.GetSurfaceNVector(vessel.latitude, vessel.longitude);

_collider.rigidbody.position = (vessel.ReferenceTransform.position - oceanNormal * (FlightGlobals.getAltitudeAtPos(vessel.ReferenceTransform.position) + 2.6f));
_collider.rigidbody.rotation = Quaternion.LookRotation(oceanNormal) * Quaternion.AngleAxis(90f, Vector3.right);
}


void FixedUpdate()
{
if (Vector3.Distance(_collider.transform.position, vessel.ReferenceTransform.position) > triggerDistance)
UpdatePosition();
}
}
[KSPAddon(KSPAddon.Startup.Flight, false)]

So it could be made to work

Link to comment
Share on other sites

I tried both a raycast method and the (what sounded like to me) crazy move-the-collider-under-you method. I had a hard time getting the right amount of force with the first method but the second method turned out surprisingly well...

So it could be made to work

:cool: next feature will be open-up the sea for us to go through ? :D

This rover-robing-on-the-water is very cool ! We could have airboats soon.

@lo-fi: you'll need to buy a mailbox upgrade :P, by the way, it would be great to have enough to deal with all existing parts, at least.

Link to comment
Share on other sites

I tried both a raycast method and the (what sounded like to me) crazy move-the-collider-under-you method. I had a hard time getting the right amount of force with the first method but the second method turned out surprisingly well...

I was just saying, as I watched the video, "okay, that's all good... now lets see him stop. He'll never be able to... OH CRUD HE JUST STOPPED!!!"

So, yeah. That's nice.

Link to comment
Share on other sites

Wow, seems like it's hit critical mass, I can't really keep up. People are talking about on Redit?? Busy for a few days IRL, and tidying up behind the scenes to speed the workflow.

We do seem to have a really good bunch of people discussing and contributing :)

Landing gear is on the list - I was going round Duxford museum on Sunday taking note of landing gear suspension designs. The air show was awesome too. Flush 'surface mount' repulsors will be available soon, they will mount like the linear RCS and come in a variety of sizes. I do have some ideas for a progressive 'cushion' effect too.

Multiple wheels on one part is easy, spanner. See the tracks in dev as well.

Speaking of which, having bypassed the tank steer mode of modulewheel, I now have properly controllable tracks. Rest of plugin now to write...

Apologies to anyone I've not got back to, I seem to be doing more communicating than creation at the moment :/

That and my mailbox is full _again_.

Let this be a lesson to all you would-be plugin developers. If you like to work at your own, slow, easy pace and retain your sanity in your old age... RUN AWAY NOW!

Don't let me discourage you though, the rest of us want to see you go insane and, in the process, bring us these awesome mods. Besides, insanity is a gift. The Dwarves told me so, and they've never lied to me. The Gnomes are little liars though, watch out for them.

Link to comment
Share on other sites

Wow! I just discovered this gem of a mod, and my nerd-glee factor is through the roof! First off, the wheels are awesome! Secondly, the antigrav repulsors are beyond awesome, with all kinds of ways to tweak them for performance!

Intake > Cockpit > Fuel Tank > Jet Engine

Install repulsors, and go nuts! :confused::D

Link to comment
Share on other sites

Let this be a lesson to all you would-be plugin developers. If you like to work at your own, slow, easy pace and retain your sanity in your old age... RUN AWAY NOW!

Don't let me discourage you though, the rest of us want to see you go insane and, in the process, bring us these awesome mods. Besides, insanity is a gift. The Dwarves told me so, and they've never lied to me. The Gnomes are little liars though, watch out for them.

Ha! Wish you'd given me that tip before I embarked on this crazy journey ;) Never trust a gnome. I learned that very early on in life ;)

<img src="images/smilies/k_cool.gif" border="0" alt="" title="Cool" smilieid="15" class="inlineimg"> next feature will be open-up the sea for us to go through ? <img src="images/smilies/k_cheesy.gif" border="0" alt="" title="Cheesy" smilieid="14" class="inlineimg">

This rover-robing-on-the-water is very cool ! We could have airboats soon.

@lo-fi: you'll need to buy a mailbox upgrade <img src="images/smilies/k_tongue.gif" border="0" alt="" title="Tongue" smilieid="24" class="inlineimg">, by the way, it would be great to have enough to deal with all existing parts, at least.

I'll clear in a mo, sorry your messages have bounced!

I tried both a raycast method and the (what sounded like to me) crazy move-the-collider-under-you method. I had a hard time getting the right amount of force with the first method but the second method turned out surprisingly well...


public class OceanTest : MonoBehaviour
{
void Start()
{
FlightGlobals.ActiveVessel.rootPart.AddModule("ModuleWaterSlider");
}
}


public class ModuleWaterSlider : PartModule
{
GameObject _collider = new GameObject("ModuleWaterSlider.Collider", typeof(BoxCollider), typeof(Rigidbody));
float triggerDistance = 50f; // avoid moving every frame


void Start()
{
Log.Write("WaterSlider start");


var box = _collider.collider as BoxCollider;
box.size = new Vector3(200f, 5f, 200f); // probably should encapsulate other colliders in real code


var rb = _collider.rigidbody;
rb.isKinematic = true;


_collider.SetActive(true);


var visible = GameObject.CreatePrimitive(PrimitiveType.Cube);
visible.transform.parent = _collider.transform;
visible.transform.localScale = box.size;
visible.renderer.enabled = false; // enable to see collider


// Debug stuff
Action<Vector3, Color> createAxis = delegate(Vector3 axis, Color c)
{
var go = new GameObject();
go.transform.parent = _collider.transform;
go.transform.position = _collider.transform.position + axis * 25f;


var line = DebugVisualizer.Line(new List<Transform> { go.transform, _collider.transform }, 0.2f, 0.1f);
line.renderer.material = ResourceUtil.LocateMaterial("DebugTools.XrayShader.shader", "Particles/Additive");
line.renderer.material.color = c;
};




createAxis(Vector3.up, Color.red);
createAxis(Vector3.right, Color.blue);
createAxis(Vector3.forward, Color.green);


UpdatePosition();
}






void UpdatePosition()
{
Log.Write("Moving plane");


var oceanNormal = part.vessel.mainBody.GetSurfaceNVector(vessel.latitude, vessel.longitude);


_collider.rigidbody.position = (vessel.ReferenceTransform.position - oceanNormal * (FlightGlobals.getAltitudeAtPos(vessel.ReferenceTransform.position) + 2.6f));
_collider.rigidbody.rotation = Quaternion.LookRotation(oceanNormal) * Quaternion.AngleAxis(90f, Vector3.right);
}




void FixedUpdate()
{
if (Vector3.Distance(_collider.transform.position, vessel.ReferenceTransform.position) > triggerDistance)
UpdatePosition();
}
}
[KSPAddon(KSPAddon.Startup.Flight, false)]

So it could be made to work

Thank you yet again xEvilReeperx :D You were kind enough to help me through my initial hiccups and got me on the way, now I think you've just shown the way forward for walking on water! If you're happy, I'll grab the code and have a play to see what I can come up with for the repulsors. Absolute legend. If you have any more thoughts or come up with some refinements please let me know!

Anyway, going back to what Gaalidas said earlier, I need to go create... Spending a lot of time communicating, which is great, and the feedback is fantastic, but it's keeping me from getting parts into KSP and improving the current ones. Can I ask the guys who've been helping me with testing to keep a weather eye on the thread and answer minor support queries (as you've kindly been doing) while I take a step back and get some serious mod-making done? I have quite a job-list:

1) I need to complete the reorganisation of all the project files and get some stuff updated for Justin and a few other people playing with textures, then hopefully this can truck along without too much input.

2) The repulsor class needs a re-write with a few new ideas and integration of the water code. Surface mount repulsors need making too, and all this pretty much hinges on developing my new method of working without ModuleWheel.

3) I've made a bit of a breakthrough with the tracks, but the next stage is going to take some time. These should be seriously fun to use and hopefully look just as good!

4) Landing gear and legs: I have some wicked ideas I need time to work on.

5) The crab-steer mode I've been working on with Zodius. This is really cool and deserves some time spent to make it easy to use.

6) Anti-roll needs another serious look with kujuman's latest findings.

7) Height adjustment needs a proper working method. I'm thinking action group and maybe a 'set all' button.

So, like I said; I'm going to duck out temporarily, get my head down and churn out some parts :D Testing team, I'll be bunging parts into the dev repo when they're ready. Feel free to go nuts!

Lo-Fi out! (for the moment).

Link to comment
Share on other sites

Between new parts and 0.24, I don't know which I'll want to play with next :P

I'm actually considering avoiding 0.24 until all my major mods have been updated to work in it - that should give me time to play with this, but my work's gotten real heavy recently (just found out my manager was suspended so someone will have to take up the slack, yikes!) so we'll see. It's a busy time at house Owksp, that's for sure :P

Link to comment
Share on other sites

Re height adjustments of repulsors, the earlier mentioned experiment has proved successful, 8 repulsors combined into a single platform( reason for initial weirdness out of scale transforms :rolleyes:) Now in this combined form all repulsors operate together in deploy and retract mode, in that case would it not be possible, in the way the smooth steering looks for partners, for the repulsor control to look for other repulsor units and adopt them.

AND a big yay for water crossing solution (the hovercraft may not be dead after all)

Link to comment
Share on other sites

Re height adjustments of repulsors, the earlier mentioned experiment has proved successful, 8 repulsors combined into a single platform( reason for initial weirdness out of scale transforms :rolleyes:) Now in this combined form all repulsors operate together in deploy and retract mode, in that case would it not be possible, in the way the smooth steering looks for partners, for the repulsor control to look for other repulsor units and adopt them.

AND a big yay for water crossing solution (the hovercraft may not be dead after all)

Yeah, it's not difficult. Just needs a robust way to work.

Almost nailed the Ackerman steering, btw, which makes the crab steer mode much better.

Tracks are still proving tricky, though I'm waiting to hear back from squad about my big report on the tank steer mode.

Link to comment
Share on other sites

Could it be possible to add the respulsor ability to another part, which is not shaped like a wheel. Instead, you could remove the anchor and just leave the circle. THat way, you could attach it to any surface, for example, under the belly of your brand new pod racer?

:)

Link to comment
Share on other sites

Could it be possible to add the respulsor ability to another part, which is not shaped like a wheel. Instead, you could remove the anchor and just leave the circle. THat way, you could attach it to any surface, for example, under the belly of your brand new pod racer?

:)

Yeah, in working on a surface mount version that will mount like the linear RCS.

Anyone tested with .24 yet?

Link to comment
Share on other sites

You should see what the rear internal looks like! yes its one of my many unreleased toys, will quite happily let it out into the wild once I've done the command IVA, works super well with smooth steering wheels also.

Meanwhile on Topic Still no Krakens discovered and new test vehicle will touch 400ms on a 2mtr hover so I think I may have run them over instead.. muhwahahaha

Link to comment
Share on other sites

Lovely piece of work, buddy :D

400m/s?? Keep an eye in the dev repo, I've been tweaking the repulsor dynamics. More height, better stability. Wheels will get an update too once I've got the Ackerman nailed. Initial tests show significant improvement in handling. The maths involved is.... challenging for my rusty skills. I've never done so much trig in my life!

And thanks for testing in .24 :)

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

400m/s? -insert colorful metaphor here- That's like.... what in mph? I have no idea, but that's seriously scary. Also, upon looking at that rover I was already trying to figure out how you made it. It took me 20 seconds to realize it was a custom model. I want it, but it definitely needs the bells and whistles (and by that I mean IVA stuff).

Link to comment
Share on other sites

400m/s? -insert colorful metaphor here- That's like.... what in mph? I have no idea, but that's seriously scary. Also, upon looking at that rover I was already trying to figure out how you made it. It took me 20 seconds to realize it was a custom model. I want it, but it definitely needs the bells and whistles (and by that I mean IVA stuff).

400m/s (400 * 60 * 60) = 1440 Kmph = 894.775 Mph = 1.166180758 Mach

Link to comment
Share on other sites

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