Thutmose / Pokecube-Mobs

Pokemobs for Minecraft, This addon provides Pokemobs for Pokecube.
MIT License
0 stars 0 forks source link

Lost PokeMobs (if player tp away) #4

Open Sinuce opened 7 years ago

Sinuce commented 7 years ago

Issue Description:

A player's PokeMob can become lost if left behind.

What happens:

If a player takes out his/her PokeMob and then teleports far away (e.g. from a cave and back to /spawn), sometimes the PokeMob can not be retrieved with either R or /pokerecall. Only way to retrieve PokeMob is to travel back to the chunk, where it was left behind... if you can remember so.

What you expected to happen:

Everytime a player types /pokerecall the PokeMob should be retrieved - regardless of his/her location.

Steps to reproduce:

  1. Press R to take out a PokeMob.
  2. Teleport yourself far away.
  3. PokeMob is now unable to be retrieved with /pokerecall hence its chunk is unloaded.

Affected Versions:

Thutmose commented 7 years ago

Solution: do not teleport away from your pokemob.

This can't be fixed, as I have no way of telling when the player unintenionally teleports away from their mob, as opposed to intentionally doing so.

Sinuce commented 7 years ago

Thank you for the speedy reply.

Regarding unintentional vs intentional teleporting: That is true.

I was hoping you would consider adding a potentially toggable feature in the config. Or maybe just a text reminder, when a player teleports, leaving their pokemob unretrievable by command.

Some players simply don't get it: "Don't teleport away from your pokemobs!" They keep forgetting and losing their pokemobs... and then it's my problem.

If you deem this issue being irrelevant, I respect your decision.

EDIT: Is there something that adminstrators can do, besides telling players not to tp away?

Thutmose commented 7 years ago

the main problem is how do I tell that a player is teleporting? I have no way to tell if the move entity is called by a teleport command, or just by the player running really fast. checking every tick how far the player has moved isn't really a good solution for that either.

Sinuce commented 7 years ago

Hmmm. True that.

What about this idea: Every pokemob's location is saved, right? So when /pokerecall doesn't work (and a pokemob is lost somewhere), would it be possible for the player to use a command that returns the location of all his/hers pokemobs? (those currently outside of their pokecubes).

EDIT: That way, you would know the exact location you would have to travel to, to retrieve your lost pokemob.

Sinuce commented 7 years ago

The main issue is not that players forget to retrieve their pokemobs before teleporting; Rather, the problem is that they can't remember WHERE in the world they left them.

Thutmose commented 7 years ago

the pokemob's location isn't saved anywhere other than the chunk, they are normal mobs, so they are stored in the chunk data, like any other mob, so there is no way to determine where it was last if the chunk itself has unloaded

Sinuce commented 7 years ago

Oh. Sorry, I thought for sure that the pokemobs data was saved in a txt or json somewhere. Thanks for the clarification.

Feel free to close this Github issue when it suits you :)

Thutmose commented 7 years ago

I think I might leave this issue open, in the hopes that people will stop reporting this if they see it, I have had numerous complaints from people using /tp and forgetting where they left their mobs.

The main reason why I don't bother saving their locations elsewhere, is that vanilla handles saving mobs, so I don't need to spend the extra ram/disk space to store their locations.

Thutmose commented 7 years ago

What possibly could be done is something client side to record where you last saw your pokemob, update it once every few seconds, then have a HUD or something that lists the coordinates for you, though that is probably best done as either and addon for pokecube, or maybe even one for journeymap.

Maybe someone else would be willing to make something that does that.

Sinuce commented 7 years ago

I like the idea of hooking it up with Journeymap. That would be nice.

Unfortunately, I am no programmer. ^^;

P3rf3ctXZer0 commented 7 years ago

@Thutmose what if you set a check if player moves 200 blocks suddenly or more send pokecube to pc if owner is not within 200 blocks.

Thutmose commented 7 years ago

Not reliably, as chunk unloading timing can cause issues with that. My suggestion is to remind players not to just leave their Pokémobs behind when they teleport

P3rf3ctXZer0 commented 7 years ago

Its a small solution which is more than none. warp is a very popular server function ... you need a solution. Not doing anything to fix this would be very foolish.

Thutmose commented 7 years ago

It is not a solution, as it will result in duped Pokémobs, deleted Pokémobs, nothing at all, or occasionally working

P3rf3ctXZer0 commented 7 years ago

All you need to do is add a check to send pokecube to be sent to pc if player is not near and remove entity in play. It will only fail if you fail to code checks correctly XD also I know your skilled enough to make something as simple as this.

Thutmose commented 7 years ago

The problem is I cannot detect when a player has warped due to a command or other reason, and the way Minecraft unloads chunks afterwards isn't reliable to check.

The only way I can think of would be to check the entire entity list of the chunk when it unloads, and search for following Pokémobs and recall them before it unloads, this will cause a rather large performance hit.

P3rf3ctXZer0 commented 7 years ago

Then why not implement something related to spawn checks - if player owner is not within 16 blocks of entity pokecube be sent to pc. I will help you test it.

Thutmose commented 7 years ago

Because if the mob unloads with the chunk, it cannot do any checks for if player is nearby

P3rf3ctXZer0 commented 7 years ago

You can't reverse that code to check for players rather than entity? I would think that would be easy.

Thutmose commented 7 years ago

No, because the server cannot find unloaded pokemobs to recall them.