flux reports: limit scorpion spawns #5070

Closed
opened 2023-08-07 01:57:32 +00:00 by yourland-report · 10 comments

flux reports a bug:

there desperately needs to be a limit on the # of scorpions that spawn in one area

Player position:

{
	z = -2734.8930664063,
	x = -912.84997558594,
	y = 26.5
}

Player look:

{
	z = 0.73723143339157,
	x = 0.65362459421158,
	y = -0.17106936872005
}

Player information:

{
	ip_version = 6,
	min_rtt = 0.19499999284744,
	avg_rtt = 0.19799999892712,
	min_jitter = 0,
	max_jitter = 3.2300000190735,
	avg_jitter = 0.0010000020265579,
	formspec_version = 6,
	serialization_version = 29,
	patch = 0,
	max_rtt = 3.4279999732971,
	connection_uptime = 181,
	lang_code = "",
	state = "Active",
	protocol_version = 42,
	minor = 8,
	major = 5,
	version_string = "5.8.0-dev-7388c87ad"
}

Player meta:

{
	fields = {
		yl_commons_thankyou = "326",
		["petz:werewolf"] = "0",
		yl_commons_player_created = "1615351173",
		["petz:lycanthropy"] = "1",
		partychat = "party",
		arenalib_infobox_arenaID = "0",
		jointime = "1615351173",
		bitten = "0",
		yl_church = "return {[\"last_death\"] = {[\"z\"] = 1227, [\"x\"] = 35, [\"y\"] = 38}, [\"last_heal\"] = 1615504208, [\"last_death_portal\"] = 1687231432}",
		["3d_armor_inventory"] = "return {\"shields:shield_rainbow 1 6384\", \"3d_armor:helmet_rainbow 1 6384\", \"3d_armor:leggings_rainbow 1 6384\", \"3d_armor:chestplate_rainbow 1 6384\", \"nether_mobs:dragon_boots 1 15940\", \"\"}",
		digged_nodes = "1714286",
		["petz:werewolf_vignette_id"] = "20",
		played_time = "40021946",
		punch_count = "302462",
		placed_nodes = "478555",
		died = "100",
		["petz:old_override_table"] = "return {[\"new_move\"] = true, [\"sneak\"] = true, [\"sneak_glitch\"] = false, [\"jump\"] = 1.5, [\"speed\"] = 2, [\"gravity\"] = 1}",
		yl_commons_player_joined = "1691373290",
		["unified_inventory:bags"] = "return {\"water_life:croc_bag\", \"water_life:croc_bag\", \"water_life:croc_bag\", \"water_life:croc_bag\"}",
		hud_state = "on",
		["signslib:pos"] = "(1275,70,546)",
		repellant = "0",
		["petz:werewolf_clan_idx"] = "1",
		crafted = "203215",
		["stamina:level"] = "4",
		inflicted_damage = "5957694",
		["stamina:poisoned"] = "no",
		xp = "2290794",
		["stamina:exhaustion"] = "144"
	}
}

Log identifier


[MOD] yl_report log identifier = m42TCRDv9DZAadsbZKfApu18uLousFls

Profiler save:

profile-20230807T015731.json_prettyEE

Status:

# Server: version: 5.7.0-yl-thx-tmm | game: Minetest Game | uptime: 4h 42min 57s | max lag: 0.169s | clients (10/52): copper144, copper248, DragonWrangler1, flux, Goldberry, jackofthebean000, mindfrost, mrminer, Oakenshield, Xonon

Teleport command:

/teleport xyz -913 27 -2735

Compass command:

/give_compass Construction m42TCRDv9DZAadsbZKfApu18uLousFls D2691E -913 27 -2735
flux reports a bug: > there desperately needs to be a limit on the # of scorpions that spawn in one area Player position: ``` { z = -2734.8930664063, x = -912.84997558594, y = 26.5 } ``` Player look: ``` { z = 0.73723143339157, x = 0.65362459421158, y = -0.17106936872005 } ``` Player information: ``` { ip_version = 6, min_rtt = 0.19499999284744, avg_rtt = 0.19799999892712, min_jitter = 0, max_jitter = 3.2300000190735, avg_jitter = 0.0010000020265579, formspec_version = 6, serialization_version = 29, patch = 0, max_rtt = 3.4279999732971, connection_uptime = 181, lang_code = "", state = "Active", protocol_version = 42, minor = 8, major = 5, version_string = "5.8.0-dev-7388c87ad" } ``` Player meta: ``` { fields = { yl_commons_thankyou = "326", ["petz:werewolf"] = "0", yl_commons_player_created = "1615351173", ["petz:lycanthropy"] = "1", partychat = "party", arenalib_infobox_arenaID = "0", jointime = "1615351173", bitten = "0", yl_church = "return {[\"last_death\"] = {[\"z\"] = 1227, [\"x\"] = 35, [\"y\"] = 38}, [\"last_heal\"] = 1615504208, [\"last_death_portal\"] = 1687231432}", ["3d_armor_inventory"] = "return {\"shields:shield_rainbow 1 6384\", \"3d_armor:helmet_rainbow 1 6384\", \"3d_armor:leggings_rainbow 1 6384\", \"3d_armor:chestplate_rainbow 1 6384\", \"nether_mobs:dragon_boots 1 15940\", \"\"}", digged_nodes = "1714286", ["petz:werewolf_vignette_id"] = "20", played_time = "40021946", punch_count = "302462", placed_nodes = "478555", died = "100", ["petz:old_override_table"] = "return {[\"new_move\"] = true, [\"sneak\"] = true, [\"sneak_glitch\"] = false, [\"jump\"] = 1.5, [\"speed\"] = 2, [\"gravity\"] = 1}", yl_commons_player_joined = "1691373290", ["unified_inventory:bags"] = "return {\"water_life:croc_bag\", \"water_life:croc_bag\", \"water_life:croc_bag\", \"water_life:croc_bag\"}", hud_state = "on", ["signslib:pos"] = "(1275,70,546)", repellant = "0", ["petz:werewolf_clan_idx"] = "1", crafted = "203215", ["stamina:level"] = "4", inflicted_damage = "5957694", ["stamina:poisoned"] = "no", xp = "2290794", ["stamina:exhaustion"] = "144" } } ``` Log identifier ``` [MOD] yl_report log identifier = m42TCRDv9DZAadsbZKfApu18uLousFls ``` Profiler save: ``` profile-20230807T015731.json_prettyEE ``` Status: ``` # Server: version: 5.7.0-yl-thx-tmm | game: Minetest Game | uptime: 4h 42min 57s | max lag: 0.169s | clients (10/52): copper144, copper248, DragonWrangler1, flux, Goldberry, jackofthebean000, mindfrost, mrminer, Oakenshield, Xonon ``` Teleport command: ``` /teleport xyz -913 27 -2735 ``` Compass command: ``` /give_compass Construction m42TCRDv9DZAadsbZKfApu18uLousFls D2691E -913 27 -2735 ```
AliasAlreadyTaken was assigned by yourland-report 2023-08-07 01:57:32 +00:00
AliasAlreadyTaken added the
1. kind/enhancement
label 2023-08-07 09:06:45 +00:00

Since scorpions create "children" via their own spawn function, it's pretty hard to limit them via spawnit.

Could spawnit have a public can_spawn(entityname,pos,...) to tell external spawns it's enough now?

Since scorpions create "children" via their own spawn function, it's pretty hard to limit them via spawnit. Could spawnit have a public `can_spawn(entityname,pos,...)` to tell external spawns it's enough now?
flux added the
1. kind/balancing
label 2023-08-08 05:51:20 +00:00
Member

Could spawnit have a public can_spawn(entityname,pos,...) to tell external spawns it's enough now?

hm. possibly? but this is a very scorpion-specific problem, the boss scorpion's attack is what causes the others to spawn, not normal spawn rules. the big and little scorpions currently don't spawn naturally in the desert stone biomes, all the ones there are from boss scorpions.

> Could spawnit have a public `can_spawn(entityname,pos,...)` to tell external spawns it's enough now? hm. possibly? but this is a very scorpion-specific problem, the boss scorpion's *attack* is what causes the others to spawn, not normal spawn rules. the big and little scorpions currently don't spawn naturally in the desert stone biomes, all the ones there are from boss scorpions.
Member

what's a reasonable count of adds in the region after which no more should spawn? 12?

what's a reasonable count of adds in the region after which no more should spawn? 12?
Member

Could spawnit have a public can_spawn(entityname,pos,...) to tell external spawns it's enough now?

hm. possibly?

i've been playing around w/ this on-and-off for several hours. it'd seem like spawnit should be able to answer a question like of "can this mob spawn in this position" should be simple, given that's 50% of its purpose? the problem is that the way spawnit answers that question is broken up over a very long and complicated pipeline, and i don't see a "good" way to refactor the code to make it feasible, at least not w/out writing a bunch of almost-but-not-quite redundant code.

i wrote some code for the scorpion boss in yl_custom, which limited the number of spawns w/ a get_objects_inside_radius call, and also implemented a basic spawn position chooser to try to keep the scorpions from spawning through walls (see #2227). however, the scorpions would still get through walls because they might spawn partially within a wall (big scorpion collision boxes are huge and gross). i then spent a while trying to convert some bits of spawnit for the purpose, and then it got bit and complicated and gross.

> > Could spawnit have a public `can_spawn(entityname,pos,...)` to tell external spawns it's enough now? > > hm. possibly? i've been playing around w/ this on-and-off for several hours. it'd seem like spawnit should be able to answer a question like of "can this mob spawn in this position" should be simple, given that's 50% of its purpose? the problem is that the way spawnit answers that question is broken up over a very long and complicated pipeline, and i don't see a "good" way to refactor the code to make it feasible, at least not w/out writing a bunch of almost-but-not-quite redundant code. i wrote some code for the scorpion boss in yl_custom, which limited the number of spawns w/ a `get_objects_inside_radius` call, and also implemented a basic spawn position chooser to try to keep the scorpions from spawning through walls (see #2227). however, the scorpions would still get *through* walls because they might spawn *partially* within a wall (big scorpion collision boxes are huge and gross). i then spent a while trying to convert some bits of spawnit for the purpose, and then it got bit and complicated and gross.
Member

what's a reasonable count of adds in the region after which no more should spawn? 12?

i'm currently going w/ 8 in an 8-node radius (L2)

> what's a reasonable count of adds in the region after which no more should spawn? 12? i'm currently going w/ 8 in an 8-node radius (L2)
flux added this to the flux's TODO list project 2023-08-09 00:35:33 +00:00
AliasAlreadyTaken was unassigned by flux 2023-08-09 00:35:40 +00:00
flux self-assigned this 2023-08-09 00:35:40 +00:00
flux added the
4. step/at work
label 2023-08-09 00:35:50 +00:00
AliasAlreadyTaken was assigned by flux 2023-08-09 00:40:53 +00:00
flux changed title from flux reports: there desperately needs to be ... to flux reports: limit scorpion spawns 2023-11-24 23:09:20 +00:00
Member

working on this again, it's already mostly there. just need to implement the check to prevent scorpions from spawning in or partially inside walls.

working on this again, it's already mostly there. just need to implement the check to prevent scorpions from spawning in or partially inside walls.
flux added
4. step/ready to QA test
and removed
4. step/at work
labels 2023-11-26 21:40:54 +00:00
Member

implemented this: ad69fc6ae4

features:

  • only 8 big+little scorpions ("adds" from now on) can be spawned by the boss within a radius of 12 nodes from the boss
  • the boss now actually does damage when not spawning scorpions in an attack
  • adds will spawn on ground and not even partially in a wall
  • adds can only spawn if the boss can "see" the location - no spawning through walls
implemented this: https://gitea.your-land.de/your-land/Scorpion/commit/ad69fc6ae4bdfc0ac1aa4d3382a02548f24a49a1 features: * only 8 big+little scorpions ("adds" from now on) can be spawned by the boss within a radius of 12 nodes from the boss * the boss now actually does damage when not spawning scorpions in an attack * adds will spawn on ground and not even partially in a wall * adds can only spawn if the boss can "see" the location - no spawning *through* walls
AliasAlreadyTaken added this to the 1.1.122 milestone 2023-11-27 00:52:53 +00:00
  • only 8 big+little scorpions ("adds" from now on) can be spawned by the boss within a radius of 12 nodes from the boss

That works, the boss occasionally even spawns less than that number

  • the boss now actually does damage when not spawning scorpions in an attack

That works. Ouch!

  • adds will spawn on ground and not even partially in a wall

When space is very limited, they do spawn on the ground, but then occasionally clip on top of the boss

  • adds can only spawn if the boss can "see" the location - no spawning through walls

I assume "see" doesn't include glass, right?

> * only 8 big+little scorpions ("adds" from now on) can be spawned by the boss within a radius of 12 nodes from the boss That works, the boss occasionally even spawns less than that number > * the boss now actually does damage when not spawning scorpions in an attack That works. Ouch! > * adds will spawn on ground and not even partially in a wall When space is very limited, they do spawn on the ground, but then occasionally clip on top of the boss > * adds can only spawn if the boss can "see" the location - no spawning *through* walls I assume "see" doesn't include glass, right?
AliasAlreadyTaken added the
ugh/QA OK
label 2023-12-04 21:01:28 +00:00
Member

I assume "see" doesn't include glass, right?

no, they can't "see" through glass.

> I assume "see" doesn't include glass, right? no, they can't "see" through glass.
flux added
5. result/fixed
and removed
4. step/ready to QA test
labels 2023-12-17 23:29:30 +00:00
flux removed this from the flux's TODO list project 2023-12-17 23:29:32 +00:00
flux removed their assignment 2023-12-17 23:29:34 +00:00
AliasAlreadyTaken was unassigned by flux 2023-12-17 23:29:34 +00:00
Member

this is live

this is live
flux closed this issue 2023-12-17 23:29:48 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
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.

Dependencies

No dependencies set.

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