#archived-networking

1 messages Β· Page 83 of 1

shut yarrow
#

None that I know of. There are plenty of framework to choose from (both free and paid) but there is no silver bullet and games are so different that it's almost impossible to make a general purpose framework that won't put limits on you

spring valley
#

any suggestion on playfab or gamesparks and why people are instead approaching pun / miror more

shut yarrow
#

PUN isn't authoritive at all and perhaps one of the easiest networking solutions for beginners

#

I never tried mirror so can't say anything about that

spring valley
#

what would you suggest if i wanna get into sever based games like dedicated server handling all game logic

#

any DIY for that

#

becase i dont really feel pun and mirror will help in a long run

shut yarrow
#

There are but I'm not sure that you're ready for that task yet and it's going to be frustrating

#

It requires you've done quite some research already before you can try to make something useful

#

I'm using an 'easy' option but it also means I have to do almost everything myself

#

If you're interested to find out, look into ENet

spring valley
#

i am willing to do the dirty work if it helps in long run

shut yarrow
#

How much experience do you have with networking and programming in general

spring valley
#

networking not much that is why i am willing to learn it but with programming lets say 5 years

shut yarrow
#

You at least need to have good programming knowledge

spring valley
#

i know c, c++, c# , python pretty well

#

weak networking guy u can say

#

xd

#

thought i have made games with firebase and unity

shut yarrow
#

That'll help though, but networking is something really specific so it's not something you can just do on intuition

spring valley
#

tbh i have my game down so if i can get my hands on a part where i can have dedicated server and i can use them for my game , it would be really good

#

i am willing to learn

#

i think networking may be the only part putting me down as a programmer hence i wanna get that up

shut yarrow
#

You can, if you think you can learn a new framework that doesn't have so much documentation but you know how to use the few simple mechanisms

#

I haven't found any simpler option than ENet yet, that's why I like it so much

gleaming prawn
#

Tip #1 to design networked games:

  • it's about how you control the simulation, not about how you send data
spring valley
#

i have always wondered how these games like fall guys, among us store data in networking scenarios

#

knowldege on that would be damn returning\

gleaming prawn
#

Start thinking how you would design a synced mechanism so all machines are "aware" of a "tick", and everyone simulates around that tick.... and everything you send/reconciliate is tied to that tick rate

shut yarrow
#

With ENet you don't worry about how to send data, that;s what the framework does for you. You worry about your packet structures and your networkingloop

gleaming prawn
#

Among Us is RELAY, it's a DIY version of something like PUN

#

networkingloop
That's the ticker... But it's more than just networking

#

It should drive how the simulation runs

#

I can't say about the other tools that I'm not familiar with, but these from us use this principle:

  • Photon Bolt
  • Photon Quantum
  • SNS (PUN2 add on by @jade glacier )
shut yarrow
#

If you want to try ENet, you can use either C# or C/C++ with it so that is nice, and it's very lightweight as well

spring valley
#

is it scalable?

shut yarrow
#

Yes

spring valley
#

also, is among us server based or client based?

shut yarrow
#

Because of its simplicity and being very lightweight on memory there's a lot of room to scale

#

A guy made a video using DOTs and ENet with a simulation running 5000 clients or so

#

That's pretty decent for a single server instance

spring valley
#

DOTS

#

IS

#

DAUNTING

#

in the state it is right now

shut yarrow
#

Yeah but just to give an idea of what's possible

#

It's in general not the networkinglibrary that is the problem, more like how you handle your business with it

spring valley
#

just for the sake of networking i have even thought of switching to unreal engine

#

unity feels like beta

gleaming prawn
#

DOTS is in preview, not complete, not in a usable state right now... Cool to learn though

spring valley
#

in this sector

shut yarrow
#

Don't rely on built in networkingsolutions

gleaming prawn
#

Depends on what you plan...

#

Don't rely on built in networkingsolutions
You mean Unity's?

shut yarrow
#

For example, great example as well πŸ˜›

spring valley
#

unitys not good

#

fall guys uses this thing called multiplay

gleaming prawn
#

The new one has good foundations, but like everything dots... Not interesting at all yet

spring valley
#

though multiplay is not transparent

#

kappa

gleaming prawn
#

Multiplay is just server hosting

shut yarrow
#

My point is, the engine makers are focused on offering features, not really specializing in some specific field like networking so I'd rather get a solution made by people who put all their time in the product they work on

gleaming prawn
#

Nothing to do with networking SDK

#

Swanson. the UE networking is decent (not perfect, but decent)

shut yarrow
#

Maybe you're right and I wouldn't doubt your word on that

spring valley
#

also, why dont people here suggest playfab or gamesparks?

shut yarrow
#

I never tried UE it doesn't even run on my hardware

#

But to choose an engine just because of the networkingsolution is also bit strange to me

gleaming prawn
#

playfrab or gamesparks?
We do suggest that, but that is NOT networking SDK

#

These are player-profile DB services

#

Playfab is decent, and has been a favorite choice by most of our customrs.

#

You can also run your own solutions, etc

#

But they are NOT a networking SDK... They have some very RUDIMENTARY tools in that direction.

shut yarrow
#

You mean it's for stuff like scoreboards etc?

gleaming prawn
#

But nothing beyond the very very basics, so not really useful for that purpose (runtime networked gameplay)

spring valley
#

they provde live environemtns right?

gleaming prawn
#

Yes

#

they provde live environemtns right?
Ye, good for running matchmaking, etc

#

It's NOT designed/targeted to realtime gameplay

#

I'll list all providers I know of that actually give you something related to realtime networking (no judment on quality, featureset, etc). And I might forget a few, but here we go:

#
  • photon (several products: quantum, bolt, pun, realtime, server), mirror, mlapi, darkrift, forge, normcore, spatial-os/improbable, coherence, Steam (they have a p2p punch+relay fallback service), XBox (teredo p2p punch+relay fallback), Nintendo (also p2p punch+relay fallback), and afaik sony also offers something (forgot)
#

These are the usual SDKs/services people discuss here + dots

#

official dots + coherence are very very preview/alpha, and afaik have nothing released with their stuff

#

all the others have games released with

shut yarrow
#

Isn't darkrift only TCP or is that something from the past?

#

I think I once ticked that one off the list because of that reason

spring valley
#

is steam worth looking into? i think they have a lot of add on and customisation

gleaming prawn
#

multiplay or gamlift are HOSTING services (you write the game with something like bolt, mirror, and run dedicated servers in these services)

spring valley
#

since most indie would be releasing on steam

gleaming prawn
#

Isn't darkrift only TCP or is that something from the past?
As I said, I did not judge anything... Just listing the SDKs which are related to realtime (that I remember of)

#

is steam worth looking into? i think they have a lot of add on and customisation
It's VERY barebones... Very, really vera

shut yarrow
#

Wasn't asking for judgement just a yes/no πŸ˜›

gleaming prawn
#
  • it just gives you a trabsport layer + invite system
#

Wasn't asking for judgement just a yes/no πŸ˜›
Yes or no depends on WHAT you want to do

shut yarrow
#

For example a shooter or racing game, not just a point and click

spring valley
#

any database you would suggest along with these sdk u just mentioned , it may even influnce the choice of sdk

gleaming prawn
#

For example a shooter or racing game, not just a point and click
Then, NO

spring valley
#

having a streamline process would be far better than hooking up a lot of stuff here and there

gleaming prawn
#

any database you would suggest along with these sdk u just mentioned , it may even influnce the choice of sdk
It should NOT influence the choice of realtime SDK, these are completely separate problems

gleaming fossil
#

DarkRift is using UDP and TCP for unreliable / reliable transfers

shut yarrow
#

I'm using SQLite for database

#

Ah so no reliable UDP

gleaming prawn
#

I'm using SQLite for database
That does not say anything... It might be just a premature choice

#

I mean, do you have a clear separation of what you need a DB for?

shut yarrow
#

Yeah you're right maybe it is

gleaming prawn
#

It's not even related to realtime gameplay

#

We're talking two different things...

shut yarrow
#

Made the choice purely for sake of convenience, easy to set up and just run SQL commands I'm already familiar with

gleaming prawn
#

DBs are used for storing:

  • player data (profile, achievements, owned item IDs)
  • match history (your runtime SDK/service might STORE data here, but they are not directly related)
spring valley
#

do u have a sign up process if yes how do u link them w player profiles @shut yarrow

shut yarrow
#

Yes I do

gleaming prawn
#

Made the choice purely for sake of convenience, easy to set up and just run SQL commands I'm already familiar with
Storing gameplay/player/match data is a lot more than this...

shut yarrow
#

Player registers and gets saved in a database, then he can login and I'll retrieve his/her information

spring valley
#

do u have an identifier for that player like a unique id

shut yarrow
#

Yes

gleaming prawn
#

Just take player signup/athentication for example:

  • most services (like ours) let you plugin any custom authentication to allow plyers connect to the realtime network... you just provide a REST URL with some conventions
#

but again, this is just <5% of what you need for a multiplayer game

spring valley
#

😭

gleaming prawn
#

if you want to create an online multiplayer game, forget a bit about storage, player profiles, etc, these are "orthogonal" requirements...

shut yarrow
#

Changing to other SQL based database isn't an issue for me though, for now this is sufficient for me

#

Exactly my point πŸ˜›

gleaming prawn
#

The choice of database is just not related/relevant to the runtime multiplayer part... that's my only argument...:)

#

But again it depends on your ambitions

spring valley
#

oh okay thanks for the pointers , could u suggest some source materials to get into these newokring process @gleaming prawn i am not that great w networking

gleaming prawn
#

[about DB storage] If you plan to release a game for real, and make money out of it... you either:

  • use existing services like playfabs
  • (after a lot of experience) write your own that will be cheaper (but really really after you learn A LOT by releasing other games using services like above).
    This is the road taken by developers I know
spring valley
#

by source materials i mean somehting that can really explain the process that goes in between gameflow, signup-> gets registered-> calls to db with indentifier-> created profile something on this line

gleaming prawn
#

could u suggest some source materials
I suggest you start with a game that is easier to network than a shooter or a racing games (these are both challenging).

spring valley
#

i would prefer doing an asynchronous game than live game

gleaming prawn
#

Then go to youtube and watch tutorials about Pun/Mirror, whatever you fancy

shut yarrow
#

I think that's what Erick was talking about before, those are secundary subjects

#

Will be difficult to find an all encompassing guide

gleaming prawn
#

i would prefer doing an asynchronous game than live game
Then you do not need per se any of the above

shut yarrow
#

And not practical either

gleaming prawn
#

BUT, still

#

it's all about the SIMULATION, not how you send data

#

for an async game you need:

  • a way to store the full game state
  • the game state must be compact (so it's cheap to send/receive)
  • the clients must be able to recreate the whole View/UI from a snapshot of the game state
  • simulating the turn/command on a server (or using determinism) will be important in this case)
spring valley
#
  • simulating the turn/command on a server (or using determinism) will be important in this case)
    @gleaming prawn
#

so this is my concern, it has t be server authoritative right?

#

maybe a dedicated server that handles these game states and assigns lobbies

shut yarrow
#

That's a world of pain I'm not willing to undertake yet

#

I'm trying to make it semi authoritive cause I just want to make something that is fun to play, then see how popular it will be and if it;s even worth doing all that effort

#

So no server side physics, or server giving permission you can move/shoot whatever

gleaming prawn
#

it has t be server authoritative right?
If you use determinism, NO

#

I'm trying to make it semi authoritive cause I just want to make something that is fun to play, then see how popular it will be and if it;s even worth doing all that effort
THIS

spring valley
#

idk what determinism is and in what context

gleaming prawn
#

I can't say better than this...

shut yarrow
#

I know gameservers with 1000 players and they don't even have full authoritive model

gleaming prawn
#

That's the spirit IMHO Swanson

shut yarrow
#

It's important for them to have actual admins to keep it fun and fair

gleaming prawn
#

I know gameservers with 1000 players and they don't even have full authoritive model
Among Us is an example...:)

shut yarrow
#

I play a lot of san andreas multiplayer

gleaming prawn
#

make a fun game...

shut yarrow
#

Yeah indeed that is the top priority

#

It might sound weird but I'd love to see people cheat, then I know I'm on to something good

#

Nobody's going to care to cheat in a game that has 3 players

#

But yeah main point is, it is difficult to do it right (what is right anyway?) and if you can get away with cutting corners then do so

#

Anyway I need to sleep thanks for the nice talk and hope you both have a good day. Good luck with your decision @spring valley

weak plinth
#

built in networking can be great, just not UNET!

grand skiff
#

Hello

#

This triggers only 1 time

#

even i have 2 players

harsh dew
#

Pretty sure OnJoinedRoom is just for the local player

#

And OnPlayerEnteredRoom in IInRoomCallbacks is used when another player enters the room

#

I'm assuming you are using pun

grand skiff
#

Yes

#

Let me use them

#

@harsh dew it doesn't even type "s"

harsh dew
#

Is the class inherting from MonoBehaviourPunCallbacks or do you just implement the callback interfaces?

#

That's what the method signature looks like

grand skiff
#

I'm so new to Photon, i'm probably using the second thing

#

I do not have experience in PUN

#

What is difference between Photon RealTime and Photon PUN

#

My application is using Photon RealTime

#

I'm new to Photon

gleaming prawn
#

Realtime: just the base transport layer SDK
Pun: simple state transfer for Unity (built on top of realtime)
For the app ID, it won't make a diffference, as both use the same relay servers and protocol...

#

If it was a Quantum App ID, then this would be important (because there's server logic going on)

grand skiff
#

Thanks!

honest spindle
#

While using Unity.Netcode, if I have a ghost object spawned on the server and then mirrored to clients, the material flickers... no other objects in the scene do this... any insight?

jade glacier
#

I would ping the DOTS channel with netcode questions. Few in networking really use Netcode at the moment, since its still preview. @honest spindle

honest spindle
#

πŸ‘ thanks!

analog python
#

why cant i find NetworkManager anywhere?

jade glacier
#

Unet has been long deprecated @analog python

analog python
#

ok then how do i do multiplayer

jade glacier
#

Mirror and Pun2 are the most common starting points for people learning networking.

analog python
#

@jade glacier im trying to use Mirror; but it is not working

grizzled narwhal
#

Be specific.

jade glacier
#

You can join their discord to get some help.

analog python
#

using Mirror; and get The type or namespace 'Mirror' could not be found (are you missing a using directive or an assembly reference?)

grizzled narwhal
#

Ok learn C# first.

analog python
#

i do know what the error means but i dont know how to fix

grizzled narwhal
#

The error tells you that you have no mirror installed

#

So install mirror

jade glacier
#

Likely you have/had errors in the log before installing.

#

And it can't run the script that adds defines in unity.

analog python
#

ok installing rn

jade glacier
#

You are joking right?

analog python
#

no i am sorta new to unity

jade glacier
#

Did you not install the library you were trying to use?

analog python
#

no

jade glacier
#

As luc said....

#

You are not even close to ready for this.

analog python
#

plus i have never added extra things to projects before from that place

jade glacier
#

Again. You are in way over your head here. Too soon to be trying game networking.

#

Make a few complete single player games before subjecting yourself to networking. Installing is the easy part. This only is going to get much much harder if you are new to unity.

grizzled narwhal
#

Networking makes everything 4x harder. Stop. Make simple games. Learn Unity. Then maybe.

hard oasis
#

yep

#

thats a very common newbie mistake,starting with networking

lime lance
#

so question. how do i go about multiplayer in 2020?.... i know the hlapi unet and llapi are deprecated and we've moved to multiplay. How does a small developer in 2020 get started with this without having to 'contact us'

hard oasis
#

so question. how do i go about multiplayer in 2020?.... i know the hlapi unet and llapi are deprecated and we've moved to multiplay. How does a small developer in 2020 get started with this without having to 'contact us'
@lime lance try mirror which is basically enhanced unet or Photon

lime lance
#

thanks

hard oasis
#

np

digital sable
#

Yeah mirror looks really promessing

graceful zephyr
#

what

#

mirror is "enhanced" photon?

#

mirror is an evolution of UNET, it has nothing to do with photon >_<

jade glacier
#

my god.

jade glacier
#

Everything is on a numbered tick, and that is basically simulation ticks.

#

A simulation consists of Prev State + Applied Inputs = New State

#

So standard FPS handling is players collect inputs for the next tick locally, and apply them to their character for that tick, but also send them to the server. The server applies them and broadcasts it's State result for all objects.

The predicting client compares its history of results for that tick with the server's results when they arrive, and if they mismatched there is a desync.

#

When there is a desync, the client must rewind the simulation to the point of disagreement, apply the server state, and resimulate forward again, using the history of inputs.

#

The server aligns all players incoming ticks to its simulation numbering

#

Simulates them all at once, and extrapolates any that didn't arrive in time

#

Then sends out its results with the tick number

#

They may have done something like that, but that is also very old tech now

#

Not sure how that kind of system would be sane to rewind, lerp, etc

#

can you paste the line of text that seems to suggest that?

#

That is not a standard server authority practice, but time based can be done - at the cost of complexity and more CPU usage for the server.

#

I guess first question is who is this author, and what game have the produced with the system they are proposing?

#

You can do just about anything you can think of in networking. If you are willing to deal with the complexity and overhead involved in what is suggested here, it is doable.

#

It isn't typical, but it is doable.

#

Determinism goes right out the window, so you will be leaning heavily on brute force for most everything.

#

I see all of the points I am making are right there in that same doc

#

More cpu drain, more complexity, more hacks

#

Source may well have, Counterstrike and such are fully non-deterministic and have super basic simulations

#

The article seems to touch all of the pitfalls and perks... so I may have missed what your original question was.

#

Another alternative route since its a simplistic simulation is to run the simulation at an insanely high rate. You can then drop sent inputs as needed to let the server extrapolate them and such.

#

To be clear, this type of thing is very specifically tuned for fast FPS shooters. If that is what you are making, by all means give it a whirl.

jade glacier
#

In that case though, you still wouldn't be sending "time", you would still be quantizing actions to a tick on the client... just the ticks happen so quick and often that they won't feel like they contribute to input lag.

#

Input lag with a fixed tick system would come from a low sim rate... since to keep things sane you would not apply weapon fire, jumps, etc immediately, you would apply them on the next simulation tick, so that they are in perfect agreement with any movement code.

#

You can fire shots between ticks, but to keep that sane with your sync, you have to start really getting meticulous with your lerping code and such.

#

If you have a lot of world entities and AI.. I would forget what you just read on that blog immediately πŸ™‚

#

If your server has to run a giant simulation, you want your players to be part of that. Making them move outside of that is just more work for your physics/sim engine, and is going to create all kinds of uncertainty about where things are/were.

#

No harm in experimenting with any/all of this - but I would NOT try to implement that into a project that has to go live without a lot of proof of concept tests preceding it.

#

We might be discussing different things

#

That snippet looks like fixed tick

#

That will make for some interesting rewind and resync code

jade glacier
#

It well may be a bit more squishy with it's ticks like that. It is a relatively old net engine, and the requirements may have allowed for that.

#

It may be that they didn't count on rock solid timing from PCs. Or they did that too allow for offtick events. I'm not sure.

#

Give it a shot. Just be aware of the complexities that come with it.

#

Rewind and resim will be significantly more complex to implement.

worldly cedar
#

anyone else getting an SSL Connection Failed rn? My traffic monitor is telling me the remote certificate is invalid, not sure if its a problem on my side or theirs

urban shadow
#

I'm having a tough time doing something I perceived as simple: syncing player metadata with Photon PUN. All I want to do is add an ID to the player, just as it has a Nickname. I tried using photonView.Owner.SetCustomProperties but either I'm doing it wrong or it's not how it should be used... Does anyone know how to do this? Or have a link that shows how to do this..? I found a serialize solution but that runs very often, and I only want to set it once. I could ofc do a check to see if the value changed and if so add it but it just feels like a lot of work for 1 id, so it's probably dumb.

gleaming prawn
#

player properties are normally a good way to do that

#

can you post a specific technical question on why you think it's not working?

#

If you follow the manual and set custom player properties, the other game clients will receive the on properties-changed callback, etc

urban shadow
#

After joining a channel I do: photonView.Owner.SetCustomProperties(new Hashtable {{ "videoUid", uid }});

#

Which seems to work. But then doing photonView.Owner.CustomProperties["uid"] doesn't because photonView is null.

gleaming prawn
#

After joining a channel
You mean a room? Channels are a concept of photon chat, so I'm double checking you are not confusing things

#

in which machine?

#

you can only do that from scripts that are place in game objects that have a photonView

urban shadow
#

I meant a channel, but it's specific to some other part of my app

#

lol

#

Yeah, no that part I know

gleaming prawn
#

Well... if you have a null pointer, clearly there's some mistake in the game object setup, or something like that.

urban shadow
#

It's a convenience method to help me get it, which is why I don't get it. It's on my Character which is on the prefab that has the photonview

gleaming prawn
#

Maybe you should join Photon's discord

urban shadow
#

They have a discord?

gleaming prawn
#

and post the exact code there

#

Yes, there's a public photon discord

urban shadow
#

I could only find their retro forum

gleaming prawn
#

I'll PM you the invitation

#

sent

urban shadow
#

Oh cool...

gleaming prawn
#

post the question there, someone will answer you

#

add some code... The approach itself is good

urban shadow
#

Oopsie

#

I need to stop running multiple instances of unity

wheat zodiac
#

Does anyone know how to redirect internet traffic in AWS that is going to an EC2 instance over to an internal IP URL for a webapp running on that instance?

sleek laurel
#

can someone tell me why photon only works in development builds? is there a fix?

amber trench
#

@wheat zodiac not sure what you mean

#

are you saying you want host.example.com to resolve to 127.0.0.1 instead of 54.x.x.x for a process running in an ec2 instance?

#

or are you saying you want https://host.example.com/path to be answered by http://localhost:8080/

#

use traefik

sleek laurel
#

wait ima test one more time

#

it worked

open sphinx
#

does unity have play with multiple different game session window like in unreal engine?

gleaming prawn
#

you can open multiple copies of the editor using symlinks to the Assets folder

wary obsidian
#

Hello guys. I'm working on a WebGL archiviz application on Unity right now and I'm using the addressables system to help me optimize the loading size of the app, since it will have a lot of assets for the furnitures. So I'd like to ask if creating the group bundles with remote build path and remote load path will automatically separate the assets from the build and thus fasten the load time, or do I still have to manually indicate to unity that those assets shouldn't be included within the build? Thanks in advance

stiff ridge
#

Look into addressables, I'd say. That said: Wrong channel?!

wary obsidian
#

Sorry I didn't know in which channel to askπŸ˜… This seemed the most appropriate for me haha

spring valley
#

how do i persist network state between differnt scenes whilst using photon?

#

eg ; if i created a room in scene A but right after that my game is in scene 2 that i want the host to go to , how would that happen, as right now i get a null refernce excep pointing towards photonclient when i try to access name of room in scene 2

jade glacier
#

Probably Custom Properties are what you are looking for? @spring valley

#

are you changing from the master server to the game server though when you change scenes? Or just changing scenes mid game?

#

Be careful to use specific networking terms... phrases like "the host to go to" can mean a lot of things.

spring valley
#

Loadlevel(scene index)

#

It persists the network state

#

@jade glacier

jade glacier
#

People usually use Custom Properties for that. They aren't the most efficient (they transmit and store as strings), but if it isn't a high traffic value that should do the trick.

spring valley
#

What do you mean by high traffic value

jade glacier
#

Gets changed often

spring valley
#

It's usually just the network object right ?

jade glacier
#

like if its a player position, that would be a terrible use case.

spring valley
#

Could u gimme an example on why would we carry on same coordinates between 2 scenes?

jade glacier
#

Not sure what that use case consists of. But I would look into Custom Properties and see if they fit what you are trying to do.

spring valley
#

How do we achieve the custom properties?

jade glacier
sleek laurel
#

help my bullets are not killing other players even tho everything is done right

#

it works if i place a fake player in the scene

jade glacier
#

sure everything is done right? πŸ™‚

sleek laurel
#

well no, maybe i am spawning them wrong?

#

but idk

#

if i place a fake player in the scene and shoot it dies

jade glacier
#

Yeah, sounds like you have a bug there

sleek laurel
#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Photon.Pun;
using Photon.Realtime;

public class KilledMultiplayer : MonoBehaviourPunCallbacks {


    public Vector3[] spawnPositions;
    // Use this for initialization
    void Start ()
    {
        
    }
    
    // Update is called once per frame
    public void OnTriggerEnter(Collider other)
    {
        if (!photonView.IsMine)
        {
            return;
        }
        if ((other.tag == "enemybullet") || (other.tag == "grenade") || (other.tag == "grenadesandbox"))
        {
            transform.position = spawnPositions[Random.Range(0, spawnPositions.Length - 0)];
        }
    }
}
#

heres my script (the bullets have enemybullet tag on them) ^

jade glacier
#

I don't see any networking there

sleek laurel
#

idk i just found out how to do multiplayer yesterday

#

do u know a fix

jade glacier
#

I would start by completing to Getting Started tutorial

sleek laurel
#

i got player movement and stuff to work

#

and shooting

#

just this does not work

jade glacier
#

I don't know what this script is trying to do that would be networked.

#

"KilledMultiplayer" doesn't really give much of a hint of what the object is

sleek laurel
#

it should move the player to a position when hit by a bullet

#

or grenade

jade glacier
#

You don't really even have a starting point here, I would have to walk through the entire process of working out what your projectile is, how it is identified on the network, who has authority over it, and how it interacts with objects (though that part looks like with tags)

#

Someone else will have to help you, that is WAY more topic than I can give a quick answer on

sleek laurel
#

uh ok

elfin inlet
#

spawnPositions.Length - 0 you sure this shouldn't be spawnPositions.Length - 1 ?

sleek laurel
#

it works

#

Β―_(ツ)_/Β―

#

well

#

the spawnpos thing anyways

elfin inlet
#

oh wait

#

yeah ure right

sleek laurel
#

my bullet just goes through the other player and nothing happens

elfin inlet
#

the max value is excluded when working on integers

#

mb

sleek laurel
#

i need to fix this and idk how

#

@elfin inlet help plz idk what to do

elfin inlet
#

this does seem like more of a coding question

#

dont wanna flood here

shut oracle
#

It's funny, I had what I thought was a coding question and got sent here πŸ™‚

#

I'm looking for some help on photon webooks. I'm a complete unity noob, but I do have a working chat application that hits my BaseURL when someone signs in, although I'm completely lost on how to pass it anything other than hard coded parameters. Has anyone used photon webhooks before? I have some specific questions and I don't want to flood if no one has any idea what I'm talking about

#

The very short version is that I don't understand how to configure PathPublishMessage. The documentation doesn't explain what the term means or what a possible value could be

shut oracle
#

I see the settings, but don't know where to add the flag

lucid sable
#

anyone use mirror and know how to make a gameobject only visible to the client it was generated on?

shut yarrow
#

I never used Mirror but I suspect you shouldn't use functions in that framework to instantiate objects, instead use the regular Instantiate function

lucid sable
#

someone on the Mirror discord helped me sort it out. had to do with checking if (isLocalPlayer)

jade glacier
#

That is typically the incorrect answer, it just works in simple games. hasAuthority and IsLocalPlayer get confused regularly. @lucid sable

#

Be sure to know the difference when using Unet or Mirror

lucid sable
#

has authority has to do with whether or not whatever is doing something has authority, whereas islocalplayer is whether it is the local player

#

I only wanted it drawn for the local player, so I told it if (!isLocalPlayer) return in LateUpdate()

jade glacier
#

If it only applies to the Local Player object then should be fine.

lucid sable
#

yeah. it's a field of view/fog of war type deal

#

server doesn't need to know what the visible area of the player is I wouldn't think

#

at least I can't think of a situation off the top of my head

jade glacier
#

I'm not fully following your questions, but sounds like you have it sorted.

lucid sable
#

like that

#

but yeah I've got it sorted

shut yarrow
#

Can I just share I've rewritten my server with C++ and now memory use is stable and about 9 times less as with C#? πŸ˜›

#

I love C# but managing memory is such a pain in the back, for some reason I can't keep a stable memory use and it just keeps growing overtime, regardless of manually calling garbage collector

#

For example in C# the server used about 10 MB after starting, and after 2 days sitting idle it was 40 MB. With C++ after 2 days it's still around 1MB

#

Still need to figure out for my clients if they have this issue when being connected for longer periods, I suspect it's less of an issue because they deal with a lot less data than the server but having that sorted would be nice

jade glacier
#

You can make a memory allocator of your own in C# without having to go through that mess.

shut yarrow
#

Please enlighten me. I've done something fairly simple with a wrapper around the MemoryStream class which returns stream.ToArray() each time and I feel like that could be a problem because it just creates new arrays all the time that the garbage collector (in theory) has to pick up on

jade glacier
#

yeah, that is what ToArray does

shut yarrow
#

Ideally I'd have a single buffer and write my stuff to it and just reuse it but I find that a terrible workflow in C#

jade glacier
#

Which networking library?

shut yarrow
#

ENet

#

It has a C# wrapper which I use for the client and I use the native library for the server

jade glacier
#

No clue on that front, because you need to send it an arraysegment<byte> or a byte[] and a length

#

Depends on what the library can take, hopefully they have a buffer and length type available to you.

shut yarrow
#

I think the library itself isn't causing the problem, it's me messing it up

jade glacier
#

You have to look into the enet API for ways to pass data

shut yarrow
#

It returns you a byte array from the native library, I copy that to another buffer, then call a method which disposes of the data in the native library

jade glacier
#

No, you need a way to get a byte[] to it that is the wrong size, and a way to tell it how much of that to use.

#

If it only accepts a perfectly sized byte[], you will have to allocate.

#

But I suspect that is accepts different types of objects and wrappers.

shut yarrow
#

Well it tells me how many bytes are in the buffer though

jade glacier
#

Does it let you tell it what byte to start reading from and how many bytes to read?

#

Send(byte[] buffer, int offset, int bytes)

#

something along those lines

shut yarrow
#

I suspect it just uses a single internal buffer and it fills it, then returns you a pointer to it with the length of the data

#

But the wrapper takes care of the intrinsics, I'm just consuming some simple interface calls

jade glacier
#

I have nothing to tell you, other than you have to look at the enet API and see if there is a way to send a buffer with size info.

shut yarrow
#

It gives me info on size

jade glacier
#

Hopefully it has an overload or a method that accepts a buffer and some size info

#

you are misunderstanding I think then

#

you don't want a buffer size from it... you want to GIVE it a buffer size.

#

On the read side, it gets more complicated

#

unless it gives you a nonalloc method, its likely going to allocate a byte[] that is the exact size as the data that was in the packet.

shut yarrow
#

I think I can actually set the internal buffer size but I think that's not the issue

jade glacier
#

Either way, you have to see what the API gives you for send and rcv... if it lacks nonalloc options, you will have to modify enet to have them.

shut yarrow
#

I think all the serialization/deserialization what I'm doing is doing a number on the garbage

jade glacier
#

I have no idea.. without the API in front of me. All I can say is check the API for nonalloc options.

shut yarrow
#

It does have a way to assign a custom allocator, haven't looked into that though

jade glacier
#

If you can give it a non-alloc, you would want to send your backing byte[] from your MemoryStream

#

and a bytecount

shut yarrow
#

But it seems to dispose fine of the data it receives, the problem is on how I do things with my data after it is received

jade glacier
#

Not sure if MemoryStream will give you a ref to its backing data though

shut yarrow
#

Not sure either, I only know of the ToArray() function

jade glacier
#

GetBuffer()

#

it does

#

That will have all of the empty padding though

shut yarrow
#

Thanks I need to look into that then, hopefully that saves me from having to allocate new arrays each time and just use whatever already exists

jade glacier
#

So if you just send that, you will be sending a bunch of garbage.

shut yarrow
#

Ah that's not good

#

I feel like constantly fighting with C# to get it to behave nicely and not waste my memory -_-

jade glacier
#

Yup, that is the tradeoff with managed languages

shut yarrow
#

I can get away with doing server in C++ but for the client it's not an option

#

I will look into the custom allocator options and that GetBuffer function

azure nimbus
#

well. it is actually... the guys from uMMORPG have a transporter that add a guy in the middle, probably in c++ which actually does the server communication

#

so the c# client communicate with the c++ client, and the c++ communicates with the server

jade glacier
#

I doubt Vis2k is doing anything like that in C++

shut yarrow
#

So you mean the client does interop with a C++ plugin?

#

I totally want to prevent having to write all that myself πŸ˜„

jade glacier
#

What kind of game are you doing that is driving this much complexity?

shut yarrow
#

I'm using this wrapper because the guy who made it put a lot of time in it already and he knows better than me how to do these type of things

jade glacier
#

That sounds like a death spiral to me

#

Who's enet library?

shut yarrow
#

I'm pretty happy with it actually, it is not the cause of my memory problems

#

There's more sources to get it from, but I got mine from NXRightHere on github

jade glacier
#

if its NX's, it for sure has proper methods

shut yarrow
#

He made changes to the original C library so it's easier to wrap in a C# assembly

jade glacier
#

just use the GetBuffer, and pass it that and the used byte count

azure nimbus
#

sorry, maybe i misunderstood what booster was about

jade glacier
#

Not sure what he offers on the read side, I haven't looked at his enet implementation, or if it has a nonalloc method to use.

#

Are you on his discord server? @shut yarrow

shut yarrow
#

No I didn't even know he had one

#

But again, I'm quite sure my problems have to do with my lack of understanding how to manage memory in C#, it's not the wrapper that I'm using

#

I find that heaps easier with C++ because it's kind of how the entire language was intended to used, to do it yourself and then get a crash on the simplest of things if you mess up πŸ˜›

#

And surprisingly enough no crashes yet, no memory leaks yet

jade glacier
#

mixing your C++ and C# like that wouldn't be the path I would take.

shut yarrow
#

Just no idea what to do for the client, other than take your advice and look into th GetBuffer method

jade glacier
#

The reason he made a C# version is so that you could keep everything right inside of Unity without passing between libraries like that.

shut yarrow
#

It's not really mixed though, it's only on the server

jade glacier
#

If you can manage the complexity, go for it.

shut yarrow
#

Server uses the same library, but not the wrapper, just the native

jade glacier
#

The server has NO game logic?

#

Is it just a relay or something?

shut yarrow
#

Very little right now

#

No not just a relay but does very little as of yet than passing through messages

#

Just focusing now on making it as stable as I possibly can and also very simple to extend my future plans

#

Server receives packets, reads them, then calls a callback in a GameMode class which I use to do all game logic

#

I don't find this too complex, it's actually fairly simple

#

I'd dare say simpler than in C# πŸ˜„

#

Some things are little bit different, but the big advantage is I'm not fighting to keep memory use low and stable

#

Other than that it's exactly the same structure as the server I did in C#

#

Using the same library, but instead of the wrapper that interops with the native libary, I use the native library directly

#

If you look at the github you'll see how little documentation ENet has, because there's isn't much to it from a consumer's point of view

#

The wrapper uses a little less code to set up a server or a client because a lot is abstracted away, but using it is not that much different in practice

jade glacier
#

It likely matches the C+ api

shut yarrow
#

Yes it does

sterile void
#

Is unity network free?

gleaming prawn
#

what do you mean by Unity Networking? Unity has NO working library to offer for multiplayer... You need to use tools like Photon, Mirror, etc

#

And what do you mean by free?
That downloading and using the lib is free of charge, sure a few are... But that you will pay nothing to have a multiplayer game running, no so... You need to pay for servers (or at least relaying servers), unless you are doing just a LAN game.

kindred wave
#

PUN is free until a certain amount of users

gleaming prawn
#

Yes, but that's only enough for development or if you are doing something like a school project

#

Same goes for normcore, and other production-ready services

kindred wave
#

If it is more then a personal project or school project just pull the wallet

#

Easy as that

gleaming prawn
#

yep

#

That's why I asked what he meant by "free"

#

Free is deceiving... There's no such thing

kindred wave
#

We make large network based games and we use PUN

gleaming prawn
#

I work at Photon

kindred wave
#

Sick ^^

#

I work at M2H

gleaming prawn
#

I'm being super clear

kindred wave
#

We always use Photon

#

It is the best solution out there

gleaming prawn
#

Oh, awesome

#

I talked about Verdun here one of these days..:)

kindred wave
#

^^

#

My boss is a big brain networking guy

gleaming prawn
#

Mike?

kindred wave
#

Yeah

gleaming prawn
#

Great guy

kindred wave
#

I learned a shit ton from him

#

He is haha

#

I'm working on cross platform support atm

gleaming prawn
#

You guys use PUN for pretty much anything... I'm actually one of the devs of Quantum...

#

You'll bump into it at some point...

kindred wave
#

Mike wrote PUN I think

gleaming prawn
#

co-wrote some of it, yeah

kindred wave
#

We have a lot of internal tools and extensions

gleaming prawn
#

He and Tobias AFAIK

kindred wave
#

Can't imagine using anything else for networking tbh

gleaming prawn
#

You guys have a lot of success with it... But you can go beyond

#

But it all depends on what you want to do... And Among Us is here to show the same approach you guys use (full relay) is no roadblock for blockbuster success

kindred wave
#

^^

#

Weird how it blew up 2 years after release

gleaming prawn
#

2020 is a weird year

#

best explanation I could come up with...:)

kindred wave
#

Totally agree

gleaming prawn
#

It's a fun game though...

#

But from that to blockbuster, 2020

kindred wave
#

I think the devs had a hearth attack when it blew up like that

#

Make it 3D and you have an easy cash grab

#

Mechanics are easy af

#

Networking has nothing really complicated as well

#

xD

gleaming prawn
#

ye

dreamy fiber
#

Anyone here who uses the RestClient plugin for Unity who I can ask some questions ?

wooden fog
#

So I’m looking at this code here for downloading asset bundles. https://gist.github.com/yaeda/5410868 - so if I were to use a script to download an asset bundle with a scene and all of its resources and instantiate it would I then be able to just do LoadScene?

Gist

Unity AssetBundle Examples.
. GitHub Gist: instantly share code, notes, and snippets.

grand skiff
#

Hello i have 3 types of guns. They're different 3 gameObjects. We change gun by pressing 1, 2 or 3 and it activates the selected gun. I want other clients to see the activated gun.

#

I mean, how can i make other clients to see activate/disable events

weak plinth
#

Guys,I would like to ask a question about Photon Pun2 free version
What are the pros and cons of it?

jade glacier
#

WAY too vague a question really

grizzled narwhal
#

How does one do client input resimulation with velocity movement? Just store velocity at each move and use that? But what about drag?

jade glacier
#

That's not really how you set room properties. And you can't see them before joining the room, or get them after leaving the room like that.

#

Where are you getting that code sample from that is showing you to do it this way?

#

Whatever tutorial that is from, needs burning. :)

#

it looks like you are trying to set the rooms properties from outside of a room?

#

ah, it was set inside the room

#

I think you have to enable something to make properties visible outside

#

Jean talks about making properties visible to the lobby down that page it looks like.

#

that is really old though, so likely is talking about pun1

#

topic says pun2 though

#

so probably is relevant.

#

working now?

#

cool

#

KCP docs should describe what it does differently from standard rudp

grand skiff
#

Hello, how can i make other clients see if a gameObject disabled or active

jade glacier
#

by having the controller broadcast its state with an RPC or using IPunObservable

weak plinth
#

Hello everyone... I am planning to do a very basic Online Game.. a shotter one (I have made single player games before).

The problem is... I don't want to use PUN.. I want to make an Online game without PUN... and then I will use PHP and MySQL for backend stuff (login, etc)

Do you guys know a tutorial to make an Online game without PUN?

prime beacon
#

You can check mlapi/mirror

weak plinth
#

maybe mysql?

slim ridge
weak plinth
#

what about using uNet guys?

#

do you recommend me to use just uNet?

#

unet is deprecated

#

is deprecated but still works?

#

haven't bothered to find out. either way there is very little incentive to use unet over mlapi/mirror/photon services

weak plinth
#

welp i have another problem

#

so im trying to create rooms

#

and it gives no error

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

public class CreateRoomMenu : MonoBehaviourPunCallbacks
{
    [SerializeField]
    private Text _roomName;

    public void OnClick_CreateRoom()
    {
        if (!PhotonNetwork.IsConnected)
            return;

        RoomOptions options = new RoomOptions();
        options.MaxPlayers = 4;
        PhotonNetwork.JoinOrCreateRoom(_roomName.text, options, TypedLobby.Default);
    }

    public override void OnCreatedRoom()
    {
        print("Created room succesfully.");
    }

    public override void OnCreateRoomFailed(short returnCode, string message)
    {
        print("Room creation failed:" + message);
    }
}```
#
using System.Collections.Generic;
using UnityEngine;
using Photon.Pun;
using Photon.Realtime;

public class RoomListingsMenu : MonoBehaviourPunCallbacks
{
    [SerializeField]
    public RoomListing _roomListing;
    [SerializeField]
    public Transform _content;

    public override void OnRoomListUpdate(List<RoomInfo> roomList)
    {
        foreach (RoomInfo info in roomList)
        {
            RoomListing listing = Instantiate(_roomListing, _content);
            if (listing != null)
                listing.SetRoomInfo(info);

        }
    }
}```
#
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Photon.Pun;
using Photon.Realtime;

public class RoomListing : MonoBehaviour
{
    [SerializeField]
    private Text _text;

    public void SetRoomInfo(RoomInfo roomInfo)
    {
        _text.text = roomInfo.MaxPlayers + ", " + roomInfo.Name;
    }
}```
#

but it wont spawn public RoomListing _roomListing;

#

and i dont get why

#

any help?

shut yarrow
#

You should debug that foreach loop to see if it actually runs

#

Also this is a clusterfuck with 3 scripts having to do something with a room, it'll be more to the point to make it a single script

ivory mural
#

hi i use photon in my game
i have rooms with max players 4
if in room are 4 players, i can't join to room
how can i do, if all rooms are full, player will create room

#

?

shut yarrow
#

Retrieve RoomInfo array, go through all items and if all are full create a room

grizzled narwhal
#

@jade glacier I know how to do client input resimulation with fixed step movement (e.g using transform.Tranlate to apply movement). But this movement has many problems. I tested a non-resimulation velocity movement and thats much better but I can't seem to think of a way to do velocity movement resimulation?

feral valley
#

Hello guys, I have a question, what's a good place to start if I want to make my game multiplayer?
I have a main charracter with spells, controls, movement, all that
And I want to spawn a second such character for now
But form another client, and have them like this:

grizzled narwhal
#

@feral valley multiplayer games are totally different from ssingle player you will have to rewrite most of it

feral valley
#

mhm

#

Even stuff like gravity modifiers on objects

#

and movement from axis

#

and OnMouseDown()...?

#

Could you point me in the right direction as a total beginner?

#

I was looking at firebase, forge, photon...

jade glacier
#

@grizzled narwhal not really following the question sorry

grizzled narwhal
#

There are 2 types of movement: Fixed step e.g adding a vector to position every movement step. And velocity -> adding force to the rigidbody and moving that way. I know howw to make resimulation with fixed step (thats easy) but I don't know how to do it with velocity?

jade glacier
#

Physx isn't deterministic in a way friendly to that. But if you go that route you need a history of velocity states as part of your history and state from the server.

grizzled narwhal
#

yeah mhh

weak plinth
#

resim with velocity, like rewinding and stepping the physics simulation forward? could never get it working good in physx. there are lots of guides and examples out there though

jade glacier
#

It will never be 100% back in agreement,. Since you can't store the physx state.

ivory mural
#

hi i trying to join, or create room cs public void StartGame() { if (isConnected) JoinRoom(); System.Threading.Thread.Sleep(2000); if (!IsInGame) CreateRoom();
but i get an error

#

how can you avoid mistake

jade glacier
#

Don't do whatever you are trying to do there.

#

Are you following a tutorial?

ivory mural
#

no

#

so what should i do?

jade glacier
#

Follow a tutorial

ivory mural
#

ingeniously

jade glacier
#

If you can't make sense of the tutorial, you can also use the prototyping components that handle all of this. You can also look at them for their code.

brittle river
#

I'm investigating network layer options for my current project. Has anyone used MLAPI? Can you tell me if it supports clients connecting to multiple servers? Based on this documentation, I would assume not:
https://mlapi.network/wiki/networking-manager/

jade glacier
#

Typically people needing that kind of extreme use case will be very advanced and experienced network devs, and they typically will be rolling their own networking library for that. MLAPI is very similar to Unet HLAPI and Mirror. It is meant as a messaging layer and net entity management system for general use.

Trying to get some of these HLAPI libraries to do anything exotic often results in doing more work to make them conform than it would to just make your own.

jade glacier
#

This is why simulation is king, and you don't blur messaging with your state syncs

#

messaging <-> Tick Based State/Input Buffers <-> Simulation

#

applying messages directly to states will create all kinds of interesting race conditions and anti-deterministic outcomes.

jade glacier
#

Once all on a tick, apply events at the end of interpolation, rather than the start.

brittle river
#

@jade glacier Appreciate the response. Trying to avoid high-level and low-level. I just want something in-between to give me performance & not have to deal with some of the lower-level headaches of packet stacking & splitting, while also having UDP support with reliable & sequenced messages. I've been toying with the idea of using LiteNetLib, but want to know if you had any specific recommendations?

#

I want to completely avoid anything that uses reflection for their RPC handling πŸ˜†

#

I might just have to roll my own.

jade glacier
#

That is why tick based is better than time based.

grizzled narwhal
#

@weak plinth I can't even make it work close to decent but sadly fixed movement is hard without character controller

jade glacier
#

I'm not sure what you mean, but sounds like you have an idea of how you want it to work. @gaunt socket

azure nimbus
#

Hi, anyone here was any experience with GGPO + Unity?

full girder
#

Is there a way, to have LAN in a Unity game, without renting any extra servers or anything?

shut yarrow
#

Yeah, just set up a local server

full girder
#

do you know a good tutorial @shut yarrow

shut yarrow
#

It's quite a general question to be honest. If we're not just talking about the actual coding aspect of it, you should have a machine which can function as a local server the others in the same network can connect to. This can be as simple as doing port forwarding in the router and the clients connecting to that machine

full girder
#

woah

#

ok

shut yarrow
#

If you want to know more about the actual coding part, there is a lot of information to take in, and I suggest you either look into existing frameworks to do this, or search for TCP/UDP server and it'll lead you in the right direction

full girder
#

alright thanks

shut yarrow
#

No problem

#

@full girder there are actually some tutorials on doing this with C#, here is one you can check out https://www.youtube.com/watch?v=uh8XaC0Y5MA

In this first part of my C# networking tutorial series, we set up a TCP connection between a dedicated server and a Unity client.
If you get stuck or have questions, ask them on my Discord server: https://tomweiland.net/discord

Kevin Kaymak's channel: https://www.youtube.com/...

β–Ά Play video
#

It's quite informative

full girder
#

thanks. I intend on adding co-op on a game I have, once I fully finish it

shut yarrow
#

If you're new to this, try to look at as many sources as possible. There will be bad ones of course but you'll get a good understanding and see some parallels

full girder
#

yup

graceful zephyr
#

@azure nimbus i have a lot of experience with rollback netcode, but not specifically ggpo in unity... whats up?

inland lion
#

What's the best, most simple multiplayer method for a connect 4 game?

graceful zephyr
#

Photon PUN

#

@inland lion

sterile void
#

How to spawn an object (for me a bullet) without using a network identity on the camera I have?

jade glacier
#

@sterile void you might need to clarify that question.

azure nimbus
#

@graceful zephyr, A friend of mine is asked me to integrate GGPO in his fight game. however, GGPO seems to be windows only. He is mainly targeting Switch.

graceful zephyr
#

have fun πŸ˜„

#

GGPO is just a very small

#

wrapper

#

around predict/rollback logic

#

for you to hook into

#

if the game wasnt made to be deterministic and predict/rollback

#

it's.. well, a lot of work

azure nimbus
#

I know that will be a lot of refactoring

sterile void
#

@sterile void you might need to clarify that question.
@jade glacier
Ok so I have a player with a camera attached as a child.
The problem is: I want to make a FPS multiplayer game, but I use physical bullets, so I want to spawn those bullets. The problem is I use the bullet script on my camera and for spawning I need to use [command] function and so to add a network identity to the camera, but te player already has a network identity so there is a bug...

graceful zephyr
#

if the game was just built in unity, like normal unity SP game?

#

it's a complete re-write

#

for make it fully deterministc predict/rollback

#

usually

#

havent seen the game ofc, but that's just speaking from experience

azure nimbus
#

I normally use an ECS approach. which make everything easier. however, I do believe that he code everything in plain unity

sterile void
#

@jade glacier nevermind, i will replace the script in the player and use the position and rotation of the camera for spawning

graceful zephyr
#

@azure nimbus yeah... idk what to say πŸ˜„

#

so do u have a question?

#

around GGPO

azure nimbus
#

it is indeed windows only?

graceful zephyr
#

its native C/C++ i think?

#

u should be able to port it

#

just yeah u might need to modify it

#

ofc

lusty crow
#

there are some docs in the official github repo, afaik ggpo is only for windows,

but james is working on backroll which is basically a rollback implementation for c#/unity

#

not sure how far he is with that though

azure nimbus
#

GGPO has so hard dependence with vcruntime...

jade glacier
#

Yeah, don't try nesting network identities. Command in Mirror sucks, so you will have to get messy with your setup @sterile void

graceful zephyr
#

@azure nimbus it can probably be separated

lusty crow
#

also, to make your game compatible to ggpo, the simulation should be deterministic, be able to simulate multiple logical frames in a single visual frame,
be able to save complete game state and restore game state from a save state,
and.. I think those are the main requirements

#

there are certain methods for ggpo you need to hook up to and those are some of the things you have to fulfil for it

#

I haven't really been here recently, have you seen james recently fholm?
I'm sure he knows things about ggpo

graceful zephyr
#

no i haven't actually

#

but i've been away for a month or so also

lusty crow
#

ah I see

graceful zephyr
#

from this corner of the internet πŸ˜„

#

but even then the hard part isnt GGPO, the hard part ismaking a game that can do what GGPO needs u to do

lusty crow
#

have been leaving ecs kinda, but actually before I finished to implement what I wanted πŸ˜…
as I understood it, ggpo is handling transport of packages, connections, detecting when states are out of sync and some primitive input prediction I think - not sure about the later.
but all else to set up for it has done in the game code custom to your game

graceful zephyr
#

ggpo just has the basic plumbing for predict-rollback, input prediction, etc.

#

that's about it

#

and it has stubs for socket plumbing afaik

azure nimbus
#

@graceful zephyr , so, your suggestion is to open the GGPO source up and remove the vcruntime dependence?

@lusty crow, I did read about it. like was telling fholm, I use a ECS approach there how the data is apart from render. so I can execute the systems many times and then run the render. so at first sight it could fit GGPO requeriments...

lusty crow
#

when I first had the idea to implement rollback netcode, it was basically a completely rewrite of my game ^^

graceful zephyr
#

@azure nimbus i mean if you want to implement GGPO... the first place to look would be GGPO source code and see what needs to be done to make it work for you

#

that seems like a logical first step πŸ˜„

azure nimbus
#

I just unsure if GGPO is the right rollback for my friend, since it has some dependence with windows only stuff

graceful zephyr
#

there's not many other options

azure nimbus
#

would you guys suggest some other rollback lib to make things easier?

graceful zephyr
#

you can make it from scratch ofc

#

there is none afaik

lusty crow
#

apparently it is conveniently possible to just make a snapshot from all relevant entities in an ecs world?

what you want to do sounds exactly like what james was working on for his rewrite of the smash-like game fantasy crescendo where he was testing out his library https://github.com/HouraiTeahouse/Backroll

not sure if he is still on this server though, I checked the names, but there is nobody that stands out to me as him

azure nimbus
#

I hear about crescendo before...

#

Maybe I can contact him...

graceful zephyr
#

FWIW i am the lead/inventor of photon quantum, its the only commerically available predict-rollback i know of

#

but its not free/open source ofc

lusty crow
#

oh nevermind, he is still a member of this server, james7132
not sure why I didn't find him before

#

but his last message was on the ... 8th of september?

#

here

azure nimbus
#

yeah, by a quick peek in the backroll repo, definitely he is ahead of me and already faced that I'm facing right now!

#

@graceful zephyr I image that you are photon related due your role and suggestion.
Well, I'm open to use a commercial asset. I will check about photon quantum.

my friend have a hard deadline for the February. If he will need to rewrite everything, the soon the better

#

@lusty crow, I may leave him a message.

graceful zephyr
#

correct

#

like i said lead dev on photon quantum

azure nimbus
#

the plain unity approach is such a pain for online games

#

@lusty crow, why you are leaving ECS?

lusty crow
#

I'd be interested too how his rollback ecs adventures went and what he's working on now.

it depends, but.. what's certainly true is that for a network game compatible architecture, it is much better to think at it from the very first minute of development and align architecture decisions towards it, but that also requires prior knowledge of it.

I think it is often unavoidable to have rewrites or iterations while being in the process or learning how something works

#

I mainly wanted to revisit something I have done in 2018,, a bullet hell game, and thought ecs was perfect for that use case.
With implementing ecs physics to a bullet hell game but.. I kinda lost motivation.

all I had left was to to make job compatible animation curves which I already had in the old bullethell game, (but it works differently know, as you can use blob assets for things like these now), and make some levels.

ebon thorn
#

Hello there,
I have a quick question.

I am planning on making a fps game with 32 - 64ish player multiplayer support.

I want to get started learning networking and would like to know where to get started.
What would be the best recommended netcode solution for my application ?

jade glacier
#

If you haven't completed several smaller networked games, I would consider doing that first. 32 to 64 players creates all kinds of difficulties you don't want while learning networking.

obsidian summit
#

I've got a small problem (using photon 2 btw). I got 2 players, both can enter a room and start up a game. When they are in the game, and one of them disconnects, it's not their own character that gets destroyed, but the other player's. So player 1 leaves, and player 2's character gets destroyed, so then player 2 gets ownership of player 1's character. I really don't know why this happens

#

also, every client only has ownership of their own character

#

nevermind, fixed

grand elm
#

Hello, could someone tell me how I can start making a server for unity?

jade glacier
#

Mirror is usually people's first step in that direction @grand elm

grand elm
#

I'm really very new and I don't know what that mirror is

#

In our course they tell us that we have to learn on our own

jade glacier
#

Look for Mirror on the asset store, they include links to their discord and such there.

grand elm
jade glacier
#

Yup

hollow pike
#

Where should I start looking for hot to make a UDP server that doesn't block on receiving packets?

jade glacier
#

That will just be based on your transport choice and settings.

hollow pike
#

I meant client, but it seems to be easy to use for that purpose as well?

jade glacier
#

What is easy to use?

hollow pike
#

mirror

jade glacier
#

Easy is all relative - not sure the context.

#

But you should try it.

weak plinth
#

UNet will be deprecated, is UnityWebRequest part of UNet?

spring crane
weak plinth
#

Thank you @spring crane

inland lion
#

how can i set maximum amount of players in a room with PUN 2

#

found it

#

does this make the maximum amount of players 2? im asking because MaxPlayers is of type byte

jovial rapids
#

byte can hold values up to 255

frank quiver
#

does this make the maximum amount of players 2? im asking because MaxPlayers is of type byte
@inland lion ya

jade glacier
#

You won't get anywhere near 255 players connected to a room though, even with a simple game that would add up to a brutal amount of data per second.

inland lion
#

I only need 2 anyway

#

It's a connect 4 game

#

Doesn't have more than 2 ppl per 'room'

versed rock
#

Hi dudes, i'm want to create a similar game like heartstone, what is the best choise for online part? i mean, what is the best framework for create games to fight 1vs1 with players?

lusty crow
#

if you want to have it competitive, you probably want to have an authoritative server that keeps tracks of games/game states to prevent cheating or at least to make it harder,

requirements seem to be 1vs1, and latency is usually not a big issue with card games, so it is okay when messages are a bit delays - meaning you don't usually need prediction logic, you just apply the effects or data the server sents to you when you get it.

I'm not sure about the best choice, but Mirror would certainly be capable of that.

you should also ask yourself if it should be possible to completely run the simulation on the server side, using only inputs from the clients, and if so, how to do it.

https://blogs.unity3d.com/2020/09/08/choosing-the-right-netcode-for-your-game/

versed rock
#

thanks!

foggy tapir
#

hey ..
there is an ANR ..
What is the solution.. help me
ANR "Input dispatching timed out (Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago. Wait queue length: 4. Wait queue head age: 5604.6ms.) com.unity3d.player.UnityPlayerActivity"

pliant marten
#

Hey I'm new to networking in Unity.

I've setup a NodeJS back-end which has endpoints
/auth/me <= returns te player

Now I am at a points where I do so many requests at different layers and points (hopefully not more than 10 requests, but I need to take action ASAP!)
What is the best way to manage routes and requests? I use IEnumerator in my requests, dunno if that is how it should be?

#

is there any tutorial or anything I can read? Because I can't find anything useful

silver steeple
#

then it's like

var req = service.Echo();
yield return req.Run();
Debug.Log(req.success.contentOfRequest);
#

@pliant marten let me know if you need any help using the tool

pliant marten
#

then it's like

var req = service.Echo();
yield return req.Run();
Debug.Log(req.success.contentOfRequest);

@silver steeple damn this is actually very nice!

silver steeple
#

tyty!

#

Dealt with my fair share of networking in unity

somber drum
#

Im confused with this whole unity networking business, fall guy uses it if I'm not mistaken is it pretty much aimed at higher ranking studios only?

#

Whenever there's an "inquire" option its never a good sign for indies.

#

**"multiplay"

#

Does not seem to be much information out there

slim ridge
#

pun2/mirror

jade glacier
#

If you are just starting up, Pun2 and Mirror are the usual starting points

dreamy mesa
#

This is the game I really want to work on right now.

#

Does anyone want to help me/know which direction I should start? map layout, recruitment?

#

I have one friend who can sorta help with programing, but I'm free every Monday-Wednsday

#

You Can DM me about it

#

I even plan on making a group chat

#

I look forward to anyone wanting to help, and greatly appreciate it

weak plinth
#

Not that kind of networking

silver steeple
#

lol

prime beacon
#

xD

dreamy mesa
#

ah.

#

I see

#

does anyone know where I should post my help?

slim ridge
#

Unity Connect

dreamy mesa
#

Thank you

#

Thank you guys so much

glossy mural
#

idk if this is the right chat to ask this question but oh well does anyone know any good server hosting for multiplayer games

mellow beacon
#

Amazon

merry star
#

Hi all, I'm new here. Can I post questions about Mirror (Networking) here?

spring crane
#

Yes, but you'll probably get better help in the Mirror Discord server.

merry star
#

I didn't know they have that. Thanks. Mine might be a more general question.
So I want to have an event system that handles a player dealing damage to another player.
I used a singleton class called GameEvents, and when a bullet collides with a player, it calls
GameEvents.current.Damage(........)
I'm just confused as to should I make my GameEvents object networked?

red nexus
#

im new to all this so

#

i dont know whats wrong i just get this

#

Assets\NetWorkManager.cs(35,35): error CS1002: ; expected

shut yarrow
#

You forgot ;

#

Line 37

red nexus
#

ok

#

will that fix everything?

shut yarrow
#

It will fix the error you have now

red nexus
#

im confused

#

i did that

#

and retried it and i got

shut yarrow
#

You also made same mistake on line 22

red nexus
#

O

#

oh

#

can you tell me what it is

#

this is kinda my first time doing stuff like this so its a little hard for me

shut yarrow
#

I already told you

#

You're ending a line of code and forget to end it with ;

silver steeple
#

@red nexus you might be better off in learning about general programming before moving on to networking.

red nexus
#

😒

silver steeple
#

You can do it! no need to cry πŸ˜„

shut yarrow
#

He means no offense but you're in for a world of pain trying to do this when you have problems with the basics

red nexus
#

i have been watching youtube videos on this doing what they do and trying to learn but i dont understand how its wrong

shut yarrow
#

That tutorial is still above your current level of understanding

red nexus
#

why is this stuff so hard

shut yarrow
#

It's not but you're trying to run before learning how to crawl and then walk

red nexus
#

but if i do exactly what the tutorial says then the code should be right

#

correct?

shut yarrow
#

Yeah but you aren't doing that really because you forget things like a semicolon at the end of a line πŸ˜›

#

It's a small detail but it doesn't mean it's not important to know

red nexus
#

yea im just really excited for what im doing

shut yarrow
#

I understand but even if you get it to work you have no idea why it works, and if it doesn't work, you have no idea how to fix it either

#

That's why trying to do networking is a bad idea to begin with

red nexus
#

i fixed somethings

#

and now im stuck again

#

and i just need help on how to do it

#

i just want to know how to fix them

#

Assets\NetWorkManager.cs(26,21): error CS1061: 'RoomOptions' does not contain a definition for 'MaxPLayers' and no accessible extension method 'MaxPLayers' accepting a first argument of type 'RoomOptions' could be found (are you missing a using directive or an assembly reference?)

#

i now get that

shut yarrow
#

You spelled this wrong MaxPLayers

red nexus
#

is that it?

#

oh

shut yarrow
#

Yeah

red nexus
#

bruh

#

im dumb

sinful monolith
#

Anyone using steamworks for matchmaking? I have it working if I apply no room filters but if I apply AddRequestLobbyListNearValueFilter I get zero results.

#

Wondering if anyone has any examples of use for it I think I’m doing it right. I apply lobby data on the host. Then in client I’m applying the request before attempting to search. Only thing that stands out to me is when you assign lobby data the data is required to be a string by steamworks.net but the filter uses an int (I am assuming it is converted by steam?)

#

SetLobbyData
bool SetLobbyData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ); (C++ version from steam) also shows it using a string

grand skiff
#

Hello, how to get another player's ID?

jade glacier
#

Pun1 or Pun2?

#

Pun2 typically it is PhotonNetwork.LocalPlayer.ActorId or something similar to that. @grand skiff

grand skiff
#

PUN1

jade glacier
#

Not sure about Pun1

grand skiff
#

😦

#

Thanks anyway

jade glacier
#

Probably asked this before... but why are you using Pun1 for new development?

grand skiff
#

I do not know actually, i was starting to make my game with PUN2 but i got an error (couldn't fix). I removed everything then i downloaded PUN1, there was no error.

#

Fixed it

#

how can i know if a player is joined in PUN1

stiff ridge
#

Use PUN 2 πŸ˜‰

#

PUN Classic is in maintenance. It will not get any features and likely won't get updated for the next Unity Editor versions either...

#

When you get errors, read them carefully. Ours are written to tell you what to do. Else, post it here and see if this can be sorted.

grand skiff
#

I swear i will use PUN2 in my next game πŸ˜„
Or i will just remove PUN and replace it with PUN2

jade glacier
#

You will also get better help, since Pun2 is what most others in discord will be using and be familiar with. Myself included.

summer bobcat
grand skiff
#

i'm not sure i will do it now. If i cannot fix this little bug with PUN, i will go to PUN2

silver steeple
#

isn't PUN1 depreciated? Or is that something else

#

oh I should read messages. Ignore me

jade glacier
#

It is basically in LTS... but the Unity Asset Store doesn't really allow you to post assets with that kind of finesse. It just is there and public, or it is not.

wispy thorn
#

Looking for network solution to making real time online multiplayer games. So far I'm looking over:
Photon: Quantum
Photon: Bolt
Heroic: Labs

Any recommendations of other potential candidates?

prime beacon
#

Photon pun/mlapi/mirror

jade glacier
#

Quantum is aimed at funded studios, so it costs a bit to get into and isn't really for hobbyists at the moment. But for funded projects should be the first platform investigated. It isn't a fit for everything, but if it is a fit, it is the hands down winner in most areas.

Past that, largely you should try tutorials for Pun2, Mirror/MLAPI, and Bolt to get a sense of what the architecture and hosting implications are for each.

wispy thorn
#

Thanks for the advice. There wouldn't be a site that compared the bunch, would there?

jade glacier
#

None that don't get them all wildly wrong.

wispy thorn
#

@jade glacier good to know

inland lion
#

Looking for network solution to making real time online multiplayer games. So far I'm looking over:
Photon: Quantum
Photon: Bolt
Heroic: Labs

Any recommendations of other potential candidates?
@wispy thorn spatialOS

weak plinth
#

what is photon quantum

obsidian wraith
#

@weak plinth quantum is the deterministic plugin of photon. Uses a lot of custom stuff (like physics) because unity is not quite deterministic.

weak plinth
#

ok thank you

sterile void
#

Hi! So I’m currently trying to make a physical bullet with Unet but my problem is that the bullet move too fast and go mostly trough the enemy player...
Setting the rigidbody to continuous works, but not with networked player, so is there a good way to make the player detect when he is hitted everytime, and to stop the bullet going through the player?

high night
#

@sterile void How do you actually handle the bullet?

slim ridge
#

with Unet problem 1
your client needs to predict the hit using continuous collision detection or the server needs to tell the players when they got hit

#

or whichever client has "authority" tells the other client they got hit

worldly cedar
#

Hey all, with Unity Web Request, if i had something like ```cs
IEnumerator Request () {
using (UnityWebRequest www = UnityWebRequest.Get(url) {
yield return www.SendWebRequest();
}
}

#

Are you able to resend that request?

#

(within the same scope i mean sorry)

#

so,

IEnumerator Request () {
  using (UnityWebRequest www = UnityWebRequest.Get(url) {
    yield return www.SendWebRequest();
    yield return www.SendWebRequest();
  }
}```
sterile void
#

@sterile void How do you actually handle the bullet?
@B.A.R.G.O.S#0973 So I’m currently spawning my bullet (with has identity and transform sync) the bullet move were I’m currently aiming, but because I want to simulate bullet drop, I can’t use raycast for applying damage...
So I decided to use collision between the bullet and the enemy player(the player has identity and transform sync) my problem is 90% of the time, the bullet go trough the enemy player even if the bullet has rigidbody set to continuous.
So what can I do if I want to apply damage with physical bullet? Or how can I make the bullet detect correctly the enemy player?

sterile void
#

@high night So I handle the bullet by using raycast and raycasthit. In my LateUpdate method, raycast verify I’m hitting something, if yes, I set the target to the hit point, else I detect the ray.point(1000) and set the target at this point.All the information about the target are in a vector variable.
Then, I use command to Instantiate then spawn the bullet. Then I make the bullet go towards the target (with physics).
My bullet has a sphere collider, a rigidbody set to continuous, a network identity and a network Transform set to sync rigidbody3d.

high night
#

@sterile void You should just sync the health and bullet hit visual effects from server

#

dont let client modify health and visual effects

sterile void
#

@sterile void You should just sync the health and bullet hit visual effects from server
@B.A.R.G.O.S#0973 I know, I’m doing that, nothing changes...

inland lion
#

What is your guys' opinion on spatialOS

high night
#

@sterile void You wont expect or accept OnCollisionEnter or aything to trigger in client
Client wont care about collisions and physics, disable physcis if you want or set kinematic

#

Client will only spawn hit effect when server tells it to

jade glacier
#

Typically for state transfer, as BARGOS is saying - you will set all objects that are not the authority version to be kinematic. Trying to replicate physics will devolve into an unmanageable mess.

You only simulate physics on the authority server or client - then you broadcast the transform state to others.

jade glacier
#

The exception being any place you do client prediction. For example each player likely will simulate their player locally immediately, and the server will apply the same inputs and simulate it as well, and the server sends out the resulting state. But for most objects all clients are just lerping between previous state snapshots - rather than trying to replicate physics.

azure mango
#

Hello! What is being used in Unity for multiplayer right now? Since Unet is deprecated

jade glacier
#

Just scroll up a bit, that gets asked a dozen times a day here @azure mango

azure mango
#

Yeah, but I was asking if there is anything "oficial" or that Unity supports

jade glacier
#

NETCODE is their only official project, but it is experimental at best.

jade glacier
#

The transport that uses is also available, and not reliant on DOTS like NETCODE is. But I have no idea since I haven't played with any of that.

azure mango
#

I will give it a look. Thanks!

jade glacier
#

I wouldn't rely on "official" as being a good thing when it comes to networking. Unity has a horrific track record with its networking solutions.

azure mango
#

So it would be better using something like Mirror, Photon etc?

jade glacier
#

I don't recommend anything, since I work on one of said libraries. I do recommend scrolling up and reviewing the chat history on the topic though. It comes up often.

azure mango
#

Okey, thanks anyways

orchid ore
#

Can someone suggest a good mirror tutorial?

#

One which explains how to synce movement , shooting , etc properly among all clients?

jade glacier
#

I would start in the Mirror discord channel

#

Far more Mirror specific discussion there

left knoll
#

So I am confused, what's the correct way to do networking in Unity in 2020? Do I need a Unity Package? Should I just use .NET?
I want to try out a simple exercise for now, simply join in a Scene along with another player and move around together

jade glacier
#

Scroll up @left knoll that question comes up every few hours.

left knoll
#

So HLAPI is the new way

#

unet is the deprecated one

#

and I don't really wanna touch DOTS lol

prime beacon
#

Photon/mlapi/mirror

#

Depends on what you want

left knoll
#

Just to start networking with a simple example

#

All the examples I've found so far is "make X-complicated game using some specific third party library"

#

I don't want a MMO, I guess maybe the best I could describe it is "Among Us/FallGuys" networking capabilities

#

join a room with 5-10 players, have them broadcast around their coordinates and actions with a server, that's it

prime beacon
#

Check out photon pun

#

Should be easiest one

shut yarrow
#

You haven't really look well then because you would've found photon pun as most likely answer

left knoll
#

There's a million answers and videos from all the years out there. Like the Brackeys one is using the UNet

#

I was so confused because I thought Unity would have a built-in system, but most people I've asked told me to not use the Unity networking as it's not ready or something

prime beacon
#

Its deprecated

#

Photon pun come with an example scene

#

You can move around and fire

shut yarrow
#

Yeah it sucks but pun has been filling that gap for many years, it's probably most easy solution for beginners who just want to try things out with not too many features

left knoll
#

And like, say I use Photon, how crossplatform would that be? Would at least do Windows and Android? I am assuming consoles are an entire new beast with networking

inland stag
#

Unity does not have a working networking solution right now.
For researching, I suggest looking at all of the available solutions and seeing what each of them offer.
Photon PUN is a good choice though.

shut yarrow
#

Not sure but I think they also have android support but you might have to pay for that

prime beacon
#

Pun support all platforms afaik

shut yarrow
#

But since pun is basically free while you're developing there's not much to lose

left knoll
shut yarrow
#

Yes

inland stag
#

Also, if you read the description of the asset, it mentions cross-platform support.

#

Same with their official website.

left knoll
#

Ahhh nice

#

I am also looking at the 2021 Unity roadmap and seems a new stable Networking is planned for then

shut yarrow
#

Don't hold your breath on it

left knoll
#

Yeah, roadmaps can change

inland stag
#

⬆️ Also, networking requirements are specific to each game and there will never be one library that works for everything.

left knoll
#

Oh yeah, and not to mention platforms

prime beacon
#

Its 2020 and Unity still dont have decent networking

#

I hope next one will be good

shut yarrow
#

Yeah and like mentioned before, Unity has a terrible track record of networking features and they start something new just to drop it like a rock and then promise to do better somewhere in the future

#

Wouldn't be the first time for Unity to half ass a feature

prime beacon
#

Yes lol

left knoll
#

Well one huge issue I had with Unity was Input and they did a pretty decent job with the Input System

shut yarrow
#

In their defense that's quite a fundamental piece of a game engine but networking always has been weak from their side and it looks more like a marketing move to get more people to jump on board when they offer it

left knoll
#

As evidenced by the success of games like Mediatonic’s Fall Guys: Ultimate Knockout, great multiplayer games are possible in Unity today, and we will keep making it easier.
Hehe

#

Oh uh, Photon requires an account.. for what?

shut yarrow
#

To obtain an Application ID

prime beacon
#

Its a paid service

#

20 CCU is free tho

left knoll
#

Oh.

#

Are there any other libraries that don't require Signup? Maybe Mirror?

jade glacier
#

Mirror and mlapi work like Unet HLAPI. No account needed since there is no relay or matchmaking. You will eventually have to sort out how to host though.

left knoll
#

I see

opaque dew
#

@left knoll saw you mentioning tutorials and that you might be using Mirror. Here's a really extensive resource. https://trello.com/b/x67wL4kH/firstgeargames-mirror-tutorials
Over 20 tutorials, several assets, and even some projects

left knoll
#

Oh damn, thank you!

humble dew
#

Hey i got issue in photon when in room have only 1 player than all works fine but when 2nd player comes to room then joystick wont work is there any solution ?

jade glacier
#

Be sure to disable all controller code when photoView.IsMine == false @humble dew

weak plinth
#

I have a problem so i am using pun2 and i have an object that has a photonview ect to be able to see it online but i dont want it on a certain child of that object so it will only show locally but i have no idea how to do this can any1 help?

inland lion
#

im trying to add multiplayer to my connect 4 game using PUN2, and i have rooms of maximum 2 players, whenever a player joins a room, he has the option to ready up, but the ready up method is on an instantiated prefab, and it gives me this error:

#

i also have visuals for when a player readies up

#

the outer circle should light up when pressing Ready Up but it doesnt because of the error

sleek laurel
#

so in my game when i kill the other player, they get teleported (they die) to me (temporarily) but nothing happens for the other player

#

any help?

#

i am using a raycast shooting system and health

weak plinth
#

Guys,does MLAPI have player restrictions?

jade glacier
#

Probably not in the sense of how many connections can be made with the various transports. But you likely will hit some CPU and bandwidth issues sooner than you are hoping.

weak plinth
#

Probably not in the sense of how many connections can be made with the various transports. But you likely will hit some CPU and bandwidth issues sooner than you are hoping.
About the CPU,how can this be improved?

jade glacier
#

@weak plinth No answer for that. You have to see where the bottleneck forms.

#

but once you get past 16 connections to a server you have to start being more and more careful. Doubling the player count exponentially increases the workload for most systems.

woeful badge
#

Networking newbie here.
What tools would you guys recommend I use for a small multiplayer games?
I'm looking to include basic Leaderboard and Text Chat System.

I've had a look at Mirror on in the Asset Store, and I've heard about Vivox, which allows up to 5000 players.

weak plinth
#

but once you get past 16 connections to a server you have to start being more and more careful. Doubling the player count exponentially increases the workload for most systems.
It is written that MLAPI can safely hold 64 players

shut yarrow
#

@woeful badge what do you consider a small multiplayer game? Never heard of Vivox, but it's not very likely you're going to have 5000 players on a single server anyway so that is kind of meaningless tbh

#

To me sounds like your best bet is to start with photon unity networking (look it up in the asset store)

woeful badge
#

@shut yarrow Thank you for the response.
Sorry, I meant that Vivox allows up to 5000 players for free on the server at a time, over multiple active games.

I only want something like 10 players per "room" really.
I will have a look at Photon, if it's free.

Only looking for something to use in small test projects like game jams or doing proof of concepts.

shut yarrow
#

Photon is free for up to 20 concurrent users spread over different rooms. So you could have for example 10 rooms with 2 players each and then you've reached the limit of the free plan

#

For testing it is quite good

woeful badge
#

Awesome, thanks πŸ™‚
I will check it out later tonight

spring crane
#

@weak plinth Is it written on the Unity blog post or on MLAPI's documentation?

#

Better ask on the MLAPI's discord server.

weak plinth
#

I have a problem so i am using pun2 and i have an object that has a photonview ect to be able to see it online but i dont want it on a certain child of that object. I want it so it will only show locally but i have no idea how to do this can any1 help?

stray sedge
#

How do you guys go about testing multiplayer games on a single computer? Not being able to open 2 editors for the same project is pretty limiting, and having to build and run every time takes time and doesn't give you easy access to things like the console.

still hare
#

I just build it, which is annoying. I wish that Unity had that one Unreal feature that duplicates the editor game window for testing multiplayer. There was some old editor extension for it, but I don't think it works anymore on newer versions of Unity

frank quiver
#

@stray sedge think you can try the plugin I posted above

stray sedge
#

@frank quiver Thanks, I had actually been using that, but randomly it started throwing errors. I get an error:
APIUpdater encountered some issues and was not able to finish.

Some stuff about not being able to find temp files... and then a dozen errors such as this:
Library/PackageCache/com.unity.inputsystem@1.0.0/InputSystem/Editor/AssetImporter/InputActionImporter.cs(24,42): error CS0246: The type or namespace name 'ScriptedImporter' could not be found (are you missing a using directive or an assembly reference?)

Seems like it doesn't like the InputSystem package, but I don't know how to fix it

#

And this is only for the cloned editor

weak plinth
#

@weak plinth Is it written on the Unity blog post or on MLAPI's documentation?
@spring crane no,sort Of

#

Mlapi - Recommended for - ~64 players

weak plinth
#

I have a problem so i am using pun2 and i have an object that has a photonview ect to be able to see it online but i dont want it on a certain child of that object. I want it so it will only show locally but i have no idea how to do this can any1 help?

jade glacier
#

Pun2 has titles with 64 players and that lists 2-8. That chart and the page it is from are considered a joke among net devs. All of the net options can handle 64 connections. The article is heavily biased toward MLAPI, likely because Unity hired its dev.

#

Having 64 players connect isn't the problem for any transport. The problems come with how much network data 64 players can produce without careful planning, and the CPU costs of schemes required to cull and compress serialization. 64+ requires more skill and knowledge on the devs part.

fallen frigate
#

is anyone here experienced and can help me with multiplayer game with photon pun

#

you can dm me

jade glacier
#

Likely not going to get any help that way. Best to just post your question in the channel and see if anyone has an answer. @fallen frigate

lunar plinth
#

here is my code ``` void Update()
{
if (photonView.IsMine)
{
if (Input.GetMouseButtonDown(0))
{
photonView.RPC("RPC_ShootGUN", RpcTarget.All);
}
}
}

[PunRPC]
void RPC_ShootGUN()
{
    RaycastHit2D hitInfo = Physics2D.Raycast(shootpoint.position, shootpoint.right);

    if (hitInfo)
    {
        Debug.DrawLine(shootpoint.position, hitInfo.point, Color.white, 2.5f);
        Debug.Log(hitInfo.transform.gameObject.tag);
        if (hitInfo.transform.gameObject.tag == "Player")
        {
            hitInfo.transform.gameObject.GetComponent<Health>().damage(damage);
            Debug.Log("damaged");
        }
    }
}```
jade glacier
#

What class are you putting this in? and is this class on the root of an object that has a PhotonView?

#

@lunar plinth

lunar plinth
#

oh wait

#

i forgot photonview

#

b r u h

#

well that worked

#

thanks

#

but now another question how can i know which player is which count

#

like how do i know how player one is player one

#

i need it for score system

jade glacier
#

Every connection gets an Player objects, which have an ActorId

#

PhotonNetwork.PlayerList gets you active players

lunar plinth
#

but how can i know which player controls which player

#

i mean how do i know who controls actual model

jade glacier
#

You are confusing your terms I think

#

Player = connection

#

Your Player as you are describing likely means some PhotonView Prefab you instantiate that is the player avatar

lunar plinth
#

i mean i want to check who killed who. I'm really new to all of this tho

jade glacier
#

There is no intrinsic connection between the Player (actor/connection) and any particular object.

#

Every PhotonView has a creator, an owner, and a controller.

#

If a PV gameobject kills another gameobject.. then you would look at their PhotonView.Owner

#

Players can own 0-X number of PhotonViews

#

So there is no "Player game object" unless you define one yourself.

lunar plinth
#

i just can't wrap my head around it

jade glacier
#

Keep at it

#

just realize that player and player objects are not the same

#

Player represents the connection, not a game object.

#

Every gameobject with a PhotonView can have an owner though.