Sunday, February 20, 2011

I refuse to say "Let there be light"

...mostly because EVERY tutorial I have read about XNA lighting over the last 3 days have used the line. So I am not, so there! :)

After promising myself not to waste time on point lights, I decided to do point lights. First a comparison...
Basic lighting. Just ambient light.
Bodge lighting. BasicEffect with directional lights simulating point lights.

Point lights via custom shader.

I am quite impressed with the result. I used FXComposer from nVidia to test the shader. FXComposer is excellent and free! It only took about 10 minutes to get the shader working, and 2 coding sessions to get it working in the game...(cue: Benny Hill theme)...

Coding session 1 : After quickly getting the shader written, I put the code into the game...but it doesn't produce a single pixel. After hours of trying to work out why (debug, hardcoding values, etc), I decide to rewrite the C# routine that call the shader....only to find out that the original routine was commented out and not even being called. After uncommenting, I got scenery but it looked wrong.

Coding session 2: I spent another couple of hours going through dozens of sample code and tutorials, only to see code almost identical to mine. Long story short: everyone was wrong :) I changed the length() HLSL function to distance() and all was good. WTF?!? A little bit of tweaking later, and I am happy.

Another thing to note is the new model for DEMII. Its a work in progress, as I move to the final version, prior to animating. A few major things are in the works with the art for the game. Watch this space.

I have also read some papers on RPG level design. Eye opening stuff! It would be easy just to cram repetitive and derivative corridors and rooms just to get it done. It takes effort and thought to make levels good. But I have learnt quite a bit over the last week.

I have been playing some old games for inspiration. Namely, UFO:Enemy Unknown on the PC and Centurions X on the C64. I am considering adding one more major game element. A lot of puzzling bang for very little development time buck. I will then put an end to new things and focus completely on level design.

Sunday, February 6, 2011

Lava

I have started adding lava to the game. It works similar to the amoeba in Boulderdash on the C64, in that it grows over time, consuming tiles. I will post some pics when I am happy with it.

I have also been playing around with FRAPS. Here is a very short video of the animated water tile...
http://www.youtube.com/watch?v=-koWsYM2eAU

I am also using the same effect for the lava, but with a different texture.

Tuesday, February 1, 2011

Animated water, more models

  • Added animated water. It is animated in 3D on the fly using 2 sine waves (one in Z and a smaller one in X). Looks awesome, while still keeping that retro look I want. Had to write my own shader to make it happen, though.
  • Made a bunch of new models including cryo chambers for area 15.