Hey all,
I am new to this forum and any kind of forums, but it shouldn’t be too hard to use =P I am confused with something. I think there is offscreen handling for objects or not drawn ones like alpha=0 etc. But does it help texture-memory management and if not, where is it helpful? My problem is that I have a scrolling game, like an endless runner game. Game needs to preload its assets because I discovered that it smooths fps (60), otherwise it will drop fps time to time. (down to 42-48 for a second and it is noticable)
This is my discovery hence the question:
* Loaded an image - lets say it took X texture memory
* I tried putting the image offscreen like 100000px away - X texture memory again
* image.alpha = 0 or/and image.isVisible = true - X texture memory again
* I preloaded with texture:preload() and didn’t create a display object for image - X texture memory again
Extra information:
-
I am actually handling my images with 1px*1px “empty.png” and when they are about to be displayed, I convert them to real ones. (They are all different images) and remove them when they are offscreen. Creating seems to cause a bit fps dropping. Because when I remove this process, and create them all with original images before the next level begins, it freezes almost 1-1.5 seconds but goes smooth afterwards. I need preloading at the very start of run to fix those freezes but texture memory goes up high. I created 2 levels atm. If I turn off this process, it goes up to 160mb texture memory during level change (second level images + existing ones). If not, maximum 26 mb during whole 2 levels. So wouldn’t it be really really high with 7 levels of preloading if there is no texture-memory handling when they are not drawn.
-
Levels are 12k px long x 7 different levels
-
Images are 150 to 700 px long, less then 1024 (no big image loading) and since PoT isn’t needed anymore, I should be fine with that. I sliced my images to get rid of unnecessary transparent areas for better texture-management and according to approx device widths. I read bigger image movements are not suggested but in my case smaller the image, more the loading parts and more fps drops.
-
No memory leak that I detected. Tho it shouldn’t matter since it happens slightly after the start of game too. Maximum 2-3 mb of memory is used.
-
5 depth of backgrounds + 1 landscape - Displayed image quantity cant be more 35-40 at once.
-
I don’t know if it would help but I even localized display.newImageRect
An extra question if you don’t mind. I don’t think I have too much image. I know 60 fps is kinda hard to get but I am testing this on Windows Simulator and Samsung S7. This is no hardware inefficiency, too much memory, texture-memory or too much of something. Am I missing something here?
