RigelEngine
RigelEngine copied to clipboard
Add an option to darken the background (leaving solid tiles, enemies and items unaffected)
When playing, I find it hard to focus on enemies and items since the background is just as bright as foreground elements. This is noticeable right away in the very first level of episode 1, but it's something I experienced on several levels.
Would it be possible to have an option that darkens the background tiles and parallax skies by 50%, but leaves solid tiles, enemies and items unaffected? Combined with the smooth movement option, this could provide better accessibility for the game.
I have a WIP implementation which is working well, but it darkens solid tiles as well: https://github.com/Calinou/RigelEngine/tree/add-darken-background-option It might not be a problem in practice, but I still need to make it a toggleable option before I can open a PR.
Without darkening | With darkening |
---|---|
![]() |
![]() |
Edit: The way I'm doing it also doesn't catch nonsolid tiles with partial transparency:
Ah that's a nice idea! Sounds good, I'm happy to look into it. Thanks for sharing your WIP implementation, I'll check it out as soon as I have time!
@Calinou
Edit: The way I'm doing it also doesn't catch nonsolid tiles with partial transparency:
Ah, the semi-transparent portions of the animated flames in that level are actually actors, not tiles. So to have them included in the darkening would require some kind of tagging as "background element", and then applying the darkening in the sprite rendering system.
See https://github.com/lethal-guitar/RigelEngine/blob/71161705a15122d729b527df71ac1120df6f57a8/src/game_logic/entity_configuration.ipp#L1959
To avoid darkening foreground tiles, you could have the color modulation in MapRenderer::renderBackground
instead of renderTiles
. Which tiles are solid doesn't always correspond to them being in the foreground necessarily but hopefully it does most of the time.