Open-source port of PoP that runs natively on Windows, Linux, etc.
Moderator: English Moderator Team
7 posts • Page 1 of 1
I was thinking it would be cool if lighting would be more modern (example; mirror). I very briefly looked into it for SDL, but it's too complicated. If I'm not mistaken, it would require rendering the entire scene to a texture (*), then pixel manipulation (*,*) to add a black layer of 50% opacity, excluding 200px circles around flames. If each scene only had 1 flame, I could've probably pulled it off by using a large, partially transparent, image. Of course, the 'real' way to do it would be a 2.5D side-scrolling remake in a modern game engine. Then adding the light sources would be relatively easy. Actually, that would be Prince of Persia Classic then, I guess.
Here is my attempt on a separate branch: https://github.com/NagyD/SDLPoP/commit/ ... 2e72e9cfd8
I did not use per-pixel manipulation, only an image of a circle, and clever use of blend modes.
BTW, the Genesis version has something similar, but it's only a background: https://www.popot.org/level_editors/ima ... p-0.7b.png
Also, I have seen a few 2D games that do lighting, like SuperTux, or ZZT in dark rooms.
[Edit: Suggestion, maybe if a room has no torches at all, make everything even darker. Or maybe the number of torches could determine how dark the room is? Either way, I really like this. This should totally make it into the main branch (as an option)...]
I made lighting an INI option: https://github.com/NagyD/SDLPoP/commit/ ... 693883f282
I merged this into the master branch: https://github.com/NagyD/SDLPoP/commit/ ... 76356aa79cNorbert wrote:This should totally make it into the main branch (as an option)...
Suggestion: maybe we could use a noise function (e.g., 2D Perlin noise) to generate a couple of animation frames with varying amounts of darkening, in order to simulate a flickering effect. The radius of the effect would then probably have to be a bit bigger, and the intensity would have to smoothly decrease with distance to the torch.