Week of Awesome III, Part 5: Let there be light... and music!

Published August 15, 2015
Advertisement
For me this has been day 6. I skipped a day because implementing sounds proved to be more difficult than I thought. It does sound simple, doesn't it? You'd think it would be something such as this:
s = Sound("path/to/sound.wav")s.play(volume=1.0)
But unfortunately the audio interface provided by SDL2 is very low level. You literally have to load the binary buffer of a WAV file and copy bits of it into a stream when its requested by a callback function. Anyway, I do have it working, but only for one sound for now. The music I picked is "Quiet Tension" by Eric Matyas (his website is http://soundimage.org/). I also credited him in the game of course. Simply adding some background music really does wonders for the atmosphere. It feels much more spooky now.

But do you know what also adds a lot of atmosphere? Lighting! Previously everything was shaded fullbright which is pretty ugly. Now every object is lit by two directional lights, front and back, and can also be lit by point lights. Although I haven't added much point lights yet. The reason I went for two directional lights which oppose each another is so you can also color the shadow differently than the front lit side of the object. This looks a lot nicer than just making the other side of the objects darker.

Lastly a big feature I've implemented is transitions between levels, which also means I've added another area. For now I've just added a starting area, but I'm planning to spend most of the last day on making new areas. Otherwise the game will be a bit short. I'm also hoping to add some secret areas, that'll make for a fun challange for the other people following the week of awesome.

Download link:
http://www.mediafire.com/download/nn3dj0nfvjx60xn/ADeathADozen_v0.0.5.zip
2 likes 4 comments

Comments

rodolfodth

hey man smile.png i couldn't play it... i got this error...

error.jpg

In the error.log:

Error occured on version 0.0.5
Traceback (most recent call last):
File "<string>", line 1094, in <module>
File "<string>", line 1080, in run
File "E:\Projects\weekofawesomeiii\build\pyi.win32\adad\out00-PYZ.pyz\snowy.game", line 135, in mainLoop
File "<string>", line 1074, in render
File "<string>", line 650, in __init__
File "<string>", line 744, in _loadLevel
File "E:\Projects\weekofawesomeiii\build\pyi.win32\adad\out00-PYZ.pyz\snowy.program", line 232, in setUniform
Exception: No uniform called lightPositions exists.
August 15, 2015 05:00 PM
slicer4ever
same issue as rodolfodth.

edit: tried the new build in the thread, works for me, left comments in my post in the thread.
August 15, 2015 07:37 PM
Orymus3

I know the feel. Audio can be a bitch, especially if you're working on a game where there's too much of it (then you may end up simulating an alternating 4-8 tracks system like I did for NO REASON!).

Keep it up!

August 16, 2015 01:10 AM
__Toz__

@rodolfodth and @slicer: Yeah it's fixed in v0.0.6. Apparently nvidia drivers handle for-loops differently than AMD drivers.

August 16, 2015 09:14 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement