Closed RoxDevvv closed 11 months ago
Current project is on hold as I am occupied with other things. It would be nice if we have new contributors otherwise I will continue to work on in in 1-2months.
Is godot have network transport layer if so could you give me link of example, i will try to write it
I was looking at this myself, I think you have to inherit from PacketPeer for the transport layer and MultiplayerPeer for connection creation/management.
https://github.com/godotengine/godot/blob/4df80b0e629e25653a706f6721c13a1f9d1da368/modules/enet/enet_packet_peer.h https://github.com/godotengine/godot/blob/4df80b0e629e25653a706f6721c13a1f9d1da368/modules/enet/enet_multiplayer_peer.h
Best guess would be to look at the enet stuff and try to rework that I think.
You then set the active multiplayer peer with multiplayer.set_multiplayer_peer in GDScript.
Oh this looks promising. What I had in mind was to not use any Godot specific network but rather directly implement the P2P interface given by EOS. Is there any pros or cons of using either method?
Well i think you have to map the EOS P2P layer onto the godot PacketPeer and MultiplayerPeer classes, basically create eos_packet_peer.cpp/h & eos_multiplayer_peer.cpp/h. Then the higher level godot multiplayer stuff works normally as I understand it. If you look at PacketPeer it has virtual functions get_packet and put_packet which would need to be mapped to EOS P2P calls to receive and send packets over EOS.
I was just showing the enet one as an example of how godot uses the base class internally for the default transport. Basically it would end up something being like that but using EOS instead of ENET.
Doing it this way will it support Godot's networking functions like rpc, rpc_id, etc
Yes thats my understanding.
e.g. once you implemented those two classes, you would write something like this in GDScript
# Create client.
var peer = EOSMultiplayerPeer.new()
peer.create_client(EOS_REMOTE_PLAYER_ID)
multiplayer.multiplayer_peer = peer
# Create server.
var peer = EOSMultiplayerPeer.new()
peer.create_server()
multiplayer.multiplayer_peer = peer
and then all the other multiplayer stuff @rpc, etc would just "work".
Obviously you have all the EOS lobby stuff first which the clients get the host socket id from.
Doing it this way will it support Godot's networking functions like rpc, rpc_id, etc
yes that is the purpose of the transport layer
this some examples of transport layers EOS made for unity FIshNet : https://github.com/ETdoFresh/FishyEOS Mirror: https://github.com/FakeByte/EpicOnlineTransport
I forked the repo and am currently working on implementing the p2p interface. My fork is here: https://github.com/LowFire/epic-online-services-godot
I've made some pretty good progress so far. Still trying to work some things out and am writing unit and integration tests for it.
Thanks for the contribution! Hoping to see great progress.
Closing since merged https://github.com/3ddelano/epic-online-services-godot/pull/13
when do you think we will have p2p thank you for the great work