Open MarkuBu opened 6 years ago
I'm thinking that spawning is dependent on each monster/entity and therefore, likely not easily solved in a more general level.
IOW, we can maybe abstract this and create various generic spawning strategies, but entities should be able to contribute their own ...
Let me quote myself from a similar discussion:
I want to suggest a different solution to mob spawning.
Low-frequent randomized spawning is cool to keep things interesting over a longer period of time, I guess.
But what’d be really interesting would be to spawn mobs into the world not by timers and chance but according to a noise pattern. This noise pattern can be based on the world seed so that it’s reproducable, just like the map itself. The mobs should never expire but death be permanent. >The spawning process should use thematized by use of biome checking. This is cool for several reasons:
Immersion will increase as players need to take care not to exterminate flocks of animals forever in a region, but instead hunt responsibly and perhaps nurture the population as well.
Players will be able to refer to not only good map spots but good mob spots by position and seed only.
Moar
https://github.com/minetest-mods/mob-engine/issues/31#issuecomment-493704232
Yes, I know - I agree 100%.
But that doesn't change that spawning should be something modular and entity dependent - This is why there is no code in this project for spawning.
It's not right to put spawning code in this project because regeneration of entities has no relationship with how they behave in the world other than reproductive behavior. Now, the code in this project can already easily handle reproductive behavior (just create gender properties and some sort of attraction and pregnancy primitives and spawn a baby entity when appropriate. But that's not what spawning is about.
It's not right to put spawning code in the entity behavior code, since different games will want to likely use the same entities but vary the spawning of them - e.g. they might vary rarity or biome dependencies.
So then logically spawning is an external layer that spans different entities. It will have to have access to many pieces of information, and some of it may be in the entity tables, since, obviously that would be the right place to define entity specific bits, but it totally doesn't need to be.
So for now I think this can be a separate thing until we get a better idea if this should be something more integrated or not - for instance if it needs to know better about positions of existing entities. We certainly want to accommodate that, of course.
I fully agree. All these ideas should go into a spawn layer mod then.
How should mobs spawn? You have no spawn code in the engine. Should this be done in mods or do you want to add this to the engine?