I was always wondering how games work internally and how do the game devs make their mechanics. I am also impressed by how much game engines and physics engines have improved over years such that they are able to simulate realistic physics phenomena easily such as flowing water. I am a 4th-year college student and so far most of my projects have been related to web dev or app dev using javascript or java. I also play a lot of games and wanted to give making one of them a shot since they always intrigued me.
I started my game development journey in July 2020 and learned Unity with the goal of making my own first game. This article will go through what I learned in the process of this project and obviously the mistakes I made.
Choosing A Game engine
So my main choices were unity and unreal. I looked at some game engines that used javascript like Phaser.js but they usually had low tickrates and could not handle complex physics simulations and also needed a lot of optimizations to run smoothly. It also seemed that the amount of code required to achieve a simple thing was really big.
So I ended up with unity2d and unreal engine. After going through some forums and Reddit posts I decided to go with unity since it was more beginner-friendly and had better support for 2D games.
Learning Path
I decided to go through some forums to look for good tutorials, which pointed me to a udemy tutorial and some YouTubers such as brackets. But for the basic interface and fundamentals I decided to learn from Unity Learn plateform courses, they are really well explained, and with some practical examples of games to do step by step.
I then found this really good course on udemy which was perfect since I also wanted to port my game to mobile platforms in the later phase.
Starting my game
I decided to make a simple 2d platformer with basic controls. Since I was working alone I did not want to make a 3d game which required way more work than a 2d game. I consist of basic movement, jump, and attack mechanics. You need to traverse through the level to find two chests that will unlock the door to the next levels. It has few enemies placed on the map that will attack you and follow you to a certain distance. All the assets I used were freely available on the web like the dungeon explorer pack.
There are somethings that I realized at the end of the development cycle that I had done right and some that I completely failed at.
Things I feel like were good
- Planning
Since I have worked on a lot of projects I have experienced end that good planning can make or break your projects. I used agile methodology to set my tasks and define the end goal.I think it’s important to restrict yourself and don’t set unreachable goals, because you may fail to achieve it and it’s discouraging.
2.Defining useful prefabs
Unity Prefab system is really easy to use and very powerful, it helps you reuse objects,animations, scripts, and everything you want between multiple scenes. I used it for my player, enemies, and chests so that I don't have to define their animations and characteristics when I place them around levels.
3. Asking for help
Don’t get stuck too long on something, it usually means that you have to ask somebody’s help or find some resources on the Web (YouTube videos, articles, StackOverflow questions, etc). The Unity community is awesome and you rarely ask a question that nobody has previously answered. If nothing works you can have your doubts cleared in the discord communities of game Dev.
Things I realized I had not done
- Testing
Unity manager rushes to dispatch the game, as your game gets greater it gets excruciating to be certain everything works effectively. I didn’t consider the time it will step through me to test my game after every little change. The time devoured to learn and do unit tests would have diminished the genuine opportunity to test my game.
2.Performance
This was my biggest mistake, while the game runs perfectly fine on pc when I ported it to mobile it was super slow running at 10fps. After some asking around I found out that this occurred due to poor optimization of physics and scripts.
Conclusion
The game is not perfect and currently only has 2 levels but I have achieved my goal of learning unity and making a playable game with it. Like all projects, we have to try, make mistakes, learn from them, and be better next time. I will try to optimize my next game more, overall this was a fun experience and I will make more games in the future.