Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feature Request Lightweight editor or standalone quick player

Discussion in 'Editor & General Support' started by davvjs, Dec 29, 2020.

?

As a coder, would you like to see a lightweight editor/runner?

  1. Yes

    15 vote(s)
    78.9%
  2. No

    4 vote(s)
    21.1%
  1. davvjs

    davvjs

    Joined:
    Nov 13, 2016
    Posts:
    11
    During latest unity developments I think it has gotten pretty clear that the unity team is struggling to keep editor quality on par with expectations. All while still trying to get DOTS ready for production.

    The editor has lots of weird UX quirks, performance issues, crashes easily, but most of all it exhibits workflow issues for coders.

    If there is anything I have learned during my latest years of working with Unity it has been to minimize the time I spend in the editor. If there is anything I can do in code instead of the editor I do it in code. Chances are the editor will crash (for something such as silly as my game crashes) and I loose all my stuff. Every second spent in the editor is a potential second lost.

    There has been widespread recognition on a major workflow issue, where switching from your code editor to the unity editor: you have to wait, press play, then wait again.
    https://forum.unity.com/threads/recompile-enter-play-mode-process.777950/

    I believe most programmer related workflow issues stems from the fact that the editor runs the game in the editor process rather than in a separate process (like any other programming environment). Changing this would require a costly major overhaul of the of the editor architecture.

    Now this will come as a pretty blatant opinion from the perspective of a silly ignorant coder. I have multiple roles and spend quite some time in shader graph etc. However... "As a coder" I love unity the "game engine" (especially the direction it is going with DOTS), but I couldn't care less about the "editor". I just want to compile my code changes and run them as quick as possible.

    So from a coder perspective I think you should open up the possibilities to develop alternative editors/players for programmers. That way you could outsource some of the workflow issues concerning us silly coders and focus on what matters, DOTS.

    I would like to se either:

    1. A standalone player that can be launched immediately from my development environment.
    My current development environment (Rider) has a build button. To be honest, I'm not sure of to what extent it compiles my game. Because Rider itself cant run it. But whatever it does it is pretty quick and I can only Imagine it wouldn't be that much more time added to the process to also run the game.​

    2. A lightweight editor rebuilt from the ground. You decide the features. I'd say the less the better. The editor runs the game in a isolated/sandboxed process and doesn't need to reload the whole editor and freeze whenever game code changes. Just like any other programmer environment.

     
    Last edited: Feb 13, 2021
    kbm, shawnblais and glenneroo like this.
  2. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,509
    I try to get around it by using script-inspector 3 and playmaker
    Script-inspector let me stay focussed on the game and I don't need to switch between programs
    Playmaker does not need compilation when I edit my state-machines so I can quickly iterate my game play.

    By the way I came across this tweet
    https://twitter.com/unity3d/status/1360242284130947080?s=20
     
    Flipbookee and davvjs like this.
  3. davvjs

    davvjs

    Joined:
    Nov 13, 2016
    Posts:
    11
    Yea I can only imagine how much creativity can flow when using tools like that. Unfortunately we are a bit reliant on dots for our game systems atm. But will definitely check out some of those tools when working with some lighter game mechanics. I personally love the creativity I can express when working on shaders in Unity because of how fast it is to experiment.
     
  4. FrankvHoof

    FrankvHoof

    Joined:
    Nov 3, 2014
    Posts:
    258
    Voted no because I think Unity has many issues that I feel are much more pressing than being 'lightweight' or using a standalone player (e.g. the UX-quirks you mentioned).
    A full rewrite of the editor would be a massive project.
     
  5. davvjs

    davvjs

    Joined:
    Nov 13, 2016
    Posts:
    11
    I hear you. Unfortunately I believe the only way to get to the root cause with these UX issues is a rewrite.

    I can only speak for myself, but my guess is it is actually a full rewrite of the editor we would all like to see in the end.

    However, my intent with this post is to propose a feasible way to get there. Instead of the team hiding under the sand for 10 years and then coming up with an amazing new editor. They can start on the ground and deliver immediate value with a parallel lightweight editor for programmers. They could then let it live its own life, in its own development cycle. Which would follow the more decentralized approach unity has taken for most of the non-editor infrastructure (DOTS, UI, Renderer and Physics).
     
    Last edited: Feb 13, 2021
  6. kbm

    kbm

    Joined:
    Aug 7, 2014
    Posts:
    84
    Hey, coming here from the other thread :)
    All very good and very valid points. Sadly, I just don't see that happening in my lifetime.

    They already have 500 different feet in 500 different feature reworks:
    - New input system
    - DOTS
    - New UI
    - Bolt or whatever that will end up being called
    - Various rendering things that are in various states of incompleteness

    For the Editor to become like it should be, they would probably need to completely redo the entire thing. There are just too many things wrong with it, on an architectural level, like the play-mode running on the same thread.

    Also, if I learned one thing in my 6 years as a Unity developer: The marketing people are driving the company, not the product people. It has never really been any other way, Unity started out with a bang and multiple millions of marketing, which definitely helped its success and was a smart choice at the beginning.

    But it's like what Steve Jobs said, if the marketing people are running the company and making the decisions based on advertisement $$$, the product will S U C K. And that's where we are.
    I am 100% sure there are soo many sad developers at Unity that are very very skilled and really want to make super cool changes on a fundamental level, but it has become very obvious that it doesn't work like that.
    Even @Joachim_Ante who is the damn CTO of the company seems to have problems properly pushing his agenda, and no "DOTS is coming, don't worry guys, we just need 3 more years" post will convince me otherwise.

    Don't get me wrong: I love what Joachim has done and he's been one of the few extremely good influences on the company over the past few years (together with Mike Acton), but with a career CEO like this who doesn't understand the product & developer's needs, how could it be anything else?

    There are two completely separate groups/realities here:
    1) The Unity people and the people who make/give them money. I am no part of group 1.
    2) Actual game developers who are relying on their product to be usable and die a slow death by a million cuts.
    It's fundamentally disconnected, the company doesn't even make their money with people like me - why should they listen to us?

    As much as I would like things to be different, I just don't see it happening. I don't see Unity magically becoming a engine without a gazillion things that pain us, without fundamental problems.

    Lastly, a list of things that would need to happen in order to salvage the situation, at least somewhat.
    But this is magical fairy land stuff:

    1. Make the engine open-source. Better: Free and open source. Without this, none of the other things will ever matter because we can't fix engine-level stuff.

    2. Rework the entire editor with the community's help.

    3. Finish DOTS, polish & integrate it into the new editor.

    4. ???

    5. Profit
     
    Thimo_ and andreyefimov2010 like this.
  7. idbrii

    idbrii

    Joined:
    Aug 18, 2014
    Posts:
    51
    How about this for a lightweight runner: You run run_build.py and it creates a build and launches your game. Unfortunately, I don't know how you could get your debugger to auto-attach.

    Code (Boo):
    1. #! /usr/bin/env python3
    2. # run_build.py
    3.  
    4. # Build and launch a Unity project
    5. # Get your editor to call this in a way where you can see its output.
    6.  
    7. import os
    8. import pprint
    9. import subprocess
    10.  
    11. unity_exe = 'c:/Program Files/Unity/Hub/Editor/2020.3.12f1/Editor/Unity.exe'
    12. project_root = 'c:/code/bug-repro/'
    13. logfile = os.path.join(project_root, 'build.log')
    14. args = [
    15.     unity_exe,
    16.     "-projectPath", project_root,
    17.     "-batchmode",
    18.     "-logFile", logfile,
    19.     "-executeMethod", "Builder.Build",
    20.     "-quit"
    21. ]
    22. # Could use command arg for building to avoid any C# code, but it requires you
    23. # set the appropriate scenes and configuration (scripts only, etc) in
    24. # File > Build Settings and it doesn't seem to be any faster.
    25. # args = [
    26. #     unity_exe,
    27. #     "-projectPath", project_root,
    28. #     "-batchmode",
    29. #     "-buildWindows64Player", "c:/code/Builds/gamebuild/game.exe",
    30. #     "-logFile", logfile,
    31. #     "-quit"
    32. # ]
    33.  
    34. pprint.pprint(args)
    35.  
    36. is_error = False
    37. try:
    38.     subprocess.check_call(
    39.         args,
    40.         cwd=project_root,
    41.         universal_newlines=True,
    42.     )
    43. except subprocess.CalledProcessError:
    44.     is_error = True
    45.  
    46. with open(logfile) as f:
    47.     print()
    48.     print(logfile)
    49.     print()
    50.     start_of_interesting_log = "-- Build Starting --"
    51.     end_of_interesting_log = "-- Build Complete --"
    52.     can_print = is_error
    53.     for line in f:
    54.         can_print = can_print or start_of_interesting_log in line
    55.         if can_print:
    56.             can_print = end_of_interesting_log not in line
    57.             print(line, end='')
    58.  
    Code (CSharp):
    1. // Put this in Assets/Scripts/Editor/Builder.cs
    2.  
    3. using UnityEngine;
    4. using UnityEditor;
    5.  
    6. public static class Builder
    7. {
    8.     // Possibly this could be done with -buildWindows64Player, but we can do
    9.     // more build prep from inside Unity code here (building asset bundles,
    10.     // etc).
    11.     public static void Build()
    12.     {
    13.         Debug.Log("-- Build Starting --");
    14.         var buildPlayerOptions = new BuildPlayerOptions();
    15.         // Make this list as short as possible to make faster builds. You could
    16.         // filter EditorBuildSettings.scenes instead of listing scenes here.
    17.         buildPlayerOptions.scenes = new[] {
    18.             "Assets/Scenes/SampleScene.unity",
    19.         };
    20.         // You could generate a .cs file that contains this path from run_build.py.
    21.         buildPlayerOptions.locationPathName = "c:/code/Builds/gamebuild/game.exe";
    22.         buildPlayerOptions.target = BuildTarget.StandaloneWindows;
    23.         buildPlayerOptions.options = BuildOptions.Development | BuildOptions.AutoRunPlayer | BuildOptions.AllowDebugging;
    24.         if (System.IO.File.Exists(buildPlayerOptions.locationPathName))
    25.         {
    26.             // disable this line if you make asset changes.
    27.             buildPlayerOptions.options |= BuildOptions.BuildScriptsOnly | BuildOptions.PatchPackage;
    28.         }
    29.  
    30.         var report = BuildPipeline.BuildPlayer(buildPlayerOptions);
    31.         var summary = report.summary;
    32.  
    33.         // This duration doesn't include Unity startup time. For me, that's about 10 seconds.
    34.         var duration = summary.buildEndedAt - summary.buildStartedAt;
    35.  
    36.         Debug.Log($"Build {summary.result} after {duration.Seconds} seconds\n"+"-- Build Complete --");
    37.     }
    38. }
    You could easily make this a lot fancier so the python generates a .cs file for any constants that should be used by Build() and to take arguments instead of hard coding paths.


    On a nearly empty project and a pretty good computer, the first build takes 25 seconds and subsequent builds take 15 seconds (because of PatchPackage). That's pretty long, but may be preferable to using the editor. And if Unity improves startup time, then everyone benefits!