Dafuq? I’m all for making programming easier to understand and introduce people to, but this weird visual representation just seems incredibly stupid to me… not to mention, substantially less clear.
The idea is that you should use both. The complex and modular game mechanics, math, systems are done in code and then you put it all together with scripting, which is then genuinely faster to write, also more flexible, extensible and reusable.
I used to be against visual scripting and thought it's just a crutch for beginners (like e.g. Scratch) because the most elementary things like "sorting enemies based on distance from the player" took ages to create with nodes, using the same approach as in code but across the entire screen, but I was using it incorrectly. You're not supposed to be writing elementary things.
If you have the "backend" of your game done in code, believe me it's then wonderful to just script something like:
"Create Quest 'Tutorial'"
"Add Objective"
"Add Objective"
"Add Objective"
(add pin)
"Assign to: 'Player'"
Bind ↔ On Quest Completed event → […]
There, quest done, and you can easily modify it, extend or reuse.
Or design an AI with a behaviour tree, where you put together, nest and reuse certain rules and actions. Or animation graphs with state machines. Writing branching dialogue with a node editor is also wonderful (because writing branching dialogue in a linear fashion – e.g. rows in Excel – will make you wish you were dead when you need to edit or reorder anything).
So basically the way it should be – the mechanics and their intricacies are all coded, now you're just putting the actual content of the game together, using high level of abstraction.
The caveat being that “low code” environments and products tend to attract the MBA types who think “neat, no need to spend $250,000 for a developer when I can pay $65,000 for a temp” before realizing, oh crap, the reason we pay for developers is to understand how to translate business logic into software in a reusable manner and not because only they know how to wrangle product x and the whole thing explodes. (The MBA, of course, has at this point fucked off months ago to do piles of cocaine at their next victim’s employer’s conference rooms)
I think that’s where most of the animosity comes from.
Or, like everything in Unreal, it's based around the realities of shipping AAA games. One of those realities is AAA games are ~90% art assets. Blueprints enable your artists do wiring logic tasks like making a traffic light change in sync, which frees up your developers to do C++ stuff.
You are the one posting in a thread about a (bad) Blueprint, and specifically to a lengthy comment explaining how Blueprints are useful. If that's not relevant why post at all? If it is, believe me it's great not getting pestered to wire up opening/closing animations every time a door is added. Visual programming (industry-wise) is used exclusively in the video games, and no one who has interacted with it will have any animosity.
“Blueprints” are a low code development platform but they are not the only ones. I didn’t say they weren’t useful. I was responding to a certain section saying that you weren’t supposed to wire all the logic up using a low code environment, you know, like the exact opposite of what you’re saying, and how that sometimes is forced to happen because of crackhead project managers trying to save a buck.
Will I have to diagram my sentences? Explain what words mean? Create a logic diagram? It’s very clear to me what I am replying to and it’s not questioning the effectiveness of blueprints (or other low code environments) at all. I’m not saying every developer hates it, but that if they hate it, and are not completely clueless, that this is where it came from. That’s why your comment annoyed me, because it’s rebutting a point I wasn’t even making.
Lol yeah, pretty much. Over the course of my career, I’ve dealt with at least several dozen “product” people (product managers, program managers, product owners… etc); I’d say about half of them were effectively useless, a quarter of them were worse than useless and actively harmed the development process (either by trying to micromanage implementation or straight up having no idea what they were doing but trying to bluff through it anyways), and maybe 3 or 4 who were genuinely good at their job and meaningfully helped my team actually accomplish shit.
I second this. Blueprints are amazing if you know how to use them right, and this is coming from a professional C/C++ backend dev. The secret is to only use blueprint as a “high-level glue”, for connecting your low-level C++ code to the rest of the project which is typically assets (3D models, animations, etc). I can’t emphasize enough how convenient and awesome it is to script the high level behavior of levels and actors with just a few nodes of blueprint.
Unfortunately like with most languages, people tend to overuse blueprints. They are not meant as a substitution for carefully crafted C++ code.
But there are many tasks within unreal (and gamedev in general) for which blueprints are far better suited than any programming language. One example that comes to mind is creating curves (aka timelines) and scheduling events. It is so easy and convenient to edit curves (essentially the dependence of something on time) in the visual editor which is a part of the blueprint editor. You can then pass the time dependent variable from blueprint to C++ and have a smooth animation of some quantity. It would be way harder to achieve this in pure C++ because humans are far better at editing the curve properties in the editor than in picking the right coefficients and putting them into text form
I'm with you on that one. I hate programming with blocks but I know a lot of people who prefer visual representation and are used to it so maybe it's just a tool that suits some minds and it's all about it. And maybe for someone who don't like learning syntax
A few people might prefer it, but I guarantee you that nobody else on the team they’re working with likes it. This sort of programming tool is objectively bad, and abstracts away far too much of the intricacies of programming that are absolutely crucial for a good developer to understand.
Put another way: this is a tool designed to let non-programmers write code. That is not a good thing, nor is it actually coding, in much the same way that plugging a few options into NVidia Canvas doesn’t make you a skilled artist/painter.
It's not objectively bad. Some would argue that those abstractions are a benefit, not a disadvantage. Like any other tech tool since the beginning of time, it has a time and a place. For general purpose programming I would have a hard time with this, but we do some visual style programming similar to this in my company where we simulate complicated aviation systems, and stuff like this is great for doing that. It's very easy to create and visualize a bunch of sensors and control boxes, and the way they interact with each other.
Like every tool, ever, it can be used to benefit, or misused. Tools are rarely "objectively and completely" bad.
It's really not for you, more for non-programmers to handle little wiring tasks. Though Unreal Engine's C++ environment is painful enough that you might still want to use Blueprints when you can.
They do get abused, but the gaming industry isn't known for producing good code anyway.
At one point Blueprint nativization was experimental, not sure if it still is. When I last tried it, it crashed when running the packaged game, even when I set it to only convert one Blueprint. It seems very hit or miss whether it will work or not.
Autocoded = translated into C++ and compiled by the C++ compiler into assembly.
Interpreted = the compiled executable contains instructions on how to execute the blueprint and the embedded program, executes it at runtime.
In practice, the main difference is speed. Blueprints are pretty slow (3-4x slower than C++ or so I've heard). For most games this doesn't matter much because games tend to be GPU-constrained.
hijacking top comment to explain - basically code execution follows the white line, and each node is essentially a line of code. Each data type gets its own color, and purple is for string and teal for int. the lines are essentially feeding the parameters, like an assembly line.
So what this code does is get to the start block, and then that requires a dice array, so the make array block is used to feed in an array of strings. then its shuffled, and then the return node needs an int, so the get is called which gets the first element and then its converted to an int using that dot block thing.
unreal blueprints can be easy to read when you get the hang of it, also when it is well written.
It was a reference to a fail by Sony in their PlayStation 3. In essence a private cryptographic key that should have been seeded with a random number, was hard-coded to always use the number 4.
I could be wrong because its a while since I have used UE4. But the return node would pull the data after the shuffle node executes. This code would work.
Also there is some use case for this. The TArray for dice numbers could be filled with numbers to handle nonstandard dice. E.g. [1,1,1,2,2,3]
So parallel code paths are executed on shared data, with no obvious execution order??? This sounds like a race condition waiting to happen. Even if the order is in some way "defined", it's still not obvious to the programmer what that order is.
In regards to non-standard dice, I think YAGNI applies here. The chance of that occurring is low. Even if it does occur, the function isn't generic enough to handle that case without adjustment anyway, and it's a trivial task to extend a small nimble function to handle an array of (integer!) values as optional input.
The white line is the execution line, the other coloured line are links to the variables. If the dice TArray is exposed to editor it could be used in any amount of blueprints.
Shuffle executes on the reference. Get pulls from the same reference. Edit: but get isn't on the white line, the get happens when the return node requests the reference.
These are some interesting nodes and connectors. Is this a different kind of UI theme? Could you also explain why this is bad? Is it because using an array of integers is not really necessary just to get a random number within a range? (Still learning UE, and node-based programming in general)
To everyone wondering why blueprints: prototyping. writing c++ code for unreal engine can be tricky and time consuming. Reflection is achieved at compilation time by a preprocessor so unless you restart the editor you can’t reload reflected interfaces. Also finding which header to include by looking docs or finding the right way to pass params or defining intermediate variables breaks “the flow”. Getting references to actors and object on the scene or dynamically defined props on instantiated actors is much easier. When you use BP is like having every header already included.
I usually refactor to c++ when I’m happy with the result, also because version control diffs under git are much more manageable
Could be nifty if it could take in a die array of any size and the string to int was left out of the function. An array of strings is not a bad way of having a flexible die system
It was already in a pure function, which is why I didn't think twice about it when I saw it being used. But I'm worried what would happen if we ever needed a 20-sided die cast.
18
u/ShapeshifterTrashcan Sep 09 '21
The
StringtoIntegerconversion in this thing was a really chef's kiss.58
u/dyingpie1 Sep 09 '21
What language is this?
270
u/MikeyBoonstra Sep 09 '21 edited Sep 09 '21
This is way harder to read than normal code. Haha
5
u/MooKk Sep 09 '21
I'm confused, is the top left node declaring a function? Can you not add parameters in unreal?
13
u/chestera321 Sep 09 '21
Is this consider as a code? (no visual script shaming just wonder :D)
4
u/knoam Sep 09 '21
So it's shuffling the array but it's returning the first element of the array from before it's shuffled so it's always the same thing?
And the shuffling is redundant with the random number generation?
2
u/TheSuperWig Sep 09 '21
Get rid of electronic nodes for the real beauty.
2
u/[deleted] Sep 09 '21
These are some interesting nodes and connectors. Is this a different kind of UI theme? Could you also explain why this is bad? Is it because using an array of integers is not really necessary just to get a random number within a range? (Still learning UE, and node-based programming in general)
2
u/evildevil90 Sep 10 '21
To everyone wondering why blueprints: prototyping. writing c++ code for unreal engine can be tricky and time consuming. Reflection is achieved at compilation time by a preprocessor so unless you restart the editor you can’t reload reflected interfaces. Also finding which header to include by looking docs or finding the right way to pass params or defining intermediate variables breaks “the flow”. Getting references to actors and object on the scene or dynamically defined props on instantiated actors is much easier. When you use BP is like having every header already included.
I usually refactor to c++ when I’m happy with the result, also because version control diffs under git are much more manageable
1
u/Slipguard Sep 09 '21
Could be nifty if it could take in a die array of any size and the string to int was left out of the function. An array of strings is not a bad way of having a flexible die system
1
u/Nasatyau Sep 09 '21
Well, this just looks like code with extra steps.
1
u/Naughtius_K_Maximus Sep 09 '21
Great. Who knew that not understanding UML meant I won't be able to understand code.
1
u/TherionSaysWhat Sep 10 '21
Look, I'm new-ish but... what the f is this?
1
u/[deleted] Sep 10 '21
Off topic... what is the software used to make this diagram called?
1
u/ION606 Sep 10 '21
What is this?
1
u/khaledsalem999 Sep 09 '21
where code ?
9
u/[deleted] Sep 09 '21
[removed] — view removed comment