Archive for December, 2009

I took a brief stab at some more Muramasa and got up to a new boss on each character, but man, those bosses are getting brutal.  I really do want to continue on and marvel more at the amazing art that game offers.  I might just put set it to easy mode just so I can go through and see everything.

Work on Lock’s Quest continues still, again 5 minutes at a time.

But the big one this week was Silent Hill: Shattered Memories.

I’ve already beaten a first play through.  The game seems fairly short (read concise), and I like that.  The old games used exploration of unknown areas and the constant threat of enemy attack as their main method of tension, and that was all well and good.  Compared to Shattered Memories which replaced that with the confusion and heart-pounding terror of the “escape sequences.”  In theory, that sounds awesome.  But I just found them to be too confusing for their own good.  I found I would have to make numerous attempts at the later stages just to feel out the plausible areas to run through to get to the goal.  My belief is that the terror in these instances is supposed to be fun, but I found it mostly tedious.  The exception to this being the next to last escape, which I will add in spoiler tags for those who don’t wish to ruin it.

Spoiler
I thought the escape sequence from Harry’s apartment was fantastic.  It differed than the others because it wasn’t a set map.  I believe (and I could be wrong on this), that it appeared to be generated on the fly, and pushed you to run to doors that were covered in ice as a hint.  But the fluidity of transition between the normal escape into the upcoming cerebral ending by interspercing the gradually lengthening room with the television was great.

In a way, though, I was also slightly disappointed.  Again, as the old games had a constant threat of attack and sudden transformation, Shattered Memories decision to do away with combat and focus on the escape meant the only enemies exist within those sequences.  Once I figured that out, I felt no tension at all during the exploration phases.  Only a deep tinge overshadowed by my desire to continue and find more “points of interest,” like the picture points or artifacts.

One great part of the game was the mechanics of the Wii remote.  I seriously cannot see why anyone would play this game on anything but the Wii.  The flashlight pointing is very intuitive (although the act of pushing a monster off me generally got me turned around longer than I would have liked because of it).  But more so, I was fascinated with the use of the Wii remote’s speaker to play audio clips, and at such a low volume as to require you to place it to your ear, effectively imitating the cell phone motion itself, bringing the player a real feeling of immersion from that simple act.

In all, however, I enjoyed this departure from the series I was used to.  And some final spoiler thoughts below.

Spoiler
I thought the change of plot line was good, in that it worked out for the new twist they decided to give the story.  Although they could easily have just made an entirely new cast, although I did like how they used Heather’s look for the older Cheryl (Makes sense, really!).  I intentionally didn’t think too much about the ending possibilities so I would be surprised later.  And I was not disappointed.  The entire beginning is constructed to make you think it’s Harry attempting to re-live the happiest moments of his life with his daughter, but the end reversal causing you realize it’s actually Cheryl watching to re-live the happiest moments of her life with her father really got to me.  I can honestly say I shed a tear when she passed the point where she says “I love my daddy.” and rewound it to hear it just one more time.

And finally, to the point of all this.  The Silent Hill series is one of those gaming experiences that profoundly altered my perception of games.  Whereas I don’t experience much fear in so-called “horror films,” the Silent Hill games have never ceased to terrify me.  As much as I love my favorite of them all, SH2, I still find it difficult to sit down and play through it subsequent times because the atmosphere and plot are so well crafted.  I have no doubt that there will be some homage to the series, whether it be brief bits of interest or mechanic styles, to be found in my own work, especially my forthcoming metroidvania style, Scale.

Symbology will be an important aspect of Emaline’s Story.  One such important symbol is that of the turtle.  What does it mean?  What role does he play?  Questions to be answered by the player in the midst of uncovering the greater scheme of things.

Jump physics are a very difficult thing to do properly.  They can be thrown in very quickly, but they require a tremendous amount of tweaking to get to feel exactly right for a given game.  In general, most people grasp quickly the method of applying gravity as a downward force.  And within a game loop, the application of the timestep methodology.

yVelocity += gravity * timestep;
yPosition += yVelocity * timestep;

But one special application of jump physics involves utilizing the timing of the button press to alter the effective height of the jump, and due to the intricacies of managing timestep based programming it isn’t so easily solved as the base problem. I’ve approached this problem a few different ways over time, but this recent method I have found to be rather elegant. Basically, it is accomplished by differing the gravity constant according to whether or not the jump button is pressed during the up motion of a jump.

The initial button press introduces a negative (upward) force. Gravity is applied as normal while the button is pressed. While the button isn’t pressed, gravity is applied with a multiplier, effectively limiting jump height when the button is released during a a jump. Once the character’s vertical velocity goes positive (indicating a downward fall), gravity is applied purely as normal.

This method ends up being simple to implement, but requires extra tweaking over the basic format due to the introduction of the gravity multiplier.

Here is a simple implementation in C# for XNA.

As some setup, I have a Character class to contain some physics variables and state data.

class Character
{
   public enum CharacterState
   {
      Idle,
      Running,
      Jumping,
      Falling,
   };

   public CharacterState State;
   public Vector2 Position;
   public Vector2 Velocity;
}

I also have an InputManager class that handles button/keyboard inputs based on an enumeration of Action items such as Jump, MoveLeft, MoveRight, Duck, etc. This is mostly my own revised implementation of the InputManager found in the XNA Creators Club RPG Kit sample

Which brings us to the main game engine.

// Gravity constant.
const float Gravity = 1980f;
// How much to increase gravity to shorten jump height while jump button is not pressed.
const float JumpMultiplier = 2f;
// Initial force to apply when initiating a jump.
const float JumpForce = 700f;

Character Character;

public void Update(GameTime gameTime)
{
   float dt = (float)gameTime.ElapsedGameTime.TotalSeconds;

   // The character is in the process of jumping (positive vertical velocity).
   if (Character.State == Character.Character.Jumping)
   {
      if (InputManager.IsActionPressed(InputManager.Action.Jump))
      {
         // Jump button is pressed, apply regular gravity.
         Character.Velocity.Y += Gravity * dt;
      }
      else
      {
         // Jump button is not pressed, apply gravity with multiplier to reduce jump height.
         Character.Velocity.Y += Gravity * JumpMultiplier * dt;
      }

      // Character was jumping, but vertical velocity means character should now be falling.
      if (Character.StateCharacter.Velocity.Y > 0)
         Character.State = Character.CharacterState.Falling;
   }
   else if (Character.State == Character.CharacterState.Falling)
   {
      // Don't alter gravity while falling, just apply regular gravity.
      Character.Velocity.Y += Gravity * dt;
   }

   // Jump!
   if (InputManager.IsActionTriggered(InputManager.Action.Jump))
   {
      Character.State = Character.CharacterState.Jumping;
      Character.Velocity.Y = -JumpForce;
   }

   // Apply character's current velocity to its position.
   Character.Position += Character.Position + Character.Velocity * dt;

   // Continue on with collision detection and all that other important stuff.
}

A strangely slow week for actually playing games, but a strikingly productive week for creating them!

I put some more time into Lock’s Quest, played some Bookworm on my iPhone while out of the house, and got a few more quests in with my Borderlands buddy, but I don’t feel like I actually gamed too much this past week.

Instead, I spent quite a bit of time actually writing potential code for my currently primary game engine including texture based level layout drawing, pixel shader post processing (including hue/saturation, vignetting, bloom, haze and refraction), simple particles (will probably rewrite this entirely later to hopefully take advantage of point-sprites), and some simple polygonal collision detection.

I’ve attempted to avoid my usual trap of  over-thinking the engine design in favor of the mantra of Jonathan Blow: “Always be prototyping!”  It’s something of a struggle to just sit down and make something “just work” rather than try to make it optimal from the start, but I always manage to surprise myself when I do follow it, and end up producing something tangible.

Here’s another piece of concept work from the upcoming Metroidvania style game.

thefool

Emaline