Skip to content

Misc Concepts

Here’s some important concepts you should know that don’t really fit anywhere else.

Hashing functions take an input, typically a file or a string, and produce a unique output. In Sims 4 modding, this is used to generate unique IDs for resources while avoiding ID conflicts. This is often handled automatically by tools, but sometimes needs to be done manually.

You’ll use either FNV32 or FNV64 depending on if you need a an int (32 bit) or a long (64 bit) respectively.

You need to use a unique input, so a good practice is using CreatorName:PackageName:ResourceName.

Both S4E and S4S have FNV hash generators.

Version numbers are NOT decimals. They are whole numbers separated by periods.

In decimal, 0.1 and 0.10 are the same number. As versions, 0.1 and 0.10 are 9 versions apart.

More complicated projects may use more numbers for better granularity.

Packages have internal support for versioning using the format Major.Minor. Using this is optional but recommended, as it is the intended way to store the version. This is new information that hasn’t been widely tested yet, but seems to work fine.

When releasing mods publicly, prefix files with your username. Doing this avoids conflicts if two people release a mod with the same name, and is a concept known as namespacing.

You should NOT include a version number in your package name. Package names should always remain the same to allow file overwriting when updating.

If your mod has more than one file, distribute it as a zip file. The zip file name can (and should) include the version.