Memory Issues

Randy In the game I am making, I am encountering a few spots where there is simply not enough memory to do everything I need the game to do. I realize, being AGI, there are obvious limitations. However, what advice can you all give me as far as things to do to reduce the amount of memory being taken?

Also, isn't there another .exe to run the game called "sarien" or something that was developed by one of you guys? Does using this executable help with some memory issues? If so, where might I download it?

Andrew_Baker Yes, Sarien can be found at that's for the latest builds, but df also has some interpreters mirrored right here at mega-tokyo. I don't know if it helps with the memory issues. NAGI, does seem to help somewhat.

As far as running out of memory, you need to explain what you are doing that is causing you to run out of memory before we can help you. It could be so many different things (pictures not drawn correctly, too many animated objects, resources not being freed up properly, etc.). Describe the exact nature of the situation when you run out of memory, and we'll be glad to advise.
Randy I had created an automatic cutscene that ran fine -- no memory issues. Since then, I had been adding new logics, views, and pics to the overall project. I went back to that cutscene in the game and now I get "No memory. Want 6720, have 6580". The background is a solid color, so that is not complicated. I am loading 2 views. The first view has 4 loops with 10 cels each (however, two of the loops are mirrors of the other two loops). The second view has 3 loops with 9 cels each.

The thing that confuses me is that I have not touched either the logic for that room or the pics & views for that room since it last worked fine. As I understand it, when this room first initiates, all previous loaded views are cleared from memory.

The things I have done since then include creating many more views, adding new logic code and modifying existing other code. I have made some additions to the logic90 which runs continuously, however, when I took them back out again I still have not been able to retrieve all the necessary memory again.

In some other rooms, I have done more coding which involved the setting of new flags and variables. Although I now have many more flags and variables, these are "room-specific" and I don't need them to be global. Could they be responsible for my memory leak? If so, how can I clear them from memory after leaving a room?

Any thoughts or assistance on this would be most appreciated.

sonneveld Have you loaded any new device drivers? perhaps that, or windows is taking up a bit too much memory.

Run the debug command show.mem() before and after you load each object (pics, views, sounds, your ego's view!)

if worse comes to worst, you may have to modify one of the above objects to make them smaller. Sierra had to spend a lot of time making small modifications to their pictures to reduce the size. Mirroring loops in your view objects is a very good practice though.

Do both views have to be on the screen at the same time? Perhaps you could unload and load each one as your use them? and use a smaller static view(no animation) for when it's not in use.

Make sure you don't fill up the script though (a list of all objects loaded and discarded). It can be disabled though by setting flag 7.

I hope that helps.

- Nick
Randy Hey thanks for all your help. After some time of squeezing every bit of memory I could out of every AGI nook & cranny, I was finally able to get it to work again.

What I wound up doing was splitting apart the loops in one of the views so the new views had one loop each. That way, when the animation of that view played, I quickly erase and unload the one view while redrawing and loading the new view in its place. I also was forced to separate some of the code I had written out of logic90 so it would not be run during the cycles in this particular room. Those major changes, along with some other minor ones, were enough to get me the memory I needed.

I'm back on track. Thanks again.
sonneveld good to hear. modifications to logic.0 might increase the memory usage as well. (just remembered) :)

good luck!

- Nick
Andrew_Baker Also to take into consideration is if you are using the "tp" teleportation command with an old version of the template logic. This old template had a bug that didn't free up memory when using the "tp" command, so if you teleported a number of times, you'd use up all your memory.