Suggested Improved spawning and behavior for mobs

xyrob

New Member
One of the biggest complaints I have with Minecraft is the way mobs are spawned.

In Minecraft, whether or not a location is valid for mobs to spawn in depends solely on the surrounding environment. In other words, you can build a huge fortress with massive walls, a mote, and tons of well-lit rooms. If you have an unlit room with a dirt floor somewhere, you'll get spiders spawning there.

It is really fun to build a fortress to keep out monsters, but not so much fun when they can just spawn inside your walls and completely bypass your defenses.

I've had an idea for a while as to how to improve this. It might be something to implement in Terasology:

---

Part I: Limit where monsters and other mobs can spawn

My approach divides the world into "known" and "wild" areas. In addition to the normal spawning rules, creatures can only randomly spawn in places that are "wild".

This is accomplished by adding a flag to every block location in the world (if mobs can only spawn in air blocks, this could be as simple as having two kinds of air). The flag is then set according to the following rules:

1. Locations which are observed by a player become "known".

In a realistic world, creatures can't simply appear out of thin air, they have to come from somewhere. The exact definition of "observed" would be one of the big things to tweak.

2. Unobserved locations are "wild" by default.

Since the player hasn't observed them yet, they have no way of knowing what was there to begin with. This makes them realistic sources of creatures.

3. Areas which are reached by creatures following valid paths can be re-marked as "wild".

If one creature could get in, so could others, so spawning them there is OK. A creature should have to actually reach the location for this to happen, at least if the player is watching.

Part II: Make known areas attractive to mobs, especially monsters

Obviously the above mechanism would significantly cut down on the number of mobs that get spawned in an active chunk. In order to offset this, mob path planning is adjusted to make them attracted to "known" areas.

---

This approach should result in a nice swarm of monsters outside the gates, wild animals in the wild, and the ability to build defenses that actually work.

Another interesting addition to this idea might be to keep track how recently each location was observed. All mobs would be attracted to locations that were observed a long time ago, simply to help reset them to wild, but only aggressive ones would actively seek out places the player had recently been.

There are still a few issues to figure out though, for example: What if the entire active chunk is "known"? Maybe send mobs in from the edges? What if part of the edges are inside the player's house?
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Hello and welcome!

This reminds me of some discussion back when we introduced biome-per-block. Since we ended up using a short for that we have a silly high 65k max biomes available with block-level accuracy. Way more than we need, but thanks to some optimization it doesn't really hurt much either.

My favorite example there is a cave near the surface. Image it is flagged as "cave" or even more exactly "cave in parent biome x" in case there is a difference between a cave in volcanic rock and one in a jungle. So you can make decisions on what to spawn there based on knowing it is a cave. Yay cave spiders in jungle or lava spiders in a volcanic cave!

But over time what happens if a player digs through the roof of the cave, exposing it to air? Maybe a very small hole wouldn't make much of a difference, but if the player set up a bunch of explosives leaving a part of the cave as more of a furrow in the landscape. At that point it surely shouldn't be cave anymore - and you could tweak the biome to say as much. Now that part isn't cave anymore and might spawn other stuff. Maybe over time in a jungle if enough plant growth builds up it can become more cave-y again, or if affected by serious erosion the loss of cave habitat could slowly sneak deeper in. Or you redirect a river into it. Poof! Underground river!

So yep this is entirely doable, and you could do something similar with "known" areas, or estates. Keep in mind though that not everything necessarily needs block-level accuracy, you might be better off just flagging whole chunks, or using an entity with a cubic selection to simply say "This area is x". Since we support infinite height you wouldn't end up with a silly column of "known" just because something was explored at one height level either :)

Another interesting application would allow for stuff like aquifers in rock layers that'll be able to flood a fortress should you dig it too deep near said water source ;)

Any interest in helping make this happen? :geek:
 

chessandgo

Member
Contributor
Hunter
"Since we ended up using a short for that we have a silly high 65k max biomes available with block-level accuracy"



*counts on hands and toes*


Thats means ill finally be able to have the aether, the twilight forest, mo biomes, biomes oplenty, biomes XXL, realistic world terrain gen, old world terrain gen, skylands, the bug world, and the book portal thing with out running out of IDs!
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
And a bunch more beyond that ;) It really is asking for somebody creative to put it to use in interesting ways!
 
Top