HACKER Q&A
📣 arduinomancer

Why is visual programming so popular for game programming?


Why is visual programming so popular for game programming compared to other domains?

For example Unreal Blueprints

What is it about them that makes it so popular?


  👤 oneoff786 Accepted Answer ✓
I’m a huge fan of blueprints. A few things it does well:

* makes the engine api very discoverable, which is huge. It’s a step above intellisense and auto complete. The api is likely the reason it’s so dominate in games. It’s the bulk of game programming. Visual programming isn’t very good for coding new things from scratch.

* let’s you read code and clearly follow execution from start to finish.

* let’s you visually document concepts with collapsed nodes, and colored containers and what not. Good blueprints are literally written as long form pseudo code, with double clicks to see actual implementation.

* concepts like const functions are just conceptually clearer. Const functions have no execution pin. They (should) have no side effects. Just a calculation. The engine doesn’t enforce this I don’t think but it’s close…

What it explicitly does not do is allow you to code games without knowing how to code. Countless beginners just die on the first steps. You still need to understand object oriented design and basic coding concepts to do well.


👤 drakonka
On the larger game teams I've worked on, most people using blueprints and schematics aren't the programmers but the content creators. The programmers are providing said blueprint elements/building blocks as well as extending (or modifying) the engine with other logic that content creators don't need access to via their visual tools.

For example: a level designer might want a specific type of entity in their level (let's say a floating platform). A programmer can extend the engine to provide the logic for said entity, which accepts parameters like how quickly the platform should move, what should trigger the movement, in which direction it is moving, etc. The programmer implements all of this and the final result is a new entity type said level designer can drag and drop into their level in the editor, and configure to their heart's content.


👤 aschearer
I'm working on a survival horror action RPG^1 with a friend. We're two people^2. At a high level, I write the code, he does the art. I use visual scripting a lot. Here's why:

  1. He is comfortable tweaking parameters in a visual environment. This means he can iterate without me which is faster. He comes to me with a list of things he wants accomplish. I create a bunch of tools. He's off to the races.
  2. For certain problems it's faster for me to whip together some visual code using re-usable code-building-blocks I've written. For example, sequencing through a series of states for some moment in the game or reacting to a game event.
  3. He is familiar with finite state machines -- for example the entire animation system is built on them -- and can therefore make changes to the game without my input, say changing how the boss works in combat.
  4. Plus these changes don't require recompilation, which helps speed up iteration.
As a programmer I'll say once you get your head around the paradigm it's pretty cool. A ton of game code is just glue or event handling. Visual coding is often a good fit for those problems. It also forces me to write my code in a more SOLID way -- I end up writing a bunch of atomic "tasks" that get mixed and matched in creative, unexpected ways. That means my code is usually simpler and therefore less bug prone.

The flip side is that it's very easy to wind up with a huge pile of visual code spaghetti strewn across a dozen places, and it's impossible to refactor safely -- pretty serious issues ... but when you're just two people trying to scrape by and release something before flaming out, they're not at the top of my list!

[1]: Very out of date screenshots for those curious: https://store.steampowered.com/app/1446350/You_Will_Die_Here...

[2]: Plus contractors who help with the art, sound, marketing.


👤 xsmasher
Beacuse you can expose functionality to non-programmers and let them go HAM with the components you have created. I'm constantly amazed at what artists and animators and producers can do themselves if given half the chance. Plenty of people have the "engineering Tao" but not the training for traditional programming.

Removing the engineer from the content loops lets a lot of work happen really quickly.


👤 qwery
It's an exceedingly popular way of writing materials/shaders in 3D content tools -- I'd guess more so than any game programming/logic (of course big game engines tend to have visual shader tools as well)

It can be (usually is) far less intimidating than text-based coding. Compare:

- a text editor with a hello-world template script, a whole keyboard and now the engine yells at you because you (bravely) did something trivial to start, like adding a blank line in between "hello" and "world"

- a canvas with a big "add node" button which brings up a list of verbs and nouns organised into native-language categories

Asynchronous code can be hard to follow. Visual programming / node graphs are actually pretty good at representing complicated asynchronous logic.

I think this is pretty closely related to why diagrams / drawing / whiteboards are commonly cited as helpful by programmers.

I haven't used Unreal Blueprints. I have used Unreal (3, UDK) Kismet which is not particularly related (to Blueprints) other than the "Unreal" part, AFAIK. It was quite capable for most level design scripting logic, but was not ideal for implementing new mechanics for example. You could also copy nodes in/out as plaintext which I always appreciated as a feature I don't see very often.


👤 yuhe00
With the availability of game engines, gameplay programming is actually very high-level. Most of the logic is handling some input or some collision or updating some position or timer every frame. The more complex parts of a game (collisions, physics simulation, rendering, asset management, networking, etc.) is handled by the game engine itself, so the games programmer usually only need to interface with the high-level API of these systems.

Also, games programming is HIGHLY agile. Most of the logic you implement will be thrown away. It's all about rapid prototyping and finding what is "fun". Of course, once you've found something fun you might want to build it into a solid and scalable system, but even in such a system you might want to keep the flexibility for designers to extend and add new elements as they see fit (using visual scripting!). The ability for non-programmers to be able to make gameplay changes is also an important factor.


👤 ReflectedImage
If you can use a Domain Specific Language (DSL) for a task, or in this case a Domain Specific Modelling Language (DSML), why wouldn't you use one?

It's no different from using SQL for database access.

Basically, someone has to do a ton of upfront work designing a domain specific language for a task, in this case game scripting then it's easier for people to do the game scripting using the domain specific language than using a general purpose language.

SQL is an early example of a language designed for a specific purpose.


👤 bogwog
Just because Unreal does it doesn’t mean it’s “popular”. I’m not familiar with any other game engine that has something like this as a first class feature.

The reason blueprints exist in UE is because they needed a way to allow non-expert programmers on the team to write code that isn’t C++, but they didn’t want to use a high level scripting language like Lua.

IIRC, Sweeney said (on Twitter) that in the past, it was a burden to constantly be designing and maintaining language bindings for scripts, especially with a rapidly changing engine.

Also, (I’m guessing here), blueprints result in less bugs since it provides static typing and makes it possible to do some advanced visual debugging. These are things that, even if they were available in a language like Lua, they would be intimidating and/or uncomfortable for the artists/non-programmers on a team. Plus I’d imagine that it’s relatively easy to produce some highly optimized code from blueprints, maybe even compile it to native instructions.

It’s also probably no coincidence that the visual node-based concept is used a lot in other tools used primarily by artists, like for material creation.


👤 hyperpallium2

  Why isn't visual programning more popular?
If a picture tells a thousand words, and diagrams and figures are so helpful, why hasn't visual programming taken over?

The problem is the complexity of overlaid graphs. Text, through references, handles this well and planar layouts do not.

Consider also the density of information; an example is a (visual) AST of an arithmetic expreasion, versus the conventional symbolic representation. You could make a visual tool to build arithmetic trees. It's a very clear repreaentation, easy to follow and would be fun to use. But... real fast... it becomes unweildy.

So, visual programming is great for simple problems, by non-programmers. As other commenters have said, there are a lot of non-programmers in game development - I think most of it is non-programming these days.

Another category is new users. People play games, and then want to make games. Visual programming is more like a game than text programming is. Some of these people really are just "playing" at making games (nothing wrong with that!) But some of them are earnestly making a game - and the fewer obstacles in their way (like learning how to program), the better. Get them onboard, get them started - better for them, better for Epic, and better for the world to get the games they've come up with.

Finally, because of text superiority, programming infrastructure (e.g. git) is also text-based.

BTW spreadsheets are kinda visual, and very popular. "Visual Basic" has some visual programming elements, for GUIs. There's some business tools, like XML mappers, that are visual.


👤 trynewideas
Accessibility. For newer developers, it puts the component parts in front of you as visual objects you can manipulate, instead of relying on you memorizing keywords (or knowing enough about syntax to leverage things like IntelliSense). For design teams, it lets people who have less or no code experience - writers, artists, mechanical designers - safely manipulate parts of complex game logic for balance and feel.

👤 Netcob
Before I learned how to program, I used this software called "Klik&Play", later replaced by "Multimedia Fusion". This was over 20 years ago, but apparently the software still exists and works in a similar way:

For the logic, you get a table where every column is essentially a class, and each row is an if-then construct. The first column can be a condition, implicitly called once per frame, or an event with an optional condition. In each cell you can add actions that should be called on the instances of the class for its column. Everything is selected through simple dialogs.

For example, you'd make a condition/event like "Bullet collides with enemy", then add an action "Destroy" under "Bullet" and "Enemy" classes, something like "Play 'boom.wav'" under the "Sound" class, and "Add 1" to some "Counter" class. If I recall correctly that is.

This ended up getting me into programming, because I was able to quickly achieve results while being able to start experimenting with the UI before reading a single tutorial or any sort of document. I think discoverability is the killer feature. I could easily see that instead of destroying an entity, I could spawn another one. Or I could create an entity at the point of the collision, so I'd animate an explosion effect. But the explosion would just stay around, so I looked around what I could do... found an "Animation ended" event, so I simply made another rule that would destroy the explosion object when its animation ended. And so on.

I think another reason is that game logic is messy yet simple. So you don't want a lot of boilerplate code or having it scattered across lots of files, otherwise you're not getting a good overview. But I can't vouch for modern visual programming languages to solve that problem since I haven't really tried them.


👤 hiddensemicolon
Ease of use.

It's just another tool in the toolbox. Epic has mentioned how a portion of Fortnite was built using Blueprints. It helped them to prototype features and get the game built quickly.

Think about how handy it is to have a diagram, picture, or plan before writing a single line of code. Epic takes sections made using Blueprints and rewrites them in C++ for better performance.

After using Blueprints for a bit I can see its merit and why it's useful.

Unfortunately, I can't find the source where Epic talked about this. I think it was a GDC talk but I could be wrong. :\


👤 NiagaraThistle
For me, someone who wanted to build a NES Dragon Warrior or Final Fantasy clone back in the early 90's and had no idea how games were even made, let alone owned a computer, the idea today that I can show my kids they can build a game without them needing to fully understand how to code is mind blowing.

I think that's really why it's so popular: "anyone" with an idea can sit down and cobble something together that looks like a video game. A lot of people will give up when they realize you need to know more than "drag and drop" to customize your game, but it allows a lot of people with game dreams to dive in who would otherwise simply never try because they don't know anything about programming.

Now where did I put those maps to my Fantasy Dragon Quester 2-d jrpg game?


👤 jay_kyburz
I think its only because Unreal has one, and everybody wants to be like Unreal.

I think Lua in Roblox, or the Godot's python like language, or Unity's C# is strictly better in every way.

Visual Programming languages don't prevent "non programmers" from writing really weird code that makes no sense.

You will find many first time programmers that like visaul programming because they created something cool in Unreal. I think if there was a Lua integration they would have achieved more, faster.

We use words to communicate our thoughts in comments on Hacker News. What would our communication be like if we only had flow charts you could plug variables into?


👤 lostgame
Why the heck wouldn't it be?

Game design - especially in 3D environments - is an incredibly visual process!

Unless you are incredibly familiar with programming to start - why, if you were approaching game design, and - for instance - had level layouts, character and enemy designs, etc - prepared in advance - wouldn't you?

It's literally the most logical way to approach filling in those gaps with functionality with a visual system of design like that.


👤 tlb
Many people working on games have graphic design backgrounds rather than programming, so they're more comfortable with it.

A lot of game programming is tweaking parameters, which the blueprint systems provide in a click-and-drag UI rather than editing numbers in text files and recompiling.

I'm curious to hear other suggestions.


👤 thurn
Even for me as a programmer, waiting for a lengthy compile cycle in order to test something like a simple logical change is pretty painful. Game programming is overwhelmingly done in low-level languages like C++/Rust which have awful compilation performance and very limited hot-reloading support.

👤 johnnyanmac
Because many people getting into game development aren't technical people. And Epic and other engines are more than happy to sell the pitch of "Make your dream video game without any coding!" (nevermind that visual programming is STILL programming, but I digress)

I'll admit a node based system is much more preferable for some systems, like UI or animation. But otherwise, I've yet to meet a technical person who prefers Blueprints over simply typing out the logic. There's a reason why there are several articles and videos out there dedicated to trying to organize "blueprint spaghetti" once our project scales up. It gets messy fast


👤 anecd0te
Programming is hard, and there's a market for making it easier. Visual programming has a quick on-ramp (albeit a low ceiling).

👤 Tozen
> Why is visual programming so popular for game programming compared to other domains...

Is visual programming really so popular in game programming, or is it being simply used for specific and particular tasks?

From what I see, nobody is using blueprint to outright program any games because it is too slow, hard to debug, and way too easy to get lost in visual spaghetti.

In context to visual effects, visual "scripting" does comes more into play, because you are doing something like video editing. In that context, you are already dealing with a list of visually identifiable options to achieve an outcome, so visual scripting is the next level up by controlling how the options are applied.

Everything is already setup for the person, it's a matter of what choices and to what degree. If you reduced this to a more primitive concept, we would be talking about which buttons to press and in what sequence. Yes, we often still define this type of interaction as programming, but there should be no illusions that this is more basic and limited. It has its place (visual programming), and clearly more so with artists (who are not programmers by trade), but you still have to do text based programming for the more advanced and creative stuff. Visual programming isn't taking over traditional text based programming, rather it's supplemental.


👤 kevingadd
The simplest way I can put it is that visual programming in games lets non-programmers meaningfully contribute to code-adjacent and 'code' parts of game content, like pixel shaders or character AI or simple object behaviors. These parts are typically not so performance critical or complex that you need a programmer to do them by hand, and more importantly, if you empower the game designer or artist to fiddle with them directly, they can quickly iterate until they hit something that is nearly perfect. At that point if there's something wrong with it, you can hand it off to a programmer to fix.

I view it as equivalent to how Microsoft Excel empowers all sorts of non-programmers to solve problems via the use of formulas (and the occasional macro). As a tools programmer and producer I frequently discovered that some of our designers or writers had cobbled together their own solutions for difficult problems just using excel know-how. Excel teaches ordinary people that computers can do their bidding and visual programming for games does the same thing for game artists, writers, etc.


👤 dangerface
Visual programming is generally considered easier to learn and there are lots of people who can't code who want to make games.

I don't really know why people consider visual programming easier than code once you know how to code I find visual programming very difficult to use or maintain a project of any moderate complexity. Theres no standardisation to visual programming either if you spend time learning one system for games and now want to make a website you now need to learn a whole new system and way of thinking about logic. If you spent all that time learning python then you would know python and could just do whatever you wanted.

I think its popularity comes mostly from fear of code, colourful icons look more approachable and easier to understand than a scary wall of text. I don't think it is easier to learn but I 100% recognise any time I have taught some one to code the number one hurdle is getting them over their fear of trying something new visual programming seems to do that well.


👤 truckerbill
A counter question to programmers in other fields - do you visualise the structure of code in your head almost like a graph, or do you think in code blocks? I feel like more visual thinkers would naturally also be drawn to games.

I’m a visual thinker myself, so I can’t imagine not thinking about code as a diagram. But it seems that from the way most tools are designed , this is not the majority view.


👤 eezurr
If you want a hands on answer OP, download Blender and follow the donut tutorial on YouTube. As a software engineer with 10+ years of experience, the geometry nodes in Blender just make sense[1]. The comparison here is your are creating a 3D object from scratch, just like a game designer would create a 3D scene from scratch.

[1] It's a form of visual programming.


👤 throwmeariver1
It's mainly because of the history of VFX tools and pipelines. A lot of game studios adopted tools from ILM and Pixar. One of the first notable presentation on compositing must be from the 1984 SIGGRAPH held by Porter and Duff. They both went and implemented a node based workflow through the whole pipeline at ILM and later at Pixar. Visual Programming also is a lower barrier of entry, at VFX and Game Studios artist need to proficient in the underlying architecture to get optimal performance and visual fidelity it's easier to give them tools like node base shaders or blueprints instead of code. Most visual programming is also realtime which makes it a lot easier to understand for non programmers.

https://keithp.com/~keithp/porterduff/p253-porter.pdf


👤 stuntkite
I've used a lot of Playmaker with Unity3D. I'm a programmer who works in NUI and I make visual art with Unity and blender but my day job is mostly python and go. I've taught 3D artists and people who were not programmers to use Playmaker to get things made in Unity and they take to it quick.

I try to avoid "writing code" when I'm making 3D things in unity until I absolutely have to. I like to work in a flow state and the context switching is murder on that. Then when I've blocked everything out and I know all the variables if needed I sit down and write specific modules if it's needed for performance or something was more difficult in a visual style. That is becoming increasingly rare though.


👤 hjkl0
How do you know it’s so popular? And popular with who?

Do you know of any developers who otherwise use text-based tools and who switch to visual programming just when they work on games?

Personally, when using visual programming UIs, I instinctively look for some kind of “edit source” function. It just seems like a waste of time to use the mouse to browse through menus and constantly reorganize the board.

My guess is that visual programming is simply more approachable and more appealing than text-based programming when you’re just starting out and you’re intimidated by the unfamiliar conventions of coding. It’s easier to learn when the the language itself looks like the teaching tools (such as flowcharts). And I bet that more people start out by writing games than any other kind of software.


👤 jayd16
Graphs fit well with functional code styles. Art and games have a lot of places where a functional style makes sense.

Games are usually heavily pre-allocated and work tends towards per frame computation operating on a pre-allocated state. Again, this leans into the functional style and thus an easy graphical style.

You can write behavior trees that run per frame without a lot of hidden state. You can write shader graphs as shaders also happen to be very functional in style.

It also helps that the field attracts very visual people by nature.

It's also a graphical field by nature. A console might make sense for some programs but a graphical interface with a built in graphical output makes more sense when you're operating on meshes and textures and such.


👤 simne
Few months ago, in Ukraine run virus ad, where the cat asks to salesman, how he could buy in their shop, as he has not hands, he said "I have paws!"

And that is, when later I talk with persons from gamedev, I hear nearly same thing form this ad, "I cannot answer your question, you are cool, but I have paws".

They are not bad people, they are extremely good in their sphere, but they are not programmers at all, and in many cases, they are fear real programming, those huge texts. Visual programming is just less fear for them.

When they got stuck, they asked people like me, who are between these two worlds.


👤 pgag
Visual programming have the advantage to be more approachable to non-programmers. In the gaming industry, you need a tone of small event reactions and logics to make great game. If you push all of those needs to a separate programmer team, you add complexity to your production and lower your agility. Given live editing supported, code will always be more efficient for programmers but getting all the talents (design, level design…) that are also fluent programmers may be unrealistic at scale.

👤 Animats
What seems to help is that Epic came up with a modular blueprint system. Blender used to have a game engine, with blocks connected via wires, but the entire game was in one giant diagram. Epic blueprints tend to be of modest size.

👤 brundolf
My take is that game studios have a lot of "designers" who need to express a lot of basic scripting logic but may not be familiar with traditional programming. So graphical nodes may be more accessible for them

👤 Kapura
Blueprints, or node graphs more generally, allow people to encode programmatic logic without needing to learn the syntax of a programming language. If they can read a flow chart, they can implement simple (or not simple) functionality without the perceived technical hurdle of "learning to code."

This is important in games because iteration is so critical to success. Delegating high level logic to visual scripting can allow different people to focus on low level concerns like performance, so both problems can (hopefully) be iterated on in parallel.


👤 nfgrep
I think part if it stems from how multidisciplinary a game studio can be. In my experience, visual programming languages allow people with minimal programming experience (artists, designers, etc) to implement ideas. Im willing to bet onboarding someone with a visual language like Unreal’s blueprints is a much better time than trying to teach them C++. I also find prototyping, especially collaborative prototyping, to be easier with visual languages; its easier to “follow the fun” when all it takes is a drag-and-drop to change some logic.

👤 danbolt
Computer programmers are relatively expensive to hire, especially ones that have specialized knowledge about making games (eg: deferred rendering, ECS gameplay patterns, network topology models, etc.). There's generally a minimum amount of technical knowledge to create the sort of art you're looking for.

If you can abstract that technical knowledge away from making the art, it can lower your costs. Plus, it becomes easier to hire programmers as they don't necessarily need skills in the visual arts or design.


👤 vzaliva
Is it? You make a generalization giving just one example: Unreal Blueprints. As somebody not familiar with game programming but familiar with critical thiking I am unconvinced.

👤 rex64
I'm not sure if it's really that popular but Visual Programming gives the ability for designers to quickly implement their ideas without having to ask and waiting for a programmer to implement them via code.

For example, in the case of Unreal Engine, gameplay programmers build the basic blocks via C++, and game designers can access them via Blueprint (Unreal Engine's visual programming tool).


👤 pcwalton
I remember hearing that studies have shown that the biggest impediment to absolute beginner programmers is the strictness of language syntax. Visual programming makes syntax errors impossible, and that's a huge benefit to those who don't have programming experience. (This was the whole motivation underlying Scratch's visual programming language, by the way.)

👤 pphysch
Developer GUI is a practical necessity for building 3D scenes, unlike 2D. Many of those GUIs were extended to add support for OOP scripting.

From a programming perspective, this often leads to poor data access patterns and poor performance (walking over a scene graph and running arbitrary code for each object is not cache friendly at all).


👤 dimgl
Blueprints is okay until you start to reach some branching or conditionals. You can always compartmentalize things into Blueprint functions, but Blueprints do have some limitations.

Thankfully, Unreal really shines when you combine them both together: C++ and Blueprints. That's when things really start to click.


👤 jaimex2
Simple, it appeals to a demographic with an interest in gaming but not coding.

I think its great. We lost a lot of culture on the web when Flash was killed. Every site looks like the same sterile cookie cut bootstrap today.

I can't remember the last time a site pleasantly surprised me with a creative rendition.

I despise Apple and Adobe for it.


👤 can16358p
Simple: it allows non-programmers to program to some extent, which is enough for many of the basic tasks.

We have it in UE, Blender, Spark AR to name a few, which are mostly used by creatives who might not have much of a programming experience, to create amazing results.


👤 dragonwriter
> Why is visual programming so popular for game programming compared to other domains?

Visual programming / executable diagrams are (usually, though it seems from mostly just-outside-the-market to ebb-and-flow over time) popular in business integration as well.


👤 Mikeb85
Because non-programmers can make games. Let's face it, for many games assets are 90% of the work and the programming is pretty simple. Hell, lots of games produced today would have been considered an engine 'mod' 20 years ago.

👤 0xdeadb00f
Because gamers are naturally visual creatures. People who create games these days usually are gamers who enjoy games. and so that visual stimulation and visual way of playing, learning probably carries across, at least for the beginners.

👤 ilrwbwrkhv
Because games are visual. It is a shame that so much of programming is still through text files. Web programming for example should be completely done visually.

👤 cttet
My speculation is that because game industry know to design better UI patterns, they simply made better visual programming languages.

👤 joeld42
Technical artists.

👤 bitwize
It helps people who don't identify as programmers/developers program without thinking they're programming.

👤 jojoz
I think it's the future. I study programming too right now. It's not so easy but I found writing service here https://essayshark.com/ to help me with my homework. These guys are pro in writing and programming and helped me hundreds of times. Useful service for students.

👤 SquidJack
Visual is good for prototyping for production I'll go for traditional approach

👤 charcircuit
It gives more power to artists to tweak things in engine.

👤 high_byte
question is why isn't visual programming more popular amongst "traditional" or non-gamedev programming?

👤 hamiltonians
i hate visual programing if i am the customer. slow, crashes, buggy. the lower the code, the better tbe program, but obviously harder.

👤 a-dub
to make it possible for non-coding designers and artists to build games.