Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Workflow Case Study - Show us your pain!

Discussion in 'Editor & General Support' started by willgoldstone, Mar 1, 2019.

  1. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,457
    It would be very convenient to have a history functionality. I regularly have to edit a group of objects and instead of selecting them all the time via mouse click I could use e. g. the side buttons of the mouse for navigating them up and down. Like in a web browser.
     
    laurentlavigne likes this.
  2. freso

    freso

    Joined:
    Mar 19, 2013
    Posts:
    24
    Unity 2019.4.1 (and let's face it, probably every other version).
    Please clean up your tooltip documentation.
    Documentation is extremely important.

    Bad examples in URP/Lit shader:
    • Workflow mode: "Select a workflow that fits your texture. Choose between Metallic and Specular".
      • Oh, really? Thanks for the help, but I kind of already know how labels and dropdowns work in a UI. Perhaps give some tip on the actual function?
    • Surface type: Same as above.
    • Occlusion map: "Sets an occlusion map to simulate shadowing from ambient lighting"
      • Unnecessary to write "Sets an occlusion map", but the tip actually says something about what it does.
    • Normal map: "Assigns a tangent-space normal map".
      • Unnecessary to write "Assigns a ...", and also what is the difference between "assigns a" and "sets a"? Also, no actual help in saying what it does.
    • Emission: No tooltip at all. :p
    Good examples:
    • Alpha clipping: "Makes your material act like a Cutout shader. Use this to create a transparent effect with hard edges between opaque and transparent areas".
      • No "Sets alpha clipping": GREAT! Less is more.
      • Actually describes what it does.

    OK, I'm sure you get the point. Streamline the vocabulary, remove unnecessary "Sets foo" text, add missing tooltip.
    Have one person in charge of streamlining vocabulary. Multiple people in charge of their respective fields can submit the tooltips to this person that OK/modifies it.

    After you have done this, also implement a quick-link function on variables that opens up the documentation (or a browser link to the docs if documentation not installed). Preferably via Ctrl-click or right-click/view docs.
     
  3. AL_W

    AL_W

    Joined:
    Jan 25, 2016
    Posts:
    327
    hi @gabrielw_unity @willgoldstone

    I made another resizing bug video. (Or maybe it's a feature?) :D

    Basically It's impossible to resize the window when profiler is enabled. Please see the gif

    Thanks for this thread!

    UnityProfile.gif
     
    awesomedata likes this.
  4. petersvp

    petersvp

    Joined:
    Dec 20, 2013
    Posts:
    44
    You can also add the undocumented [DefaultExecutionOrder(XXX)] attrib to your Behaviour derivate class
     
  5. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    5,004
    I've run into this myself, but not with the profiler window necessarily. I'm not 100% sure, but I think this is a general bug where Unity's really bad at handling clicks when the editor is chugging. So if you click and drag slowly, it should work better.

    A similar case is double-clicking assets. If you double-click, and the first click opens an inspector with a slow OnEnable, the double-click will hit the asset your mouse is over when the OnEnable finished, not the double-clicked asset.

    In short, it seems Unity's message system sometimes uses the mouse position when the click is handled, rather than when it was clicked, which is bad. I suspect the drag bug is very similar, I've noticed it myself.
     
    laurentlavigne, AL_W and MartinTilo like this.
  6. sand_lantern

    sand_lantern

    Joined:
    Sep 15, 2017
    Posts:
    155
    @indieDoroid

    It's possible that it has something to do with the issues detailed in this thread. I've certainly run into it where I can't move game objects or click and drag the scene camera around smoothly because inputs feel like they're running through molasses.
     
    AL_W likes this.
  7. oxysofts

    oxysofts

    Joined:
    Dec 17, 2015
    Posts:
    83
    I recently suggested a selection history search provider to the Quick Search team. A selection history has been in demand for years, and I think offering it as part of Quick Search would be the most efficient and clean way to do it!
     
    awesomedata likes this.
  8. fderudder

    fderudder

    Joined:
    Apr 13, 2010
    Posts:
    33
    I just noticed that the feedback website is no more, so I will repost here some of my favourite editor's pet peeves from all those years of using Unity.

    #1 Project view could use a horizontal slider
    #2 Version Control Overlay adds pixels for each item of the tree view (offsetting 3 times each item)
    #3 Add some basic ordering option for CreateAssetMenu item without having to rely on 'order' parameter


    #1 and #2 are related, because when you switch on Version Control, you end up with the row item of the treeview being offset 3 times (once for the arrow, once for the icon, once for the name). I'm aware that space is needed for overlay icons, but should not applied at least for the arrow.

    I will concede that it seems to feel a bit better since the UI update, but there is still the sensation that there is too much padding in the AssetsTreeView. (see https://github.com/Unity-Technologi...or/Mono/GUI/TreeView/AssetsTreeViewGUI.cs#L51 )

    fig.1: no VCS activated
    upload_2020-7-6_14-39-43.png

    fig. 2: VCS activated
    upload_2020-7-6_14-40-36.png

    for #3 (Add some basic ordering option for CreateAssetMenu item without having to rely on 'order' parameter), that is simply because I really like Scriptable Objects. As Marge Simpson would say, "I just think they're neat". So I use them extensively (~120 independent items so far, in 20 categories)

    Scriptable Objects:
    upload_2020-7-6_15-18-2.png

    But the way they are ordered is beyond my understanding (see note), and after a certain number of items, relying on the order = xxx parameter becomes a maintenance nightmare.

    Having a basic alphabetical ordering would go a long way.

    I mean...
    upload_2020-7-6_14-56-50.png


    Note: As far as I know, they actually are in the order they are discovered when populating the list from Type Cache, then the order parameter is applied (but that's probably on the native codebase side). There's not much we can do since it's in your editor code. See here https://github.com/Unity-Technologi...6a3ce5439/Editor/Mono/AttributeHelper.cs#L127

    Cheers
     
  9. Werti100

    Werti100

    Joined:
    Aug 3, 2018
    Posts:
    30
    Hi! I want to bring up an issue of mine with the work flow of reflection probes in the unity editor.

    so here goes: when you bake reflection probes it creates a new asset, which is cool, but the naming convention is terrible! it just goes in a folder of the scene's generated assets, and gets an automatically generated name such as "ReflectionProbe-1/ReflectionProbe-2/ReflectionProbe-3.." etc etc. I also tried renaming them in the assets and it automatically went back to it's generated name.

    This is bad because big projects like mine end up having 100+ un-named reflection probe assets and it makes it annoying to find any specific one for when you need it. Example: looking for a cubemap for a fake interior shader.

    So here's what I propose! Have the generated name instead take the name of the reflection probe object in the scene, that way I can simply name reflection probe objects after the area they're in, making it easy to find any specific one later when needed. if the object name is default then it does what it currently does, and that's fine, because it's my responsibility. duplicate names could get a (1) or (2) depending on how many there are.
     
    Last edited: Jul 10, 2020
    laurentlavigne and awesomedata like this.
  10. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    635
    I hate I can´t remap all FBX axes like Y up and which one of remaining is forward.
     
    Marc-Saubion and awesomedata like this.
  11. Werti100

    Werti100

    Joined:
    Aug 3, 2018
    Posts:
    30
    I have to raise a couple issues with the asset import process and workflow. I think it's time 3D artists receive some quality of life improvements.
    • LOD Creation
    One of the big workflow problems with unity to me as a 3D artist is the lack of a mesh editor/ previewer. UE3 and UE4 has a nice static mesh editor that lets you do things such as: generating LODs, adjusting LOD range, generate collision mesh, merge matching materials and much more. Having to create your LODs manually is such a waste of time and just a pain to organize manually in a 3D software.

    • Modular asset / prefab management / Simplifying import process
    Another big issue I have with unity's workflow is that you have to drag imported FBXs into the scene, hide the collision mesh, set all the proper static flags, then drag it back into the folder, save that as a new prefab. Really what would be ideal is that you can just do all that in the imported FBX file, but you can't, there's a plethora of settings you can't edit in a FBX file. That's what ue3/ue4 get right, imported FBX files are treated as prefabs already, you can open them up in a nice mesh editor to edit whatever needs to be edited. Sure if I need to add some game components to those meshes then I'd create a NEW prefab and save it as a variant with the components, that makes more sense. Although maybe it'd be possible to also allow the users to add components in the mesh editor?

    also a way to have meshes in a FBX file detected as collisions would be nice, something like how LODs are detected with suffix (barrel_LOD0, Barrel_LOD1) could do (Barrel_Collision), then it toggles off the renderer of said mesh and removes collision from other none collision meshes. I do realize this is a bit specific to the type of game I'm making but perhaps all it needs is to be customizable, or allow people to turn that function off.

    Keep up the good work unity devs, recent updates have brought a lot of good stuff, here's hoping for more!
     
    Last edited: Jul 15, 2020
  12. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,121
    Yup. This is just suxx0rz -- but _everyone_ has a copy of Houdini, right?

    Also _everyone_ can program an HLOD system for large, detailed, floating origin worlds too. And make their own imposter system. And use the editor to handle all this extra fancy-pants "editing" too. Right? ... Riiight??


    *smh*

    Lots of work to do.
     
    Lars-Steenhoff likes this.
  13. KokkuHub

    KokkuHub

    Joined:
    Feb 15, 2018
    Posts:
    418
    The LOD pipeline in Unity is primitive, at best. Littering the GameObject hierarchy to setup LODs is terrible. That should be handled directly by the MeshRenderer or a new Renderer component designed for that.

    When was the last time we got a brand new native component anyway?
     
  14. Werti100

    Werti100

    Joined:
    Aug 3, 2018
    Posts:
    30
    Good point, The hierarchy is very hard to keep clean, and always balloons up to this huge thing that doesn't do much but it's best to keep it organized, kinda just takes time away from my day. It truly only comes in handy when you're dealing with scripted actors, not static meshes.
     
    awesomedata likes this.
  15. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,121
    I feel like something like a ShaderGraph or SRP pass might be a better place to handle things like LODS and HLODs (i.e. stuff for scriptable / tweakable visibility) than a simple (dumb) component. However, I absolutely _do_ agree that mesh-based stuff like this should _definitely_ be handled during _mesh_ rendering process (and nowhere else). I had a bit of words with the SceneVis team about handling visibility issues like these for floating-origin / open worlds but their response was "take it up with the World Building team" (which drove me _nuts_).

    Instead -- This is the answer I propose:


    "S(M)RP" -- Scriptable Mesh-Rendering Pipeline


    Unity has been looking at updating the ancient "Mesh API" -- but I think we should be looking at our entire procedural mesh _process_ (and understanding more 'distant' reasons why users _need_ procedural rendering to begin with!)

    i.e. Faded LODs, Imposters, HLODs, or other scriptable "visibility tricks" that are all too common in games.

    To some extent, SRP can do some of this work. But there are WAY too many systems that are WAY too specific (and therefore not "modular" or data-driven and thus not "DOTS-oriented") in Unity that are meant to tackle this kind of rendering.
    To consider large, detailed, open worlds with floating origins in the Mesh rendering workflow (rather than just the Mesh API or the Mesh Renderer 'component' itself) is kind of a "duh" moment. The fact that we can do visibility tweaks with SRP also means we can do _more complex_ visibility tweaks (such as cool-looking HLOD or other fancy LOD transitions) with the S(M)RP instead. Thanks to non-trivial "visibility" issues like these in the context of open-world style games, until I can create huge worlds freely (like those seen in "Breath of the Wild") in Unity with barebones editor technology, I refuse to stop pushing Unity on this. If I can draw out a plan to make this happen (while also still keeping Unity a versatile, flexible, general-purpose tool) -- so can Unity.

    You guys can do SO much better.



    What say you, @Unity?

    Could I be on to something with this S(M)RP suggestion?
    Or better yet -- Do you guys already _have_ something like this in the pipeline?? D:


    If not -- (and just for good measure) -- I probably need to add in this:

    I would never leave Unity for "bigger fish" (since they don't usually 'taste' any better, and I happen to be a man of taste), but I would still like to point out that Unreal 5 is beginning to smell 'rather tempting' to hungry artists/designers fed up with the 'bad taste' of technology limitations preventing them from just "dropping in" their art and "quickly designing" behavior for it. With UE5's new "just make a model in Zbrush and drop it into the engine 'as-is' to render it instantly from anywhere -- even in large, open worlds!" technology, a lot of frustrated developers are going to flock to that initially -- and then be inevitably disappointed by the reality that this ability likely relies on expensive SSD hardware, using a point-cloud rendering technique similar to Euclidean's rendering technology, which would be costly for PC gamers with standard hardware, and therefore, initially, limited to consoles. Despite this huge limitation, I do still feel Unity should really step up its rendering game in the area of "visibility-based" game optimization tools and workflows -- and soon. Technology only becomes cheaper and more-accessible the longer it's on the market.

    Just food for thought -- and a word of caution.


    Either way, while I deeply believe Unity has it in its bones to be the best damn tool for making games (or any other kind of interactive virtual content), I also know it has many flaws in this area. And to be able to see these flaws (by finding creative, and genuine, people to bring things to light) -- and by _listening_ to these same genuine people, I truly believe Unity can really live up to such a huge aspiration.

    But maybe that's just me?
     
    sand_lantern likes this.
  16. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    246
    Domain Reload times need to get addressed. This is the #1 issue imo. Its extremely hard to prototype new ideas when Unity locks up for 15 seconds everytime you change a single line of code. Unity can not truly scale until this is addressed head on (script patching)?
     
  17. forestrf

    forestrf

    Joined:
    Aug 28, 2010
    Posts:
    99
    Open profiler, set it to Depp Profile, click on record and finally start the game
    Probably you won't be able to stop the profiler now. The click doesn't go through.
    This happens anywhere that you can click when the editor runs a bit slow.
     
  18. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    892
    Not really any full fix for the root issue in our Editor UI input processing but just some notes from the Profiler devs side on this:
    • Profiler Window performance (specifically with large amounts of data) was improved for 2019.3, so this should happen less
    • F9 was introduced in 2019.3 as a shortcut to toggle recording state which might have a better chance of getting through even with the lag
    • 2020.1 Added the "Profiler (Standalone Process)" menu option which will give you a Profiler process that is detached from the Editor update loop that it is profiling.
     
    forestrf likes this.
  19. Werti100

    Werti100

    Joined:
    Aug 3, 2018
    Posts:
    30
    This also comes with another problem when it comes to using reflection probes in shaders, they keep getting unlinked because everytime you bake reflection probes the names get re-generated or something, so it unlinks the reflection probe in shader. Which is very annoying because you end up having to constantly relink them every time you bake lighting.
     
    Marc-Saubion likes this.
  20. forestrf

    forestrf

    Joined:
    Aug 28, 2010
    Posts:
    99


    Thank you! I won't be using 2020 until it's LTS (so probably not this year). As a workaround for that specific case I will try the F9 key, I didn't know that and it may work (if it works I won't need to kill Unity's Editor process if I end up with the editor going slow again)



    But this problem can be related with another one: You may be using powerful computers, but not slower ones. This may be a reason of you not noticing performance problems that many do notice because many Unity devs use computers that aren't as good as yours, probably by quite a margin. For example, with a FX-8350 , and SSD, 16GB RAM and a R9-380 I was:

    - Unable to even open asset 3D Game Kit (https://assetstore.unity.com/packages/templates/tutorials/3d-game-kit-115747).

    - Only able to see the menu of the FPS Sample (https://github.com/Unity-Technologies/FPSSample).

    - Running the human demo at 1080p 18 FPS (https://blogs.unity3d.com/2020/05/13/the-heretic-digital-human-package-out-now/ but the link in the blog to the exe is broken, it's here now https://github.com/Unity-Technologi...gital-human.sample/releases/tag/0.1.1-preview)

    Makes me wonder what type of machines do you use.
     
    Last edited: Jul 20, 2020
    sand_lantern and awesomedata like this.
  21. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,121
    Also, regarding UX workflow -- I've been saying this all along, but since I stumbled upon it -- I kinda just want to put this here and let it set with @Unity for a moment:





    This "effect", to me, is proper UX in general, and Unity would be wise to post this prominently around every programmer's habitat -- everywhere.


    PS... "Remember the human." -- would be a good slogan to accompany this.
     
  22. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    246
    Just for what it's worth, none of this is much use, as it is always like 10s "Loading Assemblies" or whatever it is.

    Domain reload is just untenable as a solution when single script files have changes. I hope you guys can either: separate code changes from project changes, so Domain Reload is not so tied to project file count, or avoid it altogether by doing some sore of code-swapping
     
    sand_lantern and Lars-Steenhoff like this.
  23. SlimeProphet

    SlimeProphet

    Joined:
    Sep 30, 2019
    Posts:
    49
    I think it'd be helpful if there was some visual indication in the hierarchy that a prefab variable other than name or position (or any other non-universal prefab variables) has been changed.

    I find myself staring at the hierarchy wondering whether I made any changes that should've been applied to the base prefab. It'd be even better if this was a pull-down option from the scene kebab. It would go nicely with Select Scene Asset: Highlight Modified Prefabs.
     
    awesomedata and Lars-Steenhoff like this.
  24. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    3,536
    I'm with you on this one. It's relevant in all mental discipline where tendencies is forget the body.

    Inspector needs < > arrows
     
    awesomedata and sand_lantern like this.
  25. hurleybird

    hurleybird

    Joined:
    Mar 4, 2013
    Posts:
    100
    The most painful thing is when debugging locks up and cannot continue. Sometimes the editor will continue with execution after exiting debugging. If I'm debugging long enough, it always happens. Doesn't matter if I'm in VS or Rider, so I've always assumed it's a problem on the Unity end.
     
  26. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    246
    Here is a simple tweak that I think will be a great little addition.

    There is a fairly glaring productivity issue with the size of the condition drop down. :


    Unity somewhat forces us to stick all our params for a character into a single AnimatorController, which can easily reach dozens of params for a complex character. But then provides a tiny little dropdown to choose them.

    There is also a search field, which is interesting, as it's sorta acknowledging this list will be very large. The search is fairly useless though as it is not sticky, meaning you would have to type every single time you're trying to find some state.

    Proposal:
    1. This dropdown should extend as far as possible, to accelerate our quick selection of conditions.
    2. The search should be sticky / layer. This is a small feature but very powerfull, I could have "Move-" as a prefix in one layer, and "Fishing-" in another, and then my conditions list would be auto-filtered for the duration of my project.
     
    awesomedata and sand_lantern like this.
  27. JesseSTG

    JesseSTG

    Joined:
    Jan 10, 2019
    Posts:
    83
    If you don't optimize Unity's compilation/assembly reloading substantially, none of the other proposed changes in this thread will matter.
     
    shawnblais likes this.
  28. KokkuHub

    KokkuHub

    Joined:
    Feb 15, 2018
    Posts:
    418
    Yup. Once upon a time, one of the advantages of using C# over C++ was fast iteration times. That's no longer the case, specially when a lot of internal Unity bits got moved into C# and now interfere in user script compilation and reload times.

    The no-domain-reload play mode feature is well meaning, but in real-world projects it's impractical (and often impossible) to make 100% of the codebase compatible with it, specially when 3rd party libraries are involved.
     
    Yozaro, sand_lantern and JesseSTG like this.
  29. sand_lantern

    sand_lantern

    Joined:
    Sep 15, 2017
    Posts:
    155
    Yeah, my main project is a couple years old. Feels like pulling teeth whenever I need to iterate on code, and even with that pain, there's no way I was even going to TRY to make it compatible to do the no-domain-reload stuff. That's a quagmire of problems I don't have the time to deal with.
     
  30. JesseSTG

    JesseSTG

    Joined:
    Jan 10, 2019
    Posts:
    83
    Plus, writing your code with No-Domain-Reload in mind doesn't actually make your code compile faster, just less frequently. That's not a bad thing by any means, but it's not enough.
     
    sand_lantern likes this.
  31. SlimeProphet

    SlimeProphet

    Joined:
    Sep 30, 2019
    Posts:
    49
    Is this an okay place for general editor feature requests?

    It'd be really appreciated if you could set an aspect ratio containing a decimal point for the Game window. Apple's iPhone 11 has a 19.5:9 aspect ratio.
     
  32. JesseSTG

    JesseSTG

    Joined:
    Jan 10, 2019
    Posts:
    83
    Use 39:18. It's the same ratio, but with integer components. (19.5 * 2 == 39, and 9 * 2 == 18)
     
    SlimeProphet likes this.
  33. SlimeProphet

    SlimeProphet

    Joined:
    Sep 30, 2019
    Posts:
    49
    Ugh! I'm really glad you pointed that out and really embarrassed I didn't think of that. Thanks!
     
  34. JesseSTG

    JesseSTG

    Joined:
    Jan 10, 2019
    Posts:
    83
    No problem, it happens.
     
  35. Bastienre4

    Bastienre4

    Joined:
    Jul 8, 2014
    Posts:
    112
    While we're talking about pain, it would be great to simply be able to reference scene assets directly via a public field.
     
  36. sand_lantern

    sand_lantern

    Joined:
    Sep 15, 2017
    Posts:
    155
    Could you elaborate on this feature request?
     
  37. brunocoimbra

    brunocoimbra

    Joined:
    Sep 2, 2015
    Posts:
    413
    There is no official way to reference a Scene (the asset of the scene, more precisely) in inspector without relying on workarounds or using weak references such as strings.
     
    Bastienre4, sand_lantern and gskinner like this.
  38. sand_lantern

    sand_lantern

    Joined:
    Sep 15, 2017
    Posts:
    155
    So you're saying something like
    Code (CSharp):
    1.  
    2. public class Utility
    3. {
    4.    [MenuItem("Update Scenes")]
    5.    public void UpdateSceneData()
    6.    {
    7.       foreach(var myScenes in ListOfScenes)
    8.       {
    9.          MyBehaviour[] stuff = myScene.GetComponents<MyBehaviour>();
    10.          foreach(var thing in stuff)
    11.          {
    12.             thing.DoSomething();
    13.          }
    14.       }
    15.    }
    16. }
    17.  
    I've certainly needed something like this. It would be a godsend even if it was only available for editor code and wasn't efficient.

    My use case is that I have a specific collectable and I want to gauge completion percent based on
    collected / totalInGame


    This means at some point I'm going to have to load up each scene and count how many there are in each scene to get my total. Not the end of the world, but it will be tedious and bug prone if I ever add another one and forget to update my count.
     
  39. brunocoimbra

    brunocoimbra

    Joined:
    Sep 2, 2015
    Posts:
    413
    Hmm.. not even close. I mean something like

    Code (CSharp):
    1. // SceneReference is what we are missing, as currently we need to use a string or an int instead
    2. public SceneReference MainMenu;
    3.  
    4. public void GoToMainMenu()
    5. {
    6.     SceneManager.LoadScene(MainMenu);
    7. }
     
    Marc-Saubion and Igor_Vasiak like this.
  40. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    5,004
    There's an version of that we use on the wiki. Which is so dead it shows warnings when you open it, but don't worry about that, it's not a virus :p
     
  41. brunocoimbra

    brunocoimbra

    Joined:
    Sep 2, 2015
    Posts:
    413
    Yeah, I have an implementation in-house here but both cases (mine or from the wiki) are just workarounds, as isn't guarantee to keep working the same across different engine versions (which a built-in implementation would solve).
     
    Bastienre4 likes this.
  42. davvjs

    davvjs

    Joined:
    Nov 13, 2016
    Posts:
    2
    Very common pain for the last 8 years:
    All edits to my scene is lost because my game crashed

    Hint: The two should not be related
     
    Last edited: Aug 2, 2020
    sand_lantern likes this.
  43. Bastienre4

    Bastienre4

    Joined:
    Jul 8, 2014
    Posts:
    112
    Another great thing would be: soft masks for UI :)
     
    Igor_Vasiak likes this.
  44. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,121
    I probably wouldn't approach it this way.
    Instead, the way I'd approach this task (and other tasks like it -- i.e. inventory systems, etc.) in the current environment (i.e. without a proper data-oriented visual script programming solution that accounts for ECS methodologies) would be to keep a single (asynchronously loaded) scene that is always present when the game runs, which contains a global database that keeps track of "collectables" and registers/unregisters them in a database as they're added/removed into/from the game. It's funny that Zelda doesn't do this with its "heart piece" system, but it probably would have saved the designers some (very slight) headaches (and potential for error/hacking) had they done it. In my case, I'd probably add a keyboard shortcut to write the adding/removal/counting process to an asset file acting as a database for all the scenes in your game (which would be the most rudimentary approach, but also the most designer-friendly as long as you do adding/subtracting collectibles via keyboard shortcut).

    Regarding workflow on "small" things like this, there is a saying I always follow when designing/programming this kind of stuff:


    "A game is just a database with a fancy interface."



    That is, the stuff you see on screen (animations, button presses, etc.) is visually important, but data is data.
    That means it is still entered initially (even the sprites on your screen), then later conditionally "referenced" (usually based on a conditional "query", whose "conditions" are simply defined as pointing to a particular "location" [i.e. table->row->column] in the database to where the data you need is stored), wherein the data can potentially be "altered" by some system based on storage location (which is usually determined by the query's "location" parameters for table/row/column you want access to -- which is not unlike a hierarchy.)


    Sounds eerily similar to ECS "tagged" queries, doesn't it? -- That's because Unity's ECS implementation is close, but not quite 'there'. The saying above has lots of implications on the bulk of almost any "small" game-related data task or routine that takes up the bulk of your programming struggles -- and the most of that struggle for artists/designers is database "design" -- i.e. the process in which you 'design' how (i.e. where/when) you can access your data.

    Sounds pointless? -- That's because it is.

    "Data is Data"

    At least in most cases.

    But it does need to be funneled to systems (that change it) in order to be useful.
    However, writing formal queries sucks (and can push the memory to its limits in complex SQL databases w/ complex table/row names). So as a game designer, you need a faster/easier way to get at your data -- especially for the most-used components / systems you've essentially developed "on the fly".


    Enter the "component tag -minus- data" approach.

    This is essentially a "visual hierarchy" -- but for data.

    I suggested this approach to the DOTS Visual Scripting team in the Drop 8 thread (when I saw DOTS Visual Scripting was essentially becoming "Blueprints" from UE4 (which nobody liked, as blueprints disgust me as the "answer" to visual scripting for reasons I wont get into here, but do get into a little here). Sadly, this "data-based" approach while also being a "data-less" approach was initially not welcomed by Unity. This mostly seemed to be because it would slightly alter how DOTS works internally -- but for huge payoffs for game programmers in terms of workflow for games and / or application design for visual designers and programmers alike, as well as assist you in keeping track of your database and other smaller game information in an artist/designer-friendly way.


    To be fair, the only "limitation" to the database-query "dataless" approach (in other words, the component tag -minus- data approach to ECS implementation) is how much "data" you can have available in memory at once -- and how quickly it can be accessed. Which, with a little creativity (and I do mean just a "little"), both problems of read/write limitations and workflow issues on data reference / speed of access can easily be solved by simple, universal, realtime data design patterns. However, tons of text is hard to read, and illustrating my vision (while addressing more subtle technical problems and their solutions) can become convoluted to understand (even with pictures), therefore I've struggled with talking to Unity about these workflow improvements due to the sheer amount of information that is involved in helping Unity understand how to implement them properly -- but most importantly, why they must be implemented this way (and what happens when they are implemented any other way).

    Not all truths are self-evident, but once you add them all up (which takes time) -- they do begin to make sense.
    Thankfully I've done most of this work for Unity -- All they have to do is listen.


    Anyway, I hope I've helped a bit with giving you a better approach to your workflows.

    While it would be the badassery if the Visual Scripting team found a way to let users work with queries and systems using existing technology (in a fast and easy to understand way), the ability to tag and structure your data in a way that isn't explicitly following the standard SQL "database" structure internally, but handles this process with the things we need in memory (like the approach I try to illustrate here), we could seriously have better game-programming workflow all around.

    But hey -- I'm just one person.
    I couldn't possibly help Unity improve the whole workflow of how we program and organize our games.
    lol -- I mean, could I?

    Maybe not -- but I'm an optimist, and crazier things have happened.
     
    Last edited: Aug 5, 2020
  45. sand_lantern

    sand_lantern

    Joined:
    Sep 15, 2017
    Posts:
    155
    I've currently got that information stored in a scriptable object which is being used in more or less that manner. What advantages does a scene have over an SO in this situation?
     
  46. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,121
    The main reason is just the ability to determine register/unregister logic in a single (modular) place at runtime, ensuring it remains modular and easy to modify separately because it is not dependent upon other scenes (i.e. when you hit "play" and later "collect" the items, it accounts for whatever items exist in the SO that are available to "collect", for example.)


    Scenes like this are just an easy way to have global "systems" that load upon pressing "play" to offer a place for custom logic that initializes on "Play" -- in a similar vein as what ECS does with its "systems" concept. The modularity is key here though, as this scene can be considered equivalent to a "system" + set of "components" in ECS that is handled globally, having global (contextualized) logic separated from local (scene-based) logic. Having a global system module is a great practice in general -- a free-standing scene loaded asynchronously is just kind of the standard way to do this in Unity.

    Lots of context menus for mobile games are done this way, for example. They just contextually load asynchronously a scene with that particular menu "on top" of the current stack of scenes (and later unloads it when done).
     
    sand_lantern likes this.
  47. willgoldstone

    willgoldstone

    Unity Technologies

    Joined:
    Oct 2, 2006
    Posts:
    776
    It's a great message, something I think about every day, and encourage friends and colleagues here to join in with. It's challenging but it's almost like the lower image, I think for the UX savvy, it's a worth while cause to see the tools headed in better and better directions. But as always, thanks for the helpful articulations!
     
    awesomedata and Lars-Steenhoff like this.
  48. Bastienre4

    Bastienre4

    Joined:
    Jul 8, 2014
    Posts:
    112
    Also, it would be nice to enum to behave like string in custom classes Array.
    In this case, I would love to see XONE instead of Element 0. Or even better: XONE (Element 0)
    upload_2020-8-5_13-19-39.png
     
    Igor_Vasiak and awesomedata like this.
  49. sand_lantern

    sand_lantern

    Joined:
    Sep 15, 2017
    Posts:
    155
    Well, I'm sold. Now the question is if it's worth porting over some systems on a game with a more or less "completed" backend that I started working on 3 years ago knowing nothing about Unity, or tucking that information away for next time.
     
    awesomedata likes this.
  50. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,230
    Hi Will,

    Ok, cool - that's just what I need right now ;-)

    I have probably reported this on the alpha-list a long time ago, or even filed a bug report ... but ... in Unity 2019.4, "Export package" still defaults to "Include dependencies" ... and I have just completed a few errands while waiting for it. It's an incredibly annoying default because 9 out of 10 times, I use export package very specifically and only very rarely do I want to include the dependencies. And scanning the dependencies is the only thing I've had trouble with when Exporting packages.

    Without scanning the dependencies, moving stuff from one project to another using export / import would be a matter of less than 30 seconds (if both projects are open, it's actually something I could do within 10 seconds).

    Now, after about 10 or more minutes of waiting, I'll kill Unity, try once more for about 20 seconds, and then move the files over. In other words: The feature actually is broken for me. (PS: No, it was just in that specific session.)

    Expected behaviour: Never have "Include dependencies" checked by default. Let me check it when I need it. Then, when "Unity breaks" while scanning those dependencies, it will still be annoying - but it'll only hit me when that scan is actually needed (which is super-rare). For users that don't know what they're doing: Have a red warning near the "Export button" that tells them that exporting without dependencies might break stuff. But the truth is: When I export C#-code that doesn't have any dependencies, you don't have any reason to include *all* of my scripts, but you do.

    PS: Turns out at least I don't have to kill Unity - I can simply close the stuck Window. But in fact, after restarting Unity, it worked after a few seconds. So it's not that bad (seems like Asset Database V2 made this quicker). Still: I almost never need the dependencies ;-)
     
unityunity