Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safe Spawning #1

Open
meyerzinn opened this issue Mar 11, 2016 · 6 comments
Open

Safe Spawning #1

meyerzinn opened this issue Mar 11, 2016 · 6 comments

Comments

@meyerzinn
Copy link

So we all know people are going to be a******* and place blocks where someone spectates. Therefore, I propose the following algorithm for determining a "safe spawn":

safe(pos) =
(a) no lava or harmful liquid above or below the position without a separating block.
(b) no blocks that could suffocate or trap the player (spider webs?)
(c) a player could AFK there safely (without drowning).

  1. Get the block where the player came from. If it's safe, go there. Otherwise, continue.
  2. Calculate the next element of the golden spiral, based on the original position. Check all blocks in that element for safety. If at any point a block is safe, escape the algorithm.
  3. If there is no safe block in the spiral, go back to 2.
  4. If after a configurable amount of steps no safe location was found, teleport to the top of wherever their original location was (if it's safe as well) or to spawn or another configurable strategy.

This has the benefit of returning them as close to their original location as possible while progressively broadening the search.

@mbax
Copy link
Member

mbax commented Mar 15, 2016

Now having more free time to talk about this.

So, store player's location along with the game mode when spectating.

As for defining safe: What if lava is making its way down? :3

@meyerzinn
Copy link
Author

That’s why you check for lava above/below for, say, 10 blocks? But “safe” is a hard definition, what do you think of the concept of spiraling to find the closest possible location?

On Mar 15, 2016, at 11:23 AM, Matt Baxter [email protected] wrote:

Now having more free time to talk about this.

So, store player's location along with the game mode when spectating.

As for defining safe: What if lava is making its way down? :3


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#1 (comment) #1 (comment)

@mbax
Copy link
Member

mbax commented Mar 15, 2016

Spiraling sounds fun, but predictable. For fun I'd like to change direction of spiraling ^_^

@meyerzinn
Copy link
Author

It’s the golden spiral… you could start it in any direction ^^.

On Mar 15, 2016, at 12:31 PM, Matt Baxter [email protected] wrote:

Spiraling sounds fun, but predictable. For fun I'd like to change direction of spiraling ^_^


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub #1 (comment)

@mbax
Copy link
Member

mbax commented Mar 15, 2016

Pfffffft

@ryantheleach
Copy link

Make the safe area slightly larger, teleport the player to the position they are going to spawn in, still in spectator mode, Limit their movement to that safe area, and let them exit it either by clicking or interacting or something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants