Creature Spawning

Creatures will regular spawn around the player at a rate depending on a number of factors, including biome, time of day, and number of active mobs.

Spawn Rates
Spawn rates vary throughout different biomes. The spawn rate gives the chance per tick/frame for an attempted spawn. A rate of 600 would give a 1 in 600 chance per frame for a mob to spawn.

Population
A mob cannot spawn if the total creature count exceeds the biome's population. Most entities will be counted as 1, whilst others may take up more, or less, e.g. A bat would only count as 0.5 This value can also be effected by other factors, such as night.

Spawn Rules
A mob will attempt to spawn each frame, if the spawn rate roll passes, and the population still has room to spawn. A random tile will be chosen as a spawn location, within 50 tiles away from the player, and at a distance of at least 15. The chosen tile must also be passable in order for the mob to be successfully spawned.

Despawning
If a mob has been off screen for longer than 10 seconds, and is not a boss or animal, then the creature will be removed, and will not drop any items. Some creatures will also despawn during certain times of the day, if on the surface.