Better player spawning algorithm #515
Labels
No Label
#P1 CRITICAL
#P2: HIGH
#P3: elevated
#P4 priority: medium
#P6: low
#Review
annoying
API
bug
code quality
combat
commands
compatibility
configurability
contribution inside
controls
core feature
creative mode
delayed for engine release
documentation
duplicate
enhancement
environment
feature request
gameplay
graphics
ground content conflict
GUI/HUD
help wanted
incomplete feature
invalid / won't fix
items
looking for contributor
mapgen
meta
mineclone2+
Minecraft >= 1.13
Minecraft >= 1.17
missing feature
mobile
mobs
mod support
model needed
multiplayer
Needs adoption
needs discussion
needs engine change
needs more information
needs research
nodes
non-mob entities
performance
player
possible close
redstone
release notes
schematics
Skyblock
sounds
Testing / Retest
tools
translation
unconfirmed
mcl5
mcla
Media missing
No Milestone
No project
No Assignees
9 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: VoxeLibre/VoxeLibre#515
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The engine spawning algorithm can sometimes put the player in harsh areas, like a mesa biome, stone beach or very mountainous terrain. Sometimes the mapgen's a real bitch and encloses you between huge cliffs from which it's hard to escape.
TODO:
spawn
mod from 5.0.0)About the TODO, maybe these will be of some help:
Subterrane's cavern spawning, it doesn't always work (sometimes it places the player into a 1x1x1 hole) but it's a start worth to be looked at:
https://github.com/minetest-mods/subterrane/blob/master/player_spawn.lua
G.M.A. mobs' space check, I've developed it to prevent mobs spawning into 1x1x1 holes:
https://git.minetest.land/Hamlet/gma/src/branch/master/functions/functions_generic.lua#L79
About hole spawning, paramat just posted a PR for Minetest to fix this. Yeah, its probably better be fixed in the engine. https://github.com/minetest/minetest/pull/8374
You seem to don't understand what I mean with hole spawning. I mean areas in mapgen in which you are surrounded by giant cliffs in all directions and it's hard or impossible to escape. My
mcl_mobs
code already prevents spawning in tiny areas, that was entirely unrelated.So that leave me only with the biome spawn, which is basically already a solved problem, I just have to adopt the MTG code.
Sometimes the player can spawn in a dangerous area, like midair above a cave/ravine where you can fall to your death.
Huh? In >7 years of playing Minetest, I never ever spawned above a cave in any game ever. Wow. This sounds like one of those “happens once every 5 years” bugs … 😀
Do you know the seed (and mapgen type) of the map in which this happened? It's VERY important to know the seed for reporting any mapgen-related bugs. If you still have the map in which this happened, just press F5 (debug screen key).
As far as a seed where this happens, try simply "0" without quotes. The spawn is random but if you keep respawning you'll eventually fall into a cave and get fall damaged. Mapgen is v7.
Screenshot
Hi,
If it's still actual, there's now a function
good_for_respawn(pos)
. It must return false for places unsuitable for respawn.If it's still actual, I think why not to call it here?
But I didn't experience the bug, have no Idea how to reproduce it, so I'm just asking.
Better spawning algorithmto Better player spawning algorithmI've added a fix to my fork
1edf86446f
It is tested with different mapgens and I didn't see bugs with it for now.
Hope it fixes Wuzzy/MineClone2#972 too.
Of course that was not enough, so I added area emerging and check the position for safety:
b32ce87979
And checked if there are some trees near the point, and a bit polished the code:
6d37bee8d4
If someone breaks respawn point - in next 30 seconds the game now finds the new one.
Testing needed, I'm testing it on RG Server - there were dangerous biomes by default, kay27.ignorelist.com:30002. Other my servers still use static_spawnpoint.
I plan to save respawn point into mod storage for further use after server restart
Mod storage supported
29cccb67ab
I think we may close the issue
Merging - that's the question :)
(4 commits:
1edf86446f
,b32ce87979
,6d37bee8d4
,29cccb67ab
)Merged
fe33f172d4
@kay We have several issues here.
seed: 404
mapgen: v7 with all options enabled
MC2: master-2021-03-13-8115575f20
The next dungeons placed because place searching requires generation of the world. If the world isn’t generated, we can’t check the position, only a biome name, but it wouldn’t be enough to set world respawn position properly. The problems are: at first 30 seconds you still appear where the engine decides, and the position shifts time to time (but then stops). Do I miss the something?
The player should only be spawned on a safe surface.
In this seed I got two spawns up in the air, the second one being even higher than the previous one. This should be looked into.
A trickier issue seems to be spawning the player on grass, like Minecraft does.
I created probably over 10 worlds with seed 404 (+ all mapgen options enabled) and in all of them I spawned inside a large rocky biome.
The world spawn needs refinement, but low priority.
I don't see this as a major bug, but at some point it should be fixed because it's obviously wrong about various coords becoming unsafe.
I mentioned the ABM problem in the correct place: #393.
When I spawn 2 players on a local server and there is a large sea nearby, the players can sometimes spawn about 500 blocks apart. Pretty annoying. Is that intentional?
I think yes if we don't like to spawn in the sea... Biome search inherited from MTG, I didn't check it well, but position search is mine, I plan to fix the issue with "ignore" nodes which cause restarts of the searching
This seed spawns the player in the desert: 2322491872620265674.
The nice thing about this seed's spawning point is that it's close to a savannah and a desert temple.
Try the seed "apple" some time :) - village with funny mapgen weirdness at spawn + 2 or 3 desert temples iirc.
Try the seed “speedrun” with mapgen v7 to see this in action.
If you're speedrunning achievements, 2052 is good. You spawn in a tree at least 50% of the time, so you have the getting wood achievement pretty quick if you want to survive.