Author Topic: Memory Problems  (Read 2305 times)

0 Members and 1 Guest are viewing this topic.

Offline Corby

Memory Problems
« on: April 29, 2002, 02:04:45 AM »
I have a sorta of credit scene at the end which involves animating several views at once. When this happens I get a screen that says out of memory. Is there any way  around this because it has happened more than once and causes me to limit the animation in one room, making my game a bit less enjoyable in my opinion.
Does discarding views or anything along that line free up memory?



Offline Joel

Re:Memory Problems
« Reply #1 on: April 29, 2002, 08:30:25 AM »
Yes, discarding views does free up memory. However, you absolutely must discard them in a last in first out order. There was a big thread where I had a memory problem a few weeks ago. Look for "Memory management problem" on page 3 or 4 of the board.

Randy

  • Guest
Re:Memory Problems
« Reply #2 on: April 29, 2002, 09:38:02 AM »
I have a scene where 10 objects are created and stay on the screen while the user is on that scene.

Is it better to have several smaller views that get loaded into memory and displayed as different objects on the screen, or to have one large view that gets loaded once and has all the views necessary for each of the objects as different loops (instead of having to load different views).

It seems that the overall memory usage should be the same but I wasn't sure if there were other factors involved such as: taking up a little extra memory to load a new view, or loading larger view upfront maybe causing problems...

Offline Nick Sonneveld

Re:Memory Problems
« Reply #3 on: April 29, 2002, 10:00:58 AM »
I don't think it would make too much of a difference.  There is a small bit of memory that is allocated for each view resource loaded however.  (less than 20 bytes I believe)

Having smaller views would let you reuse them in other rooms and discard views if one object disappears later on in the room.

- Nick
Nick Sonneveld  |  AGI Dev  |  NAGI

Offline Corby

Re:Memory Problems
« Reply #4 on: April 29, 2002, 06:25:56 PM »
Thanks, that worked... next game I make, i'll be sure to actually use loops instead of just one set of cels per view.
How do you set a maximum score and fill in that "about" window?

Offline Chris Cromer

Re:Memory Problems
« Reply #5 on: April 29, 2002, 06:51:11 PM »
To set the maximum open logic 91 and change the max_score value from 0 to whatever number you want it to be.

To change what the about menu says, open the games src directory, then open defines.txt and look for this line:

Quote
#define game_about_message "About message"
Just change what is in the parentheses to whatever you want the about message to say.
Chris Cromer

It's all fun and games until someone get's hurt then it's just fun. ;)

Offline Corby

Re:Memory Problems
« Reply #6 on: April 30, 2002, 03:28:08 AM »
That worked out good, but when ever the game is restarted, the previous score remains...  I found the restart command line, but what do I add to it erase the previous score?

Offline Nick Sonneveld

Re:Memory Problems
« Reply #7 on: April 30, 2002, 08:09:45 AM »
Link to thread on Memory Management Problem

- Nick
Nick Sonneveld  |  AGI Dev  |  NAGI

Offline Blacki

Score
« Reply #8 on: April 30, 2002, 11:56:55 PM »
The current score is a variable, I couldn't tell you off the top of my head what number it is, but it will tell you in the AgiStudio help file.  Then just set it to 0.

v? = 0;

Offline Joel

Re:Memory Problems
« Reply #9 on: May 01, 2002, 12:06:53 AM »
Probably the best way to reset the score is to go to the first room in the game (most likely logic 2) and look for the part in the new room section for the very start of the game -- there just add a statement to reset the score:

Code: [Select]
if ((prev_room_no == 0 || prev_room_no == 1))
{
 // some stuff here

 score = 0;
}



SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.061 seconds with 21 queries.