AntonM
New member
- Joined
- Aug 16, 2017
- Messages
- 7
After the release of the game on mobile platforms, I have several changes in Сerberus, maybe it will be useful for someone.
iOS
Cerberus on iOS currently caches loaded images, which uses a lot of memory and when images are deleted in the game, the memory is not immediately released. Cached images should be deleted if there is not much memory left in the application and the app receives memory warning messages, but my game simply crashed on older devices due to lack of memory. To load images without caching, replace image = [UIImage imageNamed: path.ToNSString ()]; in iosgame.cpp LoadImageData by this
I was also unable to fix this error. I do not know if anyone else has similar errors, but it produces a lot of crashes for me. This error occurs on ios 12 and later, and I can't even reproduce it. If only someone could fix it it would be good.
Android
To make the game work without a navigation bar on phones with wide screens.
In androidgame.java added UpdateUI() in onWindowFocusChanged()
Also I had this error https://stackoverflow.com/questions/31439228/exception-in-the-androids-code-while-starting-the-app/
Fixed added this in Activity OnCreate()
Another bug was in mojo.android.java gxtkAudio StopMusic(), the game crashed in this place for some reason. I can't find a link to it right now, but the solution was to remove music.stop();
I also commented out the accelerometer code in BBAndroidGame.onSensorChanged(), because the accelerometer was not used in the game and generated a lot of ARN errors. In general, the android target works well, in Google Play the Crash Rate is about 0.03% and ARN 0.06%, which I think is very good.
iOS
Cerberus on iOS currently caches loaded images, which uses a lot of memory and when images are deleted in the game, the memory is not immediately released. Cached images should be deleted if there is not much memory left in the application and the app receives memory warning messages, but my game simply crashed on older devices due to lack of memory. To load images without caching, replace image = [UIImage imageNamed: path.ToNSString ()]; in iosgame.cpp LoadImageData by this
Objective-C:
NSString *thePath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent: path.ToNSString()];
image = [[UIImage alloc] initWithContentsOfFile:thePath];
I was also unable to fix this error. I do not know if anyone else has similar errors, but it produces a lot of crashes for me. This error occurs on ios 12 and later, and I can't even reproduce it. If only someone could fix it it would be good.
Android
To make the game work without a navigation bar on phones with wide screens.
In androidgame.java added UpdateUI() in onWindowFocusChanged()
Java:
public void UpdateUI(){
_view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE
|View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
}
Also I had this error https://stackoverflow.com/questions/31439228/exception-in-the-androids-code-while-starting-the-app/
Fixed added this in Activity OnCreate()
Java:
if (getResources() == null) {
bb_std_lang.error("");
}
Another bug was in mojo.android.java gxtkAudio StopMusic(), the game crashed in this place for some reason. I can't find a link to it right now, but the solution was to remove music.stop();
I also commented out the accelerometer code in BBAndroidGame.onSensorChanged(), because the accelerometer was not used in the game and generated a lot of ARN errors. In general, the android target works well, in Google Play the Crash Rate is about 0.03% and ARN 0.06%, which I think is very good.