#6. Worst 2D engine for Nutaku.


Starting to develop a game, first of all the developer chooses the engine. And here there are only two criteria for selection, it is suitable for the implementation of specific complex tasks or the developer knows this particular engine better than others. Usually everyone is guided by the second point, but you need the first. So we, starting to develop Like Heroes, took Unity 3D, confident that our many years of experience with this toolkit and the presence of a huge number of guides will make our development very simple. But we did not at all took into account one "but". We made a new game for Nutaku. Unlike other stores, Nutaku is very focused on cross-platform and the main secret of success for it is to be presented on all systems: PC, WEB, mobile WEB (for iPhone) and Android version of the game. Everything is simple here, the player’s comfort begins with the platform, it should be convenient for him not only to play the game, but to do so with his device of choice. And, it would seem, Unity is the most cross-platform engine in the galaxy, but for creating 2d games on Nutaku is complete crap.

On December 21st of the last year, we encountered a problem with the WEB PC version of our game, I wrote about this earlier. The problem was simple - game devoured all the memory without having time to boot, and when the memory ran out, it died of hunger. Regarding the problem, we did solved it and more on that at the end of the article. Unity 3D is primarily a 3D engine (it's in the name, duh) and it is not advisable to use it to create 2D projects, it was born for something else. Of course, you can create a 2D game on it, but it will work worse than that created on a less universal 2D engine. And in some cases it won't work at all. WEB PC version run through the Unity web player will spend additional resources on emulating some of its magic and slow down disgustingly. And you can simply forget about the WEB version for phones.

Realizing all the deplorability of using Unity for real cross-platform Like Heroes: Ultimate, we literally went crazy and started coming up with strange solutions. At first we thought of porting the Unity project to PlayCanvas. The Internet says it's real, rewriting all the code in Java and maintaining 2 separate versions in parallel. The idea is dubious and even a little crazy. The second idea is to find an engine that can unload the project for all the platforms we are interested in. While we opted for Cocos Creator made on the Cocos2D framework, this is the correct name. And rebuild the game for it. A little more work, but future support will be easier. The main task for us now is the development and support of the current version of the game, and the nights are full of time and someday we will be able to make LHU available everywhere.

And now for the top of our worst decisions that led to the downfall of the web version of LHU.

1. Incorrect texture compression - when loading texture atlases in Unity, the engine itself brings them to the power of two. This is when the size of each side of the texture is increased or decreased to a value like 256, 512, etc. pixels. Unity is not a photo editor, so it does all this badly and increases the volume of textures by an average of 30%. Interestingly, increasing the texture by 30% increases the RAM consumption by more than 50%, such a strange math.

2. Localization system - it so happened that the localization solution we bought simultaneously deployed all languages in memory. Of course, the chosen one showed up, and all the rest were hiding somewhere, mercilessly devouring free memory. There are a lot of stories and other text in Like Heroes, so some letters created a data array of 9 by 150,000 lines of values. The main problem arose at the start of the game, when the system took out a table of all languages and began to put it in all places. Phones still somehow coped with this task, but WEB simply blocked the process for 2.3 GB of memory and, together with inactive languages, turned off the game. We just made a separate table for each language and everything began to work, consuming 300 MB at the peak. When I rebuilt the localization table in Excel for the new system, my personal memory ran out and refused to work for another day.

3. Character Skins – To reduce the weight of the game, we decided to keep the textures of all character skins in one file. Of course, we reduced the volume of the game, but we greatly increased the memory consumption when using this character. As a result, the fight turned into a trip with a girl on vacation, when she takes the entire wardrobe with her for 3 days so you have to buy a ticket for this luggage and drag it around for her, sweating all over.

We were able to reduce the memory consumption by 10 times, which is enough for the game to work on the web. There are many more updates, mechanics and articles ahead.

That's all for today, play Like Heroes: Ultimate, go to our Discord and Patreon, Alexa uploads cool pictures and stories there.

Max Weber was with you, some guy from the Spicy Team.


Our socials:
Patreon 
Discord 

Get Like Heroes: Ultimate (18+)

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.