Search Unity

[RELEASED] uConstruct - Fully generic, socket based runtime construction system

Discussion in 'Assets and Asset Store' started by ElroyUnity, Oct 17, 2015.

  1. ivendar

    ivendar

    Joined:
    Feb 18, 2010
    Posts:
    242
    I'm going to use Inventory Pro, too. Seems to be a great inventory system. Also it has Playmaker support as well so would be a great addition maybe.
     
  2. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Definitely will add playmaker into my plans :).
    The inventory pro extension will be added hopefully in 1.2 :)
     
    ivendar likes this.
  3. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Going to start upgrading the demo building placer for 1.2 so you could have more than nine buildings on placement :).

    Bigger milestones list soon :)
     
    Last edited: Feb 4, 2016
  4. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Version 1.1 is out !!!
    As said, price was raised to $30.

    Change log is above :).


    Elroy.
     
    Last edited: Feb 5, 2016
    BackwoodsGaming likes this.
  5. LongitudeZero

    LongitudeZero

    Joined:
    Feb 5, 2016
    Posts:
    4
    Hi Elroy,

    You have decided against a webplayer demo but could you please confirm if uConstruct works with (1) Unity web player and/or (2) WebGL?
    Also, the asset source code is in C#, isn't it?

    Thanks to clarify.
     
    ElroyUnity likes this.
  6. BackwoodsGaming

    BackwoodsGaming

    Joined:
    Jan 2, 2014
    Posts:
    2,229
    Hey @LongitudeZero,

    I can confirm the code is in C# as I usually never purchase anything done in UnityScript. The only exception was Suimono and we are constantly after @chingwa to port it to C#... lol

    Not sure on the Unity web player or WebGL as I don't do anything at all with those platforms. Maybe it is something Elroy or one of the other users have tested...

    Oh.. Tip for checking what language and asset is in. If you look on the asset store page for the asset, just below the pictures is a file list.. You can scroll through that to see if it has .cs or .js scripts. :)
     
  7. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Hey,
    Yes the source code is written fully in c#, with API and documentation included.

    Unity web player - Works.
    WebGL - Doesnt work with the current version as it doesnt support multi-threading, support for this will be added for next version :). if you end up buying the asset i will be sending it to you through mail straight away :).
     
    BackwoodsGaming likes this.
  8. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Little changes to the API :

    -Completely moved the threading manager from AOI class to the new ThreadManager class.
    -Wrote the thread action approach(fully generic now with templates).
    -Added built-in support for WebGL.
    -Fixed Unity 5.3.xx warnings because of the new SceneManager.
     
    AdamGoodrich and BackwoodsGaming like this.
  9. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    Could I ask for a feature please? Is there any way the building piece being placed can have some transparency applied so you can see through the piece? When you are placing internal walls, the wall can appear in front of you and it isn't obvious you can walk through the wall to place the preview piece elsewhere.
     
  10. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Hey!,
    Yes you can definitely do that !,
    in the inspector of the BuildingPlacer script you should have 2 colors (CanPlace, CantPlace), just assign the alpha of each one of them to a value of your liking (so for your instance something like 0.4) and that should be transparent :).

    Elroy.
     
  11. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    Awesome thanks!
     
  12. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    Unfortunately turning the Alpha down to even 10/255 isn't amending the seethroughness (?!), I am using a PBR material on the wall for info.
     

    Attached Files:

  13. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Yea it seems like its because the material isnt transparent and therefor it doesnt change the transparency,
    i will create a work around for this :), will keep you updated!.
     
  14. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    Cool! I have created a video showing some multiplayer gameplay using your asset, will post a link as soon as I have uploaded it :)
     
  15. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Awesome :),
    Cant wait to see it :).
     
  16. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    Just be gentle, our internet is dreadful and is a little laggy haha



    And apparently I am not very good at video editing, sorry for the lack of full screen :)
     
    Ghosthowl and ElroyUnity like this.
  17. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Looks great!,
    well done!
     
    tapticc likes this.
  18. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    New feature request :)

    Would it be possible to check for new building placement but at a custom distance in front of the character? Currently if there is say a 2 metre gap between the camera and the back of the character, you can place a building between the camera and the character. Ideally if the raycast can start in front of the character you would never place an item between you and the camera
     
  19. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Hey,
    Yes i will be adding a "startOffset" feature for the buildingPlacer :)
     
    BackwoodsGaming and tapticc like this.
  20. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    How to implement building decay and health!

     
    BackwoodsGaming likes this.
  21. LongitudeZero

    LongitudeZero

    Joined:
    Feb 5, 2016
    Posts:
    4
    Hi Elroy,

    Thanks for adding support to WebGL, This absolutely brilliant. Going to the asset store right away...

    @Shawn67: thanks for the tip and I agree with you about C# :)
     
    ElroyUnity likes this.
  22. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    My pleasure :),
    Email me when u get it and i will send you a link :)

    Elroy.
     
  23. Carrotpie

    Carrotpie

    Joined:
    Sep 25, 2014
    Posts:
    30
    Hi,
    Recently bought the asset, but upon loading the base scene it throws an error:
    A game object can only be in one layer. The layer needs to be in the range [0...31]
    UnityEngine.GameObject:set_layer(Int32)
    uConstruct.Sockets.BaseSocket:Awake() (at Assets/uConstruct/Scripts/Core/Sockets/BaseSocket.cs:135)


    I have created the layers, depicted in the docs. Dunno how to get it to work though...

    Edit: BTW, after importing the asset, my character controller script got messed up. Apparently you have it in the example project together with the asset. I lost all what I had edited for myself.
    Please don't do that. If you are using smth edited from unity's base assets, please rename them.
     
    Last edited: Feb 9, 2016
    ElroyUnity likes this.
  24. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Hey, maybe you didnt create them with capital letters.
    Open up the uConstructManager (Window -> uConstruct -> uConstruct Manager) and click on the second button (Create Missing Layers), that should do it :).

    for better explaining on the uConstruct Manager :


    Elroy :).
     
  25. Carrotpie

    Carrotpie

    Joined:
    Sep 25, 2014
    Posts:
    30
    They were with capitals, but new method worked. Thanks.
     
    ElroyUnity likes this.
  26. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Happy it works :)
     
  27. BackwoodsGaming

    BackwoodsGaming

    Joined:
    Jan 2, 2014
    Posts:
    2,229
    Unfortunately this is something a lot of asset publishers do. From what I understand, if there are demo scenes in the project and they don't work when Unity tries them, they don't approve the asset submission. I really wish Unity would come up with a dependency system so publisher could flag assets that are needed to run the project / run project demo. But unfortunately they don't. Really the best practice that I've found is scroll through the list and uncheck anything in the Standard Assets folder or things I know are already installed. A pain in the butt, but really pays off when compared to finding out afterwards and losing changes...

    Another best practice that I've adopted, if you are going to make changes to prefab settings of something listed in your project (not your scene hierarchy), make a duplicate of it and move it into your own folders and use that copy to make changes and use in your project. If you end up updating that asset down the road and made changes to the original, that can wipe your changes as well. :)
     
    tapticc and ElroyUnity like this.
  28. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Sorry didnt notice your edited part,
    I have changed the controller namespace so it will not override your script.

    Your script should still be in the project, it shouldnt overwritten or smth like that.
     
  29. Carrotpie

    Carrotpie

    Joined:
    Sep 25, 2014
    Posts:
    30
    Well it was overwritten. And there were also namespace error, right after import: RotateView could not be found. I fixed it myself though.

    P.S. Should I expect a tutorial for new UNet any time soon? Bolt is kind of outdated currently, so I jumped on to UNet to try out. Can't find where the objects are created though, to be able to sync them properly.
     
    ElroyUnity likes this.
  30. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Weird,
    Will look into that and change the names for next version :).

    There wont be any UNet tutorial anytime soon as its being heavily developed and its API is being changed very quickly, so even if i make a tutorial on it it will be outdated very quickly.

    Although, the next part of the networking (part 3) should cover an approach that would make it easier to use the tutorial on different networking libraries. I also know of some people that have implemented UNet on their own without much efforts, and if you get into any issue while implementing it, the support email is to your service :).


    Elroy.
     
  31. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    I think the main thing which would help people, regardless of networking method (Bolt, UNet etc.) is an example function which you could call to instantiate Prefab ID X at position X,Y,Z, snapped to building with ID #X and placed on position.

    You should be able to call this function without networking to make sure it works as well. Having this central routine would really help :)
     
    BackwoodsGaming and ElroyUnity like this.
  32. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Great idea :),
    Will be added !
     
    BackwoodsGaming likes this.
  33. Carrotpie

    Carrotpie

    Joined:
    Sep 25, 2014
    Posts:
    30
    Hey,
    I'm closely following the UNet developement and would argue, that after the new system release last year, they don't change much. Checked the Unity roadmap - it promises only server library exposition and better master server support.

    Like you said, I imagined it wouldn't be very hard (even for me - not a programmer), to figure out how to implement networking, but as I spent several hours yesterday looking in uConstruct for appropriate methods which create and check stuff in no avail. Tried to follow the Bolt tutorial, but I simply don't understand what's happening there. More of a game designer than programmer here...

    But I completely agree with #tapticc .The main doc (or API) should contain examples how to call stuff outside of uConstruct.

    I also have a few additional questions how to implement / requested features:
    1. After building destruction, leave rubble & close the socket, which the building part was attached to. / reopen it after the rubble was removed
    2. On socket occupation (when a part was attached to it) do smth, i.e. activate a GameObject (with stuff on it).
    Can these be done using your condition system?
     
  34. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    I will check that out, and if it looks like it has a stable API for a while i will include it in the new documentation i am working on which will cover more parts of the system :).

    Yes you are correct, currently there is only the API file that explains about methods, i originally created the networking tutorials to expand more on the API, and i will try to create more API related tutorials where possible (For example the decay tutorial).

    1. Yes you could do that, the BaseBuilding has an event called : "OnDestroyEvent" you could do some kind of actions when its called, so for example leaving rubble or any kind of a thing like that :).

    2. And yes you could do that as well :), there is an event that handles that too on the BaseBuilding : "OnSnappedToSocket", which will help you do those actions.

    You can do them both with conditions but then again, that would be pretty much a good start :).


    Hoping that answered your questions :),
    Elroy.
     
    Carrotpie likes this.
  35. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    Personally I don't think it is up to Elroy to make this work with Unet specifically, this isn't a multiplayer tool after all. I just feel having a method to create a given prefab at a given location and have it attach to a group is all it needs, specifically without needing the user to click on an existing building to attach a new one to the existing (or new) group.

    Multiplayer is such a big area, we should be doing that ourselves but figuring out what you need to do to create a building from scratch was more toil and luck than anything else, from a personal perspective.
     
    ElroyUnity likes this.
  36. Carrotpie

    Carrotpie

    Joined:
    Sep 25, 2014
    Posts:
    30
    I agree with that, in a way. It is sure a big area, not that big since HLAPI appeared though. Not that difficult either. What I meant by asking UNet tutorials, was exacly what you said about uConstruct being more adaptable. Unless I missunderstood again. Anyways Elroy seems to be planning something towards this.
    Cheers.
     
    ElroyUnity likes this.
  37. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    i definitely have some cool stuff planned for V1.2 with some cool built-in features that will allow you to add multiplayer more easily, i will also expose more API methods to allow easier modification and will try to add example to almost each method in the API :)
     
    Carrotpie and tapticc like this.
  38. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    V1.2 is getting closer and closer, heres the main features you should be expecting to :

    Additional MultiThreading - In 1.2 i've exposed all of the thread works allowing you to make so many new things multi-threaded and expect some core features to multi-threaded.

    SMARTER group managment - This is probably the most unique one out of this features list, this will include seperation and connection of groups, dynamic batching and more awesome stuff.
    The connection and seperation of groups will allow you to destroy a middle foundation of a group and seperating that specific group into 2 different groups. Placing a new block on that position will allow you to connect those 2 groups back together.

    Snapping Points - This idea was suggested by @Carrotpie, this will give you the ability to set up snap point on buildings, allowing the snap anchor to be different on different rotations, using that you will be able to use ANY shape of a building with the system, as rotation wont be a problem anymore.

    Huge performance increase - Using the multi-threading exposure and many internal code optimization, will give you an even higher performance than what you already get!.

    Improved Serialization - V1.2 adds a new aspect to the saving system, giving you the ability to get a serialization of the buildings in your scene and even externally load a data that was serialized. (gives you the ability to send the data over the network and loading it on different machines, for example... CUSTOM MAPS!!!, for example see the new"Level Editor demo").

    Inventory Pro Integration - The new version will have an integration for Inventory PRO, allowing you to just instantly use it in your game.

    Improved BuildingPlacer - V1.2 will introduce a new approach for the demo script, allowing it to be more generic, giving you the ability to have more than 9 buildings at 1 time and adding some cool additions such as placing sounds etc.

    New Demo Scene - V1.2 will introduce a new demo which will be a "Level Editor" demo, giving you a good example on how it should be done and showing you the new serialization methods.

    Bug fixes : V1.2 will fix all of the currently known bugs.


    ANY more suggestions are welcomed :),
    Elroy.
     
    Carrotpie, Teila and tapticc like this.
  39. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    Happy to help with testing :)
     
    ElroyUnity likes this.
  40. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Great additions, Elroy! Love the snap points. :)
     
    ElroyUnity likes this.
  41. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    Will the snap points be "You can snap object types A, B, F and G to this point"?
     
    ElroyUnity likes this.
  42. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Thank you :)

    Its a bit different, but the way it works is that it has point on buildings, the system will choose the closest snap point and use it as a reference for the origin. i will have a better example by the end of the day :).
     
    BackwoodsGaming, Teila and tapticc like this.
  43. Dark5upremo

    Dark5upremo

    Joined:
    Apr 2, 2015
    Posts:
    6
    Great stuffs, can't wait to test :)
     
    ElroyUnity likes this.
  44. judah4

    judah4

    Joined:
    Feb 6, 2011
    Posts:
    256
    Hi, I dont know if you know about this bug but if a foundation is not at a cardinal rotation the wall snapping is off. I was able to observe this when I changed the create building instance function in BuildingPlacer to this
    Code (CSharp):
    1. public virtual void CreateBuildingInstance(GameObject building)
    2.         {
    3.             var go = GameObject.Instantiate<GameObject>(building);
    4.             go.transform.position = new Vector3(-999, -999, -999);
    5.             go.transform.rotation = Quaternion.Euler(0, transform.rotation.eulerAngles.y, 0);
    6.             go.name = building.gameObject.name;
    7.             currentBuilding = go.transform.GetComponent<BaseBuilding>();
    8.             currentBuilding.isBeingPlaced = true;
    9.         }
    Here is a video show the bug. First at regular placement angles and then placing the building at a different rotation.
     
    ElroyUnity likes this.
  45. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Hey, thank you for bringing this bug into my attention,
    It will be fixed in the new version :). (V1.2).

    Elroy.
     
  46. judah4

    judah4

    Joined:
    Feb 6, 2011
    Posts:
    256
    Awesome, thank you. Really enjoying uConstruct.
     
    ElroyUnity likes this.
  47. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Thank you for your kind words :),
    Happy you are liking it !
     
  48. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Update is still in works, here are some new additions to the upcoming version :

    - Built in ability to show sockets on runtime
    - Exposure for inputs on the building placer for inventory etc
    - Part 3 of networking (faked entities managment)
    - Fix angular sockets behaving weirdly.
     
  49. judah4

    judah4

    Joined:
    Feb 6, 2011
    Posts:
    256
    Im having an issue with batching. When placing a building part with batchBuilding set to false it's still trying to batch. I only noticed it because half of one of my models disapeared because of it's submesh not being recreated in the batched mesh.

    I think this method in BaseBuildingGroup is ignoring the setting and sending the MeshFilter anyways.
    Code (CSharp):
    1. protected MeshFilter[] GetUpdatedBatchData(BaseBuilding building)
    2. {
    3.     return building.GetComponentsInChildren<MeshFilter>();
    4. }
    Edit: yeah, I changed it to this and it works as I was expecting.
    Code (CSharp):
    1. protected MeshFilter[] GetUpdatedBatchData(BaseBuilding building)
    2. {
    3.        if (!building.batchBuilding) return new MeshFilter[0];
    4.  
    5.        return building.GetComponentsInChildren<MeshFilter>();
    6. }
     
    Last edited: Feb 20, 2016
    BackwoodsGaming likes this.
  50. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Yes its fixed in the new version, but glad you got it fixed :)
     
    judah4, BackwoodsGaming and tapticc like this.