Page 1 of 1

Scenario Loading Issue

Posted: 21 Dec 2014, 01:04
by Bill Barrett
In my experience most scenarios, in most gameboxes, differ from each other only in the relative position of a few counters. They usually use exactly the same graphics files, so why does ZunTzu automatically unload and then reload those same files when another scenario is selected from the Menu?

Surely it should only be necessary to do so when different files are specified and to otherwise simply map the (already loaded) components to their new positions?

It seems to me that this would dramatically increase loading times, and also stop ZT from crashing with an "Out of Memory" error with larger, more complex gameboxes.

What am I missing here?

Regards, Bill.

Posted: 21 Dec 2014, 21:41
by Jerome
Actually, the list of graphics assets to load can differ between scenarios. Nevertheless you are right that ZunTzu should avoid loading the same assets again and again.

Posted: 29 Dec 2014, 03:13
by Bill Barrett
Actually, the list of graphics assets to load can differ between scenarios.
Well that's obviously the case, but I still maintain that most scenarios use mostly the same components.

The thing is that ZT doesn't currently appear to manage memory as efficiently as it should :wink:

One of the gameboxes I'm working on at the moment is large, and "pushes the memory envelope". It loads OK, but if I then try and load any other scenario (even the same one!) ZunTzu falls over with an "Out of Memory" error...

Regards, Bill.

Posted: 29 Dec 2014, 22:55
by Jerome
There are three issues :
1 - ZunTzu tries to load again some assets that were already loaded at the start of the previous game.
2 - ZunTzu does not release the assets of the previous game until all the assets of the next game are themselves loaded, which causes a temporary peak of memory usage (x2 typically).
3 - The memory usage can never be larger than the video RAM of the graphic card, and is probably also limited to 2 GB as ZunTzu runs in a 32 bit process (not sure about that).

A workaround for you would be to define an empty scenario as the default scenario, and to always transit through that scenario to make sure assets are properly released.

For instance :
default -> #1 -> default -> #2 -> etc...

Posted: 30 Dec 2014, 01:50
by Bill Barrett
Many thanks for your prompt reply Jerome - and it's a great Christmas present to have you back "on the stage" :smile:

I'll admit that I'm probing with some questions that I long ago intended to ask. I didn't ask them before, because I'd assumed they'd come up during v2.0's development...

Anyway, that's interesting about video RAM and ZT being run as a 32 bit process. I'd had some idea that that might have been the issue, but obviously that invites the next question: how easily/quickly can it be rectified?

2GB just ain't enough (and who'd have thought it!?) now that many of us are firmly in the 64 bit era :wink:

Regards, Bill.

Posted: 30 Dec 2014, 07:58
by Jerome
Thank you for the kind words, Bill. :-)
Bill Barrett wrote:how easily/quickly can it be rectified?
All three issues could be addressed, but the most important one seems to be #1. I suppose issue #2 could just be ignored if issue #1 was solved.
Regarding issue #3, a simple solution would probably be to deploy two different builds of ZunTzu : 32 and 64 bits. But it is probably too early: graphics cards with 4 GB RAM are still quite rare.