Jump to content

Recommended Posts

Posted (edited)

I've been spending some time trying to come up with a concept for a mod that lets players settle in areas and have it affect things like entities that will spawn, and some other factors.

My current concept was to use the map regions in the worldgen as the basis for doing this. What I want to do is basically give the region a "civilization score" that counts up as players build things and generally live in the area, then modify entity spawning to reduce enemy spawn rates based on how high that score is. The idea would be that out in the wilds you see wild bears and wolves often, and a small village might be harassed by a pack of hungry wolves, but those wild creatures are smart enough not to wander close to the huge city of people with walls and crossbows. I'd like to also be able to include region "spawn types" to add variety to what spawns (probably using some other mods to add in different types of monsters and wild creatures), but that's something I'd work on down the line a bit...

My main question for worldgen experts is: am I on the right track by thinking of adding the score to the map region? Can the entity spawning of a region/chunk change after worldgen or is it fixed? 

Any advice would be greatly appreciated.

Edited by Syhrus
  • Syhrus changed the title to Modifying map region info after worldgen
Posted (edited)

I found some information so going to post what I've worked out in case someone else treads this path after me.

Entity spawning is linked to the entity config, not the chunk, so I will need to modify the entity spawning behaviour first of all to look into the chunk data for the information I want to add. I can then store the information in the chunk or region using the moddata APIs.

Not at any working solutions yet but if I lose all interest and someone else finds this thread I'll have at least saved then a little time. For now the grind continues.

Something else to note is that chunks actually keep track of how many player-placed blocks are in a chunk, which will be handy for the civilization score.

Edited by Syhrus
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.