Game Development Overview

This month, I was invited to give a talk to a high school computer class in the Fountain City area of Knoxville on the basics of game development.  This talk covered some of the major tools that are available for creating games.  I covered many of the 2D game engines such as Stencyl, Construct2, and Game Maker as well as 3D game engines like Unity and Unreal Engine.  I gave quick demos of each of these tools.  I also covered many of the free tools that can be used to create graphics, models, sound effects, and music.

 

Blasting Bits – Game Design

I didn’t do any coding tonight, so I worked some on design and conceptual art.  Instead of a development update, I thought I would share the designs that I created from my project notebook since I started working on this project.

I’ll admit that I’m not a great artist, but I think I can do good enough to use as a guide for creating the models for the game.  Below is a sketch that I drew tonight that will be the basis for the main character in the game.  I still haven’t finalized a name for this character.  First of all, I knew that I wanted the character to look humanoid, so I used that as a starting point.  The coat is long which almost looks like a cape at the bottom.  I may end up removing this due to the difficultly (and my inexperience) of rendering loose cloth.  Looking into waving flag models may give me some more insight on how to create that effect.  I always hate the sexism in video games debate, so I gave the hero a helmet which allows the player to imagine the hero as a man, woman, alien, or whatever.

The next image contains the notes I made while creating the socket system.  This isn’t inclusive of all of the abilities, but it gave me a starting point on how implement the system.  It’s really helpful to start on paper, that way I can mark out, erase, and add abilities as I get new ideas.

The level editor was and is still fairly simplistic in design.  I will need to modify this design some to handle the location of new rooms.  I’m thinking about letting the left thumbstick control movement on the room grid, and letting the D-pad move between rooms.  If the user uses the D-pad to move to a room that doesn’t exist, then it will prompt the user to create a new room.  There will also need to be some work on how to connect a door from one level to another level.  For now, I’m thinking about just having one exit for each level to keep it simple.  However, I want to make it so that there are a variety of conditions for unlocking the door.  Currently, the player just has to defeat all of the enemies to unlock the door.

Below is the original story concept.  Again, I marked out and revised portions to make the story more interesting.

The most difficult part of coding this game so far has between switching between rooms.  I could have used a standard tile editor to create the worlds, but those make the game world very limited.  My room approach allows continuous scrolling to loop around on a level.  Additionally, it also allows the possibility of moving vertically and horizontally between rooms at the same time without a break.  Most platformers only scroll horizontally or vertically, which requires a break (such as a door) to change the scroll orientation.  Also pictured is one of my notes I made when trying to figure out how to handle placement after collision with a block.

 

I haven’t started creating the game overworld yet, and that may be left out.  Below is some simple notes I made for the overworld, which would allow the player to take multiple paths to complete the game.  Each level would be a different part of the computer world, which would use real computer hardware and software concepts.  Also included are some of the original abilities that I had planned for the game.  The last image shows some of the original level design, but this may change significantly if I scrap the two separate zero and one guns.

 

 

I haven’t done much enemy AI programming yet, but I did jot down some simple enemy behaviors as shown below.

 

Below is a puzzle that I thought about including, which would require the player to shoot letter blocks based on the ASCII character code.  Other puzzles would require the player to shoot switches based on the RGB values.  I think these puzzles would be educational, but maybe to difficult or confusing for most players.

 

Lastly, this is an image of the original design that I created for the game.  Almost all of this will be left on the cutting room floor, but I may use some of the binary concepts as puzzles or a minigame.

Fun with XML

screen087

Tonight, I decided to go ahead and work on the Level Editor some more, so that I can start churning out some levels for a playable demo.  In Resistor, I used Mappy to generate arrays that I hardcoded as constants in my level class.  This probably wasn’t the best coding style, even though I’d bet it is faster than loading from disk.  In addition, I want players to be able to create their own levels in Blasting Bits, which means that having constant arrays is not an option.

screen085

To keep my data clean and organized, I decided to go with the XML format.  I was glad to find out that XNA has methods for handling reading XML files.  I found a good tutorial video by Richard Key of Paranoid Ferret Productions on how to do this.  I tried using this to load a String object from XML stored in my Content project area and it worked perfectly.  The “Boo” message that I entered into the XML file was loaded into the String variable I created using the Content.Load message, similar to a Sprite, Font, or Model.

screen086

However, I quickly realized that there is a problem when trying to create an XML data file for one of my own custom classes.  When trying to set the asset type to one of my classes, it is not able to find my class.  I created a simple Foo class with a Sting and int instance variables.  At first I thought the problem was due to my class not being public, but changing the scope of the class made no difference.  Doing a quick web search showed that this problem has been encountered before.  After digging deeper and consulting the video mentioned before, I believe that the reason why it can’t find my class is because the Content project doesn’t have a Reference defined to my main game project.  I tried adding a Reference, but it doesn’t allow this because it says that it would create a circular reference.  The only solution I was able to find is to create a third project just to hold the XML files.  This seemed really excessive, and this method probably won’t support loading XML files generated by the player so I found another approach.

screen083After finding a great example written by Microsoft, I was able to take  a new Foo object and serialize it.  In the example, it writes the XML to the Console.  Unfortunately, that isn’t very helpful aside from displaying the serialized object.  After some more trial and error, I found that instead of passing Console.Out to the Serialize method I could instead pass another Stream.  At first I tried using StreamReader and StreamWriter, but both of those require a filename, while I just want to store it as a String.  Finally, I found the StringWriter class, which takes no parameters and can hold the value of the serialized object.  The XML can be extracted using the ToString() method on the StringWriter object.  I was able to display the serialized data on the level editor screen.  From there, I just pass the String to my FileSaver class in ResistorKit, which handles opening and writing to the storage device.

screen084

That was enough to melt my brain for one night, so I will continue on later with reading the XML value back into my game object.  Last night I was able to get the remainder of my armor models (helmet, hands, boots, chest) to display in the game.  I also got the models for the basic collectible for money and the gun to display as well.  For now, I just used the second level helmet as the enemy model.  All of these models continually rotate during gameplay.