Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualbrokilodeluxe

Posted 15 March 2013 - 12:23 PM

Let me try to elaborate a little bit.

If I create an explosion object for example, I want the sound to be played once whenever it is created/first frame or whatever. This works fine for single player.

 

But in multiplayer, the server sends the client the list of objects to populate the level, so entities are created a whole bunch of times on the client.

 

This leads to explosion sounds being played numerous times until they despawn. The only other option (as I saw it) was to create a sound list and only play sounds from there, so that's why I have it set up in this way. But this leads to packet loss if you rely on the server to send it to you, which leads to sounds not being played since they get removed from the list as soon as they are played once.

 

I could just send a bunch of flags for each entity like a "isSoundPlayed" boolean whenever I repopulate my level, but that's still relying on the server for sound information, which would lead to the same problems I would guess.


#2brokilodeluxe

Posted 15 March 2013 - 12:18 PM

Let me try to elaborate a little bit.

If I create an explosion object for example, I want the sound to be played once whenever it is created/first frame or whatever. This works fine for single player.

 

But in multiplayer, the server sends the client the list of objects to populate the level, so entities are created a whole bunch of times on the client.

 

This leads to explosion sounds being played hundreds of times until they despawn. The only other option (as I saw it) was to create a sound list and only play sounds from there, so that's why I have it set up in this way. But this leads to packet loss if you rely on the server to send it to you, which leads to sounds not being played since they get removed from the list as soon as they are played once.

 

I could just send a bunch of flags for each entity like a "isSoundPlayed" boolean whenever I repopulate my level, but that's still relying on the server for sound information, which would lead to the same problems I would guess.


#1brokilodeluxe

Posted 15 March 2013 - 12:17 PM

Let me try to elaborate a little bit.

If I create an explosion object for example, I want the sound to be played once whenever it is created/first frame or whatever. This works fine for single player.

 

But in multiplayer, the server sends the client the list of objects to populate the level, so entities are created a whole bunch of times on the client.

 

This leads to explosion sounds being played hundreds of times until they despawn. The only other option (as I saw it) was to create a sound list and only play sounds from there, so that's why I have it set up in this way. But this leads to packet loss if you rely on the server to send it to you, which leads to sounds not being played since they get removed from the list as soon as they are played once.

 

I could just send a bunch of flags like a "isSoundPlayed" boolean whenever I repopulate my level, but that's still relying on the server for sound information, which would lead to the same problems I would guess.


PARTNERS