Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Multiplayer sound

Author
Message
CAJUN57
16
Years of Service
User Offline
Joined: 29th May 2008
Location:
Posted: 7th Jul 2008 01:37
Ive been writing a multiplayer system using multisync that can show other players and such by having every client send there position to the server then the server puts all the ints into an array then sends them back out to every client which then loads the players model in the correct position(if anyone knows of an easier way please let me know), I was seeing if anyone would have an idea of how to play a sound through all the clients if one player shoots all the others can hear it?

SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 7th Jul 2008 01:53
Basically the same idea. The shooter sends the server a message. Let's say you define the sound of a shot as 1. The shooter's client sends that value to the server, then the server sends the value to all the clients, which is interpreted client side as the sound of a gun shot.


My site, for various stuff that I make.
CAJUN57
16
Years of Service
User Offline
Joined: 29th May 2008
Location:
Posted: 7th Jul 2008 02:12
I think i got it with the whole idea of giving each packet sent to the server a header so they can be identified. Which works like oyu told me

sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 7th Jul 2008 06:15
It may be worthwhile to think or doing multiplayer game code along the following lines.

Every action that a player is wanting to do is stored in a data structure.
EG:
Turn Left
Turn Right
Run
Shoot
etc......

The game will look at the information in this data structure and move the character depending upon what is in this data structure.

At no time does the player directly move his own character.

This data structure is the actual data that is being sent from every player, to the server, and then from the server, back to every other player.

As in your Question..... When you press the gun trigger, the Shoot entry in your data structure will be set to a logic 1 .

Your data structure will be sent to all other players through the server.

On every player machine, the game when it is scanning through the data structure for your player, will see the Shoot entry set.

Every machine will therefor now run the code to shoot the gun for your particular player and produce the sound for that shot.

Basically your character is being controlled by remote control through its own data structure, in exactly the same way, on every players machine.

Hope that helps.

Login to post a reply

Server time is: 2024-09-30 01:23:26
Your offset time is: 2024-09-30 01:23:26