Weird FOW/Lighting - picking issue?

0 favourites
  • 7 posts
From the Asset Store
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
  • I'm using tile based fog of war

    The FOW tiles lighten based on proximity & line of sight. Originally i had FOW tiles on the walls, but since the walls are obstacles the player would never have line of sight to the FOW tiles on them and they would always been invisible.

    So I removed the FOW tiles on the walls and instead had the walls become more or less opaque based on the opacity of the nearest FOW tile. It's working for the most part but in some areas the walls won't appear unless you're right next to them, or are really bright when they should be faded out/really dark when they should be illuminated, etc.

    Really have no idea what's going on here. Left click on adjacent ground tiles to move around.

    .capx

    drive.google.com/open

    [EDIT] And here's a picture of the issue I'm having

    drive.google.com/open

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You need to save the project as a single file and upload .capx file.

    .caproj is not enough to open your project.

  • Thanks, I updated the post, is it correct now?

  • The wall in the top circle on your screenshot is dark because event #17 picked a dark FOW sprite nearest to it (the one that's on the right with opacity 80). So the wall sprite opacity is only 20.

    And that FOW sprite is dark because there is no line of sight to it. LoS behavior checks visibility in a line from the origin image point of one sprite (player) to the origin image point of the second sprite (FOW). In this case there is just a tiny portion of the corner of the wall that's blocking the sight.

    The red oval on the right on your screenshot - the wall is bright because it's part of the same Inner_DS sprite. You can't change opacity for a half of the sprite :)

    Anyway, I think the method you are using is really ineffective and too complex. I would replace all those hundreds of sprites with a single tilemap and use a separate round mask sprite for FOW, pinned to the player. You can use a trick with a shadow and blend modes from this post:

    construct.net/en/forum/construct-2/how-do-i-18/how-do-i-make-an-enemy-line-of-130966

  • dop2000

    I was originally experimenting with a system like that, but it doesn't hide the walls, which is pretty critical for a dungeon crawler. The tile-based FOW is definitely the effect I'm trying to capture. Is there a way to improve the picking process to reduce errors? I know there has to be a solution because I've seen it done in games like Rogue Fable III.

    [EDIT] A tried experimenting with a FOV mask with shadow casting and the pixelate effect to simulate tile-based FOW, but it's just really not the effect I'm trying to capture. Is there any way I could have line of sight to a wall but not through the wall? Because I could easily work around that if there was a method for it.

    [EDIT-2] Another solution would be if there was a way for each wall tile to pick the lightest adjacent FOV tile. It might cause occasional errors were certain wall tiles are being highlight when they shouldn't be, but I'd take it.

  • You can fix some of the issues if you change collision polygons of solid spites (walls). Shrink them by just 1 pixel from all sides and LoS should work much better, corners will no longer block sight to tiles that are at 45 degrees from the player.

  • Thanks, working with the collision polygons did help, and after working with and simplifying the project I've gotten to the root of the issue. The lighting system will never work unless the player can have LOS to a wall but not through it.

    I need to have LOS to the wall to lighten the FOW tile on it, but I also need to not be able to see through the wall as that would defeat the purpose of having LOS in the first place. Is there anyway to accomplish that?

    Here's the simplified CAPX I'm working in trying to figure out how to accomplish that

    drive.google.com/open

    [EDIT] I tried building a "wall detector" with a shadow light and a large circle but it looks like overlap detection occur regardless of the casting appearance. There's gotta be some really simple way to detect whether or not a player has LOS to a wall.

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