Cable Component Plugin for UE4

Hey, most of the properties of CableComponent aren’t exposed to blueprints - notably End Location and Other Actor so you can’t create a cable from Blueprint. Seems like an easy fix. 4.7?

For anyone interested, I have implemented a cable for our Chaos grapple hook which bends around objects. I use a Spline to do that and manipulate the spline points at runtime to get the bends. The code draws the spline tick by tick and detects collisions using traces, and so as such, it’s not really an actor on it’s own which sits in the world and interacts with things, which is what most people here want, but the concept could possibly be converted to such. If anyone is interested I can share some code.

Hehe, crazy cool stuff warhead328! Any plans putting complete solution (C++ preferably) to the Marketplace for a fee ?

Do want. Seriously.

I’d suggest making it into a pack, even (can offer some help if you like), as this type of grappling hook is something a lot of people wouldn’t mind having, but don’t know how to make. For my part, it’s low priority compared to other stuff, but would be amazing to have.

I need to consider a lot of issues and finalize a lot of things before I’m ready to post anything, but when ready I’ll post up some code examples of the basic idea of how to manipulate a spline for this purpose, enough to get someone on the right path to implementing it on their own. The basic idea is simple, but the getting a final good result is not as straight forward as one would want it to be and I did some dark tricks to get it to work. Like I said, it’s code driven, not actor driven, and that right there could be a deal breaker for some people who just want to drop an actor in and watch it interact with the world.

I can’t really post up much more than some spline code samples because the hook itself is Chaos property, but sharing a technical example of how to implement a world interactive spline will not be an issue. Pretty simple for me to make some code snips of the basic idea.

Of course, Chaos manager R.Flagg might be interested in making the hook available to interested parties as a separate add on, so you could always hit him up for that.
He can be found at Unreal Tournament Forum Downtime or http://www.ChaoticDreams.org

I have seen this thread and also the third party dynamic cable plugin for $20 in the other thread.

I am wondering what the difference is to the cable in the free sample content of UE4. See sample content -> Physics -> Showroom 1.2. The rope there is a FBX with physics asset and has all collision, also dynamic, has true physics and so on. I am just trying to get a full picture because I need a physics rope sooner or later, and the sample content rope is already full physics enabled from what I saw.

I assume you mean this

Just reading that page, it appears that this is meant to make a skeletal mesh interact with the world for effects like Ragdoll.
Taken at face value, it means the bendable joints are predefined ahead of time.
I am not sure how good a rope that would make, but the idea looks like it has potential.
The rope could only bend at the points that are predefined for it in the editor, so you would have to make a lot of joints.
Not sure how it would look in game, but the demo looks promising, because you see how it makes a smooth bend.

Another potential issue is if one needs the rope to change length or not.
If you have a rope of a set size that’s good, but if you need the length to change in game (such as for my grapple cable), then you have a problem, because the mesh is predefined in the editor. Sure, maybe you could stretch it out, but the predefined joints would then also stretch out, making the bending look worse and worse the longer it got. There are also material scaling issues when doing that because the material gets all stretched looking, so you have to add dynamic scaling.

Other potential snags are:

-performance. not necessarily an issue, but with so many bends, performance would need to be evaluated. I went to great lengths in my own cable to keep the number of bends down to a minimum.

-rubber band effect. earlier drafts of our cable had the rubber band effect because the cable so was bendable, too bendable. therefore every time you moved the cable wiggled around like limp spaghetti. so a possible concern for a skeletal mesh rope is that with so many bend points as it would have to have to make it work, it would also perhaps wiggle around like a rubber band or spaghetti. only play test could very that, of course, and even then, the behavior might be acceptable, so depends on what one wants.

All that said, I think a skeletal mesh with a set length that doesn’t need to change, with enough joints in it, ought to work, in my opinion.
Sounds like it could be a worthy avenue of research.

I agree with you.

I have not done Verlet Integration myself yet, but I think the Verlet integration is better suited to solved a larger number of particles that connect to a rope, because it is faster than using PhysX joints for each ‘particle’. In principle you could use the soft limits of the PhysX joint to get stretching, but not sure.
In a Verlet rope, depending on the number of particles you can also see sharp bends in the Verlet rope. (not enough particles). The more particles, the less sharp bends.
As I understood, the Verlet particles are also connected by joints, but reduced joints in the degree of freedom in order for the Verlet integration to be applicable.

Interesting stuff. At one point I will read through the link in the first post where the stuff is explained.

Welp, we as Chaos have finished core dev on our cable. It works with moving objects now. I don’t want to high jack this thread, but I did promise some more details about our cable implementation, so for anyone interested, check out the comments section on this vid. It’s enough to get anyone started down that road who wants to develop similar tech on their own. No plans at this time for releasing the cable independently from the Chaos mod.

I made a helper blueprint recently called MultipleCableActor to address the issue that CableActors/CableComponents are a ***** to set up and use, even if you’re okay with the limited feature set (which is fine for just pretty ropes around your environments). Releasing it for free on here.

**Things it does

**-let you specify any number of cable sections with their own end points that you can drag around, so a single cable can be strung up from many points along the ceiling/whatever
-automatically keep the UVs consistent across all your ropes regardless of length (tiling still adjustable)
-let you specify different amounts of “slack” on the rope for each section, or specify a Uniform Slack to use for every section

https://c2.staticflickr.com/2/1717/24059754875_cc341e0c87_o.jpg

You can download it from my blog

That’s a great contribution. I haven’t used these before but I’m wondering if the cable can be affected by wind. For example if you used these for power lines, could they sway in the wind by placing a wind direction actor in the scene or would it be more complex than that?

@JoeWintergreen - work, that looks like it will make the CableComponent much more friendly to use.

Is this only for 4.10 and up? I am on 4.9.2 and get an error when opening the BP:

Cable Sections member variable have invalid type.

Not sure. Created on 4.10, haven’t tried anywhere else. Try revoking/resaving everything.

Looks like whatever struct gets broke down below the Add Cable Component node in the ConstructionScript is the issue. There is a Break node for <unknown struct>

Also looks like there are 2 in the Get Longest Section function. Large image to show you:

Do you have a struct named CableSection in the same folder as the actor?

Yes. Its called ImpromptuCableSection

It includes EndLocation and Slack vars.

That’s correct. Unreal sometimes chokes on custom structs for weird reasons. Save the struct (even though you haven’t done anything with it) and correct those graphs so that they look like this:

https://c2.staticflickr.com/2/1570/24099949132_15511b4711_o.png

https://c2.staticflickr.com/2/1569/24181890276_6b83570ac7_o.png

Currently no - I’d really like that functionality too, the best case scenario being a perfect emulation of the ropes in the Source engine (HL2). Someone would need to implement it in code on CableComponent - currently not my scene.

Everything works perfectly now. Thanks for the help and for the BP!