EmergentOrganization / cell-rpg

:black_square_button: connect to a universe where cellular automata have run rampant
http://emergentorganization.github.io/bridge/
Other
12 stars 1 forks source link

playing too many Sound()s at once? #94

Closed 7yl4r closed 8 years ago

7yl4r commented 8 years ago

I've noticed that causing a lot of explosions will cause the music loops to temporarily cut out. I think this may be a limitation with the number of audio channels available to play sounds... or something like that. It may be that we need to wrap our Sound.play() calls in a manager which is a bit more clever about which sounds get cut out when we near the max.

orelb commented 8 years ago

When I run the game, there seems to be no sound at all. And when I go to the menu to turn it on, it crashes when you press "Back".

Also, I think that the SFX component in his current state is not good enough, because an entity can't have more than one sound effect played at the same frame. Although this will probably rarely happen, I think there should be a queue for sound effects, we can use an array inside the component and specify its size in the SFX component constructor. I hope I'm clear enough.

7yl4r commented 8 years ago

When I run the game, there seems to be no sound at all.

That doesn't sound good. I'm really not sure what is going wrong there, since I think the MusicSystem and the sound effects are pretty independent except for that they both use Gdx.Sound. I wouldn't expect a bug like that in libgdx though. Do you know if Gdx.Sound works on your system? Maybe I can write a test for this...

when I go to the menu to turn it on, it crashes when you press "Back".

My guess for this is that there is an issue with writing the preferences. Do you have any relevant log output? (stdout log is duplicated to assets/resourced/app.log (I think)).

orelb commented 8 years ago

My bad, I was looking at some old code on the artemis branch, I just realized you migrated it to master.

BrianErikson commented 8 years ago

LibGDX only allows so many sound effects to be played at once. Since that's a reality, I've implemented a simple priority scheduler for sounds that trigger when an event happens.