Wednesday, October 12, 2011

A red letter day

List of achievements since last update...

  • New flame particle. Instead of the 4 frames used previously, I now have a 64 frame explosion. En mass, looks like flames. Quite realistic. I must make a video to show it off!
  • Actors can now be injured and "killed".
  • When an actor is "killed" (HP < 1). It explodes. This effect uses 16 of the 64 frame explosion from the fire effect. These are created at evenly spaced heights. The height is determined by the actor (no point in having a 2 metre tall explosion from a 1 metre tall object). The ground position is random within the square. I have also added a random delay, so the explosions don't go off uniformly.
  • Actor death also releases nanites. These travel to the player and are automatically "collected" and added to your tally. The number of nanites released is one per inital HP of the actor killed.
  • Each nanite particle can be 1,10, or 100 nanites. This is random.
  • The upgrade and level select menus have been changed to be vertical lists. This makes them easier to work with and more intuitive. It also give me more space from descriptive text and progress bars, etc.
  • The Load Game and Options menus will have the same look for consistency.
These may sound like superficial changes, but the difference to the game is huge. It now feels like a game. You can kill things and get rewarded for it.

I am also starting to think that the flamethrower is a little too good. Not that I'd nerf it, but, it is kind of "Why would I use the melee weapon, when I have this?". The cool down period is OK...maybe make it a little more expensive to use...hmm....screw it, I leave that sort of tweaking for the beta.

Tuesday, September 20, 2011

Cubicles of death

The office



  • Started work on the second chapter (Area 1-2). This will consist of a lobby, offices, guard quarters and mess hall. It is a high security area, that starts off under lock down (apparently and experiment has escaped (wink)).
  • The simplified level select dialog separates the game into layers, starting with Stories. Each story will consist of Acts. Each act will consist of chapters. The initial release will be 1 story with 3 acts, each with 5 chapters...so 15 chapters all up.
  • Chapters may contain several maps that will link together. This serves several functions: First, it allows for better performance (dynamic shadows aren't cheap). Secondly, it will make some areas harder to find ... maybe even miss-able! Thirdly, it makes the world seem bigger, as it can be quite big by adding more maps.
  • The vertical movement of the camera has been removed. The view is now locked. The camera can still be rotated horizontally, orbiting the player, independent of the player's movement. This is to stop the camera being lost in walls, etc.
  • DEMII meets a grumpy guard.
    Can DEMII sweet talk the guard into letting her in? 
  • I started working on some comic-like special effects for attacks. More on this later

Wednesday, August 31, 2011

Stand clear, doors closing...



  • The scale change actually broke all of the door code. Got this happening again, fixing several bugs along the way
  • Door, decals, lights and switches can be linked together. So toggling a switch can change an actor's model, trigger events, etc. For example, the terminal in the screenshot changes the decals on the floor, the tick/cross light, changes the light from red to green, plays a sound and opens the door...then does the opposite when the switch is toggled again.
  • Added a fudge factor to the shadowing code. This fixed a lot of issues with the shadows.
  • Changed the level select screen to be a list of levels, rather than the 3D island map. The island map is much nicer, but would take a fair bit of effort to change, make look good, etc.
  • Many under-the-hood and editor improvements.

Wednesday, August 17, 2011

This is a triumph...

A quick update with a couple of pics of the first map. Its a Portal parody. My original idea was to have the whole first act (1/3 of the game) as training levels and it would be one big Portal parody...but when I went to make the maps, well, let's just say Portal is rather bland and I decided it was overkill to have that many training levels...best to just have one and get on with the story!

I have planned out an interesting escape story of act I. Each map will parody classic games (without cloning them) ... I was always looking for a way to inject some humor. I think its a great way to tell my story.

Anyway, I will keep the other maps under my hat ...until the maps are made anyway. Enough of me rambling, in to the pics...

DEMII in her Relaxation Vault

Multiple Shadows!!!

A matter of scale

Wow! Has it been a month, already?

Anyway, just as a quick update of my progress, I have made some major changes...

1) New map editor written in C#/XNA. This is speeding things up. Its amazing how much more you can produce when you don't have a slow, clunky editor killing your creative buzz.

2) Shadows! After putting it off for ages, I decided to attempt adding shadows to my HLSL shader code. After 2 days of coding, I finally got it happening...and it was worth the effort!
Basically, the technique I am using is called Shadow Mapping. It is fairly straight forward: Draw the view from the lights' point of view, but only store the depths and store this in a shadow map. Then, draw from the camera's point of view, testing each pixel against the depths in the shadow map. If the light is farther away than the entry in the shadow map for that pixel, then something is closer and it is therefore in shadow.
Of course, this is drawing an extra frame per light. It has reduced my framerate down from 60fps to 25fps for just 10 lights. Not bad for unoptimised code. I have a few tricks up my sleeve to get the framerate back up.

3) I have changed the scale of the game, relative to the player. Previously, I was working on a tile of about 1 metre square. Only one thing can occupy each square (well, 2 things: a block and an actor). It meant that all detail had to be in the model, and I found myself making thin and thick walls, etc. After playing Sega's Spiral Knights, I can see that it is much better to reduce that scale. So, the character models are bigger, filling the square...and the block models are smaller, half the size. Of course, this makes the maps smaller, but I may introduce several maps per map (if that makes sense), such as elevators that take you to the next map. Would also be good for hiding secret areas, etc.

4) I have added a scale attribute to blocks, so I can have the same block as a 1x1 or a 2x2 (or any size really). Will make the game lighter: why draw 4 blocks when I can draw a 2x2.

5) The point of view has changed to be higher. This is so you can see more of what's going on, and to stop the camera being blocked by walls as it will be well above them....it also negates the need to draw ceilings.

Sorry that there are no screenshots for this update because I am working on the final solid version of the first map. The changes have lead me to redesign sections of the game engine (which is a good thing). Some things need a rethink (such as the now 1x4 doorways), and I want to polish things up before releasing screenshots. So, maybe in a day or so....

Wednesday, July 13, 2011

The eyes have it

After running my new models past my art consultant, I got feedback that the eyes looked funny. Like they were very surprised. LOL. So, I have changed the heads slightly. They are now smaller with rounded tops. I have also added eyelids, which I believe have made the world of difference. They allow me to have more expression in the absence of eyebrows.

I have also started a Minion/Guard type character...top marks (6 out of 6) for anyone who can tell the 60s TV show it references :)

Minion/Guard

Scientist

Friday, July 8, 2011

Back with a vengeance

I'm back. I decided to take a 2 month break from the project. This was because the project had just moved from engine development to actual game development and I was not happy with how the game was progressing. It was not something I was comfortable putting my name to. No amount of effort was going to fix the project's problems, because I couldn't put my finger on what the problem was....I was just spinning my wheels and not getting anywhere.
Sometimes this happens, and you need to take a break and come back with fresh eyes. This allows you to see the forest, not just the trees, so to speak.
During my break, I had several epiphanies:

  1. The game was looking crap because it was a mix of styles. Realistic models here and deliberately retro models there. The retro stuff was looking like crap against the realistic stuff...but if it is ALL retro, then it becomes obvious to the player that that is the intention and it therefore looks good (despite not being ultra modern), because the player "gets it".
  2. I was seeing games, such as Lego Star Wars having 120+ characters and wondering why I was struggling making a second character. Sure they had their IP with 6 movies worth of pre-thought-up characters, but it would have been a great effort making all of those models!. No it wasn't! The way they went about it was brilliant: Have one basic model and just change the textures (and occasionally, the helmet, hair, etc).
  3. Replayablity: Although I already had the concept of locking areas (with lava, water, toxic waste) and the player needing a required element to access (shields), the Lego games used doors that can only be opened by specific characters that are not available in Story Mode, or by using helmets. This is nothing new, after all Doom had red/blue/yellow access cards to open those doors, which is the same thing, just now you have to unlock something on one map, so you can use it on another. I can replicate this via security ID cards.
  4. Upgrades: I always wanted DEMII to have upgrades, but could not think of a good way to implement them. Then I realised that upgrades are present in most modern games under various aliases: Lego Star Wars has "Extras", GTA4/Red Faction Guerrilla/etc have "Cheats", Deus Ex had "Augmentations". These are abilities that are unlocked during gameplay and give the player the option to change an aspect of the game. I have already thought up a number of them, eg Ice that dosen't melt, various automapping tools, regenerate HP from SP, etc.
  5. I don't need missions to tell a story ! Missions limit play: once they are done, why would the player want to do them again? Better to give a less restrictive map and have one main goal to achieve, to push the story forward, coupled with a number of mini-goals to make the player explore and require multiple runs, etc.
Add to that an affirmation of game size: By having replayibilty of levels, Lego Star Wars gets away with 6 maps per episode and 3 episodes per game = 18 maps (plus a few bonus maps). I am considering having 3 acts of 5 maps = 15 maps. The difference is they tell a story in 6 maps, I will be telling my story over 15 maps.

I have already redesigned DEMII into a simpler style, and designed 2 other character models. Once I have the design thought out, it only takes an hour or so to adjust the basic model template I have made into the character! I have thought up 9 possible characters (including both enemies and NPCs). So far I have DEMII, a random scientist (perhaps this will become the mad doc, himself) and a native girl (not yet named, but she will be a key NPC in the village levels).
Note: They all have the same expression in these pics, but in-game, they will change.
Scientist
DEMII
Native Girl

Tuesday, May 3, 2011

Animation:Every silver lining has a cloud.

I wanted to spend today writing the missions code. But I wasn't happy with XNAnimation's shader. It's concept of point lights (with no attenuation) and lack of directional light, made it look like crud. Apparently, once upon a time, XNAnimation did have attenuated point lights but because some crappy ATI cards couldn't handle the shader, the number of instructions had to be reduced. So, point light attenuation was taken out. I can think of a ton of stuff that should have been taken out before that! Maybe less lights? Unloop the light code?

Anyway....I spent today writing a new technique for my shader to replace the XNAnimation fail-fest. Which was frustratingly simple, in the end. But, of course, I had to go through a long process of debugging to figure out things like: animation not working on skin but worked on normals, and why DEMII's legs were on top of her head :D.

Thursday, April 28, 2011

Success with animation

  • I have had major success in getting an animated mesh that I made working in DEMII ! This is huge as it is the last major milestone/hurdle for the game engine to overcome. It opens up a world of possibilities for enemies, etc, etc. All it took was fixing the Milkshape exporter in DeleD and implementing the XNAnimation library.
  • I am also finally happy with the camera control. After playing  researching other games (GTA4, RF:G, JC2) and trying to work out what they are doing different (GTA4's camera works well indoors for a third person game)...and copying. Now the camera orbits the player in 2 dimensions and sticks to walls. So much better than pushing it up the wall (sea sickness, anyone)?
  • I have added a few new levels. The most interesting of which is a massive pyramid that DEMII must climb, only the steps are broken in places. So, she has to walk around the edges and find a path up. It kind of reduces the game to a platformer, which is a great bit of variety, me thinks. Think the old C64 classic Nebulus. There will be alternate paths, traps and hidden things, also....and a push puzzle on top!
  • My recent GTA4 "research" has also given me a lot of insight into how to do missions without an inventory. Basically, when you have to "get item X", you are really telling the player "go to location X, where I will display item X". Location X can therefore be a trigger tile.
    The other major type of mission, in GTA4, is the good old bloodlock ie kill a particular enemy or all enemies in a location.
    Using combinations of these, with dialog triggers throughout, can be quite entertaining story telling. A real eye opener!

Tuesday, April 19, 2011

Animation Woes/Rant

A new version of Blender has been released 2.57. Improvements include not having an interface that looks like it was designed by an epileptic chicken, and having a plug-in interface that can actually run plug-ins, and not just say "Script Error" or "I can't find Python despite every other program using it just fine". Major downside: Old plugins don't run, and (of course) the useful ones haven't been ported over. In other words: different shit, same smell.

Which brings me back to DeleD. This free editor may not be as powerful as Blender, but it is far easier to use, and, you know what, it gets the job done. Its major flaw is that you can't get the animations you make out into the world. The only way to save the animations is in its own DXS format. The only exporter that exports animation was to Milkshape...and even then animation export was broken. I say "was", as I invested yesterday downloading the source, tracking down a copy of Delphi7, building an XP virtual machine, and fixing the exporter....then I realised it was 3AM. LOL

I can now export to Milkshape, which will allow me to export to animated .X or .FBX. Which is a stupid workflow. Why should I use an excellent, alive and free 3D tool (DeleD) then export to a so-so, not so alive, and not free 3D tool (Milkshape) just to export to a free game framework (XNA). I think a new entry on my to do list will be to get the DeleD .X exporter exporting animations. Then I can pants off Milkshape.

Anyway, I'm off to look into getting this animation into the game.

Wednesday, March 30, 2011

Arrrgh! Robozombies!!!!



  • Put a lot more work into the conversation system. Now wraps text and has a conversation tree.
  • Added height offsets for each tile. So now the ground doesn't have to be flat. This will prove useful for the outside areas.
  • Added a new grunt-level bad guy - The RoboZombie! You see, our mad doctor is far too mad to have just regular zombies on his island. As a result of his first attempts at making a cyborg, he has these monstrosities...that got loose! They will be found all over the island in numbers.


Friday, March 18, 2011

Liquid Bug Fixed!

This has been driving me nuts. It was a bug that would cause the liquid hazards to stop animating. Turns out to be a bug in XNA.

I was using ElapsedRealTime.TotalMilliseconds to tell me the time between frames. Should be around 16.6 for 60fps. This was all over the place when I had a steady framerate. Then it would go to 0.0, so no animating. I switched to ElapsedGameTime.TotalMilliseconds and it works great. They should be equal, but by outputing them, I can see that ElapsedRealTime is all over the place.

The difference is ElapsedRealTime is the clock time and ElapsedGameTime is from the startup of the code. The games should be the same. I think this may have something to do with throttling in a multicore CPU. I have an i7, which is a quad-core (comes up as octo-core in Task Manager).

Thursday, March 17, 2011

Sound Manager


  • Added a sound manager. Now all sound effects reside in this class. This means that I don't have 100s of actors each loading sound effects. Much quicker and lighter on memory.
  • Added sound effects for push, pull, objects sliding and doors opening/closing.
  • Added particle effects for push and pull. Basically just a stream of smoke puffs. But at random spread and speeds. Surprisingly effective.
  • Added a translation to the starting point of the attack particles. So now they start at DEMII's gun barrel and not at her origin. No more shooting fire from her bully button. LOL!

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.




Wednesday, January 26, 2011

Happy Australia Day!

Happy Australia Day to all Aussies both at home and abroad!

Just to catch the blog up on my current state of affairs...

  • Actors now use a lookup class for their models. Previously, each actor had a copy of the model, which was OK for a handfull of instances. But, once you get hundreds, you start reaching memory limits, etc. The tiles have always had a lookup class.
  • Area15 is now completable. I would like to add enemy respawning when they die, though...and maybe a few more graphical niceities, but apart from that, the logic is all there and playable.
  • When you complete a level, it is marked as complete on the level select map...plus you get a prompt to say "Map complete" and you then return to the level select map.
  • Level select map now have 3 types of nodes: Locked, Open, Complete.
  • Fixed a bug where if 2 actors where in the same square (say an enemy and a health pack), then the enemy wouldn't take damage if shot.
  • DEMII can now PUNCH! This is a form of her contextual 'Metal' power that is always available as an alt-fire. It deals a random about of damage that is less than quarter of her current SP power. I need to add a delay to the punch (and animation...eventually) because now DEMII can deliver 60 punches per second = LMAO!


While randomly searching the net for inspiration, I came across a game from a few years back that is similar to what I am trying to achieve with DEMII. Though, a vastly different game, in practice, both are tile based and therefore the game engines are similar and face the same challenges. I downloaded the demo, and the game looks great. I can tell I am on the right track for a lot of things. The one thing that looked way better than what I am doing is the lighting. I have come to the conclusion that tile-based directional lights, while a great technical work-around, just dont cut it when compared to point lights.

The major pro of point lights: they look way better.
The major con of point lights: they require me to write a custom shader effect. Having multiple lights will mean more processing...a way to beat that slippery slope is deferred rendering, but how does that work with alpha materials, etc?

Anyway, I NEED to focus more on getting levels made, functional, and finishable, rather than tweaking the graphics.

Monday, January 17, 2011

Enemy AI

  • Added enemy AI, in so far as path finding. Seems there could be a whole branch of maths that could be assigned to this. But I found a very efficient way of getting the enemy to find the shortest path around a maze to get to the player.
  • When player dies, game now returns to the level select screen.
  • Game now uses one floor model and changes the texture, as opposed to having multiple models that only differ in texture. As a bonus, this will facilitate having animated textures!
  • Player can now pick up certain actors. This is crucial in the ability to pick up health, etc.
  • Menus now have music.

Saturday, January 8, 2011

We have top men working on it...top...men...

Level select - Unpolished, but working!

  • The level select is now 90% coded. Just need to lock/unlock maps as maps get completed and change how locked/unlocked/completed maps look on the map. Also need to design select maps for the other 2 areas.
  • Started adding sound/music. Makes a HUGE difference to the feel of the game. It now feels like I am playing a game, not just running code (if that makes sense).
  • Started work on a new map called "Area 15". Its my version of Area 51 from the Indiana Jones movies. With a little surprise for the observant player.
  • Started fleshing the story line out a bit more. This led me to put a bit more thought into the goal of each map...
    • LABS - Tutorial maps. Map goal: Puzzle solving. Ultimate goal: Escape labs.
    • VILLAGES - Put skills learnt in LABS to practice. Map goal: Collect all the idols. Ultimate goal: Get into volcano.
    • VOLCANO - Map goal: Find pass cards (ala Impossible Mission, perhaps?) Ultimate goal(s): Revenge? Escape island.



On a more personal note: My confidence is building. I still have a metric crap load to do, but I can see the light at the end of the tunnel. I have enough of the game engine done that I can concentrate on level design and worry about the nice-ties (animation, enemy AI, sound, etc) later. 


Area 15 - High view angle.


Area 15 - Low view angle.