Insane96 / EnhancedAI

Creepers Breaching, Zombies Mining and Skeleton Sniping
https://www.curseforge.com/minecraft/mc-mods/enhanced-ai
20 stars 6 forks source link

[Enhancement] Mobs afraid of sculk biomes #150

Open Barerock opened 7 months ago

Barerock commented 7 months ago

Describe the feature request
Sculk is a deadly "lifeform" and is advertised as such ingame and through whatever lore tidbits we get elsewhere. Mobs are already forbidden from spawning in deep dark biomes; however, they spawn around the edges and freely move around. This isn't a problem for the mobs, but is a severely unbalanced issue for players venturing into the deep dark. Mob sounds do not trigger the sculk, but when a swarm of mobs, especially those modified by Enhanced AI, tries to fight the player many things can go wrong that I believe are unrealistically difficult to avoid.

The deep dark is meant to be deep and dark. Devoid of life and yet still very dangerous. Enhanced AI could provide this somewhat concise modification to improve the playability of the region with the mod enabled and also to fix a weird unfixed problem with the game.

This solution would rely on mobs being repulsed by the border of sculk generating biomes rather than the blocks, and/or when outside a sculk biome from the naturally occurring sculk organs. Whatever implementation, I believe this to be a neglected issue by Mojang rather than an impossible feat. Repulsion checks are already part of the base game and aren't terribly laggy. Unless a player has unreal mob cap levels that are modified by something else, I don't think this would cause performance issues, especially with the modern suite of performance mods available.

Screenshots
image That's a LOT of mobs directly under where my player was last in survival!

Insane96 commented 7 months ago

Repulsion checks are terribly laggy. Animals fleeing is the heaviest feature of the mod

Barerock commented 7 months ago

The mod works, and I see much more lag regarding pathing and collision between a dozen mobs than anything else, even with hundreds of mobs fleeing at once sometimes.

Regardless, the deep dark is very far down and this feature, like all the other potentially laggy features, can be toggled. It only is effective when the player is within spawning radius of a deep dark and even then there are fewer mobs near the area of effect than the full cap because the deep dark itself prevents the mobs from spawning in it, thus granting a natural lag prevention buffer. More mobs will spawn around the biome because of spawning rules, but most will be nowhere near the edge and hopefully would be able to path check the biome in order to avoid active repulsion checks, which is something else I didn't think about. I'm not sure how laggy pathing is, it seems to be either infinitely capable and nearly non-functional simultaneously.

If sculk is changed as a block mobs refuse/can't path over, that'd make the biome edge more secure, perhaps this could be a secondary performance toggle to the main repulsion feature I'm suggesting.

Barerock commented 7 months ago

And as a slight addendum, perhaps it would be possible to avoid repulsion checks entirely by mimicking how mobs behave at block drops for sculk blocks. Making a sculk block read as a 20 block drop or something else unpathable (rails), like previously mentioned, could totally prevent excess pathing lag but maintain the feature if at a "realism" cost.