• Dear Cerberus X User!

    As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.

    Important: If you accept the amended Terms and Rules, you agree to the transfer of your user data to the future forum owner!

    Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.

    Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!

    Accepting ensures:

    - Continued access to your account with a short break for the actual transfer.

    - Retention of your data under the same terms.

    Without consent:

    - You don't have further access to your forum user account.

    - Your account and personal data will be deleted after April 5, 2024.

    - Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.

    We hope to keep you in our community and see you on the forum soon!

    All the best

    Your Cerberus X Team

Is it too much memory?

mag

Active member
3rd Party Module Dev
3rd Party Tool Dev
Joined
Mar 5, 2018
Messages
261
Hi,
I wonder; is it too much memory for this:

I load at least 54 images to be rendered. Each is 1024 x 1024 pixels size. I wonder is it too much memory for today modern device.
Can someone show calculation how much memory needed for that amount of images to be loaded into memory. tnks
 
One 1024x1024 in the common RGBA format will be 1024x1024x4 bytes = 4096KB, exactly 4MB.
54 of them will be 216MB of course. I would say you have to try it out on the devices you mean to target to be sure about performance.

Older mobiles would be the weakest link here. They are not as fuzzy about the numbers nor total usage of memory but they might become slow if textures are above their favorite size. You never know a devices favourite size. I can tell you that an 2012 Samsung Note2 has a favorite texture size of 64x64. A texture size of 256x256 would make it crawl. Things changed greatly since then of course on the market.

On new hardware I don't think it matters. But I would not just ignore it on mobiles. I would test the ones i was targeting.
If you won't get the performance you want, divide it down, and don't be afriad of the increased number of textures. But respect size.
 
  • Love
Reactions: mag
It might be needed to load them during OnUpdate on Mobile devices as they might crash if OnCreate takes to long
 
  • Like
Reactions: mag
I would only load media when its required, dont have images loaded when you dont need them as this will make your app sluggish and memory hungry. Free up images that aren't required will make it more lean and work better on older devices.
 
54 of them will be 216MB
in that case device that have 1.0G RAM still can run it.
...but probably not due to sharing ram with OS and other apps:(
 
Ya the loading aspect of things.. Mojo1 has a great async feature so you don't have to do any tricks with flags to load textures dynamically through the game. Mojo2 did not inherent this feature but someone added a mojo2 async module. I got it somewhere but I never got it to actually work?

Android startuptime is allowed to take a certain amount of seconds so look from a userperspective. I mean I can see minor delay to my game when I add a soundtrack to it (the soundtrack is 4-5MB).

If you cannot get async load to work you can do what I do ; use flags and load bit by bit inside the game where it can load without being noticed. Try to be clever about it how you portion everything up.
 
Last edited:
Loding is fine. I use flag and load it one at a time on every update circle.

About the speed: I m quite surprised to see our html5 is really good. i set the framerate at 40fps to render those images at once on top of each other.
For html5, I got around 37fps while android only 26fps. That makes me wonder; what if I create a hybrid app on android instead of nativeo_O

This thing happen probably because the PC is fast and got a lot ram and i run html on pc. I need to testrun those html on android soon
 
Nice! I noticed actually that even cheaper devices will give you an amazing performance in HTML5 nowadays.
I guess the hw-support that existin most browsers like Safari Chrome and Edge today will give you close to native speed, at least they do on my devices. Except Firefox on Linux which sucks for me though but that is proably bc I don't have time to set things up correctly.

On Android for instance I use Chrome and I get 60 fps. If I compile Android natively in Cerberus it will run at 120hz because the screen allows it. In the browser you get the said 60 fps, enough to make democoding happen on your phone.

But if you use touch and compile to HTML5 watch out because Win10/11 tablets use only the newer W3C JavaScript Pointevents standard for touch and Cerberus does not.
 
  • Like
Reactions: mag
Back
Top Bottom