Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feedback Performance troubles: Unity Visual Scripting compared with Unreal Blueprints and direct C#

Discussion in 'Visual Scripting' started by ylluminate, Jun 3, 2022.

  1. ylluminate

    ylluminate

    Joined:
    Jun 30, 2017
    Posts:
    4
    Just wanted to report a pain point for Unity Visual Scripting in comparison to other options. I believe this is important to recognize early and with clarity so that the team can work on performance improvements:


    The above is captured from the following video:
    https://www.youtube.com/watch?v=FxfMABA9eBI



    Other languages like V (https://github.com/vlang/v) that emit C are still yet faster (eg, testing reveals that
    Unity's performance for `for` loops with no caching vs caching while creating an array of 100000 ints and iterating over it took Unity 8.23 seconds (without caching) and V was 0.0019 seconds (no prod, no autofree or GC)), but I think it's important to keep these things in mind and keep pushing towards tightness and performance since we're dealing with such critical needs regarding speed when developing games.
     
    Marou1 likes this.
  2. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,050
    Unity are aware and working on a new (what they call) high-performance interpreted runtime that'll do per node C# gen. It'll be 10-12 times faster than the current reflection based runtime which was written by a solo developer some 7 years ago. So in theory, it should be just as fast as Blueprints and perhaps faster that Blueprints in scenarios where Blueprints is only five times faster than current UVS. Time will tell.

    The new runtime together with a complete UI replacement based on the new Graph Tools Foundation technology will probably release together with Unity 2023.1 next year. Nothing officially confirmed, but that's my best guess as someone who follows UVS progress closely.

    Unity haven't really made any advancements past what Bolt 1 was in 2020 when they acquired it and rebranded it to Unity Visual Scripting. And Bolt 1 itself wasn't really updated for two years before that since the original creator was working on Bolt 2 instead. All the new visual scripting technology and advancements are coming next year.
     
  3. ylluminate

    ylluminate

    Joined:
    Jun 30, 2017
    Posts:
    4
    Good to hear, thanks. I was always disappointed that they acquired Bolt instead of Nottorus, which really felt much more professional and advanced in many ways.
     
  4. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,050
    Bolt had the perfect marketing that targeted complete Unity newbies. It was/is very streamlined for that purpose and clearly it worked.

    But it's definitely not the best when it comes to making actual games. I never used Nottorus. It was already dead by the time I got interested in Visual Scripting systems for Unity. But Flow Canvas + Node Canvas combo is a lot stronger than Bolt and UVS to this day, both in features and performance. And they're actually proven in production in multiple well known games and franchises.

    So it's clear that Unity suits bought the one that had the most sales in the store. And I guess Bolt 1 is not that opinionated which might be a factor. Unity are targeting Visual Scripting as a tool for artists, designers and other creative roles in AAA space. So the tool is basically a vehicle for arranging high level nodes that are project specific and written by programmers on the team. It has to be as simple to use as possible for designers. They also intend to release a bundle of default high level nodes dealing with stuff like character controller component and similar prebuilt systems in Unity, I presume. ie they're not developing it to be a C# replacement, although it'll continue to be able to access Unity API.
     
  5. ericb_unity

    ericb_unity

    Unity Technologies

    Joined:
    Nov 24, 2017
    Posts:
    167
    We know about the perfs issues with Bolt like PanthenEye pointed out.
     
  6. Moe-Mogare

    Moe-Mogare

    Joined:
    Apr 16, 2015
    Posts:
    19
    My question is if I Learn Unreal Blue Printing does it make it easier to use Unity Blueprint
     
  7. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,050
    Unreal's Blueprints is completely different from Unity Visual Scripting.
     
  8. Marou1

    Marou1

    Joined:
    Dec 13, 2021
    Posts:
    161
    Do you know if the graphs made with the current version will be supported in the new version?

    When is that supposed to happen? summer 2023?
     
  9. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,050
    I assume it'll auto convert or there will be a migration tool at the very least, but no one really knows.
    Per latest info, no changes are coming to UVS this year besides minor bug fixes. The new runtime is 12-3 years away.

    EDIT: For source read November 2022 update:

    and
    Unity 2023.1 doesn't contain anything new, since they say nothing new will come to UVS in 2023 it's safe to assume 2023.2 won't contain anything new either. Something might appear in Unity 2024.1 but it might as well take longer.
     
    Last edited: Jan 5, 2023
  10. Marou1

    Marou1

    Joined:
    Dec 13, 2021
    Posts:
    161
    Ok thank you.
    This is disappointing. I don't know how a game developed with UVS can meet 16ms with the performances posted above.
     
  11. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,050
    Yea, it's hard. One major perf killer is the Variables system. You can gain some back by holding nearly all variables in C# scripts to avoid type boxing. And you must avoid Update() as much as possible and use custom events instead. But there's nothing there for dealing with instances stacking up. The more scriptmachines in your game, the slower everything gets. But performance is much better in builds without the graph editor overhead, so make sure you measure build performance.

    Flow Canvas avoids some of these performance pitfalls by having an Update() manager amongst other optimizations, might be worth a look if you're looking for more performance while still remaining in visual scripting land.
     
  12. Marou1

    Marou1

    Joined:
    Dec 13, 2021
    Posts:
    161
    I have to stick with visual scripting since I'm not a programmer.
    The core of my game is already done using UVS, I'm just building upon it. Switching to another visual scripting solution would mean months of work to redo everything.
    I just purchased UNode, because it is supposed to convert UVS to UNode then to C#. This would have been the perfect solution but it doesn't really work. It does not convert subgraphs, has issues with variables...

    I wish I have known about Flow Canvas earlier. Now I'm not sure what to do... I don't have performance issue for now, but I'm just starting to scale up the game. And looking to UVS performances, I'm worried.
     
  13. inSight01

    inSight01

    Joined:
    Apr 18, 2017
    Posts:
    90
    I feel like it should be pointed out that that solo developer you are referring to was already working on a much more performant version of VS called Bolt 2.0 which was more closely aligned to C# in many ways and even had live code generation which was super neat and even useful if you wanted to convert it to a C# script for even more performance. I was testing the alpha versions of it when Unity acquired it and subsequently killed it off which was enormously disappointing to say the least.
     
    Ignacii likes this.
  14. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,050
    Yea, performance wise Bolt 2.0 C# generation was amazing. In my personal tests, it was nearly indistinguishable from hand written C# code. But it wasn't without its downsides.

    One thing Unity want to achieve is DLC graphs. The ability to create new graphs or edit existing graphs and ship that as an update from some remote source without rebuilding the whole project. This is something Bolt 2 couldn't do since it required C# generation for builds and Unity can't compile C# scripts in build.

    Personally, I still would prefer Bolt 2.0 just because it was superior to current Visual Scripting in just about every way. But the ship has long sailed and we can only look forward to the next version of Visual Scripting.
     
    Ignacii likes this.