Announcement

Collapse
No announcement yet.

Please implement Short-Circuit evaluation for Blueprint

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    #76
    Originally posted by mid_gen View Post
    Related question.....do 'nativized' blueprints retain the no-SC behaviour?
    This is an extremely important questions as it has the potential to create entirely different behavior.

    Check out my discord -> https://discord.gg/kQdVwJ3

    Follow us on twitter to get updates on new products and special offers -> https://twitter.com/BlackFangTech

    Black Fang Technologies' products -> https://www.unrealengine.com/marketp...20Technologies

    Comment


      #77
      Originally posted by BlackRang666 View Post
      This is an extremely important questions as it has the potential to create entirely different behavior.
      I'll test this out later tonight when I get home. If I forget someone just @ me or quote this post to remind me.
      [Submitted] Advanced Data Validation

      Comment


        #78
        Hey everyone,

        I think that what you guys are looking for actually exists in our database as a bug. Here's the link to the issue on our public tracker, in case you're interested.

        https://issues.unrealengine.com/issue/UE-22021

        Have a great day

        Comment


          #79
          Originally posted by Raildex_ View Post
          ^"Pure" actually means it does not change any variables.

          I myself am for short-circuit implementation in Blueprints.
          Pure in Blueprints does not mean the same as pure/referentially transparent in (functional) programming. In blueprints it simply means that the node doesn't have the Exec pin, the one where the white execution line would plug into.

          As a side note, I dislike the "pure" term in Blueprints just because of this reason, it's confusing and contradicts established terms in general programming.

          Comment


            #80
            Originally posted by jonimake View Post
            Pure in Blueprints does not mean the same as pure/referentially transparent in (functional) programming. In blueprints it simply means that the node doesn't have the Exec pin, the one where the white execution line would plug into.

            As a side note, I dislike the "pure" term in Blueprints just because of this reason, it's confusing and contradicts established terms in general programming.
            The idea is however to have pure BP functions be ACTUALLY pure, but the fact is that there is nothing enforcing this in BP, it's merely suggested by the name.
            [Submitted] Advanced Data Validation

            Comment


              #81
              Click image for larger version

Name:	Unbenannt.JPG
Views:	1
Size:	80.4 KB
ID:	1128018

              Another example why Short Circuit Evaluation makes sense:
              I get accessed none, because I Access AcceptedAmmoTypes of a non-valid object, although i checked it.

              I mean, yeah I could use an impure Branch, but having a single AND is more clean imo.

              Comment


                #82
                Do as Allar does, make a ghetto "or" and "and" for x2,x3,x4 with execute and branches macro so you can avoid such issues.

                Comment


                  #83
                  ^But it would still be ghetto

                  Comment


                    #84
                    Wait this still isn't fixed? I got hit with some terrible virus, so when I get the chance I will make a pull request, someone else can do it if they want. I'm fairly certain the fix is on the first page. iirc the comma operator and return line fixed the sc for the and node. If other nodes do the same thing the should also probably be updated. the assumption is if SC is what is intended, its a bug if no SC.

                    the file is UnrealEngine/Engine/Source/Runtime/Engine/Classes/Kismet/KismetMathLibrary.inl

                    also don't just submit a pr, dl the master, edit code and test it.


                    Edit after some extensive testing im fairly sure blueprint verifies all input to a node before it executes. i will try some other things. although it seems a node like && cannot short circuit because it's by blueprints design. i originally thought the compiler was doing something but i think its actually bp, which makes much more sense anyhow.

                    //test1 normal engine
                    https://snag.gy/igAKRU.jpg
                    // test2 my edit of the bp nodes
                    https://snag.gy/IpXJwO.jpg

                    nothing changed. looking back, this is totally expected. it has to be execution order. basically, AND(A(), B())... A and B are executed before AND().

                    i don't think this is possible actually because it acts like a function and must be fully evaluated. this was an interesting little test.
                    soit is possible with my original idea, the staggered nodes which isn't ideal but at least we have something. I guess if you really need the speed code in cpp, hehe
                    Last edited by SaxonRah; 05-15-2017, 03:43 AM.
                    Youtube
                    Machine Learning C++ Plugin
                    Lindenmayer System C++ Plugin

                    Comment


                      #85
                      Originally posted by Raildex_ View Post
                      ^But it would still be ghetto
                      at some point, you getting used to it
                      I have a ghetto dump callstack blueprint macro, zero divide by zero, works like a charm

                      Comment


                        #86
                        Surprised among all this no one mentioned that UnrealScript operates this way (stops evaluating AND/OR when a condition is met).. after coming from UnrealScript to BP I was pretty disappointed to find it evaluates everything and you need to spam your graph with branch nodes if you want efficiency (and keeping things tidy is even more important in BP).

                        Doubly disappointed at Select nodes evaluating all inputs as well... I made my own pure select nodes in a shared library that do a branch, and I suppose you could just make yourself some compact AND nodes too (one with 2 inputs, one with 3, etc... using a BP function probably negates the performance gain from not evaluating both inputs, but after nativization I imagine it'd still be better). Obviously you have the problem there though that you can't keep adding input pins like you can with the coded BP select node or AND/OR nodes (which would be another great feature btw).

                        EDIT: Actually, looks like they may have fixed the Select node for 4.16?? https://issues.unrealengine.com/issue/UE-20044
                        Last edited by Spoondog; 05-23-2017, 06:37 PM.
                        Dev Blog
                        Twitter: @TheRealSpoonDog
                        150 FREE Blueprint functions for your project

                        Comment


                          #87
                          Kismet vs Blueprints [Pros / Cons]

                          Originally posted by Spoondog View Post
                          after coming from UnrealScript to BP I was pretty disappointed to find it evaluates everything and you need to spam your graph with branch nodes if you want efficiency (and keeping things tidy is even more important in BP).
                          +1.... Epic also killed off Kismet features that were far better & more powerful than Blueprints:
                          Question: Wouldn't more control over wire layout mean using more Pure nodes and less Impure...
                          Surely the answer is yes in cases where Impure nodes get used to help simplify complex wiring...
                          So isn't this issue also about excess space / the room BP takes up / screen-real-estate overall...

                          #1. Kismet vs Blueprints:
                          Straight line wires on any axis let you create more logical layouts, like in electronic circuits etc.
                          When used with collapsed Switches as ReRoute nodes, it was a neater layout using less space.
                          Whereas curved BP wires means more screen space to avoid so many crossed wires & overlap.

                          #2. Kismet vs Blueprints:
                          Kismet let users drag PINS and re-order them on nodes, which also meant less crossed wires.
                          This had been requested before and was promised. So what happened, its an easy mod, no?

                          #3. Kismet vs Blueprints - UDK Shortcuts:
                          Minimize Sequence nodes. They take up too much space and add nothing to overall workflow.
                          Why not simplify them like how it was in Kismet, just connecting wires dragged off other nodes?
                          Delay option on every node (Exec pin) & Log/PrintString with multiple inputs, badly missed too!
                          Kismet also let users hide Node PINS not being used on a per-Node-basis not a global setting!

                          #4. Kismet vs Blueprints:
                          Kismet offered right-click deactivation of node branches. Afterwards 'Exec' wires turned red.
                          This had been requested before and was promised. So what happened, its an easy mod, no?

                          #5. Blueprint User Customization:
                          Anyone looking for user control of wire-color and layout styles along with node-style Vote here.
                          It would be helpful for example to have invoked Custom-Nodes look different from built-in Nodes.

                          [MENTION=8]Alexander Paschall[/MENTION] [MENTION=160394]Sean Flint[/MENTION]
                          Last edited by ClavosTech; 05-24-2017, 05:51 AM.

                          Comment


                            #88
                            Originally posted by Spoondog View Post
                            EDIT: Actually, looks like they may have fixed the Select node for 4.16?? https://issues.unrealengine.com/issue/UE-20044
                            It is marked Won't Fix.
                            I researched source code and this goes deeply to a blueprint bytecode, so I am not sure if they will be able to fix this.
                            And And operator bug is made because And is made as a function, so there will be no short circuiting too.
                            Bleuprint VM is broken in many ways, so it will need a complete rewrite to make us happy.

                            Comment


                              #89
                              Originally posted by Yata View Post
                              It is marked Won't Fix.
                              True but it also says:
                              Developer Notes: this issue no longer occurs in 4.16 Main CL 3275234

                              Comment


                                #90
                                Originally posted by franktech View Post
                                +1.... Epic also killed off Kismet features that were far better & more powerful than Blueprints:
                                Question: Wouldn't more control over wire layout mean using more Pure nodes and less Impure...
                                Surely the answer is yes in cases where Impure nodes get used to help simplify complex wiring...
                                So isn't this issue also about excess space / the room BP takes up / screen-real-estate overall...

                                #1. Kismet vs Blueprints:
                                Straight line wires on any axis let you create more logical layouts, like with electronic circuits.
                                When used with collapsed Switch nodes for example, it meant neater layouts using less space.
                                Whereas curved BP wires means more screen space to avoid so many wires crossing & overlap.

                                #2. Kismet vs Blueprints:
                                Kismet let users drag PINS and re-order them on nodes, which also meant less crossed wires.
                                This had been requested before and was promised. So what happened, its an easy mod, no?

                                #3. Kismet vs Blueprints - UDK Shortcuts:
                                Minimize Sequence nodes. They take up too much space and add nothing to overall workflow.
                                Why not simplify them like it was in Kismet, so just connecting wires dragged off other nodes?
                                Delay option on every node (Exec pin) & Log/PrintString with multiple inputs, badly missed too!
                                Kismet also let users hide Node PINS not being used on a per-Node-basis not a global setting!

                                #4. Kismet vs Blueprints:
                                Kismet offered right-click deactivation of node branches. Afterwards 'Exec' wires turned red.
                                This had been requested before and was promised. So what happened, its an easy mod, no?

                                #5. Blueprint User Customization:
                                Anyone looking for user control of wire-color and layout styles along with node-style Vote here.
                                It would be helpful for example to have invoked Custom-Nodes look different from built-in Nodes.

                                @Alexander Paschall @Sean Flint
                                ...yeah this all sounds great actually
                                Impromptu Games|dev blog|twitter|itch.io store|Patreon
                                Impromptu Procedural Ladders|Impromptu Procedural Handrails|Impromptu Procedural Stairs
                                |Impromptu Fire Propagation|InFlux Example Game|Impromptu Vector Field Painter

                                Comment

                                Working...
                                X