Hi there
is it possible to build a peer to peer network in Unity3D - rather than a server-client network?
thanks
Hi there
is it possible to build a peer to peer network in Unity3D - rather than a server-client network?
thanks
No
All goes through the server
Anything else would be a problem as anyone with a restrictive firewall would no longer be able to play as all peers in a peer 2 peer network have to setup their firewalls etc as if they were servers.
I was hoping that the Facilitator could negotiate the connection of a computer into the network somehow.
Just read about this group that having been exploring massive 3d p2p networks - interesting
I suppose what I was curious about was: if you had, say, 100 users that had all created their own 3d worlds, running on their own computers in Unity3D - could these users all connect somehow and then jump between these worlds?
Basically a de-centralized 3D peer-to-peer setup?
Nope, one simple reason, Unity will only allow a single client connect command, if you do more than one it drops the first. Also in Unity, you can only be the client or the server with its current command set.
I have slightly different problem. I’m sure this is solvable using the Mono TCP/IP stack, I just don’t want to reinvent the wheel if something’s already out there.
Is there a solution for ad-hoc connections where the server is simply discoverable? We only need something that works on a local LAN – clients will all be local and I don’t need NAT punch-through etc. In particular, I don’t want the bother of running my own master server.
Thanks,
David Gish
You could use the regular socket on client and server just for the use of broadcast detection and server information transfer
Is this still true?
or did they changed in to possibility to Peer to Peer?
I’m reviving this post, because it’s been 5 years till now, …
The networking hasn’t changed in the last 4 years, yes it’s still valid.
Wouldn’t it make more sense to mold networking around peer-to-peer? Then peer-to-peer would be possible and making server-client networking would be as easy as designating one of the peers as a server. Not to mention peer-to-peer is the natural way to think of networking, and Unity really makes you think you’re doing peer-to-peer with the RPCs before you realize that everything goes through the server even when directed to a specific player.
Compared to native server-client making peer-to-peer literally impossible. I mean there are a lot of valid uses for peer-to-peer in games, one thing I would love is to make it so servers could communicate with each other.
Hey guys,
Youre all saying that it
s impossible to implement p2p networking using unity networking API,
but what if i used socket class from .Net and use it to implement my own protocol. Would it
be possible then? I know that for online gaming the firewall would still be an issue, but it should
work for lan, shoudn’t it?
Thanks
hmmm, …
Scaroni, seems you can’t since .Net does not have PeerToPeer class, …
I’ve just found some data here:
sigh it’ll take 50 years till unity will make P2P if you ask me, …
if we wanted to have P2P would it be possible to have it with making some Plugins?!?!?
If there is a lot of demand for a real peer-to-peer solution (where there really is NO server, and all clients send all their data to all other clients), I could considering building one on top of my UdpKit library.
what do you mean UdpKit library?
how would you build P2P in unity?
sdgd, i mean: I would use another networking library which works with unity, then the default one. which would allow me to build a peer-to-peer solution.
hmmm, … that would be interesting I’ll be keeping a watch on that, …
well all I need to have is send a message over the web and recieve it I can program my self if I want to make sure the message was recieved. OR if wrong message came from wrong address, …
like X IP loged in and does stuff.
than Y IP sends message same as X IP but nothing is returned to Y IP, cuz Y IP isn’t loged in and no current function exist to deal with Y IP behaviour, …
sometimes I don’t get it, …
Servers in a micro structure are peer to peer anyway.
and in Macro structure they aren’t.
and what bugges me the most is why can’t we do micro.
it’s kinda same as saying you can make children but you can’t have sex.
Im working on a fighting game one-on one style, and P2P seems like the way to go. It seems very odd to me that Unity doesn’t support it.
Does Unity still restrict a pure p2p network architecture?
Unity doesn’t have a built in high level solution designed for peer to peer. You certainly could build your own on top of the LLAPI or NetworkServerSimple though.
You can use Unity’s LLAPI to create a P2P connection. Just let every player open socket as host and then one more socket for every other player in the game. Then every player connects to each others host socket. If your game is run over the internet then you need to use a NAT faciliator though or you will run into problems.