Search Unity

  1. Dismiss Notice
  2. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  3. Dismiss Notice

[Released] Wire Builder - easy to use wire creation

Discussion in 'Assets and Asset Store' started by StaggartCreations, Sep 12, 2019.

  1. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,498



    An editor tool to create suspended electricity or telephone wires. Built around an intuitive "click & drag" scene-view editor.

    Connectors can be added to GameObjects (eg. utility poles) to form a group. In turn, wires can be connected between connectors.

    Features:
    • Preset-based wire type settings
    • Per-wire adjustable sagging
    • Adjustable wire resolution per meter
    • LineRenderer or MeshRenderer wire generation
    • Animated wire shader (Standard/URP)
    • Compatible with 2D view
    Vegetation Studio tree and object removal underneath wires

    Notes:
    • Wires have a centered pivot so will work with World Streamer or other grid systems
    • Tag and Layer can be set for generated wires
    • Includes Amplify Shader Editor and URP Shader Graph functions for the shader animation effect.

    Limitations:
    • Wires have no collision or physics interaction
    • No editing cannot be done at runtime, this is an editor-only tool

     
    Last edited: Nov 2, 2019
    Mark_01 and one_one like this.
  2. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    575
    That's pretty cool! Is runtime support planned at some point?
     
  3. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,498
    Thanks! I don't have any intention to add this, as the scope is limited to an editor tool ;)
     
  4. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    575
    Aw, that's too bad. Is it making extensive use of some unity editor API then?
     
  5. igor250697

    igor250697

    Joined:
    Oct 5, 2018
    Posts:
    3
    Hi, why I can’t buy your product in Asset Store? Found 404
     
  6. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,498
    Thank you for your interest, but its still pending review. This typically takes 4 weeks, so puts it somewhere halfway October ;)
     
  7. igor250697

    igor250697

    Joined:
    Oct 5, 2018
    Posts:
    3
    and for what price will you sell?
     
  8. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,498
    This is also noted in the first post ;) It is currently set at $15.
     
    Mark_01 likes this.
  9. igor250697

    igor250697

    Joined:
    Oct 5, 2018
    Posts:
    3
    Is it possible with this tool to draw wires in real time directly in the game. Or just on stage unity
     
  10. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,498
    The editor side calls on several functions in the static WireManager class, which is a non-editor class. This was done so a runtime API could still be possible, the group, connector and wire components are MonoBehaviours in any event.

    I've added code comments to all the static functions. Which allow you to create/update/destroy group, connectors and wire objects. This includes generating a wire between two connectors. So runtime wire creation should be possible using this.

    All the functionality as seen in the GIFS, for the dragging interaction is still editor-only, simply because it's written for the scene view. Anyone looking to have such interaction in-game would have to recreate this ;)
     
    Mark_01 likes this.
  11. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,498
  12. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    900
    wow result look amazing
     
  13. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    267
    Hallo, is it possible somehow to have more options regarding the sagging? Trying to drag the lines up and down in the editor is somehow very limited, because as soon as the cursor hits the border I can't make the sagging more extreme anymore.
     
  14. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,498
    Thanks for the feedback, the controls for the sagging is something I couldn't get quite right, so the reach is limited.

    What I can do is exposed the "sagging amount" parameter on the Wire component. This way it can be set there, with whatever value desired. I've just submitted an update which includes this, should be available within a few days.
     
    Last edited: Nov 2, 2019
    ratking likes this.
  15. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    267
    Thank you!

    I'd have some more feedback if you don't mind:
    - Pressing Ctrl+Z after changing the sagging amount via the gizmo doesn't change it back.
    - It should be possible to "clean up" a connector if the user (i.e. me) accidentally deleted a wire via the delete key. I had some really hard to track bugs because apparently there wasn't any hint anywhere that told me that the connector had faulty (missing) wires.
    - Is there some documentation on how to create wires at runtime via code? Is this possible at all? Would be great for procedurally created levels.

    Kind regards,
    ratking
     
  16. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,498
    1. This is true, when an Undo is performed, the value is restored, but the wire isn't (immediately) regenerated afterwards. There is apparently a way to detect this, so I can probably make this work.
    2. Whenever the wire editor is fired up, all the components are validated and missing references are removed. I assume if you're deleting a wire object outside of the editor, this is desired behavior.
    3. The WireManager class has several functions for creating and managing wires. As side from function comments, this is undocumented and unadvertised because run time generation hasn't been tested. But the editor calls on many of these functions as well.
     
  17. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    267
    Thanks for the reply. I didn't know that I had to fire up the wire editor again to remove the missing references, good to know. And I will have a deeper look at the WireManager class.

    Another thing I noticed is that my wires had a very noticeable break in the middle (mostly noticeable in motion, when having a bit of a stronger wind). In order to fix this I changed the generation of the gradient keys in the method NewWindData() in WireGenerator.cs to this:

    Code (CSharp):
    1.             GradientColorKey[] colorKeys = new GradientColorKey[2];
    2.             colorKeys[0] = new GradientColorKey(color, 0f);
    3.             colorKeys[1] = new GradientColorKey(color, 1f);
    4.             GradientAlphaKey[] alphaKeys = new GradientAlphaKey[8];
    5.             for (int i = 0; i < 8; ++i) {
    6.                 var time = i / (float)(8 - 1);
    7.                 alphaKeys[i] = new GradientAlphaKey(Mathf.Sin(time * Mathf.PI), time);
    8.             }
    9.  
    10.             g.SetKeys(colorKeys, alphaKeys);
    This way the linear interpolation isn't so striking anymore, maybe you want to adopt this. (It's still kinda visible though, maybe an AnimationCurve would be a better idea anyway.)
     
  18. osss

    osss

    Joined:
    Jan 20, 2014
    Posts:
    26
    HDRP is actually compatible, just recreate the HDRP shadergraph and connect nodes by refer URP shadergraph.
     
  19. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,498
    Thanks! This actually does look a little better, when viewed from above the curvature is a bit smoother.

    Submitted v.1.0.2

    Changed:
    - Wire sagging is now restored when Undo is performed
    - Slight improvement to wind animation (takes effect upon modifying a wire type preset)

    Fixed:
    - GUI not positioning correctly on some devices, causing GUI elements to appear off-screen (possibly DPI related)
     
  20. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,498
    Working a wire strip feature, which can be configured per wire type. I personally need this to create bunting, but it could also be used for 2D jungle vines.



    Support for a custom mesh (lightbulbs?), rather than a quad seems possible, but I'll try this further down the line. Still need to figure how align the bottom of the mesh to the wire as well (edit: fixed!). Wind also needs to match the wire, I'm aiming to add some noise towards the bottom of the strip, so the individual flags appear to move as well.

    Note: The strip mesh will be combined with the wire mesh, so will share the same material. I'll expose a UV tile/offset parameter for the wire and strip mesh, so a texture atlas can be used. Using two materials is too costly in the long run, as this would net 2 draw calls per wire.
     
    Last edited: Dec 23, 2019
  21. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634


    Hi, does this need two points to work, or can you have hanging rope, wires etc?

    Which is useful for say a busted bridge, with ropes hanging or say the telephone pole with broken hanging wires. Is this possible with such tool out of the box that is.?
     
  22. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,498
    Yes, a wire must always have a start and end point. I've dabbled with the idea to detach a wire, and have it dangle, but this has implications for a lot of functionality. Something I'll look into in the future :)
     
    recon0303 likes this.
  23. GlitchInTheMatrix

    GlitchInTheMatrix

    Joined:
    Apr 12, 2010
    Posts:
    285
    Hi, I love that update! great work!
    Is able already in the package? Thank
     
  24. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,498
    Not yet, I honestly forgot about haha. I had some troubles with applying gravity to the meshes, so things like lanterns attached to a wire would appear to hang. Meanwhile I've learned a few new tricks, so I'll have to revisit it at some point ;)
     
  25. GlitchInTheMatrix

    GlitchInTheMatrix

    Joined:
    Apr 12, 2010
    Posts:
    285
    Sounds like something very cool to have in this system! Hope you can make time to integrate in the actual system, is so easy to use and work so well that can't wait to see what is coming :)
     
  26. TimeWalk-org

    TimeWalk-org

    Joined:
    Nov 3, 2014
    Posts:
    36
    Any trick to getting the "Edit Wires" button to appear? I installed the package in 2 different Unity Windows 2020.1.b10 projects. In one, the Edit Wires button appears (when I click on a WB prefab with the scripts attached). In the other, it never appears. Anything I should check? I know that it's untested with 2020, but it does work perfectly in one project and not the other. I have pressed CTRL, of course, but nothing happens. I see no errors in the console, and the package does seem to be correctly installed (e.g. the menu Component/Wire Network works fine).
     
    Last edited: Jun 7, 2020
  27. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,498
    Strange, the button is prompted whenever any of the WireBuilder components are visible in the inspector. In the project, where it doesn't appear, do you have more than one scene-view tab open? Or both the scene- and game view by any chance? Are these projects on the same computer, or two different ones?
     
  28. Gua

    Gua

    Joined:
    Oct 29, 2012
    Posts:
    419
    Line rendering is better for performance?
     
  29. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,498
    In some respect yes, it will generally use fewer triangles, since the mesh is basically a camera-oriented strip, rather than a tube. The only downside is that lighting isn't as pretty, and LineRenderers cannot be combined into a single mesh using external tools like Mesh Combine Studio, etc.
     
  30. Harjawalda

    Harjawalda

    Joined:
    Sep 1, 2018
    Posts:
    14
    Is there a way to create a continuous cable with multiple pivot points? I keep getting disjoints and hand editing the pivot points per mm is agonizing, inefficient and inaccurate.
     
  31. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,498
    There's no such functionality, since wires are always created between two individual connectors.
     
  32. Ochoytnik

    Ochoytnik

    Joined:
    May 10, 2015
    Posts:
    1
    I just bought this ten minutes ago I was having trouble getting the edit wires button to appear and it was honestly pretty annoying. In the Scene view Unity puts a component editor tools panel in the bottom right hand corner of the scene view. The button to edit the wire is behind this! To get to it I had to toggle the little crossed tools icon (hide or show the component editor tools panel) on the scene view off.

    I am still using unity 2020.1.1f1 so it's possible things have changed. I hope this helps someone!
     
unityunity