Floating Socket

Small update tonight to implement three new boot sockets.  These new sockets allow the player to float in the air after reaching the apex of the jump, if the jump button is still held.  The amount of float time is static (20 frames), and that time is doubled for the Float +2 socket and tripled for the Float + 3 socket.

 

As with the “looking up” and “looking down” states, the floating state does not currently have animation sprites.  Therefore, I just have the word “floating” display on the player for testing purposes.

Floating could have been implemented many ways, but I like booleans so I created an isFloating bool to signify if the player is floating.  I also have an integer tracking the amount of float time.  When the player jumps, if a Float socket is equipped then the float time integer gets set to the number of frames that the player should float based on which Float socket is equipped.  When the player’s jump acceleration reaches zero, then the isFloating value gets set to true if the float counter is greater than zero.  Otherwise, the player will start falling.  On each update, the float counter is decremented until it reaches zero.  At that time, the player will start falling as they normally would after reaching the jump apex, and the isFloating bool gets set to false.  The separate bool and integer variables may be slightly redundant, but I think it makes the code more readable.  A future optimization could be to replace the bool variable with a function that returns true if the float time is greater than zero and false otherwise.

I also slightly modified the crouching code.  If the player is walking and rolls the control stick to the down/forward position, then the player will walk and look down.  From this state, if the player rolls the control stick completely down, then the player would still be looking down and standing (not crouching).  This was to prevent the player from crouching when holding down and forward, when the player should be moving.  In ResistorKit, I only have methods that fire when up, down, left, and right are pressed or released, so the crouching code was only fired when the down and pressed action was fired.  The player is not allowed to crouch if the jumping, falling, or walking states are active.  To fix this, in the code that causes the player to stop walking, I added code to set the player to the crouching state if the player is looking down.  This behavior is slightly different from other classic platformer games that also don’t set the player to crouching when rolling from foward to down, but I feel that my new way feels more natural.  With the old way, the only way to crouch was to press directly down from a standing position which feels clunky.

Floating was a fairly simple mechanic to add in about two hours.  I’m hoping to get back to character modeling, but there is a huge learning curve for me to complete that task.

Five Years of Ludum Dare

Updated April 13, 2018

This is a compilation video of all of the Ludum Dare games that I’ve created over the past five years. I started with Ludum Dare 26 in April 2013, and I’ve completed 15 straight compo entries since. The video shows gameplay highlights (post-compo version in some cases) along with a portion of the time lapse development.

My thoughts on each of the games.

Amish Brothers – This was my first Unity game and first Ludum Dare.  I made the game about the Amish after hearing about their minimalist lifestyle.

Bomb Squad – This was a more action packed game.  I was able to experiment with the Unity physics engine.  Exploding bombs seemed to go well with the 10 seconds theme.

Tex Oneman (One Gunman) – I wanted to make an educational game.  The gameplay was inspired by the old Number Munchers game.

Archaeology – I wanted to have a game which used heat maps, but it really didn’t turn out how I wanted.  I also experimented with modifying terrains in real time.  The idea for appraising treasure found came from the Pawn Stars show.

Dream World – This was my attempt at making a spooky game.  It was inspired by Little Nemo the Dream Master for the NES, which is where the idea of making it to the bed originated.  It was my first game to use Taron Verve Painter, and my first Stencyl Ludum Dare game.

TV World – A side scrolling shooter inspired by games like R-Type.  The objective was to fight your way through each of the television channels.

Expand-O-Ray – The idea for this game came from the Revenge from Mars pinball machine that had the Big-O-Beam ray that made chickens grow huge.  The game had many references to Georgia Tech, such as the SkilesBot and 1885.  I eventually got the gun attached to the robot’s hand in a post-compo version.

Monster Hotel – A game inspired by the gameplay of Lemmings, but with a monster theme.  Using a minor scale for the music gave it a more creepy feeling.

Mutant Veggie Arena – A first person shooter with a sci-fi theme using mutant vegetables.  This was my first 3D game that used 2D billboarded sprites for the characters.

ShapeQuest – This game started as a Godot engine game, but switched to GameMaker after things weren’t working correctly.  The enemy shape faces were inspired by the profiles in Punch-Out!!.  Some of the enemy movements and attacks were inspired by the Legend of Zelda.

Ancient Adventure – Another game inspired by the Legend of Zelda, but created in 3D with an overhead view.  A lot of issues with the original version were fixed in the post-compo version.

Free the Frog – This was my attempt at making a game with Frogger gameplay in 3D.  The controls differed from my other games, since when a move button was pressed it would set the target square and then pull the player’s character to the destination.  This was also my first time using Blender’s cell fracture plugin.

World Fighter, the Cosmic Warrior – A game inspired by the gameplay of Final Fight.  The movement of the planet and moons were inspired by an enemy in an old RPG, but I can’t remember which one.

Slowbot – I really wanted to give a feeling of running out of power, which was the theme for that Ludum Dare.  The speed, headlight, and motor sound were all affected by how much power the robot has.

Irwin McSpenders – I had the idea for a tax accountant game for years, but I just never made it.  The player’s score would be based on the amount of money and dependents the player collected.  I used real deductible and tax bracket values, which took a considerable amount of time.

 

File Saving Madness

Save Game

Staying true to being a ripoff of Java, C Sharp makes saving files extremely painful just as Java does.  I just want to save the player ranks and the highest level completed, which would probably be 5 to 10 lines of code in Ruby.  This is more confusing in Java, since two or three different writer classes must be created.  In XNA and C Sharp, the method for saving files is poorly documented.  There is some documentation from Microsoft on saving files, but the code is really fragmented on the page, it doesn’t explain where some of the core objects (like StorageDevice) are created, and I could never get the XML serialization to work even though I imported the  XML/Serialization references multiple times and have all the requried “using” statements in the class headers.   They do include a ZIP file of example code, but it doesn’t include the necessary references, and it is really spaghetti code because it tries to perform every single file operation known to mankind in one class file.  Therefore, it becomes an Easter Egg hunt to get it working.  The NeHe tutorials are a good example of how to properly write code tutorials.  This thread gave some additional insight on how to write save game files, but as one poster mentions it is not compatible with XBox360.  Found another tutorial, which seems to be simpler to follow since it doesn’t include all of the XML serialization, which is really overkill for what I’m trying to do now (just writing integers to a file).    This is also becoming very aggravating because it never explains how to actually get a handle to a StorageDevice instance.  These examples  just show the StorageDevice object being passed as a parameter.

Now I know how this guy feels.

So after about an hour of debugging the example StorageDemo code, I was able to get it working in a new game project (still can’t get the [Serializable] error to go away, no matter how many includes that I have, so I just commented it out).  I’m starting to think that it is not possible to display a device selection screen in an XBLIG (XBox Live Indie Game), because I don’t remember any other XBLIGs having a device selection window.  Also, I checked my XBox360 System storage settings, and there didn’t appear to be any data associated to any of the Indie games that I have played.  I know at least two of the Indie games I’ve played have had save capabilities, but maybe it was not done through the standard XBox storage device select interface.  Maybe the device selection capability is blocked in Indie games, just as the Achievement system is blocked.  The Indie games that did have saves either made saving ubiquitous or they have a custom designed save screen.  Ubiquity is great, and that is definitely the saving approach I want to take if possible.  The only problem is that it prevents the player from wiping their data from the System dashboard menu, if the player desires to start the game fresh.

Triumph

So after 4 good hours of reading unhelpful message threads, poor examples, and endless debugging, I was able to develop a solid method for saving text data to a file.  This works for both XBox360 and Windows.  The code is below.  This is ALL that is required!  I don’t have a CLUE why something this relatively simple was made so complicated in the examples!  My code could be improved by adding the ability to read multiple lines (instead of using just one single line).  Comments are welcome to improve this code, but this works for me so I’m not changing it unless there is a REALLY good reason.

Update:  I’ve learned that using a callback method with BeginShowSelector is the best way to read and write to a file.  Also, not specifying the PlayerIndex for BeginShowSelector makes things much simpler, because you don’t have to worry about if the player is signed into a profile. 

Important:  Also required is a call to  add a GamerServicesComponent to the Components collection in the constructor of the main game class.
   this.Components.Add(new GamerServicesComponent(this));

So it’s hard to capture the saving ability in a screenshot, but I now have the save method just writing the maximum level completed to the file.  Below is a fresh instance of the game started, with the max level data loaded from the save file and displayed on the screen.  The max level data was written to the file in a previous game instance.