Skip to content

Warn about hash collisions from BA2 filenames #558

@Infernio

Description

@Infernio

BA2s will override each other when the hashes of their file names collide. This will cause the later-loaded BA2 to completely overwrite the previous BA2.
The only way to resolve this is to rename one or both of the colliding BA2s. This should be done by mod authors so that all users can benefit, obviously.

Bethesda uses a CRC-like hashing algorithm for this, as documented here: https://github.com/Ryan-rsm-McKenzie/bsa/blob/ea21a026843b6b834ae70d05076ec7f34faf1cf4/include/bsa/fo4.hpp#L502-L544
Normally, it compares the directory and file hashes as well as the extension. Since all BA2s are in the same folder (Data) and have the same extension (.ba2), we really only need to check the file hash.

Note also that the hashing algorithm only handles ASCII characters - other characters will go out of bounds. So it's probably not a good idea to use non-ASCII characters in your BA2 names :)

Metadata

Metadata

Assignees

Labels

A-bsasArea: BSAs and BA2s (bosh/bsa_files.py)A-warningsArea: Warnings and Errors (e.g. corrupt files, incompatible file versions, etc.)C-enhancementCategory: Enhancement, a request to add or enhance a featureG-fallout4Game: Fallout 4M-relnotesMisc: Issue should be listed in the version history for its milestone

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions