Quick question,
I'm using automatic downsizing with 0.5 and 0.75 scales to bring my assets to a lower resolution. I'm using
collectgarbage(count)
collectgarbage()
print ("memory used:"..collectgarbage("count")) |
to see how much memory the textures use, and no matter what resolution I have in gideros player(1080x1920 or 720x1280), on windows, it still reads the same. I thought that using a lower resolution on gideros player would use the lower resolution assets and thus less memory... did I miss something? Do I have to go through all the code and put something like: if using
@half textures then load
@half textures else load full resolution textures?
Also, when using screen manager I usually put all my loading code in Scene1:onTransitionInEnd() and add an event listener to Scene1:init(). However, since theres so much loading code, it often takes a while for the game to load, and sometimes freezes although there are still textures being loaded (on windows its like 5 secs, and on my HTC One its like 10 secs) Even if I put like a print statement right in the beginning of the function, in front of every thing else, the player does not print it onto the console until everything else is loaded, which Im guessing is because the player is freezing although things are still being loaded. This is the same on windows and my HTC One, although it doesn't even work on my Droid X which is a lower end device though it might be because of the memory problem mentioned before. Is there some way to make this more efficient? Thanks.
Comments
http://docs.giderosmobile.com/reference/gideros/Application/getTextureMemoryUsage#Application:getTextureMemoryUsage
2) This is because asset loading is not asynchronous, it freezes the player until assets are loaded
You could for example preload some assets when the game starts to make scene loading better, but probably not a good solution because of limited memory
Other way would be to display a loading screen between scenes.
For that you would need to modify scenemanager a little:
http://www.giderosmobile.com/forum/discussion/3733/implement-loading-scene-/p1
oops I meant texture memory but copied the wrong functions... Still the same texture memory no matter what resolution. Auto downsizing is enabled for images also
It should automatically pick up the closest resolution, but maybe in your case it does not for some reason.
1) you can paint 0.5 image in one color and 0.75 image in other color, to see the visual difference if proper image is loaded.
2) tell us more about your project set up/settings, what are logical dimensions, are there any scalings enabled, etc
2)
Scale Mode: Letterbox: Tried different options... didn't work either
Logical dimensions: 1080 x 1920
Scale: @three - 0.75, @half 0.5
Orientation: Landscape Left
FPS: 60
Most all images have auto downscaling checked.
I ran the project in local player in the lowest and highest resolutions and each time it loaded just the base image... It generates the @half.png and @three.png files but they do not get used... I don't have them in the project folders on Gideros though... Do I have to add every single @half and @three image to their respective folders in Gideros?
---- Just tried that on one image and didn't work so I guess not. I also noticed that when I modify an image with @half and @three, it doesn't get "uploaded" in the Gideros console that normal images do. But I guess its because the @half isn't on the Gideros file manager.
The projects using the base images all the time for some reason.
Here is an example project working as you expect:
http://www.giderosmobile.com/forum/discussion/comment/13694#Comment_13694