Memory Issues

Randy I am coding an arcade sequence where ego is flying horizontally and objects zoom by. In addition to these objects, I am also animating background trees at different rates to give the illusion of depth. My problem is that I hit points where the game has to draw a lot of things at once and it crashes due to lack of enough memory. As it is, I cannot draw all the things I want to have on the screen since that requires too much memory already. What things can I do to streamline the memory usage? Is there a way of bumping up the memory limit for the game?
gpm I ran into this same problem with Hank's Quest, when you try to read the bulletin board at school, and the interpreter crashes from lack of memory. So then I used NAGI, and the problem disappeared. These memory issues, more than anything else, is why I like NAGI better than the Sierra interpreter - you can stuff more onto one screen.
David Smith Yes, I was never able to get past that part in Hank's Quest because it always crashed when I read the bulletin board. I have to say though that I found NAGI to be very difficult to figure out how to use. I couldn't get it to work. No matter what your game is, I think it's best to make it workable first on Sierra's interpreter rather than NAGI. Then, make sure it works with NAGI. Either that, or include a fully integrated NAGI with your game.

Can anyone explain NAGI to me. I've never been able to get it to work.
smartguy240 What I do is I got NAGI and the Sound thing file from Nick's website and I copied all of the files that I extraced. Then I pasted the files in each of the folders that I had an AGI game in and clicked on N.exe of nconsole.exe to run the game. Another advantage is to delete the file that is called AGISTUDIO in the folder ( is is an icon for me with a little yellow circle badge thing on it) that if you open it up says something like sierra.exe for the executable. Then I went into AGI Studio and clicked run game and it asked for the executable . I found the folder and clicked n.exe

Hope this helps!!

VvTG (Joel) You don't need to extract a copy of NAGI into each game directory. In the NAGI.ini file or something like that there is a list of directories where NAGI should look for games. If you just have a folder called something like AGIGames and under that you have subfolders where you extract all the game files, then you should be able to specify that NAGI look in the AGIGames folder and it should find all of the fan games that you have installed there. I'm pretty sure that's how it works, but it's been a while since I made that change on my computer (and I'm not on my computer right now) so I don't know for sure how you do it.
Sami_Tervo well, while i was designing my own project's interface i bumbed into similar problem. the best way to start solving problem is to add display(23,1,"Memory available %v8"); and some pauses to code to see how much memory each part takes. i solved my memory problems by reassigning views to objects and after use destroying those from memory, using position-command(like in agimouse's paint-program), animating objs and erasing them after use. kinda recycling you know. but one of the most effective was to rewrite entire game. i deleted all nonnecessery logics and removed some load.logics-commands from logic.000 (be sure to take back ups before doing that stuff!!) so game wouldn't load/use anything unnecessery stuff. after i had done that i had only two 'must have' logics. logic.000 and logic.91 (ini). that should help.
David Smith I do have to say, I still can't get NAGI to work. There isn't even an executable. All I can say is, please make your games runnable with the Sierra Interpreter. With "Dave's Quest", that is definitely a priority!
sonneveld When you go to NAGI's download area, make sure you download the nagi package and the SDL package. Both of them have to be decompressed into the same directory.

- Nick
HWM. Uh, when EXACTLY does the problem with Hank's Quest occur? If you approach school for the first time, and when in school, the first thing you do is "READ BOARD" it doesn't... At least, I think so... I do know that later in the game, when returning to the school-entrance, the game could crash due lack of memory (par example, when doing SHOW OBJECT, the picture of the object you chose doensn't display; doing this again will crash the game). Could anyone give an exact definition?
gpm Hank's Quest crashes from lack of memory during the first time I enter the school scene, when you enter "read bulletin board". The game crashes right after it displays the last message on the board "Your first class is in Room 114 and your second class is in Room 122" (or something to that effect). The message you get is "No memory. Want x Have x" (I don't remember offhand the number, but it's just barely short on memory).

Eventually I just got sick of it and stuck with NAGI. I just wish NAGI shook the screen :)
sonneveld The source is available. You could always implement it yourself. :)

I should have time in the next week or two anyway.

- Nick
HwM So it crashes at load.sound(18);, the "point taken" sound. But no matter how hard I try, it doesn't happen. The memory available is 8(something). I'd like to see some kind of parallel between the people with the memory problems...

It is either that they have less memory to start with (since the original interpreter only uses the 640k base ram, i think) or they did something in the game that spilled memory-resources... The last scenario sounds most likely, however I don't know exactly what different versions of Windows do with your base memory, so I'll keep the "less memory to start with" as an option.

But there are enough people who haven't got this problem, atleast, nobody complained. I'd read about it here. And ofcourse several have completed the game.
sonneveld Perhaps you could use the "memory pages free" variable (can't remember which)..

record what it is before and after you load the sound. You'll know how much is used then.

Then, just check and make sure you have that much free before loading the sound? Gold rush does this for some of it's bits 'n pieces.

- Nick
smartguy240 To Joel:

I know that you dont have to but all of my AGI games are in different directories and the NAGI file dosent reach them all from where I put it.

SMG240 ;)
sonneveld NAGI, by default, only searches all the directories one level above the current directory.

You can add more paths in the nagi.ini file.

- Nick
happyturk2 I just recently came across this precise problem with the opening cutscene of my game; just as above, too many animated objects on screen for scenery effects, it chokes on one and crashes.

But what's odd is that it didn't used to, and I haven't touched the cutscene since I got it running correctly; the only things that have been added are later in the game, and I suppose this is some aspect of the engine or what-have-you that I'm not familiar with, but I can't see why the memory requirements of that scene would have changed when all that was added are things it hasn't even gotten to yet at that point in the load-up.

What's even more odd is that it's such a severe lack of memory; something like needs 788, has 132. And again, this sequence used to work fine. I'm rather puzzled, but I'll probably eventually figure it out; I'm just adding another account to the thread.