#archived-networking

1 messages ยท Page 94 of 1

dim merlin
#

Players do not send their turns at the same time

#

One player will have to wait every turn for updates

grim violet
#

yeah?

#

well

#

player 1 send data to server, receive if it pass or not, then send to client 2 the change

#

its done in a fraction of second

dim merlin
#

And seeing as a REST API cannot contact a client but a client can contact a server, it would seem that there is no other way for the waiting player to get updates, other than constantly pinging the API until it's told that the turn has ended

grim violet
#

then player 2 play his turn, send data to server, server say yes or no

#

then send to client 1

#

you do it by turn like that or go hyper complex and wait the end of battle, both player send result to server, compare if data is equal, and guess who the winner

dim merlin
#

I think we are talking past each other atm

grim violet
#

im not suer what is with the PING

#

you dont have to use ping anywhere

#

;p

#

get that ping off your head lol

#

when you send data to rest api, you can get data back

#

no the rest api cannot contact player 2

#

but the client that send data to server, can

#

thats why the game is p2p, with rest api as server

#

alot of turn based game are made like this

#

In reality you want to send what player 1 and 2 did only at the end of the game. You can start battle, both player send a message to rest api saying they are in fight, rest api put them both into a container meaning they are fighting, no data, just the name and timestamp
Then both player play the game and send data to each other only. At the end of the game, both player send their combat logs to the rest api, rest api check if both data match the combat, if yes, you know no one cheated, and if one did, the other did too, which mean he clearly let the other win so it doesnt matter, he could have not played during the game and still lose.
Now if you compare both data and one of the player is wrong, you gotta check against the db which one did an illegal move, and make that player lose.
There you got full authority over your game with only a few send to the rest api. All this with p2p

weak plinth
#

@rare grove , sorry there is alot of info in the thread, so I may be repeating others. In general, computer networking works by taking data, serializing it on one computer, transmitting it via protocol and deserializinf on other side. So, how multiplayer works entirely depends on the use case. Because of this, the philosophies and approach come down to authors philosophy and needs and can't be summarized down to "this is the one way". The needs of a TCG game vary from that of a moba, from that of a time trial racing, from that of a battle royal. The library you choose or write will decide architecture and approach. Mirrors philosophy to generic networking is, from what I can tell with my blighted exposure, transport decoupled client server architecture, where client is also server and control is dictated by authority. They use attributes to specify data that needs relayed or in their terms synced. If you read that book on sockets and them come back to mirror as an implementation that integrates unity concepts, I think you'll be well prepared to understand and use mirror and or another library, or write your own. Feel free tonmessage me so we don't annoybthe thread. Cheers.

dim merlin
swift stratus
#

Greetings, i hope that i am not disrupting the conversation. I am currently having some trouble setting up a relay server for my mirror multiplayer game.

Context: I am trying to make a 2 player co-op game for a game jam project. I have the local network set up for mirror so my current step is to make it work over the internet.
I have joined the mirror server and they pointed me towards this transposer for mirror: https://github.com/Derek-R-S/Light-Reflective-Mirror.
I have created a Google Cloud project with a VM running. I managed to push the server file that existed inside the repository i linked above.

I managed to add all the nessesary files and API's (.Net 3.1 & the server files) and the server seems to be running per accordance to the command console seen here:

#

However, Unity prints out that it cant connect to the relay

dim merlin
#

You could try there if you want ๐Ÿ™‚

swift stratus
#

I know

#

I mentioned this in my message

grim violet
#

You could go that way using rest api, but thats alot of in and out for not much since its a turn based game

#

and if you do that

#

i dunnoh

#

its weird

dim merlin
grim violet
#

yeah but thats alot of in and out, you want to try to keep that to the floor to have many players

#

instead of sending every move, you can send all the move in the end and check it all at once

#

thats what im trying to explain

dim merlin
#

I understand that it's a lot of requests but as far as I know REST was also designed with this in mind.

grim violet
#

with that way, player 1 send data to server, server accept, player 1 tell player 2 data has been sent, player 2 sent data to server, receive update, then tell client 1 game can continue

#

and that every turn

#

with my way, its twice, at beginning and end

#

๐Ÿ˜›

dim merlin
#

It also requires that the two players know about each other programmatically which seems unnecessary.

grim violet
#

?

dim merlin
#

I'll think about it at least.

grim violet
#

game is played just like in your way

#

your way work too i mean

#

but if it get high amount of player

#

you gonna regret

weak plinth
#

Sorry to interrupt gents, im trying to catch up, I think a custom socket solution would be best @dim merlin, I know it's a lot of work. But games are stateful apps usually and forcing that to adhere to stateless request response would be more headache then it's worth. Not to mention the overhead for wrapping game state in http for no real value. This is just my opinion. Rest is great for transactional relationships, but not for relationships that "know about" eachother which is why web sockets are used in conjuction for more state full functionality alot.

grim violet
#

im talking about hundred or thousands

dim merlin
#

If I get a high amount of players, I'd likely have to shift to better server infrastructure and sockets.

grim violet
#

have to get there first

dim merlin
#

The question just is what kind of frameworks could I use to help this?

#

Would I really have to code it from scratch?

weak plinth
#

I bet monogame has some stuff

#

It's an xna clone but I bet it was some useful abstractions for game state transfer

dim merlin
#

hm

#

I wish there was some sort of starting point I could refer to because jumping into a codebase like that does seem rather daunting >.<

weak plinth
#

Looks like they use Lindgren.

dim merlin
#

Never heard of it

weak plinth
#

Yeah I understand, but, networked games are daunting by default! :b

#

Socket programming really isn't that bad in c#

#

I do it in c++ at my day job...

grim violet
#

i did it in perl

weak plinth
#

Ooph

dim merlin
#

I don't doubt that networked games are harder to do, just that I'm not the first to get into this so there must be stuff out there for people like me who is getting into it but aren't seasoned networking veterans yet

weak plinth
#

There are abstractions. Like the one above. But usually network tries to strike a balance of performance a d high level, so it tends to be an expert domain

#

Unfortunately

dim merlin
#

Yeah but no one is born an expert..they start somewhere ._.

#

Regardless of domain

grim violet
#

my first network program was a port scanner

#

using tcp

weak plinth
#

Same

grim violet
#

god that was crap

weak plinth
#

I used to be an ethical hacker

grim violet
#

me too

#

lol

#

ahh the 90's

weak plinth
#

Haha nice to meet you!

grim violet
#

When internet was fun

dim merlin
#

I don't know if it was fun back in the 90's...seems like a bit of romanticising ๐Ÿ˜›

weak plinth
#

Haha, I'm the next generation, I barely remember slow days haha

#

Yeah haha

#

Omni

#

Read this sockets book.

dim merlin
#

I grew up during that time and I had internet in my parents house. It was not great tech at the time.

weak plinth
#

Its dense

#

But great

grim violet
#

you could tell people to fuck off with your ip shown and no pursuit

#

;p

#

getting hacked left and right

#

it was free for all

dim merlin
#

Anarchy like that sounds great on the surface, when you get to be in power of some bubble. But if you don't, you just get to be a victim instead.

grim violet
#

oh i was victim for a while

dim merlin
#

Not a great deal but for the few

grim violet
#

thats how i learned

dim merlin
grim violet
#

first time i installed linux i didnt know about setting passwrod to root, get formated 1 day later

#

great time

dim merlin
#

This isn't some "Back in .net -2.4 days..." book right?

weak plinth
#

And I know it's painful, but, be grateful it's not the 90s and your reading a rfc or Berkley sockets api reference in c....

#

Haba

#

It is, but sockets are timeless

#

So ignore that

grim violet
#

we didnt have link like this back in the day

#

had to find urself lol

dim merlin
#

ho boy..

weak plinth
#

I promise

#

It looks old

#

But the info is the same

#

Haha

dim merlin
#

Well I say that because often when it comes to doing things like this, you learn by doing. And if a lot of the practices in this book are ancient because we found better alternatives, it might just make my life that much harder.

weak plinth
#

There aren't a ton of books on the subject in c# sadly

#

Trust me, sockets programming hasn't changed at all.

#

Because it relies on the same osi model that cannot change

#

The world runs on it

grim violet
#

tcp ip and udp back in 90 is the same yeah

#

;p

weak plinth
#

App protocols are added, thats the innovation

grim violet
#

making from scratch is hard thought

#

lot of things you gotta think of

#

and if you never made that before, you wont think about that

weak plinth
#

It's true.

grim violet
#

you gonna face ton of problem

weak plinth
#

Yaeah, but the abstractions 5hat exist require this base knowledge

#

Unfortunately

grim violet
#

better use an already made solution or copy from someone who already made something that is recognized

#

at least for starter

weak plinth
#

I'm not suggesting writing your own. But this knowledge will carry you tonunderstanding Lindgren or mirror or insert game object state transfer lib here.

grim violet
#

and it wont be everything, just the data transmission protocol, you still have to think all the logic to make the game over that

weak plinth
#

You have to do that anyway, let's not lie :b

dim merlin
#

I mean, I hope you are right.

weak plinth
#

Well, no matter what you'll be better having learned. But if you insist, just try to read the docs of Lindgren

dim merlin
#

I'll check out both

weak plinth
#

What about your plans for server infrastructure rules out mirror?

#

Can't be tied to unity for some reason.

dim merlin
#

From what I understood, Unity would be needed for both client and server to use Mirror

#

That doesn't seem like a good idea

weak plinth
#

Help me understand why. The licensing?

#

I mean why that's not a good idea btw, not why it's tied.

dim merlin
#

From what I gather, Unity has a thread count limit of 1200 threads or so. It would also be a lot to run a server through the unity client when you need none of the rendering no?

grim violet
#

from what i know of mirror, you can have it headless i think

weak plinth
#

Depends on the game if that matters. I would think headless would be an option

grim violet
#

doesnt really matter if unity is needed, you gotta make your server with something anyway

weak plinth
#

Since their goal is persistent mmmo

#

Yeah, I was thinking that.

#

I try to avoid running persistent server because I'm cheap

#

And a bit old school, I like running ny own game server

dim merlin
weak plinth
#

It's turn based card game?

dim merlin
#

Yes

weak plinth
#

That's actually way simpler to do sockets for that

#

But

#

If its 2 ppl

#

Let them host it

#

What's your target platfoem

dim merlin
#

The idea will be a card game that could expand to include thousands.

weak plinth
#

Ohhhh

dim merlin
#

Still 1v1

#

But yea

weak plinth
#

Spectatos?

#

Why 1000s then

dim merlin
#

I need to make sure what I go for can scale :/

grim violet
#

thousands 1v1?

dim merlin
#

I mean 1000's of concurrent matches for example

weak plinth
#

Ohhh

#

Dude

grim violet
#

so use my idea

#

its free!

#

;p

dim merlin
#

I just wanna hear multiple opinions

weak plinth
#

Do you need matchmaking?

#

Ranking?

grim violet
#

you gonan end up doing it that way, watch ๐Ÿ˜›

dim merlin
#

I will be needing that eventually, yes @weak plinth

weak plinth
#

Then just do THAT on server. 1000s is nothing when it's just connecting ppl. Then let them be their connection with unity/mirror

dim merlin
#

For now I need to make an internal version that can be played among the people making the game. Seeing as they are not located in the same place, it should at least have some online capabilities. Thing is, I have read stories of how hard it is to put MP in after the fact, compared to building something in as you go

weak plinth
#

That's true. I still think mirror works here. Let me explain.

#

Real quick, whats your target platform

#

A droid?

dim merlin
#

For now PC

grim violet
#

plz dont copy magic the gathering ui

#

it suck

#

;p

dim merlin
#

I'm not designing that part ๐Ÿ˜›

grim violet
#

i like the card game but not the pc game

#

lol

weak plinth
#

Haha

grim violet
#

ok ok ๐Ÿ˜›

weak plinth
#

So

#

You can indeed use rest if you want for this

#

Because

#

Your server simple keeps lists of online ppl

#

It doesn't manage game state

grim violet
#

and you can scale easily

#

compared to any other solution

dim merlin
#

But wouldn't the server still need to be the judge on legal moves?

grim violet
#

it is

weak plinth
#

Yes, it's just calculated on the client pc

dim merlin
#

It just sounds a lot like "trust the client" .-.

weak plinth
#

No

#

It's not

grim violet
#

you dont trust client for anything in a turn based game

dim merlin
#

I know...that's what I just pointed out..

grim violet
#

the client do the calcul, ask server if calcul is right

weak plinth
#

You're running same logic that you would have written

#

It's just on their oc

#

Pc

#

Bow

#

Now,

#

If I am misunderstanding, correct me. You are worried they'll disassemble and change the IL/c# and cheat?

#

If they themselves are the server?

dim merlin
#

I mean, that is one of the basic concerns right?
But could also be some attempted injection or whatever before a request is sent off.

grim violet
#

it doesnt matter

#

if client change data and server check against db and its not right

#

you just dont accept it

#

you have to make an account with the rest api, get a database, put all the card player own in that, if you loot, server decide of the loot and update db, then send info to client

#

just is just holding informations of what he got

#

but dont really decide anything

#

he do calcul

#

but server will do everything

weak plinth
#

So we're talking about card ownership aren't we

#

No gameplay cheats

grim violet
#

if client decide to cheat, you can know from the server and decide what to do, not update db and make him lose

weak plinth
#

I think there are several strategies for this. If it's card ownership, yeah, keep a dB of account info on the "user and matchmaking server"

grim violet
#

doenst matter if the clients play the match together without asking a single thing from the server, in the end, they send the combats logs to the server, server do a scan of that and check if all the move was possible against the db and tell which client won the game
yes the player can cheat during the match, but still aint gonna win

#

now if you really dont want player to be able to cheat during the match no matter what will be the result, you need mirror or something real time like that and not use rest api

weak plinth
#

Yes

grim violet
#

but is that necessary

dim merlin
#

I really don't like the idea of having a match just going on even though one party clearly cheated before they send off that to a server for verification.

#

Seems very risky

#

and also just very time consuming for players

weak plinth
#

I understand

grim violet
#

having full authority with real time data = big server that cost money

weak plinth
#

Yes

dim merlin
#

Assume that server infrastructure will be taken care of

weak plinth
#

Okay

dim merlin
#

This isn't just some solo indie game

weak plinth
#

Then go headless

#

Mirror

oblique scaffold
#

Hello im new

dim merlin
#

so headless mirror server

#

p2p mirror clients

#

?

#

Is that what I'm getting?

#

Or should it be sockets?

oblique scaffold
#

I said hello

weak plinth
#

Mirro = easier.
Sockets = challenging but more control

dim merlin
weak plinth
#

Hey demonic, sorry

dim merlin
weak plinth
#

We're all debating haha

oblique scaffold
dim merlin
#

I wasn't being rude.

weak plinth
#

Yes, all network solutions eventually are sockets

oblique scaffold
#

You cant even welcome new people

oblique scaffold
dim merlin
#

We were in the middle of something here, stop causing a fuzz dude.

weak plinth
#

Text is hard to emphasize feeling

#

I'm sure he didn't mean it. Welcome!

oblique scaffold
dim merlin
#

I didn't mean to be rude it was just stating a matter of fact. Not some personal attack.

grim violet
#

lmao

dim merlin
#

I mean okay, suit yourself.

weak plinth
#

Whoa, guys guys guys.

oblique scaffold
grim violet
#

that what happen when big brains talks

dim merlin
#

I feel like this guy is trolling us gotta be honest :/

oblique scaffold
weak plinth
#

No, I think he's just upset. It's all good

oblique scaffold
#

You think I waste my time for trolling

weak plinth
#

All are welcome

oblique scaffold
#

thats stupid

dim merlin
#

I mean look at his tags. He took like all of them.

oblique scaffold
#

I hate trolls

weak plinth
#

Oh, I didn't notice

oblique scaffold
#

Ok

#

so what

dim merlin
#

Student and Producer, okay.

#

Anyway, @weak plinth & @grim violet
Thanks so far at least. Was helpful.

oblique scaffold
#

๐Ÿ˜’

dim merlin
#

If that was toxic towards you, I don't think you've experienced toxic man :/

weak plinth
#

So you'll have xomplete control if you roll your own with bare sockets and no concerns regarding needing unity. But, at the cost of engineering time and money

oblique scaffold
dim merlin
oblique scaffold
#

General is dead

#

so

dim merlin
weak plinth
#

Or another abstraction. There might be some out there. Check out the one I mentioned and I'll keep an eye out

dim merlin
weak plinth
#

Demonic, were sorry

#

It's all goos

oblique scaffold
#

I cant interrupt people

#

Well I dont even know the channels

#

Not like I was here for ten years

dim merlin
#

So logistics wise it would be something like:
Mirror client 2 mirror client
Mirror headless server

Mirror has sockets already so that should be okay I think.

#

Might make things easier.

#

I guess I should make separate setups for querying the database

#

REST could probably be useful for that

#

So internally a piece of software uses REST as the db interface

grim violet
#

what do you mean by "mirror has sockets already"

#

all library does

dim merlin
#

It means I don't have to make the sockets myself...

#

I would think that's obvious.

grim violet
#

well a socket is just a name meaning a connection to an ip and port, any library will do it

#

can your library talk to a rest api?

#

thats a different thing

#

i dont know if mirror do, i know photon do with webrpc

dim merlin
#

Look, it's a semantic argument at this point. Let's just say that; If I can use Mirror it would cut down on a lot of time I don't have to spend reinventing the wheel.

#

=_=

grim violet
#

the functionality behind is really what you looking for

#

and you wont know before testing it

weak plinth
#

I get the point. I think the summation is:

Network lib not attached to unitu = higher engineering cost, learning cost, engineer hiring cost, more control.

Role your own = most control, most expensive all categories.

Unity integrated = cheapest, least control

grim violet
#

just thinking mirror is realtime api with authoritative server, there no use for rest api, i dont believe they have that

#

you could always use unitywebrequest to talk to your data server rest api but that kinda break the point of using mirror

#

should just take both and take the time to test them

dim merlin
#

I'd just use an internal REST API as the database interface for things like my server

#

The abstraction layer between my database and my game server

weak plinth
#

Can anyone help me with a game?

drifting turtle
#

I want to implement peer to peer networking for a fighting game, but with faked latency, I have read that unet is being deprecated and I am worried that it wont be able to support the features I need (lockstep, rollback) during the time of the project. Is there an alternative which is reliable or is unet still considered reliable?

jade glacier
#

Unet didn't have any of those features to start with, so no harm using another library. @drifting turtle

verbal lodge
gleaming prawn
#

And it (MLAPI) will also NOT support deterministic predict/rollback AFAIK, which is what fighting games use (and you mentioned specifically).

weak plinth
#

But for a card game, just use plain sockets

#

There's hardly anything to sync, there's hardly anything real-time

#

It'll actually be scalable, and you have 100% free choice over what server architecture you use.

versed rock
#

Hi guys, i want to create a Card game, i search for a relay server for the online 1vs1 and save the user data in online database, any idea?

weak plinth
#

Make that relay server not just relay, but authoritative

#

Have that server communicate the results of the 1v1 games with a database

#

You have pretty much free choice in database and server architecture, since it doesn't need to be, and imo shouldn't be a Unity server

versed rock
#

i mean, any project or app that allow that? i mean... for example Photon is a relay server

weak plinth
#

Make it yourself, websockets or tcp sockets

#

It's easy enough with something like a card-game

versed rock
#

i think i'm going to try with websockets

#

but any project in github for reference?

weak plinth
#

Not that I know of. But there should be plenty of resources available on something so basic

#

I suggest to look for 100% self made games

versed rock
#

i don't know for sync the game state haha

weak plinth
#

There's not much to sync in a card game, assuming you don't have a simulation

versed rock
#

yeah, that's true

weak plinth
#

Much like a chess game, nothing happens to the game state

#

Only when someone makes an input, and then nothing happens again

#

For a chess game I made, I only send the input to the server

#

Validate the input, and forward it to the client if it's correct

#

Otherwise, I rollback the client that sent a faulty input

#

@versed rock

void SGameHost::onRemoteInput(sf::Packet& packet)
{
    ChessMove newMove;
    newMove.netSerialize(packet, false);

    if (packet && inputMove(newMove, true, true)) {
        m_server->sendToClients(packet, m_observers);
    }
    else
    {
        sf::Packet snapshot;
        snapshot << PacketType::Snapshot;

        m_boardManager->serializeBoard(snapshot, true);
        m_server->sendToClient(snapshot, m_playerID);
    }
}
#

That's pretty much the entire authoritative part I have, and I suspect it's not going to differ much from what you are planning to make

safe lynx
#

Anyone here good with php that can help me?

#

Right now i have a ton of scripts that are super disorginised and i want some advice making a orginization scheme

#

[GetDate] A testing script that returns the current data
[getOnlineUsers] The server client calls this script with the server key and it returns a list of all the user-ID's in the online database
[getStats] Used by the discord bot to generate the statistics
[getUser] Used by the bot to get the username of someone given their discord uuid
[getUsers] Old script
[linkUser] Used by the bot to link a user-ID to a Discord uuid. given a username and password and a discord-ID
[login] Used by any client. given a username and password it returns the user-ID associated with that account and adds that user to the online list. it also generates a unique APIToken that is valid while the user is online. the user uses that APIToken to validate themselves in the future.
[logout] given an APIToken it logouts a user voiding the token and removing a user from the online database
[registerUser] given a username and password it registers a user into the database and returns the userID
[sql] given a SQL query it runs the query and returns the result (Disabled lmao)
[getUserInfo] given a userID it returns all public info about that user. currently just the username and the users color

#

And i want to try to make it so i dont have to move anything around in the future cause every time i restructure i have to change all refrences in the code

ornate zinc
#

you should include one reference PHP file on the top of your child files to get all the values/references they need @safe lynx

safe lynx
#

could you elaborate a little more i dont fully understand

ornate zinc
#

๐Ÿ™‚ that simple ๐Ÿ™‚

#

Oh its german, my bad

safe lynx
#

lol i saw

ornate zinc
safe lynx
#

hmm i dont see how that could help

ornate zinc
#

I mean, you have a lot of small files, whats your issue with them. Do you want one big chunk of file instead?

safe lynx
#

well each small file is a unique function that gets called for diffrent reasons for diffrent users

#

some functions requires APITokens

#

some functions are server/localhost access only

safe lynx
#

each client in unity accesses them via a URL

#

so for a client to login they do a POST request to serverurl/app/login.php with paramerters username,password and it returns the userID and a unique APIToken used for further accesses

#

i just dont know how i should go about making it a little more consise for myself to handle

#

like structuring them in folders or concatinating scripts

ornate zinc
#

Oh, well, I guess there is no like best thing to do. You could of course just order them with get / post or functions and data storing. more like personal preference than the way to go.

safe lynx
#

i suppose but it feels kinda like something thats been standerdizes in the past

ornate zinc
#

I would maybe try to group them for data, user, and server stuff. Just my 2 cents here on first thought

safe lynx
#

like coding conventions

ornate zinc
#

Lets take my headless CMS for example. I am just using API endpoints structured to their functions. One is for sending email with specific content asked by the user, another one gets me my data out of the CMS to json. So I have one function in those endpoints and they are ordered in their folder. But as your functions are not really doing some close to same thing, it would be just weird extra level to have one folder for one script.

safe lynx
#

interesting...

ornate zinc
#

I would just keep the fileNaming the same, so GetDate should be getDate, but thats what I see now

safe lynx
#

i suppose. im also planning on making this a website aswell

#

having a front end cause the structure is there

#

currently any error or denied access request just redirects to an index.html page

ornate zinc
#

Is this some hobby thing or client work?

safe lynx
#

hobby

#

im makin a game

#

and needed a backend

ornate zinc
#

Oh alrighty, yeah, it sounds like your files grow with your development, right ๐Ÿ˜‰

safe lynx
#

yep

#

i just wanted to get a structre down as early as possible

ornate zinc
#

So maybe just get pen and paper, write down what you need, you'll find your strcuture best suited for you there. ๐Ÿ™‚

#

Like, what endpoints do you have, what data will be transported to where, and so on

#

Maybe you do not need to write your on php sign and register and what not if you are using a CMS already. Headless CMS is a great way to just work with data

safe lynx
#

probably
(Server) for serverside only functions
(Authencation) what you use to login
(UserOnly) what you use to make general communication it also requires an api token

#

whats that?

#

im using a MYSQL database for the backend storage

#

and the php scripts to interface with them

ornate zinc
#

So you actually build your own little headless cms there, without backend interface obviously. And yeah, I like your structure there, makes sense to me. ๐Ÿ™‚

safe lynx
#

well theres kinda backend interface i think. im also creating a custom unity instance called CeaseServer that will do the bulk of serverSide code

#

it has a compleatly private APIKey that it used to access the server only scripts

ornate zinc
#

Nice, I like your setup there ๐Ÿ™‚

safe lynx
#

it runs on the same computer as the Database so it accesses it via localhost

#

thanks!

ornate zinc
#

You wanna tell what your games about or is it secret right now ? ๐Ÿ™‚

safe lynx
#

nah its compleatly open

#

its gonna be a VR multiplayer dungeon crawler

#

ive been working on a desktop mode for it aswell

#

ive been working on the backend for a while now. i got an account login system with username storage personalized names

#

been working with photon realtime and photon chat for the P2P stuff

elfin pecan
safe lynx
#

ye its been intresting learning how to code for VR from scratch

#

and learn how to code networking from scratch

lunar plinth
#

i'm trying to make a game using photon pun 2 and i have this script that doesn't work ``` public override void OnPlayerEnteredRoom(Player newPlayer)
{
Debug.Log(newPlayer.NickName);

    if (PhotonNetwork.IsMasterClient)
    {
        GameObject playerReadyObjectInst;
        playerReadyObjectInst = PhotonNetwork.Instantiate("playerReadyObject", Vector3.zero, Quaternion.identity);
        playerReadyObjectInst.GetComponent<PhotonView>().TransferOwnership(newPlayer);
        photonView.RPC("parentObject", RpcTarget.All, playerReadyObjectInst.GetComponent<PhotonView>().ViewID);
    }
}``` it feels like the problem is that it doesn't get called because i don't even get a log in the console.
rich narwhal
#

does anyone know why on one machine the collider works but the other a shot goes right through it, i know its not going through the network i just dont know how to fix it PUN

ornate zinc
safe lynx
#

I can invite you to the server

elfin pecan
#

I'll take a look

frank breach
#

anyone have idea how to use protobuf in unity?

weak plinth
#

I have a thread that calls socket.receive in an infinite loop.

When i set its exit flag to true from another thread not only the thread doesn't quit (obv its stuck awaiting the receive), but it causes a crash.

is there any way to gracefully close this thread, besides adding a timeout for the receive?

#

You should have a timeout for the receive

#

Unless you have some kind of handle that stops receiving

#

And why would it cause a crash?

#

thats some unrelated, i guess unity can't abort a thread when its stuck

#

ill add a canceltoken see if it fixes it

#

nope, apparently that's not the only thing that causes the thread to hang

#

i think i found it but....

#

an await will not yield if the called method returns null?????

#

is this true or am i tripping

elfin pecan
#

I haven't done that much async stuff but it's easy to get lost.
Are you doing any error handling on a return of null? Is it timing out and returning null or is it returning null and an error code?

weak plinth
#

Don't use the async functions.

#

Just call receive and/or poll, it's much cheaper

#

Just receive for 100-1000ms at a time in a while(isrunning)

graceful zephyr
#

Async is 100% useless for game networking

elfin pecan
#

Not looking at the network stack, what would be the best way to send updates from client to server then server to other clients?
I'm thinking of a VTT.
Token A moves from x1, y1 to x2, y2. That gets pushed from client to server then pulled to each client.
My thought was to push a serialized object to the server then have the other clients check for updates which would include character movements and other data.

#

Like, you last connected 2 minutes ago, here are all the token updates since then.

floral turtle
#

@elfin pecan is this for real time? If you don't need real time responsiveness, you could look into something like Firebase

#

it's fairly easy to get started, essentially a JSON database where you can subscribe to changed events etc

elfin pecan
#

Timing isn't strict. I'm thinking of a 3d version of Roll20 or Foundry VTT.

slim ridge
#

dont let clients push anything but normalized input

slow monolith
#

So for my game, the client's car's wheel rotation should match the server car's wheel rotation right?

#

and just have it do a rotation lerp?

#

^ For viewing other players, not when the player is predicting the car movement

grim violet
#

i wouldnt sync wheel rotation, that should happen auto when car move

slow monolith
#

yeah but the wheels only rotate when force is properly applied to the rigidbody. That won't happen when the updates come in from the server

#

it's just going to lerp the car to the correct position

grim violet
#

you are using physic on a client to move rigidbody and wheel turn by itself then other client you use lerp on position?

#

that sound wrong

slow monolith
#

correct

grim violet
#

you should use physic too

#

not lerp position

slow monolith
#

It does use physics, when the player is piloting it

#

but when the player is out of it, and someone else is controlling it

#

then player 1 only makes it lerp

grim violet
#

yeah thats not how its supose to be i think

slow monolith
#

hmm

grim violet
#

you gotta move it with physic too

#

i might be wrong but it sound more logical

#

than trying to sync all part of the vehicle

#

it could be a way too i mean if you are in the air and want to turn your backwheel while pressing pedal and want other to see that specific effect yeah

#

you gotta do it that way i guess

#

just physic should work too actually

slow monolith
#

I think you might be misunderstanding what I'm saying. So player 1 is piloting the car, and player 2 is standing beside the car, not inside of it. Player 1 predicts the car movement on his end with physics and does reconciliation checks and all that stuff. Player 2 only receives information about the car's position every 20ms

#

So if player 2 tried to move the car with physics, I don't know if that would work

grim violet
#

why not?

slow monolith
#

Well he'd have to receive a buffer of physics inputs right?

#

to apply

grim violet
#

you just push velocity and apply it i guess, there probably some math i never did it myself

#

im using photon and it calculate it under the hood but im not award of the math they use

slow monolith
#

well the car moves with physics entirely on the server's end

#

It's just getting the client to replicate it properly

grim violet
#

but your wheel and all that work with physic doesnt work properly

#

just sending velocity wouuld make all that work

slow monolith
#

how wouldn't it work?

grim violet
#

plus moving the car

#

well you said you want to sync the wheel?

slow monolith
#

on the client's end yes

grim violet
#

arent those wheel turning when you apply velocity to the rigidbody of the car?

slow monolith
#

yes, but when I send the car's position, the client makes the car lerp to that position

#
  • lerp the wheel rotation
#

so it looks like its moving while the car is moving right?

grim violet
#

why not just apply velocity?

#

and make it all in one?

slow monolith
#

trying to wrap my head around this

grim violet
slow monolith
#

yeah I just don't know if moving cars with physics is the right thing to do, because my players also move with physics and I just lerp the positions

grim violet
#

if a car hit another car and there an impact, how would you know how much velocity to apply to the impact

slow monolith
#

well the server handles that right?

grim violet
#

kk ur server doing all the work for the calculations

slow monolith
#

yeah

grim violet
#

then yeah i guess you gotta lerp everything like you doing

slow monolith
#

I see what you're saying witht the collisions though, car crashes probably wont be smooth on the clientside

#

since it has to wait for the server to recalculate and give the right positions after the collisions

dusky wedge
#

Hello everyone, I'm watching this playlist to learn someone Unity Networking but the videos are using the Multiplayer HLAPI and I saw that Unity will remove it so I don't really want to learn it. Does anyone have any other videos I can watch to learn Unity Networking
here is the playlist
https://www.youtube.com/watch?v=UK57qdq_lak&list=PLPV2KyIb3jR5PhGqsO7G4PsbEC_Al-kPZ&index=1&ab_channel=Brackeys

In this video we set up our Player and begin moving him around.

โ— Download cool Weapons: http://devassets.com/assets/modern-weapons/

โ— Developer Forum: http://forum.brackeys.com/
โ— Download project (GitHub): http://bit.ly/1JOvQ61

ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท

Learn how to make a multipla...

โ–ถ Play video
grim violet
#

its also alot of calcul for server

#

imt not sure how many people you want to handle

#

but it wont be that much

slow monolith
#

well it has to be done on the server regardless, since it's authoritative

grim violet
#

yeah but id imagine if your server give a start point and just take input from that, you can still have authority on stuff

#

with physic calculated on each client instead

#

i guess it depend of physic engine like the article i shown saying at begining of the read

#

i dont know about physx

#

how it work or anything

slow monolith
#

Isn't step 1 of networking to never trust the client?

grim violet
#

you dont

#

but you dont have to control everything on his screen too, server hold info of wher ethings are at and push that to everyone, if one client decide to cheat something for a sec, next update will fix it

slow monolith
#

alright

#

@jade glacier I'd like your opinion too whenever you get on, before I start this complicated module for my game

jade glacier
#

Way too much for me to read back through

slow monolith
#

@jade glacier So essentially every 20ms, server sends a list of all entities and their positions/rotations including the cars

#

when the client receives this, he just lerps the position/rotation of the cars driven by other players right?

#

Clients driving cars are predicted. so I don't know if that would make car crashes look weird or not

#

I could be wrong, but in Rust, whenever you crash into another car on the clientside, the collision happens, and then a quarter of a second later, the car you just collided with, will actually move. So I don't think they do crash predictions. Could just be a figment of my imagination though

jade glacier
#

The predicted cars will exist in the future, so there is always some weirdness there you have to account for.

slow monolith
#

alright

#

Would it help to put rigidbodies on ALL cars, even ones not currently being predicted?

#

So the player has SOME feedback of real-time crashes?

#

And lastly, the non-predicted cars get the wheel rotation from the server right? Since they're just being lerped and don't move with physics on the client?

slow monolith
#

but then I run into the problem where if a car hits a car that a user is currently predicting, it's going to be weird since the non predicted client cars don't move with physics.

#

@gleaming prawn Any thoughts?

#

The part that I'm stuck on is just determining if other player's (non predicted) cars should be moving with lerp transforms or through physics. Now that I really think about it, the cars all SHOULD be updated through physics right?

valid hawk
#

Hello would anyone be kind to assist me with echoing mysqli results back to unity with json objects?

#
  1. I'm not sure how I can echo multiple responses from a POST request with PHP
#
  1. Should I echo multiple json objects > work on them or make a single json objects with all query results?
ornate zinc
weak plinth
#

You are designing something poorly if you have to send out multiple separate JSONs

#

Use a DTO for something like this

#

It'll be easier to send and also easier to process on the receiving end

ornate zinc
paper stone
#

Hello all, I'm a little confused by concept of Relay Server and Dedicated Server (Authoritative). Is the difference between them is based on their set of functionalities?

As far as I understood:
Dedicated Server - used to process incoming packets from clients directly or using Relay server which is a proxy between Client and Dedicated Server. It also handle additional server-side logic like specific systems defined by user.
Relay Server - used to send packets back and forth between two destinations, can be used for a pseudo-P2P solution. Its Sending packets and can use packets optimization techniques.

Would be glad if someone would be so kind to let me know if I have the right idea. Thanks!

weak plinth
#

A relay is nothing more than a post office-like server

#

It's usually used for two clients to communicate with each other, where one client acts as the server(host)

paper stone
weak plinth
#

A dedicated server can be as simple as a client host running headless, which in some games is exactly what it is

#

"dedicated" means it's only purpose is to run a server, not act as a client where a player can play through

#

Authoritative means that the server (or whatever is authoritative in this case) decides the final outcome of the game.

paper stone
#

Yeah, I was only confused with Relay meaning since i've not remember using it

#

Alright, @weak plinth thank you!

spring crane
#

If you just wanna play around with networked games, Photon PUN is a pretty fun way to get into it.

#

They provide you a relay for upto 20 players for free, allowing play without portforwarding.

frosty coral
#

What are the best ways to store the client data in multiplayer?

#

I thought about creating a class specifically for this purpose, but that feels stupid

spring crane
#

I don't think that's terribly uncommon even for singleplayer ๐Ÿ˜„

#

Oh you mean all the data for the client? For some reason thought it to be some sort of player data.

ornate zinc
#

What is the client data tho?

shut yarrow
#

@weak plinth Regardless of playing with people in your own country or not, you probably need to do port forwarding for any other computer outside of your house to connect to you (unless you use something like PUN)

frosty coral
#

by client data I mean ID and whatever stuff that cannot be handled effectively via server, such as ammo counting

#

with limits

shut yarrow
#

It has a free tier

#

I think up till 20 CCU

weak plinth
frosty coral
#

I mean CCU

shut yarrow
#

@weak plinth isn't that what I said why you mention me ๐Ÿ˜›

weak plinth
#

That's not what you said

frosty coral
#

Number of clients that can connect at the same time to the server

shut yarrow
#

Concurrent users

weak plinth
#

NAT punchthrough and stun are not port forwarding

#

And UpNp is implicit, temporary port forwarding that the user doesn't have to do

frosty coral
#

that means 20 users can join at the same moment

#

and yes, it is the limit for free PUN

#

you don't

#

photon does this for ya

shut yarrow
#

Why overcomplicate things, nobody is going to use NAT punchthrough probably (it'll still require a server)

#

That's why I said PUN

frosty coral
#

@weak plinth you operate on your application remotely

#

no bandwidth goes through your network

weak plinth
#

No, you said "you probably need to do port forwarding for any other computer outside of your house to connect to you"
Which just isn't true

frosty coral
#

Photon PUN

#

it's just PUN

shut yarrow
#

Did you miss the part where I said (unless you use something like PUN)

#

You argue for the sake of arguing

weak plinth
#

Pun is a relay, that has nothing to do with nat punchthrough or stun

#

There's not port forwarding or pun either/or

#

There's other options...

frosty coral
#

I mean you CAN host the Photon server by yourself

#

but in most cases people choose the photon cloud to do all the job

weak plinth
#

@weak plinth Unity themselves recommend (and it's used in practice as well), is to first attempt UpNp for the host

#

If that doesn't work, STUN is the second best option

shut yarrow
#

If you want more flexibility then consider renting a VPS for a couple bucks per month, then you can run any server you like without port forwarding (your clients just connect to this machine somewhere in a datacenter)

weak plinth
#

If that doesn't work, you'll need a relay

#

Most home-routers have UpNp enabled

frosty coral
shut yarrow
#

Photon costs ridiculous amounts of money

frosty coral
#

Surely

#

But you still have to have a licence for a self-hosted server

shut yarrow
#

For photon yes

frosty coral
#

Thread is about the PUN, so I didn't mention alternatives

shut yarrow
#

Well he asked about options to not port forward, so PUN might be the best option especially for beginner

frosty coral
#

I agree

shut yarrow
#

And he can try out for free

spring crane
#

Yea it's worth considering the context

frosty coral
#

Photon is very easy to operate

#

especially PUN and Bolt

shut yarrow
#

20 I believe

#

Last time I checked

frosty coral
shut yarrow
#

Should be sufficient for testing

#

People with deep pockets

frosty coral
#

Large projects

#

with monetisation

shut yarrow
#

2000 is nothing really for a serious multiplayer game

frosty coral
#

^

grim violet
#

under 2k is not serious?

shut yarrow
#

But here is the joke of it. You could have those 2k users on a machine that costs you 20 bucks a month maybe, with photon you pay way more than that

frosty coral
#

per app

grim violet
#

2k user on a machine?

frosty coral
#

20 CCU is for one application on your photon account

grim violet
#

what kinda machine is that

spring crane
#

No, 20 total players online at the same time

shut yarrow
#

@grim violet I wasn't implying under 2k isn't serious, just saying 2k isn't something strange if you have popular game

frosty coral
shut yarrow
#

No

grim violet
#

in total

frosty coral
shut yarrow
#

Technically with PUN there's no concept of 'servers', instead you can have multiple rooms with max 20 players across all of them

spring crane
#

@weak plinth Not per server

shut yarrow
#

It is, but consider when you go over that you start paying considerable amounts of money that you might not necessarily earn already with your game

frosty coral
#

to which sentence is that a reference to?

shut yarrow
#

To the 20 players is good

#

It is for testing

frosty coral
#

I only find it useful for testing imo

#

it's very low

gleaming prawn
#

considerable amounts of money
This is relative

shut yarrow
#

Maybe so but in absolute terms you pay a lot more than other solutions with your own hosting

gleaming prawn
#

that's what I'm saying

#

It's not...:)

#

people gets confused by CCU...

frosty coral
#

Photon has it's other limits as well, so it's worth adding those to the total cost

gleaming prawn
#

CCU means simultaneous. To get something like 100 CCU (which is offered as a one-time payment for a year) you need around 40000 players in total in the game

gleaming prawn
#

not a hard-cap

frosty coral
gleaming prawn
#

PUN, sure.

#

not all photons are equal

frosty coral
#

Quantum is ignorable due to it's availability

gleaming prawn
#

For a hobby project yes

#

Bolt is same pricing as PUN in that matter though

frosty coral
#

I always wondered which Photon product can spawn NPC via server side

#

to not trust clients

gleaming prawn
#

Bolt by default.

shut yarrow
#

I'm not up to date with current photon products but in the past I think it was Photon Server

gleaming prawn
#

or custom server logic (server plugins) with photon realtime

#

or quantum which is deterministic (so not possible to do usual cheating)

grim violet
#

i do spawn on server with pun

gleaming prawn
#

or the new photon fusion

shut yarrow
#

All the options are confusing to me tbh

gleaming prawn
#

Multiplayer is not a one-solution-fits-all

shut yarrow
#

That's true

gleaming prawn
#

We're streamlining a few things

#

Photon Fusion will eventually replace both PUN and Bolt

spring crane
#

When can Fusion no longer be ignored due to availability? ๐Ÿค“

gleaming prawn
#

(although we'll still support both for existing customers, of course)

grim violet
#

i hope so

#

lol

shut yarrow
#

Ah now it makes sense you preach for your own choir ๐Ÿ˜‚ ๐Ÿ‘

gleaming prawn
gleaming prawn
#

no

#

port forward is only necessary for mlapi, mirror, etc

shut yarrow
#

It's fine I get it, I visit here every now and then

gleaming prawn
#

But notice PUN2 is a totally different thing than doing client-server multiplayer

spring crane
#

Nice. Looking to remake some older PUN projects

gleaming prawn
#

port forward is a bit old and unsafe TBH

weak plinth
#

Inb4 UpNp works just fine on your router, because he didn't turn it off

gleaming prawn
#

it's more common to use STUN punch nowadays

#

Itร„s what steam networking does, for example

#

same for upnp

#

it's something you can not rely on...

#

Sure, if it works from your machine and that is ALL you need, fine

shut yarrow
#

Wouldn't you still need a server to establish an initial connection?

#

That's how I understood NAT punchthrough to work for example

weak plinth
#

A STUN server, yes

gleaming prawn
#

But most people develop games to be available for players, in that case neither port-forward nor upnp are really a good solution (punch is + relay is more consistent)

gleaming prawn
#

the STUN server gives you reflexive addresses only... YOu need a reliable way to exchange these addresses between the machines, so they can attempt the punch, eztc

shut yarrow
#

@weak plinth register for a PUN account you can start in minutes

gleaming prawn
#

@weak plinth just use pun or bolt then... or use mirror and mlapi on LAN only (no internet) or host a dedicated server with them

#

@weak plinth you need to do this signaling (exchange the reflexive addresses and coordinate the punch process)

#

it's not only a STUN server, that's just 1/3 of what you need

shut yarrow
#

Somehow I still fail to see the big benefit of still needing a server and then exposing clients to eachother, like how can that be considered safe. The only real benefit I can think of is very low bandwidth consumption for the server that does the interconnecting

gleaming prawn
#

A complete solution that uses punch (like steam, or bolt, or nintendo PIA, or PSN, etc) have 3 pieces:
A) a reliable server to coordinate the process
B) STUN server for reflexive addresses (could even use public ones from google)
C) a Relay as fallback (punch only works 85-90% of the time)

#

You can sure combine A and C in the same server

gleaming prawn
weak plinth
#

Option C bumps up the server requirements by a lot

gleaming prawn
#

C is mandatory if you are serious about your game

weak plinth
#

Of course

gleaming prawn
#

Maybe you guys are all young, but let me tell you a story about Unity and multiplayer

shut yarrow
#

Alright understood although just the security aspect still weighs heavy on me

gleaming prawn
#

Back in the days, when Unity first launched UN (old API they built on top of raknet), they offered a master server thing for doign matchmaking, and it included all of the above except C (no relay fallback)

shut yarrow
#

I remember UN but back then no idea how any of networking works

gleaming prawn
#

It was a big failure, people tried to launch games with it, and caused rages on players because connections would not be established in 15-20% of the cases (I have a friend who released one of these games with Paradox)

#

PUN (the most popular photon product) was developed as an answer to that... Very similar API and concepts, but worked every single time (because of the reliable relay servers)

#

Not arguing PUN is the best way to do multiplayer

weak plinth
#

First time I started with Unity, PUN was already a thing

#

Which was like 6 years ago somewhere

gleaming prawn
#

Just saying a lot of its success was because it worked reliably and it was super easy to use

shut yarrow
#

Well it definitely covered a big hole Unity left open

weak plinth
#

It still does

gleaming prawn
#

My point is this:

shut yarrow
#

Yeah I'm not waiting for Unity to do it better

gleaming prawn
#
  • talking about punch/upnp/port-forward in 2021 WITHOUT a relay fallback is like repeating the same primary mistake unity did
#

If you are thinking about RELEASING a game for others to play... THis is not an option..

shut yarrow
#

I understand and I agree

gleaming prawn
#

That's all

#

Everybody have choices, several APIs, etc

weak plinth
#

Now the question is, does Stream do these things for you through their API?

gleaming prawn
#

Steam does only the basic transport (so it's not really a netcode API)

#

But it does ABC, yes

#

point is, it's only for games on Steam, so not for consoles, not for mobile, etc

weak plinth
#

I mean, is there an option to roll your own netcode and use steam for ABC

gleaming prawn
#

I think Epic is offereing something similar

#

Playfab has their own relay

#

YOu have Normcore... there are many many offerings in the basic-transport-layer tier...

#

Many can be integrated into Mirror or MLAPI (if they are not yet)

grim violet
#

tryed to email them normcore never got an anwser

gleaming prawn
#

Ours are just some of the offerings

spring crane
#

To get info about the server hour thing or whatever it was? ๐Ÿ˜„

grim violet
#

yeah

#

room thingy

#

1000+ hour a room i think

#

or some weird stuff

#

i even remailed after a week

spring crane
#

Room hours, yea

grim violet
#

still no anwser

#

sound shady

gleaming prawn
#

AFAIK they are offering legit services... But I can't answer for them of course

grim violet
#

thats the shady part

#

lol

gleaming prawn
#

I think the 3TB needs attention (this is similar to ours)

#

bandwidth is expensive

#

Here's my free interpretation of the 1K ours

grim violet
#

yeah but you have limited ccu and they dont, for 49$ a month, there has to be something

gleaming prawn
#

Knowing how people "word" these, my assumption is:

  • total SUM of hours for open rooms
weak plinth
#

What is a "room hour" ?
What is a "room" in this context?

gleaming prawn
#

example:

  • one room at a time, needs to complete 1000 hours to reach that
  • if 2 at the same time, 500 hours
  • say you have 10 concurrent rooms, your limit is 100 hours, spread that over 30 days...
#

3 hours of gameplay per day

#

That's your limit

grim violet
#

lol

#

exactly what i thought

weak plinth
#

"room" is one session?

grim violet
#

but thats freaking shady

gleaming prawn
#

Remember, that is my "safe" interpretation

grim violet
#

why would you limit your game like this

#

thats what i thought too

#

i looked throught all doc

#

not a single comment on it

#

and no mail anwser so yeah

gleaming prawn
#

because there's no free lunch?

gleaming prawn
#

see, server costs and bandwidth are commodities, these are not different for them as they are for us

#

So a plan for 50 bucks a month is probably good for half of what a plan for 100 bucks a month on photon does...

#

Normcore is a relay as well, it's always using the servers bandwidth, etc

grim violet
#

thats why i stick with photon, good anwser at any time of the day or night, and ccu limit but no room hours shit ;p
by the time i get to that ccu limit, ill probably be rich

#

id prefer have unlimited room hours

#

and ccu

#

lol

#

people play and bam server cut

#

no more time left

gleaming prawn
#

Honestly, using CCU as the metric is what our management says face to face to any customer: it's the most fair metric

grim violet
#

yeah it sound very low when you have no idea

gleaming prawn
#

You can disagree on pricing, sure

grim violet
#

i seen a game that has 600 people max ccu

#

they made 12 million

#

so yeah

#

ill be able to afford that 3k ccu once there

#

lol

gleaming prawn
#

it all depends on the platform as well

#

a 1K ccu game on steam is a HUGE success

grim violet
#

yeah

gleaming prawn
#

If you have a paid game on steam that reaches 1k ccu, you are probably rich

#

And not worrie about paying 95 bucks per month

grim violet
#

clearly

gleaming prawn
#

on mobile it's different

grim violet
#

even hosting myself i tryed to calculate and it would cost me more than just using pun and a vm somewhere as backend server

gleaming prawn
#

because of F2P, you get a lot more players

grim violet
#

computer cost + bandwith + electricity

#

it add up quickly

#

;p

gleaming prawn
#

BUT

shut yarrow
#

You can host a VPS for 10 bucks a month with 20 TB traffic what do you mean electricity...

gleaming prawn
#

It takes a LOT of work, of effort and you need to find very good deals

grim violet
#

its like having the industrial company selling at 1$ but if you do it on your own, good luck

#

its normal

#

;p

gleaming prawn
weak plinth
#

Aren't these numbers https://steamcharts.com/ representative of CCU? At least, assuming the clients are not connecting to privately owned servers

shut yarrow
#

As much till you max out on RAM and CPU, so depends

grim violet
#

If a player play "offline" is that a ccu too

gleaming prawn
#

these are live CCUs:

#

then you can see how absurdly huge the big-shots are

#

The AAA stuff

grim violet
#

yeah

weak plinth
#

The CCU of games like Destiny and Warframe though ๐Ÿ˜“

gleaming prawn
#

Or the new indie-frenzy Valheim

gleaming prawn
#

It counts also players playing single player games

grim violet
#

so it add up in that

gleaming prawn
#

So I'd say if you have the game open in the menu, not searching for a match, it already counts

grim violet
#

yeh

weak plinth
#

For the StreamCharts, or what you'd count as CCU? @gleaming prawn

grim violet
#

that screenshot

#

microsoft made a popular simulator

#

damn

#

;p

gleaming prawn
#

steam charts

weak plinth
#

Ah ok, yes

gleaming prawn
#

for photon it counts only when you are connected to photon, of course

grim violet
#

what about offline mode in photon

gleaming prawn
#

SteamCharts is steam metrics from the steam client, etc

grim violet
#

does that count

gleaming prawn
#

Which is pretty cool btw

#

Nice to have that kind of data around

weak plinth
#

Yeah, it is. As soon as you boot up the game, even if you remain in the splash-screen, it counts as an active player

gleaming prawn
grim violet
#

that data can actually be a burden

#

i played some game where community was freaking toxic

#

and used taht steam chart to attack on every side

gleaming prawn
#

lol, ye

grim violet
#

each time a lost of player was made

#

"the game is falling apart!" then they do bad reviews

#

so yeah

#

lol

shut yarrow
#

I can deal with toxic players, but cheaters -_-

grim violet
#

toxic players are worse

#

way worse

gleaming prawn
#

cheating is overrated...:)

shut yarrow
#

Depend what game you play

grim violet
#

yeah cheating is a feature

gleaming prawn
#

I mean as a game maker

shut yarrow
#

I can ignore toxic players, but cheaters come specifically for me

grim violet
#

remember nintendo game genie

#

;p

#

a cassette to place other casette over to cheat

#

made by nintendo itself

#

they understood some player had fun with this

gleaming prawn
#

Thing is I care about it a lot, more than I should... And then you have these games where the dev did not give a shit about it (Fallguys, for example)

grim violet
#

why not

gleaming prawn
#

And sell tons

shut yarrow
#

I'm flying around in an airplane trying to catch bankrobbers, then whoops I get ejected from my airplane because a cheater pressed a button and now I'm falling to certain death

gleaming prawn
#

Cheating is NOT a problem on:

  • iOS
  • Consoles
#

It's only a thing on PC and Android

grim violet
#

webgl is easy too i think

shut yarrow
#

Rinse and repeat... At that point I quit the game

gleaming prawn
#

So from a game development perspective, it's at least relative

grim violet
#

i never tryed myself but i remember having ton of developper stuff for web and easy changing variables

gleaming prawn
#

webgl is totally open

grim violet
#

thats the kind of game im making

#

\o/

gleaming prawn
#

I do not deal with it most of the time because neither quantum nor fusion work on webgl at all

grim violet
#

pun solution with fake authority from my server on webgl

gleaming prawn
#

you can do with realtime

weak plinth
#

People need an incentive to cheat in the first place, remember that

gleaming prawn
#

So you are running photon server with plugins?

weak plinth
#

And the bigger the incentive is, the likelier it is that people will cheat

grim violet
#

nope

grim violet
#

just webrpc

shut yarrow
#

Just being bored is enough for people to cheat

#

Or just want to screw with people

grim violet
#

php server

gleaming prawn
weak plinth
#

That's why you very rarely see player cheat in co-op games or modes

grim violet
#

no webrpc

#

i dont use the webhook

#

its part of it thought to give the address

#

but i dont use the webhook stuff

gleaming prawn
#

I did not get what you are doing then... you have the clients connect both to PUN and to your backend?

grim violet
#

they connect to pun, and from there talk to m yserver

#

PhotonNetwork.WebRPC

gleaming prawn
grim violet
#

from pun

gleaming prawn
#

it's a bit of a weird setup tbh, but if it works for you...:)

grim violet
#

dont you knnow what is webrpc?

#

its the name you use on the doc

#

lol

gleaming prawn
#

I know what webrpc is, of course

grim violet
#

kk lol

#

yeah its weird setup but, i can save informations

gleaming prawn
#

ye

grim violet
#

about my spawns and all, all is calculated there

gleaming prawn
#

ye ye

grim violet
#

i can have loadbalancing if there many people

gleaming prawn
#

that's what I though, you use the backend as a sort of spawn and movement limits validation etc

grim violet
#

yeah

#

not movement thought

#

its turn based battle

#

i dont care if player cheat his movement in the map

gleaming prawn
#

Makes sense then

grim violet
#

wont get him anywhere

gleaming prawn
#

so you use Pun just for the visual sync

grim violet
#

yep

#

and seeing each other player

gleaming prawn
#

but use your own backend for the gamelogic...

grim violet
#

exact

gleaming prawn
#

THAT is nice, ye

#

for a turn based game works just fine

grim violet
#

making a whole mmorpg with this

#

turn based battle but real time map with people walking around

gleaming prawn
#

ye

#

you'll only hit the issue with the number of players in the same rooms

grim violet
#

i lock em at 50

gleaming prawn
#

Although you can go clever with interest groups and the update freqnecy

grim violet
#

could probably optimize for more but i dont want to

gleaming prawn
#

and push that a lot higher

grim violet
#

ill just make more room

#

Village1 Village2 etc

gleaming prawn
#

ye

#

but you can go higher due to your setup not needing to run the actual game logic over pun

grim violet
#

yeah i dont have much going on except player movmeent

#

its just that actually

#

and ressource spawn when player get resource

#

i use custom room properties to hold info on who get it first

#

but still server that check it if its okay at the end

#

so far its working fine, tryed with 5-6 people

gleaming prawn
#

I failed to find here (google) the blog post (from a customer) explaining a way to do interest management with pun

#

Would work well for your setup

grim violet
#

i probably saw it when i started this project hehe

#

did alot of research how to make a server with pun

#

to find out about php

#

interest management you mean by player around?

#

like ring streaming players

gleaming prawn
#

just to make people far from you be updated seldom

grim violet
#

yeah

#

i could make bigger map with this

gleaming prawn
#

So you improve bandwidth and can go higher on player count

#

this

grim violet
#

i make room right now with maps, its big map but still limited

#

ill check it out

#

i wasnt even award you could do that with pun

#

that open doors

#

๐Ÿ˜›

#

can you believe im using pun since about 2 year and never seen this script, someone spoke about rigidbody view other day and i was using the transform view instead ignoring the other one was there lol

#

there so much stuff

timber lava
#

bruh what is even going on with the new multiplayer api

spring crane
#

Which one?

timber lava
#

idk i have no idea whats available to use right now all i know is that unet is being depreciated

#

but i want to start a multiplayer project

spring crane
#

Just use thirdparty solutions like people pretty much always have.

timber lava
#

alright

#

i tried photon and i really didnt like it so ill try mirror i suppose

#

or maybe, what would you guys recommend for turn based multiplayer? nothing real time

gray pond
weak plinth
#

No extra fluff to work with, and because it's TCP, you don't have issues with out-of-order, duplicate or missing data

timber lava
#

could u recommend some resources for working with a tcp socket in unity?

weak plinth
#

Don't know any on the top of my head, sorry

timber lava
#

all good

weak plinth
#

Most I can offer you is a Chess game in C++ that also uses TCP

timber lava
#

lol that actually might be pretty useful

weak plinth
#

The relevant bits are in SGameClient and SGameHost

timber lava
#

thanks a dozen ๐Ÿ‘

weak plinth
#

Yeah, no problem. Hopefully it's useful for you.

slim ridge
rich narwhal
#

Does anyone know why in unity PUN photon i have a photon view on a object yet it wont show up in game for the otherplayer

spring crane
#

@rich narwhal Are you using PhotonNetwork.Instantiate?

rich narwhal
#

well the thing is should i instantiate? i have it rn to where you just enable it and then at start it disables it and you can renenable it in game

#

but it doesnt show up

grizzled comet
#

if i have some "working" code (it's a little janky, but it basically does what i want it to) using mirror... how hard is it going to be to convert the player movement to server-authoritive from the current client authority version i'm using? relatively easy or... basically start over from scratch?

rapid horizon
#

Am having trouble understanding "CONCURRENT USERS" if i buy the photon 2 Plus does that mean only 100 players can play the game at a time OR i can have 100 players in one match / room

gleaming prawn
#

concurrent is the total sum across all active rooms

#

Does not matter if two of 50, 5 of 20, etc

#

But remember that to get to 100 players in avg you need to have something like 2000 daily active players (DAU), which requires around 40000 downloads of your game, etc

weak birch
#

@jade glacier looking for job opportunity xD

stiff zinc
#

Yo, anyone here has experience with playfab? I'm trying to figure out the session lengths of my users, upon logging in session_started gets raised, but session_ended never seems to get raised

idle coral
#

hello guys im new here, and im also new to unity networking. Im currently stuck with UnityWebRequest.Put method. I've looked at the unity manual, it shows how to pass a string, but I want to pass a key,value style pair. How to do that? Thanks

rapid horizon
jade glacier
#

@weak birch You are looking?

weak birch
#

Yes remote front end . Do u know any? @jade glacier

jade glacier
#

I don't, I live in a pretty small bubble and I don't really know many employers sorry ๐Ÿ˜•

#

Company fell apart?

weak birch
#

No im just trying to improve life by earning in dollar currency

#

Wages aren't satisfying

jade glacier
#

Ahh. yeah sorry - I am the wrong person to help there.

still pier
#

Hi does anyone know if unity server builds can utilise ConsoleColor

#

or accept stdin

weak plinth
#

There's nothing special about a "Unity Server" assuming you mean a headless build

still pier
#

yeah

#

My question is can I make a command line engine to control the server by accepting input

#

like minecraft

weak plinth
#

Sure

still pier
#

How can I make it accept input

#

in a c# console app I can do Console.ReadLine();

#

but in unity I'm not sure

weak plinth
#

The same, it's just C#

still pier
#

but it isn't a c# console app is it?