Search Unity

[Released] Modular Building System (Realtime/InGame building system)

Discussion in 'Assets and Asset Store' started by ModularTech3D, May 12, 2015.

  1. ModularTech3D

    ModularTech3D

    Joined:
    May 11, 2015
    Posts:
    113


    MBS
    (Modular Building System) is an in game real time modular building system.

    Asset Store
    MBS Wikia
    Support Forum

    Version 1.0

    • Foundation Placement Script
    • Pillar Placement Script
    • Wall Placment Script
    • Stairs Placement Script
    • Ceiling Placement Script

    Updated to 1.1 - 10/03/2016
    • Updated Wikia Page - Added several new up to date setup guides.
    • Added Module Manager Editor Extension - Now you can manage all your building modules from a custom editor window. Add new modules and generate the prefabs automatically saving a lot of time.
    • Added Prop Placement Script - Place props in your buildings and on the terrain, these can either be placed on a ceiling, wall or floor.
    • Added Window Placement Script - Windows can now be placed onto window sockets.
    • Added Door Placement Script - Doors can now be placed onto door sockets
    • Added Activate Script - Allows you to open doors and can be expanded upon for activating other things.
    • Added Action Bar Script - Equip items via action bar.
    • Added Inventory Script - Carry items around in game.
    • Added Item Database - Add new items via inspector
    • Improved placement methods in all modules - Improved snapping and placement code.
    • Cleaned and commented code - Code is now heavily simplified and mostly commented.
    • Code Documentation - Code documentation generated by doxygen.
    • Project Setting Package - Import Layers and Tags without needing to setup by hand.
    • 4 Example Scenes
    FPS Demo Scene Webplayer Build http://tinyurl.com/qbm5es4
    FPS + HUD Demo Scene Webplayer Build http://tinyurl.com/p6bye4c
    RTS Demo Scene Webplayer Build http://tinyurl.com/ph5527h
    RTS + HUD Demo Scene http://tinyurl.com/o8peb6h






    Any thoughts/suggestions/questions welcome.
     
    Last edited: Mar 17, 2016
  2. Brian-Ryer

    Brian-Ryer

    Joined:
    Mar 5, 2013
    Posts:
    43
    Looks very interesting, I can see quite a few people here would want a building system with the features you are offering myself included, watching thread for further updates.
     
    ModularTech3D likes this.
  3. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    looks interesting. the controls are a little bit awkward somehow.
    i would like to see a more strategy game like example or even third person. i think thats better for building stuff than first person view
     
    ModularTech3D likes this.
  4. ModularTech3D

    ModularTech3D

    Joined:
    May 11, 2015
    Posts:
    113
    I will be adding 3rd Person and RTS example scenes soon, I will update this thread when i get them finished.

    Thanks for the feedback,
    Lee.
     
    Der_Kevin likes this.
  5. ModularTech3D

    ModularTech3D

    Joined:
    May 11, 2015
    Posts:
    113
    Updated the post, there is now a RTS example scene up at:
    RTS Demo Scene Webplayer Build http://tinyurl.com/ph5527h

    And video here.
     
    SecretStudio likes this.
  6. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    OK. Take my money. Where can i get it? :D
     
  7. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    okay i played a little bit around with the RTS example and its pretty fun so far and the controls are way better there :) i would have one suggestion:
    The Foundation piece you can move around freely and then it snaps to the nearest foundation* when you have one. for the pillar, wall, doorway etc the moving feels a little bit clunky. would be nice if you can also drag them around how you want and when you near the "snapable" area, it snaps in. you know what i mean?

    *but if you want to continue on another foundation after you have build somewhere else, it doesn't snap anymore

    here is a pretty good example (at 7:50):
     
    Last edited: May 18, 2015
    ModularTech3D likes this.
  8. ModularTech3D

    ModularTech3D

    Joined:
    May 11, 2015
    Posts:
    113
    Sure that's a good idea, i did think that it was a bit weird as when you equip a module and it doesn't appear or there is no visual indicator then it can be confusing but i thought most people would have a UI and it may seem more obvious but that is a small change i can add with a big benefit.

    Will update the thread shortly, cheers again,
    Lee.
     
  9. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,294
    Hope to see what Kevin suggested and that we can buy it :)
     
    ModularTech3D likes this.
  10. ModularTech3D

    ModularTech3D

    Joined:
    May 11, 2015
    Posts:
    113
    I've updated the example Web Player scenes and I've just uploaded it to the asset store so waiting for it to get reviewed, in the meantime if you can't wait for that (could be several working days) PM me and we can work something out :rolleyes:
     
    Last edited: May 20, 2015
  11. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    really cool now :) cant wait to get my hands on when its in the store

    i hope I am not to annoying but i will just write down what i still find awkward:
    - snapping of the foundation: i needed some time to understand how the snapping works because it only snaps when the mouse is over the previous foundation. would be better if it just snaps when the new foundation is dragged near the old foundation regardless the position of the mouse. / how would you do this on mobile? i think the current solution wouldnt work there
    - how can i rotate a wall? I am able to place them to north and south but can not close the building on the west and east side.
    - remover: an indicator which tile you are currently hovering over would be nice :) /also think about how would you do this for mobile (maybe erase it with doubletap - first tap shows the indicator, second tap as conformation for erasing)
    (all rts example)
     
    Last edited: May 20, 2015
    ModularTech3D likes this.
  12. ModularTech3D

    ModularTech3D

    Joined:
    May 11, 2015
    Posts:
    113
    Nah not annoying at all tbh, i appreciate the feedback and am all ears for ideas :cool: This is my first asset and i am planning to add as much as possible to it over the coming months i also have plans for model packs such as medieval, modern, viking etc etc.

    There will also be an inventory/action bar example scene soon which will allow there to be many more modules than just 8 which is in the current example scenes, this new scene will also have an item system and item database. This opens up the possibility of having multiple ceiling types or walls and/or custom modules such as for instance a castle gate that is 2 x 1 foundations in dimensions and anything that you need.

    I originally built this system for my own game, which is a medieval survival game. Decided to rip the building system out of it and tidy it up for use on the asset store. You can check that out below, it's multiplayer, and of course i will be including some multiplayer examples with the building system asap.


    Now to answer your questions :p

    Snapping of the foundation - Good idea, i think i have an idea how to do this, i shall have a play around.

    Rotate Wall - You should be able to rotate the Module using the mouse wheel providing it's snapping to a foundation or ceiling, if it snaps to a wall, it inherits that rotation (i thought that might be a good thing or at least save some effort), however, i can see how that could be confusing, so what I'll do is add a tick box so that you can turn that option on and off.

    Remover - Sure, there's a few ways to do this but I'll have a think about it, probably either a UI or World Space marker and then highlight the targeted module.

    Any other suggestions are welcomes, thanks again o_O

    Regards,
    Lee.
     
    Last edited: May 21, 2015
  13. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    Looking cool the medieval stuff :)
    i am still not able to rotate the wall because the scroll wheel is moving the page up and down :/ anyway, i guess you will figure it out :)
    what i also just saw, do you plan to do anything against "floating houses" because you can just erase the first floor and the house is floating in the air :D
     
    ModularTech3D likes this.
  14. ValrikRobot

    ValrikRobot

    Joined:
    Jun 26, 2013
    Posts:
    206
    Exactly what i have been looking for. Will this work on android?
     
    ModularTech3D likes this.
  15. ModularTech3D

    ModularTech3D

    Joined:
    May 11, 2015
    Posts:
    113
    Ah, i haven't ran into that problem, i shall add an extra button for rotation just in case others are having the same issue! What browser are you using? It's working on Fire Fox and IE if u don't use those.

    Yeah i have thought about the issue you brought up, i'll make it so you can't remove a pillar if it supports another pillar or a ceiling these are the main structural parts. Walls, stairs and ceilings can be removed regardless. This will force users to remove floors a layer at a time and stop the floating issue.

    Later on i will add an additional option which can be turned on enabling the destruction system, so for instance you can remove a pillar even if it supports a ceiling and pillars above, then those ceilings and pillars will collapse using physics. Could also make the modules break and crumble into smaller parts etc.

    I will be updating the web players again soon with all the changes you suggested in your previous two posts.

    Until then!
     
    Last edited: May 22, 2015
  16. ModularTech3D

    ModularTech3D

    Joined:
    May 11, 2015
    Posts:
    113
    Should be able to, this currently doesn't support touch screen but again i can add in an option to change it easily with just a drop down menu. I'll look into it, can't see it being hard to set up tho so hopefully i can include that very soon.
     
  17. ValrikRobot

    ValrikRobot

    Joined:
    Jun 26, 2013
    Posts:
    206
    Touch screen not important at all. not what i have in mind.

    I'd like t share with you my plans, but have to do it privatly. I sent a PM
     
  18. w34edrtfg

    w34edrtfg

    Joined:
    Nov 23, 2014
    Posts:
    72
    It's just me or demo links are offline?
     
    ModularTech3D likes this.
  19. ValrikRobot

    ValrikRobot

    Joined:
    Jun 26, 2013
    Posts:
    206
    I'm getting that too, but maybe he's just updating the demos
     
    ModularTech3D likes this.
  20. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,294
    Please support touchscreen as an option.
     
    ModularTech3D likes this.
  21. ModularTech3D

    ModularTech3D

    Joined:
    May 11, 2015
    Posts:
    113
    Back up now cheers for heads up.

    Will do ;)

    Ok no worries, i'll check my inbox.
     
    Last edited: May 22, 2015
  22. ModularTech3D

    ModularTech3D

    Joined:
    May 11, 2015
    Posts:
    113
    Just thought i'd share this. It's the building system before i dissected it from my game project ;), was messing about here with some building physics.



    Surfing on a foundation block across terrain ;) (not related to building system really lol)

     
  23. Rico21745

    Rico21745

    Joined:
    Apr 25, 2012
    Posts:
    409
    I'm curious about that runtime inspector you show in the video. Is that an asset or is it something you made custom for your game?
     
    ModularTech3D likes this.
  24. ModularTech3D

    ModularTech3D

    Joined:
    May 11, 2015
    Posts:
    113
    Which video? If you mean the ones in the previous post showing the GameTime stuff? All the assets and scripts are custom made by me. (except for a few standard assets like the FPS controller etc)

    Edit*
    If you mean the one from the Survival game then that is Bolt, it's what i'm using for networking, in debug mode it has a built in console and takes care of displaying info once hovered over.
     
    Last edited: May 24, 2015
  25. vXiRiSHXv

    vXiRiSHXv

    Joined:
    Jan 31, 2015
    Posts:
    3
    Bookmarked this thread, can't wait to check it out on the asset store.
     
    ModularTech3D likes this.
  26. ModularTech3D

    ModularTech3D

    Joined:
    May 11, 2015
    Posts:
    113
    Cool glad to hear it :D
     
  27. Reiner

    Reiner

    Joined:
    Dec 2, 2012
    Posts:
    214
    Looks greate cant wait to buy it
     
    ModularTech3D likes this.
  28. ModularTech3D

    ModularTech3D

    Joined:
    May 11, 2015
    Posts:
    113
    Just updated the webplayers for both the RTS and FPS examples. Improved foundation placement, and auto building managment, also now includes physics so if you remove certain building modules will cause a chain reaction of collapsing building modules ;)

    Will post a video up in the next post but until then check out the webplayer builds, let me know if you like the new foundation placement setup.

    FPS Example
    RTS Example
     
  29. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Nice asset! Can you replace the models with your own? Could it be used with any modular parts?
     
    ModularTech3D likes this.
  30. ModularTech3D

    ModularTech3D

    Joined:
    May 11, 2015
    Posts:
    113
    Yes, very easily, you can just select a different mesh in the inspector, it's possible to change the width, height and depth of modules via the inspector also.
     
  31. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    This is perfect for us then. We want to put modular pieces in the game and have them link together with mounts. So a player can place an object, and then place another object that can mount to the first one. These will be objects, such as a base house and then an addition to the house. Sounds like that would work well.

    How does the ground handle the placement? Does it have to be flat or does placing the item smooth the ground...or can you place an item slightly below ground, such as a base for a building?

    Thanks.

    P.S. Actually, I am really asking if the object can be placed on a slope and if so, will it sit partially underground, which is what I want. :)
     
  32. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Oops, I had one of my team test out the demo. It wouldn't work on my computer because F1 takes a picture! I now have several snapshots.

    Anyway, it does work on the slope the way we want it so it is perfect. :) Thank you. Can't wait until it is out.
     
    ModularTech3D likes this.
  33. ModularTech3D

    ModularTech3D

    Joined:
    May 11, 2015
    Posts:
    113
    Thanks, i changed the Help key to H, you can also now rotate objects with the < > keys as requested by Der_Kevin who was having issues with his mouse wheel scrolling the browser up and down. Web players now updated.

    Glad it's working as desired, i will add an optional steepness check which can be turned on and off and you will also be able to set the steepness angle at which a foundation can no longer be placed.

    It's been submitted to asset store so just waiting for it to be reviewed.

    Thanks,
    Lee.
     
    Teila likes this.
  34. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    Awesome! i think i have nothing to complain anymore :D cant wait to get my hands on it

    somehow I still cant rotate the object - also not with the arrow keys. iam on OSX and safari by the way. on chrome the game crashes right after loading. but i think its google drive related cause i had this before with google drive
     
    ModularTech3D likes this.
  35. ModularTech3D

    ModularTech3D

    Joined:
    May 11, 2015
    Posts:
    113
    It's the period and comma keys, i used the < > symbols in the text which are basically the same keys but can see how that could be confusing, i'll change it to the cursor keys instead.

    I heard chrome updated recently breaking the web player, lots of people were angry about it so maybe that's the reason?
     
  36. ModularTech3D

    ModularTech3D

    Joined:
    May 11, 2015
    Posts:
    113
    Here's a couple of updated videos :)


     
  37. ivendar

    ivendar

    Joined:
    Feb 18, 2010
    Posts:
    242
    Looks like good work. Does this include source ?
    Considering to buy depending on price, but would need a way to be able to alter it to have certain bigger pieces that can only match to other appropriate pieces. So some kind of prefab builder having Foundation + 2 Walls for corner piece for example, Floor 1 only allowing Floor 2 above and nothing after and so on. So some way to limit how big buildings can be and look and where different pieces can connect. Also is there any way to prevent foundations to be set at certain areas or one to mark a zone where those can be placed ? Won't be smart to be able to build where a road is for example or maybe you just don't want to allow building everywhere. ^^
     
    ModularTech3D likes this.
  38. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Videos look fantastic! I do have one other question though...can the destructive mode be disabled? I really don't want piles of garbage all over the world. :)

    Oh, and another, is there anything prohibiting this to be used in multiplayer? I realize we would have to make it work with server and client, just want to make sure that it is possible.

    Thanks.
     
    ModularTech3D likes this.
  39. ModularTech3D

    ModularTech3D

    Joined:
    May 11, 2015
    Posts:
    113
    Yeah you can alter the source and recycle items code to make your own custom items etc, you can set what modules can connect to what modules and is already a part of the script so once you get under the hood and see the code it's easy to see how to make a module snap to another particular module and not allow others. You can edit the grid size for each module aswell.

    Most object when placed do an intersection check to make sure it's not intersecting with for instance a road or lamp post, so you can't place it in this situation, it will turn the placement model red.

    Someone asked for me to include a Territory system so players can own a plot of land and build only there which i am going to include an example scene demonstrating how to do this.
     
    ivendar and Der_Kevin like this.
  40. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Fabulous! Thank you so much!
     
  41. ModularTech3D

    ModularTech3D

    Joined:
    May 11, 2015
    Posts:
    113
    Yes sure haha, it is actually all taken care of by the remover tool, i will make this optional so you can turn it off. I am also going to add in a timer to delete the collapsed modules after a certain period so might be an option for some.

    It's totally possible to use in multiplayer, it's a little bit more complicated than simply instantiating prefabs of course. I've had it working with TNet before but now i'm currently using Bolt in conjunction with my system.

    With bolt i just used the event system to spawn building modules on all clients (server side) and Tnet i used either RFC ( Remote Function Calls ) or RCC (Remote Creation Calls ) RCC is unique to TNet i think, similar to a RFC tho except it's used for spawning prefabs that have hierarchies i think.

    I am going to be creating and including multi player example scenes and also a tutorial for the more well known networking solutions.

    Edit* Here is the system used with Bolt Networking
     
    Last edited: Jun 1, 2015
    Teila likes this.
  42. Reiner

    Reiner

    Joined:
    Dec 2, 2012
    Posts:
    214
    Works this with ufps or other multiplayer photon networks?
     
    ModularTech3D likes this.
  43. Iron-Oxide

    Iron-Oxide

    Joined:
    Nov 20, 2013
    Posts:
    34
    Looks good. Are doors on the to-do list?
     
    ModularTech3D likes this.
  44. ModularTech3D

    ModularTech3D

    Joined:
    May 11, 2015
    Posts:
    113
    Funnily enough someone asked me to integrate it into the UFPS + Photon Network example so i am gonna be doing that soon ;) Just need to get to grips with UFPS first.

    Yep, this system was in my game project first and that had doors i just haven't got around to adding them in this version of the system yet but will add that very soon, also windows and prop placement where you can limit which angles/steepness that you can place an item, for instance place tables only on the floor or paintings only on a wall.

    For the others asking about the optional pillar check this can now be turned off in the inspector and the distance at which items can be placed can be edited in the inspector too.

    Stackable foundations - Foundations can be set to either Off, Unlimited or Limited.
     
    Iron-Oxide likes this.
  45. ivendar

    ivendar

    Joined:
    Feb 18, 2010
    Posts:
    242
    Great thanks for reply. Also great to see you use Bolt, that will also help.
    Additional request for the territory system. Can this be made to allow a whole territory to be useable by all players / all players by faction you add them to and the mentioned buy for single players ?
    I'm most interested in the option to mark whole territories as buildable and prevent in others to make sure no one blocks city gates or the like.
     
    ModularTech3D likes this.
  46. ModularTech3D

    ModularTech3D

    Joined:
    May 11, 2015
    Posts:
    113
    Sure essentially, the territory would be defined by a cube or sphere collider, the size can be custom, you can check which players are inside this cube. You can also have a script attached to it that includes a permission list of which players actually have permission to build there. You could also include things like whether someone is exiled and banned so guards would attack them or they can be killed by other players with no penalty for doing so.

    you can then approve or dis approve other players/AI to be citizens, plus give certain citizens building permissions. Perhaps a title system would work for this. For instance "City Planner" title.

    Inside the territory, you could also place down smaller cubes which are plots of land, that other citizens can rent and build houses on or rent existing buildings.

    Plots could also be industrial, commercial or residential so you can set certain areas to be only used for crafting, for instance black smith, in the building you get boosts so you can make items that can't be made outside of a city/settlement.

    Commercial areas are basically markets and residential.

    Could also have political areas, royal palace etc etc

    What you reckon to that?
     
    julianr, ivendar and Teila like this.
  47. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    I reckon I would really like that and have to send you a dozen roses. :)

    Fantastic! Please add all that! :D
     
  48. ivendar

    ivendar

    Joined:
    Feb 18, 2010
    Posts:
    242
    Is this a dream ? Yeah add it all please. :D
    Just hope it doesn't become too complicated for me to understand, so tutorials for everything very welcome. ^^
     
    ModularTech3D likes this.
  49. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,783
    This would be amazing with this:
    http://forum.unity3d.com/threads/3dforge-exteriors.316736/

    And then if you added a blueprinting system so that you could save the steps to an XML file or something, the ai in your game could later reconstruct your buildings for you :)

    BTW I like the physics based destruction as well.

    Nice work!
     
    XPAction, ModularTech3D and Teila like this.
  50. ModularTech3D

    ModularTech3D

    Joined:
    May 11, 2015
    Posts:
    113
    Sure i will add something like this, not only for in game but also for the editor extension for speeding up level creation etc

    Thanks :p
     
    AdamGoodrich and Teila like this.