Wednesday, April 17, 2013

Ghost Train - Coding in a dead language

So, I find out today that XNA is essentially a dead language.  Microsoft will not longer support it and offer new releases.  It will be considered officially dead on April 1, 2014.  That leaves me in a bit of a conundrum.  Do I continue on in XNA, having only just started to learn it and not too deep into coding my game that it would hurt to stop?

If I do stop, then what?  Unity?  I've tried it and I know it's powerful (I've played many great games made with Unity), it just doesn't feel like coding does in XNA.  I like to see the lines of code.  That's part of the draw for me.

Likely I will continue on with this project in XNA and then figure out what's next for the next project.  I feel like a modern scholar studying Latin.  There's not really any reason to except to do it...

Wednesday, April 10, 2013

Ghost Train - Menus and Gamestates

Of course I jumped right in and started programming the action part of the game, cause really I had to get that instant gratification of seeing graphics on a screen with some input.  Having a bit of that (still much, much more to go), I need to go back and define the menus and the rest of the game.

Here are the different states of the game:

0.  Main splash screen.  Just a picture with "hit spacebar to continue".
1. Main menu.
2. Hire hunters.  This is going to be like a  bar or employment line.  You can see your available slots and build a team off of that.
3. Purchase items.  Special equipment for the team.  Buy, then give to a character.
4. Overall map.  This is where you see all of the train lines and select the one to work.  Train lines open as you get better.  Other optional idea is that instead of a map, you get a job posting screen and you select one of a few open jobs.  Either way, this state is where you select a route to work.
5. Action state.  This is the main game on the traincars.

There are probably some sub states in there like a screen before #4 and #5 that just says press start when ready.  I can always add those in later as I identify them.

Here's where my lack of programming background comes into play.  I'm not exactly sure how to create new callouts for the gamestates, so I have implemented them directly into the "update" and "draw" processes.  This seems to work fine, though is probably not the most practical method, especially if the program was large.

Right now, gamestate 0 is the main opening menu and gamestate 1 is the action part of the game.

protected override void Update(GameTime gameTime)

        {
            if (Gamestate == 0)
            {
              //Updates here...keyboard input.
                {
                    Gamestate = 1;
                }
            }
         

            if (Gamestate == 1)
            {
              //Updates here...keyboard input.
            }
            base.Update(gameTime);
        }

       protected override void Draw(GameTime gameTime)
        {
            if (Gamestate == 0)
            {
                //Draw something here.  Main Menu
            }
         
            if (Gamestate == 1)
            {
               //Draw something here.              
            } //
          }

I also saw from Microsoft's gamestate sample the use of the region marker and I'm using that to break each gamestate up so I can quickly find it.  This marker allows you to collapse code to make it easier to find.  Kind of like a bookmark.

#region gamestate0 draw
...
#endregion

Neat!  Now I have a main menu and you press spacebar to enter the next state.  Exciting stuff!

Tuesday, April 9, 2013

Ghost Train - Controls

As this is a skill based game, I want the controls to be intuitive and quick to access.  The player should not be hunting around for keys on the keyboard, but should be able to keep their eyes focused on the screen.  Thus the keys have to be grouped and used in a manner that would allow for ease of play.

There are three control groups:

1. Character select.  This is number keys 1-5, to be accessed by the fingers of the left hand.
2. Action button.  This is the spacebar to be pressed by the thumb of the left hand.
3. Move button.  This is the arrow keys to be used by the right hand.


The flow of play would work like this:  Select a character, move that character into place, then hit the action button.  Select the next character...and repeat.  The position and facing of characters is important as the ghost will be moving and attacking and most actions have a small area of effect so characters will need to be close.

I'm focused on Windows development at this moment, but keeping Xbox in mind as well as I want to see this game on XBLA at some point.  I've considered controls for the Xbox controller and map the ideas above like this (though this would need to be tested out):



Monday, April 8, 2013

Ghost Train - Beginning XNA

So, I'm new to programming.  I've done tons of unix shell scripting and some javascript, but never really programmed with a real language.  It's going to be a huge learning curve, I realize.  I did some initial research on what to program in and have decided to use the XNA plugin for Microsoft Visual C#.  I was recommended to some really good beginner tutorials which I've spent some time following and playing around with the ideas in each to see what I can get from it.

I selected XNA because it seems tailored towards game programming and also it allows one to develop for Windows and XBox, both of which I'd like to support.

The tutorials I've been mainly using are at: http://rbwhitaker.wikidot.com/xna-tutorials which I highly recommend.  There are a few things assumed, but he does a great job at explaining the basics.  There were only a few times I had to look things up in other places to really get the gist of the exercise.

Using the tutorials, I've learned to:

1. Make a screen and change the size.  I'm standardizing on the normal xbox screen size for games.
2. Put graphics on the screen.  A background (which I eventually want to be scrolling giving the impression that the train is moving).
3. Use number keys to select one of five characters on the screen.  The character portrait lights up (blue halo) to show which character is active.
4. Use the number keys to move a sprite character around the train.  He can only move on the train and is restricted from going too far left or right (going off the train).  When the character is selected it only moves that character's sprite.


So, not much of a game yet, but I see it starting to shape up and Visual C#/XNA is fantastic to put you into the thick of it rather quickly and be able to see fast results.  If I couldn't see it yet, probably would have quit.

I'll talk more about the controls and about creating graphics soon.

Friday, April 5, 2013

Ghost Train - Types of Hunters

Jeb grabbed the Soul Hammer and held it close to his chest in fear.  Through the limited periphery of the gasmask, he could see the electric blue glow of one pissed off spirit.  Andrux was in front of the crew facing the ghost.  He carried a large Aether Shield and Jeb was glad he was behind it....

Ghost Hunters, Bulls of the Line, Spirit Miners, Enforcers...whatever we call them, they are the characters that a player has access to.  I want there to be at least nine types of character, each with variations so that your choice of up to five is somewhat difficult.  Do you take another DPS guy, or a Librarian?  Pick a tank or another trapper?

The type of ghosts will also effect which characters are most effective and it might take a few tries of different combinations to capture the ghost.

I'll use terminology from other games to explain the types of characters and what they do:

1. Tank or controller.  This character draws the attention of ghosts and redirects their attacks away from other characters.  If you had a ghost in the middle of a train car, you could move the tank to one side and have it draw the attacks and the rest of the chars on the other side draining the ghost.
2. Trapper.  Think of this guy like the Ghostbuster who has the trap.  He's there to catch the ghost when it is mostly drained.  It's a delicate balance.
3. Striker 1.  Damages ghosts with a weapon (Soul Hammer or Spirit Axe, something neat).  This one does fast damage, but small amounts.
4. Striker 2. Like the other striker, but very slow attacks dealing lots of damage.
5. Striker 3.  Area of effect damager.  Useful for multiple ghosts.
6. Sheild/Defender.  Kind of like a tank, but does a bit of damage for it's high armor.  Might just combine this with Tank.
7. Librarian.  Wears aetherial goggles and spots ghosts.  Maybe knows lore/weak points of ghosts.
8. Healer 1 - Heals a team member with lots of damage.
9. Healer 2 - AOE healer.

Each character only has one action/power.  This is a skill level thing where there is a chance at failure each try.

Characters have a few stats:
Class (as above, though want more atmospheric names)
Spirit - This is their health bar
Speed - How fast they move back and forth on the train

In addition, each power has a subset of stats like how much damage, how long it lasts, area of effect, chance to succeed.


Speed concept.  Going for a Victorian era, post-apocalyptic miner/engineer sort of vibe.

Ghost Train - Designing

What impresses me about games like Ridiculous Fishing and even Angry Birds is creating a fun, engaging experience with a few simple mechanics.  I want to keep the design for Ghost Train (this is just the working name, btw) simple but fun.

Here are the elements that I want to include:

  • A moving train.  Trains move from city to city on the map.  A train might have 3-7 passenger cars.
  • Ghosts.  A ghost is on the train and is sucking the souls out of passengers.  There are different types of ghosts, each with unique abilities.   
  • Ghost Hunters.  "Line Bulls" as John Harper describes them in Ghost Lines.  Players will have 2-5 of these hunters, each with their own specialty.
  • Hiring.  Hunters are hired (maybe from a bar or employment line).
  • Different train lines which get progressively more difficult.
  • Upgrade system/equipment buying.
The action part of the game, I envision as a relatively fast paced fight between the Hunters and the Ghosts.  This is kind of a twitch action, but I also want it to feel somewhat puzzle like.  This is something between a boss fight in World of Warcraft mixed with a rhythm game.  You are constantly selecting characters from your crew, positioning them and activating their power, then moving to the other.  You need all characters working in concert to capture the ghosts.

Narratively, I imagine the battle happening something like this:  The characters enter the train car.  It's full of passengers, but no ghost to be seen.  The librarian moves to each part of the car, putting on his goggles and scoping out looking for Aetherial matter.  He spots a ghost sucking the soul of an unwitting passenger.  The player moves the librarian out of harms way quickly and moves his damage guys in.  They start hammering away at the ghost with spirit hammers.  The ghost isn't just going to stand there and take that so he attacks the nearest hunter and starts draining his spirit.  The hunter's getting weaker and weaker, so the tank moves into position, attracting the attention (and wrath) of the ghost, leaving the damage guys alone.  The ghost is getting weaker and weaker.  Keep going and the thing will evaporate from existence...but you need to capture it to get the reward.  So, when it's weak, but not dead, you bring in your trapper, moving him into place and activating the spirit trap.  After a couple of tries, it sucks the ghost in just in time.  All the while the passengers keep sipping their tea unaware of the danger they were just in.