Smooth lighting

March 10th, 2012 - 12:06 am

As mentioned briefly in the last blog post, I’ve been working on smooth lighting. That’s now complete and working as well as I think I’ll get it to. Check out these comparison screenshots:

Click to enlarge Click to enlarge

Click to enlarge Click to enlarge

As I also mentioned in the last blog post, this was somewhat inspired by the Project Zomboid programmer adding smooth lighting to that game (and now I notice that they also posted some comparison screenshots just yesterday!). I believe he accomplished this by overlaying a multiplied and untextured polygon that completely matches the shape of each ground tile, with the vertices of that polygon set to color values that create a smooth transition. I tried this as well, but wasn’t quite able to get the same results, and switching the OpenGL blending between normal mode and the multiply mode each frame also added a bit of overhead, so I went for a simpler method where I just supply the smoothing color values to the vertices of the sprite itself, skipping the overlay entirely.

The Project Zomboid method results in much smoother lighting on the ground (there really aren’t any hard edges at all), while my method still retains some of the per tile lighting, which I kinda like. It’s sort of halfway between the old X-COM hard lighting and the completely smooth lighting of Project Zomboid. I’m adding a toggle to the options menu to turn smooth lighting off if you prefer the old school hard edges.

Development Video #16

March 5th, 2012 - 6:53 pm

Clicky, clicky:

Watch it in HD!

New stuff in this video:

  • Wall decorations
  • Some more art assets
  • Light sources can now be added/edited in the map editor
  • Light sources can also be “baked” into the map to avoid having to calculate shadow casting for static light sources
  • Added the Remote Trigger
  • Integrated some more of the scripting language so that light sources and elevators can be toggled off/on
  • Added a briefcase with money to your inventory showing how much cash you’ve got

Work continues on the female character sprites for getting shot and killed, and I’m almost done with the doubling of male character aiming and shooting sprites. I also just today managed to improve the lighting engine to allow for more smooth lighting (partially inspired by the great work done by the Project Zomboid guys), but that’s still work-in-progress, which is why I’m not showing it in this video. I’ll put some screenshots up when it’s worth showing.

And then there’s the big elephant in the room: AI. It’s quite a daunting task, since so much of the game will be about manipulating NPCs, and I’ve only briefly jotted down some ideas. I recently finished Batman: Arkham Asylum (can’t wait to get my hands on Arkham City!), and the reactions of the NPCs in that game is somewhat of an inspiration – especially how the thugs would freak out the more of them you picked off. But I’ll probably write a separate blog post on AI at some point, so I won’t go more into that now.