How do I create a tile based lighting system?

  • Thread Purpose: discuss tile based lighting systems in construct 2/3.

    My game has a fixed 64x64 tile system using the tilemap object.

    I created an array that holds a light value for each tile (example: index 10 on the array represents the light value for tile 10 on the tilemap).

    I created a system to update the light array based on certain events (spawning a new light source, building a wall, ect).

    Now this is the hard part. What is a good way to represent this data to the user?

    A silly solution would be a bunch of 64x64 black squares that individually change opacity based on the lighting array.

    I'm hoping someone out there knows some layer blending magic that can solve this problem elegantly.

    Bonus Points:

    I'm using a shadow caster tilemap to simulate line of sight for the player.

    It would be nice if the suggested solution was flexible enough to take over this function as well.

  • Just grabbed a random picture off of google as an example of a tile-based lighting system.

    In this picture its clear that the lighting is calculated per tile.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Alternative Question:

    Does anyone know of a way to change opacity of individual tiles within a tilemap object?

  • Put a second tilemap (light mask) on top of your main tilemap. With tiles ranging from transparent to 100% black.

    For better results you can add some blending effect to it, for example "Multiply".

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)