Author Topic: Game's Size  (Read 216 times)

Game's Size
« on: 30 Jun 2020, 10:47 »
I created this topic because it was starting in another topic, but it is clearier (and more interessant, I think) (and more fair, I believe !) to put it in a specific topic, maybe it could help someone else :)

I was asking about what can we do to decrease Game's Size. There were the first answers :

Snarky said :

Inefficient scripting makes no significant difference to game size (it could potentially cause it to run slower), but reducing GUIs and buttons—as long as you also delete the associated sprites—might.

The game size is almost entirely made up of graphics (sprites and room backgrounds) and audio. Importing the same graphics multiple times, or being inefficient when you have small variations (huge sprites that are nearly exactly the same except for a small difference, instead of just having the static part as one sprite and the bit that varies separately) tends to bloat the game size. Also avoid excessive frame-by-frame animations, which should instead be done as videos. If an animation is more than say 100 frames (of individual sprites), you may want to rethink. Many things can be done in-engine instead of being pre-rendered as separate sprites. Similarly, many, large room backgrounds take up a lot of space, and there are ways to store them more efficiently (typically using tile-based drawing or other standard elements that you can reuse in order to create different rooms from the same small set of graphics).

For audio, it's mostly about using efficient sound compression, e.g. OGG format (and of course not importing the same sound multiple times, or sound you're not using).

Edit: That's not to say that you shouldn't simplify and clean up your code. Bad code is difficult and tedious to work with, and can drain your energy for working on the game. If you've learned a significantly better way to do it, it's often worth going back and fixing it. (Though at the same time, if it works, you shouldn't put so much work into polishing it that you don't make any other progress.)

Crimson Wizard said :

Right, this is the first reason to simplify the code :) Improving game's perfomance is a reason to optimise it, but that's kind of a different thing (and sometimes you have to write more complex code when doing that).

I said : (my last answer with some questions)

OK, thanks a lot for your replies about decreasing the Game's Size. Effectively I could  decrease that by separating existing sprites in several sprites (one for the part that doesn't change, for example the "background" of a button, and other sprites for the part that changes, for example the "text" of the button.). Maybe also by using "labels" for some texts, but labels are less "flexible" for text alignment, so I have to test before.

About audio's format (OGG you said), I will take a look at that. It won't be difficult to change that quickly since I use a very few audios in my game, and it is still not ready to play.

What's about image's format ? I'm using basically PNG and BMP, but I didn't think a lot about that, and I am not an expert about compressing the image, or choose the right format...

eri0o

Re: Game's Size
« Reply #1 on: 30 Jun 2020, 15:41 »

Re: Game's Size
« Reply #2 on: 05 Jul 2020, 16:19 »
Thanks for the answer ! I understood that Game's size is most linked to the number of sprites the game use, so maybe I'm going to check if I can reduce the number of sprites, in fact I think it can bo done with a bit of work :)

Re: Game's Size
« Reply #3 on: 05 Jul 2020, 16:56 »
Thanks for the answer ! I understood that Game's size is most linked to the number of sprites the game use, so maybe I'm going to check if I can reduce the number of sprites, in fact I think it can bo done with a bit of work :)

What's your game resolution and how many sprites you already have? For low-res games I would not be worrying about size of sprites too early, unless you are doing a very long game with lot's of animations.