Monday, March 14, 2011

Camera angles revisited II

  • Added point lighting to actors


This screenshot shows the Tomb Raider style camera in effect ie. you can now orbit around DEMII and see her face. Model is not finalised , yet, but very close to it.

Saturday, March 12, 2011

Camera angles revisited

  • Switches now can be linked to doors, lights and events. This will add a new layer of puzzling to the game.
  • I decided to revisit the camera, as I have never been 100% happy with it. I spent some time doing research, playing other games and seeing what they do. I saw that the cameras seem to fall into 2 styles (I will name them based on the games I saw them in):

    GTA3 -
    Mouse rotates camera AND player. This means you always look at the back of the player's head.
    UP=walk away from camera
    DOWN=Walk backwards

    Tomb Raider/Just Cause 2/Red Faction: Guerrilla -
    Mouse makes the camera orbit the player. Player only changes direction when moving.
    UP=turn and walk away from camera
    DOWN=turn and walk towards camera

    The advantage of the latter method is that you can have action happen behind the player. Even chase the player. I have recoded the camera to work this way. Looks and feels way better. Unfortunately, it highlights an issue with the actors: They still use BasicEffect and not my custom point lighting. Hence, no pictures today...not until I address that.

  • I have rigged DEMII's model up for animation. Hopefully, my Deled3D to MilkShape to XNA animation path will work issue free. Fingers crossed on that.

Tuesday, March 8, 2011

XML Maps

I had an idea to add an attribute to the actors that would link actors together. All actors with the same value in this attribute would effect each other. ie Switch #2 will open door #2...all doors marked #2...could even trigger event #2 for a crescendo or something. An idea with a lot of potential. Plus it will cut down on a lot of code (as in I wouldn't have to put any code behind individual switches as they would all use the same code).
With this came the problem of storing the value. Rather than add a new layer to my binary format maps. I decided to break free of the binary format (which is based heavily on Wolf3D maps) altogether and use XML. So thats what today was wasted spent on. But the end result is much more flexible.

Wednesday, March 2, 2011

Nanoshields

  • Added single tile doors. Can't believe that this wasn't done before. Especially after spending so much time on double doors.
  • Added Nanoshields. These protect DEMII from hazards. She can only have one at a time. There are 3 different types: Aquashield, Heatshield and Bioshield protect against water, lava and toxic waste, respectively. If you don't have the right shield, you take damage. If you do, no damage and you can walk through the hazard. It is a good way to block off areas and add more map based puzzles. Maybe the right shield is hidden, maybe you need to use one to get to the other, etc, etc.
  • Added an in-game menu so you can go back to the level select or end the game.
  • Added in-game notices of events. At the moment, they look like the achievement notices given by Live....a bit too much. So, I will need to change that a bit. :)
  • Started adding terminals. These will act as switches in the game. I am considering having a hacking element, like in Just Cause 2 (type in the random code within the allocated time). Or perhaps, you need to find the code (like in Deus Ex). Yes, they are C64's :)
  • Started a shield training map. Good for testing the shields, as well.




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.