Yeah better to call it "backend" maybe than server... a rose is a rose by any other name 😎
OK, for anyone from the future with a similar need searching around, here's how I see this going down:
- in local-dev / debug builds, godot game UDP-connects to localhost "server"
- for hypothetical release builds, the "server" prog (and not the godot game binary) is the game-starting prog and it runs the godot game binary, this let's both communicate via standard-I/O pipes, on the Godot side via
printraw
(print line to stdout aka the "server") and OS.read_string_from_stdin
(in sep thread — read next line from stdin aka the "server").
The line protocol could be no-whitespace-JSON or custom. Will use the former, assuming GDScripts JSON APIs are anyway C++ underneath =)
The two different modes are of course so I can F5-run with the GDScript debugger/profiler etc.
Thanks for the lively discussion, good lookin' out 😁