Document tool details in default mod #16

Closed
opened 2025-09-07 20:40:40 +00:00 by gsg_josh · 1 comment
gsg_josh commented 2025-09-07 20:40:40 +00:00 (Migrated from codeberg.org)

tool class (cracky, choppy, etc) and amount dealt
Levels
node type and health

tool class (cracky, choppy, etc) and amount dealt Levels node type and health
gsg_josh commented 2025-09-12 16:51:07 +00:00 (Migrated from codeberg.org)

So in documenting the tool capabilities, I've run into something confusing. Let's talk it out.

When defining tools, there are two values that define the level of node this tool can dig.

  • When defining the times table, the key is a level value. If a value is omitted, the tool cannot break that level of node at all.
    • In default, the empty hand can break levels 2 and 3, but not 1, implying that 1 is the hardest value.
    • Diamond Pickaxe supports this as well, it can break 1 2 and 3.
  • By defining the maxlevel value, we indirectly modify the uses final value (uses * 3^(maxlevel-node.level))
    • In default, the empty hand has a max level of 1, implying that it can break 1 but not 2 or 3, which is backwards
    • Improving this number will make the tool last longer, also implying bigger is better
    • Diamond Pickaxe again supports this, with a maxlevel of 3.

Conclusion: maxlevel is poorly named. It doesn't actually interact with the other level, and doesn't describe the max of anything.

I think the intent for this was to represent the max level of a node that can be broken while retaining a 1:1 between the uses value in code and the result in game. This is pretty terrible naming, because it's not a limit at all and level is used for other things. Unfortunately, this is core stuff so no changing it. It also poses a problem with #28, specifically adding new levels. I dunno. For now, we'll document it as is and we'll burn that bridge when we get to it.

So in documenting the tool capabilities, I've run into something confusing. Let's talk it out. When defining tools, there are two values that define the level of node this tool can dig. - When defining the `times` table, the key is a level value. If a value is omitted, the tool cannot break that level of node at all. - In default, the empty hand can break levels 2 and 3, but not 1, implying that 1 is the hardest value. - Diamond Pickaxe supports this as well, it can break 1 2 and 3. - By defining the `maxlevel` value, we indirectly modify the `uses` final value (`uses * 3^(maxlevel-node.level)`) - In default, the empty hand has a max level of 1, implying that it can break 1 but not 2 or 3, which is backwards - Improving this number will make the tool last longer, also implying bigger is better - Diamond Pickaxe again supports this, with a maxlevel of 3. Conclusion: `maxlevel` is poorly named. It doesn't actually interact with the other level, and doesn't describe the max of anything. I think the intent for this was to represent the max level of a node that can be broken while retaining a 1:1 between the uses value in code and the result in game. This is pretty terrible naming, because it's not a limit at all and level is used for other things. Unfortunately, this is core stuff so no changing it. It also poses a problem with #28, specifically adding new levels. I dunno. For now, we'll document it as is and we'll burn that bridge when we get to it.
Sign in to join this conversation.
No description provided.