Unity vs libGDX – 2020 already, which one to choose now?

Tram Ho

Up to the time I wrote this article, the development of the game was actually a lot easier than it was a long time ago. With the hegemony of different tools and frameworks, there is probably almost no common programming language that doesn’t make games. I will name some names like Unreal Engine that supports C ++, open source Godot using Python, with libGDX you can write code in Java and implement Unity C #; Your choice has never been easier. However, it is also because there are so many options that for a beginner to find out, there will be many difficulties and misunderstandings. So in this article, I will choose two bright candidates, libGDX and Unity, to compare them in many respects starting from the initial installation and all the steps in the game product development process. .

Before starting the comparison, I should have introduced myself so that you think whether you should believe me or not. I started my professional software development career in 2014, primarily (but not limited to) specializing in Java. Game development has always been my passion and so far I have released 3 2D games for Android. The first one took me about 2 years and was developed in libGDX. In the next two times, I decided to switch to Unity and from mid-2017 until now, this is the only tool I’ve been using. Worth mentioning is that this article focuses primarily on developers because using libGDX requires specific programming skills. If you are a game designer or artist, I will save your reading time with a very clear sentence: Use Unity!

Setting

1. LibGDX

Assuming you are already a developer, libGDX is easy to get started and you do not need to install any additional applications. Just downloading the Project Setup App will create class-based projects to be imported into your favorite IDE. This frameworks JDK 8+.

2. Unity

When I first started with Unity, there was no Unity Hub and managing all the different versions made game development quite complicated because any new Unity version was installed as an application. separate use. The Hub significantly reduces the process that allows you to install and uninstall existing versions. Now to get started with Unity, you’ll need to install Unity Hub, Unity itself, and the IDE to work with C #. Previously, Rider was just a plugin for Visual Studio, the most popular IDE. Thankfully, people from JetBrains decided to improve the lives of developers and release an independent version in 2017.

3. Conclusion

Both libGDX and Unity will require platform-specific dependencies, for example, for Android, you’ll need the Android SDK or even the entire Android Studio.

In the end : libGDX is a bit easier to install because of less dependencies, but the introduction of Unity Hub has greatly improved the Unity installation process.

Familiarization process

1. LibGDX

If you are considering using libGDX, you are probably a professional developer with experience in Java or other OOP languages. That means you know how to code and learn new frameworks very well. In addition, there are many guides available online. Plus a familiar environment with your favorite IDE, you’ll be fast to get started.

2. Unity

Unity requires time and patience especially if you, like most developers, prefer code instead of clicking on different buttons and dragging objects. The desktop is a huge piece of software with a lot of settings to configure and to be honest, after working with Unity for a few years, I’m still looking for a Way to open the Asset Store. It simply cannot remember everything. On the other hand, C # is relatively easy to use for development, especially for people with previous OOP experience.

3. Conclusion

In the end : The programming language part is the same difficulty but it will take time to learn and master the Unity screen.

Work progress

1. LibGDX

There is no user interface to help you develop games in libGDX. Whenever you want to place a button, a text or a game object you make through the code in the hope that they will at least be seen on a scene. Sure, over time, you’ll build helper classes to put elements in place, but whenever there’s a new section, you’ll need to extend existing utilities to protect it. Another major problem I encountered was building a user interface that worked correctly with different screen aspect ratios. I had to rewrite this section many times until I achieved the desired result. Surprisingly, there was not much useful information on this issue before.

2. Unity

Unity on the other hand is a user interface driven tool. Once you get used to it and understand it, the power of game development really awakens. You can drag and drop, scroll and click, rotate and scale. You don’t even need to code at all when trying to create some simple games. All unique in-game user interface elements, adhesives or sides of the scene, and multi-aspect ratio handling are supported in the off-stream. With a few clicks, you can arrange a prototype with different game objects on a scene. On the other hand, Unity is a program created by other developers and it certainly has quite disturbing bugs. Whenever there is a new Unity release, the first part you’ll see will be hints of what went wrong when updating the new version. It is indeed a pain that many people encounter, even some people do not understand why the error arises when everything is working well.

3. Conclusion

In the end : The sample interface is definitely much faster in Unity and the desktop itself has helped a lot in the process.

Manage code and dependencies

1. LibGDX

libGDX is written in Java, so you create your game entirely in Java. The frameworks themselves have great documentation, very easy debugging, and all the Java 8 supported Android features can be used. Managing dependencies handled by Gradle is very convenient to use. There are many components available in framworks but still not as much as in Unity. As an example look at the programming aspect of 2D animation processing. In my first game, I ended up with a fairly complex helper class to create a consistent animation. In Unity, this is just a drag and drop problem without spending a single line of code.

2. Unity

In Unity, you’ll use C # because in August 2017 UnityScript and Boo were officially discontinued. Having many years of Java experience, I had no problem using C # with my proficient OOP skills. Dependencies are managed through Package Manager or 3rd party plugins stored along with your own project files. The best part of coding in Unity is a large set of components built with all the useful methods in place. Like animated objects, music or images – we don’t need extra code to make them work. As a result, you can devote more time to essential game mechanics instead. But note which IDE to use! My only option is JetBrains Rider, which provides developers with smart code completion, performance highlighting, documentation, and more, but it’s a waste of money, but it’s worth it. !

3. Conclusion

In the end : Coding is a bit better in Unity because there are many components built.

Community

1. LibGDX

libGDX version 1.0 was released in 2014 but developers have been using frameworks even before. During those years, a lot of questions were asked and answered on StackOverflow and hundreds of written instructional videos and videos were created. There is also a fairly active official libGDX forum where one can seek the help of maintainers. What’s even better, libGDX is an open source project hosted on Github which means anyone can contribute. I personally had a PR merged there, so what I said was completely true!

2. Unity

Community solidarity is huge, much bigger than libGDX. But there is a catch – you can find lots of questions and answers but many of them are outdated or simply wrong. You must always be pragmatic and check the solution provided on other official resources and documents. On the other hand, Unity developers publish many high-quality blog posts and tutorials that can be considered the most reliable source along with the codes attached to the back.

3. Conclusion

Ultimately : Find a working solution suitable for libGDX easier and faster.

Game release process

1. LibGDX

Since I have only developed Android games so far, this section will describe the process for that platform. Developing iOS in general is not particularly easy as it requires the Mac to install Xcode. In JetBrains products – be it IDEA or Android Studio – the release is done through a single click doing a few Gradle tasks.

In the latest IDE version, there’s an option to build a simple App Bundle or old APK. On the bottom, you still have to know how to handle gradle wrappers, AndroidManifest, and application icons because all the required components must be in the right place.

2. Unity

The release process of Unity is done in quite the same way, but all the basic processing is hidden from our eyes.

Gradle is still implicitly done, but you don’t need to know about it. What I particularly like about Unity is the series of settings that one can configure for the project through the Player Settings window.

On a single screen, you can choose the Target Architecture level and Android min max API level to use, place your icons, set supported screen orientation and more. Such an abundance of options can be overwhelming, but once you grasp it, all the settings are gathered in one place with nothing but convenience. Both App Bundle and APK are also supported.

3. Conclusion

In the end : The release process in Unity is better due to the flexible project configuration and little knowledge of certain platforms to know.

Summarizing

Now that you know more about the topic and can make your own decisions about what to use. Working with libGDX will probably improve your Java coding skills while mastering Unity may be able to expand the next career opportunity.

Game development is fun but also challenging, so let the right technology chosen things become easier!

The article was translated and modified from: Unity vs libGDX – what to choose in 2020?

Share the news now

Source : Viblo