How do we face the challenge of working with multimedia content?
By Alan Rosas and Shanlogauthier, Software Engineers at etermax
In the New Games team at etermax we are dedicated to generating new proposals and initiatives when developing a new product and we aspire to innovate in new game mechanics.
At etermax we seek to think outside the box and aim for the stars. For this reason, at New Games we look for the best levels for the requirements of new products. Currently, we face the challenge of working with multimedia content and, in this context, we detect that Flutter is the alternative that empowers us the most and allows us to achieve our goals. Although we are fans of Unity, the game engine where we develop most of our products, in this case we cannot maximize its specialized gaming potential.
Due to this, in our squad we ventured into an investigation through different Frameworks and technologies that could meet our needs, and in the process we found that Flutter is the best tool and the one that best suits our needs.
What is Flutter?
It is an open source SDK created by Google for the development of applications, both mobile and desktop.
Flutter uses the Dart language, aimed at developing apps based on Widgets. In simple words, it separates the logic of the software into the most atomic and focused parts together with its visual representation.
- Time saving in development of devices, as you can export for both Android and iOS.
- It uses native features
- It makes use of Material Design from Google, and Cupertino from Apple.
- It has a hot-reload feature, which allows you to develop your widgets and see the changes in real time on your device or in the simulators.
- Abundant documentation in several languages, apart from being supported by a company like Google.
- Great growth of the developer community in recent years.
- Increase in the interest of Google to compete in this market.
- Ease and agility when developing applications.
- A large community that generates plugins to facilitate various tasks, as well as being properly documented and valued, both by Flutter itself and by the developers who consume these packages.
- It is a relatively young framework, which will grow together with its community, and the technology will be stressed to a greater extent.
- Many packages or plugins are still being developed or are in early stages for large products or large production development. For example, they don’t currently have an AR or VR one.
- Learning a language that at the moment is only used in Flutter development.
Why Flutter instead of Unity?
Unity is a game engine while Flutter is an SDK made for developing apps. Each one has its purpose. If we wanted, for example, to make a food delivery application, it would not make sense to use Unity since the integration with the map is complex, the size of the app would be too large and we would use many more hardware resources that would not be necessary for what is being developed.
On the contrary, making a 3D game in Flutter with animations, 3D models, visual effects, and cinematics is very difficult or impossible (although progress is being made in that direction). Flutter is not an SDK specialized in video games, while Unity is. In fact, if we wanted to develop a VR or AR application in Flutter, it is very likely that the solution would be to run an instance of Unity inside Flutter, since Flutter does not have libraries like ArKit(iOS) and ARCore(Android) .
For example, nowadays as we develop using multimedia content, we need to work both with the camera and with files inside the phone, and everything related to permissions is handled in a much more direct way than when using Unity.
What is the best way to evaluate a technology?
Considering our experience, we took into account the following key points:
- What do we want to develop?
- Application performance.
- The ease in developing our features and their scalability.
To show the benefits that Flutter has over Unity, we made a small project that contains a carousel with the iconic characters from Trivia Crack.
Below you will find the code so you can have this experience of creating a carousel for yourself, in a very easy way. If you want to give it a try, you can install Flutter by following the instructions below.
What lessons did we learn from the test?
The build of the application (apk) has a significantly smaller size than what we generally get in Unity, since the minimum of this tool without using Tiny versions is approximately 18 MB. Meanwhile, this test with the carousel has a size of 16.8 MB. This difference increases as we add files and features.
On the other hand, the performance of the application is highly valued. Unity updates its UI once per frame, while in Flutter this is done on demand. We can update just a part of the UI, a specific component, or the entire screen. Obviously this is done all the time in Unity, since it is prepared to work with 3D models, animations and a lot of content that we would not be taking advantage of in this case.
Another great benefit that we discovered in this development is the ease of creating a carousel.
Unity comes with a component that allows us to slide content on a certain canvas. But it does not allow us to “turn pages” or to anchor these to the focus of what the user is seeing. To do this, in Unity we must develop everything ourselves, both the anchor animation and the “swipe” gesture.
In the code you can see that just by creating a PageView Widget not only we can swipe the content, but it can also be anchored to the focus of the screen. We also have access to a controller, for example to know what screen we are on, the orientation of the gesture (vertical, horizontal), and access the method that notifies us of the page change.
What do we take away?
We continue to test and explore the technologies on the market. Flutter, Unity, native development, are all options that must be chosen depending on the context in which we want to work. At etermax we keep moving forward when it comes to experimenting to achieve our goals.
Do you also want to experiment with us? Become a Game Changer!