Modding a compiled program in Go

So I had an idea about a game using Go and Raylib that would highly be oriented around modding. Most of the things I figured out except modding part. So I would like my game to be compiled and mods to be compiled. Ideally I would build my game and a game will detect binaries in a specific folder.Mods will mostly be maps of new game objects( map of structs, and struct has members for data and functions that need to be defined). So how would I do this by not having to recompile my project whenever I add a mod to it(or anyone in the future). To be a bit more precise I would like to achieve something like Minecraft modding. You have a folder with jar files(in my case binaries) that Minecraft mod loader will detect and load them.

Hi @bosko2,

What quickly comes to mind:

  • Use embedded script languages like Lua or JavaScript. There are a few such packages available (try GitHub).
  • Use a Go interpreter like Yaegi.
3 Likes

I did consider JavaScript or Go interpreter as an option but but only if my original idea is not possible ( or extremely hard to implement).

1 Like

By looking into Yaegi it does seem very good. I think I will use Yaegi. Using binaries will make it harder for both me and a modder.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.