Files version priority usages : vanilla vs ego_dlc_2 vs ego_dlc_teladi_outpost

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

Browser_ice
Posts: 488
Joined: Sun, 5. Feb 06, 17:15
x4

Files version priority usages : vanilla vs ego_dlc_2 vs ego_dlc_teladi_outpost

Post by Browser_ice »

Hi, I am just playing around wih the game code to understand how it works.

I extracted all the files and put them back in the XRebirth folder, except for the aiscripts one and removed all the compressed files where they came from. The result is all the folders that are either from the catalog files or folders that were not in the first place.

I did the same thing for the extensions ego_dlc_2 and ego_dlc_teladi_outpost excet again for the aiscripts.

I also unsubscribed from all workshop extensions.

I want to understand from a script poing of view, what is executed first, then second until I get to the main loop of it.

So far with all of this, when I start the game (debug enabled), I get up to the game menu. I haven't gone further yet. I am still checking what goes on to this point by looking at the debug file.

I understand the main purpose of those 2 ego* dlc is to add content. But there might be replacement situations.

If both ego* exstensions have one file that is present in all 3 places (ego* DLC + vanilla extracted), then which one is used as the main and last version ?

Can we have same files in both ego* DLCs only (not present in vanilla extracted) ?

Which version used in all possible cases (identical files in both ego* folders or in all 3 folders) ?
Ubuntu 24.04 playing with ProtonDB
Intel I7-12700K
32Gb Memory
Nvgidia RTX-3060
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

it doesnt go by Mod Folder.

load order then goes by this for the virtual Game root:

01.cat/dat
02.cat/dat
.....

ater that the mod subst[ cats dats are loaded:
ego_dlc_teladi_outpost/subst_01.cat/dat
ego_dlc_teladi_outpost/subst_02.cat/dat
ego_dlc_2/subst_01.cat/dat

Note that later loaded cats/dats override the the same files of already loaded ones, so higher numbers => higher priority. Doesnt matter in this case though because there is no overlap (the DLC subst file only provide additional assetes to the Game, but i have replaced some UI files for the Core Game using this method. consider any file in a mod subst cat/dat higher in priority than a core game file.)

now to the ext_**.cat/dat files - these are extracted into the virtual mod directory, so it is not possible for them to overlap with any existent file of other mods or the core game.

At this point we have a bunch of extracted files. their treatment differs on their content:
=> diff files:
these are applied to the main files, meaning they change the original file which has the same path in the game root as the diff file has in the mod (see that RFC which number i forgot for details, but syntax should be easy to figure out without that)
=> aiscript, mdscript files not yet in the game root
these are treated as if they were in the Game root, as simple as that. Usual Way to add new Script Files.
=> any ui files
have some special treatment, refer to the UI Modding doc for that ( https://www.egosoft.com:8444/confluence ... ng+support )
=> any other xml files
work as complement to the existent xml files, meaning everything inside their root node is merged (makes sense for many library files, but not su much for ai and md scripts)

Regarding Overlapping files consider the load Order random if not specified in the content.xml (there it is possible to change the load order of Mods by using a <dependency> to other mods, which makes sure they are only loaded after them)


Now a little bit to the Script Execution: i can tell you in advance that in the Main Menu neither AI nor MD Scripts have been executed at all. they all start only after the Game Universe is loaded. Some lua ui files are executed though to provide the Icons and Buttons to launch a Game. When the Game Universe is loaded the MD and AI Scripts will start their work - the MD ones will run globally and the AI ones will be performed by the NPCs (now that you have removed them no ship will do anything though, because they have no idea what to do) - thats all for now, took me long enough to write this together...
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
Browser_ice
Posts: 488
Joined: Sun, 5. Feb 06, 17:15
x4

Post by Browser_ice »

Thx

I am resinstalling my game. I realized I messed up some files. :-(

By the way, with the set up I was building (everything extracted but no aiscript folders in root and ext), it happened just like you said once I pasted the game menu. Ships where around but not moving. I was able to move and able to access menus, maps, ... However, which was suprising at first, I had ship screen messages saying money had been taken out or deposited in my account. I realized these were probably jobs left in the job process from trades initiated before I did my game save.

It felt like time had stopped. ;-)
Ubuntu 24.04 playing with ProtonDB
Intel I7-12700K
32Gb Memory
Nvgidia RTX-3060
Browser_ice
Posts: 488
Joined: Sun, 5. Feb 06, 17:15
x4

Post by Browser_ice »

I tried to write down a bullet proof way for everyone to understand how the files are loaded/executed. Please validate.

program game starts executing
root game cat/dat are extracted and loaded in the virtual game root
root game folders are loaded in the virtual game root (replacing whatever was there first)
load all substr files from the MOD folders in the virtual MOD folders to add/modify/replace any virtual game root files
MOD folders cat/dat files are extracted and loaded in the virtual MOD folders
MOD folders are loaded in the virtual MOD folders (replacing whatever was there first)
virtual MOD folders patching files that cause a modify/replace on game root files are executed into the virtual game root
* the initial game environement is created based on virtual game root + virtual MOD folders *
the player is loaded into the universe
virtual game root MD files are executed
virtual MOD folders MD files are executed
* player is ready to play *
virtual game root aiscripts are executed per needs of NPCs
virtual MOD folders aiscripts are executed per needs of NPCs
* rule of thumbs, root first, MOD second unless MOD modifies root *
Ubuntu 24.04 playing with ProtonDB
Intel I7-12700K
32Gb Memory
Nvgidia RTX-3060
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

correction:
loose files have lower priority than packed ones usually (forgot to mentoin that)
you can change this behavior with the parameter -prefersinglefiles though (useful for experiments maybe, but i wouldnt recommend getting used to use it)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
Browser_ice
Posts: 488
Joined: Sun, 5. Feb 06, 17:15
x4

Post by Browser_ice »

UniTrader wrote:correction:
loose files have lower priority than packed ones usually (forgot to mentoin that)
you can change this behavior with the parameter -prefersinglefiles though (useful for experiments maybe, but i wouldnt recommend getting used to use it)
Thx

The list would now look like what ?
Ubuntu 24.04 playing with ProtonDB
Intel I7-12700K
32Gb Memory
Nvgidia RTX-3060

Return to “X Rebirth - Scripts and Modding”