HellFirePvP / CustomMobs

CustomMobs v4.16
5 stars 9 forks source link

Custom mobs with cspawn set spawning too often #23

Open Sydael opened 8 years ago

Sydael commented 8 years ago

Hi, i'm not really sure what to do. I've set the spawn rate of each of my mob to 0.05, but they spawn way too often. I want them to have a 5%-1% of spawning in the biomes i've set, and also without a limit on how many can there be in the world at the same time. What setting should i change?

HellFirePvP commented 8 years ago

The spawnRate is related to other custommobs that are spawned, not related to the mobs that are spawned by vanilla minecraft.

If you don't mind i'm gonna copy a part of the "Configuration details" in on the plugin's description page:

(...)

"worldSpawnFrequency" (default: 5) Defines the tick interval of the worldspawner. The WorldSpawner tries to find valid spawn locations for mobs once each interval. The lower the interval, the more often the spawner executes and vice versa. The worldspawner handles the spawning of mobs that are defined via /cspawn.

"worldSpawnThreshold" (default: 256) The threshold at which the worldspawner will stop spawning mobs. Values between 16 and 512 can be entered. The higher this number, the less mobs will be spawned by the worldspawner overall and vice versa.

(...)

So, you might want to increase the threshold.

Sydael commented 8 years ago

I'm sorry. I'm not quite sure what will be the result. What i'd want is these custom mobs have a 1-5% chance to spawn in certain biomes. I don't want then to stop spawning completely after some time. I want them to have a very small chance to spawn each night.

HellFirePvP commented 8 years ago

If they'd not stop spawning, your world will be overflowing with mobs, no matter how "rare" you make them. Minecraft has the same system in place, but you can configure their "threshold" with the limits set in the spigot.yml or server.properties (i can't remember where).

increasing the "worldSpawnThreshold" will reduce the amount total amount of mobs spawned in the area where a mob would spawn. Adjust that high enough to create the effect you want to have, if 512 isn't high enough, well, i guess i can increase that with the next version.

This spawning system is designed to be vanilla-like. Meaning, like vanilla spawning, spawn as fast as possible until a certain threshold is met. That's how minecraft does it, that's how i do it; in order to create a similiar, "minecrafty" effect. If you want a spawning mechanism that constantly spawns endless mobs over your world, well, i suppose you need to get somebody to write that for you.

Sydael commented 8 years ago

Trouble is, when i set it to 512, and fly around, most mobs that spawn are those custom mobs. My world is overflowing with them. I'm not familiar with how minecraft does it, but is there a way to set it so that if a mob spawns, there is only a small chance for the custom mob to spawn instead of a normal mob? Also, they spawn at day. I would wish them to spawn at night only.

How about the setting: WorldSpawnerTickSpeed and WorldSpawnFrequency? What do they exactly do and would it help me to change them?

HellFirePvP commented 8 years ago

I untied the CustomMob worldspawning from minecraft's worldspawning when rewriting the plugin from v3.X to v4.0 - before that, hooking into minecraft's worldspawning is just a mess and caused a TON of issues, so replacing normal mobs when being spawned by minecraft's worldspawner is not feasible without creating more issues.

The day/night control is planned and will be added if/when i can find a proper way to add that functionality without making the /cspawn add command even more complex.

(Or maybe it was setting the threshold lower to decrease mobspawning? uhh....)

Sydael commented 8 years ago

I've noticed i had worldspawnerfrequency at 50 which made the custommobs spawn more often. Set it bac to 5, and they do spawn less often but still i'd wish it to be much less often. Also, in my opinion, the /cspawn command isn't complex as it is right now. The settings look clear to me.

HellFirePvP commented 8 years ago

the worldSpawnerFrequency doesn't affect the total amount of mobs spawned. also, increasing that config value increases the time interval when the spawner runs to reduce the performance impact on the server. increasing or decreasing that number will not affect how many mobs the plugin will spawn.

Well it is not complex now since i try to keep it as clean as possible eventhough it is already quite complex given you may specify regions, biomes and worlds with r:, b: and w: - if i would've added everything that was suggested until now to that command, i guess you can't even fit it into your commandline. I had people complain that the /cspawn command is too complex the way it is now and they don't understand any of it, so i fear adding more stuff to that one command as i think that it will move away from the original intention of having a plugin that allows for basic mob modifications with intuitive commands.

HellFirePvP commented 8 years ago

I'll think about possible options to further specify mobspawning conditions, but well. trying to not make it too complex.

Sydael commented 8 years ago

So again, the higher the treshold, the less often the custom mob will spawn, right? It won't make it stop spawning after certain amount of time, right?

HellFirePvP commented 8 years ago

increasing the threshold will decrease the amount of mobs spawned.

Imagine it like this: if a mob gets to be spawned, it'll see/collect the amount of mobs around. it will also look for the limit that's defined in your server settings, multiplies that by the total amount of chunks loaded in that world and divides that by the threshold-number. IF that number is higher than the amount of mobs found around the location where a new mob should spawn, it will spawn it, if not, it won't spawn it.

For more detail on the actual implementation, look here: https://github.com/HellFirePvP/CustomMobs/blob/master/src/main/java/de/hellfirepvp/spawning/worldSpawning/WorldSpawner.java#L63

So yea. increasing the threshold will kinda decrease the density.

Sydael commented 8 years ago

Okay thanks. Your plugin is awesome. Wish there was a different way in mob spawning - like i said, to set a small chance of a mob spawning near a player on a chunk load for a player or something

Problem with this max treshold of 512 is that once there's a day on the server, these custom mobs will spawn more frequent as there aren't that many mobs during the day. There's a lot of them during the day.

Keep up the good work

HellFirePvP commented 8 years ago

I'll see if/when i want to redesign the spawning...

I don't have much time to invest in developing stuff so the time i have leftover mostly goes into different projects. at least i'll keep maintaining this plugin and occasionally adding stuff - which i do now for over 3 years.