Hello,
Yesterday, I started reimplementing the Oblivion scripting engine. Thus far I made the Lexer by defining its rules and let Flex generate it.
https://github.com/1-Zer0/openob
It's able to generate the Tokens (Lexem, Type) of an Oblivion script.
I am going to work on it occasionally, mostly on weekends, repo contains a roadmap.
OpenMW support for other games: Oblivion, Skyrim, Fallout and more
- AnyOldName3
- Posts: 2668
- Joined: 26 Nov 2015, 03:25
Re: Elder-scrolls IV Oblivion
The thing we'll need here is something that transpiles OBScript into OpenMW-Lua, and OpenMW-Lua doesn't exist yet. We don't want to be stuck maintaining eight scripting engines.
Re: Elder-scrolls IV Oblivion
You can from the AST of an Oblivion script generate code for the LUA VM if the team prefers to use that. It might be a bit hackery and could turn out to be more of a hassle than using a custom VM optimized for the game, but it's easier to maintain. If that's the consensus of the forum, so shall it be, for Oblivion.AnyOldName3 wrote: ↑15 Feb 2020, 23:08 The thing we'll need here is something that transpiles OBScript into OpenMW-Lua, and OpenMW-Lua doesn't exist yet. We don't want to be stuck maintaining eight scripting engines.
Either way, there needs to be a front end to create an AST from a Oblivion Script, no matter the backend. Means writing a Bison module with the Oblivion scripting formal grammar.
-
- Posts: 256
- Joined: 19 Jul 2016, 01:02
Re: Elder-scrolls IV Oblivion
I did personally make an attempt at updating your ESM-reading code to the latest OpenMW, but – lacking the other half of the code – I did not really have the ability to see it working as intended and to determine what I was doing wrong.
I guess I can give it another try, if no one else does.
- psi29a
- Posts: 5357
- Joined: 29 Sep 2011, 10:13
- Location: Belgium
- Gitlab profile: https://gitlab.com/psi29a/
- Contact:
Re: Elder-scrolls IV Oblivion
The eventual goal is to also do this with mwscript as well, that way the core engine's scripting language is Lua and we support mapping mwscript, obscript (and etc.) calls to the Lua-VM equivalents. This also makes clear which mods are for Morrowind and which mods are for OpenMW specifically.1Zero wrote: ↑15 Feb 2020, 23:24You can from the AST of an Oblivion script generate code for the LUA VM if the team prefers to use that. It might be a bit hackery and could turn out to be more of a hassle than using a custom VM optimized for the game, but it's easier to maintain. If that's the consensus of the forum, so shall it be, for Oblivion.AnyOldName3 wrote: ↑15 Feb 2020, 23:08 The thing we'll need here is something that transpiles OBScript into OpenMW-Lua, and OpenMW-Lua doesn't exist yet. We don't want to be stuck maintaining eight scripting engines.
Either way, there needs to be a front end to create an AST from a Oblivion Script, no matter the backend. Means writing a Bison module with the Oblivion scripting formal grammar.
OpenMW-Lua exists but currently only in TES3MP, the idea here is to get both forks using the same Lua.
Re: Elder-scrolls IV Oblivion
I am not perfectly familiar with LUA currently but can manage to understand the language in time.psi29a wrote: ↑17 Feb 2020, 09:49The eventual goal is to also do this with mwscript as well, that way the core engine's scripting language is Lua and we support mapping mwscript, obscript (and etc.) calls to the Lua-VM equivalents. This also makes clear which mods are for Morrowind and which mods are for OpenMW specifically.1Zero wrote: ↑15 Feb 2020, 23:24You can from the AST of an Oblivion script generate code for the LUA VM if the team prefers to use that. It might be a bit hackery and could turn out to be more of a hassle than using a custom VM optimized for the game, but it's easier to maintain. If that's the consensus of the forum, so shall it be, for Oblivion.AnyOldName3 wrote: ↑15 Feb 2020, 23:08 The thing we'll need here is something that transpiles OBScript into OpenMW-Lua, and OpenMW-Lua doesn't exist yet. We don't want to be stuck maintaining eight scripting engines.
Either way, there needs to be a front end to create an AST from a Oblivion Script, no matter the backend. Means writing a Bison module with the Oblivion scripting formal grammar.
OpenMW-Lua exists but currently only in TES3MP, the idea here is to get both forks using the same Lua.
If I get the current plan it should look as follows
Morrowind Vanilla -----\
| ---------------> Lua Morrowind Virtual Machine
Lua- Morrowind --------/
With the Vanilla Vanilla Morrowind Script and Lua Morrowind scripts all being compiled to run on the Lua Morrowind Virtual Machine
and
Oblivion Vanilla--------\
| ---------------> Lua Oblivion Virtual Machine
Lua- Oblivion-----------/
As both games have different Opcodes for their instruction (I presume at least, I don't really know Morrowind's bytecode and the game in general all too well) and as such require adapted Lua Virtual Machines
- psi29a
- Posts: 5357
- Joined: 29 Sep 2011, 10:13
- Location: Belgium
- Gitlab profile: https://gitlab.com/psi29a/
- Contact:
Re: Elder-scrolls IV Oblivion
Yeah, the target is OpenMW in that OpenMW exposes an API in Lua that developers can use. One layer of abstraction is that anything calling mwscript or obscript function/method/variable then maps to an equivalent OpenMW's Lua.
Re: Elder-scrolls IV Oblivion
The abstraction layer for Morrowind already exists for MorrowindMP?
Re: Elder-scrolls IV Oblivion
I need to comprehend a few things about the architecture, I could go through the code the next few hours but I suppose it's more efficient to just ask
I see that those are the main modules that need to be adapted for the LUA VM
https://github.com/OpenMW/openmw/tree/m ... nterpreter
https://github.com/OpenMW/openmw/tree/m ... w/mwscript
https://github.com/OpenMW/openmw/tree/m ... s/compiler
OpenMW appears to not have changed any of those, but instead has its own:
https://github.com/TES3MP/openmw-tes3mp ... -mp/Script
So OpenMW MP is currently still using the "vanilla" scripting engine for the client side script processing
but LUA for the Server side script processing?
I see that those are the main modules that need to be adapted for the LUA VM
https://github.com/OpenMW/openmw/tree/m ... nterpreter
https://github.com/OpenMW/openmw/tree/m ... w/mwscript
https://github.com/OpenMW/openmw/tree/m ... s/compiler
OpenMW appears to not have changed any of those, but instead has its own:
https://github.com/TES3MP/openmw-tes3mp ... -mp/Script
So OpenMW MP is currently still using the "vanilla" scripting engine for the client side script processing
but LUA for the Server side script processing?
-
- Posts: 14
- Joined: 11 Jun 2019, 23:53
Re: Elder-scrolls IV Oblivion
Very cool progress on an Oblivion interpreter. I'll try to finish moving my TES3-to-TES4 transpiler into standalone translator and compiler as soon as I can. The TES3 translator is still incomplete, but the TES4 byte compiler has been near complete and working very well in my production tool chains for a couple years now. I've also gotten it to properly compile a small subset of OBSE instructions too.
https://github.com/ponyrider0/openmw
https://github.com/ponyrider0/openmw