AliasAlreadyTaken reports: Make relative velocity damage ... #8170

Open
opened 2025-03-04 12:22:38 +01:00 by yourland-report · 1 comment

AliasAlreadyTaken reports a bug:

Make relative velocity damage multiplier function. Implement a function that takes two velocity vectors and returns a float damage multiplier between 1 and a reasonable maximum. Prepare to multiply combat damage with this multiplier.

Player position:

{
	x = 1979.3000488281,
	y = 18,
	z = 1174.0150146484
}

Player look:

{
	x = 0.99730551242828,
	y = -0.054950181394815,
	z = 0.048601999878883
}

Player information:

{
	ip_version = 6,
	min_rtt = 0.016000000759959,
	min_jitter = 0,
	max_jitter = 0.29499998688698,
	avg_jitter = 0,
	connection_uptime = 10392,
	patch = 0,
	minor = 12,
	avg_rtt = 0.017000000923872,
	major = 5,
	version_string = "5.12.0-yl-debug-0eb047ca3",
	state = "Active",
	max_rtt = 0.31099998950958,
	protocol_version = 46,
	formspec_version = 8,
	serialization_version = 29,
	lang_code = "de"
}

Player meta:

{
	fields = {
		["unified_inventory:bags"] = "return {\"unified_inventory:bag_large\", \"unified_inventory:bag_large\", \"unified_inventory:bag_large\", \"unified_inventory:bag_large\"}",
		szutil_watch = "return {}",
		["arena_lib_editor.spawner_ID"] = "0",
		["arena_lib_editor.team_ID"] = "0",
		["hud_manager:spawnit:hud_enabled"] = "y",
		["petz:werewolf_vignette_id"] = "19",
		["signslib:pos"] = "(1953,30,1118)",
		yl_church = "return {[\"last_death\"] = {[\"y\"] = 18, [\"z\"] = 1174, [\"x\"] = 1979}, [\"last_death_portal\"] = 1714631995, [\"last_heal\"] = 1707613077}",
		partychat = "party",
		arenalib_infobox_arenaID = "0",
		bitten = "0",
		xp_redo_hud_color = "0xFFFF00",
		yl_commons_thankyou = "2324",
		["petz:werewolf"] = "0",
		["petz:lycanthropy"] = "0",
		["ocean_build.last_warning"] = "1.67421e+09",
		["ocean_build.forbidden"] = "true",
		["ocean_build.ocean_built"] = "12",
		["sethome:home"] = "(1983.4349365234,17.5,1183.5950927734)",
		["hud_manager:yl_snowball:hud__enabled"] = "n",
		digged_nodes = "146110",
		xp = "0",
		died = "1593",
		["stamina:level"] = "0",
		partypvp = "true",
		arenalib_watchID = "0",
		["petz:old_override_table"] = "return {[\"speed\"] = 1, [\"new_move\"] = true, [\"sneak_glitch\"] = false, [\"gravity\"] = 1, [\"jump\"] = 1, [\"sneak\"] = true}",
		["stamina:exhaustion"] = "3.5",
		repellant = "0",
		punch_count = "65505",
		yl_audio_state = "off",
		inflicted_damage = "3050958",
		["petz:werewolf_clan_idx"] = "4",
		["arena_lib_editor.players_number"] = "0",
		team = "STAFF",
		lagometer = "1",
		played_time = "133989753",
		["ethereal:fly_timer"] = "-99",
		placed_nodes = "187926",
		hotbar_size = "16",
		crafted = "4872",
		hud_state = "on",
		yl_commons_player_joined = "1741076973",
		["3d_armor_inventory"] = "return {\"\", \"\", \"\", \"\", \"\", \"\"}"
	}
}

Log identifier


[MOD] yl_report log identifier = cR9VHr9g4LGM8V55uAqb3h3jD2ivCRrE

Profiler save:

profile-20250304T122238.json_prettyEE

Status:

# Server: version: 5.11.0-yl-lt | game: Minetest Game | uptime: 2d 16h 31min 2s | max lag: 0.533s | clients (17/52): AliasAlreadyTaken, aloxyz, Bailiff, BenOnly, bluie, botumin, daydream, Deathwing, Janne, Midori, MineWorlds, mirb, Murmel, rabenkind, Rjjck, Service, testmineweirdo

Teleport command:

/teleport xyz 1979 18 1174

Compass command:

/give_compass Construction cR9VHr9g4LGM8V55uAqb3h3jD2ivCRrE D2691E 1979 18 1174
AliasAlreadyTaken reports a bug: > Make relative velocity damage multiplier function. Implement a function that takes two velocity vectors and returns a float damage multiplier between 1 and a reasonable maximum. Prepare to multiply combat damage with this multiplier. Player position: ``` { x = 1979.3000488281, y = 18, z = 1174.0150146484 } ``` Player look: ``` { x = 0.99730551242828, y = -0.054950181394815, z = 0.048601999878883 } ``` Player information: ``` { ip_version = 6, min_rtt = 0.016000000759959, min_jitter = 0, max_jitter = 0.29499998688698, avg_jitter = 0, connection_uptime = 10392, patch = 0, minor = 12, avg_rtt = 0.017000000923872, major = 5, version_string = "5.12.0-yl-debug-0eb047ca3", state = "Active", max_rtt = 0.31099998950958, protocol_version = 46, formspec_version = 8, serialization_version = 29, lang_code = "de" } ``` Player meta: ``` { fields = { ["unified_inventory:bags"] = "return {\"unified_inventory:bag_large\", \"unified_inventory:bag_large\", \"unified_inventory:bag_large\", \"unified_inventory:bag_large\"}", szutil_watch = "return {}", ["arena_lib_editor.spawner_ID"] = "0", ["arena_lib_editor.team_ID"] = "0", ["hud_manager:spawnit:hud_enabled"] = "y", ["petz:werewolf_vignette_id"] = "19", ["signslib:pos"] = "(1953,30,1118)", yl_church = "return {[\"last_death\"] = {[\"y\"] = 18, [\"z\"] = 1174, [\"x\"] = 1979}, [\"last_death_portal\"] = 1714631995, [\"last_heal\"] = 1707613077}", partychat = "party", arenalib_infobox_arenaID = "0", bitten = "0", xp_redo_hud_color = "0xFFFF00", yl_commons_thankyou = "2324", ["petz:werewolf"] = "0", ["petz:lycanthropy"] = "0", ["ocean_build.last_warning"] = "1.67421e+09", ["ocean_build.forbidden"] = "true", ["ocean_build.ocean_built"] = "12", ["sethome:home"] = "(1983.4349365234,17.5,1183.5950927734)", ["hud_manager:yl_snowball:hud__enabled"] = "n", digged_nodes = "146110", xp = "0", died = "1593", ["stamina:level"] = "0", partypvp = "true", arenalib_watchID = "0", ["petz:old_override_table"] = "return {[\"speed\"] = 1, [\"new_move\"] = true, [\"sneak_glitch\"] = false, [\"gravity\"] = 1, [\"jump\"] = 1, [\"sneak\"] = true}", ["stamina:exhaustion"] = "3.5", repellant = "0", punch_count = "65505", yl_audio_state = "off", inflicted_damage = "3050958", ["petz:werewolf_clan_idx"] = "4", ["arena_lib_editor.players_number"] = "0", team = "STAFF", lagometer = "1", played_time = "133989753", ["ethereal:fly_timer"] = "-99", placed_nodes = "187926", hotbar_size = "16", crafted = "4872", hud_state = "on", yl_commons_player_joined = "1741076973", ["3d_armor_inventory"] = "return {\"\", \"\", \"\", \"\", \"\", \"\"}" } } ``` Log identifier ``` [MOD] yl_report log identifier = cR9VHr9g4LGM8V55uAqb3h3jD2ivCRrE ``` Profiler save: ``` profile-20250304T122238.json_prettyEE ``` Status: ``` # Server: version: 5.11.0-yl-lt | game: Minetest Game | uptime: 2d 16h 31min 2s | max lag: 0.533s | clients (17/52): AliasAlreadyTaken, aloxyz, Bailiff, BenOnly, bluie, botumin, daydream, Deathwing, Janne, Midori, MineWorlds, mirb, Murmel, rabenkind, Rjjck, Service, testmineweirdo ``` Teleport command: ``` /teleport xyz 1979 18 1174 ``` Compass command: ``` /give_compass Construction cR9VHr9g4LGM8V55uAqb3h3jD2ivCRrE D2691E 1979 18 1174 ```
AliasAlreadyTaken was assigned by yourland-report 2025-03-04 12:22:38 +01:00
AliasAlreadyTaken added the
1. kind/enhancement
2. prio/good first issue
labels 2025-03-04 12:44:07 +01:00
AliasAlreadyTaken added this to the 1.4 Classes and abilities milestone 2025-03-04 12:44:13 +01:00

I thought of the wizard's spell, "Magic Missiles"

Calculatable factors of physics
Large target 3+meters
Medium 2 meters
Small 1 meter or less

Calc 1 "Velocity to target"
Calc 2 "Target direction of travel" (1 toward 2 away 3 equal distance or standing still)

Basic impact damage makes sense to have +/- modifiers based on movement

Magic missiles explode on impact, causing that violent air displacement and whatever magical shrapnel is sent flying. So the concussive exploding damage and the direction of travel and mass of the target should be affected.

-- Function to calculate relative velocity damage multiplier
local function get_velocity_damage_multiplier(target, explosion_pos)
local target_velocity = target:get_velocity() or {x = 0, y = 0, z = 0}
local target_mass = target:get_properties().physical and target:get_properties().collisionbox[4] or 1 -- Estimate mass based on size
local explosion_force = 1.5 -- Base force of explosion impact

local relative_velocity = vector.length(target_velocity)
local direction_factor = vector.dot(vector.subtract(explosion_pos, target:get_pos()), target_velocity)
local damage_multiplier = 1 + (relative_velocity * 0.3)

if direction_factor > 0 then
    damage_multiplier = damage_multiplier * (1 + (target_mass * 0.2))  -- Running towards explosion amplifies damage
else
    damage_multiplier = damage_multiplier * (1 - (target_mass * 0.1))  -- Running away slightly negates damage
end

return math.max(1, damage_multiplier)

end

-- Function to handle magic missile impact explosion
local function magic_missile_explosion(pos, target, base_damage)
if not target then return end

local multiplier = get_velocity_damage_multiplier(target, pos)
local final_damage = base_damage * multiplier

target:punch(nil, 1.0, {damage_groups = {fleshy = final_damage}}, nil)
minetest.chat_send_all("Magic Missile hit! Damage: " .. final_damage)

end

-- Spell: Magic Missiles
local function cast_magic_missiles(caster, target)
local num_missiles = math.random(3, 5)
local base_damage = 5 -- Base damage per missile

for i = 1, num_missiles do
    minetest.after(i * 0.2, function()
        if target and target:get_pos() then
            local impact_pos = target:get_pos()
            magic_missile_explosion(impact_pos, target, base_damage)
        end
    end)
end

end

I thought of the wizard's spell, "Magic Missiles" *Calculatable factors of physics* Large target 3+meters Medium 2 meters Small 1 meter or less Calc 1 "Velocity to target" Calc 2 "Target direction of travel" (1 toward 2 away 3 equal distance or standing still) Basic impact damage makes sense to have +/- modifiers based on movement Magic missiles explode on impact, causing that violent air displacement and whatever magical shrapnel is sent flying. So the concussive exploding damage and the direction of travel and mass of the target should be affected. -- Function to calculate relative velocity damage multiplier local function get_velocity_damage_multiplier(target, explosion_pos) local target_velocity = target:get_velocity() or {x = 0, y = 0, z = 0} local target_mass = target:get_properties().physical and target:get_properties().collisionbox[4] or 1 -- Estimate mass based on size local explosion_force = 1.5 -- Base force of explosion impact local relative_velocity = vector.length(target_velocity) local direction_factor = vector.dot(vector.subtract(explosion_pos, target:get_pos()), target_velocity) local damage_multiplier = 1 + (relative_velocity * 0.3) if direction_factor > 0 then damage_multiplier = damage_multiplier * (1 + (target_mass * 0.2)) -- Running towards explosion amplifies damage else damage_multiplier = damage_multiplier * (1 - (target_mass * 0.1)) -- Running away slightly negates damage end return math.max(1, damage_multiplier) end -- Function to handle magic missile impact explosion local function magic_missile_explosion(pos, target, base_damage) if not target then return end local multiplier = get_velocity_damage_multiplier(target, pos) local final_damage = base_damage * multiplier target:punch(nil, 1.0, {damage_groups = {fleshy = final_damage}}, nil) minetest.chat_send_all("Magic Missile hit! Damage: " .. final_damage) end -- Spell: Magic Missiles local function cast_magic_missiles(caster, target) local num_missiles = math.random(3, 5) local base_damage = 5 -- Base damage per missile for i = 1, num_missiles do minetest.after(i * 0.2, function() if target and target:get_pos() then local impact_pos = target:get_pos() magic_missile_explosion(impact_pos, target, base_damage) end end) end end
Sign in to join this conversation.
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: your-land/bugtracker#8170
No description provided.