Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Jan 2010
Location: USA
F
enthusiast
OP Offline
enthusiast
F
Joined: Jan 2010
Location: USA
When you modify a story script and build, the editor rebuilds these files:

- story_ac.dat
- goals.div
- story.div
- story.div.osi
- goals.raw

Are all these files necessary to the modified story script? If some are not necessary, why are they packaged with the mod? (Are they packaged with the mod?)

story.div.osi is the compiled binary version of story.div, and the new story.div includes the modified story script. I'm not entirely sure about goals.div and goals.raw. story_ac.dat just looks like a definitions resource.

Is there a reason why individual story scripts are not compiled individually (for example, GLO_Origins.txt.osi)? Why does making a single change to a single script necessitate overriding all story scripts?

This system doesn't appear to be very mod-friendly. It looks like players will have to choose between one story script mod and another. That is, it does not appear to be possible to run multiple story script mods alongside each other.

Can a dev please explain the architecture here?

Joined: Sep 2017
Location: Belgium, Ghent
addict
Offline
addict
Joined: Sep 2017
Location: Belgium, Ghent
All individual files are compiled into a final story (story.div.osi). The other files are used to generate this, some contain function definitions, others story goals, etc.

The final story file is needed because we run the story based on that one file. It is a compiled result of everything relevant to the game you are running.

When you enable a mod, a custom story is built at runtime that uses the header and goal files of all relevant modules to create the final story for the game. Also when running from an existing savegame, if a change to the add-on setup is detected, those new goals, etc. get patched in/out of the existing story. (It's also how we patch in story changes to the actual game).

Having a story.div.osi on disk as well, next to the runtime compile allows us to skip that runtime compile when no mods are enabled or when a certain setup is invalid/corrupted which then makes the runtime compile fail gracefully by using the fallback story. Granted, the local story.div.osi is not relevant for add-ons, only for adventures.

Last edited by Larian_KVN; 27/09/17 04:11 PM.

CTRL+K the elf
Joined: Jan 2010
Location: USA
F
enthusiast
OP Offline
enthusiast
F
Joined: Jan 2010
Location: USA
Thanks! Sounds like you guys thought ahead. smile

By the way, rebuilding the story dumps a 90 MB log.txt file in the mod directory, which may lead to artificially inflated packages distributed on Steam and elsewhere, if the packaging system does not filter out this file.

Joined: Sep 2017
Location: Belgium, Ghent
addict
Offline
addict
Joined: Sep 2017
Location: Belgium, Ghent
Heh, we got ya covered wink

That log file though is something we hadn't had the chance yet to filter out, but it is indeed not necessary in there laugh But rest assured, our packaging compresses that to a nice ~4MB. We'll remove it in a future patch, but it's not too dramatic to have it in there right now.


CTRL+K the elf
Joined: Sep 2017
X
journeyman
Offline
journeyman
X
Joined: Sep 2017
When/is it necessary to compile the story? My own mod seems to work with only the relevant raw goal file altered and included, is that normal and intended practice?

Joined: Sep 2017
Location: Belgium, Ghent
addict
Offline
addict
Joined: Sep 2017
Location: Belgium, Ghent
1) Compiling is good practice to make sure your mod actually compiles and works
2) Only adventures really need a compile, so they can fallback to the compiled story file
3) Add-ons compile at runtime so they only really need raw goals, headers & definitions


CTRL+K the elf
Joined: Sep 2017
X
journeyman
Offline
journeyman
X
Joined: Sep 2017
Thanks, good to know.


Moderated by  Larian_KVN 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5