Different spawning methode for mobs

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Different spawning methode for mobs

by burli » Fri Jul 29, 2016 14:26

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?
 

User avatar
everamzah
Member
 
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah

Re: Different spawning methode for mobs

by everamzah » Fri Jul 29, 2016 15:30

LBMs and NodeTimers?
 

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Re: Different spawning methode for mobs

by burli » Fri Jul 29, 2016 16:24

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)
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

Re: Different spawning methode for mobs

by Byakuren » Fri Jul 29, 2016 18:04

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.
Every time a mod API is left undocumented, a koala dies.
 

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Re: Different spawning methode for mobs

by burli » Fri Jul 29, 2016 18:40

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.
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

Re: Different spawning methode for mobs

by Byakuren » Fri Jul 29, 2016 21:02

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.
Every time a mod API is left undocumented, a koala dies.
 

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Re: Different spawning methode for mobs

by burli » Sat Jul 30, 2016 06:48

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
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

Re: Different spawning methode for mobs

by Byakuren » Sat Jul 30, 2016 07:36

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.
Every time a mod API is left undocumented, a koala dies.
 

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Re: Different spawning methode for mobs

by burli » Sat Jul 30, 2016 09:14

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
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

Re: Different spawning methode for mobs

by Byakuren » Sat Jul 30, 2016 10:21

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.
Every time a mod API is left undocumented, a koala dies.
 

DcNdrew
Member
 
Posts: 14
Joined: Tue Jul 26, 2016 03:12

Re: Different spawning methode for mobs

by DcNdrew » Mon Aug 01, 2016 08:07

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?
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 22 guests

cron