Showing posts with label debug. Show all posts
Showing posts with label debug. Show all posts

Friday, February 1, 2013

Postmortem: My first year as a Indie Developer

One year ago on February 1st, 2012 I began my journey to learn how to program.

So here we are exactly one year later, I have decided to do a developer postmortem and share my experiences.

To get the full story on my decision to become a programmer you can read my announcement post here but in short I had decided that after doing game related development in every other aspect since 1995 that I would finally take the last step and learn to program myself.

Warning this is going to be long, but I'll try to include as many pictures as possible!

So as part of my motivation plan to learn to program I decided I needed to pick a goal. I decided to try and pick something easy to learn with. Something that would be more motivational than constantly doing tutorials!

So I decided I would make a classic 'match-3' style gem game.

This being a postmortem this is where I tell you how that worked out for me!


Tuesday, January 8, 2013

further optimized saving and loading + bugfixes

I was able to further optimize my saving and loading routines for my platformer engine I'm working on.


In particular I made it so every time you save the following takes place:


  1. The array that holds the current level structure is bubble sorted to move all the 'deleted' items to the top
  2. The save routine skips over the deleted elements
  3. The save routine re-numbers the items as they are saved out to have a new in-order numeral  (this is important because I am limiting my levels to 20,000 sprites at the moment, therefore I need to make sure there are not gaps in the order, nor a jump in numbers)
  4. Once saved out the current level is deleted from memory and the screen.
  5. The array that holds the level is zeroed out
  6. The save routine calls the load routine to load the freshly saved , newly ordered level into memory.
There were a few bugs , such as when I was deleting sprites manually I was not zeroing the array # that held the sprite; therefore I had 'magic' blocks that would come back all by themselves! 

That was a fun one to figure out!

Also because I was bubble sorting, the zeroed out "empty' blocks were getting bubble sorted to the top of the array ( position 0,1,2,3 if there were 4 0's for example) and I had to do a function to count how many zeroes there actually were and subtract that from the total before saving. 

- punchy out

Monday, January 7, 2013

Platformer: saving and loading now works!


I was able to get the file loading and saving working using the structure I described in my previous post.

It works extremely well so far!

I did find a few bugs I need to fix:

1: Saving a file I do a getSpriteExists; if it fails then I write that particular block to be 0's. This later causes "empty" blocks in my structure so I need to do some sort of bubble sort on it.

2: The variable I use to determine what sprite # I'm on needs to be reset when I do a load.  For example if I put down 50 sprites and load the level it resets the sprite count back to 1 and each sprite I put down thereafter effectively deletes one of the loaded ones until I surpass the loaded sprite count (super easy to fix but just sharing what I saw).

Also I want to add some additional functionality such as loading/saving by name instead of hard coding it but I want to iron out the bugs before doing so.

But for my first 'level file format' I am jazzed at how well this is working!  Some times its great when you do some planning ahead of time and everything works out!

Sunday, March 4, 2012

My Visual Debugging Tool

As seen in my post titled "Programming : My Motivation Plan" I had a list of things my inexperience in programming had imagined up that I should work from to produce my game.

I'm going to focus on two items from that list today:

  1. A function to determine the player has 'selected' a gem and chosen to move it to a nearby cell.  This would then swap the values of cell A and Cell B but only permit this swap if it aligned a 3 in a row combo or more.
  2. Mouse Clicking / Swapping Code
To me these were interrelated enough that I needed to consider them together. Eventually as I thought about them I realized this was actually probably another subset of goals.

So I came up with another list of things to try and achieve these goals ...