Author Topic: Did I break my template? Restart frees more memory than initrooms  (Read 3544 times)

0 Members and 1 Guest are viewing this topic.

Offline Cloudee1

So over the years, i have been adding bits and pieces here and there to the template game some of which I made comments about and some of them I didn't so it is impossible for me to actually find all of the edits.

Anyway, I have noticed something in my quest for memory domination  ;D and I was wondering if this was caused by some of my edits or if this is the case for everyone. I have noticed that if I change the end of the title screen script from
Code: [Select]
(send gRoom:newRoom(INITROOMS_SCRIPT)) to
Code: [Select]
(send gGame:restart()) alot more memory resources are freed up. I'm still using a list of UnLoad(rsVIEW 800) for every resource I used, but that same list is used both ways.

I just ran a little test and using initrooms script I have 13930 free Bytes of heap, using restart gets me to the same point with 16428 free Bytes. Have I changed something causing my initrooms script to malfunction or is it indeed true that using restart instead of initrooms frees more memory at game start?
« Last Edit: January 29, 2007, 10:05:03 AM by Cloudee1 »


Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline Eigen

Re: Did I break my template? Restart frees more memory than initrooms
« Reply #1 on: January 29, 2007, 02:07:08 PM »
It does have very slight difference here too. At first the free heap was 17262 bytes, but with restarting it was 17354. As the manual states about the RestartGame() function .. "It restarts the game by stopping all the sounds, disposing of the menubar, clearing the heap status, and disposing of all the scripts. ". But I wonder where this difference comes from ..


-Eigen
Artificial Intelligence Competition

Offline lskovlun

Re: Did I break my template? Restart frees more memory than initrooms
« Reply #2 on: January 29, 2007, 05:47:03 PM »
Actually, this is the usual way of skipping past/ending the intro in SCI games. The template game is modeled after LSL3; that one is an anomaly. Most other games don't use an INITROOMS script at all - I'm surprised you'd try this, though.

Lars

Offline Cloudee1

Re: Did I break my template? Restart frees more memory than initrooms
« Reply #3 on: January 29, 2007, 06:24:31 PM »
Trying it was a result of putting buttons up "start" "intro" "restart" on the titlescreen after clicking the mouse. I had the syntax handy for restart so I copied and pasted it in there for the start button figuring it puts at the same point as the end of the initrooms script.

I had assumed however that restart at some point crossed paths with the initrooms script. But reading your last comments, I guess it probably doesn't afterall. I'm also guessing that since the title screen is the only thing that ever calls the initrooms script (I don't see any others anyway) then we really don't need the initrooms script at all.
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition


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

Page created in 0.021 seconds with 22 queries.