lethal-guitar / RigelEngine

A modern re-implementation of the classic DOS game Duke Nukem II

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add an option to darken the background (leaving solid tiles, enemies and items unaffected)

Calinou opened this issue · comments

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
2022-03-14_01 25 27 2022-03-14_01 23 21

Edit: The way I'm doing it also doesn't catch nonsolid tiles with partial transparency:

image

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

case ActorID::Flame_jet_1: // Rocket exhaust flame left

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.