First Time with Unity: Building a Complete Game with Amazon Q
As a game developer with 2 years of experience on other engines who had never touched C# or the concepts of prefab, Inspector,..., I thought that switching to Unity to build a complete game would be quite difficult. But the truth is that Unity is both interesting and challenging, especially when having to get used to the new interface, different design thinking and the way Unity manages the game lifecycle.
Published Dec 26, 2024
As a game developer with 2 years of experience on other engines who had never touched C# or the concepts of prefab, Inspector,..., I thought that switching to Unity to build a complete game would be quite difficult. But the truth is that Unity is both interesting and challenging, especially when having to get used to the new interface, different design thinking and the way Unity manages the game lifecycle.
If you’re used to other engines where the interface is often code-centric or simple panels, the Unity Inspector can be overwhelming at first. In the Inspector, each GameObject comes with a bunch of Components, from basic ones like Transform (position, rotation, and scale of the object), Renderer (displaying images), Collider (handling collisions), to more complex ones like Scripts (custom code).
At first, I was lost in a maze, not knowing what to change and what to leave as default. Just understanding each component took quite a bit of time, let alone adjusting the right parameters to achieve the desired effect. For example, an object can contain a Mesh Renderer, Material, Animator, and each component has dozens of small settings. This took me a lot of time to fumble around, especially when I wasn’t sure how the changes would affect the game’s outcome.
At first, I was lost in a maze, not knowing what to change and what to leave as default. Just understanding each component took quite a bit of time, let alone adjusting the right parameters to achieve the desired effect. For example, an object can contain a Mesh Renderer, Material, Animator, and each component has dozens of small settings. This took me a lot of time to fumble around, especially when I wasn’t sure how the changes would affect the game’s outcome.
In previous engines, everything I did started with code. I created objects, assigned values, and handled everything in the command line. But when I switched to Unity, this approach no longer worked. Unity encourages you to use Inspector to drag and drop GameObjects or assign values directly into the script instead of manually configuring them in the code. For example, when I write a C# script, I have to declare [SerializeField] or public variables so that they show up in Inspector. Then, I can drag and drop objects into these fields instead of writing initialization code. At first, this made me very confused because I was not used to the "do first, code later" mindset.
In addition, editing parameters in Inspector while the game is running (Play Mode) is also a "trick". I thought the changes would be saved, but when I exit Play Mode, everything goes back to the way it was. There were many times when I edited for an hour and then forgot to save the changes outside of Play Mode.
In addition, editing parameters in Inspector while the game is running (Play Mode) is also a "trick". I thought the changes would be saved, but when I exit Play Mode, everything goes back to the way it was. There were many times when I edited for an hour and then forgot to save the changes outside of Play Mode.
When I first came across Prefab, I was completely captivated by its convenience. Prefab helps me create reusable object templates, which makes it easy to change and manage multiple similar objects without having to waste time creating new ones each time. But what I didn’t expect was… Prefabs don’t always save changes automatically.
The first time, I edited a Prefab in a Scene, and I was confident that everything was saved. But when I went back and checked, I realized that the changes weren’t applied to the original Prefab. That’s when I discovered the legendary “Apply Changes” button that Unity offers. One click of Apply and the whole world changes! If you forget to click Apply, all your editing efforts will disappear when you exit the Scene.
That’s when I learned an important lesson – that “Apply Changes” is not just a simple operation but an essential part of the game development process with Unity. It felt like a great discovery when I discovered it, helping me easily manage and update Prefabs throughout the project without worrying about losing changes.
Since then, whenever I work with Prefabs, I always make sure to press "Apply Changes" before exiting any Scene. Because no one wants to lose work just because they forgot a small operation!
The first time, I edited a Prefab in a Scene, and I was confident that everything was saved. But when I went back and checked, I realized that the changes weren’t applied to the original Prefab. That’s when I discovered the legendary “Apply Changes” button that Unity offers. One click of Apply and the whole world changes! If you forget to click Apply, all your editing efforts will disappear when you exit the Scene.
That’s when I learned an important lesson – that “Apply Changes” is not just a simple operation but an essential part of the game development process with Unity. It felt like a great discovery when I discovered it, helping me easily manage and update Prefabs throughout the project without worrying about losing changes.
Since then, whenever I work with Prefabs, I always make sure to press "Apply Changes" before exiting any Scene. Because no one wants to lose work just because they forgot a small operation!
But the difficulty did not stop there. After more than 3 weeks of diligently learning Unity, I realized that there were many things to learn and optimize in code. Although I had started to get used to Inspector and Prefabs, optimizing source code and reducing workload was still a challenge. So, while "groping" through the pile of documents and looking for support tools, I discovered Amazon Q - a perfect coding assistant.
Amazon Q not only helps me write code faster but also automatically suggests optimal solutions for complex code segments. With the ability to understand context, automate programming operations, and help me optimize code from algorithms to performance, it has saved me a lot of time and effort. In particular, Amazon Q has helped me solve problems that I previously did not know where to start.
Check out the before and after specs I used with help from Amazon Q:
At first glance, the visual difference might seem minimal since it's just a 2D game, but the performance improvement is undeniable. The smoother gameplay and more responsive controls are clear signs that the optimization did its job. This is one of the many ways Amazon Q has helped me improve not just the code but the overall experience of the game.
Not only does Amazon Q help optimize my code, but it also teaches me new concepts that I didn’t encounter in the engines I worked with before. Learning Unity has been a bit of a challenge at times, but thanks to Amazon Q, it’s been so much easier. It introduced me to features and best practices that other engines didn’t have, and that has made all the difference.
Thanks to Amazon Q’s amazing features, I’ve learned how to present my code in the most efficient, readable, and understandable way possible. It's one thing to write code that works, but with Amazon Q, I now understand how to write code that works better and smarter, not just faster. The optimizations and suggestions I get help me elevate my skills and deliver a much cleaner and more professional result.
And here is the best part! Amazon Q helps me optimize not only the source code but also the way to deploy online games without having to worry about writing complex code on the Node.js server.
All I need to do is provide Amazon Q with the algorithm – and that’s it. Amazon Q automatically handles all the work related to managing player connections, synchronizing game state, and performing network events without having to write a single line of complex server code. I just need to focus on the logical algorithms and Amazon Q will help me convert and deploy them smoothly and efficiently.
With Amazon Q, building and maintaining an online game has become much simpler. Instead of having to worry about complex issues related to servers and network communication, now I just need to provide the algorithm and Amazon Q will take care of everything. This not only saves me a lot of time, but also speeds up the game development process and reduces the chance of errors during deployment.
And Then In 2 Days, A Server To Store And Process Player Information Was Completed With Just A Few FilesResult:
In just 2 days, my game was basically completed with online features, running stably on a powerful Amazon EC2 server, and all optimized by Amazon Q. I no longer had to worry about server management or writing complex code for network features. All I had to do was focus on improving the algorithm and let Amazon Q take care of the rest.
With the support of Amazon Q and Amazon EC2, I was able to turn a 2D game idea into a complete online game in a short time, without having to face difficulties with infrastructure and source code optimization. The game now not only runs smoothly but can also be flexibly expanded as the number of players increases.