Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

World Building Modular Building Tool : Black Builder ,Looking For Some Tips And Advices

Discussion in 'Tools In Progress' started by sadygames, Jul 25, 2023.

  1. sadygames

    sadygames

    Joined:
    Jan 29, 2017
    Posts:
    1
    Hello Everyone! ,Im Sady , Nice To Meet Ya, The Reason Of This Post Is To Get New Ideas On How To Improve The BB ( BlackBuilder )

    The Way My Tool Works Is With Anchor Points , Every Wall (Every Side) Depends On The Previous One , Every Anchor Has His Own Settings , Lenght , With Windows , Without Windows , With Doors , Whitout Door , Etc...My Question Is ,Should I Use Scriptable Objets For This? I'm Not Very Familiar With Scriptable Objects , I Know They Are Data Containers ,But Can I Change That Data In Realtime?? ,I Need To Modify It In PlayMode , Like Im Doing In This Gif. The Tool Works Fine In My Pc , I Have An Rtx2060 , My Fear Is That Maybe It Works Fine In MY Pc, And It May Be Slow In Other Devices , This Is Not Geometry Being Created At RunTime ,These Are Prefabs , Like Any Other Modular Building Assets, Instead Of Draggin The Prefabs One By One My Tool Does That For You , It Spawns(Instanciates) The Prefabs To Fit In That Specific Lenght , I Know ECS Would Be Great For This , But Unfortunately I Know Nothing About It, Every Tutorial I Saw Is Either Outdated Or Depricated , And The Documentation Shares The Same Problem ,And That Turbo Guy (Turbo Makes Games Youtube Channel) Hasn't Done A New Tutorial Yet xd So Im Walking In New Territory Here , Coding Its Not The Problem , The Problem Is The Performance, Like I Said It Works Fine In MY Pc ,But With Every Anchor Having Their Own Settings And The Prefabs Being Instanciated At Runtime , Im Afraid That It Would Work Bad In Other Pc's , Since I Want To Sell This Tool , And I Cant Sell Something That Is Laggy Af , Once You Finished Your Building Or Interior , You Can Save It As A Prefab And It Combines Alll Of The Meshes , Every Building You See In The Background Its A Unique Mesh Made In BlackBuilder
    Any Advice Is Welcome , Or Something That Points Me In The Right Direction
    Anclajes.gif

    Heres And Example Of Playing With Anchors, 3 Anchor On The Bottom Without Touching The Height , And 3 Superior Anchors With Different Prefabs And Different Height , Every Other Building You See In The Background Was Made Like This (Without The Lights).
    AnclajeSuperior.gif

    This Is My First Post , So Sorry If I Posted In The Wrong Place Or Did Something Wrong.
    Thanks Everybody.
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    3,899
    In that case the GPU is practically irrelevant when it comes to the speed of constructing this.
    Also DOTS won't help much because instantiating game objects still needs to be done on the main thread.

    But I see no reason why this wouldn't run fast enough on most mediocre machines. It is often said that "Instantiate is slow" but this needs to be considered in context, as "slow" is very relative. It's slower than you know Vector3.Distance() but it's nowhere near as slow that you cannot call it hundreds of times per frame and still achieve 60 fps. It really depends on the prefab actually, so if the prefab has a deep hierarchy and/or contains a lot of scripts or just one that performs heavyweight stuff during Awake/Start/OnEnable then it will be a lot slower than instantiating a Cube prefab with just rigidbody and collider.

    Anyway ... you can always downclock your machine to emulate slower computers. ;)
    Disabling CPU cores and setting max. CPU frequency can easily be done in the BIOS. You can also use Task Manager to change which CPU cores a running process can utilize - but this really only matters if you actually do write multithreaded code.
    For downclocking the GPU you'll need some performance tuning tool - they do allow you to go in the other direction too. I think Nvidia has its own, most GPU vendors (Asus, Gigabyte, etc) provide custom ones and there are generic tools also.