tilemovers is a fun puzzle game. The objective is to move the red tile to the goal position (different in each puzzle) by sliding the other tiles out of its way. 150+ different puzzles in 3 levels of increasing difficulty.
What's going on? Is this real life?(it has lore)
"Never moving from point A to point B had been so challenging!"
From the depths of the underworld emerges the nefarious Zootmer, diabolical architect of intricate dungeons and labyrinths. Builder of prisons, Zootmer will do the impossible to avoid the escape of our hero to the vortex of light, an infinite system of passages where with skill and dexterity and overcoming terrible enemies our hero will be able to find the way out.
Game Additional InfoThis is a solo developer project. You can learn more about my 6+ months journey below.
Also, the game is already on itch.io please check it out:
https://agnasg.itch.io/tilemoversI'm looking for testers for the Android version: please download the Android version
tilemovers on Google PlayNotes about the migration from the Windows version to Android.I will work on:
C++ (no surprises here)
SDL2 (could be Qt but the paraphernalia is too flashy (and paraphernalic), which I'm not saying that SDL2's is not, but it's more for the Android Studio (AS) issue).
ChallengesSDL2. The problem with SDL2 is SDL. There are two versions and everywhere (StackOverflow and even some SDL tutorials sites*) the philosophies of both are confused. The approach is slightly different and the calls are different. Bottom line, SDL2 looks like SDL but is different.
Android. I've already done some things, nothing fancy, so this is new, or almost new. I don't know Android Studio so we'll see.
Now, the problem from the business point of view is that this project (publishing an application in the play store and making money with it) is supposed to be something that should not last more than 2 weeks from start to finish: I'm already on my second one and the application is just ready to start the migration. Besides the migration, there is a lack of marketing, many other things. (NOTE: since I wrote that until today it has been
1 2 3 4 5 6 months).
It's like the process of entering
Tiragarde Sound (World of Warcraft) an alt, it should be fast (10, 15 minutes?) But in reality, it's 2-3 hours.
Note: this section discusses my vicissitudes migrating tilemovers to Android. It is an adventure with lots of action, intrigue, ambushes, romance, suspense, and a happy ending.
Starring:
Android Studio (AS): the development environment (something like Visual Studio)
Gradle: the build system, allows to organize and execute the compilation and link with all the components involved.
ndk: Native Development Kit, a set of tools that allows using C++ with Android.
For Android installation, which I do for the first time (as I said at the beginning I have never worked with mobile app) I followed this guide.
https://lazyfoo.net/tutorials/SDL/52_hello_mobile/android_windows/index.php. There are other guides on google, but this one seemed to be the best.
Note (04-01-2021):
another guide is this one that is slightly updated and has detailed explanations. Unfortunately, I found it very late. As the author says, "you are entering the realm of Android development... take a deep breath...
Problems encountered: many, including some unexplained. One of the many pitfalls (something that particularly happens with Java applications) is that there are multiple versions of multiple packages and compatibility tables between packages and multiple errors due (perhaps) to those incompatibilities. For example,
here are the compatibilities between versions of Android Gradle Plugin and Android Gradle: working on this project I had to check innumerable times StackOverflow, and find tables like this very often.
Another error that appeared and is not included in the guide:
Unsupported method: TaskExecutionResult.getExecutionReasons()
The console indicates that there is an incompatibility with Gradle without giving further details. One step that I skipped in the guide is step 12 because the error did not appear to me:
Minimum supported Gradle version is 4.1. Current version is 2.14.1.
Well, in the new version, or because I had the 3.1.x version the error message is different (after several stumbles, slips, falls, laughs, disconsolate screams at midnight, screams and other manifestations of frustration the message "Minimum supported Gradle version" appeared without explanation. If it was always there, I'm not sure now) . To solve it, open the project's build.gradle file and modify the line
classpath 'com.android.tools.build:gradle:3.1.4
a
classpath 'com.android.tools.build:gradle:4.0.2
and in the file gradle-wrapper.properties the line distributionUrl should read
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
(Here 6.1.1 should be replaced by the latest version).
The window will display a link to do Sync, which will allow you to download the update.
Android Studio is a difficult horse to tame. How do you define the architectures to be compiled? By default, it compiles them all, "armeabi-v7a", "armeabi", "x86", "x86-64", "arm64-v8a" (answer). If I am going to change an asset, what should I do? If I press "rebuild", it starts compiling everything again, that's not what I want, but that the final apk includes the new assets. How do I create a new project based on an old one? I'm surprised that "Import" from an old project is the same as "Open the project", apart from opening it doesn't do anything else (this can cause problems, right?) (at the end you simply copy the folder and open the project from the new folder).
Eventually, I got the answers to these and other questions, but you have to be prepared to spend time on it (i.e. the learning curve is steep).
My impression is that the installation process and application settings are very detailed and change as the versions of the plugins and packages change. It is best to download the application and start working step by step. Eventually, everything works.
Other ambushes?The
abiFilters variable that indicates which architectures will be supported by the Android executable (the possibilities are '
armeabi-v7a', '
arm64-v8a', '
x86', '
x86_64') should only be modified in the file
build.gradle of the application (the one in the app folder) can also be adjusted in
Application.mk using
APP_ABI := armeabi-v7a arm64-v8a x86 x86_64 but it is either ignored or the effect is unknown (at least to me).
As a productivity trick you should have at hand the file build.gradle(:app) and change the variable 'abiFilters' to the architecture of the device you are using. For example, fishing the problem with the corrupted sqlite database, I had to test alternatively between the Pixel 2 API 30 emulator (abiFilters 'x86') and my cellular device (an old BLU R1 HD) (abiFilters 'armeabi-v7a')
Another curious note: the
Pixel 2 API 30 emulator is not as slow as
the internet says, you can work on it. I had to spend several minutes (more than I would like to admit) because I couldn't find how to get to Settings->Applications to delete the game and install it again (you can also do it in AS -> Tools -> AVD Manager). It turns out that in google pixel phone the menu with all the icons opens sliding from the bottom to the top (in all the android devices I've known is from top to bottom).
Still another much more curious note: implementing the movement by sliding the tiles requires a combination
SDL_FINGERMOTION and
SDL_FINGERUP. I had already implemented all the combinations and validations for the movement of the tiles, but I still had to create new functions especially for
SDL_FINGERMOTION. The right way is to forget the amount of reported movement, at least the 2-3 hours I was translating those deltas into the right resolution, in windows and in all the combinations of devices in android, I determined that it is useless. Equally useless is trying to convert the float value 0...1.0 that
SDL_FINGERUP gives to the correct resolution. My final implementation is to determine the direction of the movement with
SDL_FINGERMOTION and do the calculations when SDL_FINGERUP is triggered.
In the next post I'll add a lot of more details of the migration process, the SQLite integration and more. If there are interest I can add more details about the Windows implementation.
If you read Spanish you can see a lot of details about all this in my blog
micronosis.comSee you tomorrow.