Monthly Archives: February 2013

Developer Diary #4

Implementation Week

This week I didn’t cover any new material from the text but instead took the time to implement fix bugs, implement planned features, and tweak things here and there. Although there is no planned learning material for implementation weeks I learn a lot of things by just trying to do them. Not every little thing I want to do will be found in a textbook so when I am trying to add new features and don’t know where to start I generally look to the excellent Unity Community page Unity Answers or the Unity script documentation.

Implementation Changelog

  • Added coin rankings to the main menu
  • Added all the code to update and save ranking information and display them on the main menu via bronze, silver, and gold coins
  • Added a spell counter to the main level GUI that tells you which ranking you are currently earning based on the number of spells you have cast
  • Added score display to the victory menu. It shows you the score you earned this round as well as what your best all time score is
  • Finished implementing the unlocking levels functionality
  • Moved pause button to the bottom right and put spell counter in the top right
  • Moved the “swings” down to make the level “the swingset” easier to beat
  • Fixed bugs introduced by changing the water colliders
  • Added a clear data button on the main menu
    • So I can erase level unlocks and ranks (mostly for testing)
    • This will likely later be put into a settings page
    • Added several levels and modified a few existing ones
    • Added several “cave” assets for second world
    • Made a sample cave level
    • Added parallax effect to forest levels
      • This includes a new layer in between the foreground and the background that scrolls at a different speed
      • The background also scrolls
      • Added few changes and optimizations to fix graphical and physics glitches on lower end device (droid x)
      • Implemented Journal Entries
        • Journal buttons work
        • Created journal controller persistent gameObject
        • Created one scene for all the journal entries (the text is changed dependent on the button pushed)
        • The first time you beat each “boss level” the next journal entry is forced when you say next level
        • When you start the game with no data you are given the first journal entry

Main Challenges

Cave Assets

The tile sheet I’m using for the cave levels is very confusing. It has many tiles of different sizes and they are not broken up on the tile-sheet. Furthermore it’s unclear which tiles are seamless and which ones can flow into each other aside from the ones adjacent on the tile-sheet and the ones in the sample pictures that came with it. I had to play with it a lot and hand-pick which images I wanted to use for the levels. I also had to edit a few of the images in order to fit my needs.

The other challenge was once I had them in unity I had to create custom polygon colliders for each image because they are not square. It’s important to be careful how you make the colliders so that each one flows seamlessly into the next.

Finally I had to play with the colors a bit to make it look right. The solid color below the foreground is slightly different from the black color that fills the background.


When implementing the journal entries I wanted to avoid making an individual scene for each entry because they would all be identical except for the text. The problem is that in Unity when you load a scene you can’t pass a parameter to it so I couldn’t say “when journal2Btn is pressed pass a certain string to the scene.

My solution was to create a gameObject in the first scene of the game that does not destroy when a new scene is loaded. This means it’s in every scene of the game and doesn’t change its data. Now when I button is pressed I set an integer value in that object which tells the journal scene which string to load.

The next challenge was to design my own scrolling algorithm to read the text as one does not exist for the textMesh solution I use. I created a scroller object that moves its y coordinate based on mouse movements when the mouse is clicked (this works for touches too). Then I used a standard “smoothFollow” script that comes with unity to have the camera follow the scroller object. I got the dimensions of the textMesh and used them to set a min and max to the scroller object so that you couldn’t go too far. When the scroller goes past the end of the text or the beginning it is pulled back at a variable rate depending on the distance. This gives a spring/bounce effect.

Leave a comment

Posted by on February 26, 2013 in Developer Diary


Developer Diary #3

Link to most recent build (as of Feb. 17, 2013)

The Wandering Wizard.apk

Assembling Assets – Lessons from the Text

The chapter that I read from the text this week was all about importing assets and building levels. As it turns out a lot of this information is much more applicable to the creation of a 3d environment, such as building and paining 3d terrain. Although this particular information is not useful for my current project I will certainly reference it again if and when I begin a 3d project. The information that was more useful from the text was about importing textures and using prefabs.

The chapter very nicely went over every option when importing a texture and this really helped me figure out which ones were important for 3d and which ones were important for my project. This also helps me import my textures and make sure they are consuming the smallest amount of space possible. For example “mip maps” load a smaller version of the texture when the camera is a certain distance away and the higher res texture when the camera gets close. I have no need for this because the camera is always the same distance away in a 2d game.

I also learned about different kinds of shaders and what they are used for. In particular I figured out how to use a lit shader vs. an unlit shader. I plan to use this later in my game when I start creating the cave levels. This way I can use light and darkness as part of the puzzles as well as just making the environment look nice.

The last important thing from the text was the encouragement to use prefabs. Although I already knew about prefabs and do use them sometimes this really taught me about their importance. Additionally I learned about making changes to the prefab vs. making changes to the instance of it in a scene and how it affects all of the other instances of the prefab. Now I know I need to apply the changes to the prefab if I want it to affect every instance of it which is very helpful and reduces frustration and time wasted.

Implementation Change log

This week I started working on the actual project again, starting from the prototype I had already created as a base. I began to implement several GUI changes that I had planned as well as improving a few bugs and annoyances that I have noticed while playing the game and watching others play the game. The following list of changes is what I have done so far.

Noticeable Changes

  • Added a new level to the game
  • Made the spell buttons bigger so that they are easier to hit
  • Added “leniency” to the self-casting mechanic so that it’s easier to cast spells on the wizard.
  • Added a pause button as well as a pause menu
    • Removed the restart button
    • Made the level buttons on the main menu larger
    • Made it easier to hit the water with the ice spell by making the collider cover the entire tile
      • Added a second collider with a smaller height to handle the collisions of the wizard, this prevents him from sinking to early and appearing to go through the ground
      • Added a spell tracker that tells you which spell is currently selected.
      • Lots of GUI changes
        • Changed menu backgrounds and buttons to have a better and more consistent style
        • Added some GUI elements of soon to be added features
          • Lock icons to mark locked levels
          • Journal buttons at the end of each row
          • NOTE: these are not yet fully implemented. For now there is a lock on each level covering the number. This is very temporary and should be completed in the next week. Additionally the Journal buttons do nothing.
          • Created a new sprite collection to hold GUI elements
          • Moved all GUI sprites into this new sprite collection
            • Adjusted all objects to use the new sprite collection
            • Adjusted scale of sprites to match the old ones

Backstage Changes

  • Created a new sprite collection to hold GUI elements
  • Moved all GUI sprites into this new sprite collection
    • Adjusted all objects to use the new sprite collection
    • Adjusted scale of sprites to match the old ones

Leave a comment

Posted by on February 17, 2013 in Developer Diary


Developer Diary #2

Design and Planning – Lessons from the Text

This week most of my work came from reading chapter 3 of the textbook which covered design and planning of my game. A lot of the material in the chapter focused on coming up with the idea for your game. It suggested things like writing down a bunch of words that pop into your head, looking and random Wikipedia pages, and going to random entries in an encyclopedia. In my case I already have the concept of my game decided so although this information was interesting it wasn’t relevant at this time for me.

The rest of the chapter talked about planning out your game. It covered things such as a core statement and a list of features and mechanics for the game. Overall it got it into my head that I needed to do some planning and find a way to write down my ideas as they come to me.

Planning the Game

I did a few things to help arrange my thoughts and plans for my game. First of all I followed the game outline form provided in the text which consists of a core statement, list of features, world description, and victory condition/goals of the game. This was somewhat helpful in hammering out the general description and goal of the game. Most of this I had already had a solid idea of in my head but it was good to have things down on paper just in case I need to reference it for further design decisions.

Link to Game Outline

Game Outline


The second thing I did in reaction to the text was to purchase a sketchbook primarily for making level design documents. This way when I have an idea for a level I can quickly sketch it out and write down the important details so that I won’t forget it later when it comes time to actually implement it. Aside from the basic sketch of what the level will look like I can add notes about how the puzzle will be solved and how difficult the level is.

Sketching out all of my level designs is also helpful to give me a better perspective on how all of the levels will fit together, especially considering the early levels. I was careful to design the early levels with the purpose of slowly introducing all of the different spell mechanics so that the player will be able to solve more complicated puzzles when they come.

In addition to level design documents I have begun to sketch other ideas for the game as they come to me. For example I have a few sketches of generally what I’m planning for some of the GUI screens and menus. Another sketch shows what I have planned for a couple of the enemies in the game as well as a prop for future levels that involves enemies. This is very helpful because although I am no-where near ready to implement some of these things I can record my ideas for later.

To view the design sketches go here

Leave a comment

Posted by on February 10, 2013 in Developer Diary


Developer Diary #1

The Groundwork

My first important task for this week was getting some groundwork for the independent study laid out. This consisted of meeting with a few professors and getting the syllabus hammered out. All in all things went very well and I have good direction for the project. The syllabus is now completed and approved by all important parties.

One requirement of the course is a written developer diary which is where this document comes into play. I will document my progress in the project as well as the concepts learned in the course and how I will apply them in this developer diary.

Developing the Story

After working out some preliminary details I was advised to begin thinking out details of the storyline for my game (At this point my concept is pretty solid already). Therefore my big task this week was to think out in greater detail what the story for my game would be and how I would deliver the information to the player.

Story Basics

In this case the story had to be based off of the concept because the concept is fairly unique. The game takes away direct control from the player, having the character walk endlessly forward. The player can only interact by casting spells and effecting the character and the environment with them. This means that the storyline had to explain this behavior and make it make sense.

The first basic concept of the story is that the wizard (main character) has been cursed and can only walk forward. Initially I thought maybe the curse was meant to kill him but I eventually decided that he was actually possessed and the levels were all tests by the soul inside of him to see if he was powerful enough for a powerful ritual.


Once I had a basic idea for the story I had to decide how it would be presented to the player. I think that the best way for me to accomplish this is through journal entries written by the wizard describing his thoughts throughout the game. I love this because it gives the opportunity for cloaking certain information and making everything seem very mysterious. The player will only ever know as much as the wizard knows and he will gradually learn more and more as the game goes on. This will hopefully keep the player engaged as they will want to know the true nature of what’s happening to the wizard.

This idea required me to make an addition to the concept of the story since as it stands the wizard has no way to write journals. As a solution I decided that the entity possessing the wizard would allow him to rest by night (although not allowing him to escape). This way the wizard will have a chance to write his journals. Additionally endless walking wouldn’t make much sense as he would realistically die from exhaustion after a few days or so.


Once I had all the basic concepts fleshed out to my satisfaction I began writing the actual journal entries. So far I have most of the core journals that are vital to the story. Later I can add in additional “filler” journals relaying less important information but still adding to the immersion of the player.

Link to first 7 journal entries

Wizard Journals

Leave a comment

Posted by on February 10, 2013 in Developer Diary