Framerate drops after a few minutes in Mac
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- AaronWizard
- Citizen
- Posts: 68
- Joined: Sun Nov 06, 2011 2:45 pm
- Location: Canada
Re: Framerate drops after a few minutes in Mac
On your suggestion, I've attached versions of my game (one .love file, one Mac app) with an FPS meter in the caption. I can confirm that it hovers around 60 FPS during normal gameplay. When it freezes the FPS meter drops to zero, if it manages to update at all.
- Attachments
-
- WarpRun.zip
- Mac app
- (5.63 MiB) Downloaded 151 times
-
- WarpRun.love
- (1.28 MiB) Downloaded 151 times
Re: Framerate drops after a few minutes in Mac
I have good and bad news for you. For the first time i got that freezing slowdown. During gameplay I had all keys and I was heading/searching warp to second structure. Started to freeze in a totally random situation. The good of this is that I have some guess now of what's going on. For me It looks like a sound problem. I had other sound problems long ago with another game, Ellohir zombie's game (viewtopic.php?f=5&t=3940) that would almost lock after a while if sound on. I reclaimed but that sound problem never was fixed and only with sound off would be playable. Try to play it (it's a 0.7) game and see if same problems happens to you.AaronWizard wrote:On your suggestion, I've attached versions of my game (one .love file, one Mac app) with an FPS meter in the caption. I can confirm that it hovers around 60 FPS during normal gameplay. When it freezes the FPS meter drops to zero, if it manages to update at all.
Force quitting and reading what log crash manager wants to send to apple I have the feeling that audio part of love there is too big (looping?)
So, I think could end be several things like:
- Some bad audio sample specifically badly eaten by osx
- your code or the audio manager lib isn't dealing well with some situation (in osx)
- Love/audio osx frameworks could have some issue.
- AaronWizard
- Citizen
- Posts: 68
- Joined: Sun Nov 06, 2011 2:45 pm
- Location: Canada
Re: Framerate drops after a few minutes in Mac
Aw man, now I have to debug my sound system again.
Did anyone figure out the problem with the zombie game? It seems after reading the thread that all that anyone came up with was a setting to turn the sound off completely.
All my sounds are .ogg files, all exported from Audacity. All 16-bit PCM and 44100Hz. All but one were stero, and I've since changed the single mono sound to stero to match.
And now to explain how my sound manager works, in case someone notices something wrong.
My SoundManager (sound_manager.lua) is meant to handle sounds and sound attenuation (couldn't figure out OpenAL). It keeps a table of SoundData objects indexed by file name, which are used to create Source objects whenever I want to play a particular sound. Used up Source objects are also kept around in a table indexed by file name so that they can be reused instead of creating a new Source object to play a certain sound again.
So if I want to play "bot_attack.ogg", it first checks if there's already a Source object for that file in the used-up Source pool. The existing Source is removed from the pool and replayed if such a Source exists. If a new Source has to be made, it creates one from the SoundData object for that file, creating it if necessary.
When a Source is finished playing (it has stopped) it is added to the used-up Source pool.
Source objects are actually wrapped in a sound table to contain some other information. This includes position, so that way I can do sound attenuation in a simpler manner than OpenAL. A sound may also be specified as "unclearable" and as "persistent".
The SoundManager has a clear function that manually stops and removes all active sounds, which I use when changing the scene. Unclearable sounds are ignored by the clear function, and are only removed when they finish playing naturally.
Persistent sounds get to stay in the SoundManager table of active sounds even when they're stopped, though they still get removed with the clear function. This is used for looping sounds that I stop and start manually, namely the walking sounds and the sound that the green cubes make when they're sparkling.
I also have a pair of streaming sounds I create an manage outside of SoundManager that I use for the background ambience.
Did anyone figure out the problem with the zombie game? It seems after reading the thread that all that anyone came up with was a setting to turn the sound off completely.
All my sounds are .ogg files, all exported from Audacity. All 16-bit PCM and 44100Hz. All but one were stero, and I've since changed the single mono sound to stero to match.
And now to explain how my sound manager works, in case someone notices something wrong.
My SoundManager (sound_manager.lua) is meant to handle sounds and sound attenuation (couldn't figure out OpenAL). It keeps a table of SoundData objects indexed by file name, which are used to create Source objects whenever I want to play a particular sound. Used up Source objects are also kept around in a table indexed by file name so that they can be reused instead of creating a new Source object to play a certain sound again.
So if I want to play "bot_attack.ogg", it first checks if there's already a Source object for that file in the used-up Source pool. The existing Source is removed from the pool and replayed if such a Source exists. If a new Source has to be made, it creates one from the SoundData object for that file, creating it if necessary.
When a Source is finished playing (it has stopped) it is added to the used-up Source pool.
Source objects are actually wrapped in a sound table to contain some other information. This includes position, so that way I can do sound attenuation in a simpler manner than OpenAL. A sound may also be specified as "unclearable" and as "persistent".
The SoundManager has a clear function that manually stops and removes all active sounds, which I use when changing the scene. Unclearable sounds are ignored by the clear function, and are only removed when they finish playing naturally.
Persistent sounds get to stay in the SoundManager table of active sounds even when they're stopped, though they still get removed with the clear function. This is used for looping sounds that I stop and start manually, namely the walking sounds and the sound that the green cubes make when they're sparkling.
I also have a pair of streaming sounds I create an manage outside of SoundManager that I use for the background ambience.
Re: Framerate drops after a few minutes in Mac
I managed to clear a whole stage without it freezing. I've tested it several times and the only time it crashed was when I started a new game in fullscreen. It crashed before I could move the player and I had to cmd-optn-esc to get out of it.
I love the 'starburst' mystery box weapon by the way! Though you may want to tweak the sound volumes when using it, it is somewhat abrupt.
I love the 'starburst' mystery box weapon by the way! Though you may want to tweak the sound volumes when using it, it is somewhat abrupt.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
Re: Framerate drops after a few minutes in Mac
I can say with confidence that this issue is almost resolved. I've tested a version of 0.8.1 that uses OpenAL Soft on OS X and it works wonders. I was getting crashes in a few minutes on my game. With the new version, I couldn't make the game crash.
Hopefully, OpenAL soft will land in master soon. I'm eagerly awaiting a 0.8.1 release.
Hopefully, OpenAL soft will land in master soon. I'm eagerly awaiting a 0.8.1 release.
Re: Framerate drops after a few minutes in Mac
Those errors you quoted from the console are a consequence of something in the Löve binaries. They have nothing to do with your project (and I can't wait for them to be gone!).
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
Who is online
Users browsing this forum: Amazon [Bot], Google [Bot] and 12 guests