Just stumped on GS Viewer - Game increases in size
Stormtrix
Member Posts: 256
Hey all,
I've sort of gone into this before on another thread but i'm still having the same issue and it's just killing me to figure this out - main reason is, it will help me better understand how GS responds to rules for future projects.
I'm trying to get away from so much spawning and destroying and just recycling more.
The game i have is just a free silly 1-card poker game called Blind Man's Bluff. (already on appstore but looking to update it with the new improved version and iAds)
The Project is (Portrait Mode) just 2 scenes, 7 actors, 66 images (.png)..and designed for Retina
3 background images are 960x640 and 200-375k each in size
52 images (the cards) are 512x768 and with RI on then 256x384 in GS ---
sizes of the cards are 100k for reg. cards 250k for face cards.
No spawning/destroying or Timers in the game at all.
GS project size on home page is 5.5mb.
Start game in GS Viewer --
Main menu Images=10mb, No sounds, Game Engine=4.6mb, Other=10.4mb, Total=25mb
Touch instructions button - camera goes 320 turns image from alpha 0 to 1, go back to menu alpha 1 to 0
Same for hitting Credits/more games button but camera goes to x-640
None of the above sizes change when viewing the instructions and credits pages..
hit play button takes you to camera x=1280 to play no file size changes in GS Viewer.
Actor - CardDisplay has --
Rule - game.CDdisplay=0 // change attribute: self.image to "c"..floor(game.cardback)..".png"
Rule - game.CDdisplay= and Touch is pressed
change attribute: game.RndCard to random(1,52)
change attribute: game.CDdisplay=1 (so they can't press card again right away)
change attribute: game.card to game.RndCard
change attribute: self.image to floor(game.card)..".png"
Then 'play again' actor button just has -
Rule -- Touch is pressed and game.CDdisplay=1
change attribute: game.CDdisplay=0
I do have a another background at camera x-960 with 6 different backgrounds of cards to choose from.
background image is static with invisible actors over each card to select and save attribute select.
That's pretty much it... But i play the game in GS Viewer and every single time I touch the 'back of the card'
to reveal the new card from Actor-CardDisplay the following sizes in GS Viewer go up - every single time and it's driving me crazy no spawning or destroying at all... just change images.
Main-12mb, Sound-0, Engine-4.6, Other-11.1, Total-27.7
Main-14mb, Sound-0, Engine-4.6, Other-11.8, Total-30.4
Main-16mb, Sound-0, Engine-4.6, Other-12.4, Total-33.1
Main-18mb, Sound-0, Engine-4.6, Other-13.1, Total-35.7
I'd be happy to email the project to someone to take a look at.
I really feel if i can understand why this is happening it''ll let me tweek and fix my other projects to be better.
Thanks for your time!
I've sort of gone into this before on another thread but i'm still having the same issue and it's just killing me to figure this out - main reason is, it will help me better understand how GS responds to rules for future projects.
I'm trying to get away from so much spawning and destroying and just recycling more.
The game i have is just a free silly 1-card poker game called Blind Man's Bluff. (already on appstore but looking to update it with the new improved version and iAds)
The Project is (Portrait Mode) just 2 scenes, 7 actors, 66 images (.png)..and designed for Retina
3 background images are 960x640 and 200-375k each in size
52 images (the cards) are 512x768 and with RI on then 256x384 in GS ---
sizes of the cards are 100k for reg. cards 250k for face cards.
No spawning/destroying or Timers in the game at all.
GS project size on home page is 5.5mb.
Start game in GS Viewer --
Main menu Images=10mb, No sounds, Game Engine=4.6mb, Other=10.4mb, Total=25mb
Touch instructions button - camera goes 320 turns image from alpha 0 to 1, go back to menu alpha 1 to 0
Same for hitting Credits/more games button but camera goes to x-640
None of the above sizes change when viewing the instructions and credits pages..
hit play button takes you to camera x=1280 to play no file size changes in GS Viewer.
Actor - CardDisplay has --
Rule - game.CDdisplay=0 // change attribute: self.image to "c"..floor(game.cardback)..".png"
Rule - game.CDdisplay= and Touch is pressed
change attribute: game.RndCard to random(1,52)
change attribute: game.CDdisplay=1 (so they can't press card again right away)
change attribute: game.card to game.RndCard
change attribute: self.image to floor(game.card)..".png"
Then 'play again' actor button just has -
Rule -- Touch is pressed and game.CDdisplay=1
change attribute: game.CDdisplay=0
I do have a another background at camera x-960 with 6 different backgrounds of cards to choose from.
background image is static with invisible actors over each card to select and save attribute select.
That's pretty much it... But i play the game in GS Viewer and every single time I touch the 'back of the card'
to reveal the new card from Actor-CardDisplay the following sizes in GS Viewer go up - every single time and it's driving me crazy no spawning or destroying at all... just change images.
Main-12mb, Sound-0, Engine-4.6, Other-11.1, Total-27.7
Main-14mb, Sound-0, Engine-4.6, Other-11.8, Total-30.4
Main-16mb, Sound-0, Engine-4.6, Other-12.4, Total-33.1
Main-18mb, Sound-0, Engine-4.6, Other-13.1, Total-35.7
I'd be happy to email the project to someone to take a look at.
I really feel if i can understand why this is happening it''ll let me tweek and fix my other projects to be better.
Thanks for your time!
Comments
As far as a solution if that is the case? You could try making your own cards, lol. Like, make an image of 0-9, A, the 4 suits... maybe some custom for J, Q, K? I dunno man, hard to say.
It just seems strange to me.. i get that all the images might load once into memory but to just increase
because i've changed the image is weird... they should already be loaded..
even if it loaded a brand new image- the image is only 100-200k in size.. not 2mb.
Well - i tried what you said - was thinking that myself actually as a troubleshooting step..
Amazing that as soon it loads the main menu and all the images --
GS Viewer -
Images = 114mb, Sounds=0k, Game Engine=7.1mb, Other=41.5mb, Total=162.5mb..
How the hell does it increase that much when the whole project is only 5.8mb in size.
I mean all my images only total 3.6mb.. (testing on iphone4)
After doing this -- when i touch the card for a new random one at least it doesn't increase in size anymore.
Man i wish i could figure this out -- I'm afraid i'm going to put a lot of work into redesigning my games for better peformance to only get worse performance..
52 img 512x768 it's a lot! You should use image around 64x64, max 128x128, having so many images that big can't be handled by the limited ram of the idevices. So try to not load them all together (divide in scenes?) or just make them smaller.
An image of 200kb can get more than 2 mb if it's a large image. It depends on the width and height mainly, not the file size.
definitely non-moveable selected on the actors and
I'll try changing the images to 256x384 and forget
about retina. I still don't understand how the image
Size would make a difference when it comes
To using the change image attribute based on a
Random attribute pull that would stop the memory
increasing in size while selecting a new card in GS Viewer.
Again I know this is a silly type app but it would truely
Help to understand why the size increase so
When I fix my toddler fun app which uses a lot of actors and spawning
I can fi it properly with recycling and image changing.
Thx again. Traveling for work rest of week so will report back Friday
Oh and can't use an image size of 64x64 or 128x128. Cards would look funny.
Still working on my 1st 3 games, that I'm about to try and get pub once I finished put the score screen on. Since I'm new to this game this my advice lightly lol, I had similar problems to. It was 2 different issues. The since of the game was 10mb but once I took off the extra stuff that I didn't end up using mostly extra audio, it went down a bit, I also resaved the sizes of the images I was using and then placed it back on game salad. They were about 15 inces and made them into 2 inches or smaller since it was for the small screen of the Iphone anyway. That helped a lot. The changing images and spawning created the original size of the image. Fix that by going to the the actor itself and changed the sizing of the actor that was created. Not sure if that helps but figured since I'm been reading all this for clues on how to get unstuck I would try and help.
NEW Testing --- i'm pulling my %@#%$@% hair out this
Gave up on RI Display...
Resized all 52 card images and the 6 card back images to 256x384 -
file sizes -- normal card 8k , face cards like 100-160k each
The 4 background images are just 320x480 portrait and 130-160k each
Test 1) Put all cards on the screen off to the side and alpha 0 - then called to main display when drawing.
GS Viewer reports - 28.5mb images, 0k sound, 7.1mb game engine, 18.5mb other, 54.1mb total
When playing the game -- numbers don't increase and game runs fine..
Test 2) Then got rid of all on-screen 52 cards and just used 1 card and did a change image attribute based
on the game.rndcard attribute..
GS Viewer reports - 3.5mb images, 0k sound, 4.6mb game engine, 8.5mb other, 16.8mb total
and when playing the game -- images and total increase by .5 mb every time you draw a new card!
Test 3) Then -- got rid of the 1 card and did a spawn/destroy card.. so - touch card back image and spawn
the main card display of your number.. touch the play again button and it destroy's that main card and goes
back to the card back image.
GS Viewer reports - 2.5mb images, 0k sound, 4.6mb game engine, 4.1mb other, 11.3mb total
playing the game -- sizes increase by .5mb every time you draw a new card all the way up to 44.6mb total after playing 40 times or so..
So, apparently my conclusion is that every time you bring an image into your game for the first time
it will increase the size of your game and you can't clear it from memory unless you change scene's probably i'm thinking.. which to me means - this just stinks !!!
Anyway I took out that overlapping image, made four smaller images for each side of teh border and a 12kb image being taken out resulted in about 8mgs of less ram.
Don't know if in the interest of 'science' you would retry your tests with no background? Would at least give a reference point for understanding the limitations.
Would then a multi part background with a 'hole' where the cards appear give better performance? IDN
In other words, it will use the highest resolution images even on a low spec device.
One way to check it's working would be to make a version with standard res images and see how that performs. It should give you a better idea of what the final game will be like, after the resolution independence stuff kicks in, on lower spec devices.
Then, when you're done, just replace the standard res images with your high resolution ones, and all should be dandy!
Hope that helps,
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Heck I'll try anything..
QS, I tried making it a standard version actually (see 2 posts up).. only thing that changed was instead of
growing in size by 2mb when drawing a card with RI images, it increases by .5mb with standard images..
Just wish i could understand how GS handles memory and images.. I wanted to clean up and fix my toddler fun app and use more change images and recycling but heck I can't even figure out a 1 card game, let alone 26 letters of the alphabet changing and multiple shapes.
If you would like to see the project just shoot me an email at equessen (at) gmail (dot) com
Decided to just make an extra scene for the cards to be played in - after about 30 draws or so memory
goes to about 25mb.. Just banking on someone will change the card deck to reload first scene and clean the memory up so it can start over for new round. -- update sent to itunes.
guess i'll work on trying to tweek and update my toddler game but might be back for help in regards to images and memory