size of my file... saving my game from a laggy piece of crap
digitalzero
Member, BASIC Posts: 639
hey you guys! I have a file that is already at 31.1mb and i am only about 30 percent done with the game are there any tips that i can grab from you guys so that i can make sure the game does not lag too much
Comments
There isn't a direct correlation between game size and whether a game runs smoothly or not, if your game is not playing smoothly you really need to look at your code / game structure rather than focus on reducing the game size, it's quite possible to have a 800mb game that runs smoothly at 60fps and a 12mb game that lags and stutters along at 20fps.
. . . . . . . . . . . . .
For example, take this hypothetical scenario . . . you have a game, it has a custom font of some kind, perhaps for a score, it goes up to 10,000,000 (eight digits) or some other ridiculously high value. The score/font is made up of 10 custom images, 1, 2, 3, 4, 6, 7, 8, 9 and 0.
But because your camera is rotating or spinning (or whatever) all throughout your game, you need to constrain the position of each digit of the score to some trigonometry to keep it in one place relative to the camera, so we need 24 constrain behaviours (1 for X, 1 for Y, and 1 for rotation - for each of the eight digits in the score).
So you get it all working only to find these 24 constrain behaviours, on top of all the other stuff in your game, drops the frame rate from 60fps to 40fps, the game becomes laggy. : (
So, you decide to get around this by dumping the 10 custom images (1, 2, 3 . . . etc) and instead using something like After Effects to render out every number from 0 to 10,000,000 as a single individual image, so for example instead of '340,500' being made up of 6 images, it is just one single image, which of course means you will have 10,000,000 individual images (!!!).
Ok, so now you import these into GameSalad . . . . and . . . . . your game size jumps massively from 14mb to 66mb !!!
But now you only need 3 constrain behaviours instead of 24 as you just have one single image instead of 8 separate images, this saving of 21 constrain behaviours (which are fairly processor heavy compared to other GameSalad functions) sees your game get back up to 60fps !!! Yeah !!!
So, this would be a situation where actually increasing the size of your game makes it run more smoothly.
(actually this example is not all that hypothetical, it's an actual situation I found myself in, although my score wasn't as high as 10,000,000 ! But using 1,000 pre-rendered images, meant I could get rid of 18 constrain behaviours, my game size went up by 10mb or so, and the game ran much more smoothly).
I'm not trying to claim that making the game size larger will make it run more smoothly, just that a smooth running game is more often the result of good code rather than a small memory footprint.
. . . . . . . . . . . . .
P.S. what platform are you targeting your game at that a 100mb app size would be a worry (an iPad from 1989 ?) Or do you just want to keep it small so that it will squeeze over a mobile network (rather than Wi-Fi) ?
Concept iPad from 1989
Fortuna Infortuna Forti Una
Hahahahaha i just want this game to be perfect... More than likely i will pay someone to go over the code and make sure everything is correct... More than likely my game is going to be featured in game informer and i wanna get a good score... I live in Minnesota so the head quarters is just downtown and my friend is best friends with the head editor so i just want things to be perfect ya know
Not see that before, looks like a brick ! I want to see support for the brick in the next stable release.