[HN Gopher] Ask HN: Why is visual programming so popular for gam...
___________________________________________________________________
Ask HN: 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?
Author : arduinomancer
Score : 8 points
Date : 2022-04-06 20:39 UTC (2 hours ago)
| aschearer wrote:
| 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.
| yuhe00 wrote:
| 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 wrote:
| 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.
| truckerbill wrote:
| 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.
| tlb wrote:
| 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.
___________________________________________________________________
(page generated 2022-04-06 23:02 UTC)