Page 1 of 1
Different spawning methode for mobs

Posted:
Fri Jul 29, 2016 14:26
by burli
currently mobs are spawned by an ABM. The problem with this methode is, that it only works for default maps. If mods like ethereal or valleys change the ground nodes, the spawn rate drops dramatically and you have to add more nodes or groups to the ABM
Using more generic parameters like "group:stone" doesn't solve the problem because then monsters can spawn e.g. in cobblestone buildings. Then the ABM has to check for ground content
Is there any other possible methode to spawn mobs than ABMs?
Re: Different spawning methode for mobs

Posted:
Fri Jul 29, 2016 15:30
by everamzah
LBMs and NodeTimers?
Re: Different spawning methode for mobs

Posted:
Fri Jul 29, 2016 16:24
by burli
everamzah wrote:LBMs and NodeTimers?
LBMs also search for nodes. So if you change the combination of the nodes you also change the spawn rate
Plus LBMs return all nodes and you have to search for neighbors yourself. Plus LBMs only run once at mapblock load
Currently I have no better idea than ABMs, but use more generic descriptions like "group:stone" and check for ground content (if not water or air)
Re: Different spawning methode for mobs

Posted:
Fri Jul 29, 2016 18:04
by Byakuren
You could also have mob spawning be player-based like in Minecraft, where mobs can spawn on anything solid with the right light level as long as it's distance from the player is within some range.
Re: Different spawning methode for mobs

Posted:
Fri Jul 29, 2016 18:40
by burli
I like the idea of area specific mobs like the treemonster. Wouldn't be possible if just light level and maybe height are relevant
I think I will try to optimize the ABM methode, if no one else has a better idea.
Re: Different spawning methode for mobs

Posted:
Fri Jul 29, 2016 21:02
by Byakuren
burli wrote:I like the idea of area specific mobs like the treemonster. Wouldn't be possible if just light level and maybe height are relevant
I think I will try to optimize the ABM methode, if no one else has a better idea.
You can still have area-specific mob if you check what you spawned them on top of and spawn appropriate mobs. This will require registering the mobs globally so you can get a list of mobs you can spawn.
Re: Different spawning methode for mobs

Posted:
Sat Jul 30, 2016 06:48
by burli
Byakuren wrote:burli wrote:I like the idea of area specific mobs like the treemonster. Wouldn't be possible if just light level and maybe height are relevant
I think I will try to optimize the ABM methode, if no one else has a better idea.
You can still have area-specific mob if you check what you spawned them on top of and spawn appropriate mobs. This will require registering the mobs globally so you can get a list of mobs you can spawn.
Ok, it is a vicious circle. As long as we don't have biome and other informations we need to search for nodes. This sucks
I will rewrite the ABM and some other things for my mod
Re: Different spawning methode for mobs

Posted:
Sat Jul 30, 2016 07:36
by Byakuren
The player-based approach makes mobs that spawn anywhere less expensive. With only ABMs you would need to make an air ABM to have mobs spawn regardless of node.
Re: Different spawning methode for mobs

Posted:
Sat Jul 30, 2016 09:14
by burli
I don't see the difference. ABMs are player specific because only the blocks around the player are "active". Outside the active area nothing spawns
And you have to search for nodes where mobs should spawn.
I think ABMs are the best method, it has just to be optimized
Re: Different spawning methode for mobs

Posted:
Sat Jul 30, 2016 10:21
by Byakuren
The difference I mentioned is in making mobs that spawn regardless of node type. With ABMs, all mob spawning is tied to nodes. If you choose a location to spawn a mob without using an ABM, you don't have to spawn them on a particular node. This only helps with mobs that aren't tied to a node, though.
Re: Different spawning methode for mobs

Posted:
Mon Aug 01, 2016 08:07
by DcNdrew
If you know why mobs are spawn, you'll know how to make it.
In Minecraft, darkness makes hostile mobs, light makes friendly mobs (except bat).
In Minetest what do you want to spawn and why? Why do they exists? For example zombies. Are there graves? Bones underground? That's for skeletons too.
Animals: Is there grass? Are they biome-based? Do they need light? Can they spawn underground?