Autosave command on Android

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
Willy Elektrix
Liquid Metal Slime
Posts: 910
Joined: Sun Aug 15, 2010 11:30 pm

Autosave command on Android

Post by Willy Elektrix »

The autosave command doesn't seem to be working in the Android version of Xoo: Xeno Xafari.

The Facts
  • Whenever the autosave command is called in Xoo: Xeno Xafari, the game opens the save menu.

    When I select a slot in that save menu, the game saves, but calling the autosave command will open the save menu again instead of automatically saving in the same slot.

    I am testing with the Android debug apk linked here: https://rpg.hamsterrepublic.com/ohrrpgc ... roid_games. I'm also testing with a packaged apk of Xoo: Xeno Xafari that James made for me. I get the same bug in both places.

    The autosave works fine on the PC version of the game.

    The autosaving also works fine when I run the Alien Squatter .rpg file (one of my old games that also uses autosave) on the same Android debug apk I am testing Xoo: Xeno Xafari on.
This is pretty crazy bug, right?
Last edited by Willy Elektrix on Mon Sep 14, 2020 4:13 pm, edited 1 time in total.
User avatar
Willy Elektrix
Liquid Metal Slime
Posts: 910
Joined: Sun Aug 15, 2010 11:30 pm

Post by Willy Elektrix »

Alright, I created a very sample program to test this bug out and make sure that it's real.

If anyone wants to work on it, here is a link to my test .rpg file. http://files.andihagen.com/miscmedia/autosavetest.rpg

Here are the scripts. http://files.andihagen.com/miscmedia/autosavetest.txt

Basically, the test is very simple and should be self-explanatory. There is a script that runs when you start a new game that opens the save menu and asks you to choose a slot.

When you open the main menu and press save, there is a script that calls the autosave command.

On a PC this works fine. However, if you run this .rpg on the Android version of game.exe, the the autosave command will open the save menu and ask you to choose a slot instead of automatically saving in your recent save slot.

---

In the meantime, anyone know how to script a workaround? For instance, is there an easy way for me to store which slot the player saves in as a variable without scripting a custom save menu?
Last edited by Willy Elektrix on Tue Sep 15, 2020 10:22 pm, edited 2 times in total.
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Ooh! A minimal test case. Wonderful! I will try it out and see if I can get to the bottom of it (might take me a few days to find time)
User avatar
Willy Elektrix
Liquid Metal Slime
Posts: 910
Joined: Sun Aug 15, 2010 11:30 pm

Post by Willy Elektrix »

Bob the Hamster wrote:Ooh! A minimal test case. Wonderful! I will try it out and see if I can get to the bottom of it (might take me a few days to find time)
Groovy! Can Detective James crack the case?

Here's another hint. This has not been a problem with past versions of the engine. Alien Squatter's autosave functions work fine. They even work fine when using the newest Android version of game.exe. Is this because Alien Squatter was created with an older version of the engine???
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

So this bug is not android-specific, it seems to affect all platforms.

This bug was introduced by a mistake in a fix that I made on 2020-06-28 ("Saving in a hidden save slot with a script will not move the default cursor to the very bottom of the save/load menu anymore")

I was incorrectly calculating the last normal slot on games where the player had never visited the save game options menu. The default of 4 would not have been initialized yet, and the number of allowed save slots would be set to 0 which would not affect the save picker, but was affecting the memory of the last saved slot.

That explains why this bug was not happening in other games, since if you changed the number of save slots, or even just looked in the menu that lest you change the number of slots, then the bug would be avoided.

I am guessing that on Windows you were using an older build than 2020-06-28. I think that is the only possible reason you would not have seen it there

Thank you very much for finding this bug! :)

I have fixed the bug, and it will be in tonight's nightly build. Let me know when you are ready for me to re-build the Xoo apk for you :)
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

(Would be nice if those details had been in the SVN commit message too! It left me wondering a few things, which your post here nicely answered.)
Post Reply