Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The backend of Skyrim (and other Bethesda games) is largely a database. Bethesda calls them .esp files, but they're relational in a way. There has been a large open undertaking to produce tooling for this, such as xedit (Pascal) and z-edit (JS).

When you open a container in the game, and it doesn't have a specified set of contents, the contents get loaded by picking randomly from a category linked to in the database. If, in one of the db tools, you follow the link from the container you can see what objects could load in it and by what likelihood. You can then follow those links through the db over to the object itself, which is also made up of db entries.

From the scripting system you can access the db for some amount of functionality. Their db doesn't contain the models or textures or strings. But it does contain the location of every tree in the game. If you wanted a mod with a dozen golden crates to go find, you would use the db system for the logic.



This is fascinating. Where can I read more about this architecture?


In the context of the OP article, a similar functionality to querying a database is "Find matching references" kind of quest alias filling https://www.creationkit.com/index.php?title=Quest_Alias_Tab#...:

However it is not 100% documented what kind of optimization this "query engine" has implemented, there are some vibes that sometimes it could be faster than a full scan.

A serialized data format is here if you are interested https://en.uesp.net/wiki/Skyrim_Mod:Mod_File_Format


Author here: I’m working on another post that describes the inner workings of the query engine in depth! It’s definitely faster than a full scan ;)

In case anyone’s interested, this is the source for it: https://github.com/SanderMertens/flecs/tree/master/src/addon...





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: