The Daily Click ::. Forums ::. Klik Coding Help ::. TGF is running out of memory!
 

Post Reply  Post Oekaki 
 

Posted By Message

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
13th May, 2008 at 22:10:10 -

Given my nasty habit of answering my own questions and spamming a million posts in a row, I did enough testing to finish this off:

Step 1: Copy the 3992 kb NOT corrupted version
::Copy is not corrupted
Step 2: DELETE a sound effect that only occurred ONCE in the editor
::Copy is not corrupted
::Memory now displays 3962 kb used; the SFX was 30 kb (roar1.wav)
Step 3: ADD a sound effect that DID NOT already occur in the editor (15 kb)
::Copy is not corrupted
::Memory now displays 3980 kb used; where the extra 3 kb comes from, IDK, but I'll assume its overhead
Step 4: DELETE that same sound effect
::Copy is not corrupted
::Memory now displays 3968 kb used; yet another 3 kb has been added. Looks like each time one is added or deleted, 3 kb is added permanently regardless of size of the file.
Step 5: ADD a sound effect that ALREADY occurred in the editor (7 kb)
::Memory now displays 3968 kb used; this DID NOT add to the total memory



SOLUTION TO PROBLEM:
Many of the sound effects in my game were ripped from the Warcraft III World Editor; they ranged from 50 to 150 kb in size. By deleting several of these, I can reduce the total memory used dramatically, well away from that 4000kb maximum. Then I can replace them with other, smaller, sound effects, and not worry about the game corrupting due to memory issues, just to normal TGF suckage.
Speaking of TGF suckage, the memory from the MIDIS cannot be reclaimed.


CONCLUSIONS:
TGF is capped at 4000 kb of midi/wav per frame
TGF WILL reclaim the memory freed by deleting all copies of a SFX
TGF WILL NOT reclaim the memory freed by deleting all copies of a MIDI
TGF WILL NOT take additional memory for an occurrance of a SFX that already exists elsewhere in the frame
TGF adds 3 kb permanently to your memory whenever you add a new SFX that doesn't already exist in the editor, or delete all occurances of one, on TOP of the normal filesize of the SFX.
Once TGF exceeds 4000 kb, the world asplodes
TGF sucks major balls.

Image Edited by the Author.




Err and finally; Converting all the WC3 ripped SFX from 22.05 HZ 16 bit Mono encoding to 11.025 HZ 8 bit Mono encoding (1/4 the size for each file) resulted in a folder that totaled 720 kb. Hence the total size of those SFX was ~2880 kb, and I will be freeing up ~2160 kb of memory from my 3992 used.

Hence, you really gotta watch the filesize of the sounds you put in your game. Thats the moral of de story.

Image Edited by the Author.

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
13th May, 2008 at 23:54:36 -

woot

 
n/a

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
14th May, 2008 at 00:12:05 -

well fuck that.

after hours of work, I reduced it from 3992 to 2062 memory for sound. I converted tons of files, and replaced well over half of the games sound effects.

Everything worked well

I try adding NEW sound effects (well more of the same ones that already existed in the .gam file)
BAM IT CORRUPTS AGAIN.



Gridquest is effectively dead in the water. I can't add new sound effects to the game or it corrupts, even if I remove all the old ones. For some reason, REPLACING old ones with new ones doesn't make it crash.

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
14th May, 2008 at 00:18:56 -

Yup this is definitely the issue. Adding even a SINGLE more sound effect to the game, anywhere, will result in corrupted game. It seems there is a finite amount of sound effects you are allowed in the event editor, and I have hit it EXACTLY on the dot. I'll count up how many I have

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
14th May, 2008 at 00:25:45 -

EXACTLY 512 EVENTS WITH SOUND EFFECTS (512 = 2^9)
its definitely a cap on the amount of calls to the .wav player, perhaps on every object.

Thus when you add a 513th, it crashes.

I am now replacing all redundant sound effect events with flags that trigger that SFX later in the code, dramatically reducing the amount of calls involving the SFX object.

Image Edited by the Author.

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
14th May, 2008 at 01:52:51 -

has it worked thus far?

 
n/a

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
14th May, 2008 at 02:10:23 -

yarr, looks like I should be able to finish it up, I just reduced the amount of events that used the sound player, so I doubt I'll hit 512 again. I posted Blobquest under the DL's in the meantime, so that should be up tomorrow

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456
   

Post Reply



 



Advertisement

Worth A Click