Author Topic: reducing game background size  (Read 2705 times)

reducing game background size
« on: 31 May 2013, 12:43 »
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

  • ǝsıɔɹǝxǝ ʞɔǝu puɐ uıɐɹq
    • I can help with play testing
    • I can help with proof reading
    • I can help with translating
    • I can help with web design
    • selmiak worked on one or more games that won an AGS Award!
    •  
    • selmiak worked on one or more games that was nominated for an AGS Award!
Re: reducing game background size
« Reply #1 on: 31 May 2013, 13:43 »
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

  • slasher
    • I can help with AGS tutoring
    • Lifetime Achievement Award Winner
    • I can help with scripting
    • I can help with story design
    • Slasher worked on one or more games that won an AGS Award!
    •  
    • Slasher worked on one or more games that was nominated for an AGS Award!
Re: reducing game background size
« Reply #2 on: 31 May 2013, 13:59 »
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

  • Mittens Vassal
  • art consists in drawing a line somewhere
    • arj0n worked on one or more games that won an AGS Award!
    •  
    • arj0n worked on one or more games that was nominated for an AGS Award!
Re: reducing game background size
« Reply #3 on: 31 May 2013, 14:01 »
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

  • slasher
    • I can help with AGS tutoring
    • Lifetime Achievement Award Winner
    • I can help with scripting
    • I can help with story design
    • Slasher worked on one or more games that won an AGS Award!
    •  
    • Slasher worked on one or more games that was nominated for an AGS Award!
Re: reducing game background size
« Reply #4 on: 31 May 2013, 14:03 »
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)



Re: reducing game background size
« Reply #5 on: 31 May 2013, 14:22 »
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.
Fail at Floaty Rog' now!  still having to deal with what games are going through

Re: reducing game background size
« Reply #6 on: 31 May 2013, 17:03 »
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'.

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.

Re: reducing game background size
« Reply #7 on: 31 May 2013, 19:08 »
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.
Fail at Floaty Rog' now!  still having to deal with what games are going through