Try / OpenGothic

Reimplementation of Gothic 2 Notr
MIT License
1.07k stars 78 forks source link

provide an API for moders to port DMA mods to OpenGothic #573

Open Alino opened 3 months ago

Alino commented 3 months ago

Hi guys. I have read that you are not going to support DMA mods and I think it's the right approach. But then I guess the right way to make the mods work - is to use some game API that would enable the moders to port their DMA based mods, or create new ones? Is that possible, and is it something on the roadmap?

(I mean instead of using memory exploits, the moders would use an API to achieve executing their code)

ezamelczyk commented 3 months ago

I feel like most mods could just be implemented into the game engine itself. I'm right now working on gamepad support just like zGamePad and it will be eventually merged into the main branch.

Try commented 3 months ago

Hi @Alino !

Is that possible, and is it something on the roadmap?

Nothing concrete yet (and to be fair development here is sporadic and for fun), only some high level ideas so far:

Alino commented 3 months ago

I feel like most mods could just be implemented into the game engine itself. I'm right now working on gamepad support just like zGamePad and it will be eventually merged into the main branch.

Working on gamepad support sounds great and definitely feels like something that should be part of the main game engine. I totally get where you're coming from with that.

About adding mods, though, I think there's a bit of a line to draw. Mods that change the game a lot, like adding new stuff or changing what's already there, might be better off as separate plugins. That way, if the goal is to keep things close to the original game, we can do that without messing with the core too much. A plugin system seems like a smart move for handling those bigger changes.

Hi @Alino !

Is that possible, and is it something on the roadmap?

Nothing concrete yet (and to be fair development here is sporadic and for fun), only some high level ideas so far:

  • Classify use-cases of DMA into:
  • existing project (CoM) - for them there is a compatibility layer in progress (Support for Ikarus/LeGo #231)
  • support for system features (aka GamePad) -those can be baked into engine
  • .dll plugins - no, I'm not comfortable to recommend for player run external code, that cannot be sandboxed
  • C++ plugins wia web-assembly - looks promising for internal api and quite portable (same wasm can work on any OS and be safe for player)

Thanks a lot for the update! Hearing about the compatibility layer is super exciting. It sounds like it's going to make it way easier for people to get into OpenGothic, which is awesome. I had no idea you guys were working on that, so it's pretty cool news.

The idea of using WebAssembly (WASM) for plugins is really interesting too. It seems like a smart way to make mods work across different systems without causing security headaches. Can't wait to see how it'll play out in OpenGothic and what new features we might get from it.

I've been playing OpenGothic on my MacBook Pro M1 and loving it, especially with some texture mods to spice things up. It's encouraging to see the project moving forward. Looking forward to what's coming next and happy to help out however I can.

Reveares commented 3 months ago
* C++ plugins wia web-assembly - looks promising for internal api and quite portable (same wasm can work on any OS and be safe for player)

What are your plans and thoughts on WASM?

I would like to throw the topic of multiplayer into the ring. Because I think it would be useful to find a solution that works for mods and multiplayer, so that each modding project doesn't use its own language/ecosystem and would therefore be incompatible.

It is of course important that the client scripts are sandboxed, especially if you connect to a multiplayer server and the client scripts are automatically downloaded and executed.

For server scripts there are other requirements. Because here you want to have access to the file system, databases, caches, HTTP server etc.. This means that you want to integrate appropriate libraries and need a package manager. And, of course, a corresponding ecosystem, debugger, IDE support - in other words, a reasonably modern development experience. This also makes it easier for beginners.

In my opinion, it would therefore make sense to use one of the established scripting languages such as Lua or JavaScript. Perhaps someone here also knows of other possibilities.

hellozyemlya commented 1 month ago

Quick comment regarding wasm - generally existing wasm engines will require writing lot of glue code, also, wasm modules are isolated, so they can't call each other easily. I guess for external relatively safe code execution it's better to use something like c# runtime with limited functionality.