reducing game background size

Started by san.daniele, Fri 31/05/2013 12:43:19

Previous topic - Next topic

san.daniele

I've gone through countless topics regarding game size but none quite suit my problem.
My game is around 120mb big. While that's not really problem, I consider that being a little too much for what the game itself has to offer.
I'm fairly sure that a major part comes from the room backgrounds.

Every room (total: 12 rooms) has basically the same background (see announcement thread), so I'm trying to find a way to reduce the size there.

(if this can be resolved using room templates: shame on me … I found that option too late into developement)
here's what I tried:
- have a blank background. insert an object in each room using a sprite. Result: works just fine, but no effect on size.
- create a view with the background image. then insert a blank object in each room and set that view to it in the room_load. Result: see above.

At this point I'm asking myself how the rooms/views are actually compiled? Let's say I'm using a 10-frame long door animation. 3 doors in every room and 100 rooms in the game. Does AGS actually see that as 3,000 single pictures instead of just the 10 from the animation? (and does my question make sense?).

selmiak

Quote from: san.daniele on Fri 31/05/2013 12:43:19
Does AGS actually see that as 3,000 single pictures instead of just the 10 from the animation? (and does my question make sense?).

I hope not. But an even more interesting question is, what does AGS do with imported graphics that are not used. Are they compiled into the game.exe too?
Sorry for hijacking this thread, but I hope I get an answer anyways...

Slasher

I believe:
Pointing to an animation just gives an 'instance' of that animation which could be used a 1000 times. It does not make copies that would add to file size. This applies to any character or object animation. If you have an object in your sprites folder you can use it as many times as you like and the above applies.

And selmiak: If that were truly the case we would all be in for a very heavy time indeed!

Food for thought though....



arj0n

Quote from: san.daniele on Fri 31/05/2013 12:43:19
Let's say I'm using a 10-frame long door animation. 3 doors in every room and 100 rooms in the game. Does AGS actually see that as 3,000 single pictures instead of just the 10 from the animation? (and does my question make sense?).
Just the 10 sprites used in the animation.

Slasher

Quote from: Arj0n on Fri 31/05/2013 14:01:32
Quote from: san.daniele on Fri 31/05/2013 12:43:19
Let's say I'm using a 10-frame long door animation. 3 doors in every room and 100 rooms in the game. Does AGS actually see that as 3,000 single pictures instead of just the 10 from the animation? (and does my question make sense?).
Just the 10 sprites used in the animation.

I think the record is 30... any taker's  (laugh)



Khris

AGS stores a) room backgrounds and b) sprites. Both are compressed. A big factor is color depth; an 8-bit game will be significantly smaller than a 32-bit game.

A view is just a collection of numbers, having lots of similar views or reusing them lots of times does of course NOT increase the file size, let alone make AGS save identical sprites multiple times.

What I would do is make sure it's actually the room backgrounds. Copy the game folder, remove half the rooms, then check the file size. Did it go down by half, too?

Also, though knowing nothing about AGS's internal workings in that regard, I suspect using a room template with an already imported background wouldn't bring down the filesize, because AGS would have to keep track of the room background, and removing the original room would break all others, so I'm pretty sure the background gets copied when a room is created from the template.

san.daniele

Quote from: Khris on Fri 31/05/2013 14:22:27
What I would do is make sure it's actually the room backgrounds. Copy the game folder, remove half the rooms, then check the file size. Did it go down by half, too?

yep, you're right, it's actually not the backgrounds. So I guess when I replaced the previous backgrounds with room objects using the same sprites, at the same time I added a lot of other stuff to the game so I didn't notice a significant change in size.

I actually wondered why room backgrounds are not sprites but imported seperatly. Is there a special reason for that? Or something mundane like a linguistic issue, where 'sprites' can never mean 'background picture'.

Quote from: selmiak on Fri 31/05/2013 13:43:50
what does AGS do with imported graphics that are not used. Are they compiled into the game.exe too?

From what I read when doing some research on this topic: yes, they are part of the game.exe.

Khris

I guess from a technical point of view, the engine could work like you'd import room backgrounds just like other sprites, then set the background sprite slot in the room editor.
In fact, it's easily possible to do just that manually, by drawing a sprite to the background when a room is loaded.

I guess back when CJ started designing AGS, it made sense to begin creating a room by importing a background.
There's also the fact that you can import a room into another game, background and all.

SMF spam blocked by CleanTalk