Game likes stuttering when sounds are included

For questions about using Classic.

Post » Mon Aug 13, 2012 4:35 pm

Hello
I have a problem:
I make a game, and everything is OK... until I insert a sound. When I set sound related with (for example:) "collision between object 1 and object 2", When this event should take place, now the game is stuttering (game is stopped during 0.5-1 second <screen is frozen> and then plays again. I understand that's a kind of a burden for the whole game, when the sound is playing. But I cannot build the game without sound - it must be some way to solve this problem. Perhaps this question has already been raised, but unfortunately I didn't find anything on the forum.

I will be grateful for any advice given to me.

Sincere greetings

Chris/bodzio_stawski
B
6
S
1
Posts: 29
Reputation: 614

Post » Mon Aug 13, 2012 4:50 pm

I don't have enough details to say for sure, but my guess is that the problem lies in the way your events are structured. Can you upload your CAP file so we can see what's going on in your game?
B
6
Posts: 27
Reputation: 404

Post » Tue Aug 14, 2012 12:33 pm

Yes, please upload a .CAP file so we can see actuall problem.

P.S.
Polak?
B
5
S
1
Posts: 37
Reputation: 576

Post » Tue Aug 14, 2012 11:40 pm

OK
http://www.sendspace.pl/file/a9f35ac1e378a82c2224d5b

(click on "pobierz")
PS: There are more problems than I thought. Just check it :)

Polak :)
B
6
S
1
Posts: 29
Reputation: 614

Post » Wed Aug 15, 2012 8:12 am

I didn't notice any stuttering or brief pause when the ball hits the paddle or bricks. Did you already fix this before uploading your CAP file?

Anyhow, when I lost the game, there was a noticeable stuttering of sound and the program became unresponsive. To fix this problem, add a "trigger once" condition to your game-over event, as shown below.



By the way, I found your game to be very entertaining. It made me laugh to see the paddle getting destroyed bit by bit every time the ball hit it. Elyzius2012-08-15 08:14:19
B
6
Posts: 27
Reputation: 404

Post » Wed Aug 15, 2012 8:56 am

I'm terribly sorry for this, I didn't write about fixing of the first issue - I managed to solve this, and the sentence "There are more problems than I thought" is attached just to this error with "GameOver" sound, which you rightly have found.

You're right, "trigger once" condition solve the problem with playing sound, so thanks :)
But unfortunately, the game after losing the ball still stops responding. So it's not the end of the problem :(

---
Thanks, the "bit by bit" destroying is conceived to be a key feature of this game :-)
B
6
S
1
Posts: 29
Reputation: 614

Post » Wed Aug 15, 2012 10:51 am

That strange MOD object is causing the crash. I don't know what it is, or why you've added it to the game, since i've never used it, but if you just erase it the game works fine after losing.
B
6
S
1
G
1
Posts: 69
Reputation: 1,019

Post » Wed Aug 15, 2012 11:42 am

You're right! Once I inserted an object MOD (MOD is a specific audio format), because I wanted to see if many recurring sound problems depend on the sound format (and I forgot to remove it later). But as the one MOD file can make that the game is unresponsive... :)

As my sound problems have been solved, .I can close this topic. So great thanks for Elyzius and shadowlord!!!bodzio stawski2012-08-15 12:04:47
B
6
S
1
Posts: 29
Reputation: 614

Post » Wed Aug 15, 2012 4:59 pm

So how You solve this ...
"game is stopped during 0.5-1 second <screen is frozen> and then plays again"
Because I have a similar problem.

Pozdrawiam rodaka ;)
B
10
S
2
G
2
Posts: 11
Reputation: 931

Post » Wed Aug 15, 2012 5:35 pm

Yes, it was precisely this problem, about which I wrote at the very beginning, and that I solved it later, and I forgot to mention about it ...

I do not know how about you, but in my game it appeared when sound was playing by setting this system event:




So, as the normal system event worked bad, I decided to use an object "XAudio2". I set the action:

On collision between <object> and <another object> (because I wanted to hear sound in such a situation)

===>             1)XAudio2: Load file "abc.wav" to channel 1 (no loop)
2)XAudio2: play channel 1


And that's all. In my game it works fine. :)


PS: wybacz, ze po angielsku, ale moze to innym tez sie przydac :)

B
6
S
1
Posts: 29
Reputation: 614

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests