Haugerud15328
Recruit

Oxidsys
As a newcomer to modding M&B, I've enjoyed the experience. I didn't completely take kindly to the module system however. While I greatly appreciate the M&B devs and their work, I found the module system to be terribly concentrated (50k lines of code in a single file!?), not particularly readable in most places, unpleasant to edit in (python lists/tuples is not a very fluid medium) and other various issues I'm not the first to come across. Overall I just found too many frustrations to ignore them. I wanted an environment that wouldn't make me painfully search all the time, make VSCode use over a gigabyte of RAM to edit the game scripts, have compile times that while not abysmal are certainly not fast and so on. That brings us to this project called Oxidsys.
Oxidsys is a work in progress completely redone module system with some distinguishing characteristics/goals.
No Python
Oxidsys does not rely on Python. You can have Python completely absent from your system and still define game content and compile it. This is because Oxidsys opts for a (in my own opinion) better more readable format for defining game content, and because Oxidsys itself is written Rust, therefore Python has been replaced for the compilation procedure.
JSON
I found the method with Python lists/tuples bad for readability and organization. Oxidsys instead makes use of JSON files in respective directories. For example, to add the Trade skill to the game, one defines skills/trade.json and gives it the following content (assuming identical to Vanilla).
One can quickly make sense of the data. Also, skills instead of being defined all in one file, they are defined file by file in the skills directory. This a philosophy Oxidsys holds in general to avoid giant messy globs of code/data, improving readability, organization, and modularity.
Oxid
Of course, not all content in a mod is simple data. Oxidsys provides a new grammar Oxid for scripting. The goal of Oxid is to offer some nice features for verbosity and safety, but for the most part to feel familiar to the original module system.
An example of how Oxid looks in comparison.
Original Script in the native module system:
Oxid grammar:
This aspect of Oxidsys is still in a pretty early stage, but the parser is in fact mostly complete, and I am near being able to output a simple operation call list and compile it down to the .txt format. Nonetheless there is much work that will need to be done here.
Fast Build Times
There have already been projects that improve the build times, but Oxidsys has the potential to be the fastest. Being written in Rust, and purposefully avoiding IO bottlenecks by mostly working with content in memory before writing among other things, Oxidsys has the making for blazing fast build times. With the currently existing compilers, build speed is near instant. This is silly to brag about currently however without an actual port of Native yet.
Helpful Services
Oxidsys aims to offer various helpful utilities. A currently existing example is quick documentation access based currently from Lav's work. He is currently credited here
but if Lav or someone who feels they can reasonably speak for Lav can comment on a better way to present this please let me know.
TLDR
Oxidsys is my attempt at creating a tool that allows scripters to be more productive, write safer code, offer better modularity making tools ModMerger redundant, and just make modding better in general.
I would've been content keeping this project to myself until I felt it was mostly done, as I can keep writing Oxidsys itself on my own. I don't want this to be a tool that's just useful to me however. I want Oxidsys to be a robust widely useful tool to modders in this community as a whole. This is why I want to reach out to the community and ask for modders to give their input and feedback on what the kind of things they like and dislike, what's the biggest thing on their wish list were they to use a new module system, etc.
You can contact me here, on Discord (GoblinJenkins), or make an issue on my github repo linked below.
https://github.com/AustinHaugerud/oxidsys <- Come here to make issues and watch my progress.
As a newcomer to modding M&B, I've enjoyed the experience. I didn't completely take kindly to the module system however. While I greatly appreciate the M&B devs and their work, I found the module system to be terribly concentrated (50k lines of code in a single file!?), not particularly readable in most places, unpleasant to edit in (python lists/tuples is not a very fluid medium) and other various issues I'm not the first to come across. Overall I just found too many frustrations to ignore them. I wanted an environment that wouldn't make me painfully search all the time, make VSCode use over a gigabyte of RAM to edit the game scripts, have compile times that while not abysmal are certainly not fast and so on. That brings us to this project called Oxidsys.
Oxidsys is a work in progress completely redone module system with some distinguishing characteristics/goals.
No Python
Oxidsys does not rely on Python. You can have Python completely absent from your system and still define game content and compile it. This is because Oxidsys opts for a (in my own opinion) better more readable format for defining game content, and because Oxidsys itself is written Rust, therefore Python has been replaced for the compilation procedure.
JSON
I found the method with Python lists/tuples bad for readability and organization. Oxidsys instead makes use of JSON files in respective directories. For example, to add the Trade skill to the game, one defines skills/trade.json and gives it the following content (assuming identical to Vanilla).
插入代码块:
{
"id" : "trade",
"name" : "Trade",
"flags" : ["base_att_4", "effects_party"],
"max_level" : 10,
"description" : "Every level of this skill reduces your trade penalty by 5%%. (Party Skill)"
}
One can quickly make sense of the data. Also, skills instead of being defined all in one file, they are defined file by file in the skills directory. This a philosophy Oxidsys holds in general to avoid giant messy globs of code/data, improving readability, organization, and modularity.
Oxid
Of course, not all content in a mod is simple data. Oxidsys provides a new grammar Oxid for scripting. The goal of Oxid is to offer some nice features for verbosity and safety, but for the most part to feel familiar to the original module system.
An example of how Oxid looks in comparison.
Original Script in the native module system:
插入代码块:
("game_get_skill_modifier_for_troop",
[(store_script_param, ":troop_no", 1),
(store_script_param, ":skill_no", 2),
(assign, ":modifier_value", 0),
(try_begin),
(eq, ":skill_no", "skl_wound_treatment"),
(call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_wound_treatment_reference"),
(gt, reg0, 0),
(val_add, ":modifier_value", 1),
(else_try),
(eq, ":skill_no", "skl_trainer"),
(call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_training_reference"),
(gt, reg0, 0),
(val_add, ":modifier_value", 1),
(else_try),
(eq, ":skill_no", "skl_surgery"),
(call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_surgery_reference"),
(gt, reg0, 0),
(val_add, ":modifier_value", 1),
(try_end),
(set_trigger_result, ":modifier_value"),
]),
Oxid grammar:
插入代码块:
param troop_no;
param skill_no;
register r0;
local modifier_value;
assign modifier_value 0;
try_begin;
eq skill_no skl::wound_treatment;
call_script script::get_troop_item_amount troop_no itm::book_wound_treatment_reference;
gt reg0 0;
val_add modifier_value 1;
else_try;
eq skill_no skl::trainer;
call_script script::get_troop_item_amount troop_no itm::book_training_reference;
gt reg0 0;
val_add modifier_value 1;
else_try;
eq skill_no skl::surgery;
call_script script::get_troop_item_amount troop_no itm::book_surgery_reference;
gt reg0 0;
val_add modifier_value 1;
try_end;
set_trigger_result modifier_value;
This aspect of Oxidsys is still in a pretty early stage, but the parser is in fact mostly complete, and I am near being able to output a simple operation call list and compile it down to the .txt format. Nonetheless there is much work that will need to be done here.
Fast Build Times
There have already been projects that improve the build times, but Oxidsys has the potential to be the fastest. Being written in Rust, and purposefully avoiding IO bottlenecks by mostly working with content in memory before writing among other things, Oxidsys has the making for blazing fast build times. With the currently existing compilers, build speed is near instant. This is silly to brag about currently however without an actual port of Native yet.
Helpful Services
Oxidsys aims to offer various helpful utilities. A currently existing example is quick documentation access based currently from Lav's work. He is currently credited here
https://github.com/AustinHaugerud/oxidsys/blob/master/src/language/operations/mod.rs
插入代码块:C:\Users\harbinger\ClionProjects\oxidsys>cargo run -- documentation call_script Finished dev [unoptimized + debuginfo] target(s) in 0.09s Running `target\debug\oxidsys.exe documentation call_script` Calls specified script with or without parameters. <script_id>: [<script_param>...]:
TLDR
Oxidsys is my attempt at creating a tool that allows scripters to be more productive, write safer code, offer better modularity making tools ModMerger redundant, and just make modding better in general.
I would've been content keeping this project to myself until I felt it was mostly done, as I can keep writing Oxidsys itself on my own. I don't want this to be a tool that's just useful to me however. I want Oxidsys to be a robust widely useful tool to modders in this community as a whole. This is why I want to reach out to the community and ask for modders to give their input and feedback on what the kind of things they like and dislike, what's the biggest thing on their wish list were they to use a new module system, etc.
You can contact me here, on Discord (GoblinJenkins), or make an issue on my github repo linked below.
https://github.com/AustinHaugerud/oxidsys <- Come here to make issues and watch my progress.

