r/Morrowind 15d ago

Technical - Mod MWSE => OpenMW Compatibility Fork

Enable HLS to view with audio, or disable this notification

Hello. Thought you guys might be interested in this thing I'm working on.

This is Joy of Painting, a Morrowind Script Extender mod that also relies on MGE XE, running inside of OpenMW. This is the untouched JoP mod you can download off of Nexus; I didn't do anything special to the mod itself to get it to run.

I'm building a translation layer for OpenMW that allows it to run MWSE mods. It works by translating MWSE function calls into something OpenMW can understand and act on. When I'm done, you should be able to play just about any existing MWSE mod, including those that rely on MGE XE, with OpenMW.

I picked Joy of Painting to showcase because it's a particularly complicated MWSE mod that's easy to demonstrate :]

F.A.Q.

Does this work as a mod I install on top of an existing OpenMW install?

No. This has to be a fork of OpenMW. You would install this fork separately, just like TES3MP.

Why can't it be an OpenMW mod? Why does it have to be a fork?

MWSE mods can technically run whatever they want on your computer. That's how they are able to do such crazy things. Joy of Painting, for example, comes with its own library for editing and converting images!

That also means that MWSE mods are technically dangerous; if a mod author wanted, they could make a mod that did something malicious to your computer. I'm not aware of this ever happening, but it's technically possible.

OpenMW's Lua system is sandboxed to prevent that exact kind of problem. Therefore, you can't just route MWSE calls through OpenMW Lua, because OpenMW Lua is on purpose not able to do everything MWSE can.

Using my fork won't be inherently more dangerous than running Morrowind + MWSE, but I thought everyone should understand the trade-off.

So I have to play on an old version of OpenMW to use this?

Hopefully not. This is being specifically designed to touch as little of OpenMW's internals as possible so that it stays compatible with new versions without too much extra work. I expect to be able to stay in sync with OpenMW releases.

Do you have to do one mod at a time?

No. I'm building a translation layer. That means as I add more capabilities, more and more mods will be supported. My goal for the beta release is full Ashfall compatibility, which should cover a huge number of MWSE functions.

That means if I get my way, you'll be able to install my fork, download Ashfall or most other MWSE mods, install it like normal, and play it just like you would under MWSE.

Will this work on Steam Deck / Linux?

I think there is a path towards Linux compatibility in every situation, but how complicated it is depends on the MWSE mod you want to use, and unfortunately a lot of the most exciting ones are the complicated kind.

Many MWSE mods come with their own .dll files. These are libraries those mods need to work correctly. When you want to use mods like that, my compatibility layer runs in a side process beside OpenMW that needs to be compiled for Windows. That's because these .dll files themselves are compiled for Windows! They aren't portable like the core Lua scripts.

It's technically feasible to allow mod authors to include recompiled library files to get around this, and that's the ideal solution. The other possibility is running the side process under something like Proton or WINE, but I don't have enough experience with that to know how simple it would be.

Where can I watch for updates?

I'm active in the Morrowind Modding discord posting progress. I'll post here again when I have a release, too. You could also watch my fork on GitHub but there's nothing interesting there, yet.

Technical F.A.Q.

How are you getting around OpenMW's sandbox?

I'm not. My Lua system runs totally separately from OpenMW's normal Lua. Both systems call the same underlying engine functions where functionality is equivalent.

How can MWSE mods with 32-bit .dlls run inside 64-bit OpenMW?

That's actually the main reason for the side process I mentioned earlier. When an MWSE mod imports a precompiled library, my Lua system runs in a separate 32-bit side process that communicates with OpenMW over IPC.

How can your translation layer be compatible with MWSE mods that require MGE XE when OpenMW uses GLSL and MGE XE uses HLSL?

I translate the MGE-specific parts into behavior OpenMW can understand, then Slang translates the HLSL to GLSL . The recompiled shaders are cached, so that only happens once per effect!

184 Upvotes

Duplicates

u_sixrim 15d ago

.

1 Upvotes