Static Lighting Generator 2

by DarkCampainger
Static Lighting Generator 2
Generate advanced soft-edge static lighting. Now using an EXE!
NOTE: This generator requires the 2010 version of the C++ runtime library. It only takes a minute to update, and the download is just 5MB. You can download the latest version from Microsoft: (x86 32-bit System) / (x64 64-bit System)

This generator creates a shadow image overlay for your map. It currently supports a top-down camera view or y-axis perspective view, floor and wall shading, and full-tile opacity. The image is static, and should be generated outside the normal play of the game. Keep in mind that large light maps will considerably increase the size of your resource file.

The included demo is all set up to generate maps. Just compile with the example map you want to generate, and click the "Generate" verb.

The system can be easily integrated into other games, so feel free to use the light maps in your projects. In fact, if you decide to use it, I'd love to hear from you! Of course, I would appreciate a link or short mention on your hub.

If you have any questions, comments, or find any bugs, feel free to post on my blog comments or the hub's comments.

Update History:

Version 2.3 (5/30/11) - EXE support, new method!

Transfered from GDI+ to libpng

Updgraded to filter-strip method

Now uses an EXE with a progress bar

Added shading of southward-facing walls

Support for rectangular icon_sizes

Added perspective-skew feature

Added number of generator options, including light falloff

Number of optimizations

Fixed blank icon bug

Fixed "eclipse" bug

Version 2.2 (3/31/11) - Bug Fixes and More!

Fixed faint "tile outlines" in shadows

Shadows are now properly symmetrical

Large radii values are now supported (just keep it on the map, and outside walls!)

Fixed duplication of last light

Added comments and cleaned up demo code

Added "Penumbra.dmm" example map to showcase the effects of different light source radii values

Version 2.1 (3/28/11) - Minor Update

Updated DLL's version information

Better error-handling

Version 2 (3/27/11) - Soft Shadows

Soft-shadow support added

Version 1 (7/05/10) - DLL Support

Transfered drawing over to an external DLL, greatly increasing the speed and ease of use of the generator.

Light maps are now saved directly into DMI files, instead of savefiles.

Arbitrary world icon-sizes now supported

Version 0 (8/21/09) - Original Release

Original release of Static Lighting Generator (1). Doesn't use a DLL, and generates hard-edge shadows. However, includes full generator source code.

runtime error: Unable to load library LightingGenerator.dll
proc name: generate (/lightGenerator/proc/generate)
usr: Kulex (/mob)
src: /lightGenerator (/lightGenerator)
call stack:
/lightGenerator (/lightGenerator): generate("lightMap_a.dmi", the wall (1,1,1) (/turf/wall), the wall (22,70,1) (/turf/wall))
Kulex (/client): Generate()
runtime error: bad icon operation
proc name: New (/icon/New)
usr: Kulex (/mob)
src: /icon (/icon)
call stack:
/icon (/icon): New(lightMap_a.dmi, null, null, null, null)
Kulex (/client): Load(lightMap_a.dmi)
Kulex (/client): Generate()
runtime error: bad icon
verb name: Load (/client/verb/Load)
usr: Kulex (/mob)
src: Kulex (/client)
call stack:
Kulex (/client): Load(lightMap_a.dmi)
Kulex (/client): Generate()

That bug appears, when I tried to generate light on demo map.
Kulex wrote:
runtime error: Unable to load library LightingGenerator.dll
runtime error: bad icon operation

That bug appears, when I tried to generate light on demo map.

What OS are you running?
I get that runtime as well. I'm running on Windows 7.
I think I found the problem.

Make sure you're running the latest version of the C++ runtime library. The hub description now has links to them.
I installed C++ runtime library and generator works good :)
Yut Put wrote:
When will the update that fixes the bug where it loads up an empty icon be uploaded? I've been patiently waiting for a while...

Sorry Yut Put, I know I promised you a quick update. Classes have been kicking my butt recently, and I haven't had time to finish it. I'll try to push that fix through this weekend.
Version 2.3 uploaded. Fixes the blank icon problem, and adds a number of new features. Check it out!

Next version (barring any major bugs) will feature semi-transparent walls and user-defined light shapes.
Amazing (:
Could you please release the source code of the exe application and dll files? I would really like to see it.
Can I get the source code for the program?