Game limitations

Started by magiclight, Thu 04/11/2021 12:37:42

Previous topic - Next topic

magiclight

Hi!
I could not find anything about this in the limitations section in the manual

As AGS is a 32 bit application, does it load the entire game at startup or does it load things when they are needed ? say for example I make a game in very high resolution with many locations (1920x1080=~6MB*300 rooms=1.8GB and then all walkable areas and things on top of that), it can use up a lot of memory, sure it's a long way to 2GB or whatever the limit might be, just curious if there are any limitations in this area to watch out for.

Crimson Wizard

#1
Hello.

No, AGS does not load whole game at once.

There's roughly following parts:
1) Global game data, which consists of all global game object parameters (characters, inventory items, and so on), fonts, and the script modules memory. Note that this does not include any images, only their references in character etc data.
2) Room data, which includes room backgrounds, masks, local object data (but not object images, only references to these), local script data.
3) Saved room state, which includes object parameters and script variable values.
4) Sprites.
5) Audio files, and voice files.
6) Translation texts.

The load rules are following:
1) On startup engine loads global game data and keeps it in memory all the time.
2) Rooms are loaded one by one, unloading when you leave them.
3) However, engine keeps "saved room states" which include object properties and room script variables, so that these could be applied next time same room is loaded again. This is important to note, and if you create some big data in your room scripts, like large dynamic arrays, or dynamic sprites for visual effects, it is a very good idea to delete these in the "leave room" event and possibly recreate in the next "room enter", otherwise they will clutter the program memory, as well as game saves.
4) Sprites are cached on demand. The size of this cache is set in game config (and may be changed by players). Engine keeps the record of the order these sprites were requested. Whenever the cache is full to the limit, engine unloads the sprites, starting with the ones that were used long ago.
5) Audio and voice clips are loaded on demand and disposed right afterwards. There's also an audio cache but iirc it's limited to quite small size and was meant for particular platforms, where loading times are longer.
6) Translations are loaded on demand and unloaded when you change translation in game.

magiclight

Thanks, that helps a lot.

SMF spam blocked by CleanTalk