#Theoretical question in relation to server hosting and steam SDK

26 messages · Page 1 of 1 (latest)

olive kernel
#

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.

ember trench
#

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.

olive merlinBOT
#

a.thor thanked xahellz

icy hatch
#

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.

olive kernel
#

also why is unity relay payed per CCU, does it cost unity anything for each CCU using relay?

olive kernel
#

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

icy hatch
icy hatch
icy hatch
olive kernel
#

are there free relay solutions for unity

#

i think fishnet has a free relay solution right?

icy hatch
#

Valve and Epic provide free relay services. Open source networking solutions tend to have implementations for one or both.

olive kernel
#

thank you

olive merlinBOT
#

a.thor thanked dannywebbie

icy hatch
# olive kernel also why is unity relay payed per CCU, does it cost unity anything for each CCU ...

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.

olive kernel
icy hatch
#

Ah, yea, relays relay 😛

olive kernel