Advice on runtime scripting for players


I want to give players a limited scripting language that can be used to modify items in my game, and can then be shared by simply sharing the script. I thought of something like Python, but am open to options.

My thoughts were to have items like weapons and spells be incame actors that interpret a script for things like hit chance, damage and whatever else I can think of. And then let players make modified versions and load the scripts at runtime.

Any ideas or pointers, advice etc is most welcome

Hi there @Rob-bb

If the player is going to modify logic {variable|array storage, conditional compare, math operations, loops, etc}, then I can see need for a Scripting System…and I would limit how much logic could be modified. I personally think 3D games need a visual scripting interface using a the same Art style as the game to avoid immersion breakage. Two-dimensional Wired Nodes are common approach to visual programming (ie Blueprints), and you can go to extremes with 3D Wired Nodes; OR even make the logic construction game mechanics in themselves (ie: little big planet).

I’ve written a couple of text-based scripting systems in the past, if this is your route, I would recommend sticking to a procedural language with a simple keyword set. I’d would have voted for BASIC or LUA a few years back, but, Python is whats in nowadays and many applications embed it. But, if you’re goal is not to educate on learning a scripting language, avoid a scripting language all together. I’m currently at this crossroad to make this decision in my own game.

If the player is only limited to modifying data values, I would avoid the complexity of a scripting system altogether, only providing a user interface to modify/view data values. With a Data-driven design model, you could achieve all you’re goals with just modifying data values.You can shared the data in a popular exchange format like JSON (Its human readable, heavily supported). You can transmit this sort of data in a text-based chat if you needed too. Of course, I would hide all of it behind a share button for ease-of-use.

Yeah, i was thinking of it not being a part of the game, rather some players can if they wish modify some stuff outside the game much like modding a game like ark or skyrim, but not as intense or capable. I would like them to have some basic functions, loops, if…else and so on, so area effect items could be modified to effect based on who knows what at this stage, allow for some sort of RPG saveign roll system etc… I am in the very very early stages of working out what I Want to do, no code has been created yet.

Want to know something funny? I am in the process of re-writing an updated version of a game a I made over 20 years ago on the Amiga using Blitz Basic, I brought Blitz because it was made in New Zealand and I am a Kiwi :slight_smile:

Thats awesome @Rob-bb .Worked with Blitzbasic for years working my way up to the bravery of dealing with C++. I learned a great deal about compiler’s investigating Mark Sibly’s compiler code. I still favor the simple syntax of BASIC languages, which is why I appreciate Blueprints. C++ is just not easy on my eyes (too much symbol clutter). Unfortunately, Blitzbasic is gone. I definitely think it deserves a new life, taking advantage of all this new tech.

It is so interesting that you’re developing a 20 year old game dev’d in Blitzbasic. I’m also doing the same. My game’s (see signature) Tournament Event Management System is based on my previous BlitzBasic TournamentBlitz Event Management System. In fact, at this very moment I’m coding a Wordpress Plugin to provide Online Services Subsystem to handle Tournaments, and other Online Services. I would definitely like to hear more about your game, its probably been haunting you all this time.

OPTIONAL READING I developed the TournamentBlitz Event Management System (TBEMS) to support cash-driven tournaments and other monetization models. With Players could purchase Tokens via Paypal Button. My system used HTTP to support Paypal Buttons on Website/ Paypal Instant Payment Notification (IPN)communications with my MySQL server.

In regards to Scripting Languages, I’m currently at the crossroad to make this decision to use or not use a Scripting Language. I’ve already scripted a BASIC interpreter (based on mark sibly compiler code) in UE4 with Blueprints for fun. Its requires a little more work to be fully functional as a Scripting Language Interpreter. I have my plate full developing a non-traditional MMO single handedly.

My game is a multiplayer sandbox in which Players can create their own adventures in with a in-game toolset and subsystems provided. All tools are in-game. I see the ‘MOD’ problem as a ‘rapid’ content creation problem, not a scripting problem. I’m solving this MOD problem with Hyper-Bashing and Procedural Generation. The goal is to extend the game world and entities with *Parts *created in DCC which can be easily added/removed from the world at run-time.

I’m providing extendable modular game mechanics (mutators) , puzzle system, unified projectile combat to support myriad combination of Adventure Logic and Weapon combinations without programming. In my opinion, these areas need to be stable and have a predictable function to prevent game breaking.

Some of the best moddable game examples:
Skyrim, Witcher 3, Cities Skylines.

They all have an offline/out of game somewhat intuitive scripting system that is based on either a very customized language and needs a special editor (bethesda) or text based (witcher/skylines).

They also usually offer the same commands within the game itself via console commands. Particularly skyrim, where you could literally script a whole new level by spawning and positioning things around via copy/paste.

It really all depends on the amount of time you wish to spend vs what it is that you wish the players to customize.

For skyrim you can format and pack new 3d objects and animations because they re- created a basic game editor essentially.

The Unreal examples are actually in the forums below. Don’t get too excited, the games and the mod systems for those kinda suck. In fact I’d disregard them altogether and suggest implementing your own scripting system instead.

You could actually just wrap a c++ conversion of your (whatever)Basic language (darkBasic, visualBasic, probably another 10 at least) and effectively allow the language to be used for scripting (in a limited fashion unless you really want to re-wrap all the functions).

Then naturally you would need a system that loads the files. Not hard to do, but all of the games cited above have brilliant examples.
1 file determines the loading hierarchy of the rest. Some have prerequisites so that the file can be organized appropriately right inside the game launcher, some (witcher) do not and depend on the user doing the legwork.
Some others simply load all the files within a specific folder.

Developing is a strong word, I have been using a limited version of UE4 to Mod the ARK survival game, and now I am re-creating an old game I made as an exercise to learn proper UE4. Obviously the ideas are bigger as the technology is greater than it was on the old A4000

I guess as a category it would fall under rogue like, was a 2d turn based maze with monsters to hack slash and zap with magic. So now I plan to do 3d random maze, not turn based, multi player co op and other things that were not possible to do in 6mb of ram with 120mb hard drive

The goal here is my own satisfaction derived from the pleasure of creating. I have no plans to conquer the steam charts :slight_smile:

The similarities between us are amazing. My Dream Game that brought me to UE4 was a Dragon’$ Gold:A Sci-Fantasy Co-Op, FPS Action RPG, Roguelike Dungeon Crawl, Treasure Hunt for Cash!. OPTIONAL READING: The highlight of the game concept was to team up with a party of 4 on a quest, enter a maze, fight monsters, get loot while on a quest to locate virtual treasure worth a real world cash prize, while competing against other teams. D$G was specifically designed to use the new version of tournament event management system I developed in Blitz3D. In fact, my previous business model evolved around Cash-driven Tournaments.

Since, that time I’ve joined many teams and conduct many experiments in UnrealEngine 4. The game concept did not die, but sort of morphed, assimilating all of my game concepts and business models over the years into my current project and businesses.

Roguelikes are what sparked my interest in Procedural Generation. I’ve written several Depth First Search Maze algorithms in Blueprints and invested into several procedural generation marketplace assets like Dungeon Architect, Procedural Landscape Ecosystem, and many others. As mentioned above, I’m leveraging Hyper-Bashing and Procedural Generation to develop a FTPS/RPG MMO Sandbox single-handedly.

My goal is creating a fun game, with unique player-driven creation features…simultaneously conquering the steam charts:)