[Solved] Backwards dig group levels - why?

User avatar
SegFault22
Member
 
Posts: 870
Joined: Mon May 21, 2012 03:17

[Solved] Backwards dig group levels - why?

by SegFault22 » Mon Oct 03, 2016 18:22

Almost everyone knows that the dig group "cracky=2" is stronger than "cracky=3", and "cracky=1" is stronger than "cracky=2". The stronger dig group levels damage tools more than the weaker levels, which is fine.

However, I have encountered a really big problem with this order of the dig group level system. When I try to implement "types" of stone or ores that are harder than "cracky=1", I have to use 4, 5 and so on as the higher and stronger dig levels. I won't try using 0, -1 and so on, because this may cause unusual problems, and even if it does work properly, it will be foolish-looking. The biggest problem is that the "stronger" dig group levels such as 4 and 5 (which can't be dug with any tools in minetest_game - I made special pickaxes for those levels) damage the tools far less than the "weaker" level 1. The table of dig group times is backwards for 1 through 3, and then goes forward for 4 and beyond.

This is a serious problem, because my mod's tool sets made of materials like Wolframium and Iridium last nearly forever digging the "stronger" nodes of dig level 4 and higher, but if you have the nether mod installed as well (the one with nether stone that has a dig level "cracky=1") the tool gets damaged much faster digging those nodes than the ones that are supposed to be much stronger. Sure, we could just handwave the problem away by saying something like "herp derp netherrack melts your tools", but this fails miserably when a player decide to mine a bunch of mese or diamond ore, or decides to deconstruct a building made of steel blocks, mese blocks or diamond blocks.

However, if we "fix" the backwards orientation of dig levels - such that level 1 would be as strong as level 3 is now, level 2 wouldn't have to change since its in the middle, and level 3 would be as strong as level 1 is now - this creates an even bigger problem: All mods which were designed to register tools before the change, will be partially broken, as the dig levels and times will be reversed. Sure, we could just wait until a major overhaul of significant parts of the API breaks those mods more anyways, and make the change then - but that may never happen, because it is a goal of the project that the API of newer versions does not break older mods, and that is a huge problem over at Minecraft-ForgeModLoader-land (old versions of mods almost never work with the new version without having to be changed significantly, due to the developers regularly rebuilding the proprietary game's internal APIs). Of course, ForgeModLoader didn't exist when Minetest was first created (you still had to put mods directly into the minecraft.jar "back then"), but the same problems existed - it was much more difficult for modders to keep up with the changing internal APIs.

So, why did we make the dig level system use backwards numbering in the first place?
Also, would it be reasonable to make level numbers such as 0, -1 and lower work properly (as 2 is harder than 3, 1 is harder than 2, 0 would be harder than 1 and so on), to avoid the aforementioned problem with existing mods that have added tools - or would this be extremely hackish to implement? (only considering how it could possibly have to be programmed on the "engine" side, and not how hackish it looks from the Lua modding API side - combined, that's even hackish-er than "extremely")
If it isn't possible to allow zero and negative values for the dig group level, would there be any way to implement a sort of backwards-compatibility with older mods if the system were to be changed to fit what I have suggested?

(we could say that the dig level number gets lower for nodes that are harder, because you find nodes with those levels at depths that are lower - lol)

EDIT: The group "cracky" does not determine tool wear. The group "level" does that, and is limited by "maxwear" (the hand tool isn't destroyed because its maxwear is 0). However, the level group does not determine dig time, so if you want to create a node and associated tool which takes as much time to mine as a mese pickaxe takes to mine a diamond block, you have to create cracky = 4 and define the tool's dig time for it as the dig time for the mese pickaxe's cracky = 1 dig time. The problem isn't so big since this was realized, but you still have to implement a higher cracky group if you want the cracky = 1 level = 3 nodes to take less time to mine than the "stronger" nodes with level = 4.

If you decide that it isn't right to create another cracky group "level" (cracky = 4 and so on), you have to use cracky = 1 and level = 4 (or higher) for your "stronger" nodes, but that introduces a problem - your "stronger" nodes take just as long to mine as the weaker level 3 nodes, which should be mined faster since the tool's level is higher, since every already-existing tool with a higher level can mine the weaker nodes faster than a tool of a lower level.
Last edited by SegFault22 on Tue Oct 04, 2016 12:23, edited 1 time in total.
 

User avatar
qwertymine3
Member
 
Posts: 194
Joined: Wed Jun 03, 2015 14:33
GitHub: Qwertymine
In-game: qwertymine3

Re: Backwards dig group levels - why?

by qwertymine3 » Tue Oct 04, 2016 06:52

You appear to be confusing the digging group with the node level. The digging groups you are talking about are only supposed to be to differentiate digging times within a group, not define the 'level'; that is the job of the level group.

The higher node levels increase both the digging time and durability damage.

So your node is cracky = 5, but the nether rack is cracky = 3, level = 2. Since the level is higher, naturally it will require more durability.

If you want a harder node, you need to increase the level rather than adding new numbers to cracky.

BTW, the reason it is backwards is to try and discourage people from making digging groups which take too long to mine... (without increasing the level at least)
Avatar by :devnko-ennekappao:
 

User avatar
SegFault22
Member
 
Posts: 870
Joined: Mon May 21, 2012 03:17

Re: Backwards dig group levels - why?

by SegFault22 » Tue Oct 04, 2016 11:39

Even if it's the level group that determines how much a tool is damaged when mining a node, and that it is possible to use the level group to implement a node that is "harder" than the default:diamondblock (cracky = 1, level = 3), We still can't create nodes that take longer to mine, without setting a "cracky = 4" and adding the time for that dig group to the tool.

If you have a tool which is supposed to mine cracky 3, 2 and 1 relatively quicker than the mese pickaxe, but takes somewhat longer to mine a certain node that is harder than cracky = 1 even if it has a higher level, you have to use cracky = 4 and set its time to something higher. Of course, some idiot would make a mod wherein a certain tool takes an extremely long time (minecraft obsidian) to mine a certain node, but there will always be idiots who intentionally abuse the system like that, regardless of whether 4 comes after 1 or 3.

The level group does not influence the digging time (which is good, it should be that way); if you want a tool which takes as much time (and no more) to mine a level = 4 node as the mese pickaxe takes to mine a level = 3 node, you have to define its dig time for cracky = 1 as the same for the mese pickaxe, and then it takes just as long to mine a level 3 node as it does to mine a level 4 node, when it should be able to mine the level 3 node substantially faster, but it can't because they are both in cracky = 1.

The only thing this "feature" discourages, is making tools which can mine cracky = 3 as fast as breaking a torch (dig_immediate) while taking as much time to mine a level = 6 node as the mese pickaxe takes to mine a level = 3 node, but that wouldn't be a problem since there is a static limit of time between mining one node and starting to mine another (at least, back in 0.4.10+/-2, when I experimented with that). If a tool can mine nodes of level = 6, but it takes just as much time to mine those nodes as the same tool takes to mine nodes of level = 3, that is a problem visible at the player's end.

Basically, we can use the level group to cause stronger tools to mine stronger nodes, by implementing a higher level group for both, but we can't make the same tool mine the "weaker" nodes faster than the stronger ones, without adding cracky = 4 and higher. Maybe this "small" problem just wasn't seen when this system was implemented, which is fine. Since cracky = 4 doesn't damage tools less than cracky = 1, we can still implement cracky = 4 and higher, for stronger tools to be able to mine cracky = 1 somewhat faster than the stronger nodes with cracky = 4; it just doesn't make much sense when you look at the code, and see that cracky = 1 takes longer to mine than cracky = 2, but cracky = 4 takes longer to mine than cracky 1, 2 and 3. Most players won't be looking at the code, though, so it isn't a huge problem.

I am glad that it is actually the level group which determines tool wear, because now I know how to implement my mod's system to use that properly, which I did not know before. Thank you.
 


Return to Minetest Problems

Who is online

Users browsing this forum: No registered users and 19 guests

cron