#archived-networking

1 messages · Page 47 of 1

graceful zephyr
#

You can integrate psn and xbox live into mirror for example but you'll have to do it by hand

#

I assume you can at least

compact bramble
#

I have very little dunning krueger about me so I prefer not to

#

sounds like if I just use bolt it'll be taken care of one way or another

graceful zephyr
#

Afaik yes, check with stanchion for the latest on all of this in relation to bolt pro, I don't deal with bolt anymore on a day to day basis

#

Gotta put the kids to sleep now

#

Back later

compact bramble
#

thanks

vital hawk
#

bolt pro sounds like a thing "ask for pricing and we give offer based on your project"

compact bramble
#

Probably :) I'm not worried about it, Photon needs to be my friend for very obvious reasons and vice versa. I think it's nice being friends.

#

It's why Sony's stuck with me for half a decade: sometimes its good to have people around who can reach a lot of people and who are not malicious

#

I don't hide anything including intentions, honesty is best.

indigo current
#

@graceful zephyr Some reason I thought you were still developing on bolt, even though I know you've said you sold it many times. The documentation is bad though. It has some examples that say, 'use this to do such and such' and the naming is so obscure it doesn't even make sense. Then when you go look up the method in bolts API there is no information on it what-so-ever. That's what I ran into regularly while trying to research bolt (not long ago).

#

eg they have custom methods that only call on the master/server, and all these messages do is an 'if owner check' before being called internally.

#

but there's literally nothing showing if they are run on fixed update, update, lateupdate

#

just that it magically calls at some point

#

Oh, the method was "SimulateOwner" which runs on FixedUpdate. The only way I was able to find out though was a direct answer from stanch. It's not in the API anywhere; a lot of stuff isn't.

graceful zephyr
indigo current
#

Yet if you google "SimulateOwner" that page never comes up, or at least didn't for me.

#

I was able to find the example page and the API page, neither mentions what it does.

graceful zephyr
#

Not really trying to argue here, like I said I have not actively worked on bolt for a few years

indigo current
#

I know.

graceful zephyr
#

I work on quantum now

indigo current
#

Bad documentation is just a huge turn off for me, especially when it's something large as a networking solution.

compact bramble
#

I don't see bad docs myself but I am working on this from monday so we'll see

real saddle
compact bramble
#

right so Unity's networking - the new one - dots based?

real saddle
#

No, Unet

fading pawn
#

UNET DOTS ?

jade glacier
#

For anyone using PUN2/UNET/Mirror I have a new beta release of my Transform and Animator sync posted. Anyone who can test it out and give me feedback, I'll give access to the final once its on the store.

https://github.com/emotitron/Simple-Network-Sync

fading pawn
#

Can I try it with Bolt?

jade glacier
#

Nope, bolt though has all of its own stuff, largely what a lot of this was based on

#

I learned networking from fholm

#

Are the bolt transform and animator sync components not cutting it? @fading pawn

fading pawn
#

Nope just curious what new stuff people are doing

jade glacier
fading pawn
#

neat

scenic topaz
#

Which multiplayer solution is a good fit if I want to create a 4 player peer-to-peer co-op game?

compact bramble
#

Bolt

#

:D

#

Honestly though if it's peer to peer then I think MLAPI or Bolt from my research because both have direct connection capability

#

(both free so try)

undone sigil
#

LiteNetLib

indigo current
#

@jade glacier No source files found..

jade glacier
#

Not will there be. The release is all there is, but it's all c#

#

This isn't open source, it's beta.

#

@indigo current

indigo current
#

Oh, meh.

#

I was curious to see the inner workings.

#

Have you benched yours against the stock for network cost differences?

jade glacier
#

No need to bench, it's a fraction by nature

#

All bipacked, and they share a write per tick

#

CPU use is likely higher from the bitpacking

indigo current
#

So you pack multiple transform data then send it all together to maximize* compression and reduce sends

jade glacier
#

As well as animator data

#

The whole NI backs them all in one byte[]

#

Mobile typing

#

Can't keep up with this phone bad guesses

indigo current
#

To be honest, I don't see the point in debugging someone else's work when it will ultimately become a paid asset.

jade glacier
#

I am giving it free to testers

#

But that's fine, not bending anyone's arm

indigo current
#

How much do you plan on selling for? And you mean the paid version will be free to testers?

jade glacier
#

No clue yet. It sounds like you aren't really a candidate for using it. I would just disregard all of this.

#

You know how to do this stuff already, just make your own really.

indigo current
#

I was asking because I might make a run-through of a networked game being developed (not a tutorial series) and was considering using it. That wouldn't be for at least a month though.

vital hawk
#

that's not really the reason to buy things in all cases (if you can make it on your own)

#

you still learn from other solutions or simply save time

indigo current
#

Yeah I mean, if it works I'd have no complaints using it. But I want to know what I might be potentially be showing my viewers.

jade glacier
#

It's there if you are curious... The work involved is literally just dragging two components on to an object

#

The code is exposed

#

It's not open source though. So I'm not making a git... Because that says the wrong thing.

indigo current
#

I understand.

#

Does it work with the serialization rates set by photon?

#

eg if I increase/decrease my serialization rate in photon settings will your script follow the rules of those changes

jade glacier
#

It currently works on fixed update... Specifically post physx

indigo current
#

I'd probably make it work using serializationrate at least when working with PUN

#

The default rate is every 100ms.

jade glacier
#

It's tiring to not forget to bad networking practices... Like default rates

#

Trying

#

Ok, getting laptop, this phone is hopeless

indigo current
#

haha

#

I wouldn't blow the photon settings out of the water though; that's kind of counter productive

#

users might intentionally serialize less.

jade glacier
#

I will be adding in the SendEveryX thing my other libs have, but that is phase two once I get this solid.

indigo current
#

Heck, I usually drop mine to every 250ms and use in/exterp

jade glacier
#

its not a lot of work, but it will take me a week or so.

#

yeah, its not every going to be time based

#

I am repulsed by the adhoc time used by UNET/Mirror/Forge and PUN

#

and no component I make ever again is going to contribute that that

#

simulations belong as fixed based

#

net send rates should be a factor of the physics rate, or whatever simulation rate is being used

indigo current
#

if youre sending stuff every fixed update i imagine the network is going to take a beating

#

I'd strongly recommend following the API pattern or at least supporting it

jade glacier
#

For this test, it is sending at a high rate if your physx tick is high yeah. The final will send every X

#

Normally I would love the debate, but I have a pile of work on this to two and 2 days to do it

#

so if I seem short I apologize

#

but I am very firm on how bad time based networking is, and it works counter to EVERYTHING my core library is working to avoid

vital hawk
#

Huh

indigo current
#

Without inspecting your code, I don't fell as though it would be hard to implement.


bool _useFrequency;
float _frequency = 1f / PhotonNetwork.sendRate;
float _nextSend = 0f;

void Update()
{
      if (_useFrequency && systemTimeOrWhatever >= _nextSend)
    {
        _nextSend = whatever;
        SendData();
    }
}

void FixedUpdate()
{
    if (!_useFrequency)
        SendData();
}```
jade glacier
#

Not super hard, just not on my roadmap at all, since the entire thing runs off of a timing singleton

vital hawk
#

Sending stuff on each fixedupdate is just silly

indigo current
#

In my videos I show how to utilize the sendrate to your advantage

jade glacier
#

it will send on every X

#

ok guys, please don't use this

#

not for you

indigo current
#

If your asset just completely ignores sendrate I believe you're right in that I cannot use it

jade glacier
#

it is absolutely not for you

vital hawk
#

Huh, you asked for feedback

indigo current
#

You shouldn't even write it for PUN if you arent going to actually support the internal mechanics, to be honest

jade glacier
#

yeah, no worries

#

I get what you are doing... it is not for that.

indigo current
#

you say yours is inherently faster because of how it works but you never benched it, and given how frequently you send data I'm not sure that's even true.

jade glacier
#

Its smaller, not faster

#

it is in fact slower because it uses a ring buffer

indigo current
#

poor choice of words on my part. I meant uses less bandwidth.

jade glacier
#

uses less per tick

#

right now I don't have the factional tick implemented

#

I wanted to make sure it works on all edge cases first. That part I have done in NST and reducing it to every X isn't a big deal, its just time spent that has to wait.

#

It will operate on fixed timings, because the nature of what it is. I don;t have the descriptions up so I would have to type it all here

#

but its basically putting everything on a unified simualtion based frame buffer

#

It is geared toward simulations tied to the fixed. I have no plans for making it conform to UNET/Mirror/PUN serialization rates because that will break the very nature of what it is

#

and will have me coding in core timing logic that I do not condone

#

I should step back and be clear, I am not making any of this for profit

indigo current
#

shrug

jade glacier
#

I make these assets for my own use on my server auth system. I share them because there is a desperate need for better networking in the Unity world. I only charge for them because I tried free assets on the store and it brings out the worst people.

indigo current
#

I like the compression and send at once idea, don't like that the user has no control over how often data sends

jade glacier
#

I'm not being a dick... just saying... what this is ultimately for isn't for what you are doing

#

You can pick it apart, and rework it to your timing

#

the serialization of each component is exposed and very clear

#

but I cannot and will not support adhoc time based usages because I have no interest in doing that... and because users of photon and unet need to stop doing that and learn what a simulation is.

#

I know I sound dickish, but this is part of a longer frustrating constant battle in these channels between the right way, and good enough.

#

Maybe when I get time I will circle around on that, but right now... nope. The next iteration will send every X fixed updates and that is the end of the line probably until fall.

jade glacier
#

A little janky from the screen cap software, but this is with every 3rd fixed update sending. So a fixedTime of 50 per sec, and a net rate of 16.6 per second.

vital hawk
#

I still don't get it, why send anything network related on fixedupdate? that sounds like one doesn't understand how fixedupdate loop works.. you can have 1-3 fixedupdates per frame on the same main player loop and the execute within milliseconds of each others, there's no real time between them at all

jade glacier
#

it sends post physx

vital hawk
#

of course if you have typical 50Hz physics and 60 fps lock, it's not that bad but it's still silly concept

jade glacier
#

its tied to whatever the simulation is, and the assumption is anyone networking is using fixed as the simulation timing

vital hawk
#

like, after all fixedupdates are done and not for each fixedupdate?

jade glacier
#

the adhoc send rate thing is just a sloppy handling of simulation (or lack of it) by Unet and PUN

#

serious engines like Bolt and AAA titles DO NOT do that

#

its all a tick based simulation.

#

In Unity, the simulation that is built in is PhysX

#

but any simulation is applicable

vital hawk
#

if you just alternate between fixedupdates to throttle, you may end up with some frames that don't send any packages at all and then have some (rendered frames) where you send multiple

jade glacier
#

fixedUpdate is pre-physx

#

there is no post physx timing, you have to create it yourself

#

if you are only moving your stuff in Update, then yes you will get some oddball fixed sends

#

you shouldn;t be running your sim in update though

vital hawk
#

I don't mean that at all

jade glacier
#

The entire basis of the library is a tick based simulation

vital hawk
#

I mean that you are ultimately sending extra packages where it doesn't matter (there's only 1-2ms between fixedupdates that run on same main loop run

#

so sending packages for each such is just silly

jade glacier
#

if your networking has no concept of simulation timing... then this isn't really for you

#

if you try to use this on a simulation-less game that is doing its stuff only in update, then yes... its a mismatch and not the solution you want

vital hawk
#

you know fixedupdates really don't run at fixed time intervals in realtime?

jade glacier
#

of course

#

I get the impression you think I don't know this stuff inside out

vital hawk
#

I get impression you don't get my point here 😄

jade glacier
#

I know exactly what this is and why, I am saying it is not for you if you don;t; use fixed as your sim

#

you are asking about a case where you arent using fixed as your simulation timing

#

and yes, for that ... do not use this.

vital hawk
#

I know fixedupdate and physics inside and out, it's what I do and have done for years alone

jade glacier
#

great, then we are on the same page

#

If you don't use fixed for your simulation... then this is no good for you. We agree.

vital hawk
#

all I'm saying, there's really no reason to send network updates for things that will get new data within few ms anyway if you only use the latest data received to sync things

jade glacier
#

its a simulation

vital hawk
#

you just add traffic for no good reason

jade glacier
#

this is a state based simulation sync

#

same as Bolt

#

only its simplified for client auth

#

there are deltas in the compression

#

its not sending full uncompressed garbage, but it does send every tick

#

even if that something is just a header and a bunch of 1 bit pools saying "nothing has changed"

#

I get what you are thinking about trying to cull frames because two happened before an update, but that already gets handled by delta reductions if you are using them

#

the point of a state based is that it sends a very regular stream of updates

#

It is possible if you expect crappy refresh rates to send flags of merged packets, but that is a lot of work for serializer to deal with.

#

But yes, it is possible to detect when a post fixed is happening if its going to be followed by another that update... that you could cull the data and mark them as merged or something

#

but I won't' do that, because this is me sharing code from my server auth

#

and the serer auth can't have that

#

states are concrete and not fluid, because they need to be concrete for determinism

#

Which comes back to again.. if you know how to do this stuff... do it.

#

I am sharing this for people who have no idea how to do animator or transform syncs

#

and who find the unet and pun ones to be lacking

#

You are not the target audience for it

limpid bay
#

does anyone know why the blocks are spawning twice if i have 2 players? if i have 3 players they will spawn trice and so one

#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Photon.Pun;

public class BlockSpawner : MonoBehaviourPun
{
    public Transform[] spawnPoints;
    public float TimeBetweenSpawns = 1f;
    private float timeToSpawn = 2f;

    void Update()
    {
        if (Time.time >= timeToSpawn)
        {
            SpawnBlocks();
            timeToSpawn = Time.time + TimeBetweenSpawns;
        }
    }

    public void SpawnBlocks()
    {
        int randomIndex = Random.Range(0, spawnPoints.Length);

        for (int i = 0; i < spawnPoints.Length; i++)
        {
            if (randomIndex != i)
            {
                PhotonNetwork.Instantiate("RoadBlock", spawnPoints[i].position, Quaternion.identity);
            }
        }
    }
}```
#

here is the code

jade glacier
#

the thing spawning.... is on an object that gets spawned?

#

@limpid bay

limpid bay
#

yes

jade glacier
#

then yeah

#

seems like your answer is right there

limpid bay
#

oh on an object i mean no

jade glacier
#

What is block spawner? and why is it a net object?

limpid bay
#

the blockspawnner is an emptygameobject and it has this script with 5 spawnpoints and the spawnpoints instantiate a block every 4 secs

jade glacier
#

So why is that a punbehaviour?

#

I dont see enough to answer your original question, but what I see there is a net object... spawning other net objects... which is a bit odd

limpid bay
#

so it can spawn the same blocks for each player

jade glacier
#

it needs to be a networked object for that?

limpid bay
#

yes if i remove it the blocks are defferent for each player

jade glacier
#

There is no netcode in that class you posted above

#

not related to your problem probably, just saying that that seems a bit odd.

limpid bay
#

i have a thing from the asset store that is called photon and i provided the ability to use the monobehaviourPun

jade glacier
#

yeah, I know what PUN2 is

limpid bay
#

ok

#

then

jade glacier
#

just wondering why this script is a punbehaviour, there is nothing going on in it that needs to be networked

#

it probably is harmless, but indicates you are kind of just guessing here

limpid bay
#

oooh you mean that thing uhm i am new so idk what i am doing very well

jade glacier
#

What you probably want to do for what I think I see here, is that when a block is created, it should generate a seed, and use that seed to generate the random stuff

#

then, when it instantiates, have it sync that seed - so all other clients have the same random seed and create the same randomized road segement

limpid bay
#

uhm you are talking to me, the biggest noob and i do't really know what you mean with seed 😅

jade glacier
#

Just some stuff for you to google

#

I can't explain it all, or I will literally be googling it, and cutting and pasting it here for you

limpid bay
#

i google it but idk what it means

jade glacier
#

but for generation of terrain using random, you can just sync with the seed, rather than trying to sync the results of the random generation... way smaller and easier

#

you googled "Unity Random Seed" ?

#

or did you just google "seed" ?

limpid bay
#

oops i google seed im dumb

past garnet
#

Hi mates sorry for beeing stupid 😄

#

im new to networking and i use UMA in my project, everything is fine yet, but if i change the online cloths its just happen on the server, not on the clients, I use cmd for this, should i use ClientRPC?

jade glacier
#

Command is from client with authority to server. RPC is from server to clients

past garnet
#

But RPC will also handled from the server or?

#

in the unity doc is an example about CMD, its with shooting a bullet, thats why i used cmd i thought it is the right way..... networking is hard at the beginning^^

jade glacier
#

lot to unpack there

#

Client player will call a command saying it fired. Server will RPC all letting all know that player fired

past garnet
#

ahh

#

ok so right way is setup the cmd to do the shot on the server, call rpc to getting result (hit, blablabla) to all clients right?

#

and thanks for your support 😃

jade glacier
#

if you do a few tutorials it should make sense

fading pawn
#

So quiet here today

#

Would anybody be interested in a Unity GameLift sample?

weak plinth
#

Can i use Photon PUNv2 to create a room on the client side and in that room a world which will be saved for weeks, months(until creator removes it) like in minecraft servers. And up to 8 players would be able to join the world.

fading pawn
#

not really

#

you would have to persist the state somewhere

weak plinth
#

@fading pawn Would Photon Bolt be able to handle that then?

fading pawn
#

Well having dedicated servers would make it more straightforward

#

To make your own “Minecraft realms”

weak plinth
#

So Bolt would we a better choice.

fading pawn
#

Or if you’re thinking of something like normal Minecraft where someone hosts and others join, then it doesn’t matter

weak plinth
#

I was thinking to get the same effect just by being able to save the Room on PUN on photon cloud.

fading pawn
#

PUN doesn’t have any “save” feature afaik

weak plinth
#

so a player can't exit the game and expect his world to be saved?

#

progress, etc.

fading pawn
#

Host can save it locally, that’s easy

weak plinth
#

yeah it would be saved locally

fading pawn
#

Obviously they can modify that data or cheat but that’s how it goes

weak plinth
#

Would it be the same in bolt cases?

fading pawn
#

Sure but you have more options with Bolt

#

The save data and simulation can be completely server side like Minecraft realms

weak plinth
#

I see now, thank you for your answers.

jade glacier
#

The software equivalent of the wild west basically.

stone depot
#

I have a similar question: What is the current solution for online multiplayer games in Unity right now?

I want to put together a simple multiplayer game, but I do not want to use a WIP solution. I would prefer the ability to host a dedicated server on a cloud infrastructure service such as DigitalOcean or AWS, and have support for both native and WebGL builds.

surreal adder
#

In the end the most suggestions you will get for now are either something Mirror-based or MLAPI

fading pawn
#

besides WebGL, Photon Bolt would work fine as it is a proven solution and will work well with dedicated servers

compact bramble
#

And bolt doesn't cost more money unless one of the players fails to connect directly

stone depot
#

Alright, thank you for the help 😃

untold quest
#

pun 2:
if i have a server and a client in the same room, and a gameobject with a photon view, a photon transform view, and a photon rigidbody view, shouldn't that be enough to have the position and motion of the gameobject sync across the two games?

jade glacier
#

you don't have a server in PUN to be clear... just one client gets the "Master" baton to hold is all

#

Movement is not something you want to be passing through the Master, because it isn't a server... PUN2 is purely a relay environment

#

@untold quest

untold quest
#

why cant i have one """client""" with different code so that it just acts as a server?

#

and that doesn't pertain to my question

jade glacier
#

Master is meant to be able to act as the authority over things you want a master for

untold quest
#

on the host-client, i can't see the movement im making on the client

jade glacier
#

Again, you are using server/client speak so I am not sure you are getting what PUN2 is and does

untold quest
#

i do

jade glacier
#

all traffic goes from each clietn, to the relay, to all other clients

untold quest
#

i knoooow

#

im asking whats missing if objects arent syncing

#

i told you what i have

#

i think ive done everything from the tutorials i can see except im not doing any ui

jade glacier
#

You started with that, so wanted to make sure that was clear... there is no server/client.... but yes those components are what you need to sync clients... but you do need to tie them into the PhotonView serialization

untold quest
#

if you want i could call you and share my screen so you can poke around in my project

jade glacier
#

that might interfere with the work I am doing right now just a little bit 😛

#

<-- not paid tech support, just a user of networking libs here to help others in my spare moments

untold quest
#

i have the components i want synced in the photonview, but i dont see them syncing

#

they're in the same room, same level

jade glacier
#

You wired the transformview up to the photonview?

untold quest
#

yep

#

and the rigidbody view

jade glacier
#

No idea then, if the PhotonView is set to serialize them, you should be getting something, unless your movement method is stomping on them and overriding the values.

untold quest
#

i just dragged it in the scene editor

jade glacier
#

what's your controller? Is it aware of ownership and such?

untold quest
#

this is on a gun on the floor

#

its not a player

jade glacier
#

what is moving it?

#

and who owns it?

untold quest
#

me

#

in the scene editor

jade glacier
#

The master owns it?

untold quest
#

its in the level to start with. no one spawned it

jade glacier
#

"me" isn't a meaningful term in networking

#

there is the owner, there is the master, and there are other clients that are neither

untold quest
#

the host is in a separate build. im playing the client in the editor. im moving the object in the scene editor

jade glacier
#

The client you are moving it on has authority over it?

#

Scene editor means nothing in networking... all that matter is owner, master, client and if the client has authority or not

untold quest
#

who has authority over objects that are in the level already?

jade glacier
#

ok

#

So which of these clients owns/has authority?

#

IsMine == true in other words

#

Scene objects go to the master usually

untold quest
#

ok well then the master

jade glacier
#

Are you moving it on the master?

#

or on another client?

untold quest
#

on the other client

jade glacier
#

There you go

untold quest
#

well how do i make it so that anyone can influence the object

jade glacier
#

That will break everything about networking

#

something has to have authority

#

or else it will degrade into a hellstorm if two clients try to interact with it

untold quest
#

ok well then how do i make it so that my players can pick up and move the gun

#

i need clients to be able to interact with the scene lol

jade glacier
#

I would be googling PUN tutorials and cutting and pasting that here...so that part I'll leave for you to find.

#

But your issue is you are moving things without authority to.

untold quest
#

so do you think it would be a good idea to transfer ownership when the player touches it?

jade glacier
#

Hard to say, people deal with this issue lots of ways - you kind of have to play around and research it a bit to see which will cause you the least problems

untold quest
#

i moved the object on the master and it still didnt sync

jade glacier
#

trying to make an item that more than one player can interact with is one of the more difficult parts of networking... 3x harder in PUN because of the relay and non-server nature

untold quest
#

i switched it around so that the build was the normal one and the editor was the master

jade glacier
#

If its not moving when the server moves it, then somethings wired up wrong yeah

untold quest
#

when i moved it in the editor, nothing changed in the build

jade glacier
#

The editor was the master this time?

untold quest
#

i should say the editor created the room and the build joined it

#

i can write some code to test ismine

jade glacier
#

then yeah, sounds like it

#

but yeah, and have it throw you some debug.log info to make sure its getting where you want it to get

untold quest
#

actually i dont think the build correctly joined the room so i have another problem somewhere

#

thanks for the info

#

cya

jade glacier
#

if your builds aren't joining, hard code your region in settings

#

its a common problem for editor and builds to connect to a different region... Tobi I think was unsure why and it may not be resolved

untold quest
#

looks like it was indeed a region issue -_-

jade glacier
#

yeah, very common. You should hopefully get syncing now @untold quest

untold quest
#

yeah but it only works one way

#

i still need to figure out the best way to make the client able to move the object

#

from some initial research i think it might require RPCs but i dont if im right

#

if it requires an rpc to update the position, could i just write a generalized function such as

[PunRPC]
public void UpdatePosition(GameObject obj, Transform newTransform)
{
    obj.transform.position = newTransform.position;
    obj.transform.rotation = newTransform.rotation;
}
jade glacier
#

Just be aware of the latency involved

#

Asking the master to move is a hop through the relay, and the applied change is also a hop through the relay.

untold quest
#

Then how should I do it? Should I just change the owner based on the location of the player?

jade glacier
#

Not sure, I haven't tackled that particular problem so I don't have a best practice to share sorry

#

@untold quest

#

Just warning you about the pitfalls of what you are doing in an relay environment. Treating the Master as a Server involves a lot of latency since everything has to go through the relay. You likely will have to get very creative with prediction.

untold quest
#

Ok. If anyone has any suggestions let me know.

polar jasper
#

Hey guys, https://assetstore.unity.com/packages/essentials/tutorial-projects/tanks-reference-project-80165 .
Is this project using old Unity UNET multiplayer that will be deprecated or this new Multiplayer that is "coming".
Is this new multiplayer for Unity actually available? On Unity features/multiplayer page in FAQ there's a link to Documentation on multiplayer, but its says that UNET is deprecated, so I'm pretty confused about it.

Built on Unity's Tanks! tutorials, Tanks!!! goes further, turning them into a live, fully featured, Multiplayer game. Get the game now, on iOS , Android , MacOS , or Windows !

The Tanks!!! Reference Project shows how Unity Multiplayer can be implemented in a real wo...

#

Basically, I am working on mobile game that needs some simple multiplayer and wanted to use Unity multiplayer but current state of its seems confusing to me as UNET is being deprecated and I'm not sure if that new multiplayer is already ready to use.

jade glacier
#

It will be on life support for some time, they got a bit over-excited about its demise and forgot that they have no track record of producing networking in a timely fashion, or at all.

polar jasper
#

so there is no new networking system to use yet?

candid igloo
#

UNET will be there for at least a couple of years, so if you need to ship it soon(ish), just go with it

#

Just stick with the 2018 LTS

jade glacier
#

They are releasing packages for 2019 to keep it alive, you just have to add it, which is just a couple clicks

polar jasper
#

So the best option for now (if I choose Unity) is to implement my multiplayer in UNET but to have in mind that sometime in 2020/2021 there will be need to change it to their new networking

lean kindle
#

You can always go for some 3rd party provider like photon

stable cairn
#

HI!
We are currently using the new transport package, and testing the reliable pipeline.
We are wondering if anyone knows the size of the header added for the reliable packets as compare to the 4 bytes with the unreliable udp?

stable cairn
#

We think we found it!
Seems to be an additional 12 bytes on the usual 4

#

Additional question for the reliable pipelines:
Can we set up both a reliable and unreliable pipeline for the same network connection, or would we need 2 connections?

timid badge
#

Is there a way to add the High Level API to unity 2019? I have a few projects in 2019 with the HLAPI components, but i just can't remember how to add it to a new project

#

Ah i found it in the Package Manager

pulsar moon
#

Odd-ball question, not entirely Unity-specific, but I'm working on a client for an existing game protocol and I was wondering if anyone could share some knowledge.
I've been handed a project with every incoming packet defined as a class/struct with each parameter in order (they actually gave offsets but I'm not using them right now, headache) and I want to make a (de)serializer to translate between our binary format, and these objects.

Is there any way to like reflect the class, enumerate each property and it's type and then set that field with the message output? I did one parser by hand in ConfigurationMsg's ctor, but I'd really like to not. That sucked. https://gist.github.com/scottstamp/97e93d27741a78939f1e5d44c9964ab6#file-incominggamemessagestructure-cs-L33-L99

weak plinth
#

with the UNet deprecated is there a way to create a lan game?

vital hawk
#

unet is still available for few years

undone sigil
#

@vital hawk but it's on fix-only support

vital hawk
#

well, has UNet got new features in past years otherwise?

white vigil
#

I switched from unet to pun2 and I have it working, but if I change one thing in a different script, it will stop players from entering the same room. Why is this happening.

jade glacier
#

My guess is it changes the checksum, and some kind of checksum checking is enabled?

indigo current
#

@white vigil I can't think of anything in PUN that would cause that.

#

The only thing that determines what room you're in is what you pass into createorjoin or joinroom

#

There are other factors such as the room options used when creating a room but that's photon room options and if you aren't changing those specifically no reason other things should change

white vigil
#

Ok

little tree
#

im having an issue with this WWW, i replaced it with unitywebrequest it then broke my .test, so i added .downloadHandler.text, now my returnedddd is now red

#

trying to use the asset Database Control free, im using Unity 2019

#

can someone please help me 😦

undone sigil
#

@little tree cause you have it twice

#

also, remember that UnityWebRequest is an IDisposabe, so you have to dispose it

little tree
#

hrmm, how do i go about that, I commented the extra line

#

I did that and got another refernce error

#

NullReferenceException: Object reference not set to an instance of an object
LoginMenu+<sendLoginRequest>d__19.MoveNext () (at Assets/LoginMenu.cs:147)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Scripting/Coroutines.cs:17)

undone sigil
little tree
#

so confused

zinc ravine
#

Anyone dealt with Pun 2?

white vigil
#

I am working with pun 2 and I have been able to add both players into the game, but I can only see the other player from the master. How do I fix this?

little tree
#

Is this the proper way to do this?

#

private const string PLAYER_ID_PREFIX = "Player ";
private static Dictionary<string, Player> players = new Dictionary<string, Player>();

public static void RegisterPlayer (string _netID, Player _player)
{
    string _playerID = PLAYER_ID_PREFIX + _netID;
    players.Add(_playerID, _player);
    _player.transform.name = _playerID;
}
#

im trying to read a string from accounts to display a nameplate

jade glacier
#

@white vigil a common problem is the editor connecting to a different region than builds... if this is the problem go into the pun settings and hard enter a region

white vigil
#

Ok

#

How do I do that

#

@jade glacier

jade glacier
#

you'll need to google past that sorry, will never get work done with the quantity of questions I get per hour

white vigil
#

Ok

#

Thank you for the help

#

@jade glacier Even if I run 2 build and not the editor, you can only see the other car in the master

jade glacier
#

not sure, just saying that mismatched regions can cause each client to have its own room, may or may not be related

#

just a common issue

#

Are they in the same room?

#

like one sees the other join?

white vigil
#

Yes

jade glacier
#

ah, then its something else

white vigil
#

in the master you can see both but in the other one, you can only see it and not the master

#

What could cause that

little tree
#

anyone here to help pick a server for unity game?

#

im trying to use Vultr servers

#

@here

noble knoll
#

look up Game Dev League

zinc ravine
#

lets see your code @white vigil

#

that pertains to connecting

white vigil
#
using UnityEngine;
using Photon.Pun;
using UnityEngine.SceneManagement;
using Photon.Realtime;

namespace WildRide
{
    public class GameManager : MonoBehaviourPunCallbacks
    {
        [Header("Game Manager")]
        public Player PlayerPrefab;

        public GameObject camObject;

        [HideInInspector]
        public Player LocalPlayer;

        void Awake()
        {
            if (!PhotonNetwork.IsConnected)
            {
                SceneManager.LoadScene(0);
                return;
            }
        }

        void Start()
        {
            Player.RefreshInstance(ref LocalPlayer, PlayerPrefab);
            AddCamera();            
        }

        public override void OnPlayerEnteredRoom(Photon.Realtime.Player newPlayer)
        {            
            base.OnPlayerEnteredRoom(newPlayer);
            Player.RefreshInstance(ref LocalPlayer, PlayerPrefab);
            AddCamera();            
        }

        void AddCamera()
        {
            RCC_Camera cam = Instantiate(camObject).GetComponent<RCC_Camera>();
            cam.playerCar = LocalPlayer.GetComponent<RCC_CarControllerV3>();
            cam.SetTarget(LocalPlayer.gameObject);
            Debug.Log("Camera Added");
        }
    }
}
#

@zinc ravine

zinc ravine
#

In the unity editor, can you see two player prefabs when two people connect?

#

@white vigil

white vigil
#

only if the unity editor it the master

#

if it isnt the master, you cant

zinc ravine
#

so the master/host can see both players?

white vigil
#

Yes

zinc ravine
#

when running two games, in the unity editor, go to the two player prefabs and tell me the photon view ID's for both of them.

white vigil
#

1002 for the host, and 2001 for the client

zinc ravine
#

okay...well...thats good...

white vigil
#

Do you think you know what is causing the problem

zinc ravine
#

so far, no

white vigil
#

Ok

zinc ravine
#

your code is definitely different from how I learned

#

but this is how I did it ^

white vigil
#

I have looked and it doesnt make sense what is happening

zinc ravine
#

just watch that video series

#

it should really help

white vigil
#

Ok

stray scroll
#

Hey! So I've come to the stage where I want to add some multiplayer functionality on my project. I recon the development time of the project as a will be on the timescale of ~2 years, and hopefully maintenance a few years after that. I'm using a hybrid approach right now and want to transition to pure ECS later, with all of the DOTS stuff. So my question/thought is of what network layer I should add for now with the least amount of hassle of integration that can replaced later on when Unity has some more mature stuff. From what I've seen there is the multiplayer repo with Asteroids example, the FPS sample, or doing some simple implementation for now with free lib. Anyone who've tried out basing your project on the samples and if so the opinion on it?~

compact bramble
#

Too inexperienced to comment IMHO but I would probably avoid UNet, it's only available as a package to aid existing projects still using it.

stray scroll
#

Yeah, wasn't thinking of using UNet anyway^^

little tree
#

can someone help me, the server is rejecting the player. No connection could be made because the target machine actively refused it.

stray scroll
#

Googled? ^^

indigo current
#

@zinc ravine I've worked a lot with PUN 2. I have a series (see link above), what questions did you have?

zinc ravine
#

@indigo current Yeah, I've been having some tough jittering problems between clients. It all works properly, but the rigidbodies on the characters are quite...laggy looking I guess.

indigo current
#

Set the rigidbody to kinematic on non-owning clients

zinc ravine
#

Did that already. It works functionally, but doesnt seem to help.

#

@indigo current

indigo current
#

Do they jitter without the rigidbody? Are you certain its the rigidbody causing jitter?

zinc ravine
#

I do believe so. Because clients are perfectly fine moving their OWN characters around, so I know it's a network issue.

#

I am using hingejoints on the player...could that be it? There set to certain limits to not let the characters arm..bend backwards for isntance

indigo current
#

what component are you syncing movement with?

zinc ravine
#

the rigidbody photon view

#

@indigo current

indigo current
#

and youre using both a transform view as well a rigidbody view?

zinc ravine
#

yes

#

side note: does the classic transform view still work..?

indigo current
#

afaik yes

#

I use the classic with estimated speed. it tends to be more accurate than the new one. Not sure if it plays nice with rigidbody view

#

the joint restrictions may be causing issues as you suspect

#

given the rigid views sync velocity its entirely possible something is overshooting and then resetting

zinc ravine
#

okay, so what should I do? if not client, disable limits?

indigo current
#

Id first determine if thats the issue

zinc ravine
#

true

indigo current
#

maybe remove limits if not client to start, if that solves your problem then you know what to do

#

Im heading off, let me know what you find out please

zinc ravine
#

I will

#

Also, another thing. i'm trying to use RPC's to activate an inventory object. @indigo current But it's not working.. I'll show code in a sec

fading pawn
#

Anyone interested in GameLift want to try an example of using it in Unity?

untold quest
#

hey i know you

fading pawn
#

o hay

zinc ravine
#

Here's what I'm using on ever body part

zinc ravine
#

Can anyone help me figure out why my players are jittery in game over clients?

lament bough
#

So, Unity has tagged its UNet system as obsolete without first providing a built-in alternative; what's the best alternative for LAN-only networking, aside from using standard C# functions?

timid badge
#

Im trying to understand how the UNET system works, anyone got experience with it?
So far from what i understand and have working, i can give GameObjects a NetworkIdentity and make each client have Authority over their GameObject.

This makes each GameObject with a NetworkIdentity live on both the clients and the server.
Now the client can then call Commands on their own GameObject, which will execute on the same GameObject but on the server.

What i can't seem to grasp yet, how can 1 client call a Command on its own GameObject and on the server tell all other clients to move their GameObject to some specific position?

indigo current
#

@zinc ravine Did removing joint constraints fix it?

zinc ravine
#

No it did not sadly @indigo current

#

Still not sure what is up..

indigo current
#

I kind of wonder if it is the rigidbody view

zinc ravine
#

thats what I'm thinking...

indigo current
#

Why are you trying to sync rigidbodies anyway?

#

is it essential that limbs match up?

graceful zephyr
#

Write a custom state transfer component that can do prediction/rollback, should solve any issues regarding syncing bodies like that

indigo current
#

kind of annoying that there is no documentation on the rigidbody view, specifically about how it works

#

I'm curious as to why you need to sync up specific rigidbodies anyway. If youre doing things such as IK youd be better off passing on the IK data rather than trying to sync the rigidbodies

#

eg: if someone is going to grab something sync the grab target position, not the pos/rot of the limbs

#

then let the IK solver work locally; just an example

graceful zephyr
#

@indigo current in the realm of a generic game I'd argue that approach is best

#

But without context hard to say

indigo current
#

yeah

zinc ravine
#

my game is heavily physics based

#

i have my arms work using hinge limits

indigo current
#

Still doesn't really explain how much you need networked though.

#

Why do you absolutely need the rigidbody networked?

#

@zinc ravine

zinc ravine
#

I'll suppose I'll try without it

#

Does photon transform classic and photon transform work together..?

#

@indigo current

#

Cause I can't get the classic without the new transform being there.

indigo current
#

no you replace the new one

zinc ravine
#

Yeah, but when adding an observable component, it auto-adds a new transform. @indigo current

indigo current
#

?

zinc ravine
#

see where it's circled? If I fill that, it automatically adds a photon transform view

indigo current
#

you can in the classic

#

remove the other one

zinc ravine
#

If I delete the photon transform view (new version), it auto removes the observed component as well

indigo current
#

yes

zinc ravine
#

...? So how do I keep the classic, remove the new, and add an observed component? @indigo current

indigo current
#

remove the new one

#

add classic component

#

drag classic into observed

zinc ravine
#

OHH

#

damnnnn

#

okay, thank you

indigo current
#

np

zinc ravine
#

I've been adding the gameobjects...

#

but I guess its still be using the items WITHIN the game objeccts

#

omg

#

thanks

#

and should lerping help out?

#

@indigo current

indigo current
#

the transform views already lerp

daring rain
#

Hello! I'm using Mirror as my networking solution, it works by client server hosting, like the former uNet.
I want people to be able to connect to other players over the internet, without having to port-forward. I'm not really sure what I'm looking for, anyone got any clue what I'd need/what service I'd need to look for, to achieve that?

vital hawk
#

you are asking about NAT punch-through

#

@daring rain

daring rain
#

Alright, thanks!

zinc ravine
#

So my character instantiates an object properly over the network, but sometimes when they put it away, it doesn't get destroyed on other peoples clients.

        if (GUI_Tools_slotOn == 1)               //Slot 1
        {
            foreach (Transform child in item_Transform.transform) {             //Removes other children first.
                PhotonNetwork.Destroy(child.gameObject);
            }
            var slot_1_Spawn = PhotonNetwork.Instantiate(Path.Combine("Prefabs", item_id_1), new Vector3(item_Transform.transform.position.x, item_Transform.transform.position.y, item_Transform.transform.position.z), Quaternion.Euler(new Vector3(item_Transform.transform.eulerAngles.x, item_Transform.transform.eulerAngles.y, item_Transform.transform.eulerAngles.z + 180)));
            slot_1_Spawn.transform.parent = item_Transform.transform;
        }```
indigo current
#

@zinc ravine What do you mean put it away?

zinc ravine
#

put away, as in destroy();

#

I have it instantiate and then destroyed when they 'put their tool in their pocket'

#

@indigo current

indigo current
#

Why are you destroying each child though? How many objects are being destroyed? Why not destroy locally since you're sending as a RPC anyway?

zinc ravine
#

destroying the item is how I hide the tools when they're not in use. And what do you mean locally? They need to be destroyed across all clients to show that the tool was put away. @indigo current

indigo current
#

youre calling an RPC which means youre performing the action over the network

manic solstice
#

why would all clients need access to a tool only 1 client is using?

indigo current
#

you dont need to call it as a PunRPC if youre calling PhotnNetwork.destroy

#

the photonnetwork.destroy will destroy it across all clients

zinc ravine
#

gotcha

#

@manic solstice they need to see it pop into the players hands.

#

Well, how does this look?

#

@indigo current

#

Either way, it still doesnt destroy ):

indigo current
#

Is it spawning the new item?

#

you shouldn't be instantiating over the photonnetworking if the object doesnt have a photonview on it either

#

theres not enough context to give good advice

zinc ravine
#

they have photon views on them

#

and yes, the items are spawning, but not destroying.

#

@indigo current

indigo current
#

dont destroy them on other players

#

only destroy them on owning player

#

remove the RPC call

#

you either spawn over the network ont he owner

#

or you send an rpc and spawn locally off the network

#

but logically you shoudl spawn over the network on the owner, not using an RPC

zinc ravine
#

So I figured out out to sync tools properly- but now I'm trying to sync rigidbody kinematics.

As of right now, the masterclient can hit them and they'll collapse,
but other clients cannot make them budge.

crude sedge
#

Hey I'm a programmer at a major software company so yeah I can code, but I have absolutely no knowledge in networking what so ever
I'm making a game with some of my old mates from university and in our game we wanted a system much like dead by daylights', which was also made in unity, the killer is the host and the 4 survivers are clients, in ours we need 1 player of the party to be the host of the dungeon and the other 4 to play in the dungeon too, is this >extremely< hard to implement using unity?

undone sigil
#

First rule of networking: it's never easy

#

whether it'll be hard - that depends on exact plans

crude sedge
#

actually another thing, I read the docs but I didn't understand

#

if to implement such a system

#

we had to pay anything to unity

weak plinth
#

For small networking use pun setup win server and get free 100ccu

#

For real server files u need knowing about hard coding

visual tulip
#

has anyone gotten the new networking layer working in unity 2019 1.4f?

#

getting an indexoutofrangexception with regards to nativelist

#

it occurs in the scheduleupdate().complete() method on the client side

#

nvm was able to fix it false alarm, dumb mistake on my part

crude sedge
#

can a [HOST+CLIENT ] - CLIENT - CLIENT - CLIENT networking system work outside of a lan ?

fair roost
#
[Looking for a mentor]
Area of interest: networking, C#, Unity

I am looking for a person who will help me start well with networking, I use Mirror for this (this is a repaired UNET) so the code is practically the same.  I would like the mentor to help me fix the problems that I will encounter.

If you think you could help me please dm me ;>
vital hawk
#

@fair roost unless you are looking for paid mentor, you'll have better chance of solving your issues if you just bring up the issues at mirror's own discord (or here but I'd imagine people on the Mirror's Discord are more qualified to answer your questions about it)

fair roost
#

on Mirrors Discord I have already asked, now I am asking here because Mirror is practically the same as UNET

vital hawk
#

you are asking if some person is willing to help you one-on-one

#

unless you pay for it, it's not very likely to happen

#

it's better to ask publicly on these groups, WHEN you have actual issue you can't solve on your own

fair roost
#

I do so too, but maybe in the meantime there will be a person who will want to help them...

vital hawk
#

I keep mentioning the payment as you can't really expect people to start mentoring others at personal level if there's nothing there for them

#

that's also not what these groups are about

#

these groups work best if people help eachothers and people only ask help if they've first tried and can't solve some specific issue

#

you don't reserve people who jump to help you whenever you feel like it

#

people are here helping others on their free time, without getting paid for it so kinda have to just take what you get unless you are willing to pay for personal one-on-one mentoring

fair roost
#

I did not mean it, I am looking for a mentor who will lead me through the process of learning networking, give me some hints, etc.

vital hawk
#

well, are you paying for it?

lapis patio
#

something something read the documentation

vital hawk
#

if not, then good luck, but don't expect people to volunteer

fair roost
#

nope

#

ive readed the documentation already

lapis patio
#

*read

#

well, have you tried codediving?

fair roost
#

(sorry for my English ;p)

#

codediving?

lapis patio
#

Hueh, I don't mind it, I just lik correcting people

#

Opening up the source code

#

and trying to make sense of it

#

It's a hard but very useful skill to master

fair roost
#

never

lapis patio
#

...well

#

then you are forced to:
A) pay
B) actually ask on occasion

#

O, such terrible fate

fair roost
#

in this case I choose option C: I will wait for a volunteer
😄
i will ask tho and try to learn "harder"

vital hawk
#

good luck then 😃

lapis patio
#

Choosing a third option. How bold

#

I am afraid the interdimensional switch case statement is not ready for your creativity

fair roost
#

?

vital hawk
#

anyway, this discussion is already way out of scope of this channel now

lapis patio
#

I was implying a joke like this:

switch(choice)
{
    case A: doThis(); break;
    case B: doThat(); break;
    default: new throw NotImplementedException(); break;
}```
fair roost
#

btw, any good tutorial to learn from?

#

btw, any good tutorial to learn from?

#

(UNET/Mirror for sure)

lapis patio
#

I am afraid you have to stick to the documentation

fair roost
#

meh

vital hawk
#

for community driven things, tutorials can be scarce, but you'd think you can find plenty of UNet tutorials

#

I can't recommend any as I've not watched a single one

lapis patio
#

I can only echo what had been said on the mirror discord

#

UNET and Mirror are different enough to each other that UNET tutorials might fail you in actually helping

fair roost
#

;-;

visual tulip
#

does anyone know how to run a dedicated server in unity using their new networking layer?

#

specifically with multiple clients running at once?

visual tulip
#

or is there any way to run multiple game instances to test networking code in the unity editor?

visual tulip
#

nvm symbolic links work like a charm!

untold quest
#

using photon pun, right now if a player picks up a gun, i transfer ownership of the gameobject to the player that just picked it up. this allows the other clients to see the gun moving. but, if the player moves another object with the gun, and doesnt directly touch that other object, it doesnt transfer ownership. is there a simpler way to deal with this? my initial thought is to place a script on the gun when touched that causes anything it touches to also transfer ownership, which then propagates even further, etc. like some sort of ownership virus. however, this seems ridiculous. is there a simpler way to make sure that when a client interacts with an object by moving it, the other clients see the movement? new to networking so thanks for the help.

indigo current
#

Your question seems a bit of a rabbit hole so I'll try to give you a simple answer which might point you in the right direction.

#

Ownership is transferred of only 3 ways.

#
  1. It's a scene object (placed in scene on build, not instantiated) and current or future master clients receive ownership automatically. Ownership must be set to Fixed on the photonview for this.
#
  1. photonView.RequestOwnership() is called, and is automatically granted. Ownership must be set to Takeover for this.
#
  1. photonView.RequestOwnership() is called and logic must run in OnOwnershipRequest() to grant ownership. Ownership must be set to Request for this.
#
  1. [bonus] Ownership is forcefully taken by directly calling photonView.TransferOwnership(player) with no checks; this is bad, don't do this.
untold quest
#

i appreciate the information about transferring ownership of objects. so, from my understanding, if i want a player to be able to knock over a stack of boxes, then I need to make sure that the photonview on each box is set to takeover instead of fixed, and make sure that anything that the player is interacting with gets transferred to the player.

untold quest
#

problem is i cant think of a way to propagate the ownership correctly. if a player knocks over a stack of something, how do i make sure the player owns the objects?

jade glacier
#

The relay should do that for you. You just have to decide if you want to predict it on the new owner, or wait for the ownership change.... Though I have not made use of authority change with pun. Not sure what callback of any fire on owner changes.

indigo current
#

@untold quest I don't think you should transfer ownership at all

#

Perform collision on the owning client of boxes, probably the master and have them push the boxes around.

untold quest
#

omg im bug dumb

crude sedge
#

I never used anything like it but I heard there's some steam networking that we could use to implement into our games?
Am I wrong? Can anyone tell me some more about it?

last hornet
#

you could of course do it authoritatively but it won't look great for non-authority people because they won't react immediately, in that article he does a pretty complicated system similar to what your talking about. like an authority virus

zinc ravine
#

So I've been using photon PUN2 to help me with server hosting.

I'm trying to better understand ownership over ID's but I'm not entirely sure how to transfer ownership to another client.

The problem: I have a building system where blocks are placed, but I want ALL players to be able to destroy one another's blocks. My code doesn't do that- obviously. How can I transfer the blocks ownership over to the person trying to destroy it?

Thanks.

last hornet
#

@zinc ravine you transfer ownership with PhotonView.TransferOwnership(), but it seems silly for your use case when you could just send an RPC to the owner, and have him called PhotonNetwork.Destroy()

zinc ravine
#

okay, so how would I go about doing that? Sending an RPC to the owner? and having him destroy it? @last hornet thanks.

#
        Ray ray_Build = new Ray(cam_1st.transform.position, cam_1st.transform.forward);
        RaycastHit hitInfo;

        if (Physics.Raycast(ray_Build, out hitInfo)) {

            Debug.Log("Hit = " + hitInfo.collider.gameObject.name);

            if (Input.GetMouseButtonDown(1)) {              //Right Mouse
                Vector3 spawn_Bl_Position = (hitInfo.collider.transform.position) + (hitInfo.normal) * 2;              //Grabs item-hit's location. 'hitinfo.normal' is face of cube.
                Quaternion spawn_Bl_Rotation = Quaternion.FromToRotation(Vector3.forward, hitInfo.normal);              //Fixed rotation.
                PhotonNetwork.Instantiate(Path.Combine("Prefabs/Blocks", bl_Holder), spawn_Bl_Position, spawn_Bl_Rotation);
            }
            if (Input.GetMouseButtonDown(0)) {              //Left Mouse
                                                            //Destroy(hitInfo.collider.gameObject);
                //PV.RequestOwnership();//???????????????
                PhotonNetwork.Destroy(hitInfo.collider.gameObject);
            }
        }
    }```
untold quest
#

@last hornet thanks but i got that all sorted out >_<

#

now i've got multiplayer vr players with avatars and its so cool

#

i just high fived my mom in vr and she's giddy

#

😃

last hornet
#

@zinc ravine i don't think all that should be in an RPC, having those Input checks inside the RPC makes no sense

#

you should do Input for the local player like in Update() and then send an RPC

zinc ravine
#

I'll rewrite it a bit

last hornet
#

assuming your sending that RPC to everyone, then everyone is checking for Input.GetMouseButtonDown() themselves

zinc ravine
last hornet
#

so you and i are playing together

#

and you send me a BlockDestroy() RPC

#

my cam_1st is probably pointing somewhere different than yours, no?

zinc ravine
#

that is true...

#

And thats another problem I'm having. I need to define the raycast to obviously allow for that object being SHOT by the raycast, to get destroyed. Yet it shouldn't be in the RPC...

last hornet
#

you need to do all that stuff locally and only send the stuff you need in the RPC

zinc ravine
#

how can I do it locally if I need to define what the raycast is as well?

last hornet
#

why does the other player need to know anything about the raycast you used to determine what block you hit?

#

he only needs to know the block you hit so he can destroy it

zinc ravine
#

well maybe thats my problem: I'm not sure how to go about sending the block- without using the raycast.

#

@last hornet

last hornet
#

you do the raycast, but only for the local player

#
private void Update()
{

    //only process input on the local player
    if (photonView.isMine)
    {

        //mouse down
        if (Input.GetMouseButtonDown(0))
        {
            //cast ray to look for objects tagged block
            Ray ray = new Ray(cam.position, cam.forward);
            RaycastHit hitInfo;
            if (Physics.Raycast(ray, out hitInfo))
            {
                //hit a block
                if (hitInfo.collider.CompareTag("Block"))
                {
                    //tell everyone the photonView of the block we hit
                    photonView.RPC("DestroyBlock", RpcTarget.All, hitInfo.collider.gameObject.GetComponent<PhotonView>());
                }
            }

        }
    }
}

[PunRPC]
void DestroyBlock(PhotonView blockPhotonView)
{
    //only the owner can destroy the block
    if (blockPhotonView.isMine) PhotonNetwork.Destroy(blockPhotonView);
}
#

general idea

#

not tested obvi

zinc ravine
#

Unsure if I did it properly.

#

@last hornet

last hornet
#

i mean i dunon if you had a block tag, I just made that up haha

zinc ravine
#

Yeah I set it up- but it still doesn't work.

#
ExitGames.Client.Photon.Protocol18.WriteCustomType (ExitGames.Client.Photon.StreamBuffer stream, System.Object value, System.Boolean writeType)...```
#

any time I try to delete a block.

#

er- destroy one. @last hornet

last hornet
#

ah sry for whatever reason i thought PhotonView was a serializable type

#

in pun

#

send the viewID then

#

photonView.RPC("DestroyBlock", RpcTarget.All, hitInfo.collider.gameObject.GetComponent<PhotonView>().ViewID);

#

and then you need to find the photonview by the id

#
[PunRPC]
void DestroyBlock(int viewID)
{
    PhotonView blockPhotonView = PhotonNetwork.GetPhotonView(viewID);
    //only the owner can destroy the block
    if (blockPhotonView.IsMine) PhotonNetwork.Destroy(blockPhotonView);
}
zinc ravine
#

Now that I'm beginning to understand the parameters, how would I go about transfering the position and rotation of the instantiated object to the BUILD RPC?

#

@last hornet

last hornet
#

you don't need to do that with an RPC, PhotonNetwork.Instantiate is basically an RPC itself under the hood

zinc ravine
#

yeah, thats what I thought.... I've heard people say that in forums before

last hornet
#

doing it the way you have it would actually spawn as many blocks as you have players, because EVERYONE is calling it themselves whent hey receive the RPC

zinc ravine
#

but why then would photonnetwork.destroy NOT BE?

last hornet
#

it is! but only the owner player can call it

zinc ravine
#

gotcha, gotcha

#

yeah, i guess it has to gather the data rather than 'instantiating' it.

#

@last hornet thanks for helping. Fully functional now. I need to learn more about parameters that hold data, they've always scared me, lol.

zinc ravine
#

also set it up to help me change materials using a paint tool, thanks for the help @last hornet

last hornet
#

no probs!

jade glacier
#

https://github.com/emotitron/Simple-Network-Sync

Probably my last beta release for anyone who wants in. Try it in a project where you would use NetworkTransform and/or NetworkAnimator... or PhotonAnimatorView or PhotonTransformView. Anyone getting me feedback I'll give free access to the final.

indigo current
#

Are you still ignoring the serialization rate? 😛

jade glacier
#

depending what you call serialization rate, but yes - the one you are talking about about

#

you can send every X fixed

#

but it is strongly encouraging doing your simulation on FixedUpdate - as it should be

#

not even NetworkTransform/Animator go through the send rate

#

send rate is for syncvars, not RPCs

#

NetworkAnimator sends using Message base on its own send rate

#

It's still not for you @indigo current

indigo current
#

photon animator and transform does go through serialization rate

#

theyre just wrappers

jade glacier
#

PUN runs everything through PhotonView normally yeah

zinc ravine
#

So I've been trying to get my materials to change over the network, but they're still having trouble and I know I'm so close.

#

@last hornet It's somewhat of the same issue as destroying, I don't know if you want to take a crack at it again, I'd appreciate it.

autumn bone
#

Hello, I'm trying to serialize NavMeshPaths so I can send it through the network. However, the class doesn't seem to support serialization. Has anyone accomplished this? The reason for this is so I can calculate paths on the Server and merely distribute the paths to the clients who will set their nav agents with the correct paths.

An alternative to this which I am aware of is to instead send the destination to the clients but, I'm pretty sure that there is bound to be some discrepancy in the paths the AIs take. I also would not like to sync their positions because I wish to use root motion for each client (I've heard that root motion and network transform / lerping do not play well together).

I've spent the better part of the month trying to find a solution to this issue. Any help would be greatly appreciated.

olive yacht
#

Anyone here play with the new addressables at all? I'm struggling to get my .exe file to see Assets/StreamingAssets/com.unity.addressables/[BuildTarget]

jade glacier
#

@autumn bone You can try my asset above, I am actively trying to find people who can break its ability to sync Animator/Transform.

autumn bone
#

@jade glacier will do

jade glacier
#

And let me know how it fares, and even better help me repo it if it does fail. Letting anyone who gets me feedback free access to the final. @autumn bone

autumn bone
#

Anyone knows if it's possible to reigster handlers for a spawned object on the client?

trail parrot
#

I have a race game where each character does hops. The hop is auto, player only needs to tap to jump higher instead of hop, to dodge hurdles. What's more, there's a bit of time frame after a hop that u can do a late input to do a "last second" jump.
Offline version works fine. But the online is a disaster. (Client have their own prediction to keep hopping).
Haven't added actual proper prediction, server correction etc. Got a few ideas but just wondering in this kinda race game (hop is auto), how it should be done..

trail parrot
#

I cant start build on linux...
Some native stacktrace then
mono_gdb_render_native_backtraces not supported on this platform, unable to find gdb or lldb

solar garden
#

Does anyone have any idea why when i call this RPC it select the weapon only to the player who picked up the weapon YET the SetParent part just before worked on both views

    public void OnInteract(int player)
    {
        networkObject.SendRpc(RPC_EQUIP_WEAPON, Receivers.All, player);
    }

    public override void EquipWeapon(RpcArgs args)
    {
        GameObject target = GameObject.Find("Player " + args.GetNext<int>());
        transform.SetParent(target.GetComponent<WeaponManager>().weaponBone);
        target.GetComponent<WeaponManager>().SelectWeapon(transform.childCount);
    }
proper wave
#

hi

#

new to here

#

anyone know how to multiplayer for free?

#

pls help🙏🏻

rare root
#

Hi guys i am new here i have a problem about a WebGL app and i don't know how to solve it i have the following error : An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:
uncaught exception: abort("To use dlopen, you need to use Emscripten's linking support, see https://github.com/kripken/emscripten/wiki/Linking")

#

I am using Httweb Request, WWW, or Unity web request and the error looks like it comes from request

stray scroll
#

@proper wave What do you mean by free? 😛

thorny arrow
#

Anyone else having Photon randomly stopping to show avaiable room list for no reason?
It's the 3rd time it's happening to me and I just don't know what to do at this point

stray scroll
#

Anyone who've tried implementing something with the NetCode of the multiplayer repository?

covert monolith
vital hawk
fading pawn
#

I like the Bolt shoutout @covert monolith

graceful zephyr
#

@compact bramble my guess would be no, no it doesn't work with MB projects.

#

(saw your comment)

vital hawk
#

that chart tho... they say you should use FPS Sample as basis if you ship soon and need dedicated servers IF you have less than 80 users per session

#

fairly certain the framework done for FPS Sample does not scale up to 80

#

or I guess it depends what the clients do but seems quite high for a setup that was designed to run with what, 16 players on one session?

graceful zephyr
#

@vital hawk i have no comment on this directly, it just feels like if you need an 8 level deep flow chart to describe the networking situation for you're engine... something is wrong.

vital hawk
#

well, we all know current situation is bad

#

also that chart totally leaves out the possiblity to use 3rd party solutions for anything but dedicated

#

but to be honest, built-in networking situation on Unity has never been good as long as I've used it

#

so if they get their stuff together ultimately, that's great

graceful zephyr
#

@vital hawk just feels like it's one blog post every six months, promising the future thing

#

which isn't even close to materialized yet

#

¯_(ツ)_/¯

vital hawk
#

well, this at least told they have a DOTS netcode framework coming up

graceful zephyr
#

@vital hawk they have a preview of it on github, including state sync/etc.

vital hawk
#

we've always known there are ECS based to extent but this is first time I see them mention something that sounds more general purpose

graceful zephyr
#

there's an actual sample that can replicate stuff over the network, etc.

vital hawk
#

you mean the sample for multiplayer thing?

#

I thought that was more of embedded in the samples still

graceful zephyr
#

here

#

this contains a full delta snapshot, etc. stuff

#

not the fps sample

vital hawk
#

yeah, I'm aware of that 😃

graceful zephyr
#

it's just... very crude

#

nothing wrong with the overall stuff they are doing

vital hawk
#

but what I mean, if you have tech just emdedded in samples, it's not really nicely put, it should eventually be in some standalone package which then utilize it for the samples

#

so people can clearly see what's custom to the sample and what is part of reusable framework

#

which is what I expect from DOTS-Netcode essentially

#

I'm sure they'll get there eventually

#

but that's not this year

#

realistically not next one either if you take into account the speed they've developed any of the recent systems

graceful zephyr
#

oh yeah sure

vital hawk
#

I mean, if you need something production ready

graceful zephyr
#

and they seem way to focused on hard core dedicated server games

vital hawk
#

not counting experimental stuff

graceful zephyr
#

which is like what? 0.1% of games being built

vital hawk
#

maybe because they are after AAA space?

#

it's also way easier to market dedicated to new users when you have everything setup for people

graceful zephyr
#

sure, but the AAA guys already have network engineers that can build this stuff for them specifically for their game

#

which always is better

vital hawk
#

yeah but this will save a ton of time eventually

#

well, hopefully 😄

graceful zephyr
#

ha

vital hawk
#

that's what they seem to be aiming for anyway as they got all the backend stuff now, just need solid frameworks and integrations for them

graceful zephyr
#

but they are getting butchered in the comments on the blog post

#

and i kinda get it

#

people are fed up with their buggy networking systems, deprecated stuff, and 'future' promises

vital hawk
#

sure, future plans always evolve too, can't really bet on those

graceful zephyr
#

plus this seems to be DOTS exclusive, so wth happens to everyone not using dots?

vital hawk
#

if you need multiplayer for Unity today, it's not likely that many would pick any of that charts suggested solutions

graceful zephyr
#

i get that, eventually, in 5-6 years, maybe DOTS is the only way you want to build games

#

but even when this is 'done' next year

#

DOTS is not going to be ready for prime time

vital hawk
#

I'm guessing they will make hybrid integration too

graceful zephyr
#

for all games

vital hawk
#

like they do for Unity Physics package right now

#

you can use it from monobehavior side, that's actually how all their samples work

graceful zephyr
#

yeah but that package cant compete with physx

vital hawk
#

for everything no, but it beats physx in many things already

graceful zephyr
#

like?

vital hawk
#

also you can run it fully off main thread with zero sync points while you run it with your custom physics forces

#

well, later doesn't work for monobehaviours

#

but in DOTS side, you can do that

graceful zephyr
#

yeah i suppose

vital hawk
#

also once they get Burst deterministic, well, you know what that means for netcode and physics

#

but like you said, it's "future promise"

#

so, take it with a grain of salt

graceful zephyr
#

yeah

#

There's too much focus on future promises right now

#

I think that's what annoys people (and me)

#

too much focus on what we will be able to do in 2-3 years, IF they manage to deliver

vital hawk
#

I'm still totally fine by it

#

I'd rather know what they are planning to do instead of them keeping us in the dark

#

latter still happens a lot

#

for example, people didn't know about that multiplayer repos samples

#

many probably implemented similar systems on their own as there weren't any ETA for example for that kind of use cases

mortal ridge
#

Hey people. I'm working on polishing a small game which is written with https://github.com/Unity-Technologies/multiplayer
I tried to fix several issues but came to the point where I don't want to work with it anymore. Changing the framework/ library is still an option as this game is very small.

What can you recommend? I saw:

  • NetMQ
  • Lidgren
  • Photon

I'd love to have some lib/framework that elevates c# at its best like using the task library. As always Unity doesn't give a F about idiomatic code

undone sigil
#

@graceful zephyr what, how would it be possible if tons of games like Minecraft, Gmod, CS:GO, etc have dedicateds?

#

@mortal ridge i'd recommend LiteNetLib

graceful zephyr
#

@undone sigil I meant out of the games being built with Unity

#

How many high end dedicated server games are being built with Unity

undone sigil
#

@mortal ridge also, from what i've heard, Tasks are extremly underperforming in Unity

graceful zephyr
#

they are very focused on predict/rollback fps networking

undone sigil
#

@mortal ridge just beware that unity 2018.3 has some bug on linux which causes LiteNetLib to stop receiving/sending messages

mortal ridge
#

@undone sigil I used it in some heavy editor scripts and it was very well performing as far as I can tell

vital hawk
#

@graceful zephyr I don't really blame Unity for trying this, considering that their biggest competition does this out of the box for character movement and provides tools for the rest

graceful zephyr
#

@vital hawk unreal doesn't use the same type of system as unity is implementing

vital hawk
#

I mean just in general for prediction / reconciliation

#

their stuff works on dedicated

graceful zephyr
#

It's not the same tho, not even close

vital hawk
#

I don't mean the implementation itself, but the overal concept on being able to do this on remote server and have clients play nice

#

most devs don't care what happens internally

#

they just want tools that enable thing x

graceful zephyr
#

/shrug

vital hawk
#

you probably mean the handcrafted nature of current fps sample being totally different from generic replication stuff in unreal, but I doubt fps sample is even meant to be the final form how Unity will ship these things

#

it's more of a prototyping platform

compact bramble
#

Re: "nobody's using DOTS" will get fixed with dots visual scripting for a lot of people but networking via visual scripting will have to be in part making some large assumptions

#

What I am seeing with Unity's new networking is: you're basically on your own if you use monobehaviour based projects or you don't want to pay us for server fees.

#

Every paid networking solution is less good than it could've been because of the need to monetise everyone.

It pisses me off enough to maybe get off my arse and do it myself.

#

I don't get the same attitude from API or middleware when it comes to audio, rendering, code in general. Just networking.

jade wharf
#

@graceful zephyr you called?

#

dont know what your talking about, im ready, promotion! :^)

graceful zephyr
#

@jade wharf huh?

jade glacier
#

Talk about DOTS vs Dots... He's kidding

jade wharf
#

Lmao

graceful zephyr
#

oh

empty elk
#

Hey everyone,

Have an old prototype i wanted to play around with.
Its a little 2d multiplayer fighter (think Towerfall) that I had made to learn UNET at the time.

I'd love to be able to clean it up a bit, as UNET wasn't great for the fast rigidbody movement of the projectiles.
I also know they deprecated UNET.

Ideally i'm looking for a decent solution that i could do a webgl build, and p2p.
Any reccomendations?

jade glacier
#

WebGL and P2P don't really go together

#

browser based apps aren't going ever have the permissions needed as far as I know to ever try to connect to other browser based clients directly.

#

Relay based like PUN2 would be about the closest thing there

#

But no clue what PUN2 has in the way for webgl support with its transport

empty elk
#

Ahh bummer

#

If I was gonna do server based implementation, and wanted good performance, what should i look into?

undone sigil
#

First see what networking solutions support WebGL at all, then think about choosing one

weak plinth
#

hello, how to stress test photon ccu? i have free 100ccu but i want check out my hardware on server

weak plinth
#

I'v come across a little problem, somehow 2 different versions of websocket are mixing, after importing photon in my project.
http://prntscr.com/o2o5ca
This is because i have substance asset as well, which is pretty important for my project.

If someone have any advice of how do i fix this without giving up on any of assets, would appreciate.

Lightshot

Captured with Lightshot

fading pawn
#

Turn one off

weak plinth
#

@fading pawn
so i fixed the error with removing this
http://prntscr.com/o2or2m
now the question is, will photon work with no problem with this dll removed?

Lightshot

Captured with Lightshot

#

or should i go with different method of turnig it off?

fading pawn
#

I would delete the non Photon one

trail parrot
#

I'd suggest for DarkRift

smoky widget
#

Already boys

#

I'm currently working on an open world game

#

What is your reccomendation

#

Never done networking before in my life, so wheres a good start

fading pawn
#

I assume you're going with dedicated server?

smoky widget
#

Sure @fading pawn

fading pawn
#

your options are pretty much: Photon Bolt, Forge, Unity FPS, Spatial OS

#

and you can probably narrow that down

smoky widget
#

Assets store?

#

Any reason to not use Unet?

fading pawn
#

Yes

#

see most recent pinned post

smoky widget
fading pawn
#

My understanding is that is basically a preview, it isn't quite ready yet

smoky widget
#

If I focus on my single player for right now

#

would it be easy to transition over to multiplayer?

fading pawn
#

Only if you understand networking and have a plan to transition to it, otherwise you may end up needing to rewrite large parts

smoky widget
#

I don't understand networking

#

How ever the map will be static, but the npc will not

#

If that helps

#

I think I can make the game track players, npcs and bullets only

#

along with animations

#

and sound triggers

fading pawn
#

It doesn't really

#

I would expect to rewrite the single player mode if you move to mp

smoky widget
#

I want to know what to deal with

#

So i can make subsystems in design from now

#

so when its time

#

Its not that much of a big deal

smoky widget
#

@fading pawn SpatialOS can't be used in unity anymore

#

Its against there terms of services, just thought I would alert you of that

fading pawn
#

There was some drama 6 months ago, afaik it is resolved

vital hawk
#

you wouldn't write single player first and then make multiplayer, especially if you haven't done multiplayer programming before

#

it's a thing that need to be taken into account from the first steps already

#

like mentioned, you are likely to rewrite a lot of code if you try to do it like that

#

but it also sounds like almost certain way to get a ton of weird bugs if you do it as an afterthought

candid igloo
#

Yeah, adding multiplayer to a project that's already underway is definitely not a good idea, even if you know what you're doing

#

and multiplayer games are super hard to make compared to sp

vital hawk
#

the whole "if you know what you are doing" is kinda pointless in the end because if you know what you are doing, you factor it in anyway from the beginning 😄 but in theory, if you know what you need, you can at least take it into account when you design the framework for the game

#

you just usually can't take everything into consideration in advance which is why the whole waterfall model was a failure in the software development in the first place....

last hornet
stray scroll
#

@main sage I'm by no means an expert. But thinking in terms of ECS. You want requests to create buildings, that can be multiple? That feels like a buffer, if you're talking about the multipalyer samples, there are already RPC buffers in place you can use I think. If buildings are only used for instanciation, why not use a bitmask for what buildings each player can use? Easy to check against and easy to sync.

main sage
#

I accidentally deleted my post rip. Any help appreciated Thanks. I guess I could solve it a different way. I could have players to be in their own sessions but say a they are only tied together by a map where players practically don't see eachother. Would it be possible to have players in their own rooms under 1 server or 1 server per player?

stray scroll
#

Uhm, so they are not acting on the world or another player?

main sage
#

Let's say very minimal interaction such as they have their own world in which they build their own but can export/import goods to eachother as simple data values. I guess kind of like how simcity supports multiple players in a world but each player builds in their own city but can still trade amount players.

stray scroll
#

Well, then I would ask if cheating is a problem for your game. If yes, you need to have some server checking everything the player does in his local world as well right? Else you only need the server for transferring the "import/export goods"

#

Well any maybe accessing database if that's applicable

main sage
#

I'll disregard cheating for now. So it's possible for a player to host a 'lobby' then inside that lobby is a 'room' for each player to build their world? Is there a term for this kind of design I can look up. I'm pretty new to MP, only done SP games so far

stray scroll
#

Not sure if there's a term, but what you're proposing is not too far from a singleplayer game anyway. I'm not sure if you're using any 3d party multiplayer API or so? But there might be limitations to them, since they may be built for a specific type of gametype. Further I'm not sure what type of interaction flow you're planning? Can the player put down the game and come back tomorrow? Do the import/exports happen every minute? Each hour?

main sage
#

It's more of a case study for now. I'm trying to mimic simcity. I believe in their system, the world was running 24/7 and players could drop in and out of the lobby/world. If a players city was offline it would run autonomous (do nothing) while a neighboring stil city who's still online would continue to build in their city as they please. There might have been scheduled syncs for the cities visuals whenever somebody logs back in and looks at another players city

stray scroll
#

Hmm ok, so I would setup a lobby which the clients saves ID/adress etc, depending on your surrounding systems. Depending on how often the import/exports happen, I would have the server on first start tell the client when next import/export happens and its interval, and the client would connect to the server at those intervals and do the exchange. And when the client changes information that is outbound, I would also make a connection to the server and tell it to update stored information for the players outbound (all players outbounds in fact). And then it can tick resources (do import/export enchanges) and assign IDs to them, and when the clients connect it can ask for all resource exchanges from a certain ID to catch up.

opaque dew
#

can anyone recommend a good video series for photon?

stray sedge
#

Is anyone knowledgeable with Mirror? (The uNet fork)

frigid rock
#

Hello guys, I'm having trouble syncing a variable between clients.. I'm kinda new to networkmanager.

#

If someone could help me that'd be great.

vital hawk
#

@stray sedge Mirror has it's own discord, if you have questions for it, it's probably the best place to ask them

#

I can DM the link if needed

stray sedge
#

@vital hawk that would be great

vital hawk
#

sent the link

opaque dew
inland timber
#

Heya, I just happened to come up with this question in my mind. Is there any way to prove a game logic is fully deterministic?
I am currently implementing multiplayer synchronization with lockstep. And my game loop seems to be deterministic. As identical frame data from 2 different machines say. But I am not sure if it ‘truely’ is.

graceful zephyr
#

@inland timber not really

#

@inland timber I work on photon quantum, and well.. we do a lot of determinism, and technically there is no way to prove it - we use game state checksums to ensure everyone is in sync, and should the worst happen in a live game and someone desyncs we have a way of recovering (the recovery just exists to give peace of mind, we don't expect it to be needed)

inland timber
#

@graceful zephyr Thank you for your reply 😃 yeah I also kind of doubt that there's a "mathematical" way to prove that... To manage desyncs, I am thinking of replicating the whole game's states over players. From super peer to others perhaps. I hope it will work out well...

jade glacier
#

the checksum will give you a pretty definitive indication of desync, if you do your checksum right

inland timber
#

@jade glacier What kind of checksum making algorithm would be good in general? Tbh, I have no idea if my hashing (just mixing internal state values randomly) is great enough. 😂

jade glacier
#

any typical hashing system I would expect to work

#

The odds of an out of sync coming up with the same hash are absurdly high. The main thing is to make sure EVERYTHING is included

graceful zephyr
#

@inland timber We use CRC64

midnight latch
#

it's hard create a dedicated server for my own game?

inland timber
#

@graceful zephyr Oh thanks 😃 i will think about using that 😃

weak plinth
#

What networking solution should I look into using with my team for 100+ CCU mmo type game?

jovial rapids
#

@weak plinth maybe atavism

weak plinth
#

Guys and Gals, are there any RTS lockstep libs out there that work with pure ECS now? I'm aware already of Quantum but was hoping for something open source.

#

really need client prediction and rewind, the same sort of stuff that Quantum provides, though maybe not so advanced.

vital hawk
#

that would be no

#

even for nonECS, you probably wouldn't find anything like that ready made

midnight latch
#

for a MMO it's good create my own code or use a API?

lusty crow
#

okay,
first, it is highly encouraged to already have some experience with how networking works or having made some games before you try to tackle an MMO,
depending on your scale, there are assets on the store that demonstrate how a possible architecture for an mmo might look like.

as for the API, you are already using an API by using unity and their provided functions. So I guess the question is, should you use your own solutions or third party libraries and services?

If you are experienced and you want to write your own libraries for everything, that would still take a huge amount of time and resources, you should ask yourself if it is worth it.
Many libraries are open source, so you can benefit from being able to make necessary code changes yourself. Using closed source software you cannot change might be more of a risk in case there is an unexpected bug.

one additional benefit of other libraries and frameworks is that if the community or dev is still active, they are maintained and you don't have to care about it.

as reference, Worlds Adrift was made with SpatialOS, which is not just a library, but a whole service/infrastructure. maintenance costs were pretty high too I would assume. So there is also the possibility to use services, if they fullfill your requirements and if you can afford them.

#

So,
TL;DR: please use APIs if you don't want to work on the game for 15 or more years

#

Also, setting a too huge scope for yourself in regards to your skill set will increase the possibility of the project to fail,
many people want to make their dream game as first game, but underestimate the time or skills required, after a while it gets frustrating and they quit. that is not to say it is impossible to make an mmo on your own, it most likely is possible, but it will probably require a lot of time and resources, depending on how the game plays etc.

river saffron
#

wondering if anyone has used the Unity.Networking.Transport and can help me with an issue. visual studio thinks it is missing a assembly reference as it can't find Networking in Unity. any idea, my brain already wants it to be Saturday.

#

ideas**

amber venture
#

Hi, i have a question about the limitations of unity's high level multiplayer api. does it support a scenario where on a single server you could have multiple different maps active simultaneously? as in, have player a in map 1, player b in map 2?

rapid tendon
#

I'm trying to make a game that only has 1 server and players automatically join it.

I'm using Mirror as the networking and I want to do a few things:
Make a server (what services would be good for this. It's not a complex game, it's based on The Backrooms creepypasta and players are put into a BIG static maze and have to find their way out)

Make players automatically join the server on opening the game

#

I don't have much practice with networking so I have no idea how to do any of this.

fading pawn
#

You're asking how to host a server?

amber venture
#

i asked before but maybe i formed my question a bit wrong. what would be the best way to go about writing a multiplayer game where a single server can host multiple maps (i.e. if player a wants to be on map 1, and player b on map 2)? would the new unity high level api support that, or is that a limitation?

faint fern
#

If you are talking about scenes, you can dynamically add scenes

#

so scene1 could be the map 1 and scene2 could be map2

obtuse forge
#

Hey, I'm working on a game that requires people to be able to 1v1 each other. Anyone know any good tutorials for making something like this possible?

#

I don't know anything about networking yet, but I would love to learn. I'm not really sure where to start.

weak plinth
obtuse forge
#

Thanks a ton! I'll look into it. 😄

weak plinth
#

No problem hope you enjoy the series

rapid tendon
#

Does anyone know anything about using an ec2 to use as a kind-of master server for a unity multiplayer game? I've set one up via aws and now I want to run the game's server on that

#

I'm using Mirror for the networking (the discord server for it is kinda dead so I thought posting here would be better)

#

I have no idea what to do from here on out

#

What do I put on the ec2 itself? A linux build of my game that only runs the server?

weak plinth
#

@rapid tendon I can help you out

#

Do you have a public static ip for the ec2

rapid tendon
#

I set an elastic IP so I assume so @weak plinth

#

set an elastic IP, got a new IPv4(I think), set that as my network address, created a new server build, put it on the ec2 via pscp and client won't connect

weak plinth
#

When you connect are you trying to connect to that port 7777?

#

most likely will need to set it to 80

#

and in the server build use the environment port

#

that gets assigned

#

for routing

rapid tendon
#

well after trying to use port 80 I just got a timeout error

#

I've opened 7777 on my ec2 inbound/outbound rules

#

but i had done that already

weak plinth
rapid tendon
#

got it to work by making it a headless build. thx anyway tho

weak plinth
#

👍🏻 Glad you were able to get it working

rapid tendon
#

I got my multiplayer game working and now I want to finalize some stuff.

Every time I change something serverside in the code, what I have to do to update the server is:
Build a linux server build
Send it to linux ec2
Run the server build

Is there a way to automate this process?

weak plinth
#

I am currently for my development server utilizing Heroku for the reason it can auto detect github changes on a branch which has helped a ton in doing micro updates. In the future would be swapping out to just ec2 or the gamelift service to cut out the middle man

graceful zephyr
#

@rapid tendon can probably do a little power shell script that does this for you

rapid tendon
#

I'll look into that later. I'm probably not going to do any changes server side except for saving player positions so I can just do the process one more time and be done with it for now

main hill
#

Sure would be nice to get at least a little taste of what the new DOTS-Netcode API may look like before its preview in the fall. Anyone have any info on that? The most recent post on Unity pointed us the FPS Sample, but my understanding is that it is using the Low Level Transport, and the only similarities it may have with what to expect in the fall is that it uses ECS.

#

I at least hope they are piloting the project with current game developers outside Unity, and it won't be this big release and "Blah, here's what we built without asking you" type of thing

stray scroll
rapid tendon
#

What would be the best way to approach saving for my multiplayer game?

#

it's not a complex game and I won't be storing sensitive data like passwords or anything (ill just be saving player position when they leave the game).

Currently my idea is just:
save player position in a file/playerpref when they leave, in plaintext, on the server (which is an ec2)

But my main issue is somehow identifying each player uniquely and then being able to reference that unique id whenever they rejoin the game

#

someone said using guid but I couldn't really understand how to use it when looking it up. It seems like UNET did have a specfic way to generate network GUIDs but Mirror (what I'm using) doesn't seem to have it.

weak plinth
#

Perhaps you can get the mac address from the connection ?

jade glacier
#

Generally for that you would have a login server that takes your name and pword, and from that generates the token that the game would use to accept the connection, and the master server would pass to the game server your player deets

#

The gameserver isn't really going to want to start that kind of stuff. Logging in and out should involve a database of some kind outside of the game.

lusty crow
#

often it is enough to have one or a few instances of matchmaking server that handle that stuff: logging in, authorization.
and for game instances, this can happen on other servers

hard bronze
#

Hi guys,
Need some help, anyone experience in using Unity Photon Pun? T^T

This is how the things work, where the server is playing on a big screen that actually showcase all the player character walking around (just showcase, nobody is able to control it).
And other computers are run as clients, which audience will interact finish( including screenshot their face and put it on plane ) after that audience will press the button and the screenshot will put it on plane and transfer to the server.

Currently facing a question:-
After screenshot, it does not show on the Big Screen(does not send to Server), but only on Client side are able to preview the screenshot that project on plane.

my problem is exactly same with this link, however no one is able to solve it yet.
https://answers.unity.com/questions/1063470/using-photon-to-send-screenshot-to-other-players.html

stiff ridge
#

@hard bronze : The code in that Unity Answers post is not using the RPC as intended. Caling RPC("method", ...) will just call that method via the network, not pass the image. You can use parameters as part of a RPC call.
If only one client needs the image (as only the big screen shows it to all), you can call the RPC on a particular client (the one on the screen).
https://doc.photonengine.com/en-us/pun/v2/gameplay/rpcsandraiseevent

empty elk
#

In a p2p model, how are large amounts of things like enemies handled? If im constantly updating position and state, and such for up to 75-100ish enemies, wouldn't this just overload network traffic?

gray pond
#

@empty elk No generally not. We have demos with 400+ entities in a confined area all moving and updating pos / rot and bandwidth isn't the choke. CPU falls over before the network does.

#

Depending on the size of your scene, applying area of interest filters and some compression goes a long way to making it a non issue at 100-ish entities.

empty elk
#

Awesome, thanks for the info @gray pond

jade glacier
#

Large amounts of enemies in P2P meaning lots of players, or NPCs? Because neither really is going to be condusive to a pure P2P, the number of connections involved and sends per connection would be pretty messy

#

by p2p are you talking relay, like PUN?