• News
  • Games
  • About
  • Cover image

    Phaser vs. Unity: Making the Switch

    Unity's recent pricing changes have left many developers reevaluating their options, making it the number one reason to consider switching. However, the decision to choose Phaser over Unity goes beyond just pricing. In this blog post, we'll explore some compelling reasons why Phaser might be the perfect choice for your next game development project.

    Author's Disclaimer

    Before I tell you why I switched from Unity to Phaser, I want to make one thing clear: this blog post reflects my personal opinions and experiences. While I've been using Unity since 2017 and started exploring Phaser in 2021, my journey in game development has been more of a passionate pursuit than a professional endeavor. I've participated in game jams and worked on side projects mostly for fun and learning.

    Pricing

    When it comes to choosing a game engine, cost is often the most critical factor to consider. Phaser and Unity present drastically different approaches to pricing, and this is where the distinction becomes crystal clear.

    Phaser: Free and Open Source

    The number one reason for using Phaser over Unity is pricing. Phaser is free, and open source. This means your players can download your game as many times as they want without any cost to you. No hidden fees, no surprise bills.

    blog post image

    Unity's Shifting Pricing Landscape

    Unity on the other hand, just implemented a new pricing strategy, leaving developers and game studios scratching their heads. Let's take a closer look at their new pricing model (image taken from this article):

    blog post image

    The introduction of "price per new install" is the most radical change, which is causing a lot of buzz in the game dev community. X (formerly Twitter,) has blown up with thoughts and opinions on these changes.

    While pricing is the main reason for switching, there are several other reasons I chose Phaser over Unity, even before the pricing change was announced.

    Development

    Speedy development is important. Time is money, and the less time you spend debugging seemingly simple things, the better. Unity requires you to stop the game and restart it every time you make a code change. This is tedious and slow. Phaser on the other hand is a made with JavaScript, and you can use the browser as your debugging window. Making code changes and enjoying the convenience of hot-reloads (where the browser automatically refreshes when you make code changes) and fast loading times is a breeze. It's difficult to beat Phaser's fast development cycle.

    Reduce Scope, Finish Your Project

    Using Phaser will automatically force yourself to scope your project smaller, which is a good thing if you're an indie game developer like myself. Unity has a ton of features, and it's easy to get lost in the jungle of everything they have. I find myself playing more around with Shader Graph than making an actual game.

    Phaser is a 2D game engine. If you want to make a 3D game, Phaser is not for you, but if you plan on making a 2D game, Phaser is a lot more comfortable to work with than Unity. Unity was made primarily for 3D games, but they do support 2D games as well.

    Effortless Version Control with Phaser

    Have you ever tried to use versioning, such as GitHub or BitBucket for a Unity Game? I have, and it is not a pleasant experience. The project files can become too large, and the repository won't even make you save all your changes. I end up storing the complete project on Google Drive. Maybe I don't know the best practices for Unity Project. Larger studios with multiple developers may have valuable insights into proper versioning practices.

    Phaser on the other hand is easy to use with versioning. A phaser project doesn't consist of thousands of files, and several hundreds of mega bytes, or giga bytes. Phaser games are relatively small in comparison. If images, models, and textures are too large, you can leave them out of the version control. I have never had that issue, and keep everything nice and tidy in GitHub.

    Platforms

    Unity has the upper hand when it comes to the various platforms you can build your game to. Unity supports (almost) everything, but Phaser only supports web out of the box. You can build your Phaser game to other platforms as well, but it requires some extra setup, for example using Electron. It can be challenging for someone who is inexperienced with web development to accomplish this. There are tutorials out there that can help you build your game for Steam, iPhone, Android, and desktop. I use Phaser mainly for web games, where Phaser shines. You don't need any plugins, and you don't have to download a runtime. Everything just works.

    Performance

    Phaser was built with JavaScript, and runs natively in the browser using Canvas and WebGL. It's difficult to beat web performance with Phaser, considering it is meant to run on the web. Unity can create web builds by compiling all the code into web assembly. I won't say Unity has poor performance, because it runs well on web too. I have one 2D Unity game I created for a game jam: https://johnonym.itch.io/secret-moon-shards, and I haven't experienced any issues with web performance. However, a Unity game built for web may end up taking a lot more space than necessary, and the user has to download several mega bytes to play the game. Phaser does not include a lot of overhead in comparison, and therefore loads faster. My game, Toki, is created with Phaser, and the code itself is less than 1 MB (images and sound files not included.)

    Community and Examples

    Looking at Unity today, the community is enraged (because of the new pricing policy.) I don't know what the future holds for Unity, but it doesn't look good considering the circumstances.

    Phaser has an active community on Twitter, Discord, and their Forum. It's easy to ask questions on Discord, and you can get answers quickly. Phaser is also in active development, and they are even working on version 4 (while still actively working on version 3.)

    Both Unity and Phaser have good examples. Phaser has a library of examples for everything you need https://phaser.io/examples, and they are easy to break down, and use them in your own games.

    Unity has https://learn.unity.com/, a great place to learn how to use the engine, and I think Unity excels in the availability of examples you can find. It's also easy to lean Unity from YouTube, with lots of good examples and tutorials.

    Conclusion

    If you want to make 2D games mainly for the web without having to worry about pricing, then Phaser is a good choice for you.

    If you want to make a 3D game and easily create builds for several platforms, then Unity, or another 3D-oriented game engine is a better choice.

    If you liked this blog post, or want me to elaborate on other topics, consider following me on Twitter, @ReitGames, and subscribe to my weekly newsletter for more posts about game development. Happy coding!