Search Unity

Auto Fence Builder [Released]

Discussion in 'Assets and Asset Store' started by Two_Click_Tools, Oct 18, 2014.

  1. Two_Click_Tools

    Two_Click_Tools

    Joined:
    Oct 9, 2014
    Posts:
    249
    Hi Peter, thanks for the comments.

    Categories - yes I agree, usage categories would be good.
    You can kinda do that at the moment. When you save your fence/wall (or resave an existing one), add "category-name/" to the name e.g. name your preset Military/MyDefenceWall, this will automatically create a new Military category.

    I'll add your category suggestions to the 3.1 update though.

    "Random Variation"
    Actually, while making that video, I realised the 3 Variation modes can be rolled in to one, so skipped it. All Variation settings are in one consistent module now.
    The only real difference was the option to assign a probability to the distribution of variations.
    E.g. if you were using WallA as the main wall section, and had WallB and WallC as variations, you could assign the relative chance of each one appearing, e.g. WallA 70% , WallB 20%, and Wall C 10%.
    In 3.1 the controls for this are now in the main block.

    Joe
     
    Last edited: May 21, 2019
    hopeful likes this.
  2. PeterBaker009

    PeterBaker009

    Joined:
    May 18, 2019
    Posts:
    4
    Ok, thanks.

    Is it hard to add something like this...
    https://www.yourdictionary.com/cheval-de-frise
     
  3. Two_Click_Tools

    Two_Click_Tools

    Joined:
    Oct 9, 2014
    Posts:
    249
    Cheval de frise, huh, now I know what they're called:). Sounds better than Spikey Thing.

    Metal version...

    Screen Shot 2019-05-19 at 13.59.38.png
     
    Last edited: May 19, 2019
  4. Two_Click_Tools

    Two_Click_Tools

    Joined:
    Oct 9, 2014
    Posts:
    249
    Wooden version


    Screen Shot 2019-05-19 at 14.06.34.png
     
  5. Two_Click_Tools

    Two_Click_Tools

    Joined:
    Oct 9, 2014
    Posts:
    249
    I'll include them in next week's update, or, you can contact the support address and we'll send you (or anyone) the preset package before.

    (The forward facing sticks are posts spaced at 1m (interpolation) with a z angle of 45, then there's 1 sub-post between them facing the opposite way. Then both have z position offsets so they meet in the centre. Then finally a Rusty Girder rail to hold them all together. I also added a bit of randomness to the wooden one)
     
  6. Two_Click_Tools

    Two_Click_Tools

    Joined:
    Oct 9, 2014
    Posts:
    249
    Auto Fence & Wall Builder update 3.1 is now available on the Asset Store

    https://assetstore.unity.com/packages/tools/level-design/auto-fence-wall-builder-23201

    New Features

    • Smaller, simplified UI - only see the tools you need.
    • Auto Assign Variations - some one-click starting points for variations
    • Basic Unity LOD group setup - each finished fence/wall can be assigned a LOD with distance disable
    • Triangle usage displayed in Scene View can be enabled/disabled
    • Tooltip help on every control and parameter
    • Subposts now have variations
    • Control Nodes can be enabled within Scene View
    • Military category added with new complete fences & walls, and new component parts

    Improvements

    • Optimised & refactored code - 2-300% faster build times in the editor

    Bug Fixes

    • Fixed issue where under some circumstances Undo can create duplicated GameObjects that had to be cleared with ‘Rebuild’
    • Fixed geometry errors on highly rotated panels on steeply-sloped surfaces.
     
  7. tremault

    tremault

    Joined:
    Oct 16, 2015
    Posts:
    58
    Hi, I'm coming across an issue with Fence Builder and Bakery. when i build my project, all the fences in scenes that I have baked, are invisible. I spoke to the developer of bakery and they have said the following :
    I disabled batching for one of the fences and this fence appeared in my next build, I replied to them with that info and they said this:
    What could I do to try and resolve this?
     
  8. Two_Click_Tools

    Two_Click_Tools

    Joined:
    Oct 9, 2014
    Posts:
    249
    Hi, I’m looking in to this with Bakery now, haven’t used AFWB with it before. What Unity version are you on?

    Thanks

    Joe
     
  9. Two_Click_Tools

    Two_Click_Tools

    Joined:
    Oct 9, 2014
    Posts:
    249
    In the meantime, what happens if you set your AFWB combine options to ’None’?
     
  10. tremault

    tremault

    Joined:
    Oct 16, 2015
    Posts:
    58
    I'm stuck at 2017.1.5f1
    can't upgrade any further. too many things get broken,.
     
  11. tremault

    tremault

    Joined:
    Oct 16, 2015
    Posts:
    58
    I'll try this. i did create a combined mesh copy recently and that produced a visible fence in build.
    I'll do the combine option thing now.
     
  12. tremault

    tremault

    Joined:
    Oct 16, 2015
    Posts:
    58
    okay, i took a fence that was previously invisible, disabled combine on each element of it, and built the project and the fence was visible in build.
     
    Last edited: Jun 2, 2019
  13. Two_Click_Tools

    Two_Click_Tools

    Joined:
    Oct 9, 2014
    Posts:
    249
    Ok, thanks for the update. With Combine off, you still have the option to merge the finished fences meshes if you want by selecting "Create Merged-Mesh Copy" on the Finished Autofence folder.


    If you get any more unexpected behaviour with Bakery, can you get in touch at twoclicktools@gmail.com. We don't have that asset at the moment, but we should be able to figure out if it has special mesh requirements if we try a few things. BTW, yes the meshes are procedural until you 'Finish' a fence, at which point they exist in the 'UserGeneratedRailMeshes' folder.

    Cheers

    Joe
     
    Last edited: Jun 2, 2019
    guycalledfrank likes this.
  14. tremault

    tremault

    Joined:
    Oct 16, 2015
    Posts:
    58
    okay so after i create or edit a fence, I have to use this extra step. maybe not ideal but it is the right solution for now. thank you.
     
  15. Two_Click_Tools

    Two_Click_Tools

    Joined:
    Oct 9, 2014
    Posts:
    249
    No problem. If you'd like a custom script to always keep hard mesh copies during editing when using Bakery, drop us a line. (They take a finite time to generate so it might slow down realtime editing a tiny bit - but I guess it could always be toggled on/off)
     
  16. tremault

    tremault

    Joined:
    Oct 16, 2015
    Posts:
    58
    I appreciate that. I think i'm going to be ok doing it this way. :)
     
  17. tremault

    tremault

    Joined:
    Oct 16, 2015
    Posts:
    58
    hmm, some of my completed autofences will not generate a mesh. they just produce an empty 'folder', whereas the others are fine. I've looked for potential differences that might cause this but come up empty. any suggestions on what else to check?

    Edit:
    never mind, I resolved it. the naming structure was different. must have been generated from a previous version of AFWB.
     
    Last edited: Jun 2, 2019
  18. Two_Click_Tools

    Two_Click_Tools

    Joined:
    Oct 9, 2014
    Posts:
    249
    Auto Fence & Wall Builder 3.2 Will be submitted to the Asset Store tomorrow

    As usual, if you've found any issues, or have feature-tweak requests, let us know before then.

    New Features

    • The Auto Fence Builder folder can now be placed anywhere in your Assets folder
    • There is the option to show preview guides from mouse-position, where the next section will be build. (see below)
    • Finished fences/walls (v3.2+) can now be brought back to life and re-edited.
    • Added 'Save Meshes' while editing capability (for those using 3rd-party assets that require AFWB's mesh assets)
    • Added Concrete and Wood Decorative wall designs. (see below)

    Bug Fixes

    • Fixed mislabelled Delete Node hint (should be control-left-click)
    • Fixed issue with AFWB prefabs not being available outside of AFWB

    Decorative wall - 2 rails + sub-posts:
    Screen Shot 2019-06-07 at 10.16.30.png

    Green lines from last position to current mouse position shows where next section will be built.
    Screen Shot 2019-06-07 at 10.19.png
     
    sjm-tech likes this.
  19. Toylips

    Toylips

    Joined:
    Feb 15, 2013
    Posts:
    28
    Hi! I've bought the last auto fence builder and when I'm trying to finish & start new, after pressing ok it log an error

    ArgumentOutOfRangeException: Index and length must refer to a location within the string.
    Parameter name: length
    System.String.Substring (System.Int32 startIndex, System.Int32 length) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
    SaveRailMeshes.SaveProcRailMeshesAsAssets (AutoFenceCreator af) (at Assets/Auto Fence Builder/Editor/SaveRailMeshes.cs:22)
    AutoFenceEditor.OnInspectorGUI () (at Assets/Auto Fence Builder/Editor/AutoFenceEditor.cs:664)
    UnityEditor.UIElements.InspectorElement+<CreateIMGUIInspectorFromEditor>c__AnonStorey1.<>m__0 () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorElement.cs:462)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    pls help
     
  20. Toylips

    Toylips

    Joined:
    Feb 15, 2013
    Posts:
    28
    Oh and if I press ok couple times the fence has disappeared
     
  21. Two_Click_Tools

    Two_Click_Tools

    Joined:
    Oct 9, 2014
    Posts:
    249
    Hi, did part of your message disappear?
     
  22. Toylips

    Toylips

    Joined:
    Feb 15, 2013
    Posts:
    28
    all fence flied away for a moment, oh I guess everything going wrong because of the error, after it trying to parent, that is why it fly away mb, it could be because I'm using 2019.1.6f1, have you tested the tool on this version ?
     
  23. Toylips

    Toylips

    Joined:
    Feb 15, 2013
    Posts:
    28
    and I want to add that this tool is awesome , but the little issue is annoying a bit
     
  24. Two_Click_Tools

    Two_Click_Tools

    Joined:
    Oct 9, 2014
    Posts:
    249
    It’s been tested in 2019.1.3. I will test in 2019.1.6 now though.

    Which version of Auto Fence are you using... the newest version 3.2?

    I don’t completely understand the message, it looks like some of the first message was missing. Did you Finish a fence and parent it, then it disappeared?
    If you can give as much information as possible, I can try to reproduce the issue in 2019.1.6


    Did you get an error message in the console? If so can you copy it and send it to twoclicktools@gmail.com

    Thanks

    Joe
     
    Last edited: Jun 13, 2019
  25. Toylips

    Toylips

    Joined:
    Feb 15, 2013
    Posts:
    28
    I've bought it today, I guess, it should be the last one.
    I will create a video and send you e-mail with log
     
  26. Two_Click_Tools

    Two_Click_Tools

    Joined:
    Oct 9, 2014
    Posts:
    249
  27. Toylips

    Toylips

    Joined:
    Feb 15, 2013
    Posts:
    28
    No worries , I've sent the mail
     
  28. Two_Click_Tools

    Two_Click_Tools

    Joined:
    Oct 9, 2014
    Posts:
    249
    Finish & Start New Issue

    Referring to the last messages, Toylips has found an issue with yesterday's update (v3.2) and the latest 2019 Unity release. This can sometimes cause an error when trying to complete a 'Finish & Start New' or 'Finish & Duplicate' action.

    It's been fixed now and should be on the Asset Store in a day or two. In the meantime, if you see this issue, please contact twoclicktools@gmail.com and we'll send you an updated scripts package to import.

    Thanks

    Joe
     
    Last edited: Jun 13, 2019
  29. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    363
    Hey everyone. Does this work at runtime aswell? (so that our players can build the fences and walls) ?
     
  30. Two_Click_Tools

    Two_Click_Tools

    Joined:
    Oct 9, 2014
    Posts:
    249
    Hey, yes, with a bit of coding...
    Fences are created between node points (Vector3), if you supply it with a List<Vector3> and call the build command you're good to go.

    If you're not sure and would like a demo of Auto Fence & Wall Builder, or some coding snippets, get in touch at
    twoclicktools@gmail.com

    Cheers

    Joe
     
  31. Two_Click_Tools

    Two_Click_Tools

    Joined:
    Oct 9, 2014
    Posts:
    249
    Forgot to mention... there is an example of how to do this included in the package, but the exact implementation would depend on your gameplay & UI etc.
     
  32. Two_Click_Tools

    Two_Click_Tools

    Joined:
    Oct 9, 2014
    Posts:
    249
    Auto Fence & Wall Builder 3.3 is available on the Asset Store

    https://assetstore.unity.com/packages/tools/level-design/auto-fence-wall-builder-23201

    This is mainly a maintenance update for anyone seeing an error on Finishing issue in AFWB 3.2 with Unity 2019.1.6.

    New Features

    It's now possible to create a minimal version of AFWB containing no built-in prefabs, for use only with your own custom objects. There are instructions on how to export this package that you can then import instead of the main AFWB when you want a lightweight version.
     
  33. tremault

    tremault

    Joined:
    Oct 16, 2015
    Posts:
    58
    Hi, I'm creating meshes from older fences created in older versions of afwb and the colliders are being put in the wrong position. i can move them, to where they are supposed to be by hand but it will be a lot of work. any ideas on what i can do to correct this issue?
     
  34. Two_Click_Tools

    Two_Click_Tools

    Joined:
    Oct 9, 2014
    Posts:
    249
    Hi, yes you can change the size, or the height position offset of the collider in the Settings.
    Could you post a screenshot of the old mesh you're using, showing the collider? It would be good to figure out what caused this.

    Thanks

    Joe

    Collider.png
     
  35. tremault

    tremault

    Joined:
    Oct 16, 2015
    Posts:
    58
    I don't have that panel foe what the settings were when i created the fence, because I have updated afwb since.
    I mentioned previously that i had to rename all the components to get it to generate a mesh. the names were originally 'railsdividedgroupfolder' etc.
    here is a screenshot of what my objects look like and for some reason a new error message just popped up that wasn't there yesterday.
     
  36. Two_Click_Tools

    Two_Click_Tools

    Joined:
    Oct 9, 2014
    Posts:
    249
    Thanks for the screenshot. I'm just trying to figure out the situation, as obviously there's a lot I don't know about what's happened in your project
    • So the Finished Fence in question was created in an old (2.2?) version of AFWB? The settings I showed above were in all versions from 2.1, but I guess if you Finished the fence (and no longer have access to that AFWB session), then all you have is the meshes and colliders, so there's nothing a new session of AFWB can do, as at this point they are literally just Unity objects.
    • I'm not sure what you mean by "creating meshes from older fences". How are you creating meshes? By importing these Finished fences from another project perhaps?
    • Have you merged two different versions of AFWB, the error you showed refers to code from v3+, but seems like the only way it could happen is if a pre-v3 source file was present. (Could be wrong - just fishing for clues)
    • As the Finished fence is now independent of AFWB, the only way I can fix it is if you could send the finished fence. (Save it as a prefab, then export) It might help figure out where in the process the error occurred.


    I didn't follow up on one of your previous posts about renaming things as it seemed you'd fixed it. But it could be that the problem is related to that. Can you remember what happened?
    Any info you could give on the lead-up to this would be appreciated as it's tricky to guess what lead to this.
    My guess is:
    You created some finished fences in an old (2.2?) version of AFWB, but didn't notice the colliders were offset at the time. You've now updated to AFWB 3.3 and noticed the misplaced colliders from v2.2.

    As far as the error goes, if it persists, you can fix it by removing AFWB, then re-importing it. I can't re-create it but it's almost certainly project files becoming replaced or mixed up. In the meantime if you can export and send the Finished fence to twoclicktools@gmail.com.

    Thanks

    Joe
     
  37. tremault

    tremault

    Joined:
    Oct 16, 2015
    Posts:
    58
    It seems like you have a clear understanding of the situation. I don't know what version of afwb I used to create these fences, I think it was over a year ago when i did those ones. I have since updated, but am not on hte latest, I think i'm on a version from a few months ago.
    The state of these fences is as such. they are completed fences, but they are still afwb objects. I say this because they have a script at the base level that has the option to 'create merged mesh copy'. this is where the error occurs. as you see in the screenshot the collider is aligned with the fence. when I create a merged mesh copy, the colliders end up quite a way away from the fence.
    I see what you say about the scripts making reference to a different version.. I am re-importing all assets and that should resolve. I had made a backup and had tried the latest version of afwb to see if it fixed my issue but when it didn't i decided to revert to my backup to save risking any unseen issues. the prefabs were wrong as a result so I'm reimporting and that should be fine.

    so once I get that all reimported i can check on more things.
    yes the fences are from an old version. they are completed fences, but they have not been converted to a merged mesh copy. when I try to create a merged mesh copy, initially they are not recognised because they are named differently. rename the files and then it creates a merged mesh copy but the colliders are in a wildly different location. the different location seems to be related to the axis of the fence object. These older fence objects have axis points that are quite far from the actual fence for some reason. it appears the colliders are getting placed on the other side of that axis. the orientation is correct, but the position is sort of mirrored. I can show you a screenshot of this in action once it's finished reimporting.
     
  38. Two_Click_Tools

    Two_Click_Tools

    Joined:
    Oct 9, 2014
    Posts:
    249
    OK, thanks for the info. Once a fence is Finished it's really no longer an AFWB object... as you mentioned there is a further option to merge the meshes, but this is unrelated, at this point everything in the Finished folder are just standard Unity Game Objects with their associated meshes, materials colliders etc.

    Given that this has happened across unknown older AFWB versions, that you're now on 3.01+ and that access to the original AFWB session that made the fence is gone, then there is nothing that AFWB can do directly to move those colliders.
    It's quite a complicated case with a lot of variables, but I appreciate this must be frustrating, and apologies that without looking at the fence I wouldn't be able to pinpoint what happened. But if you send a Finished fence prefab as an exported .unitypackage (just drag Finished Fence in to top level of your Assets folder, then export), I'll write a new tool to analyse the old fence and rebuild colliders. This should be a quick fix once you have that tool, so I wouldn't spend any more time trying to figure it out.
     
  39. tremault

    tremault

    Joined:
    Oct 16, 2015
    Posts:
    58
    are you sure it's not an afwb object? is this script not part of it?
    in an case, I can send this to you , but I'm not sure how to do that, it may take me a hot minute.

    edit: I've sent you an email. I hope I exported the prefab correctly.
     
    Last edited: Jul 2, 2019
  40. Two_Click_Tools

    Two_Click_Tools

    Joined:
    Oct 9, 2014
    Posts:
    249
    That's great, I'll get back to you with a collider adjustment script soon.
    BTW, the top level 'Finished Fence' folder is just an empty Unity Game Object with a script - 'FenceMeshMerge' - attached. It's just a separate utility to merge all child meshes, not connected to AFWB.

    Thanks

    Joe
     
  41. tremault

    tremault

    Joined:
    Oct 16, 2015
    Posts:
    58
    Ah! I see!!
    That makes sense now, thank you.
     
  42. jh092

    jh092

    Joined:
    Sep 2, 2018
    Posts:
    55
    Hi there, I have just purchased and it looks great, thank you.

    My requirements are meagre though :)

    I can see your instructions on how to create a minimal package without all the included assets. That is clear to me, but what I would like to do is to create a trimmed down version with only the assets I need for my single fence. For example I am using the white picket fence only, so is it just a matter for me to work out what meshes, prefabs, textures and materials are needed for that fence and then delete all the other objects? Or will that break other things.

    It would be great to have a utility where unused fence assets could be removed/ignored for the final build.

    Anyway, thanks again, having a great time playing around :)

    John
     
  43. Two_Click_Tools

    Two_Click_Tools

    Joined:
    Oct 9, 2014
    Posts:
    249
    Hi John, thanks for the comments.


    In this case, that in your current project you want to remove all unused assets before a build, you can find an option in the Refresh/Unload tab, in the 'Globals' section at the bottom of the AFWB interface.
    Selecting "Unload Unused Assets" will purge all but the ones being used, thereby AFWB will only affect your build size by a few Mbs. (The assets will still exist in the Assets folder, but they are no longer in memory, or included in the build)

    If on the other hand you wanted to create a minimal version of AFWB, that only ever contains e.g. white picket fence, drop us a line at the support address and I can send you a utility to do this. (i.e. a version of AFWB, that whenever imported, only contains one or more fences of your choosing.)

    Let me know if there's other functionality you need, regarding this.

    Cheers

    Joe

    (P.S. Apologies if this reply seemed slow, we're on European time, and I see your message was posted last night)
     
  44. PHLCollective

    PHLCollective

    Joined:
    Jun 27, 2014
    Posts:
    59
    Hey, just bought this tool today and so far I'm really enjoying the flexibility of it. One thing that was make-or-break for deciding to buy was the ability to use just the tools with custom assets and not have to bog down our project with tons of assets we'll never use. I followed the instructions in the docs folder and it definitely helped, but there are still a huge number of FBXs included in \Auto Fence Builder\Meshes\ that don't appear to be used by the default template. I'm curious if that folder was just accidentally left out of the things to delete part of the instructions.
     
  45. Two_Click_Tools

    Two_Click_Tools

    Joined:
    Oct 9, 2014
    Posts:
    249
    Hi, yes, I accidentally omitted it from the list of things to delete .
    So you can delete the entire contents of the Meshes folder (including any sub-folders), but don't delete the Meshes folder itself, as this is where copies of your custom meshes will be placed.
    (If you're already using any custom meshes in the currentAFWB project, you'd have to remember not to delete those, but they're easy to find as they are prefixed with "_user_")

    I've just tried and confirmed this, but if you need any more help with it, drop us a line.
    I'll edit the instructions in the next update.

    Thanks

    Joe
     
  46. MyFairy

    MyFairy

    Joined:
    Oct 21, 2019
    Posts:
    2
    Hello, I would like to know if it would be possible that each rail and post become a prefab (as same as when it's in the FencePrefabs_AFWB folder) after finished fence ?
    upload_2019-10-21_11-12-8.png
     
  47. Two_Click_Tools

    Two_Click_Tools

    Joined:
    Oct 9, 2014
    Posts:
    249
    At the moment they're only created as Game Objects, but it would be easy to provide you with a script to save as prefabs instead. Contact us at twoclicktools@gmail.com and I'll email you a script - let us know if there are any other details as to how you would like it to work for your requirements.

    Joe
     
  48. martman100

    martman100

    Joined:
    Sep 4, 2013
    Posts:
    44
    Just purchased the asset a couple days ago and it has proven to be awesome for what I need. I am only faced with one problem. After adding some fences I my scene now takes a long time to load at runtime in the game on a mobile device. Are there some settings or something that I am missing to optimize this? I have not profiled it or really did a deep dive on the root cause as I suspect I am just missing some optimization settings.

    Thanks
     
  49. Two_Click_Tools

    Two_Click_Tools

    Joined:
    Oct 9, 2014
    Posts:
    249
    Hi, it could be that you haven’t unloaded the unused assets. At the bottom of the AFWB inspector in one of he globals tabs there is an option to unload unused before you do a build. For your final build it’s best to Finish any live fence, then do this, then remove AFWB from the hierarchy. But during testing it’s fine to leave AFWB there, and after your test build, you can reload all the assets in AFWB and continue from where you left off.

    Cheers

    Joe
     
  50. martman100

    martman100

    Joined:
    Sep 4, 2013
    Posts:
    44
    Okay will give that a try when I get to that point. Thanks for the quick reply. Awesome asset!