Inside Out, Day 5

 

 

Screen Shot 2013-03-15 at 17.27.34

Totally forgot to post yesterday, ah well. I made a lot of progress, but the only thing I specifically remember doing was adding the first sound effect – and I only remembered that because when it played this morning I scared the bejezus out of myself 🙂

Today I finally managed to get the field-of-view ‘shadows’ working. I’m quite pleased with the results, though the interaction with objects in the rooms could be nicer. As is often the way I went through several really complex methods that sorta worked before finding a nice, if brute-force-y ~50 line method that did the job perfectly.

The floor texture is modulated/blended with a series of light textures (radial gradient fading from opaque in the centre to transparent at the edges), one placed on the player, and one in each room (if the light is turned on). The field-of-view is generated by casting a bunch of rays out from the player in a circle, building a triangle fan from the results, and using it to mask the floor.

The objects in the rooms unfortunately can’t be rendered using the same method as they cause the floor texture to show through them, so for now I just make them visible (without blending) if any of the rays go through their tile.

We’ve nearly got the level generation integrated, it still needs a couple of fixes but once those are done I’m sure I’ll discover a boatload of issues that just don’t happen to appear on my simplistic test level!

Only other things after that are:

  • allow the player to hide inside objects
  • add audio cues to the environment (creaky floorboards etc., to give you some idea of where the beastie is, especially while you’re hiding in a cupboard!)
  • add a few more sound effects
  • add a lot more furniture tiles
  • implement final text

Right now, that doesn’t seem too bad.. though perhaps I’ll change my mind when the new levels start destroying everything!

Day 2: Mostly lighting stuff

My second day was mostly spent on trying to make normal mapping work in my WebGL 7drl. I finally managed to do that, but it took too much time for me to be completely happy and there still remains some tweaking. However, I did have time for something else apart from making the walls bumpy. I now have an actual dungeon generator instead of a hard-coded level, but it still needs a lot of work. Other notable things concern lights: they now pulsate slightly (not yet a satisfactory torch effect though) and the engine is now able to handle arbitrary number of them (the closest ones are determined and passed to the shaders).

Tomorrow I hope I can improve the map generator and also the actual visible wall geometry. I might also add some simple monsters.

Light in the dark

I started my WebGL based 7drl roughly 10 hours ago and I think I’ve gotten into a quite good start: I’ve got movement, basic collision detection, level loading from an ascii map and basic lighting with multi-light support.

Multi-light system
First day’s results: simple dungeon with lighting

I’ll probably continue by tweaking the shaders for prettier effects and trying to add randomness to those boring cube blocks.