Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

Slime Spawning


  • Please log in to reply
313 replies to this topic

#1

trunkz
    trunkz

    Redstone Miner

  • Curse Premium
  • Curse Premium
  • 559 posts
  • Minecraft: taurose

Posted 17 June 2011 - 10:25 AM

Related Topics

Tool (NEW!):
http://www.minecraft...pawning-chunks/

Old discussion:
http://www.minecraft...mes-spawn-here/
http://www.minecraft...mes-spawn-here/
...

Theory
1.5 Changes
- Spawn rate in swamps reduced; now depends on lunar phase

1.4 Changes:
- Slimes also spawn in swamp biomes

1.0.0 Release Changes:
- height limit increased to 40
- bounding box check was added. As a result, instant suffocation or trapping techniques don't work anymore. See slime sizes for minimum spawning room.


Spawning:

Slimes can now spawn both in swamp biomes as well as in slime chunks. The two spawn conditions require different heights:
- Swamp Biome: 51-69
- Slime Chunk:  0-39

While chunk spawning always has a 10% success rate (not taking slime chunk chances or anything else into account), the success rate of swamp spawning depends on the light level (just like it is with hostile mobs) and the moon phase:

Spawn Rate = 50% * [Light Factor] * [Lunar Phase Factor]

Light Factor:

- Level 8: 0.0%
- Level 7: 12.5%
- Level 6: 25.0%
..
- Level 1: 87.5%
- Level 0: 100%

So they can't spawn overground during daytime.



Lunar Phase:

Day 1 (Full Moon): 100%
Day 2: 75%
Day 3: 50%
Day 4: 25%
Day 5 (New Moon): 0%
Day 6: 25%
Day 7: 50%
Day 8: 75%
Day 9 = Day 1 (Full Moon): 100%
....


So assuming you get the light level to 0, the average spawn rate in swamps is 25%.

As for chunk spawning, the Random Seed of your world determines in which chunks slimes can spawn. In average, slimes can spawn in every 10th chunk. I have written a small java tool to determine these chunks for your world (i.e. its seed). See link above.

Some other facts:
- slimes share mob limits and most of the algorithm with other hostile mobs. So if you want to make a productive farm, light caves and the surface as well as your farm. It should also make a tiny difference to prevent slime spawning in other eligible chunks (see below)
- if the game decides to spawn hostile mobs, it randomly chooses one. Every mob, including slimes, has the same chance. But there is an additional 90% chance for slimes not to spawn (even if inside an eligible chunk). So theoretically it's more like 1:10:10:10:10:1 (slime:(skeleton) spider:creeper:skeleton:zombie:enderman). Also, slime spawns will fail more often due to the height and chunk limit (see below)
- slimes spawning in slime chunks don't need light and spawn only below level 40 (the air block must be 39 or below, so the ground they spawn on must be 38 or below which results in a minimum f3 coordinate of 40.6 while standing on that ground)
- Sizes:
Small Slime: 0.6x0.6x0.6 (needs 1x1x2 room to spawn or 1x1x1 if block above is not opaque)
Medium Slime: 1.2x1.2x1.2 (needs 3x3x2 room to spawn)
Big Slime: 2.4x2.4x2.4 (needs 3x3x3 room to spawn)
- every slime size has the same chance to spawn (33%)
- there's no bigger slime ingame (despite what the wiki says). It's easy to mod them in though, as their size is determined by an internal number, which also affects their damage, health, splitting behaviour etc (might be a lazy way for them to add a boss monster Posted Image)

Slow Spawn / Why you need to mess with your world

The game tries to spawn mobs every tick (0.1s). It completely skips specific mob types (water, hostile, neutral) if the limit has been reached or the game difficulty is on peaceful for hostiles. This is actually the only time that limit is checked, which is the reason why much more mobs can potentially spawn in a single tick (>1000).
Then it consecutively goes through every chunk (17x17 = 289!) around the player(s) in a random order, picks a random mob of that type and a random spot in that chunk. If the spot meets some criteria, the game tries to spawn up to 4 mobs around and possibly on that spot. Just before spawning, there's some additional checks depending on the mob. For slimes, it first checks if the position is in a biome and between level 50 and 70. If so, it calculates a probability depending on the light level (see above). If that roll passes, a slime will spawn. If the roll failed or the biome and height conditions weren't met, it'll check if the position is in a slime and chunk and below level 40. If that's true, there's a 10% chance for a slime to spawn.

Assuming you have a one chunk-wide spawning floor (16x16):

Scenario 1, natural world:
There's plenty of spots all around you for hostiles to spawn with low or zero light. Might not even take a tick for the limit to be reached again, meaning your chunk only gets called once after the mob count goes below the limit. There's a chance of 20% that the game decides to spawn slimes. Then there's only a chance of 1/128 = .7% (=> 20% * .7% = .14%) that it picks a spot on your floor. And also, the 90% bailout decreases your chance (less transparent because of the group spawning algorithm, so I can't give numbers).
Because of despawning of hostiles other than slimes, the algorithm kicks in every few seconds, I'd say.
Also, switching to peaceful might only cause some additional calls, so no magic Posted Image

Scenario 2, world lit up:
Since no other hostiles can spawn, the algorithm gets called every tick until the limit is reached only with slimes.

Note that even the numbers I gave aren't exact, because group spawning can also traverse chunks and height levels to some degree.
Anyway, hope it clarifies why it takes so long and why you need to mess with your world to get a decent spawning rate.

Posted Image


Register or log in to remove.

#2

gooscar
    gooscar

    Iron Miner

  • Members
  • 305 posts
  • Location: Climbin' in yo' windows, snatchin' yo' people up

Posted 17 June 2011 - 10:35 AM

Just to add, they require 9x9x5
Knowledge is often mistaken for intelligence. This is like mistaking a cup of milk for a cow.
Posted Image

#3

Sweet Ride
  • Location: USA
  • Minecraft: Sweet_Ride

Posted 17 June 2011 - 10:43 AM

View Postgooscar, on 17 June 2011 - 10:35 AM, said:

Just to add, they require 9x9x5

I do not believe that is true. The wiki SUGGESTS a SPAWNING ROOM of that size. It does NOT state that that is what is REQUIRED for them to spawn. Also, thanks for clearing that up OP. I do not feel this tool is cheating, seeing as it is very time consuming, and mostly not worth it to determine the chunk in which slimes can spawn without a tool.

@OP, could we also see the code? All of the code in which you determine your facts. I myself can check it myself, but I am too lazy to look, and some other people may be curious.

#4

Beige
    Beige

    Carpenter

  • Members
  • 45 posts

Posted 17 June 2011 - 10:46 AM

I occasionally encounter slimes in my strip mines which have widths of 1 and heights of 2.

#5

Sweet Ride
  • Location: USA
  • Minecraft: Sweet_Ride

Posted 17 June 2011 - 10:54 AM

View PostBeige, on 17 June 2011 - 10:46 AM, said:

I occasionally encounter slimes in my strip mines which have widths of 1 and heights of 2.

Yes, but they are small slimes or medium size, no? We're talking huge slimes for spawning rooms, seeing as you WANT huge slimes. :P

#6

Moleculor

Posted 17 June 2011 - 11:05 AM

View PostSweet Ride, on 17 June 2011 - 10:54 AM, said:

Yes, but they are small slimes or medium size, no? We're talking huge slimes for spawning rooms, seeing as you WANT huge slimes. :P

No. I've had huge slimes spawn in a 1x2 space. They then immediately self-destruct due to being stuck inside rock. But they do spawn.

#7

trunkz
    trunkz

    Redstone Miner

  • Curse Premium
  • Curse Premium
  • 559 posts
  • Minecraft: taurose

Posted 17 June 2011 - 11:07 AM

View PostSweet Ride, on 17 June 2011 - 10:43 AM, said:

@OP, could we also see the code? All of the code in which you determine your facts. I myself can check it myself, but I am too lazy to look, and some other people may be curious.

The two main parts are quoted here: http://www.minecraft...ost__p__5482388

While rand.nextInt(10) == 0 return true 10% of the time, chunk.func_334_a(0x3ad8025fL).nextInt(10) == 0, which is checked directly after, returns deterministic values depending on world seed and chunk coordinates. I think notch just added arbitrary numbers in.

It's easy to see the sizes:
Small Slime: 0.6x0.6x0.6
Medium Slime: 1.2x1.2x1.2
Big Slime: 2.4x2.4x2.4

These values might differ from spawning checks though. But it would mean that, for example, a big slime should fit into a 3 wide, 2.5 high (with slabs) tunnel..

Posted Image


#8

Underkover

Posted 17 June 2011 - 12:14 PM

Thanks alot :) this helped me to find the chunk spawned on and i now made a big room there :D
Posted Image <-- Click the picture for my Redcartocraft texture pack :)
Spoiler:

#9

Sweet Ride
  • Location: USA
  • Minecraft: Sweet_Ride

Posted 17 June 2011 - 12:23 PM

View PostMoleculor, on 17 June 2011 - 11:05 AM, said:

No. I've had huge slimes spawn in a 1x2 space. They then immediately self-destruct due to being stuck inside rock. But they do spawn.

It's a bug. I think it's because the game spawns all slimes at one size, and then randomly selects a size to put there, regardless of space. For instance, the game might spawn all slimes as a two high square, and then randomly select a size of slime to put there. Something like that, but I doubt that's how it works.

@Anyone I'm a bit confused. Your fist does one heart of damage now, instead of half a heart, as it used to. All slimes health except for small does not have half hearts, which means you can kill all size slimes with your fist and they will split, but does this mean you can kill small slimes and still get slimeballs? Or do you have to kill them with fire? I also want to know the outcome of them drowning, as it does one heart damage, and I've seen a video where drowning made small slimes drop slimeballs. Not sure if that's still the case.

#10

Mr_Pirate12321
  • Location: In the Man-Cave

Posted 17 June 2011 - 12:29 PM

View PostBeige, on 17 June 2011 - 10:46 AM, said:

I occasionally encounter slimes in my strip mines which have widths of 1 and heights of 2.
This is a strip mine:
Posted Image

Sorry, I had to or I'd be thinking about it all day.
Posted Image

#11

trunkz
    trunkz

    Redstone Miner

  • Curse Premium
  • Curse Premium
  • 559 posts
  • Minecraft: taurose

Posted 17 June 2011 - 09:24 PM

okay, I've looked into the code to see which room you need to spawn slimes. turns out, notch probably forgot to add boundary checks.
These usually are called here:

EntityAnimal.java
	public boolean getCanSpawnHere()
	{
		int i = MathHelper.floor_double(posX);
		int j = MathHelper.floor_double(boundingBox.minY);
		int k = MathHelper.floor_double(posZ);
		return worldObj.getBlockId(i, j - 1, k) == Block.grass.blockID && worldObj.func_28098_j(i, j, k) > 8 && super.getCanSpawnHere();
	}

This is what happens when the game determines extra conditions for animals. it checks for grass block etc, but note th super.getCanSpawnHere(). This is what calls the check for all living entities' boundary boxes before they spawn.
However, it's missing in EntitySlime.java:

	public boolean getCanSpawnHere()
	{
		Chunk chunk = worldObj.getChunkFromBlockCoords(MathHelper.floor_double(posX), MathHelper.floor_double(posZ));
		return (func_25027_m() == 1 || worldObj.difficultySetting > 0) && rand.nextInt(10) == 0 && chunk.func_334_a(0x3ad8025fL).nextInt(10) == 0 && posY < 16D;

	}
	

My best guess is, that notch forgot to add "&& super.getCanSpawnHere()" at the end of the return value.


So this means:
all you need to spawn them is one opaque (not glass, slabs etc) ground block, one air block above (this is the point where they actually spawn, should be lower than 16) and a non-opaque cube above that (air, glass, slab..). there are no distinctions for small, medium and big slimes. If you've got a 2 high ceiling, big slimes will automatically suffocate and split (hence you wouldn't see them unless you get them in sight very fast before they die). If you put a glass (probably affects slabs too) below, medium slimes get stuck in it, but they don't die (so no real use in this).

Posted Image


#12

Malacodor
    Malacodor

    Lapis Lazuli Collector

  • Members
  • 1022 posts

Posted 17 June 2011 - 10:56 PM

View PostSweet Ride, on 17 June 2011 - 12:23 PM, said:

@Anyone I'm a bit confused. Your fist does one heart of damage now, instead of half a heart, as it used to. All slimes health except for small does not have half hearts, which means you can kill all size slimes with your fist and they will split, but does this mean you can kill small slimes and still get slimeballs?
It doesn't matter how much damage small slimes receive, they will always drop their 0-2 slime balls. I usually kill slimes with arrows (2 hearts damage) and get slime balls.

#13

Jinzha
    Jinzha

    Lapis Lazuli Collector

  • Members
  • 972 posts

Posted 18 June 2011 - 08:04 AM

So, I need to download some sort of program I don't understand to find out where my world spawns slimes :( .

I really hope 1.7 fixes this!
Posted Image

#14

Crunkatog

Posted 18 June 2011 - 09:36 PM

View PostSweet Ride, on 17 June 2011 - 12:23 PM, said:

It's a bug. I think it's because the game spawns all slimes at one size, and then randomly selects a size to put there, regardless of space. For instance, the game might spawn all slimes as a two high square, and then randomly select a size of slime to put there. Something like that, but I doubt that's how it works.

@Anyone I'm a bit confused. Your fist does one heart of damage now, instead of half a heart, as it used to. All slimes health except for small does not have half hearts, which means you can kill all size slimes with your fist and they will split, but does this mean you can kill small slimes and still get slimeballs? Or do you have to kill them with fire? I also want to know the outcome of them drowning, as it does one heart damage, and I've seen a video where drowning made small slimes drop slimeballs. Not sure if that's still the case.

I get slimeballs from punching small slimes in 1.6.6 SMP.

Drowning slimes drop slimeballs too.

I think it's odd that several times, I've been caught by surprise by slimes spawning in leaf blocks of trees in my basement farm, or somehow spawning on another block somewhere else and landing in the leaf blocks.

if it's true that slimes don't spawn on nonsolid blocks, and the walls of my basement tree farm are sheer without any cavities or shelves whatsoever, where are they coming from?

Posted Image


#15

Boxman
    Boxman

    Zombie Killer

  • Members
  • 205 posts
  • Location: In some crazy old dude's blue box
  • Minecraft: Overninek

Posted 18 June 2011 - 10:18 PM

This has been informative and full of SCIENCE! thanks OP.
Posted Image

#16

trunkz
    trunkz

    Redstone Miner

  • Curse Premium
  • Curse Premium
  • 559 posts
  • Minecraft: taurose

Posted 21 June 2011 - 10:50 AM

I've just read through the changelog to figure out why people are saying this was fixed. I couldn't find anything saying that this was even a bug. So I'm guessing it might be intended after all.
I'm just wondering about the bounding box thing...

Posted Image


#17

rodabon
    rodabon

    End Dweller

  • Members
  • 7187 posts

Posted 21 June 2011 - 04:13 PM

View Posttrunkz, on 21 June 2011 - 10:50 AM, said:

I've just read through the changelog to figure out why people are saying this was fixed. I couldn't find anything saying that this was even a bug. So I'm guessing it might be intended after all.
I'm just wondering about the bounding box thing...

Question:  If a large slime is 2.4, then if you make a 2 high spawning area with a glass ceiling it should still die and break into smaller slimes right?

Also, is there any discernable pattern of the chunks in relation to chunk 0,0 by any chance or is it really random by seed?
Re: 3D Minecraft - Anyone tried it?
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..

#18

Daimoth
    Daimoth

    Diamond Miner

  • Members
  • 897 posts
  • Location: USA
  • Minecraft: Vogner

Posted 21 June 2011 - 04:15 PM

View Postgooscar, on 17 June 2011 - 10:35 AM, said:

Just to add, they require 9x9x5
Not really. It's been documented many times that they'll spawn anywhere, even if it means they "drown" in the blocks they spawn in. I've seen it happen, and so have tons of others. If you're in a hotspot, slimes don't give a damn where they spawn. Bug or no, currently they need next to zero space to spawn.

The reason people assume that a lot of space is needed to spawn them is because usually they do. This is because, on average, it's going to take you a lot of mining before you see your first slime, unless you use that program that indicates slime-spawning chunks and mine into a hotspot right away.

That, and mobs in general are reluctant to spawn right next to you, which again means you'll need some space between you and the actual point at which a given slimes spawns. Some people get around this by camping in the shaft leading to the slime farm.

Anyways, I'm subscribing to this thread. I suggest the lot of you do the same, and link it in all of the slime threads that have appeared and will continue to appear.

View PostSmartie, on 18 June 2011 - 08:04 AM, said:

So, I need to download some sort of program I don't understand to find out where my world spawns slimes :( .

I really hope 1.7 fixes this!
It's currently impossible to tell beforehand without external software. The current bizarre spawning conditions are a programming compromise regarding the spawning frequency slimes had in patches past. They've spawned too often, not often enough, and finally this. Ironically, people now complain that they spawn too often and too seldom.
"Don't pay any attention to the critics. Don't even ignore them."
-Nicolas Negroponte

#19

Jefferist
  • Location: Behind you.
  • Minecraft: Jefferist

Posted 21 June 2011 - 06:18 PM

View PostMr_Pirate12321, on 17 June 2011 - 12:29 PM, said:

This is a strip mine:
Posted Image

Sorry, I had to or I'd be thinking about it all day.

Strip mines in Minecraft and strip mines in the real world are two totally different things.  In Minecraft, the image you just showed everyone would be called a quarry.  No need to be a smart ass.
-God Damn Banners for Mods and Suggestions-
-Quote by some guy you've never heard of-

#20

Daimoth
    Daimoth

    Diamond Miner

  • Members
  • 897 posts
  • Location: USA
  • Minecraft: Vogner

Posted 21 June 2011 - 07:37 PM

View PostJefferist, on 21 June 2011 - 06:18 PM, said:

Strip mines in Minecraft and strip mines in the real world are two totally different things.  In Minecraft, the image you just showed everyone would be called a quarry.  No need to be a smart ass.
There's also no need to get upset over nothing. Also, I'm pretty sure what you're saying about terms for different mines has never been established anywhere.
"Don't pay any attention to the critics. Don't even ignore them."
-Nicolas Negroponte