[MC-10303] Slimes do not spawn at world spawn point Created: 26/Feb/13 Updated: 21/Jul/17 Resolved: 19/Mar/13 |
|
| Status: | Resolved |
| Project: | Minecraft: Java Edition |
| Component/s: | None |
| Affects Version/s: | Minecraft 1.4.7 |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Brad Corbin | Assignee: | Unassigned |
| Resolution: | Works As Intended | Votes: | 1 |
| Labels: | chunk, slime, superflat-world | ||
| Environment: |
Windows Vista 64-bit |
||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Confirmation Status: | Unconfirmed | ||||||||||||||||
| Game Mode: | Creative | ||||||||||||||||
| Description |
|
I made a custom superflat in creative mode using seed -6310548451344270339 (I used one layer of bedrock, one layer of clay). Spawn point is at (x=288,z=592). I created a fence grid on the chunk boundaries to determine where exactly slimes spawn. Available "slime finder" utilities (see http://www.minecraftwiki.net/wiki/Slime#Slime_Finding_Tools ) show valid slime chunks at (x=272,z=576) to (x=288,z=592) and (x=288,z=592) to (x=304,z=608). On a normal world, these chunks do successfully spawn slimes. On this superflat, though, no slimes spawn in these chunks (see red-marked areas in pic). Other slime chunks appear to work fine (left side of pic). So are these valid slime chunks? Or is this working as expected, but the slime finder utilities have an outdated algorithm, or are missing an exception for superflats? If so, can we have the corrected algorithm? Was this due to the slime spawning changes made in 12w25a? (Search found a possibly-related closed ticket, |
| Comments |
| Comment by Brad Corbin [ 01/Apr/13 ] |
|
Thanks, Markku, for your testing on this. This seems correct, as I tried to replicate the problem on several other seeds, but could never get it to replicate. I realize now I was testing other chunks besides the world spawn. |
| Comment by Markku [ 19/Mar/13 ] |
|
Created |
| Comment by Kumasasa [ 19/Mar/13 ] |
|
Markku, create a new ticket (refering to this one), then we'll resolve this. |
| Comment by Markku [ 19/Mar/13 ] |
|
I checked the code related to this, and while slime spawning has been made very rare (and there are changes for the higher level swampland spawning in 1.5, but not for lower level spawning), to the point of making testing this without adjusting the probabilities near impossible, the reason for the described lack of spawning is sort of an intended feature - the world spawn point is near those two non-spawning chunks and spawning is prevented on those areas. The idea behind this is probably to keep the spawn point somewhat clear/safe. The reason why all chunks worked on normal world is likely because the spawn point will be higher up (vertical distance matters, too), and slime spawning was tested on lower levels. However, that intended feature seems to be a bit bugged these days, when all games are server-based (and thus sort of multiplayer). Changing the solo-player's spawn point will not change the world's spawnpoint, which is the one used in the mob spawn test. Thus, the player's spawn point will be vulnerable to mob spawning, while that unused world spawnpoint messes up spawning in a seemingly random area (like in this issue). (I tested this by using /spawnpoint command to move my spawnpoint; nothing changed, issue continues.) Thus, I'd resolve this one with "works as intended" (as in, spawnpoint area is kept clear), and open up a new issue for the problem I described (i.e. using incorrect spawnpoint in the prevention check), as it affects all hostile mobs and game modes, not just slimes/super-flat. |
| Comment by Kumasasa [ 18/Mar/13 ] |
|
Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases. |
| Comment by Markku [ 11/Mar/13 ] |
|
That world/terrain type check is the very first logic check in the method, and its Random is generated properly (i.e. it should provide good enough randomness). I also expect that 75% skip chance to apply equally to every chunk (and every slime). The only explanation/idea I have had (and its related further test) I already explained earlier. |
| Comment by Brad Corbin [ 11/Mar/13 ] |
|
Right, but I would have expected it to give an equal 75% nerf in all (valid) slime chunks, and not to give a complete nerf to 75% of all slime chunks? (Not sure if that's really what is happening here, I don't think 75% of slime chunks are broken.) Unless the value of this.rand.nextInt(4) is somehow being determined by the chunk coordinates? So where exactly is THIS.RAND being created/initialized? Is it a global object, or is it initialized earlier in the EntitySlime.getCanSpawnHere() routine? Ah, I bet that's it. If the sequence looks something like (combining the wiki code and your code with a dash of speculation): EntitySlime.getCanSpawnHere() ... if (this.rand.nextInt(10) == 0) { //we're in a valid slime chunk }... //check for additional nerf for flatland, added in 12w25a If it looks something like that, then this.rand.nextInt(4) would always generate the same value in the same coordinates, so we'd end up with entire slime chunks non-functional, like I'm describing in the original ticket description. |
| Comment by Markku [ 11/Mar/13 ] |
|
The effect of that per-slime check would likely be that in its place, another mob type would be spawned (somewhere else?). I couldn't find other checks for world type in that code. And the chunk location check (for lower levels) is still the same as shown in wiki. From wiki "Spawn": "There must be no players and no player spawn points within a 24 block distance (spherical) of the spawning block". While that does not extend far down (unless the spawn point is at low levels), I would not rule out something like that affecting. I wrote one extra test case earlier, and I would now augment it with twist of "keep the player suitable away from the test area, e.g. at least 2 chunks away". |
| Comment by Brad Corbin [ 11/Mar/13 ] |
|
Jeff- Yes, high slime generation was pretty frustrating for flatlands, I believe this was changed back in 12w25a, the wiki mentions "Slimes spawning in Superflat world type has reduced." The problem is that we weren't provided with any details about how exactly slime spawning was reduced, and it certainly matters when using a "slime finder" and building slime farms based on the result. I'm not really contending that this is a bug in the game that needs to be fixed, but more of information that players/tool developers/wiki maintainers need to fix our slime finding methods for superflats. Markku, thanks for checking on that. As you mention, that appears to be "can I spawn this specific slime" code. What does the "is this a valid slime chunk" code look like? Does it have a similar test for WorldType.FLAT? I've pasted the formula from the wiki into an earlier comment, I'm not sure if it bears any resemblance to the game code. If the EntitySlime.getCanSpawnHere() code you posted is the only part that mentions WorldType.FLAT, do you have any theories on why those two specific chunks are non-producing, only on flatworlds? They also happen to be directly under the spawnpoint, if you think that might be relevant. I'll see if I can also do some further testing. I had already done a 2x2 test (just the 4 chunks to the right that should have had 2 slime chunks) and couldn't generate any slimes. |
| Comment by Markku [ 07/Mar/13 ] |
|
A bit of light: EntitySlime.getCanSpawnHere() ...
if (this.worldObj.getWorldInfo().getTerrainType() == WorldType.FLAT && this.rand.nextInt(4) != 1) {
return false;
...
That is, if the world type is superflat, there is a 75% chance it will just decide that no, not spawning that one. (Although that should only be per-slime check, not per-chunk). Also, there are different rules for spawning at surface levels than spawning on the lower levels. The wiki-formula only applies to the lower levels (below 40). There can be other things affecting it. For example, if one part of map spawns lots (due to it being so easy to spawn slimes there), when the algorithm gets to other parts, the maximum numbers have been reached already. I didn't check for this at all, just a quick example what sort of rule-tangles can affect the issue. I'd suggest a further test. Fill the chunks that now do spawn slimes (so that no mobs can spawn there), and see if the now-empty chunks would then get some slimes. |
| Comment by Jeuv [ 07/Mar/13 ] |
|
I think these are valid slime chunks but the reason that they spawn only little slimes is because of complaints that superflat worlds spawned huge amounts of slimes. |
| Comment by Brad Corbin [ 01/Mar/13 ] |
|
More extensive test with better results. Same seed and location as the other screenshot. The two left slime chunks are obvious, the top middle should be one, but has only spawned a very small number. The chunk on the bottom right should also be a slime chunk, according to slime finders. |
| Comment by Brad Corbin [ 27/Feb/13 ] |
|
Quick update: I did some further testing, and confirmed that these two chunks discussed above, (x=272,z=576) to (x=288,z=592) and (x=288,z=592) to (x=304,z=608), are valid slime chunks in a normal world (not superflat). I generated a world with the same seed, dug down to level 10, cleared out and lit up these chunks, separating them by fences. Slimes spawned in all the chunks indicated on the slime finder map. |
| Comment by Brad Corbin [ 26/Feb/13 ] |
|
The wiki page on slime generation lists the following as the formula used to calculate slime chunks: Random rnd = new Random(seed + I assume that this is the formula used by all the slime-finder tools. If this formula is no longer correct for superflats, that would be really handy to know |
| Comment by Brad Corbin [ 26/Feb/13 ] |
|
Note that the pillar holding the anvil in the screenshot corresponds to x=288,z=592, which is the center point of the slime finder map. There should be four valid slime chunks near the center, but only the left two appear to actually work on superflats. |