Ive seen loads of videos teaching how to make a steam lobby, can i turn that steam lobby into a server? Can i use it like a Hamachi so that a player hosts a server and other people join trough something like a steam port?
Ive seen multiple tutorials showing stuff like, host rpc, client rpc, targeted rpc, do these work for both peer to peer and dedicated server, how different is building a peer to peer game and a dedicated server game in relation to calling rpcs and sharing information.
#Theoretical question in relation to server hosting and steam SDK
26 messages · Page 1 of 1 (latest)
RPC is a "remote procedure call", it's basically a wrapper that map a packet to an instance's method within your code.
It is not specifically related to dedicated servers, it's just a wrapper.
It works in peer to peer too.
Here is an example of basic RPC:
// Sender
Kill()
{
KillRPC(this.networkEntity.Id, KillMethodId);
}
KillRPC(entityId, methodId)
{
packet.body.entityId = entityId;
packet.body.methodId = methodId;
Send(packet)
}
// Reader
KillRPCCallback(packet)
{
entity = Entities[packet.body.entityId];
if (packet.body.methodId == KillMethodId)
entity.Kill();
}
Kill()
{
Destroy(gameObject);
}
Add to that some reflection that collect the RPC by annotation with a couple of dictionaries to map the network entities by ID and you've a system like Photon or Mirror.
It's basically a design pattern, not much to do with networking itself.
Thank you, got it
a.thor thanked xahellz
Relay services essentially serve the purpose of Hamachi like service when it comes to dealing with port forwarding related issues. Scope of those Hamachi like services is a bit larger, but users not having to open ports to be a host is the primary purpose here afaik.
Those networking concepts generally work the same. Primary difference between client hosted servers and dedicated servers is the reliability of the host, which might lead you to think about host migration and what that may involve.
when you host a server trough relay, is it a peer to peer or is it tecnically a dedicated server
also why is unity relay payed per CCU, does it cost unity anything for each CCU using relay?
is there a difference between peer to peer and dedicated, ive heard that p2p is where everyone is hosting the game at the same time while dedicated has a server owner
i just got more confused the further i looked into it, from what i knew as a "Gamer" was that p2p basically tries to match everyone's game and have the ticks at around the same time so if someones internet were to be bad the server itself would be bad, while dedicated or hosted would depend on the host connection
One could have a dedicated server behind a relay.
You can think of dedicated servers as someone specifically running server software for a given game/application, while "peer to peer" (this has a more strict definition too) games have clients who can become hosts just by running the game.
There doesn't have to be any real networking code differences. Common special feature would be to make sure any state can easily be transferred between each client to make sure any client can takeover the hosting duty.
are there free relay solutions for unity
i think fishnet has a free relay solution right?
Valve and Epic provide free relay services. Open source networking solutions tend to have implementations for one or both.
thank you
thank you
a.thor thanked dannywebbie
Relay servers certainly cost money to run in hardware and bandwidth, but I don't really have any insight into why companies choose different monetization models.
CCU is certainly seems like an easy way to scale pricing based on how successful your client likely is. We have seen Unity and Apple both implement per user runtime fees, and per seat pricing is common for more company facing products.
got it,i understand that about the ccu's, my question was because i thought that relays were a client side and not a "service on the net"
Ah, yea, relays relay 😛
yeah, i guess that makes sense, i thought that relays would relay the data from within the router/pc, not to a server and from a server to the computers