Lighting in a Dungeon Keeper style game

Unity: 2021.3.4f1 (could upgrade / no problem)
Rendering Pipeline: URP

Hello,
For fun, I’m working on a game similar to Dungeon Keeper (3D) and have absolutely no idea how to fix the lighting problem because:

  • The map is one mesh that can be “extracted”, so it changes its shape
  • The map is a dungeon so there is no directional light like the sun … the only light source illuminating the dungeons should come from torches attached to the walls

Dungeon Keeper 2 screens for reference (found on google)


Found some gameplay on the Internet

My current progress (lit by directional light, which is not OK)

What I have tried / problems:

  • As I understand it, I can’t set my map as “static” and use lightmaps because the map is procedurally generated
  • The light from the torch should have a slight flickering effect.
  • For torches, I tried to use realtime spotlights but only 4 lights work. If I add another light, the previous one disappears.
  • I found a solution which caused the lights to disappear by changing the “Render Path” from “Forward” to “Deferred”, but it breaks the game’s performance
  • Lighting should be very atmospheric and dynamic, in addition, imps and other creatures should respond appropriately to lighting
  • As you can see in the game in DK2, the “cursor” also lights up the area

I am desperate because Bullfrog did this 25 years ago in his game without having so much computing power.

I appreciate any hint :wink:

You’re approaching the lighting from a modern perspective but it’s important to remember that the game is very old. It came out at the same time that NVIDIA was releasing their first GeForce card. Like the below reddit thread suggests it’s likely just changing the vertices of the world on the fly using the CPU since shaders didn’t exist yet.

https://www.reddit.com/r/gamedev/comments/hrz910/fake_lights_and_shadows_in_dungeon_keeper_2/

Hey, you’re absolutely right, but is that wrong?

So even after 25 there is no “hardware” solution for that and I need to calculate and fake this manually? I aware that many years ago some thing were done differently and there was need for many talented people who had to handle these problems - but nowadays I hoped that there is some smart and performant solution for that.

So the concept mentioned in the article suggest to use some “fake” lightmaps and shadows to colorize vertices / project them on the surface (walls, floor etc) and I guess it should be smart enough to blend them together. It sounds like a lot of struggle

I know about some modern DK2 successors like
War for the Overworld

https://www.youtube.com/watch?v=P4MKc3K-b4E

I see that this game is a lot darker and lighting is not so marvelous… but still it has torchlights and dynamic lights: light following cursor, lighting on “explosions” and magical events, pulsating lights in a “dungeon hearth”

If I analyze the torch lighting correctly, probably some of the fake “lightmaps” have blended into the wall and are a bit fainter on the floor … but I can still see many other examples of dynamic light and I just can’t believe they’re all calculated by hand.

I also see that they graphically use modern solutions of having normal / heightmap maps etc. so projecting or changing the colors of vertices will not work with these techniques.

I don’t get the problem. Just switch to Deferred and place as many lights as you want, as long as they don’t cast shadows.

The light limit comes from Forward rendering mode. You can increase it or switch to Deferred. I only recommend Forward for mobile games.

Hey, as I wrote earlier, I tried to change Forward to Deferred but it causes very slow performance. When set to Forward I have 270-290 FPS … but when I set it to Deferred it drops to 30 (and I only have 4 lights)

OK, to be honest, the machine on which I work, it may not be the best idea, because it is an “office” laptop with an integrated graphics card (Intel) … so is it possible that it has an impact and this configuration is not optimized to work in the “Deferred” mode which results in 10x lower performance? Sorry, I don’t have another computer to compare: /

I could accept 30 FPS, but this is just a map, and yet there must be enough logic, animations, particles, etc. … I must have some FPS reserve … … especially since as I wrote … 25 years ago it was possible in DK2 :wink:

// A few moments later…

You mentioned “shadows” … and in the Rendering Pipeline resource I found there is an option for “Additional Lights” and “Cast Shadows” … and if I uncheck it gives me 2x better performance (but no shadows … but I haven’t noticed any shadows before … so for now it’s OK

I also found that if I change the “Scope” in the spotlight from 10 to 5. I have another x2 better performance (and don’t see any difference).

I currently have 24 dynamic lights on a 90k vertex map and 80fps on my office laptop, so I guess it’s not too bad.

OK, then I understand that this Deferred "is not such a bad idea - I just wan’t to kown if tihs is not a wrong concept … just think about some optimization.

I would use Point lights for a game like this. You can turn shadows/shadowmaps on/off per light.

If it’s a game for desktops, even 10 year old PC’s should be able to handle 15+ lights that don’t cast shadows with 100+ FPS.