Closed marc-weber1 closed 1 month ago
That is easily done. I'll do it since a lot of multiplayer demos take that structure, though it's not great when both players use the same speaker and mic.
I am trying to go up a level with a peer-to-peer networking-over-webrtc (mqtt signalling) plugin can be dropped into any game with minimum hassle. At the moment I am working on this one: https://github.com/manuq/truco-card-game/pull/1
I've done a big redesign to allow more negotiation of who is online and who is the server, seeing how most of these games are structured so that the multiplayerpeer object is constructed and used prior to any connection being made. https://github.com/goatchurchprime/godot_multiplayer_networking_workbench/tree/roommonitor
This is a very trivial game example, but the features get complicated quickly since the audio needs to be stereo spatial so that the speech from the card player on the left comes through the left speaker.
Ping me on the discord @JulianTodd if you have time to test any of these plugins.
I've copied your example across and merged the server and client versions of it. This works okay if you do Debug -> Run multiple instances, and set it to two. The second runner fails to create a server on the same port and makes a client instead.
https://github.com/goatchurchprime/two-voip-godot-4/tree/main/trivialexample
You can install twovoip from the asset after you open it and get errors. However Godot unhelpfully deletes any Audio busses with Effects it doesn't understand, so this deployment method is not great.
Might be slightly too trivial, because it's hard to tell the difference between a microphone echo and a genuine transferred audio channel.
Why can you hear yourself with only one client open if the Mic bus is set to mute?
Told you it was easy to make mistakes. The microphone was not directed at the Mic bus. Fixed now. https://github.com/goatchurchprime/two-voip-godot-4/commit/cc2addf78a0f51076b427433bd4cbbb6935cb55c
To make it more practical for someone making e.g. a first person shooter and just trying to get it working with as little effort as possible, would it be possible to make a second example with just one gdscript file, with no UI and only absolutely necessary components? e.g.:
https://github.com/RevoluPowered/one-voip-godot-4/blob/main/demo/main.gd
just to help devs get started faster, and help new contributors have an easier time testing
(also thank u for getting something working I been short on time lately)