Nodebox: Visual Scripting for UGC (now) at your fingertips
Posted 10 hours ago

I hate visual scripting*

First thing I wanted to make in S&box was a scripting API, so that people could make minigames on Sandbox-like gamemodes and stuff like that.
I literally have 5k hours of playtime on a Garry's Mod sandbox server(s) just scripting random thingamajigs:
  • (Expression 2) Whole ass PvP/Competitive gamemodes like Control Points / Supraball-something / etc
  • (Expression 2) "Shader" library that draws fractals, Raymarches stuff or just trace-scans a photo (with water reflections, texture sampling, world-wrap, debanding and supersampling)
  • ...
  • (Starfall) A couple 2D multiplayer games on a screen, where people can gather around and play them
  • (Starfall) A cat png that chases you, flips you off, drops a bunch of metal pipes on top of you and runs away
  • ...
This is what got me into coding/game development in the first place.
Developer experience was horrible..?, but I didn't know any better.
Now I have a LuaVM Godot extension, a bachelor's thesis on a coding-learning sandbox game/platform of some sort and way too many thoughts on scripting APIs.
Lua is still great, but I learned to hate it too. (fuck you Roberto Ierusalimschy, with your ~= and 1-indexing)

Visual scripting, yeah, visual scripting,
It's cumbersome :) (most of the time)
It's great for shaders/materials (very gud) and for small event logic (only sometimes)

Although, Blueprints in Unreal Engine are fine, they have variables, functions and libraries. It's the nicest visual scripting system you can try. (and materials are great too)

* - but,
"normal" people - non-nerd players that play your game - don't want to learn a programming language, they just want to cobble some stuff together and make RGB neon lights for their car.
This is what Wiremod in Gmod is - a very basic way to make funky contraptions come to life.
I still have no idea how people got into it, since you have zero-to-none help understanding it in-game, only tutorial videos on Youtube (most of which are already 8+ years old).

Wiremod is great, but it was so fiddly that I never want to comeback to it ever again.
I hate the fact that almost all wiremod contraptions are only understood by the person who made them.
 ???? A hunter?x???prop with 100 gates ?? and a mess of ????? wires ????

This was my stance on visual scripting before, but now...

"Play" Resonite.

Without a VR headset it's kinda weird, but at the very least, look up a Youtube video on it.

The visual scripting there is fucking ASS, but the framework is insane
(buuut it handles nicely in VR, which makes it one-of-a-kind)

The gist of it is:
  • All nodes exist in 3D space and everyone can see them
  • You can collaborate on scripts together, or just help someone understand stuff
  • Nodes can be hidden away (into GameObjects)
But, the most mind-bending things are:
  • You can upload anything from your PC and it just works
    • Models, Images/Textures, Sound Effects, Text Files, etc
  • You can control any property you want:
    • Set the model material, change the shader, move stuff around, parent/unparent, etc
      • Yes, that means every avatar is "constructed" in-game, maybe even by multiple people, one person is importing stuff, someone else is configuring materials, and another dood is plucking boogers while making node logic so the avatar farts when it walks
  • You have a personal inventory, where you can save any creation (and it has folders)
There are a lot of worlds where you can "symlink" folders shared by others to your inventory
I've seen everything:
  • Multi-tools
  • A 2D plane that's snaps nodes onto itself for ease of scripting (yes, it's a tool made for visual scripting in the same visual scripting engine)
  • Working minigames (sudoku/uno/...)
  • Equipable Half-Life HUD
  • and a fully-working Tardis...
Here's an Imgur album with more clips/screenshots if you are interested
(Nope, I lost all the clips where we were spawning random shit, like Sudoku, Tardis and others)

And, yes, this does look complex, but it's because we were balls deep into making a button that screams "YIPPIE" with it's pitch driven by it's scale, the sound effect for which was recorded in-game via an in-game microphone tool from my inventory...

But, the visual scripting itself is very bloated imo, backwards-compatibility is a bitch, and it makes the whole scripting system neigh-incomprehensible to a beginner.
Secondly, it's lacking libraries or even just the ability to collapse a group of nodes into a single node.