SkookumScript in a Multiplayer Environment


(Word of warning, over-caffeinated and under rested so this may or may not be coherent)

I have a few questions but I’ll start with a bit of background. I came to UE4 from Unity (Torque3D before that) and I’ve dabbled with Leadwerks in the past. With each engine transition the tools were better and I felt I could do more than I had before (at least some of that has to do with experience). I fell in love with UE4 and BP but as much as I liked BP I started running into limitations (it can become literal spaghetti code) and started cursing the lack of a text based scripting language. BP does what it does really well, C++ does what it does really well, but there’s a gap. You seem to have filled that gap, which is phenomenal and I am really excited by the prospect of what SkookumScript can bring to the table. I saw your videos and my jaw dropped. It’s exactly what I feel has been missing. I haven’t used it yet (need to transition my project to 4.11 and remove the cruft/gangrene in my code base) and I’m curious about it’s applicability/appropriateness to my project.

The game I’m working on is an arena shooter that lives somewhere between Quake and Tribes. I’d like to support “easy” modding without necessarily requiring a user download the UE4 editor. Essentially I would like my gamemodes to be “serverside mods” where the client doesn’t need to know the rules of the game. Currently this is pretty much how gamemode works in cpp and BP, but i’d like to put all the logic into script (the idea of building a gamemode while players are in the server is extremely compelling). I have a lot of ideas surrounding gamemodes but doing them in c++ can be cumbersome and hard to debug while BP just gets… messy. Aside from gamemodes I’d like to allow for script based control of pickups, when they spawn, can they be picked up by multiple people etc. The primary drive for serverside mods/modes is to allow the users to make any weird mode they can imagine (strange combinations of CTF/DM/KOTH/etc). It’s a piece of gaming I think has sadly fallen by the wayside that I really miss from the mid '00s all the way back into the '90s.

Is SkookumScript appropriate for these use cases? Does SkookumScript support client/server RPCs (i assume if necessary it could call an appropriate function cpp (tagged with client/server) which would then call back into SkookumScript)? Does SkookumScript have support for variable replication?

If you’d like any clarification on what my caffeine addled brain is trying to convey please ask away.


1 Like

I may be corrected, but SK does not to my knowledge have native support for RPC or variable replication.

But, as you pointed out, you can merely access the CPP or BP interfaces for this functionality from SK.

So you’d have kind of your standard practice of 95% in the base lang(SK) and then some glue at both ends to handle network/server logic via CPP/BP.

I don’t see any reason you couldn’t do exactly what you describe.

The only caveat is actually loading the module on the server, with the free SK you need to compile/bake the game. To allow live unloading/loading of dynamic scripts I think you’d actually need the premium runtime; it’s one of the only features behind the paywall.

(As I said, not 100% confident that’s correct, if not, I’m sure I’ll be corrected XD)

1 Like

Thanks for the reply VolkerEinsfeld.

Just for clarification, users wouldn’t be able to write their own scripts and apply it to a packaged game? Or they would but all the scripts would need to be loaded together/at once/at launch?

If it’s the second case then I don’t think that would be a problem. If I can’t build the gamemode “live” then that’s not a deal breaker by any means.

I should have mentioned we’re not doing anything fancy for the server. It’s just UE4’s built in dedicated server (requires build from source but if I understand correctly I can use the version in github for that?).

The game is small scale (2 to at most 12) players and match/round based. I’m mostly just after gamemodes (anything else is gravy).

Scenario 1-ish, a user can write their own script, but couldn’t apply it to the packaged game server.

The game server would have to be able to load/unload the script dynamically at runtime(which is a paid feature).

If the user also has access to your source, they could then re-package the game with their mod via SK, however.

Ah, I was hoping they could write and compile their scripts then dump them in a folder in the packaged game. Even without that I think the ease of scripting game modes rather than writing them in CPP would be worth using SkookumScript.

Edit: When you say source, do you mean the cpp/UE project or the sk script files? I was planning on making all scripts available with the game.

I meant the CPP/UE project.

As for SkookumScript having “native support for RPC or variable replication”, its native variables are not currently remotely replicated though it can still read and write Blueprint variables that are replicated and such variables can be exposed as raw variables and used in SkookumScript just like built-in :sk: variables.

SkookumScript can also call any UE4 functions that support replication (RPC). It can call all the same functions that BPs can call.

We haven’t experimented with remote replication here at Agog Labs, though it should work fine.

As for modding, see the separate post here: