EmptyStar / asuna

A Minetest game of vibrant natural wonders
Other
13 stars 4 forks source link

Bats are annoying #58

Open sem-geologist opened 1 year ago

sem-geologist commented 1 year ago

I already filled the issue at animalia, but probably version of animalia in asuna is embedded and deeply connected with biomes. So here the excerpt: #

AFAIK bats do not like bright light IRL. With current Animalia bat implementation It is impossible to keep my very well light dungeons clear from bats (I know there is the option to turn off guano production as that is the most annoying aspect from that, but logically bats should not spawn in well lit places (i.e. underground lab) at all), as they spawn inside my sealed spaces under 0 height. One of building has its floor at 0 with well light space, and bats spawns there. It looks currently bats can spawn even in the sunlight (light 15), as there is only min_light defined to 0, and no max_light (which in creatura lib defaults to 15).

So i suggest to add max_light = 7 for bat spawning (maybe some other value, but clearly bats should not spawn in well lit spaces, or settle and make a mess just few blocks above any light source). With fixing that issue the max_height=1 limit could be lifted. Bats normally should spawn in any dark cave (those in mountain side too, if it is dark enough).

I had testested our game with such hardcoded modifications and bats tends to appear at lighted places significantly less often. Also raising max_height limit to 128 makes bats to appear in caverns of mountains and at darkness of dense and darkening cannopy of trees - thus a nice touch I think. I think it would be useful to make these tweeks to Asuna, eventually max_light parameter could be exposed to be configurable. The biggest problem with bats is their dung, which destroys any walk-able nodes (crystals, rails, torches, water, lava source, mese lines....). vanilla Animalia has this user configurable option to switch that off. The caverns in vicinity of base gets completely littered with guanno. I still can't understand bats settling for sleep directly above the torch. Exposing guanno generation switch would be also wishful feature.

EmptyStar commented 1 year ago

I didn't realize bats could be such trouble. If you want to share your modifications, pull requests are welcome. It's not a bad idea to have bats spawn only where it's dark, and as long as it's not terribly difficult to implement, I'd be willing to entertain the idea.

The version of Animalia included with Asuna has had modifications to better integrate with Asuna's many biomes, and I'm open to tweaking it further as long as it still functions as expected and remains compatible with its original implementation. I believe it's one release behind the latest release of Animalia on ContentDB.

As for exposing the mod settings, I'm less willing to expose too much in the game settings. I don't want to clutter the settings with too many options, and I'd rather have a more sensible guano implementation that doesn't cause damage and maybe expires naturally generated guano after a time. I feel like there are probably more elegant solutions to this problem than an on/off switch, and solutions that upstream Animalia may benefit from.

sem-geologist commented 1 year ago

I think spawning between 7 and 0 light is good range. Also increasing the height up to 128, should nicely play with some future spooky biomes (everness, these forsanken with temple/old something structures...). Actually I found that animalia has hidden protection against the guano, it checks if node above ground is not protected. I think that is not very elegant, as 1) protection mods are more common in multiplayer games, in single player games there is normally no need for protection; 2) in multiplayer if someone would want to protect the bat-guano farm from grieving it would brake the farm. Thus I would replace that protection check with checking the light with get_node_light minetest function and would allow to produce guano only if light is below 6. This way only if there is light from 0-5 guano can be produced. - that way player can protect from guano by moderately lighting the spaces where guano is not welcome, or make dark stone surounded dark spaces for guano farming if it is to be used as fertilizer. I also add check for light in function for setting home position of bat (place where it rests at day) - it should stop resting just above torch (added criteria: light < 8). Maybe I should increase it a bit so bats should be able to rest under trees. stricter criteria for guano production would prevent it from messing under the tree.

I will make PR, but please do not merge, let me and kids test how that works.