#archived-networking

1 messages ยท Page 58 of 1

solar garden
#

@jade glacier

jade glacier
#

You can do anything you want, this is programming

#

Doing it on the main scene just means you have to be careful

#

New dots stuff is going to change the whole physics workflow anyway

solar garden
#

terrific

graceful zephyr
#

The new dots netcode implements a basic version of all this already @solar garden

#

So you can just use that

faint fern
#

@graceful zephyr have you been liking the new netcode?

graceful zephyr
#

Eh

#

Its okey

#

Too early to tell

faint fern
#

I think I want to do a tutorial on it.

#

I think that would force me to really over think it.

graceful zephyr
#

Like, its okey. Is my take so far on it

#

Read through the whole codebase line by line

#

Its missing a lot of features

faint fern
#

Say on

graceful zephyr
#

Not a fan of the codegen, the rpc system is cumbersome, the delta compression I think is going to use too much CPU to scale well for dedicated servers that can use 1-2 cores only and still be able to host something like a fortnite

#

@faint fern

faint fern
#

The biggest complaint that we had at the start of Unet was that it wasn't multithreaded when it went into the base Unity Game engine.

#

So I mean they fixed that this time.

graceful zephyr
#

But its early, so things will change

#

Sure, but you generally don't need that much multithreading for dedicated servers for fpses

faint fern
#

True, it was more for the mmo's

graceful zephyr
#

Nobody builds an mmo server in engine anyway

faint fern
#

There are people that are trying to.

graceful zephyr
#

So building a networking lib that lives in engine with that target seems useless

#

@faint fern sure, people try things all the time, doesn't mean it's a good idea

faint fern
#

I didn't say it was a good idea, but the people that are trying to might outnumber us here.

#

and their money is money

#

so...

graceful zephyr
#

ยฏ\_(ใƒ„)_/ยฏ

#

The new networking isn't going to work for an mmo anyway I'd say so

faint fern
#

I wonder if that argument will cause them to branch it?

white apex
#

the new netcode is for FPS types only, so, yeah, at some point they will have more types

faint fern
#

I'm not sure, I've not read it yet.

#

I'm just starting in the manual today.

#

I asked @graceful zephyr for his opinion since I've known him for so long. Thank you btw. for your info.

graceful zephyr
#

@faint fern yeah it's been a while

#

But yes, overall it looks good, but it's way to early to tell fully. A few things I don't agree with how it's done (rpc, codegen) and some performers concerns

white apex
#

what's up with the rpcs?

#

the InvokeExecute is weird but I think it's pretty straight forward

hoary lake
#

Hi ! I need help using Steamworks.NET in Unity, i can't figure out how to send an invite to a friend

#

anyone knows a good example on how to do that ? i can't find anything online expect the official steamworks api doc (wich isn't enough for me)

white apex
hoary lake
#

it's a different library, and lacks the same kind of example

#

i'm already using Steamworks.NET for the P2P networking so i was more interested in example using this library, but if someone has some with the Facepunch one it could also help me get on track.

graceful zephyr
#

@hoary lake The official steamworks api doc should be enough to figure it out in steamworks.net

#

its baically a 1:1 mapping

#

of the C++/C api into C#

stray scroll
#

SteamMatchmaking.InviteUserToLobby( CSteamID steamIDLobby, CSteamID steamIDInvitee ); It only takes like 3 seconds to google x)

hoary lake
#

the thing is i don't have a lobby i only have a P2P client to connect to

#

but i guess invitation only apply for lobby ?

#

but when the game start, isn't the lobby dead ? so i'm not sure about how to invite to the running game if there is no lobby

#

that's why i wanted a realexample and not an api doc with just functions names

stray scroll
#

Hmm, I think it's a state, don't remember correctly how to set it. I'll see if I can find it in some old code.

#

SteamMatchmaking.SetLobbyJoinable( CSteamID steamIDLobby, bool bLobbyJoinable );

#

So just never set it to false?

hoary lake
#

Oh then the lobby would keep existing even after the game had started... Do you know if it's how every Steam game handle late join and the way we're supposed to do ? It sounds hackish but i'll try, If it works then why not... :)

stray scroll
#

No, I have no other experience then using it myself and reading through docs. I don't see why it shouldn't be the way to go considering what the steamlobby brings in features.

#

I think it's better to ask steamworks questions in the forums as well?

hoary lake
#

Yeah you're right, this goes beyond the scope of unity.

weak plinth
#

Can someone help me out setting up server sdk?

#

I cannot access my routers info

#

By default ip

#

Diff pws for admin

#

Pwd

north vector
#

Hey guys, I'm new to networking,
my current project is for a roleplay server, they have a big group of emergency services but the dispatch system was terrible so I'm making a system for them.

I noticed Unet was bucoming depricated and so I just started using Mirror, but theres not alot of tutorials or anything that can really help me make a fully GUI based software

#

All I basically need is about 25 users or so that can click a button to change their status to "On Scene" or something similar, and a few people that can access a list with all the statusses in a list

#

Maybe someone can help me out on this? I can probably do everything except the networking.

stray scroll
#

I don't think you'll find anyone doing your work for you in this channel. I would try other generic dev discord channels that has a LFM, or reddit forums classfields or INAT.

north vector
#

I know

stray scroll
#

From what I've heard MIRROR and UNET should be very similar, so looking at UNET guides should help you out.

north vector
#

Its more that I could use some explanation on some stuff, when wrote that I didnt start on the program itself but now its more clear on what im gonna do

stray scroll
#

If you can't google yourself to your answers, ask ahead on the specific questions.

north vector
#

Ill read through some UNet docs for a min

#

Ok how do I make a button that hosts a server with a default name

graceful zephyr
#

go ask in the mirror discord

#

they can help you with that

#

much more efficiently

weak plinth
#

yeah

#

this is unity

stuck hinge
#

hows it going fellas

#

is there a way to get the old unity networking system back ?

#

the network view one. they deprecated it too fast imo

#

I found in the package manager the old HL API it says it will deprecated so as long as i keep old unity install im good i presume

stray scroll
#

use MIRROR

nimble grove
#

when you're having an issue and find a 4 year old post that Tobias answered in detail

jade glacier
#

Network view was before unet. That's legacy unity networking.

stuck hinge
#

so Mirror it is

#

having some trouble importing will try to fix and come back here if no luck

twilit lion
#

How could I do local mutliplayer on Oculus quest (two to four) for an arena scale thing

stray scroll
#

What do you mean how? just do it

gleaming prawn
#

Can you make a more specific question CheckMiner?

mellow beacon
#

man untiy is taking his time to release the 2019.3

#

been in beta for a while a no sight of the preview packages

stray scroll
#

It's released?

#

add "com.unity.netcode": "0.0.2-preview.1", "com.unity.transport": "0.2.1-preview.1"

#

not sure why it doesn't show up in packet manager

serene fox
#

Hey guys, does anyone know how the Nintendo Switch multiplayer works? I mean, there is this multiplayer where you can connect multiple Nintendo Switches and play the same game, but I have an offline multiplayer, anyone knows how this feature works and what I must do for my game to make it possible?

gleaming prawn
#

What you mean by offli e multiplayer? A couch game?

#

Offline*

#

If yes, this is not the right channel, as this would qualify as a normal game, just with more than one controller, some rendering camera to show all players or split screen etc... No networking involved.

#

If you want to write the same code and have both local couch multiplaer + online + mixed (online with more than one player per machine) then I might have something that interests you.

serene fox
#

My game is couch/local on every platform. But I think there may be a different way to handle things on Switch specifically cause you can use two Nintendo Switches to play the same game using a connect between them, and I don't know if this multiplayer is native (such as Steam solution for playing local multiplayer on network). I would like to understand this platform specific functionality.

stray scroll
#

Platform specific - in unity channel? Isn't that under NDA as well?

graceful zephyr
#

@stray scroll yes you are right, this stuff is not allowed to be discussed publicly AFAIK

jade glacier
#

Its a bit funny of course, since every major developer very likely has members on their team who are intimately familiar with all of the other platforms apis

plain dock
#

my networktransform doesnt work how it should. the gameobject moves on the client but it doesnt update the transform on the server.

jade glacier
#

networktransform is bad, but it should "Work"

#

if its not working at all, that usually means your controller needs to be disabled on non-authority network versions

#

@plain dock

stray scroll
#

Most annoying code I've written in a long time (because all parsing stuff x) ) https://pastebin.com/TLSek3F2
Not sure if anyone ever would have use of the code, but share it anyway. I want to have all the servers in my project existing in different worlds, and those worlds can talk to other "worlds" through RPCs. I generate the simulation groups which exist in same namespace as their names. E.g. LoginSimulationSystemGroup /InitializationGroup. And extract the RPC network part of the NetCode and add it in specified folders. Parse and remove unneeded code (which is very prone to what they might update it with). But hopefully this will reduce my refactor time in future x)

plain dock
#

@jade glacier thanks, i'll try that

weak plinth
#

am I missing something? you can make a listen server build with the new netcode right? meaning you can play the game and act as the host from the same client right?

stray scroll
#

I don't actually think you can build it as a client+server

#

Which is super weird, and I complained at forums on it as well ๐Ÿ˜› But it works in editor to run client+ server

#

The thing is in bootstrap the define UNITY_SERVER takes precedence over UNITY_CLIENT, instead of being parallell.

weak plinth
#

Ok, I just watched the last unity video, and it seems they deliberately made the decision to separate them, they even said 'who would even want that?'

#

me: in the corner looking at my coop game ๐Ÿ˜ž

#

man, I get that this is super early and all, but I'm kinda glad that I didn't drink the coolaid and jumped on this dots stuff right now

#

same with xrp

stray scroll
#

why would you do co-op with server though?

solar garden
#

I have a weird one, i had set somewhere in a start function Application.targetFrameRate so my pc stop screaming on builds runtime, tho is it normal that if i set my input send rate below the Application.targetFrameRate, half of my input will be ignored ? i thought Application.targetFrameRate was only for frames to render but it seems it is doing more than that

stray scroll
#

Application.targetFrameRate is core loop rate, since everything is built on top of the basic loop.

#

I'm not sure what you mean with "half of my input will be ignored"

#

And are we talking Dots Netcode?

solar garden
#

i don't know if i set the send rate bellow the Application.targetFrameRate it doesn't play the inputs and the far the number the most inputs are not played

#

ah no

#

its forge networking

#

but i just throught it was a problem from Application.targetFrameRate

stray scroll
#

Ok, haven't used forge. But imagine that if you set the targetFrameRate to 30, and you have a physicsTick on 60 you will have multiple physics tick on every render frame.Depending on how your send system works, if it consumes input, it might be that there is no input generated between your sends (since two of them happen after eachother) and thereby some inputs are "missed".

solar garden
#

its just weird because why would it even be a problem its not packet drop it is just not playing for some reason but the framerate shouldn't cause any problem

#

i'd figured that i would keep the older input as i just override the InputFrame var

stray scroll
#

Could also be on the server side that the buffering of inputs can't account for your chunk sends of input

#

If there are 0 inputs, then it is weird, and then I don't think it has to do with framerate .

solar garden
#

i don't have a buffer or input management of any kind i am pretty early in the code i just send a InputFrame object via RPC to the server and the server overrides its inputFrame object with the new one every time so yeah its weird that the framerate would have anything to do with this

#

ofc i use the current inputFrame directly for movements and such

stray scroll
#

I would print out (tickNumber, MovementAxis) on both client and server send/recv methods and see what's going on

solar garden
#

yeah i did that and there is no slowing down when this happens :/

stray scroll
#

slowing down?

solar garden
#

yeah you mean for showing if there is some missed packets right ?

stray scroll
#

Both that and see if inputs are zero

solar garden
#

yeah i take a deeper look but i told you inputs can't be "zero" because they are not reset its just a matter of replacing a state input so while it is not a good idea the result would be that i should continue doing the input until i receive a new one...

#

See im spmming jump here

#

but it jumps only at times

stray scroll
#

Yeah, so check some output logs and see what actually happens.

solar garden
#

yeah will do thx

north vector
#

I have multiple players with the same scripts ofcourse, but the scripts change eachothers values

#

if callsignSet is true for one player and its false for the other they keep changing eachothers value

#

how to fix this

solar garden
#

@jade glacier @graceful zephyr Do you guys let the clients change fps at will ? i have a problem where inputs are being sent though the FixedUpdate() and if my server is running at a lower framerate as the client inputs will be glossed over because it is too fast for some reason a solution could be to make a input queue to process them one by one but if the clients are still faster wont the queue be bloated with inputs and will create more lag ?

jade glacier
#

Server should run at your sim rate

#

Server should run at your sim rate

misty shale
#

Anyone got any good samples of Node.js / MongoDB REST server and DOTS?

gleaming prawn
#

@solar garden you are right, you should let clients run at a faster pace in many cases, but not completely free.

#

You should still limit that to a max, so your input queue doesn't require your code to process 10 inputs per tick. You should also require the input rate from clients to be a multiple of the server tick rate, this simplifies everything. Something like 3.

#

Rendering FPS glcan go free on clients, use interpolation to smooth.

solar garden
#

@gleaming prawn oh ok thx for the reply ! I don't know if it is linked but right now im sending inputs in the fixedupdate making the sending bound to the fps of the game, im using forge it is supposed to run on a different thread so i am trying to see if i can't send the inputs in its own "loop" so the fps doesnt matter anymore the client can run at 300 fps like 30 no problem of overfeeding the server, is it something good to look into in your oppinion ?

gleaming prawn
#

I don't know how forge works. I though you were designing your own solution. No idea how to work with forge, sorry.

#

This is a basic idea/principle that I know works well.

#

But I never trust unitys updates anyway, because even the hardware clocks drift with time, so you need to feedback or even sync the client clocks based on the server (we do this)

jade glacier
#

I would always build in some kind of drift correction if possible. Pretty easy with physics.Simulate () now.

#

You can have clients slowly respond to feedback from the server about how happy it is with it's buffer for that client

#

Even if not for dealing with clock drift, just for shaving buffers down to razor thin over time.

solar garden
#

Does this makes the input sending not fps bound ?

jade glacier
#

What makes it not fps bound is sending a fixed tick

#

Which means some updates get no update, some may get two

#

Same as how fixed update works

#

Hey, jealousy

#

Oops

#

Wrong window

solar garden
#

but i used Application.targetFrameRate to lock the framerate to 300 so it is not uncapped on builds and it seems to change the fixedupdate aswell

#

i don't know what to use to send inputs now

#

Sup, Jealousy

jade glacier
#

A timer really

solar garden
#

with Time.fixedDeltaTime ?

#

it ajust it self on the framerate right ?

jade glacier
#

Erick will know the best way. I just know stopwatch for that.

#

Just a check of elapsed every update

stray scroll
#

Cant you just accumulate the inputs to your fixed steps?

graceful zephyr
#

@stray scroll client needs a way to adapt itself to the server if it ends up behind/ahead

stray scroll
#

So then it just changes simulation time until it's corrected?

graceful zephyr
#

that leads to jitters for the local client

#

not a good idea

stray scroll
#

What I meant was simulation tick rate, not the delta. Would that lead to jitter?

fathom gust
#

How to simulate loss of connection with PUN 2 on one client?

graceful zephyr
#

@fathom gust disable LAN interface? kill editor/game?

fathom gust
#

What i want to do is make player reconnect to server and room after short loss of connection. Basically return him back to match.

mystic blade
#

is there an actual tutorial for online multiplayer? ive heard photon is one of the easier things to use

weak plinth
#

Hey there !
I'm making an open world multiplayer game . You can interact with pretty much anything and there are lobbys with about 10 people that are hosted by players .
So is there anything to watch out for when building environments for those kinds of games ? Would you just optimize the world/game and spawn players in there ?
....Yea I know I could google it but I'm a multiplayer noob and would like to hear opinions from people who know more than me and well I'm 'waiting' for dots ._.

graceful zephyr
#

@weak plinth You're basically asking "how do i build a skyscraper" when you don't know how to nail two 2x4's together

weak plinth
#

Am I ? ._.

#

well... I'm gonna take a good look at it

graceful zephyr
#

The question is too big too answer is what I'm saying

weak plinth
#

Okay :/

fathom gust
#

@weak plinth do you have previous experience with multiplayer games?

weak plinth
#

I did some simple stuff but not really. I'm not even sure how a Server works ๐Ÿ˜‚ ๐Ÿคฆโ€โ™‚๏ธ

jade glacier
#

Start with 2 player Pong... not kidding

weak plinth
#

I will

fathom gust
#

@jade glacier you stole my words. But seriously, listen to his advice, start with something really simple and build on that knowledge

neat python
#

Hi guys, been stuck in position transform synchronization with PUN in my unity project. Would like to ask why my object position keep does not want to sync to other players ๐Ÿ˜ฆ . Really thanks and appreciate for any input! Sorry im still a newbie to Unity ๐Ÿ™‚

#

getTarget.transform.position is the object that i wanted to sync to other players

#

master (Player 1) able to receive any sync but only clients (Player 2,3,4) not able to receive the sync

jade glacier
#

Have you first tried using the built in PhotonTransformView, or looked at its guts to get an idea? @neat python

neat python
#

Hi @jade glacier , yes the attached script object and its parent has photonTransformView and photonview

#

ObstacleSpace object being the attached script

jade glacier
#

You seem to be putting your rb and networking components on a child, so you may be experiencing some issues with that

#

Hard to say without the project open in front of me, but that does indicate you are trying to do some not quite vanilla stuff there

neat python
#

so you mean , better im not puttin rb in the child

jade glacier
#

I wouldn't start there if you are just getting familiar with networking

#

you are creating an edge case right out of the gate

neat python
#

oh ok got it

upbeat basalt
#

Anyone tried using gRPC with their projects and have any pointers on it?
What went good and what is good to think about and such.

gray pond
undone jolt
#

Hi, Im making an mmo social game, a bit like club penguin and growtopia, what's the best networking solution for me to use?

#

oh also it must be cross platfrom for mobile, pc, and webgl

gleaming prawn
#

Is this your first networking game?

#

@undone jolt

#

If yes: don't do an mmo.

undone jolt
#

Yea it's my first, why shouldn't I do one?

gleaming prawn
#

Do the most basic networking game possible

#

That's all about it... There's no point in pursuing an MMO as your first game, you won't be able to.

#

Even some of us with 10+ years of experience with game networking won't do one...:)

#

Think the most basic possible game (and not a fighting game, that is also not easy)

#

Do something like moving around and picking up mushrooms cooperatively... Anything super simple.

#

Then you can try to use either Photon PUN, or Mirror, etc...

#

There are people here who are part of the development team of several of these tools, and we always can answer technical questions.

#

Look at the answers...:)

undone jolt
#

alright, ima go small first, thanks for the advice ๐Ÿ™‚

wind ruin
#

@undone jolt if your long-term goal is an MMO of some kind, learn PHP/MySQL or whatever the cool kids are doing for backend these days while you're learning unity

#

In 2005 or so I was contracted to write a backend for a "signature pet" thing that gained XP every time the sig was viewed by a unique IP (or non-unique every 8ish hours)

#

I hate myself every day for not realizing what a money-maker that was at the time but even in 2019, the easiest way to interact with an online server is via PHP

#

Things like JSON have only made PHP more powerful in that sense

#

if someone wants to chime in on a newer and better database system than mySQL I'm all ears, but I'd be surprised to hear an argument against a web-based backend

tulip schooner
#

I am sorry to disagree with you, but IMHO PHP is not exactly the best choice you can do.
The only reason I would pick PHP is for legacy: a lot of companies (not in gaming, I mean in enterprise software) worked with PHP in the past, so now they have a tons of codebases on PHP. If you aim to work with this kind of companies, so yeah: learn PHP. If you're doing something new or you want to invest on something more solid, I would learn better technologies.

C# on ASP.NET Core is already a better and more solid pick than PHP (and if you come from Unity, you should already be familiar with C#). It also has an extraordinary tooling you simply cannot ignore.
You can check out Go, another good language for backend development, for high concurrency scenarios.
If we want to compare dynamically typed languages, even Javascript on Node.js is better than PHP if you talk about JSON and API interactions.

About MySQL: every DBMS has its own pros and cons. Be sure to check them in order to pick the one that better fits your needs. Check out MariaDB and Postgres too, as well as SQL Server.
Another good hint: don't be scared to use multiple database engines for different purposes. Classic relational databases can be mixed with NoSQL (Cassandra, for example... Or MongoDB) ones to improve the service and its architecture.

graceful zephyr
#

PHP? What serious company uses PHP for their backend?

#

o.O

#

(in gaming that)

tulip schooner
#

No serious one

graceful zephyr
#

oh... hey MH ๐Ÿ˜„

tulip schooner
#

Hey ๐Ÿ˜„

gleaming prawn
#

Nicely put @tulip schooner

stray scroll
#

@tulip schooner I've written my stuff in PHP with WAMP rn, quite early in dev. You're saying I should swap to ASP.NET? ^^

tulip schooner
#

@stray scroll currently I am writing all my backend services with C# and ASP.NET Core. Never looked back. I used PHP early on my backend dev career, I luckily quitted it after few time. I am suggesting every company I work for to migrate from PHP to something better (C# or Go).

#

Obviously, if you already coded all your stuff and it works for your use case, there is no point in recode everything from scratch

#

Just take it in consideration next time

stray scroll
#

90% of the code is just quieries to DB x) As one very new to that area, it feels like a jungle of words and choices. ๐Ÿ˜›

tulip schooner
#

Yeah, I guess it is.
Also, depending on what you're doing and what you want to achieve, you should correctly model the backend architecture before even pick a language/framework.

stray scroll
#

Could you give any broad pointers/cases that this would differ?

tulip schooner
#

For example: how many players your backend should be able to handle? In other words: is it something that has to horizontally scale?

#

Do I have a simple game that will have just 1000 players during the day? Well, a monolithic architecture should be enough.
Do I have a game that has to host as many players as I can? Yeah? Well, I should consider to distribute the load on demand on X physical servers (so we are talking about a distributed system, with all its implications).
In this case, a microservices architecture could fit your needs.

stray scroll
#

Hmm right, but does that tie directly into of choosing C# with ASP.NET or PHP or other, or isn't this a layer in between the web service and your application?

#

So for me, I want to have multiple servers running and talking to DB, and be able to scale it in the end. Like the overview of what I have in mind is this; and I have no idea if this is good or bad, but I would imagine you would use some DB solution that does redundancy and accommodate multiple servers reads in the end.

#

So I imagine only the DB and Matchmaker would need to have some REST API interface.

tulip schooner
#

This does not tie directly with the choice of the tech you want to use, exactly. It is a layer before it, before you even pick tech A or tech B. It is important to decide this and to have clear in mind what you want to achieve, when you start.

For example, in a microservices architecture, you can write multiple services based on multiple techs: service A on C#, service B on PHP, service C on Node.js, etc. Just pick whatever fits better the architecture you already defined ๐Ÿ˜„

#

About your architecture:

#

It could entirely be done as a REST API

#

Just the game server will remain an actual "game simulation"

#

(I am doing myself a matchmaker too)

#

About REST API: recently there is a new competitor to build this kind of APIs. Check GraphQL

stray scroll
#

Hmm ok. But REST API can be written in any web backend language, so it doesn't really matter?

tulip schooner
#

It doesn't matter as far as you don't have particular needs

#

But if you need to scale, performance, etc. I would pick something that I know it is reliable and performant

wind ruin
#

Idk why I suggested PHP when talking about gaming

#

glad someone showed up to point out how dumb that sounds

#

it's really easy to work with for simple stuff that you can handle with HTTP requests, stuff like managing a high score board

#

but it's actually really slow and can't communicate directly with like anything

tulip schooner
#

Exactly, definitely not something I would invest in.
Instead, try what I suggested and let me know! ๐Ÿ˜„

wind ruin
#

I'll add C# with ASP.NET Core to the list of things I hopefully have time to learn one day

mellow beacon
#

Dude PHP is fine.

#

But it's not tailored for highly demanding backend systems.

wind ruin
#

it's also not tailored for interacting with unity apps

#

it's easy enough to do, but there's better stuff out there these days

candid aurora
#

I've been working on getting my game's networking to work for a while now, and I'm aiming for something similar to the Unity Networking FPS demo, but something I'm still trying to figure out is how to handle one-shot events, rather than states. Anyone got any good tips, tutorials or articles on this? Do people create a second channel or something that's ordered and reliable UDP? It seems it's usually OK for an old packet to be overwritten by a new one for player position, but if a user key press to grab an item only gets sent out in a single packet then loss of that packet is going to make a big impact, even more so for chat messages etc.

I considered treating events as states, but attaching a series of old inputs as part of each packet (they only take up about 2 bytes in a custom bitfield anyway), but I'm hoping there are better ways that are obvious, simpler and that I'd just missed.

jade glacier
#

The best practice is to reduce EVERYTHING to tick based Inputs and States

#

making separate streams might seem like a fix, but now you are creating a situation where you have all kinds of oddball race conditions

gleaming prawn
#

It's a valid question.

stray scroll
#

Did some fast research yesterday and the things I read said only that PHP7 is marginally slower then ASP.NET ? Esp there wouldn't be any difference if the code only involves sending requests to DB.

gleaming prawn
#

This varies, there are solutions that indeed use a separate channel for things like events... you want to shoot projectiles with something like that (while the health changes are treated as state)

#

It should be the opposite question IMHO Jaws

#

PhP would have to be A LOT faster for it to be considered a valid option given the advantages of modern .net core

#

The only reason to use PHP seems to be cheaper developers on the market, maybe? (if you are a company)

#

Or in the same way, if your team has super good with PhP and do not want to switch

#

I mean a backend team that is doing more then just a game backend,

#

Being able to share C# projects for data-models between game simulation and the backend is a huge time saver.

#

This is something we really "surf" on in the stuff we build (photon server runs .net, unity accepts .net DLLs, so a .net core to match just saves everybody time)

#

PHP is the "challenger" in that sense, so it would have to bring a lot to the table (I'd say it's arguable in the cases I mentioned: available expertise within the team, or cheaper developers if building a team for a big project that's not only "game")

stray scroll
#

Sure, I think those are valid points. <sigh> how not to sound like an idiot, from some videos and posts I've read that there some sort of "populism" against using php. I'm not saying anything of what you should choose, just that the tone in the arguments should differ mayhaps?

gleaming prawn
#

yes, you are right

#

We should not have (a lot, unjustified) bias as much as possible...:)

#

There are always decisions made based on emotion and not on technical reasons... Sometimes that is the difference between a successful and profitable product and a flop...

jade glacier
#

For smaller projects it often comes down to what the dev knows and is comfortable with

gleaming prawn
#

yep

jade glacier
#

and if that is good enough to get the job done... next

gleaming prawn
#

that falls into one of the cases I mentioned (existing team expertise, so no brainer)

jade glacier
#

For sure

gleaming prawn
#

team = yourself... ๐Ÿ™‚

jade glacier
#

I can easily see using PHP if you are a PHP hero

gleaming prawn
#

y

stray scroll
#

Marvels new hero, PHP guy

gleaming prawn
#

But being realistic, what I've seen a lot in practice recently is neither of these...

#

It is specialized APIs like javascript-based Playfab Cloud, etc

#

Because just like what we do, people save A LOT of time by integrating everything into those...

#

I cannot share specific numbers, but I've seen the adoption of Playfab's cloud script grow a lot. And I'm talking about experienced teams, that could definitely develop a backend themselves...

jade glacier
#

Interesting

gleaming prawn
#

Some publishers already have their OWN legacy backends, in that case, that's what they use (nobody likes to share valuable data)... But new projects, Playfab has been getting some interesting use.

jade glacier
#

Manhunter manifesto incoming?

tulip schooner
#

@stray scroll it is not only matter of who is faster (and on this point I still can't see PHP as a competitor in a field where .NET Core, Go and Rust can easily win, but this is my own point of view).
You should also check for:

  • resources usage. Lower resources requirement = cheaper architecture for you to pay. When you handle a huge amount of players, wasting resources can really hit your bank account.
  • tooling. Debugger, frameworks, package manger, etc. Just quality-of-life tools that improve your productivity.
  • safety. Not only related to the runtime itself. But also related to the language. A lot of bugs can be easily catched on statically typed languages, bugs that you will not notice in a dinamically typed language until you get a runtime error.
  • community. Self-explanatory.
  • expertise. As @gleaming prawn said, your team expertise. If everyone on your team is a PHP addict and your whole libraries are written on top of it, just go for it.
#

@jade glacier yeah, I wall-texted again ๐Ÿ˜

jade glacier
#

Excellent manifest though

gleaming prawn
#

yep, all sensible

stray scroll
#

Uughh, I feel like I need to do a lot more reading... is Playfab only framework or do they cover the hosting of the backend used as well?

gleaming prawn
#

backend as a service

tulip schooner
#

If I remember correctly, they cover the hosting too

gleaming prawn
#

yes, they cover everything

#

It's SaaS

#

On first notice might feel expensive (out of my scope to judge), although this is arguable as always.

#

Because you might save a feel engineers (salaries are expensive, and you need people if you'll deal with liveops)

stray scroll
#

100$ for 100k users? seems cheap af

#

Wait.. then it's 0.008$/MAU, so when you bump 100k, you have to pay 800$/month. That's weird pricing.

gleaming prawn
#

Read it all

#

lol

#

Liveops is expensive, remember how much an engineer cost you, then check how many you need for a live successful game.

tulip schooner
#

And now some numbers!
I made a little test just for fun: measured HTTP requests throughput for some of the tech I suggested.
Obviously, nothing advanced and basic/standard HTTP requests processing pipelines.
Bombardier is used to bombard the HTTP server and both of them have been ran on localhost.
The request was a simple GET and the response a simple constant string.

C# (ASP.NET Core): avg. 90k req/s
Rust (Nickel.rs): avg. 108k req/s
Go (FastHTTP): avg. 128k req/s

gleaming prawn
#

But 100k MAU is a SMALL game... that in Photon would be around 250CCU (100 USD per month)

#

Photon and playfab) do not offer similar services, so not really competing (more like complimentary, as I see several customers using both), but to my understanding their solutions are indeed more expensive. But this is arguable, as this depends a lot on what is the value being added, etc...

stray scroll
#

Ah, to my previous comment. From what I now understand you can even go completely free, but with limited features etc.

#

So it isn't really like Photon, as you always have to pay by usersize, and not by features x usersize ๐Ÿ˜›

#

Time to dig into Playfab, gamesparks and firebase and see if I should use them instead of doing my own thing x)

gleaming prawn
#

yep

#

but remember there's nothing free

#

Unless this is just a hobby for you

stray scroll
#

My sanity isn't free either ๐Ÿ˜„

gleaming prawn
#

if not, you need players

#

then it's never free...:)

jade glacier
#

^^ People who worry about server costs and such always seem to neglect the general cost of GETTING any users at all

#

"Build it and no one will come"

tulip schooner
stray scroll
#

Firebase - seems only to be for IOS/Andorid
Gamesparks - 300$/month on release for any number of players
Playfab - Seems good at surface, until you see that it's all sort of "micro transactions"/"dlls" based. If you don't use the parameters as a "normal"(?) game, you will pay for extended parameters.

gleaming prawn
#

Well said emotitron

#

That's what matters really

glad compass
#

Has anyone had success getting networking working well for small lobby games (2-4) players where the game is very physics based (movement, projectiles ect) and dependent on animations for hit detection?

gleaming prawn
#

We'll, we can do that super well, but our solution is targeted to experienced teams. Depends more.on your studio.

jade glacier
#

@glad compass Yes in a few ways, but the answer varies depending on if you are going with state interpolation, state extrapolation or determinism. But in all of those cases as long as the animations are being synced using a fixed clock, you can reproduce them with great accuracy.

#

The main difference between methods being whether or not all clients see the exact same world through extrapolation or if they all live in the future and interpolate the world states around them.

#

To make that work ideally you will want your network tick and physics tick to match, so you aren't relying on any tweening of your animations on clients.

floral turtle
#

@glad compass you can set the animator to run in the fixed update loop if you are finding it non-deterministic

glad compass
#

Interesting. I'll have to look into that.

wanton scroll
#

hey guys I would like to ask someone with networking experience how to go about creating a matchmaker for Oculus Quest. I need to create a simple 1v1 multiplayer.

mellow beacon
#

what makes the quest so different that you need a special matchmaker for this device ?

gleaming prawn
#

Networking wise it is not different

#

Maybe you are asking about UI?

wanton scroll
#

I dont know ,I'm a complete networking noob. I just thought that mentioning the device might be of importance. Reading this blog post https://blogs.unity3d.com/2019/06/13/navigating-unitys-multiplayer-netcode-transition/ and following the chart it seems I need to take a look at the fps sample. Currently I'm using the NetCode sample. But my game is monobehaviour based( I cant change that) and it seems NetCode is for pure ECS.

Unity Technologies Blog

As many of you know, we put UNet into maintenance mode because we believe there is a better way forward with our new connected games stack. Since this anno...

gleaming prawn
#

NetCode is for ECS, and not nearly close to being ready.

#

And for a VR 1v1 game that's overkill and not really a good approach I'd say...

#

Depending on what you need to do you have simpler options.

wanton scroll
#

@gleaming prawn I would love some advice. What I need to sync over the network are the IK targets and spells that are being cast. The spells are not going to be physics projectiles so I think I would only need to sync the initial position and params of the cast.

gleaming prawn
#

You can do that super quick whit PUN2 (Photon on Unity asset store - free), but I'm biased (I work for Photon, although I'm a developer of another product: Quantum).

#

Other people here work with different solutions and they will have reasonable advice as well.

#

IMHO PUN2 would be the simplest for this use case and it will fit well.

#

There's enough documentation for you to get started and the support forums are very active.

wanton scroll
gleaming prawn
#

yes

#

I thought we had a free version of 2

#

you can get the free version of PUN classic if we don't. That would also work well for your case.

#

Here it is:

wanton scroll
#

I have a question. 100 CCU, given that the game is 1v1, means 50 separate matches right? Not 100 people in one game ?

gleaming prawn
#

zes, 50 instances

#

CCU is total game players currently online, spread across all running matches.

#

The free plan is good for development and testing up to 10 matches simultaneously

#

the pay once is good for up to 50 matches at the same time and so on

#

Anything that you have to host servers would be way more expensive btw (arguably)

fast lake
#

what networking system should i use with unity someone told me unet is gone

spring crane
#

For peer to peer over relay, PUN2 is pretty nice. For dedicated <-> client, Mirror would probably pretty nice one to start with

#

PUN comes with matchmaking/lobby system hosted for you, which is really nice if networking quality and security aren't that important

fast lake
#

I have just begun to use pun now

weak plinth
#

im working on an authoritative server and I'm not sure how I should handle user data. Should I have everything (physics, collisions, etc) be server side or are client calculations supplemented with server validations ok too?

#

I want to minimize server load so I can have as many players on a single instanec

jade glacier
#

typically players apply inputs locally and simulate themselves, and send inputs to server with a tick id. Player stores their sim results with that tick id.

Server once it applies that input sends out state for that tick (the sim results it got). Players compare that with their results to make sure they agree. If not you are in desync, and the client will move the object to the servers stated position/state and resimulte the inputs that followed that tick up to current.

@weak plinth

#

That keeps all extra work off the server, it is the clients job to get back into agreement.

spice orbit
stray scroll
#

@spice orbit Have you added the package to your project?

spice orbit
#

yes, still have the error

#

I made the script, then imported the package.Then when it "didn't exist" I deleted the script and made it again.The error still comes up

stray scroll
#

And what does the error say?

spice orbit
#

The type or namespace name 'Networking' does not exist in the namespace 'Unity'(are you missing an assembly reference?)

stray scroll
#

1st; Check package is actually in project, 2nd; Check you're not making any assemblies by asmdef, and have not included the reference there. 3d: Trigger a refresh of assets or restart unity.

spice orbit
#

I already checked that the package is there, I have not used any asmdef, I will try to restart Unity

#

am I supposed to do something with asmdef?

stray scroll
#

What do you mean?

spice orbit
#

2nd; Check you're not making any assemblies by asmdef, and have not included the reference there
sounds like you said I should include a reference in an asmdef for the script

stray scroll
#

only if you're using asmdef files

spice orbit
#

I'm not using one, so I don't have to worry about it?

stray scroll
#

exactly

spice orbit
#

uh the moment my Unity opened now, the error is in the console

stray scroll
#

And it's the only error? can you print it here? And then maybe print your view of package manager containing unity transport?

#

If still not working I would try Clean library, remove content of Library-> PackageCache

#

And show the script you have as well.

spice orbit
#

Assets\Scripts\Server.cs(4,13):error CS0234:The type or namespace name 'Networking' does not exist in the namespace 'Unity' (are you missing an assembly reference?)
that's the error in the console

#
using Unity.Collections;
using Unity.Jobs;
using Unity.Networking.Transport;

public class Server : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}```
is the script, not much happened already ๐Ÿ˜›
#

oh goody I am stupid, sorry ๐Ÿ˜‚ I have not imported it, I was looking at a DIFFERENT package earlier and it said that the other one was imported, and I thought that Transport is imported ๐Ÿ˜›

#

thx @stray scroll I would have never checked if you haven't asked for an image ๐Ÿ˜‚

weak plinth
#

@jade glacier That was the answer I was hoping for. Thanks

jade glacier
#

Np

weak plinth
#

which guy is tobi?

#

i mean tobias

gleaming prawn
#

I'll ask him to talk to you tomorrow...:) He's not online on weekends

weak plinth
#

alright ty

tribal timber
#

I can't seem to get a Facepunch server instance to initialize unless connected to Steam even though it supposed to work without the Steam client ๐Ÿค”

weak plinth
#

Does anyone know why my dev would be unable to connect to PUN while running the game in Unity, but can connect fine when its being ran on his machine?

#

He gets stuck on "Connecting" inside Unity, but when he runs the .exe it connects fine. I have the same Unity project on my machine and can connect fine. All the PUN keys are fine on his Unity and the PUN settings.

wind ruin
#

firewall?

versed cliff
#

Hi guys, I want to get into game networking with Unity. My end goal is to make a multiplayer mobile RTS game, but I'm probably a long ways away from that. I was wondering which resource you think I should working with to put myself on that track, especially whether to use Photon or something else.

#

I've been looking at some youtube tutorial series on it but they're mainly FPS's and I wasn't sure how much of that sort of multiplayer would carry over to an RTS.

#

And also there's a surprising lack of multiplayer tutorial content on youtube

graceful zephyr
#

@versed cliff RTSes are made using deterministic lockstep (generally)

wanton scroll
#

Hey, anyone with PUN2 experience here. I would like to ask a quick question.

versed cliff
#

@graceful zephyr yeah I was reading about that. But where do you think I should start as a newbie to networking in general?

graceful zephyr
versed cliff
#

oh this is great

#

Do you think I should make my game and then worry about making it multiplayer after the fact or should I become familiar with networking practices before I do anything?

graceful zephyr
#

make a small simple pong game thats multiplayer

#

or some shit like that

#

taking a singleplayer game and trying to make it multiplayer is the cardinal sin of MP dev

versed cliff
#

Ok thanks

#

Do you have any recommendations for which resources on that page I should look at for making a pong game?

graceful zephyr
#

nope

gleaming prawn
#

Checked that list and it has almost no technical resources on deterministic predict/rollback... Interesting...

#

Except for two on Fighting game rollback (simple 1v1). And no mention to XWing vs Tie Fighter

frank thorn
#

@gleaming prawn

graceful zephyr
#

@frank thorn this doesn't look very modern

frank thorn
#

I haven't used it but it uses Entitas and LiteNetLib which I am a fan of

graceful zephyr
#

Literally first issue is stating that it's too slow and gets into a death spiral and author has no way to solve it

#

@frank thorn

frank thorn
#

sounds like a gameplay mechanic to me

graceful zephyr
#

Looked through the code

#

Nothing special

#

And not very modern

frank thorn
#

Have any other unity lockstep examples?

graceful zephyr
frank thorn
#

Nice only a grand a month

#

plus 50 cents per player

graceful zephyr
#

Well I made 80% of it so

frank thorn
#

How does that help me

graceful zephyr
#

Idk, but you asked for determinism in unity

frank thorn
#

That's true lmao

#

Thanks

gleaming prawn
#

Server less lockstep is a dead end

#

Even if you do your own, just don't waste time with client only lockstepping

#

And 1k a month is cheaper than a developer to write your own top notch lib over 2/3 years, but that's what it is...:)

floral turtle
#

a heads up @frank thorn, although PhysX guarantees determinism on the same machine (and these days across most cpus), ensuring a game made within Unity is deterministic can be pretty time consuming. Loads of stuff like Destroy() don't happen in the fixed timestep, so if you're planning on writing your own stuff make sure you have a robust system to check for desyncs

frank thorn
#

Thank you for the additional information.

untold gale
#

Hey, anyone here using Forge Plugin for Networking? Need some help with Forge and master server

jovial rapids
#

@frank thorn unitylockstep is outdated ๐Ÿ˜…

wanton scroll
#

hey guys I'm a bit confused. I'm using PUN2 and writing my own implementation of IPunObservable and sending messages manually it works. But lets say I want a cube to move for both players. I add a Photon Transform View to it and drag it to the observable slot in the Photon View, but then when I run my test the cube movement does not sync. What am I missing ?

graceful zephyr
#

@untold gale check forges discord

untold gale
#

@graceful zephyr
I have asked few question there as well. Just waiting for replies form as many people as possible

solar garden
#

Do you guys use Input.getbuttonDown() in your games ?

#

i found it useful for task like jumping but its kind of hard to network it mainly because the processing is made in FixedUpdate

#

Im trying to implement a way to send a Input.GetButtonDown across the network but i am having a bad time with it

frank thorn
#

@graceful zephyr If you were to make a game like Fortnite today, what networking stack would you use to do it, assuming you did not have the time to write your own.

#

And you were using Unity

graceful zephyr
#

I'd write my own...

#

There's none that can do a 100 player auth game available

frank thorn
#

Of course, but if you didnt

#

Even Forge you think?

graceful zephyr
#

None of them can do a 100 player auth game easily, some of them don't have the perf, some of them will takelonger using the lib than doing it from scratch because the lib is so bad.

#

Photon Bolt is the closest (im biased ofc, as I made that originally), but it was really never made for more than ~50 players

#

Unity FPS Sample is a good starting point also, but you will have to tweak and optimize the code yourself for it to handle 100 players

#

I'd just do the game in Unreal instead ๐Ÿ˜„

frank thorn
#

So once you get past ~50 players, in general, it's time to write your own framework because you'll have to account for a lot of network optimizations unique to your product

#

Is the reason you'd do it Unreal because of network optimizations?

graceful zephyr
#

@frank thorn no because unreal has been proven to work for 100 player games (obviously: fortnite/pubg)

#

and i'd not bet my company on tech which hasn't been proven for the game im trying to build

#

or do you know of any 100 player game using unity on the scale of fortnite/pubg? cos i dont

frank thorn
#

Rust comes to mind

graceful zephyr
#

@frank thorn rust isn't a 100 player competitive shooter tho

#

and it's hardly the pinnacle of stability ๐Ÿ˜„

frank thorn
#

Lol

#

You have a valid point

#

However

#

I think it might be worth taking a gamble and building in Unity

#

Just because of DOTS

#

If you could get a decent networking framework going wrapped around DOTS, I think you could have as good if not better performance than Unreal

graceful zephyr
#

@frank thorn dots is very unstable stil

hollow sandal
#

@gleaming prawn, rewinding the conversation a bit, why do you say serverless lockstep is a dead end?

#

I can understand for ranked games they would need some kind of validation, and P2P doesn't scale well for multiple players, but for low player counts should be fine right?

graceful zephyr
#

There's nothing wrong with server-less lockstep for simpler games, etc.

#

Maybe for a competitive title sure

stray scroll
white apex
#

yeah, like the fpssample, pretty hard to build on. lots of redundancy and abstractions could be removed

#

and the biggest problem i guess, i wouldn't mind building on a good foundation but it's not

#

weird pieces of code like in BeforeServerPredictionSystem where a system pretty much checks for disconnects and then calls a method that run systems that are not even systems, just functions. i would bet this could be done in less code and not as confusing

#

i had high hopes for a more advanced fpssample but it's not really the case

#

i'm getting 30ms on main thread in the editor without any safety checks. ๐Ÿ˜ฆ

jade glacier
#

Pretty much they are showing their work in the early stages, because... they feel they have to show progress. But that early on its useless since everything made is still part of the "Let's see if we can make this even work" phase, and its going to need like 10 rounds of refactoring once its working.

#

And refactoring something like Unity = breaking changes constantly.

white apex
#

in the profiler it seems the animation package is the biggest contender for performance problems. pretty crazy when it's 1 char running around

#

kind of bothers me that they are not making a hybrid approach and sticking to this new workflow that they haven't figured out themselves yet. doing so many things at once is a recipe for disaster

#

yeah, haha, sorry i sound like an ungrateful bitch @jade glacier i'm happy they released it, it's just that the refactoring part is quite annoying because as unity dev you can't build on it. right now the default netcode sample is still the best to start

stray scroll
#

Not sure if you're meant to "build" on top of it? For me it more seems like they're trying to show off that things work together of course, and then also create smaller packages for different parts of the game.

graceful zephyr
#

@white apex color me... uhm, not impressed.

#

it's an absolute mess the code

#

impossible to dissect and figure out how it works

#

no clear examples, just a massive dump of what looks like a half baked project someone gave up on

graceful zephyr
#

found a nice comment in the dots sample

#

//@TODO: Temp hack for unite keynote to hide error

#

lol

stray scroll
#

xD

frank thorn
#

Thanks for the git link @stray scroll

#

I've found that most of the DOTS samples are a complete mess in the code

graceful zephyr
#

@frank thorn you don't say lol

#

as a 'sample' its useless

frank thorn
#

disappointing

#

but also expected

graceful zephyr
#

yup

stray scroll
#

Yeah, I donno, for netcode it feels like they mixed from the NetCode and FPS sample at first glance. Or if the FPS sample part is even used I donno? They have a NetworkServer.cs that seems to use the FPS network code but where Update is only called from test scripts it seems.

#

It feels like they're trying to do too many things at the same time here, I hope they clean it up and give some docs to it.

graceful zephyr
#

@stray scroll Honestly it's an absolute absolute mess, I don't get how they could release it like this, it looks like they did this:

  1. take fps sample
  2. cut out everything we want to replace with dots
  3. shove dots in
  4. duct-tape it together
#

=/

white apex
#

Yesterday i read the dotssample code for some hours to figure out what all the parts are. first of all, yes it has to be cleaned up. some parts are worse than others as some feel overengineered to me, like the ability systems or the amount of data that is required for the base character. What sucks is that there are so many classes for setting up systems and groups. I think in a composition this should be in 1-2 places for server/client but modules are all over the place which makes it weird to untangle and debug. I expected most to be found in attributes like [UpdateInGroup] and sometimes this is used but then a system in GhostPredictionSystemGroup calls a method from a world that runs those systems manually which again makes it hard to figure out what's going on or where to best put new things. I don't understand the benefit and usage of ManualComponentSystemGroup and I think all this can be intergrated in a more streamlined, elegant way.

#

Unity.Sample.Core seems pretty cool and useful for debugging.
Unity.Sample.Game is mostly alright unless you get to the player parts. Like, why is input sampled in HandleTime and why is there a ClientLateUpdateSystem that calls a function with ChatSystemClient as parameter? So many relics of MB behaviour makes it disjointed.
Unity.Sample.BaseCharacter seems like the best start for cleaning up.
Like, the abilities should be elegant in usage because they are an endpoint for devs and a lot of abstraction was built to get there so you'd expect to not need much code, just firing off entities with components for systems to work on. Instead the ability_rifle has 450 lines of code. They have abstracted so much but firing a projectile from a player/enemy is still hardcoded to one ability.
I was also searching for a better way to load prefabs and their WeakAssetReference and registry loading seems like a solution but then you find out it can't actually load anything and is really just a meaningless GUID split up into 4 ints. I wish they would use their own Addressables for that.

#

overall it's not that bad but I guess it's disappointing that it's still pretty prototype

graceful zephyr
#

@white apex honestly i think its pretty bad... i mean if this is supposed to be the sample of how to build a complex game in DOTS

white apex
#

yeah, from that perspective I agree

graceful zephyr
#

Why is it 1) an absolute fucking mess in terms of code organisation 2) basically cut and pasted FPS Sample with large holes cut in it

#

like... what is this? is this the BEST they can come up with after working on DOTS for 2-3 years?

#

Isn't dots supposed to give benefits in organizing code? this doesn't show that.

#

Isn't dots supposed to give perf benefits? this doesn't show that (it runs like dogshit...)

jade glacier
#

I just think its all very un-Unity. Not at ALL accessible to new devs in any way.

white apex
#

yeah, i'm with you. i'm not sure who all the coders are but some seem not good

#

i trust tim though

graceful zephyr
#

i know of 3 of them at least

jade glacier
#

I'm pretty advanced along the learning how to networking scale... and I have no desire to try to sort through that mess.

white apex
#

the androids netcode sample is the best unity has released imo

graceful zephyr
#

Also the fact that the networking seems to be? half fps frame work? half dots new netcode?

white apex
#

animations needs a fix, it drags the whole dotssample down

jade glacier
#

I can't speak to the quality of the code itself. I can only speak to that it shouldn't be anything be easy to use after 2 years of dev if its under the Unity banner.

graceful zephyr
#

@white apex turns out that literally replacing the entire engine at once isn't a good idea

#

๐Ÿ˜„

jade glacier
#

Unity = questionable code, but easy to use. At least to the dev world.

graceful zephyr
#

new engine architecture, new physics, new animation, new rendering, new netcode, new audio, new input

#

new particle system

#

new shader programming system

#

new visual scripting

#

like...

#

finish one fucking thing to completion please.

jade glacier
#

I feel somewhat redeemed because my initial take on the ECS announcements was "Why is this not just a new engine?"

graceful zephyr
#

@void burrow ninja reaction? ๐Ÿ˜„

jade glacier
#

Thought maybe I was missing something

white apex
#

tbh, yesterday i was at the point where I thought, why are they don't branch off from unity as it is right now.

void burrow
#

"ninja reaction"?

white apex
#

unity dots or whatever

graceful zephyr
#

no i mean you just come in and leave a reaction without saying a word, like a ninja ๐Ÿ˜„

#

sneaky sneaky

void burrow
#

Oh ๐Ÿ˜‚

jade glacier
#

drive by

graceful zephyr
#

@white apex i'm just... i actually expected something good this time around for the dots sample ยฏ_(ใƒ„)_/ยฏ

jade glacier
#

They could still fork Unity, but they won't

white apex
#

me too man ๐Ÿ˜„ i spent some time on the fpssample and built a LOT on it but it ran like shit and the architecture wasn't good. so, to find the same architecture in place is bitter for me

jade glacier
#

upside, Quantum isn't going to be facing any competitors.. maybe ever at this rate. @graceful zephyr

graceful zephyr
#

well, i suppose

void burrow
#

Auch

graceful zephyr
#

but it feels like they are slowly killing the engine

#

which kills my customer base also

jade glacier
#

yeah, that is a problem

white apex
#

yeah

jade glacier
#

though you guys are already looking at UE ports anyway no?

graceful zephyr
#

we are

jade glacier
#

you are solid no matter how the wind blows

white apex
#

hdrp 7.1.6 fucked my project yesterday. had to revert to 7.1.5 but I couldn't so I had to manually add them in packages.manifest. everything is so cutting edge right now and buggy

graceful zephyr
#

all features individually are buggy

#

all features together ... it's unusable

jade glacier
#

If I were making a real game right now, I would likely be doing it in 2017

graceful zephyr
#

the domain reload times in 2019.3

#

are insane

#

idk man... this is just... sigh

white apex
#

don't get me wrong, i think the best thing you can do right now is hybrid. using ecs for computation and unity as presentation layer

graceful zephyr
#

@white apex it's hard to do that even with so many missing features

jade glacier
#

Assuming your game even needs ecs

graceful zephyr
#

from the ecs packages you need for game logic

#

and yeah, assuming that

jade glacier
#

If your game is small enough to run with just standard monoBs... I would just do that

white apex
#

i think data oriented is the way to go, even performance aside

jade glacier
#

I don't disagree, I just have no desire to even try to learn their ECS at the moment unless I have something that begs for it

white apex
#

it's nice to really design in unity and things are stable and interact nice with each other

graceful zephyr
#

@white apex honestly i have my doubts on DOD as the main architecture for a game, it's basically unproven if it works well for large scale complex games.

white apex
#

well, programmers can ruin everything. i'm just saying it's better than monobehaviours

graceful zephyr
#

performance wise, yes 100%

#

architecture wise? idk

white apex
#

and mbs still have their place, i don't think it's wise to go fully in one direction. i see ecs as a tool

graceful zephyr
#

i mean MBs is not the pinnacle of engineering, don't get me wrong

#

but there's an inbetween land between full DOD and MBs

white apex
#

never go full DOD

graceful zephyr
#

what really is interesting for me

#

is Jobs/Burst

white apex
#

it is, and ecs is IMO the best form to design memory layout for jobs to be actually effective. i mean, i feel stupid in retrospective but c# memory layout has fucked me over so much and I was optimizing code instead of knowing what's going on

#

or it's just a band-aid for a bad programming language haha

wind ruin
#

I didn't want to interrupt because you both seem really into this conversation

jade glacier
#

I really should go back to my first unity game at some point and look at the code for a laugh some time @white apex

wind ruin
#

but can someone tell me what ECS and DOD stand for real quick so I can follow along

white apex
#

entity component system and data oriented design

jade glacier
#

its all about aligning memory as a priority

wind ruin
#

ty ๐Ÿ™‡โ€โ™‚๏ธ

jade glacier
#

sloppy OO coding can lead to all kinds of wackado cpu gymnastics when executing code

#

for the super non-tech explaination

white apex
#

totally and with MBs it's impossible unless you use managers

#

and even those will plateau out where you can't optimize anymore

#

then you try to find a good memory layout for an oop architecture that doesn't support it ... that's where most my projects stopped haha

graceful zephyr
#

@white apex yes ECS is good for memory layout

#

but you pay a hefty price for that, at least when in C#

white apex
#

can you eleborate? do you mean the system overhead?

graceful zephyr
#

And yes if you say that OOP = Mono Behaviour

#

Then yes 'OOP' is 'bad'

#

@white apex the price you pay is the fact that everything is native memory and structs, while it does wonders for memory layout and batch processing, it absolutely wrecks other parts of the architecture - you need to give up on the massive library of C# code that exists for example, and dealing with singular entities is very bad perf wise

#

Don't get me wrong, I do like and think that ECS is a valid pattern, and that DOD has its place. But this all-in thing where everything is going to have max performance, doesn't lend itself to actual game design.

#

or at least if it does or doesn't lend itself to game design, is unproven.

white apex
#

yeah, single entity systems overhead sucks. i don't write such

#

and i think noone should

graceful zephyr
#

i mean thats a misnomer tho

white apex
#

that's the hard part. finding what's best for what

graceful zephyr
#

what if you have a game that just have one special player entity with has TONS of unique logic?

#

you are going to need tons of singleton systems

#

for example

white apex
#

or MBs

#

that interact with systems in that they create entities

graceful zephyr
#

yeah but then you're in frankenstein land

#

imho

#

if ur gonna be mixing MBs and ECS back and forth

white apex
#

why not? it's all pretty readable

graceful zephyr
#

you have two physics engines? two ways to render things?> etc.

#

yes its a mess

#

i can see using jobs/burst to accelerate some subparts of a game thats built on MBs

wind ruin
#

so why's everyone so upset about DOTS?

white apex
#

maybe things are easier for me because i don't use their rendering and physics

graceful zephyr
#

sure, absolutely

#

@white apex what are you doing ? :p

#

@wind ruin upset is the wrong word, more ... just... sigh

wind ruin
#

"I'm not mad, I'm just disappointed"

graceful zephyr
#

just,... tired of it

#

all we hear is DOTS DOTS DOTS from unity side, but nothing is finished, everything is broken and buggy and the sample released a day ago is a mess, etc.

white apex
#

right now it's "just" a FPS, mechanically it's similar to risk of rain 2

#

multiplayer, many projectiles and enemies

graceful zephyr
#

ah

stray scroll
#

I feel like all other samples then DOTS and FPS have been good shrugs

white apex
#

but i've done other projects too, not much genres I haven't been lol

#

i like building things from scratch as much as possible. for anyone else I don't know how the transition to dots should even work. even most graphic assets are broken with urp/hdrp

wind ruin
#

Well from what little I can find out about it, it's supposed to optimize memory R/W but most of the engine's components don't work when using it?

#

At least not without a bunch of extra work

#

I'm curious as to why you would use an engine at all if you're building your own versions of its most basic features from scratch though

white apex
#

i meant, i'm building from scratch as much as possible so i'm not using store assets. i'm not replacing basic engine features

#

in that regard, i think unity5 rendering/physics is good enough for any moderate project and having ecs run on anything that's supposed to be batch processed is a win in both cases because it doesn't overcomplicate things and you also stay away from the cutting edge (buggy) stuff

#

most systems I write are for game mechanics because I agree, build games not engines. sometimes I feel we are still in the "build an engine" phase ^^

wind ruin
#

I definitely misunderstood you

#

Wait no

#

you said you don't use their rendering or physics

white apex
#

oh sorry, i meant the new ones

wind ruin
#

isn't that wildly redundant

#

Unless unity's physics system is bad enough to significantly affect performance

white apex
#

my bad unity projects have bottlenecks in simulation code and not in rendering/physics

#

you have to do a lot to get unity5 to choke

#

most games won't but still have a complicated simulation

#

factorio is one of the better examples.

#

it's not possible in unity5 + mbs but in unity5 + ecs

#

of course it's even better with dots rendering and dots physics

#

but that's for the programmer to decide because one way is a lot harder

wind ruin
#

I'm still a little confused about why you don't use unity's physics though

white apex
#

to be clear, you mean the new physics package? tbh, because I don't want to integrate it yet. Last time I used it I had constant crashes and random errors. It's just not stable enough. Default physics/havok is though

wind ruin
#

Oh

#

I see where I got mixed up now

white apex
#

yeah, it's even confusing to talk about right? ๐Ÿ˜„

#

which physics??

wind ruin
#

I was just starting to read about ECS/DOD/DOTS when you said "I guess it's easier for me because I don't use their physics or rendering"

#

so I thought you meant you used your own physics and rendering systems that you wrote from scratch

#

so I thought you were some kind of maniac

white apex
#

lol, i'm not that mad ๐Ÿ˜„

wind ruin
#

why still use Unity 5 though?

white apex
#

i don't, actually 2019.3 i'm just calling the default render pipeline unity5

wind ruin
#

๐Ÿคฆโ€โ™‚๏ธ

#

I'm not as stupid as I seem right now

white apex
#

i know this stuff is confusing

#

on top we have urp/hdrp with default rendering and hybrid renderer for the most optimization

#

and no proper names for it

wind ruin
#

I'm basically brand new to Unity but have a bit of a programming background.. Unfortunately I've only just come back to this side of the internet since around 2010

#

Done a few things here and there, but even OOP wasn't that common when I was fresh and up-to-date on everything

#

So it's a little concerning to hear that unity isn't all that well-optimized and that their flagship solution is a wreck

white apex
#

well, the negatives aside, it's a good time to start learning unity. a lot has changed in the last 3 years so be aware that 2 things exist for 1 thing. that's confusing at first but okay once you get the hang of it

#

it's mostly a wreck because the dots animation package is not done and takes too much cpu

wind ruin
#

The two things being MonoBehaviour and ECS?

#

er, dots

white apex
#

roughly said, yeah

#

pretty much everything that exists in unity gets a dots counterpart

#

from animations, physics, rendering, audio, etc...

wind ruin
#

What sort of problems have you run into that you were hoping dots would help with?

#

Yeah, I get it. I can just ignore dots until it's something I can actually benefit from though.. I hope

white apex
#

many things actually, faster simulation code, proper barriers between designer/code data, avoid spaghetti code, avoid refactoring, interaction between game mechanics/systems, extendibility. you can get those right now IMO

wind ruin
#

oh cool

#

but then you still need MB for things that dont work

#

do dots and MB play nice together?

white apex
#

things that dont work are actually very specific

#

assetstore assets ^^

#

for example, I can't bring the kinematic character controller in ecs

#

it would take a long time to port this code to have cool movement out of the box

#

so, instead of porting, i use a gameobject for the player which is directly linked to an entity

#

there is another MB on the player, like the weaponmanager which creates entities with components when i shoot a pistol or shotgun

#

i talked with @graceful zephyr about this. systems that only work on one entity like the player are useless right now as they have too much overhead

wind ruin
#

so you need to use MB for anything your bullet is supposed to collide with

jade glacier
#

I am not looking forward to people complaining about my asset not working for their ECS stuff. I am going to have to be very clear in store description.

white apex
#

only for my player because it relies on the KCM asset. bullets can be built without colliders and raycasts instead

wind ruin
#

Ah

#

I think it would just overcomplicate things for me this early on

white apex
#

what do you want to make? genre like?

wind ruin
#

it is already difficult at times to find a tutorial on something that doesn't seem to be done terribly

#

I'm just making simple 2D games for now to learn the engine

white apex
#

most tutorials are horrible. they are the reason why dots exists in the first place. unity just doesn't scale when the same code is executed on 100s of gameobjects

graceful zephyr
#

@white apex eh... you're under the impression that things will be better with ecs/dots.

wind ruin
#

eventually I will learn to make games in 3D, but I have no long-term specific game in mind at this point

graceful zephyr
#

performance wise, yes. architecture wise, no.

#

is my guess

white apex
#

true but that's on us ๐Ÿ™‚

wind ruin
#

For example, last night I was trying to get an idea of how procedural level generation is done and how I could make it not seem repetitive

#

I found a youtube tutorial on it that was part of a series on making a spelunky clone

#

Around the halfway point of the first video (of 3 I think), I started to feel really bad for the people who followed this tutorial without knowing better because the guy did some seriously dumb shit

white apex
#

lol

#

you can find good resources in forums and repositories

#

but it's all "hidden" quite well

wind ruin
#

I watched the rest of the series and learned what I wanted to learn

#

but there's all these youtubers and what not teaching people to use garbage code and no one there to set them straight

#

it's why we have 100s of people in this server a day who ask "why dont this work" who haven't even read the error message

#
public GameObject[] rooms; // index 0 --> closed, index 1 --> LR, index 2 --> LRB, index 3 --> LRT, index 4 --> LRBT
//populate array stuff snipped
int direction = Random.Range(1,6);
if (direction == 1 || direction == 2)
        { // Move right !
          
            if (transform.position.x < 25)
            {
                downCounter = 0;
                Vector2 pos = new Vector2(transform.position.x + moveIncrement, transform.position.y);
                transform.position = pos;

                int randRoom = Random.Range(1, 4);
                Instantiate(rooms[randRoom], transform.position, Quaternion.identity);

                // Makes sure the level generator doesn't move left !
                direction = Random.Range(1, 6);
                if (direction == 3)
                {
                    direction = 1;
                }
                else if (direction == 4)
                {
                    direction = 5;
                }
            }
            else {
                direction = 5;
            }
        }```
#

that's how his final code decides which side of the room the next room should be placed (a third of it, anyway. theres another block for direction == 3 | 4 and one for direction == 5)

#

anyway I'm just not looking forward to seeing that kinda stuff for dots :/

white apex
#

easy answer, then don't ๐Ÿ™‚ i wouldn't either

#

i guess this code only runs once anyway on init level

wind ruin
#

nah I snipped a bunch out just to show the bad part

#

i'm done ranting now ๐Ÿคทโ€โ™‚๏ธ

latent pendant
#

I have a mouse interaction script that gets the current highlighted asset, and invokes a predefined unity event on it to the main character.


            {

                if (Input.GetKey(KeyCode.F))

                {

                    PlayerController.CallInvokeAction(newObject);

                }


                return;

            }```

which calls ```  public void CallInvokeAction(GameObject gameObject)

    {

        CmdInvokeTargetAction(gameObject);

    }

}``` in my TPS controller, which in turn calls ```[Command]

    private void CmdInvokeTargetAction(GameObject newObject)

    {

        newObject.GetComponent<NetworkIdentity>().AssignClientAuthority(connectionToClient);

        newObject.GetComponent<InteractionActions>().InteractionAction.Invoke();

    }``` on the server. However, i"m sitll getting that pesky 'trying to send command for object without authority' error. Any idea what I'm doing wrong?
jade glacier
#

the script with that Command HAS to be on the object you spawn as the Player

#

its a major limitation of unet/mirror you learn to work around

#

At a glance you are trying as a player to command an object... to become your object. But command can only be called on an object that is yours.

#

So the answer is don't use command, use a MessageBase message, or a NetworkWriter message and send that... OR run all of that through your player object

#

@latent pendant

latent pendant
#

ahhh yes. that's exactly what i was trying to do. that seems very... odd. i'll try the mehtod you suggested. thanks!

#

here i was thinking that unet isn't ALL that bad with what people say about it, but now I get what the big fuss is.

gray pond
#

@latent pendant You said the TPS controller has the command - isn't that on your player object?

latent pendant
#

yup

gray pond
#

then that should work

latent pendant
#

but it's trying to interact with a different object

gray pond
#

at least it does in Mirror

latent pendant
#

no, my TPS is trying to invoke a unityevent on another object

gray pond
#

I'm confused then.

#

you have player object [P] and networked object [O] in scene. O has the click script that calls the TPS on P where the Command script is. true or false?

latent pendant
#

false

gray pond
#

ok, clear it up for me?

latent pendant
#

P calls a Command script in P, that tries to invoke a unity event in O.

#

which, i've just learned, doesn't work. ๐Ÿ˜›

gray pond
#

This is valid

P calls a Command script in P

[Command]
private void CmdInvokeTargetAction(GameObject newObject)
{
  newObject.GetComponent<NetworkIdentity>().AssignClientAuthority(connectionToClient);
  newObject.GetComponent<InteractionActions>().InteractionAction.Invoke();
}
latent pendant
#

right, but when in calls .Invoke on the GO, it gives that authority error.

gray pond
#

Where is this code?

if (DoesGoHaveValidInteractions(newObject))
{
    if (Input.GetKey(KeyCode.F))
        PlayerController.CallInvokeAction(newObject);

    return;
}
latent pendant
#

on the TPS controller

gray pond
#

Is TPS controller on the player?

latent pendant
#

yes

gray pond
#

and what is PlayerController in there?

latent pendant
#

in there?

gray pond
#

in that last code snip

latent pendant
#

i'm sorry, i was mistaken

#

that code snippet is on a camera controller

#

that has a reference to the TPS controller

#

thats what PlayerController is

gray pond
#

and this is in the TPS controller then?

public void CallInvokeAction(GameObject gameObject)
{
    CmdInvokeTargetAction(gameObject);
}
latent pendant
#

correct

gray pond
#

the camera script is getting newObject as something it's aiming at I guess?

latent pendant
#

yes, the GO under the cursor

gray pond
#

oh - how is PlayerController reference assigned?

#

betting you have the wrong ref

latent pendant
#

in the controller?

#

it works all the way up to the server, until i try to invoke it

#

the Command that is.

gray pond
#

it does and I think I know why - humor me

#

is on the camera - which has a PlayerController field with a ref to your TPS - how is that ref being set?

weak plinth
#

Application.Quit(); put this on awake method and u r good to go

latent pendant
#

set in the prefab

gray pond
#

@latent pendant is the camera a child of the player prefab?

latent pendant
#

no, instantiated client side only

gray pond
#

which probably breaks your reference.

latent pendant
#

works completely clientside

#

the player GO does get the right functions called, but it's still the authority that's the problem

gray pond
#

clear that assignment and grab camera.main from OnStartLocalPlayer and set the reference there. My guess is that every player object has that reference and it's going through the wrong player object

latent pendant
#

my apologies Camera.main.GetComponent<InteractionDetection>().PlayerController = this; this is currently in TPS Start

#

should I put it in OnStartLocal?

gray pond
#

OnStartLocalPlayer

#

otherwise you're reassigning it for every player object on both the server and all clients

latent pendant
#

    {

        if (!isLocalPlayer)

            return;


        spawnedCamera = Instantiate(CameraToSpawn);


        // get the transform of the main camera

        if (spawnedCamera != null)

        {

            m_Cam = spawnedCamera.transform;

            spawnedCamera.GetComponent<FreeLookCam>().m_Target = transform;

            Camera.main.GetComponent<InteractionDetection>().PlayerController = this;```
#

that's what i had

gray pond
#

isLocalPlayer isn't valid in Start in UNet (it is in Mirror)

latent pendant
#

i'm using Mirror. ๐Ÿ™‚

gray pond
#

then why are you asking in this discord?

latent pendant
#

fair point, but because it was an authority question.

#

since mirror is a drop in replacement, i just came here. my bad. ๐Ÿ™‚

gray pond
#

you said

4:49 PM] floppy pancakes: here i was thinking that unet isn't ALL that bad with what people say about it, but now I get what the big fuss is.

latent pendant
#

I know. I forget sometimes. it's my bad

#

I'll find their discord and ask over there.

#

Thanks for your help. ๐Ÿ™‚

gray pond
#

There are differences, I've been going along thinking you were in UNet all this time ๐Ÿ™‚

latent pendant
#

My apologies. haha

gray pond
#

sending by PM because this discord blocks links to other discord servers for some inexplicable reason

weak plinth
#

For the development of a competitive FPS multiplayer game, what setup would you recommend with Unity?

Photon, FPS Sample or else?

#

Looking for low latency.

gray pond
#

Low latency = LAN games...just sayin' No network package can change the nature of the internet. Players either have a good connection to your server or they don't. Having regional servers in high quality backbone facilities might help a little, but your choice of network package really won't make any substantial difference.

graceful zephyr
#

@weak plinth use unreal, it's literally been built for this over two decades.

#

replied to an old message, sorry didn't realize

weak plinth
#

Yeah, no thx.

#

UE4 is great as a generic AAA game engine, but it's not great for competitive multiplayer FPS games specifically.

#

Unless it only works flawlessly on current High End PCs.

#

Significant amount of input lag.
Significant amount of stuttering when playing Online.

#

Even if the graphics look like Quake 3 Arena

solar tendon
#

HELP: i am trying to get the creation time of a webserver file but i cant seem to find anythign that can help me.

DateTime webFile = File.GetCreationTime(baseAddr + file);

this combines the root directory "baseAddr" with the file name "file" used in a foreach loop to compare if a file on the local machine is older than one on the websevrer and update accordingly

fathom light
#

ok, sorry for asking for a spoonfed question, i pretty know many of aspect for unity, but one thing i havent done successfully before is networking (it was photon back in 2015 iirc)
so Im here would like some tips / starting point on where i can go to start this thing

I need a way to communicate between a server (windows pc) and ipad over wifi
it will be built on different project because the PC will be using HDRP while ipad will be solely using standard / urp / lwrp
and ipad will be able to send command to pc do various fancy stuff
it doesnt have to realtime and not that time sensitive (although low latency would be prefer)
ipad and pc server doesnt have to be connected all the time, it is just for some e-kiosk.

imagine playing wii u on large tv. except input will be touchscreen on ipad instead.
any tips & links appreciated

jade glacier
#

If its lan and you aren't making a real competitive game, you might want to just use Mirror or MLAPI

#

Neither will really put you down a path for tick based sims and such, but that layer of networking may not be of much value if you are just cosmetically syncing things.

wind ruin
#

He wants to build a RAT with Unity :p

#

just kidding

fathom light
weak vessel
#

Hi, I started recently with unity and my first (own) game. I planned to add LAN- and P2P-Multiplayer (direct connect via internet for more than 2 player). Now I have read that the UNET service is deprecated .... ... is the following solution available? What might be the best way to follow for multiplayer? ... ( it's a racing game)

jade glacier
#

You will want to completely back up from your game, and go make tutorial projects for like PUN2 and Mirror to even get familiar with the landscape of networking HLAPIs, then from there decide if you need to use a LLAPI/Transport and how you want to host your game type based on its requirements.

#

But you won't be able to even think about those things until you have made like Pong with a HLAPI to understand the challenges involved in networking, and the language used to describe them.

#

The authority model you choose will shorten to list of networking options.

weak vessel
#

ok. thank you! I'll take a look at PUN2 and Mirror

jade glacier
#

If you decide from that that you want proper server authority, Photon Bolt is another to do some tutorials for. @weak vessel

#

Being the only option out there with a full stack for server authority. It does however come with a lot of caveats, so you really want to understand most of the complexities of networking before deciding anything.

weak vessel
#

will build-in servers be included in the future? For my application dedicated servers won't be needed ...

burnt axle
#

has the namespace using UnityEngine.Networking been deprecated? unity cannot find it in my game

jade glacier
#

it has, quite a while ago

burnt axle
#

On unity unet deprecation faq it shows a timeline of unet support until 2022

#

does "support" for the hlapi mean that unity will keep the api updated and stable?

#

And ive read about the new network framework but im still confused wether the matchmaking service its payed or not?

#

Just saw price comparisons for photon vs unet and concluded to go to photon

jade glacier
#

Is Unity still proving those services? I assumed not but I guess they may still be.

graceful zephyr
#

@jade glacier I think until 2021 or something?

#

Idk

jade glacier
#

Haven't looked in ages, I just assumed it was shut down by now, but I guess they really can't do that without something to replace it and games relying on it.

#

@graceful zephyr

clever silo
#

@burnt axle Unity are keeping UNET available for a while yet... it's not being updated, and I wouldn't call it stable

graceful zephyr
#

Yeah I wouldn't touch unet with a 10 foot pole

void burrow
#

Hi! I'm a bit confused and was hoping someone could help me out, I was looking at PUN 2. Now from my understanding the system is basically that all clients can talk to each other through multiple servers, so no 'main master'. However I see games showcased on the PUN website which use authoritative systems. For example the game Robocraft. How do those games do this if there is no main master, what am I missing here? ๐Ÿ™‚

burnt axle
#

Ive managed to set up the local connection fine with UNET, but the matchmaking services has uncertainty regarding its namespaces so id just rather avoid the whole thing and build with photon instead

burnt axle
void burrow
#

Yes, I took a look at that. But it still brings up questions as how the game I mentioned uses PUN, which makes me think my understanding of PUN is just in general wrong.

burnt axle
#

Im not gonna say to much as im just learning the differences myself. What i understand this far is that PUN uses some of the old unity ways of networking and BOLT has its own way where you use alot of their components and such to sync varios data and states.

jade glacier
#

PUN allows for server plugins that let you give the relay some logic is likely what you are seeing

#

that and there is a Master that is given loose authority.Basically the first client to join a room is given the Master baton. If that player leaves the game another is selected and so on. @void burrow

#

Bolt uses its own codegen, physics, input system and controllers to create classical CS:GO style server auth.

void burrow
#

Ah, so instead of it being full authoritative it has some simple checks. That does explain why they severely used client side anti-cheats and why there were hacks I had not seen in any other game xd

#

Thanks for the answer ^^

jade glacier
#

yeah, because of the extra hops to the master, and it not being the hub of traffic, you wouldn't want to do full server auth with PUN2 without a server plugin

#

but it is good for making a final word on some things

void burrow
#

Which was for them a really bad choice, since it was a pretty competitive game ๐Ÿค”

jade glacier
#

yeah, they should have just used Photon Server really and coded more of that themselves

#

Or made the required plug ins

#

or... just used Bolt and dealt with the restrictions that come from having to use its systems

void burrow
#

Maybe that they did in the mean time, I haven't played it for a while. But back in the days you had hacks which would make you impossible to kill xd

jade glacier
#

They were likely just new to networking and PUN2 got them working code fast... and they didn't expect the success?

void burrow
#

No clue, never talked to their developers. I just saw it on the PUN website ๐Ÿ˜„

jade glacier
#

I am making an entire PUN2 component system for Exit right now, so I'm dancing around those restrictions right now.

void burrow
#

A question about PUN2, you said earlier on that one of the clients is given more authority, let's call it the 'master client'. Does it know that it's assigned that roll?

#

And do others know that as well, or shouldn't it be used like that?

jade glacier
#

yeah, everyone knows who the master is

#

and it has the IsMasterClient check

#

I forget off the top of my head the check on others, but they all know which actor is the master

void burrow
#

So all by all PUN2 is more fitted for games in which you don't really need authoritative servers but rather play with friends for example.

#

Let me rephrase that, isn't fitted for competitive gameplay. But rather for the opposite of that.

jade glacier
#

I make use of the master very little for my PUN2 work, and just assume that my assets for it will NOT be used for large scale competitive games. Trying to code in anticheats is tricky using just the master. By tricky I mean they will tax that players machine with a lot of rewind checks, and result it high latency corrections

#

So my intention is to eventually get with Tobi about creating some generic server plugins that create some universal relay owned objects that can be semi-intelligent

void burrow
#

Sounds to me like you could better use bolt in that case, or am I seeing that wrong xD

jade glacier
#

I am not making a game, I am working for Exit to extend PUN2 with components

#

I should be releasing the first beta for it within a month. Basically its drop in components that are all properly tick based and work together for things like hitscans, projectiles, item that can be picked up, dropped, thrown, health and energy systems, powerup pickups and such.

#

So its all specifically about making PUN2 super easy to make stuff with, not so much about trying to make the perfect networking system, since Quantum and Bolt already have the serious server auth and deterministic sides of things covered.

void burrow
#

Components are the relay sided plugins you are talking about right?

jade glacier
#

nope, MonoBs

#

lots of components like that

#

The relay owned object stuff is more just a conversation at this point

void burrow
#

Ah alright

#

But those things are owned by the master client I assume?

#

If so, wouldnโ€™t that have a decent amount of lag when picking up items as an example?

jade glacier
#

nope, its all just based on client authority

#

the pickup right now is a little extra latency for the first grab

#

I have the default for that being that ownership is given to the person grabbing it

#

but that is the big area where relay owned objects would come in handy later

#

for that reason. I will likely though work in prediction for grabs

#

and it will reconcile out if the master says someone else got it first

void burrow
#

But can you still call it a relay if youโ€™re basically making it a server?

jade glacier
#

yeah, but the relay already is a server

#

its just a dumb as a brick server

void burrow
#

But if you make it smart then whatโ€™s the point in not using Bolt?

jade glacier
#

Bolt answers other bigger issues with server auth

#

server auth requires a tightly controlled simulation

#

you don't just "server auth" and finished

#

the whole system requires a simulation, which requires standardized inputs and controller code

#

Bolt code gens its own controllers, input structs and physics

#

which is what makes it a bit restrictive to work with, but its what allows for things like shot rewind and resimulation

#

It was made in like Unity 4, LONG before the new physx changes in 2018.3 that allow for networking to play nice with PhysX

#

thus why fholm had to make his own physics and controller system for it

void burrow
#

I think I donโ€™t have enough experience yet too really understand this xd

jade glacier
#

few people do, nor really want to. Its why better HLAPI tools are needed.

void burrow
#

Just wanted to say thanks for the help btw! Iโ€™m going to try to mess around with PUN2 for a little while. โค๏ธ

jade glacier
#

If you want in on the beta it works along side standard PUN2

#

unmuted for the sin of pasting a discord link now?

#

yay.

burnt axle
#

Im a little confused regarding the dedicated server part for photon. Do photon only provide the networking api for unity or do they also let you run games on their servers (matchmaking) as well?

graceful zephyr
#

@burnt axle different products for different uses

solar tendon
#

Anyone have an idea why client.DownloadFile(url, path) doesnโ€™t seem to ever want to download a .mdb file extension?

#

Only files that are downloading in the loop that get a 403 forbidden error

gray pond
#

webserver doesn't have that extension in it's list of allowed files, thinks it's a database?

rich flame
#

Btw are there any official solutions for unet deprecating yet

#

I cant be bothered learning how to photon yet

void burrow
#

Unity is working on a solution, but if Iโ€™m not mistaken itโ€™s not production ready yet.

graceful zephyr
#

@void burrow that'd be an understatement

void burrow
#

xd

#

I donโ€™t really have the right to say something about it when I can barely my self do networking ๐Ÿ˜„

burnt axle
#

maybe im missing something, but do photon provide servers/cloud or just the networking api?

void burrow
#

I'm using PUN2 and they provide the servers. (The relay in this case).
Not sure how that's for quantum & bolt though

jade glacier
#

They use the same servers

#

Bolt may still allow other forms of hosting

#

but Quantum's ability to do determism without lockstep is based on the relay being the final word on user inputs

#

Photon provides the APIs as a way to get people to commit to using their servers

#

Quantum being the outlier for them, since they also charge for the API access as well.

#

The details I don't know, but that is the big picture

burnt axle
#

Ok so they give you both servers and apis

fathom light
#

i tried to use MLAPI, managed to do simple stuff like start server / host / client
and call a method from client on the server

however i having hard time trying to find best to test this connection,
so far i have success via hardcoding my pc ip
issue happen when i tried to test on my phone itself

i succeed on

  1. using same pc (edtior + exe)
  2. using different pc on same lan network (editor + exe)
  3. using emulator + pc (editor + emulator)

however since i dont have solution for wifi yet
so i thought i can use tether connection
but despite using the number listed on ipconfig, it cant connect from my phone to my pc

any reason why?
and can i work with something like usb wifi + my phone via hotspot or something?

paper stone
#

Sup guys, just uploaded my piece of code for an MMO game I'm working on right now.
It's just a beggining and contain a bit of mess but it may help someone struggling with base packets handling setup.
(Networking library is ENet)
https://github.com/Devdood/enet-mmorpg-server

#

Still missing quadtree setup and other meaningful stuff but should be a good start point ๐Ÿ˜„

graceful zephyr
#

@paper stone quadtree?

paper stone
#

@graceful zephyr Spatial Partitioning for server entities grouping. Just to take performance load from iterations when looking for other entities around etc.

fading apex
#

hey, i am starting a new project. its a real time strategy game
and i was wondering which netwroking solution is best to use here.
i already made another game using u net but I kept running into delay issues which is why i would like to avoid it
but I am a complete beginner to everything else so i need something that is simple to learn and also should be up to date
can anybody help me ?

deft thunder
#

Hi,
I can't really understand the pricing of photon. I if I subscribephoton server, I will get a server in the cloud

midnight swan
#

Good book or video tutorial to read to start networking?

stray scroll
#

Then maybe do some simple game like pong or three in row with sockets. And then try out the different 3d party solutions.

#

@deft thunder Not sure if best place to ask pricing of 3d party solution, but you should link to the model you're asking for. If you're talking about "Self-hosted Server" as indicated in name, you don't get a server in cloud, but for "multiplayer: Realtime" you do.

#

@fading apex Maybe explain what delay issues you're talking about? If you're complete beginner, look at my previous answer to Terror.Claw. Also explain a bit what your game entails, how many players, individual units alive at same time etc?

midnight swan
#

Thank you

fading apex
#

@stray scroll
For example in my previous game the player could move a gun barrel wherever his mouse cursor moved.

If one player changed the direction of the barrel it took like half a second for the barrel to change from the other players view. This meant that when player 1 shoots and moves at the same time that the bullet und both players views did not lign up. They went in complete different directions. I tried as hard as I could but I did could not fix it without getting extreme jittering in the barrel movement

stray scroll
#

@fading apex And you tried this on two built versions on two computers on the same network? Ofc if bullet or spawn of bullet is not synced it might not be in same place by packet delay.

weak plinth
#

UNet is deprecated, and will be removed from Unity in the future. A new system is under development. For more information and next steps see this blog post and the FAQ., does it mean that I can't work on multiplayer aspects right now?

void burrow
#

You still can, just with other solutions ๐Ÿ™‚

graceful zephyr
#

@fading apex deterministic lockstep is the way to go for RTS

fading apex
#

@graceful zephyr ok thx for the tip
@stray scroll yes i tried it on the same network and it kind of broke me XD i gave up on the project because of this reoccuring problem

graceful zephyr
#

@fading apex There isn't really much of an option, deterministic lockstep is the way to go

fading apex
#

ok thx i will look into that

copper wadi
#

im trying to check in which team the player is so he spawns with the right player model, but its not working, this is my code

        {
            GameObject go = PhotonNetwork.Instantiate(Gamehandler.Player.name, Gamehandler.TDMSpawns[Random.Range(0, Gamehandler.TDMSpawns.Count)].position, Quaternion.identity, 0);
            go.name = StaticUserProperties.Username + go.GetComponent<PhotonView>().owner.ID.ToString();

            Gamehandler.gameObject.GetPhotonView().RPC("AddPlayer", PhotonTargets.All, new object[] { go.name });
        }```
jade glacier
#

this is happening well after the teams will have been set?

copper wadi
#

yes @jade glacier

jade glacier
#

Is PunTeams.Team part of the PUN2 api, or is that your type?

fathom light
#

sorry if this not a correct place, but is it possible to do remote control via bluetooth + unity app on phone that control the app running on a pc?
assuming both device have bluetooth connectivity capability of course

copper wadi
#

@jade glacier it's part of pun2

jade glacier
#

I am only partially familiar with the handlers in PUN, but this seems a bit odd?
Gamehandler.gameObject.GetPhotonView().RPC("AddPlayer", PhotonTargets.All, new object[] { go.name });

You are passing it a null object array?

#

Which part is failing? are you getting the correct team value?

#

@copper wadi

copper wadi
#

i think i'm not actually checking which team the player is in so the if statement fails and the player is not getting spawned @jade glacier

unique anvil
#

I'm trying to make car crash physics over a network (Mirror) - rigidbodies and networking don't mix, but how would you all approach this?

void burrow
#

One of the developers from Rocket League had a talk about how their vehicles work with networking and physics. Which may or may not help you get somewhere :D
https://www.gdcvault.com/play/1024972/It-IS-Rocket-Science-The

unique anvil
#

worth a shot. I appreciate it

vital hawk
#

it also boils down on what kind of results you find acceptable

#

determinism with built-in physx is kinda lost whenever you move rigidbodies around manually

#

also this totally depends on the networking model

#

if you do client auth, just let each player sim their own collisions

#

on server auth, the best thing one could do is to figure out a point in time where you know both colliding players got the same data and then predict their trajectories from that and use that same data for both sides on collision resolving

#

all in all, usually people just hack these things

#

as it's impossible thing to get 100% perfect due to ping

#

(that RL talk is in youtube as well)

unique anvil
#

well I'm looking for at least some sort of real feel during a collision (e.g., if somebody is hit on their front right side, I expect the vehicle to pivot as it would in real life). Not worried about the damage aspect of it, I have those set up via syncvar hooks - but are connected via OnCollision. The wheel colliders do use RBs, but if I have to rework that aspect to ditch the RBs, I will. Right now the RBs just don't look right while moving and when they collide, it becomes a total mess real quick

vital hawk
#

I can imagine

#

replicating networked physics is one of the hardest things to do well as it's always a quite custom solution for your application

unique anvil
#

did WD2 have an online aspect to it?

vital hawk
#

they had 4 player co-op mode

#

afaik anyway

#

I'd really recommend going client auth if you can

#

it'll make things so much easier

#

(unless it's designed as some sort of e-sports where cheating could be a real issue)

unique anvil
#

well I have it set up so each playerprefab has local authority...and enable their own scripts including the OnCollisions...you're saying keep the OnCollisions all client-side? Or are you referring to something lower level than that?

#

I saw forum posts about how making your own physics occur in Unity isn't that hard to do..yet I have found no good examples of anybody actually doing it