Big Game Project – Week 5

This week I spent most of the time building the menus of the game, as well as a start of the save and load features of the game. We had Alpha playtesting on Friday, so we had a deadline to meet this week. Alpha for us meant that we wanted all our features in the game, even if it meant they might be in their simplest states.

Image

Above is our current world map of the game. It features boxes that represent levels, a red dot that represents which level is selected and buttons with fairly obvious functions (except for the reset level, which I will get to in a moment). It also shows the female avatar in the top right, and her current level.

There’s something we call an invasion system in the game, which affects the levels as they are completed, but before I get into it I will recap on what the game is. The game is called “Tower Offensive” and is a Match Three/Tower Defense game with a 2D isometric perspective. The player is invading a country and has to match resources to be able to build the towers so that the enemy forces can be pushed back.

Invasion System

Once the player has completed a level all the towers are saved so that once the player returns to the level they are still there. Now you might ask yourself, why would the player play the level again if they completed it? That’s where the invasion system comes in. Eventually after the player has completed the level, the enemy troops will try to take the area on the map back, meaning that you will have to go back and defend it. If you don’t, you will lose the bonuses you get for holding that area. If you look back on the map from earlier you might see two levels that have increased resources, +2 coin and +2 wood respectively. When you complete a level like this one you will gain extra resources as long as you hold that area.

After a certain time an exclamation mark will appear on levels you have completed, indicating that enemy forces are trying to take it back. If you ignore it for too long (time passes each time you play a level) they will succeed.

Currently there are only 10 levels starting from bottom right to top left in difficulty, but for the final release (which we’re planning to make on tablet) we’re hoping to have more. The last two levels on the map are still not quite finished, therefore the “Out of Order!”. The more levels we have, the more interesting the invasion system will become, forcing the player to choose between trying to progress quickly without bonuses or going back and defending them.

Saving and Loading in Unity

As as I started working on saving the game I found out that Unity has a pretty neat way of handling save and load, called PlayerPrefs. PlayerPrefs lets you save and load String, Integer and Float values with key names that you use to later load them through. What I found more, though, is that there’s a faster implementation of it from PreviewLabs. This suits us very well since we will need to optimize the game for tablet release eventually. It’s very easy to use and so far I haven’t seen any problems with it. Since they released it roughly three years ago Unity has updated their PlayerPrefs but PreviewLabs implementation is still faster.

Each time you load a new scene in Unity every object on the last one is destroyed unless you say otherwise. Since we use different scenes for each level and menu in the game, we need to somehow save data such as avatar experience and player score for levels. Therefore I created a class called Blob, because it will hold a lot of various information that we need to keep from getting destroyed in scene loading. The blob is a somewhat of a Singleton, there can only be one of it, and it exists throughout every scene. It’s where I save every level’s towers and stats, along with player experience, level, score and other various data. It’s used for a lot of things, and probably isn’t the best way to do it, but it works.

Next week we will be focusing on getting what we have in the game more polished, as well as trying to get as much feedback into the game as possible. It’s about time we get some fancy particle effects into the matching field.

 

Until next time!