Final word and improvement ideas
Tutorial
·
Beginner
·
+0XP
·
5 mins
·
Unity Technologies

Your game is now finished, but it’s far from complete! This final tutorial contains a number of challenges that you can choose to complete in order to make your game even better than it already is. When you're ready to share it with others, feel free to upload a WebGL version of your game below!
Languages available:
1. Overview
Now you have a fully functional, endless game where levels keep getting generated as long as you have food. However, the game is quite simple and unbalanced (with all the default settings, the game can be too easy and never stops because you get more food than you use), so below you’ll find some ideas on how you can improve your game while practicing all you’ve learned during this project.
2. Change the board size
The game is constrained to the board size. Experiment with a larger board. Maybe even link the board size to the current level, the higher the level the larger the board. This will require adding a dynamic camera to your project. You can either handle that manually (follow the player character every time they move or when it’s too far from the center of the screen) or use Cinemachine to have the camera smoothly recenter when the player character gets outside a “safe” zone. For more information on how Cinemachine works, check out the Cinemachine package documentation.
3. Change board generation based on level
Reduce the amount of food on the board, change the amount of walls or enemies that spawn, or create different types of enemies. You could even use the level number to determine certain values in the game. For example, have enemies' damage increase by one point every five levels or spawn one less food collectible every five levels, etc.
Play around with balancing these settings to make your game harder as you progress through levels.
4. Wait for a turn
Right now a turn only happens when the player character moves, which limits tactical choice: sometimes it might be more pertinent to wait for an enemy to get closer to attack or lure them one way to go around a wall, etc. Try to add a key in the PlayerController that keeps the turns ticking even when the player character doesn’t move.
5. Items and stats
You can add stats to your player character and enemies, which will modify their behavior. For example, Strength could determine how much damage they can do to each other, Defense could determine how much damage they can block, and Speed could determine how fast they act.
You can also add new CellObjects that can modify those stats: like a suit of armor that increases the defense of the player character, a lunchbox that doubles the food you receive from food items, etc.
6. Speed and timing
One of the stats you can implement from the ones mentioned above is a Speed stat, which would allow the player or enemies to move faster. But one question might arise: how do you handle faster inside a turn based game?
One way is to allow some characters to do more actions in their turn in comparison to others. For example, a fast player character might be able to move twice before the enemy can move once.
Multiple options exist to do this, but a common option used in traditional roguelikes is to use an energy system: you gain a certain amount of energy based on your speed (for example, 10 energy points per point of speed) and performing an action cost certain energy point (for example, moving cost 10 energy points).
In this scenario an entity with a speed of 2 would get 20 energy points, and because moving costs 10 points, they can only make 2 moves per turn.
With this energy system created, feel free to experiment with different ways of handling this new functionality. For example, does each entity act until they run out of energy or does each entity get one action and after all entities in the game have had their turn, the game goes back to the beginning of the list and allows any entity with leftover energy to perform an action?
The good thing about this system is that you can start playing with the energy cost: a heavy attack can do twice the damage, but uses twice the energy, or a running action only uses half the energy, but temporarily makes the player take twice the damage.
7. Menus
The game starts directly into the first level and cannot be quit at any moment. It would be worth adding a main menu where the user can choose to start a new game or access some settings (sound, controls, etc), and a pause menu so they can exit or return to the main menu in the middle of a game.
8. Saving
If you close the game, you will restart at level one when you relaunch the game. It would be nice to add a system that writes the current level and food to a file somewhere on the disk every time you increase the level. That way, when the game restarts, you check if that file exists, and if it does, you read it and set those values before generating the level. And when a Game Over state happens, you delete that file. This is a roguelike after all, so you need to include permadeath!
9. Next steps
You can create more complex level generation with different rooms and walls, different types of enemies, upgrades to your game, etc. From now on, the only limit is your imagination and the time it takes for you to implement all those new functionalities. Have fun with this project and don’t forget to share your creations in the Submission step below, because any good game requires regular playtests and feedback.
10. Share your game
If you need help with building your game for the web, follow along with the Getting started with Unity Web tutorial. Once your game is hosted on Unity Play, add the URL of where it's hosted below, along with a description of your game.