evil123 reports: I enchanted my mithril axe, an ... #2575

Open
opened 2022-08-30 12:23:08 +00:00 by yourland-report · 10 comments

evil123 reports a bug:

I enchanted my mithril axe, and got the enchantment "Fast (+nan%)"

Player position:

{
	x = -1326.4420166016,
	y = 71.5,
	z = 1067.8879394531
}

Player look:

{
	x = 0.93141740560532,
	y = -0.36292600631714,
	z = 0.027318261563778
}

Player information:

{
	major = 5,
	minor = 4,
	version_string = "5.4.1",
	lang_code = "",
	min_rtt = 0.25,
	max_rtt = 2.5490000247955,
	avg_rtt = 0.27300000190735,
	min_jitter = 0,
	max_jitter = 2.2160000801086,
	avg_jitter = 0.00099998712539673,
	connection_uptime = 2350,
	serialization_version = 28,
	patch = 1,
	state = "Active",
	ip_version = 6,
	protocol_version = 39,
	formspec_version = 4
}

Player meta:

{
	fields = {
		played_time = "4837748",
		["ocean_build.forbidden"] = "true",
		repellant = "0",
		died = "346",
		crafted = "336906",
		["3d_armor_inventory"] = "return {\"3d_armor:chestplate_rainbow 1 7826\", \"3d_armor:helmet_rainbow 1 7826\", \"3d_armor:leggings_rainbow 1 7826\", \"shields:shield_rainbow 1 7826\", \"3d_armor:boots_crystal 1 18940\", \"\"}",
		arenalib_infobox_arenaID = "0",
		hud_state = "on",
		punch_count = "32356",
		yl_commons_thankyou = "72",
		partychat = "party",
		yl_church = "return {[\"last_death_portal\"] = 1661660515, [\"last_death\"] = {[\"x\"] = -1507, [\"y\"] = -6, [\"z\"] = 1727}}",
		bitten = "0",
		["unified_inventory:bags"] = "return {\"unified_inventory:bag_large\", \"unified_inventory:bag_large\", \"unified_inventory:bag_large\", \"water_life:croc_bag\"}",
		["signslib:pos"] = "(865,5,1940)",
		arenalib_watchID = "0",
		yl_commons_player_joined = "1661859872",
		placed_nodes = "177067",
		jointime = "1612610117",
		["stamina:level"] = "16",
		xp = "1094748",
		["stamina:poisoned"] = "no",
		["ocean_build.last_warning"] = "1.65638e+09",
		["stamina:exhaustion"] = "128.5",
		["ocean_build.ocean_built"] = "12",
		inflicted_damage = "625408",
		digged_nodes = "1389582",
		yl_commons_player_created = "1612610117"
	}
}

Log identifier


[MOD] yl_report log identifier = sDKMCUK4i5ps3G84frwpCBDNf0L3M1a9

Profiler save:

profile-20220830T122307.json_prettyEE

Status:

# Server: version: 5.5.1-yl | game: Minetest Game | uptime: 6h 22min 24s | max lag: 1.45s | clients: Unelias, evil123, mtvisitor, mtwalker, Aero, Segmentation_Fault, Bishiro, Service, AliasAlreadyTaken, Bailiff

Teleport command:

/teleport xyz -1326 72 1068

Compass command:

/give_compass Construction sDKMCUK4i5ps3G84frwpCBDNf0L3M1a9 D2691E -1326 72 1068
evil123 reports a bug: > I enchanted my mithril axe, and got the enchantment "Fast (+nan%)" Player position: ``` { x = -1326.4420166016, y = 71.5, z = 1067.8879394531 } ``` Player look: ``` { x = 0.93141740560532, y = -0.36292600631714, z = 0.027318261563778 } ``` Player information: ``` { major = 5, minor = 4, version_string = "5.4.1", lang_code = "", min_rtt = 0.25, max_rtt = 2.5490000247955, avg_rtt = 0.27300000190735, min_jitter = 0, max_jitter = 2.2160000801086, avg_jitter = 0.00099998712539673, connection_uptime = 2350, serialization_version = 28, patch = 1, state = "Active", ip_version = 6, protocol_version = 39, formspec_version = 4 } ``` Player meta: ``` { fields = { played_time = "4837748", ["ocean_build.forbidden"] = "true", repellant = "0", died = "346", crafted = "336906", ["3d_armor_inventory"] = "return {\"3d_armor:chestplate_rainbow 1 7826\", \"3d_armor:helmet_rainbow 1 7826\", \"3d_armor:leggings_rainbow 1 7826\", \"shields:shield_rainbow 1 7826\", \"3d_armor:boots_crystal 1 18940\", \"\"}", arenalib_infobox_arenaID = "0", hud_state = "on", punch_count = "32356", yl_commons_thankyou = "72", partychat = "party", yl_church = "return {[\"last_death_portal\"] = 1661660515, [\"last_death\"] = {[\"x\"] = -1507, [\"y\"] = -6, [\"z\"] = 1727}}", bitten = "0", ["unified_inventory:bags"] = "return {\"unified_inventory:bag_large\", \"unified_inventory:bag_large\", \"unified_inventory:bag_large\", \"water_life:croc_bag\"}", ["signslib:pos"] = "(865,5,1940)", arenalib_watchID = "0", yl_commons_player_joined = "1661859872", placed_nodes = "177067", jointime = "1612610117", ["stamina:level"] = "16", xp = "1094748", ["stamina:poisoned"] = "no", ["ocean_build.last_warning"] = "1.65638e+09", ["stamina:exhaustion"] = "128.5", ["ocean_build.ocean_built"] = "12", inflicted_damage = "625408", digged_nodes = "1389582", yl_commons_player_created = "1612610117" } } ``` Log identifier ``` [MOD] yl_report log identifier = sDKMCUK4i5ps3G84frwpCBDNf0L3M1a9 ``` Profiler save: ``` profile-20220830T122307.json_prettyEE ``` Status: ``` # Server: version: 5.5.1-yl | game: Minetest Game | uptime: 6h 22min 24s | max lag: 1.45s | clients: Unelias, evil123, mtvisitor, mtwalker, Aero, Segmentation_Fault, Bishiro, Service, AliasAlreadyTaken, Bailiff ``` Teleport command: ``` /teleport xyz -1326 72 1068 ``` Compass command: ``` /give_compass Construction sDKMCUK4i5ps3G84frwpCBDNf0L3M1a9 D2691E -1326 72 1068 ```
AliasAlreadyTaken was assigned by yourland-report 2022-08-30 12:23:08 +00:00
flux added the
1. kind/bug
label 2022-08-30 16:34:35 +00:00
Member

blegh, the problem here is multifold.

  1. when upgrading a tool, the enchantment mod chooses a random groupcap to upgrade (random due to the order of entries in the table). the chosen value could quite possibly change from session to session.
  2. for the mithril axe, it currently chooses "fleshy". so it'll break "fleshy" nodes faster, or be more durable while breaking fleshy nodes, but won't actually change anything when you're cutting down a tree.
  3. the "time" values for the mithril axe only define values for level 2 and 3, not 1
  4. enchantment assumes that the times are a "normal" array when calculating the tooltip value, so iterating over it leaves the original times at 0
  5. it then divides by zero, resulting in nan%

what should change:

  • upgrade all the groupcaps, not just a single one.
  • tooltip code shouldn't assume a "normal" array
  • tooltip code should ensure it never divides by 0 anyway

i'm probably not going to do this anytime soon, i'd rather write an entirely new enchantment mod from the ground up.

blegh, the problem here is multifold. 1. when upgrading a tool, the enchantment mod chooses a *random* groupcap to upgrade (random due to the order of entries in the table). the chosen value could quite possibly change from session to session. 2. for the mithril axe, it currently chooses "fleshy". so it'll break "fleshy" nodes faster, or be more durable while breaking fleshy nodes, but won't actually change anything when you're cutting down a tree. 3. the "time" values for the mithril axe only define values for level 2 and 3, not 1 4. enchantment assumes that the times are a "normal" array when calculating the tooltip value, so iterating over it leaves the original times at 0 5. it then divides by zero, resulting in nan% what should change: * upgrade *all* the groupcaps, not just a single one. * tooltip code shouldn't assume a "normal" array * tooltip code should ensure it never divides by 0 anyway i'm probably not going to do this anytime soon, i'd rather write an entirely new enchantment mod from the ground up.
flux added this to the flux's TODO list project 2022-08-30 16:58:08 +00:00
flux self-assigned this 2022-08-30 16:58:12 +00:00
flux added a new dependency 2022-11-04 16:24:00 +00:00

Cannot reproduce with 1.1.118, but don't know where it was fixed.

Cannot reproduce with 1.1.118, but don't know where it was fixed.
AliasAlreadyTaken added the
5. result/cannot reproduce
label 2023-04-09 15:19:02 +00:00
AliasAlreadyTaken added this to the 1.1.118 milestone 2023-04-09 15:19:07 +00:00
Member

Cannot reproduce with 1.1.118, but don't know where it was fixed.

it probably was not fixed, it's just random whether the problem occurs or not. see point #1 in my comment above.

the mods i'm working on currently will create the groundwork for creating a much more fully featured enchanting mod that integrates w/ other mechanisms. however, it seems that enchanting isn't planned for some time. your-land/administration#33

> Cannot reproduce with 1.1.118, but don't know where it was fixed. it probably was not fixed, it's just random whether the problem occurs or not. see point #1 in my comment above. the mods i'm working on currently will create the groundwork for creating a much more fully featured enchanting mod that integrates w/ other mechanisms. however, it seems that enchanting isn't planned for some time. https://gitea.your-land.de/your-land/administration/issues/33

I enchanted 10 mithril axes both with durability and efficiency and was unable to reproduce the effect. What's the chance of appearance?

I enchanted 10 mithril axes both with durability and efficiency and was unable to reproduce the effect. What's the chance of appearance?
Member

I enchanted 10 mithril axes both with durability and efficiency and was unable to reproduce the effect. What's the chance of appearance?

it's a chance for all tools of the same kind, at server startup. the "randomness" is the order of items in a hashtable.

> I enchanted 10 mithril axes both with durability and efficiency and was unable to reproduce the effect. What's the chance of appearance? it's a chance for all tools of the same kind, at server startup. the "randomness" is the order of items in a hashtable.
AliasAlreadyTaken added
4. step/needs confirmation
and removed
5. result/cannot reproduce
labels 2023-04-10 00:22:38 +00:00
Member

image

yeah, still happening (this was on the fourth restart, first three reported 11%)

![image](/attachments/1f0c00a4-56e2-45c3-9347-edd9cf06d4f2) yeah, still happening (this was on the fourth restart, first three reported 11%)
Member

toolcaps of an unenchanted axe:

{
	damage_groups = {
		fleshy = 8
	},
	full_punch_interval = 0.44999998807907,
	groupcaps = {
		choppy = {
			maxlevel = 3,
			times = {
				1.75,
				0.44999998807907,
				0.44999998807907
			},
			uses = 200
		},
		fleshy = {
			maxlevel = 2,
			times = {
				[2] = 0.94999998807907,
				[3] = 0.30000001192093
			},
			uses = 200
		}
	},
	max_drop_level = 3,
	punch_attack_uses = 1800
}

toolcaps of a nan% axe:

{
	damage_groups = {
		fleshy = 8
	},
	full_punch_interval = 0.44999998807907,
	groupcaps = {
		choppy = {
			maxlevel = 3,
			times = {
				1.6499999761581,
				0.34999999403954,
				0.34999999403954
			},
			uses = 200
		},
		fleshy = {
			maxlevel = 2,
			times = {
				[2] = 0.94999998807907,
				[3] = 0.30000001192093
			},
			uses = 200
		}
	},
	max_drop_level = 3,
	punch_attack_uses = 1800
}

toolcaps of a 11% axe:

{
	damage_groups = {
		fleshy = 8
	},
	full_punch_interval = 0.44999998807907,
	groupcaps = {
		choppy = {
			maxlevel = 3,
			times = {
				1.6499999761581,
				0.34999999403954,
				0.34999999403954
			},
			uses = 200
		},
		fleshy = {
			maxlevel = 2,
			times = {
				[2] = 0.94999998807907,
				[3] = 0.30000001192093
			},
			uses = 200
		}
	},
	max_drop_level = 3,
	punch_attack_uses = 1800
}
toolcaps of an unenchanted axe: ```lua { damage_groups = { fleshy = 8 }, full_punch_interval = 0.44999998807907, groupcaps = { choppy = { maxlevel = 3, times = { 1.75, 0.44999998807907, 0.44999998807907 }, uses = 200 }, fleshy = { maxlevel = 2, times = { [2] = 0.94999998807907, [3] = 0.30000001192093 }, uses = 200 } }, max_drop_level = 3, punch_attack_uses = 1800 } ``` toolcaps of a nan% axe: ```lua { damage_groups = { fleshy = 8 }, full_punch_interval = 0.44999998807907, groupcaps = { choppy = { maxlevel = 3, times = { 1.6499999761581, 0.34999999403954, 0.34999999403954 }, uses = 200 }, fleshy = { maxlevel = 2, times = { [2] = 0.94999998807907, [3] = 0.30000001192093 }, uses = 200 } }, max_drop_level = 3, punch_attack_uses = 1800 } ``` toolcaps of a 11% axe: ```lua { damage_groups = { fleshy = 8 }, full_punch_interval = 0.44999998807907, groupcaps = { choppy = { maxlevel = 3, times = { 1.6499999761581, 0.34999999403954, 0.34999999403954 }, uses = 200 }, fleshy = { maxlevel = 2, times = { [2] = 0.94999998807907, [3] = 0.30000001192093 }, uses = 200 } }, max_drop_level = 3, punch_attack_uses = 1800 } ```
Member

also, note that upstream enchanting is archived (no updates possible), and has been since before we noticed the problem.

also, note that upstream enchanting is archived (no updates possible), and has been since before we noticed the problem.

That's where we got it from : https://codeberg.org/Hamlet/enchanting.git

Looks like we'll need to adopt until Hamlet comes back. In case a repo is archived, we have no chance to contribute back.

  • Fully adopt and release fork? Over the course of time that will clutter contend DB
  • Move to https://github.com/mt-mods/ ? That may delay contribs but at least make them accessible and available in an accepted location.
  • Remove and reinvent? Takes a lot of dev time, but is planned anyways
That's where we got it from : https://codeberg.org/Hamlet/enchanting.git Looks like we'll need to adopt until Hamlet comes back. In case a repo is archived, we have no chance to contribute back. - Fully adopt and release fork? Over the course of time that will clutter contend DB - Move to https://github.com/mt-mods/ ? That may delay contribs but at least make them accessible and available in an accepted location. - Remove and reinvent? Takes a lot of dev time, but is planned anyways
Member

Looks like we'll need to adopt until Hamlet comes back.

the code is frozen; we need to assume hamlet isn't coming back, and solve our problems w/ that assumption.

the current modstorm i'm working on (see #4132) allows a better way of enchanting tools. it's designed to provide an avenue for compatibility w/ other mods that affect how tools are used. it needs some work before i suggest your-land adopts it, but that's my ultimate goal.

> Looks like we'll need to adopt until Hamlet comes back. the code is frozen; we need to assume hamlet isn't coming back, and solve our problems w/ that assumption. the current modstorm i'm working on (see #4132) allows a better way of enchanting tools. it's designed to provide an avenue for compatibility w/ other mods that affect how tools are used. it needs some work before i suggest your-land adopts it, but that's my ultimate goal.
AliasAlreadyTaken removed this from the 1.1.118 milestone 2023-04-14 06:36:18 +00:00
Sign in to join this conversation.
No Milestone
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Depends on
You do not have permission to read 1 dependency
Reference: your-land/bugtracker#2575
No description provided.