"If the shoe fits, wear it"

In development, there is a problem often people dont really see, and while it is simple it is elusive.

There is a C version for this code, but in this instance, using Blueprints if gets more “visual”.

There is a “Is Valid” there, and a “Is Valid + branch” after. On a first glance, they “would” do the same thing, one check if it is valid, and the other checks if it is valid and branch if the condition is negative. Nothing wrong with it, but ONE SIMPLE THING.

If the TARGET there asks for the Surface Type BEFORE the code verifies if the target is valid, doesnt matter if it verifies AFTER asking for anything from the target.

Some might say about the fact that the specific box will first verify if it is valid and then verify the value, and that would be correct if the actual decision of if it is negative would not require the target to be asked about the priority to be evaluated, effectivelly using the target before the Is Valid block. But thanks for playing.

This is akin to that interesting math problem that asks:
2 plus 2 divided by 2 equals 3.
PEMDAS joke. Well, that is something like that.

What that means for you player that is not seeing this is that once for some reason the target is not valid, it becomes this:
1a194d1bda32bd09e961d45a1837bb7bad1da053_2_690x528

When I say since some time in 2017 that this happens, that is the reason. Mods can have that type of code, but that precise part I posted up there is not part of a mod code, it is not even related to any mod I develop or use.
It is part of a void mod that does nothing else but add -is valid- boxes everywhere the code needs one but doesnt have it.

The lad who picks up the shoe seeing it fits nicely, “you are welcome”.

3 Likes

I wonder if this is why foliage is crash happy when not saved properly. I tend to wire up both because of my LabView days when anything dangling causes bizarre behavior (and labview doesnt even always execute left to right with wires).

You have to be a bit more careful when using foliage’s as not all the foliage in the devkit is in the actual game files, if you use one of the foliage that’s not present in the game it will cause a crash whenever that section of the map loads.

You can use UnrealPAK to list the files contained in the clients pak files to verify =)

Certain errors should not occur even if they are result of unexpected use, if things like that were not made.

The “is valid + branch” node should not be used when the thing in the branch requires use of the thing being “is validated” during it, period.

That is kind of “rule of thumb”. It is like a driver entering a crossing to check if that crossing can be crossed.

Oh I know. What I meant was, the base code for foliage that we don’t see, I wonder how it handles it. It feels like rather than crash, it could simply identify that its not included, and do nothing similar to if you invlude a static mesh thats not included. If I drop an unsaved cliff into the map and cook, it doesnt crash on interact; its just not there.

1 Like

My first thought would be for optimisation, there can be thousands, sometimes millions of instances of foliage, grass in a cinematic build for example, there would have to be checks to ensure the engine doesn’t try to access unallocated memory, invalid pointers etc which would impact performance a lot at runtime with so many instances, errors with the foliage would normally be picked up in a development build that has more extensive error handling, unfortunately when developing mods we don’t have the luxury of running development builds of the game =(

1 Like

Foliage is reduced in many different ways. LOD, camera culling, special rendering methods such as instancing. Not sure what unnallocated memory/invalid pionters has to do with anything. Then again i don’t call malloc or ‘new’ all over my code base so I never have those types of problems.

Ah, the footguns of visual programming. Having a diagram creates certain expectations about the execution order, but the devil’s in the details and from a cursory google search, it doesn’t look like the details are well-specified.

In your diagram, without knowing how Unreal Engine works, I could come up with several different execution orders for the node.

For example, if the outputs “pull” from the inputs, then the first node to execute would be whatever is connected to the output of your whole blueprint. It’s a functional programming paradigm, and in that paradigm the “IsValid+Branch” node would execute before other nodes.

On the other hand, if the paradigm is imperative, then the inputs are being “pushed” through to the outputs, so that the “Get Surface Type” node would be the first to run (if your “IsValid” node is absent).

Mix in the concurrent execution, and it gets even merrier. From what I’ve gathered, it looks like the execution order is “push”, and there are no guarantees in which order the concurrent nodes get executed. In fact, even the Sequence node has a footgun in that it creates an expectation of sequential execution, but that expectation doesn’t work well with async nodes like Delay.

But even if the node execution order is well-specified, the logic of each node might also have ambiguities and should be well-specified. For example, in “IsValid+Branch”, what is evaluated first – the validity of the object pin or the condition?

Fortunately, we’re teaching kids to code in schools these days, so maybe one day we’ll get a generation of devs that will dislike being forced to deal with unnecessarily gigantic and poorly documented diagrams, and the engines will give them an option to work with a decent scripting language.

Not that diagrams don’t have their place, but there’s a cutoff point where their complexity becomes a liability, rather than an asset.

Your trolling with that message right lol.

I say that because you obviously wouldn’t call malloc all over you code to reference the same pointer a million times so I’m assuming your trying to be funny or trying to sound smart by saying that, also LODs and culling have nothing to do with the CPU checking if something exists before sending it to the GPU, also unreal engine is designed for many tasks including CGI, comimetics (as stated previously) where LODs and culling are typically not used to favour quality (and instances in the case with CGI).

I don’t know…I find visual programming to be one of the dumbest things around.

This:
c = a + b

Turns into this:

Now lets put our little nodes together to make:
[(a + b) * (c + d)] / (e + f) = g

Untitled-1

It doesn’t have to be messy

1 Like

I am not trolling. What do you think something like RAII is about?

Yes the GPU has culling built in, but it is also a CPU thing. You can check things against a view volume or whatever you want so you are not sending stuff to the GPU that you already know will be culled. i.e. Why on earth would you ask the GPU to attempt to draw things behind the camera?

So they have a math expression node.
Does not change the point.
Try writing anything complicated/sophisticated and you are looking at a bunch of boxes and lines.

I don’t know, some things are inherently easier to visualize. Having separate nodes for math expressions, like you showed there, is not a good use of visual editors, but that’s kinda like picking the worst case and judging the whole thing.

I don’t know, why would you? that has to be another troll.

Stop thinking about games and start thinking about the engine and what’s it’s actually made for, and what it has to do well, for example in CGI you would send “a lot” more for more accurate occlusion, you also send it in the highest possibly quality, you also don’t use on screen culling, again for more accurate occlusion etc.

I hope we don’t have any of your mods on our server.

Visual programming has been around for ages. It has failed every-time. We have too much repeating of history in tech and claiming it to be new. There also seems to be too many people trying to find the path of least resistance.

I have been working on a game engine for the past 10 years.

Get back to me when you leave mods and pre-existing game engines and decide to start writing the underlying systems from scratch.

1 Like

Sorry, I call bull… from our little interaction.

You don’t believe CPU frustum culling is a thing?
You don’t seem to understand memory management?
You are talking about occlusion for some reason? Ambient occlusion? Occlusion culling? Why would you need to send massive amounts of information for accurate culling? Are we too close where there is potential z-fighting?

Tell me about this interaction?

Oh, yeah. Believe me, I know. I bought into the UML+MDA hype back in the day, until I realized that all the OCL crap was getting to the same level of specificity as regular code, with the added inconvenience of having to sprinkle it across a bunch of diagrams :rofl:

But that’s kinda part of my point: visual programming usually fails, but there’s use for visuals in higher levels of abstraction. Yeah, I write code, but I still draw boxes and arrows on a white board when I’m trying to explain (to myself or to someone else) how the system is structured, or how the data flows.

Same thing here: there’s value in having visual blueprints, but there should be an option to say “hey, we crossed the complexity threshold where this thing starts being counter-productive, let’s turn parts of this into code” :slight_smile:

Any chance it’s somewhere on GitHub? I love looking at what’s available out there.

I’ve been messing with Bevy in my spare time, remaking an old Flash game I wrote in 2010. I tried playing with Godot a while ago, but visual and spatial reasoning is my weakness, and I just can’t get used to the paradigm of making your game in a level editor. I’m used to the game being a program, and I need to understand the structure of the program, so Bevy allows me to play to my strengths and postpone working on my weaknesses until I’ve grokked the basics :smiley: