Packed ID Calculator

Horticular's object identifiers are packed integers containing two components: a unique module number and an object number that is unique within that module for objects of that type. The official modding guide PDF included with the game says that using the built-in editor is "virtually required" for generating these unique identifiers. Personally, I am more comfortable modding in a text editor than in a GUI, so I sought to work around this requirement.

The packing method ended up being pretty simple to replicate, and I have created the tool below. You can enter your mod's module number and your object number to have the webpage calculate a packed ID for you. This is the value that goes into the data.xml file for your mod. For your convenience, you can also enter a packed ID and have the other two values calculated. This can be used to reverse engineer values found in the base game's Base.mpck file or values found in other mods.

Note: Different types objects can have the same packed ID. For example: the frog animal and waste tile from the base game both have an ID of 2097153

Methodology & pseudocode

The way the game and this calculator packs these IDs is by shifting the module number 21 bits left and then adding the object number directly to that.

$packedID = ($moduleID << 21) + $objectID

And to reverse the packing:

$moduleID = $packedID >> 21 $objectID = $packedID & ((1 << 21) - 1)