This is more of a gut check to make sure I'm not seeing things here that aren't really there.
I'm writing a mod that does a survival island kind of world that generates a bunch of islands in the sky... sort of like Skyblock. The problem I'm facing is that when you generate the map, the position you spawn at now moves around +/- about 10-20 meters in either the x, y, or z axis. If you get lucky, you spawn right on top of one of the islands and everything is fine from that point... at least until you fall off and jump into the void. Then the spawn point shifts around again.
In other words, it turns every map into a hardcore map (defacto) as you can't survive until you expand the island.
This problem doesn't seem to be limited to just this mod though, as I've seen it happen with a couple of different survival island maps I've downloaded in the Map section of this forum. While the original spawn point isn't so big of a deal (your x/y/z position seems to be saved accurately and loaded from the game), the problems start to happen if you die and the game tries to return you to near the spawn point (presumably set with a map editor). If you are on a survival island map such as being on a small island in a sea of lava or something else equally deadly, you are simply SOL in terms of trying to recover the map.
I understand that this kind of behavior might have been nice to have a slightly "fuzzy" position for the spawn point in a multi-player situation, where the spawn point would be rather mundane and plan on a general spawn area. So much content has been created for single player maps though that I would think this is a fatal bug.
Maybe it the mod that's doing it are you sure it's minecraft 1.3.1? Check again.
No, I found the offending lines of code in 1.3.1 and have been able to make a work around that specific section. BTW, I'll also give credit to mallaian who pointed out this section, even though he thinks this isn't necessarily a bug (it is, for other reasons).
This is something that was intentionally put into the software by Notch (I presume... I think it has been there for some time) but until 1.3.x hasn't really been an issue because it wasn't a part of the single-player version of the software.
The specific class that is causing the problems is the "EntityPlayerMP" class (called "gt" in the obfuscated code) where the class constructor has the following bit of code:
if (!par2World.worldProvider.hasNoSky && par2World.getWorldInfo().func_76077_q() != EnumGameType.ADVENTURE)
{
i += rand.nextInt(20) - 10;
k = par2World.getTopSolidOrLiquidBlock(i, j);
j += rand.nextInt(20) - 10;
}
There are a number of problems with this bit of code, both because the "z-axis" is being changed after the y-axis has been modified, and because this is even happening in the first place. (I need to give KeyBounce credit for pointing out this other error).
The purpose of this bit of code is to make sure that on a massive multiplayer server that two players don't spawn at the same place at the same time. That isn't a problem on single player clients or even a serious problem for small servers like would be typical for LAN gameplay. Really this is a cheap fix to a more serious problem that could have been taken care of in other ways.
Significantly though, this is impacting almost all of the survival island type maps that have a very small spawn area, in particular the very popular SkyBlock map and the derivative kind of maps like it.
There are a number of kinds of "fixes" that I might suggest to the Mojang development team, but clearly this is a behavior that has some unintended consequences for single player map designers. Trying to fix this with MCEdit or something similar won't help, as this is a base code problem with Minecraft.
BTW, the other problem that this relates to is that servers (or for that matter any current Minecraft map) that has players spawning on the side of a mountain or some other place that has huge differences in height along the z-axis near the spawn point will be causing damage to players either from fall damage when you respawn (potentially killing players immediately after spawn) or having players spawn inside of solid blocks. That is potentially a fatal problem that certainly should rank well above a minor annoyance.
I too had noticed inconsistent spawn behavior. I noticed I seemed to bounce between respawning at two different spots that were about 100 blocks apart. I thought SMP used a circular spawning area and randomly spawned you in that area. Or is that what you're saying is happening?
I too had noticed inconsistent spawn behavior. I noticed I seemed to bounce between respawning at two different spots that were about 100 blocks apart. I thought SMP used a circular spawning area and randomly spawned you in that area. Or is that what you're saying is happening?
SMP uses a square (not circular) spawning area where you are randomly spawned. Unfortunately in this case, SSP is now SMP in this regard too as of 1.3.1 is concerned, which is sort of my point about this issue but there are also additional bugs on top of the intentional random spawning that was also happening with SMP. Just don't have a slope in the z-axis direction in your spawning area either.
This is important to know about as well if you are designing the spawn area for an SMP server. One of my suggestions I made was to make this a user-settable parameter that a server operator could adjust themselves (there are already several such parameters for both SMP and SSP) that would be set to 0 by default for ordinary user client/server downloads, but for the server downloads to make this parameter default to the current 10 block distance. If you wanted to imitate server behavior, you could on your personal machine that usually has just yourself playing, or you could keep the 0 spawning range from the spawn point as something deliberate so you can play these more exotic maps that have a restricted spawn area.
Either that or all of these map makers need to be explicitly informed that they need to create a spawn area for people using their maps that will accommodate this new spawn behavior. This does impact a whole lot of map content though and renders many of the old maps useless and obsolete. If you make maps of any kind intended for download and play you need to be made aware of this issue.
If you are bouncing between two different locations, there may be still other bugs related to spawning behavior as there are several different places where spawn points are derived and calculated. Strangely, the spawn point is calculated by the biome weather generator, but it is also set by beds and may even be set by some other areas of the game. It definitely needs a serious code review.
i've had this problem too. i'm making adventure maps and all of them make me (or anyone who downloads them) spawn outside the rooms they are supposed to spawn. i hope this changes in the next version of minecraft
If you need a quick and dirty fix to recommend to folks, you can download the WorldGen API that I've posted on my SkyZone thread and put the gt.class file into the "minecraft.jar" file (the other classes shouldn't do any damage except for some conflict issues I know about regarding MC Forge). All I've done with the class is to remove the fuzzy spawning and replacing it with spawning at the precise spot... like used to be done with traditional SSP in 1.2.5 and earlier.
I really hope this class gets a solid code review and is updated for 1.3.2. Please don't let this wait until 1.4.x to be fixed!
The odd part that I don't understand is why adventure mode gets a pass on this as a spawning issue, but custom survival maps are ignored? Some sort of internal map project with the Mojang developers must have noticed this was an issue, so some programming effort was expended to "turn it off" for at least adventure maps.
One of my suggestions I made was to make this a user-settable parameter that a server operator could adjust themselves (there are already several such parameters for both SMP and SSP) that would be set to 0 by default for ordinary user client/server downloads, but for the server downloads to make this parameter default to the current 10 block distance. If you wanted to imitate server behavior, you could on your personal machine that usually has just yourself playing, or you could keep the 0 spawning range from the spawn point as something deliberate so you can play these more exotic maps that have a restricted spawn area.
This is great though. Probably the easiest fix.
Rollback Post to RevisionRollBack
Don't play vanilla? You don't know **** about minecraft.
I realize this is zombifying an old discussion, but it is still relevant as a "recent update" because the bug is still something found in 1.3.2 as it was in 1.3.1
I also made a mod that fixes this bug, for those who may find this an annoyance and just want a work around:
If the game parsed the landscape for a suitable spawn position before just throwing us in that would fix half the problem.
One of the problems is that the code being used to calculate the spawn location already does this, only it comes from the world generator subroutines. They may even "fix" this problem by trying to find a suitable location by simply generating a large flat area where a pure vanilla map never has problems.
The problem here is that the subroutine takes that location and then randomizes it even further, without doing any sort of checking that it might be "safe" other than adjusting the y position.... which it does a lousy job of doing as well and even that step is buggy. Setting the default spawn location with MC Edit doesn't help as that default location saved in the world data file is what gets manipulated here.
I'm writing a mod that does a survival island kind of world that generates a bunch of islands in the sky... sort of like Skyblock. The problem I'm facing is that when you generate the map, the position you spawn at now moves around +/- about 10-20 meters in either the x, y, or z axis. If you get lucky, you spawn right on top of one of the islands and everything is fine from that point... at least until you fall off and jump into the void. Then the spawn point shifts around again.
In other words, it turns every map into a hardcore map (defacto) as you can't survive until you expand the island.
This problem doesn't seem to be limited to just this mod though, as I've seen it happen with a couple of different survival island maps I've downloaded in the Map section of this forum. While the original spawn point isn't so big of a deal (your x/y/z position seems to be saved accurately and loaded from the game), the problems start to happen if you die and the game tries to return you to near the spawn point (presumably set with a map editor). If you are on a survival island map such as being on a small island in a sea of lava or something else equally deadly, you are simply SOL in terms of trying to recover the map.
I understand that this kind of behavior might have been nice to have a slightly "fuzzy" position for the spawn point in a multi-player situation, where the spawn point would be rather mundane and plan on a general spawn area. So much content has been created for single player maps though that I would think this is a fatal bug.
Version 2.1 now updated for MC 1.6.2
No, I found the offending lines of code in 1.3.1 and have been able to make a work around that specific section. BTW, I'll also give credit to mallaian who pointed out this section, even though he thinks this isn't necessarily a bug (it is, for other reasons).
This is something that was intentionally put into the software by Notch (I presume... I think it has been there for some time) but until 1.3.x hasn't really been an issue because it wasn't a part of the single-player version of the software.
The specific class that is causing the problems is the "EntityPlayerMP" class (called "gt" in the obfuscated code) where the class constructor has the following bit of code:
There are a number of problems with this bit of code, both because the "z-axis" is being changed after the y-axis has been modified, and because this is even happening in the first place. (I need to give KeyBounce credit for pointing out this other error).
The purpose of this bit of code is to make sure that on a massive multiplayer server that two players don't spawn at the same place at the same time. That isn't a problem on single player clients or even a serious problem for small servers like would be typical for LAN gameplay. Really this is a cheap fix to a more serious problem that could have been taken care of in other ways.
Significantly though, this is impacting almost all of the survival island type maps that have a very small spawn area, in particular the very popular SkyBlock map and the derivative kind of maps like it.
There are a number of kinds of "fixes" that I might suggest to the Mojang development team, but clearly this is a behavior that has some unintended consequences for single player map designers. Trying to fix this with MCEdit or something similar won't help, as this is a base code problem with Minecraft.
BTW, the other problem that this relates to is that servers (or for that matter any current Minecraft map) that has players spawning on the side of a mountain or some other place that has huge differences in height along the z-axis near the spawn point will be causing damage to players either from fall damage when you respawn (potentially killing players immediately after spawn) or having players spawn inside of solid blocks. That is potentially a fatal problem that certainly should rank well above a minor annoyance.
Version 2.1 now updated for MC 1.6.2
by c0yote
I tried it with terrible results. I gave my wife my glasses for a second, a creeper showed up and now my wife is pregnant.
Stupid 3D..
SMP uses a square (not circular) spawning area where you are randomly spawned. Unfortunately in this case, SSP is now SMP in this regard too as of 1.3.1 is concerned, which is sort of my point about this issue but there are also additional bugs on top of the intentional random spawning that was also happening with SMP. Just don't have a slope in the z-axis direction in your spawning area either.
This is important to know about as well if you are designing the spawn area for an SMP server. One of my suggestions I made was to make this a user-settable parameter that a server operator could adjust themselves (there are already several such parameters for both SMP and SSP) that would be set to 0 by default for ordinary user client/server downloads, but for the server downloads to make this parameter default to the current 10 block distance. If you wanted to imitate server behavior, you could on your personal machine that usually has just yourself playing, or you could keep the 0 spawning range from the spawn point as something deliberate so you can play these more exotic maps that have a restricted spawn area.
Either that or all of these map makers need to be explicitly informed that they need to create a spawn area for people using their maps that will accommodate this new spawn behavior. This does impact a whole lot of map content though and renders many of the old maps useless and obsolete. If you make maps of any kind intended for download and play you need to be made aware of this issue.
If you are bouncing between two different locations, there may be still other bugs related to spawning behavior as there are several different places where spawn points are derived and calculated. Strangely, the spawn point is calculated by the biome weather generator, but it is also set by beds and may even be set by some other areas of the game. It definitely needs a serious code review.
Version 2.1 now updated for MC 1.6.2
If you need a quick and dirty fix to recommend to folks, you can download the WorldGen API that I've posted on my SkyZone thread and put the gt.class file into the "minecraft.jar" file (the other classes shouldn't do any damage except for some conflict issues I know about regarding MC Forge). All I've done with the class is to remove the fuzzy spawning and replacing it with spawning at the precise spot... like used to be done with traditional SSP in 1.2.5 and earlier.
I really hope this class gets a solid code review and is updated for 1.3.2. Please don't let this wait until 1.4.x to be fixed!
The odd part that I don't understand is why adventure mode gets a pass on this as a spawning issue, but custom survival maps are ignored? Some sort of internal map project with the Mojang developers must have noticed this was an issue, so some programming effort was expended to "turn it off" for at least adventure maps.
Version 2.1 now updated for MC 1.6.2
This is great though. Probably the easiest fix.
I also made a mod that fixes this bug, for those who may find this an annoyance and just want a work around:
http://www.minecraftforum.net/topic/1436789-132131-fallfix-mc-bug-patch-for-spawning-spmp/
One of the problems is that the code being used to calculate the spawn location already does this, only it comes from the world generator subroutines. They may even "fix" this problem by trying to find a suitable location by simply generating a large flat area where a pure vanilla map never has problems.
The problem here is that the subroutine takes that location and then randomizes it even further, without doing any sort of checking that it might be "safe" other than adjusting the y position.... which it does a lousy job of doing as well and even that step is buggy. Setting the default spawn location with MC Edit doesn't help as that default location saved in the world data file is what gets manipulated here.
Version 2.1 now updated for MC 1.6.2