slow muddy performance

BlitzPlus Forums/BlitzPlus Programming/slow muddy performance

gerald(Posted 2012) [#1]
Hi

With a longer game my result slows and muddies in the middle to end. 48 pictures with periodic games and a ding noise seem too much for my code. The ding becomes ddddddiiiiiiinnnnnnnngggggg and the page flip slows quite abit. How do I keep it sharp and smappy from start to end? I tried delays but they didn't help that I can say.

Is a frame rate setting to blame? Too fast or slow?


Gerald


andy_mc(Posted 2012) [#2]
Lay off the hot mountain dew with milk.


Matty(Posted 2012) [#3]
At a rough guess I'd say you are doing something like continually creating new images in memory, or loading in your main loop, or creating more and more types without handling them correctly....basically not managing your resources correctly....although from that description it is hard to tell.


gerald(Posted 2012) [#4]
I figured out a few things. I was loading the sound each time I used it. I only need to load it at certain spots. I was doing the same with an image used to mark a selection. I removed 99% of these duplicate loads. This helped alot. I still get some dddddddiiiiiiinnnnnnnggggggg in the middle of the program. I switched to multiple data folders for the 80 or so images I am using. This helped alot (data cabs?).

The force is strong in you Matty!

I AM continually creating new images. Is it possible to flush cache or memory? Is it possible to set up chapters, parts, subroutines, or breaks that are like starting a new program but you don't exit? How is this done in a long game, missions etc?

What is "handling them correctly"? I only cls/flip/cls and load/flip/load the images what else can be done?

Gerald


Timjo(Posted 2012) [#5]
If you just need to clear unnecessary images from memory, you can use the 'FreeImage' command.

With some more detail we might be able to help a bit more. What are you doing that you need to keep creating/deleting images? Perhaps there's a more efficient way of achieving what you need.


gerald(Posted 2012) [#6]
Hi,

I was loading my backgrounds every time I used them also. This helped. I switched support images to "globals" so I only load them once at startup. This helped.

I spotted the freeimage and freesound commands in the reference area. I cannot use them as I use the same file handle for each background as I load it. Unless there is a backlog of "copy of background " or background2 type files I only have the most recent background in memory and I crashed the program using the freeimage on the existing background.

Is there a memory size commmand? Is there a list items in memory command?

Currently there is only trouble with several "dings" in the middle of the program. They can be slow to respond and ring repeatedly sometimes, (ding,ding,ding,ding,ding). It is kind of like the program might be looping at this point, exicuting the command repeatedly. It is puzzling as the same code works fine in 32 other cases in the same program. I sort of think it is getting tired or something. The AI is bored and goofing with me! I'm down to checking for spaces at the end of a line of code or something. The debugger finds nothing.

Thanks for your input.

Gerald


Matty(Posted 2012) [#7]
With blitz you need to manage memory mostly by yourself..maybe post some code so that we can help further?


Timjo(Posted 2012) [#8]
Can you not use the 'GrabImage' command to re-grab your background - using the same image handle?

A bit more detail as to why you need to constantly re-create your background images would help us to see what's going on and find a solution.