Jump to content

[WIP] ActiveStruts Dev Thread [updated 10.10.2014]


marce

What type of joints do you prefer?  

7 members have voted

  1. 1. What type of joints do you prefer?

    • all should be AttachJoints
      18
    • all should be ConfigJoints
      5
    • keep it as it is now (user's choice)
      66


Recommended Posts

Hi Sean,

at first sight it looks like a corrupt download (I should provide checksums sometime...). Please try downloading again.

Hope it works then, otherwise I'll have to do a bit of research :huh:

Downloaded it 3 times...

Even did a new download of the file (3rd time) for the clean install test, same outcome with all three tries.

Sorry to be a pain, I really appreciate all that you modders do and I don't want to cause any negativity in this thread, but I really want to get your mod working in my game.

Thanks again for all your help and your hard work on this mod.

Sean

Link to comment
Share on other sites

This is without a doubt the best strut mod I have ever used, awesome mate awesome

Glad to hear :)

Downloaded it 3 times...

Even did a new download of the file (3rd time) for the clean install test, same outcome with all three tries.

Sorry to be a pain, I really appreciate all that you modders do and I don't want to cause any negativity in this thread, but I really want to get your mod working in my game.

Thanks again for all your help and your hard work on this mod.

Sean

Damn it...

All I found was this which also points towards an invalid dll...

I just checked that I'm building against .NET 3.5 and for AnyCPU, so everything should be fine...

I uploaded you the dll only (fresh rebuild), please try that one.

For everything else I'll need the full logs, but to be honest, I don't really know what to look for, sorry... :(

Oh and a quick shot: In the log snippet you posted it seems as there's a space in the dll name (Failed to load assembly D:\KSP_win\GameData\ActiveStruts\Plugin\ActiveStru ts.dll:), maybe just a copy&paste error but hey :cool:

Edited by marce
Link to comment
Share on other sites

I uploaded you the dll only (fresh rebuild), please try that one.

For everything else I'll need the full logs, but to be honest, I don't really know what to look for, sorry... :(

Oh and a quick shot: In the log snippet you posted it seems as there's a space in the dll name (Failed to load assembly D:\KSP_win\GameData\ActiveStruts\Plugin\ActiveStru ts.dll:), maybe just a copy&paste error but hey :cool:

The new DLL did the trick, it loaded without error. I am playing with your mod now, very nice!

Thank you so much, I really appreciate the fast response and all your work on this.

Sean

Link to comment
Share on other sites

The new DLL did the trick, it loaded without error. I am playing with your mod now, very nice!

Thank you so much, I really appreciate the fast response and all your work on this.

Sean

Yeah! Glad it worked, what a strange error... Maybe the file on the server got corrupted somehow, I'll have to check if it happens again...

Anyway, have fun :wink:

Link to comment
Share on other sites

I'm stumped trying to track down a little bug I encountered yesterday.

I tried to hold the robotic arm from this craft in place using an Active Strut, but almost every time it links to something on the far side, it moves upon reload. I haven't been able to reproduce it with less complex crafts, but it doesn't seem to be directly related to TweakScale.

Steps:

  1. Load the above craft (requires IR Rework-Robotic & Grabber, Active Struts, & TweakScale)
  2. Straight-out link the strut – should attach to the grabber. (Edit: though I've had this issue without it touching the grabber)
  3. Save and reload the craft, or just launch it.

KSP 0.24.2 Mac OS X 10.9.4

Mods:

  • Active Struts 1.0rc1.2b
  • Infernal Robotics 18.6a
  • Infernal Robotics Rework Parts (latest)
  • TweakScale 1.43
  • Module Manager 2.3.1/2.3.2

Output log: Player.log

This may be the error:

Actor::updateMassFromShapes: Compute mesh inertia tensor failed for one of the actor's mesh shapes! Please change mesh geometry or supply a tensor manually!

(Filename: /Applications/buildAgent/work/3d1e9e6e6eefaa7f/SDKs/compiler/xcodeosx/../../Physics/src/NpActor.cpp Line: 134)

There are some other oddities in the log, because I removed SP+ and Firespitter to eliminate them as the cause and I quit with the keyboard shortcut rather than the menu.

Edited by Master Tao
Link to comment
Share on other sites

I'm stumped trying to track down a little bug I encountered yesterday.

I tried to hold the robotic arm from this craft in place using an Active Strut, but almost every time it links to something on the far side, it moves upon reload. I haven't been able to reproduce it with less complex crafts, but it doesn't seem to be directly related to TweakScale.

Steps:

  1. Load the above craft (requires IR Rework-Robotic & Grabber, Active Struts, & TweakScale)
  2. Straight-out link the strut – should attach to the grabber. (Edit: though I've had this issue without it touching the grabber)
  3. Save and reload the craft, or just launch it.

KSP 0.24.2 Mac OS X 10.9.4

Mods:

  • Active Struts 1.0rc1.2b
  • Infernal Robotics 18.6a
  • Infernal Robotics Rework Parts (latest)
  • TweakScale 1.43
  • Module Manager 2.3.1/2.3.2

Output log: Player.log

This may be the error:

Actor::updateMassFromShapes: Compute mesh inertia tensor failed for one of the actor's mesh shapes! Please change mesh geometry or supply a tensor manually!

(Filename: /Applications/buildAgent/work/3d1e9e6e6eefaa7f/SDKs/compiler/xcodeosx/../../Physics/src/NpActor.cpp Line: 134)

There are some other oddities in the log, because I removed SP+ and Firespitter to eliminate them as the cause and I quit with the keyboard shortcut rather than the menu.

Ok, so here are my findings so far:

  1. Yes, you found a bug.
  2. This happens with QuantumStruts as well, so I suppose this Actor::updateMassFromShapes error is caused by creating a Joint with the grabber part.
  3. Why this happens I really don't know. To be honest, I don't even know exactly what a mesh is :blush:
  4. The misalignment is a different problem. It also happens if you connect to the structural panel.
  5. Once again I don't know why, I don't get any error messages logged.

So this is my conclusion:

There is a solution which would fix the following problems:

  • Misalignment of FreeAttach links
  • Adding a module to every part in the game
  • Physical nonsense of FreeAttach links being actually joint to the origin of the target part instead of the position you see it connected to.
  • A performance hit due to constant Raycasting.
  • And most probably also this Actor::updateMassFromShapes

If I know how to create a perfect world (or at least think it would work as expected) why didn't I do it right away? Simple answer: I still have no idea how. Not even where to start.

What I want to achieve in the end is to spawn a small object and surface-attach it to the part at the position in question (when placing any FreeAttach link of course) then simply link to this part. It may even be possible to have it physicless. This should solve all the aforementioned problems. And when the link is destroyed the part can be removed and deleted again. Imagine the hooks to be this part, if everything goes as I imagine the only noticeable thing should be that you could click on it then, but I may as well add an "Unlink" action there, shouldn't be a big problem.

And here are my problems:

  • For attaching a part I could look at KAS, but I'm worried about the license, can't actually take it from there. Maybe RoverDude's GrabbyStuff will have the feature and he'll surely allow me to use his code because he's awesome.
  • The second problem is how to spawn a part. While thinking over it the Hangar mod came to my mind. It didn't exist when I started AS, but now it does. I'll check its license later today and maybe I'll find what I'm looking for.
  • If I know how to do it AS need quite a rewrite, but should turn out simpler and more stable in the end.

So i decided not to try and once again patch something in that fixes the misalignment only in some cases but still leaves holes in the experience. I'll persuade the new approach which I think is better. If I'm wrong we still can revert and I can go crazy. Until then I'll ask all testers to rely on the grappler-grapple connection types since those have to be super stable, otherwise the new approach will suffer from at least the same flaws. You should be able to use FreeAttach while the current scene is loaded, it usually fails only on reconnect (so after a reload of the craft).

I hope that you can understand my decision!

Link to comment
Share on other sites

@Hellbrand:

marce posted a video a while back. That post has been buried. Basically, these struts can be moved and replaced. They're similar to QuantumStruts because you don't need to EVA adjust them and they can attach to anything. They're also like KAS Struts because they can attach in any direction, they can use an endpoint (the Grapple makes them stronger), and they actually break if you push them too hard.

I hope that you can understand my decision!

Absolutely. :) Sounds like it's more work to find and fix than it's worth.

Also: polygon mesh. They're the basic representations of 3d shapes. The logged error is related to the collision mesh, which is a simplified version used to make rigid-body physics calculations easier. It's probably what ZodiusInfuser said – IIRC, KSP doesn't handle concave collision meshes.

Link to comment
Share on other sites

Also: polygon mesh. They're the basic representations of 3d shapes. The logged error is related to the collision mesh, which is a simplified version used to make rigid-body physics calculations easier. It's probably what ZodiusInfuser said – IIRC, KSP doesn't handle concave collision meshes.

Unfortunately for most of the parts, especially the new Foldatrons, I have no option but to use Concave meshes. They're also the only way to do things like cargo bays :(, unless you aproximate the shape with lots of cubes.

Link to comment
Share on other sites

@Hellbrand:

marce posted a video a while back. That post has been buried. Basically, these struts can be moved and replaced. They're similar to QuantumStruts because you don't need to EVA adjust them and they can attach to anything. They're also like KAS Struts because they can attach in any direction, they can use an endpoint (the Grapple makes them stronger), and they actually break if you push them too hard.

Absolutely. Sounds like it's more work to find and fix than it's worth.

Also: polygon mesh. They're the basic representations of 3d shapes. The logged error is related to the collision mesh, which is a simplified version used to make rigid-body physics calculations easier. It's probably what ZodiusInfuser said – IIRC, KSP doesn't handle concave collision meshes.

This. Thanks for helping out Master Tao :)

Once the new version is getting somewhere (current progress: parts spawn and then get destroyed immediately. Once I figured that out the foundation is there. How much easier would it be if KospY would allow me to use KAS code, but nooo, I have to hack my way around the way he does it :mad:) I'll have to create a new/proper video to showcase.

Btw: is there something like imgur for videos? I can't use Google services (including YouTube) for certain reasons and usually don't deal with videos.

Unfortunately for most of the parts, especially the new Foldatrons, I have no option but to use Concave meshes. They're also the only way to do things like cargo bays :(, unless you aproximate the shape with lots of cubes.

Well, call me the clueless idiot I am but does concave really means a smooth curve or a polygon with a lot of edges like other "round" shapes in this case? If the latter I'm having a hard time to understand how they managed to not handle it like anything else. KSP is full of surprises for the young and naive ones...

Link to comment
Share on other sites

Well, call me the clueless idiot I am but does concave really means a smooth curve or a polygon with a lot of edges like other "round" shapes in this case? If the latter I'm having a hard time to understand how they managed to not handle it like anything else. KSP is full of surprises for the young and naive ones...

The images at the top of this page describe it best: http://ubicomp.algoritmi.uminho.pt/local/concavehull.html

Given a mesh, Unity can create a convex mesh/hull automatically (and this is sufficient many situations), but concave meshes have to be modelled and specified manually.

To put it in a context you may better understand. If you do a raycast against a Convex mesh, then you'll get two intersection points, one where the ray enters and one where it leaves the object. With a concave mesh, depending on the shape you could have many more.

Now whether this relates at all to the issues you're having or not I don't know, but if it is then it would be hard for you to enforce that every modder avoid using the feature given how easy it is to do.

Link to comment
Share on other sites

The images at the top of this page describe it best: http://ubicomp.algoritmi.uminho.pt/local/concavehull.html

Given a mesh, Unity can create a convex mesh/hull automatically (and this is sufficient many situations), but concave meshes have to be modelled and specified manually.

To put it in a context you may better understand. If you do a raycast against a Convex mesh, then you'll get two intersection points, one where the ray enters and one where it leaves the object. With a concave mesh, depending on the shape you could have many more.

Now whether this relates at all to the issues you're having or not I don't know, but if it is then it would be hard for you to enforce that every modder avoid using the feature given how easy it is to do.

Got it!

No worries, the new approach should solve this problem in an instant. And I made progress again, maybe I'll teaser some pictures later :cool:

Link to comment
Share on other sites

is there something like imgur for videos? I can't use Google services (including YouTube) for certain reasons and usually don't deal with videos.

I don't deal with videos much, either, but I've had good experiences with Vimeo, Metacafe, Veoh, and DailyMotion. I think all of them would let you embed a video in a post.

Link to comment
Share on other sites

I don't deal with videos much, either, but I've had good experiences with Vimeo, Metacafe, Veoh, and DailyMotion. I think all of them would let you embed a video in a post.

Thanks I will take a look!

But now: the greates news ever!

For me personally that thing beats Banana for Scale. Period.

*imagine a choir of angels singing hallelujah now or so*

KospY the great and glorious just allowed me to use an essential part of the KAS code for AS.

And since all other efforts in the last two days to do it in a different way from his (which would have been required) lead to:

  • reentry flames on the launchpad
  • the creative (and a bit desperate sounding) RasterProp error "Running a part without IVA. How did this happen?"
  • vessel parts being distributed around KSC but still being one vessel
  • and multiple universe-insta-deaths (even faster than calling the Kraken)
  • with the effects getting worse the more I tried to fix

I'm obviously either not good enough with Unity or not patient enough to do it myself :D So this will help massivley to get the much improved version out.

You may give him a cookie if you see him the next time :wink:

I'll continue my work and give you further updates on my progress. This is a dev thread after all, so I'm allowed to babble about my dev problems, right? :wink:

Link to comment
Share on other sites

Alright guys, here's a quick update because I'm so happy it finally kinda works :D

(@Master Tao: thanks for the hints, I tried a few alternatives but always had to wait ages for conversion so I finally gave in and managed to get myself a YouTube account thingy)

You have seen stuff like that before with KAS and EL, but believe me, I had to jump through many hoops to get it working while not on EVA and not destroying staging.

[And there is another dirty hack involved, but if you can't see it on the video I'm good to go :cool:]

Link to comment
Share on other sites

And here you see why I was so excited in the last post. :cool:

The battery pack is obviously only a placeholder. The final part spawned when placing a FreeAttach will be so tiny you won't actually see it.

The downside is, that links aren't created instantly. It takes ~0.5-1sec until Unity/KSP has everything initialized and ready (with more parts it will take a bit longer than in this video). Should be acceptable, though.

However, this not only allows for a much more stable system, it also produces a "believable physics" experience I wanted to see for a long time. More about that tomorrow, for now I call it a day :wink:

Link to comment
Share on other sites

....

EDIT2: Majiir might have a better idea since the KAS winch has flexible connections. Well, I really don't know much about Unity.

...

KospY the great and glorious just allowed me to use an essential part of the KAS code for AS.

...

And here you see why I was so excited in the last post. :cool:

...

While I am obviously happy about your progress and wish to congratulate for your results, I also must say I was hoping that part KospY allowed you to use could be in some way related to an old request I made, and you answered with the first post linked above.

Well, you certainly have a schedule and priorities, and it is to you to decide if and when any feature could be implemented with your mod. However, while reminding of the above, I would gladly know if you now see a possibility to implement the kind of "flexible struts" we talked about at that time. Possibly, with some more help from KospY.

Thanks for all the work done so far :).

Link to comment
Share on other sites

And here you see why I was so excited in the last post. :cool:

The battery pack is obviously only a placeholder. The final part spawned when placing a FreeAttach will be so tiny you won't actually see it.

The downside is, that links aren't created instantly. It takes ~0.5-1sec until Unity/KSP has everything initialized and ready (with more parts it will take a bit longer than in this video). Should be acceptable, though.

However, this not only allows for a much more stable system, it also produces a "believable physics" experience I wanted to see for a long time. More about that tomorrow, for now I call it a day :wink:

Some people would consider spawning batteries to be a super power :wink:. Am I right in thinking this is only for the free attach modes, since the others already have a part on the other side to connect to?

Link to comment
Share on other sites

Wait! Are you spawning stuff? Very very nice.

Hmmh, yes :wink:

While I am obviously happy about your progress and wish to congratulate for your results, I also must say I was hoping that part KospY allowed you to use could be in some way related to an old request I made, and you answered with the first post linked above.

Well, you certainly have a schedule and priorities, and it is to you to decide if and when any feature could be implemented with your mod. However, while reminding of the above, I would gladly know if you now see a possibility to implement the kind of "flexible struts" we talked about at that time. Possibly, with some more help from KospY.

Thanks for all the work done so far .

I have good and bad news for you:

  1. KospY chose the KAS license to keep it whole and unique, which is fully understandable and has to be respected. Therefore I only got a waiver to use a small part of the code which is not directly used to replicate KAS behavior after I tried to work around it (because a different solution would have been required) without success. Thanks again KospY! Sure, I had to change that code once again quite a bit to make it work while not on EVA, but it was at least a starting point I knew worked. And it's still not perfect yet I have to admit. :blush:Hey, that's damn Dwayne "The Rock" Johnson hard guys!! :confused:
  2. While I won't use the KAS code for flexible stuff and I'm not sure I would even attempt to do winches to respect KospY's IP I have a rough idea how fixed length flexible connections could work without me looking how KAS does it. But no guarantees for that and expect it as a v2 feature at least. My current focus is to get the current scope working well.

Some people would consider spawning batteries to be a super power . Am I right in thinking this is only for the free attach modes, since the others already have a part on the other side to connect to?

Considering what I do in the background it's more like black witchcraft or even bloodmagic :P (And yeah I got the pun, nice one :D)

Yes, that's only for FreeAttach ones. Basically I'm giving them a counterpart as well without having the user place it. And that one is also removed automatically once the link is gone. So I'm unifying the way I create those links (there are now always two AS parts connected), create a more realistic behavior but hide it as good as possible from the user. That's what your radioactive cube is for :wink:

Link to comment
Share on other sites

Alright guys, this will be the last update for some time, since the next in-game visible step from now is "it works" :wink:

A few remarks:

  1. Yes, I'm still making progress :D
  2. I'm exploring this "YouTube" thingy and what I can do with it, please be patient :blush:
  3. All joints in the video are of the "ConfigJoint" type which could break (if not set to infinite strength like in the video :rolleyes:) but wobbles more than "AttachJoints".
  4. The cool pink, radioactive cube is a MarceCubeTM manufactured by Zodius Inc. And the good news: everyone who will install the next version of this mod will get one! [Well, it will be basically invisible if you don't spawn it yourself, but hey!]
  5. Most of the voices in my head are confident that I'm still sane. Which is probably a good sign. Maybe.
  6. sirkut: if you are reading this, my problems seem to be related to a joint to a surface attached part. I had that in the past as well and do have a working (=promising) workaround at hand. However, if you have an idea how to properly fix that let me know. Anyway, family first man, you know what I mean!

Link to comment
Share on other sites

Well, I got it working. Mostly. To speak in SQUAD terms: we are in Experimentals :cool:

Until I get a bit more feedback I’ll provide two download in the OP: one for the old version and one for the new one.

The most important changes:

  • FreeAttach links are now spawning a target part. This improves strut targeting a lot.
  • In the editor you will see a small pink cube when placing a FreeAttach link. Don’t worry, it will be scaled to be invisible in flight.
  • You don’t have to remove the pink cube yourself, a coroutine should take care of that. You may experience that ghosts have invaded your KSP install after you Unlink or do something similar. Those ghosts pick up the cube and delete it automatically. I tried to lock the input during this operations (~0.75sec) but that lead to a NullRef flooding, don’t ask me why. I hope you will get used to that soon. I also want to point out that this is not the design I wanted but there are heavy restriction concerning spawning parts in code in KSP. Frankly it’s easier in flight than in the editor… If you are annoyed tell SQUAD to make the nice addPart and removePart methods public :mad:
  • A StraightOut attach in the editor will not spawn a part. This is also due to a limitation. However, it will create one automatically once you launch the vessel. You shouldn’t see a difference except that there is no pink cube in the editor. Since I have to handle this case differently there is a good possibility of some in-editor or even in-flight bugs, sorry.
  • Having a target part could also allow for the same physics experience as with a dedicated Grapple part. However, Unity/KSP don’t like me and it didn’t work when using IR. So I decided to still create the joint with the parent part which you won’t notice if the parent is not too big. If it is I suggest adding a small girder to the big part and FreeAttach to that. I do apologize and promise that I’ll continue my efforts to get rid of this problem. [Nothing is different from the last version, if you never mentioned it before you won’t do now.]
  • Due to the new part spawning there is always a short delay when creating FreeAttach links. Usually only a few physic frames (=in most cases <1sec). Unity needs this time to initialize the part correctly. You don’t have to do anything, the system will fix itself once everything is ready. However, please don’t click around for 1-2sec after creating a link. If you need insta-connections you can still use a Grappler-Grapple link! Compared to the time it takes to create struts with KAS and a Kerbal on EVA I think this is still acceptable :rolleyes:
  • The new target cube is a new part delivered with the mod directly (= it is needed!), thanks to ZodiusInfuser! I chose the form with the (I think) lowest possible impact on CPU/GPU performance since you don’t see it anyway most of the time. It has near to no mass and no drag, so the stock aerodynamics should be happy. However, it has to be a physics part, otherwise joints don’t work as expected. Additionally I packed a MM patch that should make it invisible to FAR as well. Anyway, consider it to be the weight of the hooks or so.
  • I changed the config file a bit, please use the new one which comes with the mod or deleted your old one so that a new default file can be created by the plugin.
  • With this release the license is changed to CC BY-NC-SA 4.0. I’m doing this because I put so much effort into this project by now that I want it to stay free and open, while the MIT license would have permitted different use cases. And yes, I would also like to get credit if someone builds on the work (that’s still possible and desired!) which cost me so much blood and tears :wink:

I will be honest, there are surely bugs in the code. I fixed everyone I came about but did not test all corner cases. However, the latest changes took again close to 50 hours, so I currently get a high blood pressure if I only think about joints and part spawning. If you find bugs please report them and I’ll do my best to fix them for the release, but please understand that I simply need a break from ActiveStruts for the moment.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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.

×
×
  • Create New...