I've created a monster!

Started by beomoud, Mon 28/01/2008 13:02:28

Previous topic - Next topic

beomoud

I have already completed my first 3 rooms and i have the player character for now, my cursor sprites, my button sprites and a Lot of code for my new RPG. The thing is that my little newborn is already about 240Mb Compiled while the whole game folder is about 1,1GB!! I admitt i have added a lot of features i wanted to see in games but i'm only at the beginning yet. Is this even possible? Are these games supposed to be that big?

Radiant

Well, not really :)  I suspect you have imported a substantial amount of high-resolution high-color sprites, is that correct? (check the size of your acsprset.spr file).

Scripts are neglegible in size, compared to graphics and music. It's also possible that you're using a lot of music, but that usually doesn't compress well (like, 1100 Mb -> 240 Mb) and sprites generally do.

GarageGothic

Radiant is right that it could be the graphics. But since it's an RPG, I assume you're using structs and arrays in your code. Even though every int or String in an array only takes up a few bytes, declaring a large array (10000 or so indexes) can allocate quite a bit of memory (and thus file space) to it, even before those ints and Strings are assigned values. You could possibly look into the dynamic array functions of AGS 3.0 to try to optimize the code - and in general not declare structs or arrays larger than what you'll need.

mchammer

I cant really understand how cursor,button and player sprites and code coud take 1.1gb memory.
Even if you have very very large arrays, it should take much less space. The game im working on right now has 300 arrays with 64000 index (that makes about 20000000 ints) and it's still only 10mb compiled.
My 40 bullets - An action/war game.

Cloudanger

After resizing your images to exactly same right size as used in the game you could try optimizing it some more. I recommend PNG format in 8bit indexed mode (with optimized palette) as it is usually enough even for 32bit games and results as very small high quality images.

Some tips on my website: Link

After lossy optimizing you can squeeze a little more (5-15% usually) with PNG auto-optimizer called PNGOUT. Note that PNGOUT is very slow for images larger than 10MB.

Radiant

Quote from: GarageGothic on Mon 28/01/2008 13:16:18
Even though every int or String in an array only takes up a few bytes, declaring a large array (10000 or so indexes) can allocate quite a bit of memory (and thus file space) to it,
I'm afraid that doesn't nearly account for the 240 MB size. An array of 10000 integers would take up only 40k of memory.

Quote from: Cloudanger on Tue 29/01/2008 14:25:04
After resizing your images to exactly same right size as used in the game you could try optimizing it some more. I recommend PNG format in 8bit indexed mode (with optimized palette)
I'm afraid that's not going to help much, because regardless of what you import graphics from, AGS stores them internally in its own binary format.

Of course, using 8-bit graphics rather than 32-bit graphics will, for obvious reasons, reduce the amount of space used by your graphics by a factor of four.

beomoud

I've dropped it down to 70Mb, it seems that my problem was one BIG room. I had a large background of 4800 *2500 pixel! which changes into other backgrounds (5 of them in all) as the time passes (i wanted the effect of sunrise and sundown). Every such background apparently took up to 40Mb or more. At first i tried to have them as an animating background but then i realised that in order to change from one to another i would have to place that function in the player enters room section while i wanted it to change without having to restore the room (leave and come in again). So i decided to have them as objects (one over the other) that turn visible/ invisible acoording to the hour of the day.

I just yesterday discovered about DrawingSurface.DrawSurface so i'm currently gonna use only two of these huge backgrounds that i want them fading into one an other on a very slow rate, every 12 minutes lets say. The problem is that i have no idea how to do that without putting this in my repeatedly execute section (as i'm advised not to do so in the manual) but frankly i see no other way if i want this to check on my variables all the time. Any suggestions on how to have this??

Radiant

It's not a problem to put it in your repeatedly_execute as long as you're not doing that every single frame (which could cause excessive slowdown). You seem to want to do it every couple seconds, which should not be problematic.

beomoud

I have one problem. When i first used DrawSurface to simulate the day/night change as stated in the manual i had to put it in the repeatedly execute function. That slowed my game at a point that it was no longer playable so i thought of a trick to have a timer and have the repeatedly execute function only DrawSurface when the timer is expired, lets say 5 seconds, and now run smoothly. But now it still doesn't work because i can't circumvent the background animation. I have tried to set the delay at -1 or even 1000 but it changes automatically to 255. The only solution seemed to be to lock the background with SetBackgroundFrame but then the DrawSurface doesn't work> What am i to do, what could the manual possibly suggest?

beomoud

Does anyone know about DrawSurface, it seems like there is no way to go with it.

GarageGothic

What's the problem with using DrawingSurface along with SetBackgroundFrame? In what way doesn't it work? As an alternate solution to animated backgrounds, you could store the remaining background frames as sprites and draw them to the background DrawingSurface when needed.

beomoud

When i use SetBackgroundFrame the BackgroundFrame simply locks on the initial background and doesn't change anymore as stated also in the manual. What am i to do? I want the background to change alright but only when i want it to and not in every animation delay cycle.

Dualnames

I think's you should use SetBackgroundFrame(-1);. And I think i saw that in the manual. ;D
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

beomoud

You use SetBackgroundFrame(-1) to unlock the background lock and return it to its initial animation. That is not what i want. I don't want the frame to animate every delay cycle.

Dualnames

Oh, just put SetBackgroundFrame(1); or whatever. The initial background is either 1 or 0 , i can;t recall which.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

beomoud

Then the background stubbornly locks on the initial background and changes no longer. I wish someone knew that  :(

Khris

The frames are numbered from 0 to 4.

If you want to e.g. manually advance the frame, use a global int to store the current frame:

Code: ags
// room script

int bg_frame;

function AdvanceFrame() {
  bg_frame++;
  if (bg_frame==5) bg_frame=0;
  SetBackgroundFrame(bg_frame);
}

Dualnames

I misread your post... sorry for all the frustration i caused..
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Zufub

If you making REALLY BIG game good idea is to make "parts" of your game. You ending part 1 end there at end is picture: "End of part 1, thanks for playing, please launch part 2" - or sumthing like that. You may make your game lower size and faster to download ;P But I think that idea is stupid ;P
If you like any game makers, writ in your browser those tags:
RPG maker
Game Maker
Adventure Maker
Of course there are many more programmes to making games, but i prefer them + AGS ;) First is to making RPG games, next to ANY games and last is able to make Adventure Games (many is type: Escape the Room).

ZuFub ;

.M.M.

No, I think it is really clever!  ;)

SMF spam blocked by CleanTalk