#archived-networking
1 messages ยท Page 99 of 1
At the end I guess 
Let me try again.. maybe will be fixed as layout problem .. idk
Multiple methods are available to install the MLAPI package.
I did this
You gave me it yesterday
It was a new project..let me try again
No error now, so I guess its fine
making an FPS for VR
would you use KCP or ENet, and why?
So I tried making a simpler list (NetworkList<int>) and it showed the same behaviour of having values only serverside and the client read it like if it was empty
Does anyone else had had any problem with NetworkList?
Can someone @ me if they know PlayFab? Ive got a very simple issue but I cant find anyone who can help me
This is happening when trying to join with another client. To host the server works perfectly.
Also, on host client i can see there are 2 players
Im trying to get PlayFab to work, check out this thread (https://www.reddit.com/r/Unity2D/comments/n23n7u/can_anyone_link_me_to_somewhere_or_help_me_make/) if you know PlayFab
Look in the comments
You could join the Mirror discord, there's a PlayFab channel there
You might have more luck
Any solution for my question ? 
What would be the best mp solution for unity for a mmo realistic fps I'm new to networking and want to know the best product to use in my category
Anyone ever use MLAPI.Relay by TwoTen? Is there something I have to do code-wise to accept a client to connect to a host?
There area few people on the MLAPI discord who have used it. They might be able to help you. Link is in the pinned post.
Anyone ? 
It seems to be very difficult to get answers for networking problems xd
I would say if you want faster answers, join the relevant Discords, the Mirror and MLAPI Discords are used frequently
Fixed : removed Network Object component from one of player's children
Do you know any tutorial that explains how to port forward to connect 2 clients from different countries which is compatible with MLAPI/UNet transport ?
I usually hear mirror when they are making TCG online games, what should I use? was wondering how we could make a TCG game that could be uploaded in googleplay? or as an exe with online battles?
Hey guys, does anyone do P2P here? Just wondering what's the best way to send and sync data across all clients if someone picks up an item?
Any example or lead on how to do this the right way?
@mortal willow Your networking solutions usually give you "RPCS"
You call a special method on a networked gameobject
and that same method gets called for the same object with same paramaters on all clients
mirror with ignorance or kcp is good
Hello ! I can join with 2 clients on my game, but when I try to join from 2 devices on same network it does not work. What is the problem ? Do I have to specify what IP should second device connect to ?
Dose anyone know a video tutorial for epic online services?
I read the documentation but I have a hard time putting some stuff in to use and it would be probably easier seeing an example.
@weak plinth you should probably host using your local ip
@tranquil nest https://www.youtube.com/watch?v=3u0EgoD-4YQ&list=PLmi311Or-z04UD2lCtjS0KLD_YhgI5C-Q&ab_channel=Aphix
I guess I'm the first :DDD
Discord Server: https://discord.gg/qwz7nW43wf
Music Credits
Song: LAKEY INSPIRED - Arcade
Music provided by Vlog No Copyright Music.
Creative Commons - Attribution-ShareAlike 3.0 Unported
Video Link: https://youtu.be/VOZc7020k2U
I figured out how to do this, thanks 
how about epic for unity?
Authorization server shooting games
I have some problem with sync shooting and player movement. For example a remote player or bots fire at the different direction, somewhere in past position. The weapon is not aimed at players
Movement inputs (client) and movement states (server) are sent and received in a fixed rate
but shooting input is not.
I want to add it in snapshots as well.
My question is:
Ticks: t1,t2,t3,...
Suppose a remote player shoots at time t (before snapshot t2 and after t1)
Should it be sent to the server at snapshot t2?
How can I create a snapshot for it so that after receiving, other players can play shoot animation for that remote player at the right time?
I have another question too.
When consuming a medkit and then cancellation
Suppose players can cancel medkit consumption by pressing a button.
After pressing that button, should the client wait for confirmation from the server to cancel it or immediately, cancel it and then after receiving the data from the server, check the current state with the received state and if they have conflict with each other, update it?
Different actions can cancel the medkit consumption. Shooting, switching weapons, etc. For these situations, I think it is better to handle it completely server side.
@analog shoal
If you have a server-authoritative tick-based simulation, make sure everybody shares the same timeline (tick N is tick N for everyone). As part of that, make sure clients rollback and re-simulate from the snapshots they receive.
(I've paraphrased some of your questions)
What can I put in the snapshot so that other players know to play the shooting animation at the right time?
Easiest thing to do is include animation data in your snapshots. If that's too large, see if you can infer animation triggers from the other snapshot data.
I have some problem with sync shooting and player movement. Everybody is shooting at where stuff was in the past.
Relativity always wins. You can either run lag compensation or make everybody extrapolate everything. For lag compensation, make the server store past collider states and have it resolve hits using that.
Should the client wait for confirmation from the server or predict the outcome of doing X?
This is up to you. As a general principle, if you want some code to run exclusively on the server, just remove those lines from the client version. Clients will sort themselves out when they get another snapshot.
What port should I forward to allow other IP connect to my host ? (MLAPI/UNet transport)
Im trying to port forward now
Its first time I'm coming this deep into router's settings
Step 3: Next, locate the port forwarding settings. Typically this will be under Advanced and then Port Forwarding or Virtual Server.
I dont have this ๐ฆ
Huh, that's odd
Really ? ๐ฎ
Well it says forwarding, and it has port numbers and protocol
I believe it is UDP, could be wrong though
Not sure on the first one, you'd have thought the router would know your external IPv4
The external port should be the same though, 7777
maybe its IPv4, too ?
You might have to Google what that means for your router brand
Unless you literally put your own IPv4 address in
Bolt has Nat Punchthrough. ๐
If youre talking about photon bolt, youre right. But it only has 20ccu for free. After that youre gonna have to pay. And photon are very expensive compared to what you get.
hey guys can please some one help me i got a bug in my multiplayer game where the client if jumps the player flying away :S can some one help me ?
can anyone help me how to make a cloud gaming server for free
Can anyone share a good way to share item data (name, description, etc) between unity projects in development?
Getting any good server for free is nigh-on impossible, if you're talking about hosting for a Unity networked game, Photon has a free version but only for a few CCU
I would be surprised if you found any server space worthwhile without throwing any cash at it
I recently decided to implement multiplayer in my game. I am a total noob tho. Shall I go for unity's new solution or for mirror/something else?
Mirror or photon for an already existing, time tested solution.
ok thank you man
Hi! I'm new to Multiplayer and followed a tutorial from SRCoder. I did everything what he did in the tutorial and it worked, now i tried to implement it in my game, but if i try to join, the transform doesn't sync. I have the networkTransform object on my player but that has a lot of children. Has that anything to do with it?
HOW CAN I MAKE A ONLINE GAME WITHOUT SERVERS?
https://www.youtube.com/playlist?list=PLbxeTux6kwSBxS567wiVk1j2aJP4ard6Y I think you want this.
any reasons why downloading MLAPI by git URL would not work?
when clicking 'add' i get errors
What errors?
should i try in an empty project or download it some other way
oh ok
P2P?
and i need to restart my PC right?
If it asks you to, I'd say so
I think it worked thanks <33
Unfortunately I don't speak Italian, but judging by the title that is about P2P
even p2p uses some servers, to do so-called NAT punch through. But it is much cheaper than a server actually hosting a game instance
How can I run a script after host has started ?
Now, my script runs even before I host
Hi, Do you know how to set an opponent's nickname with Photon (PUN)? I create a game for 2 people and I don't want to use the array. Down I paste the link to a forum question.
https://forum.photonengine.com/discussion/18218/set-opponent-nickname/p1?new=1
How will your players find each other without a server?
You must have an IQ of 200
Try Peer to peer I guess
But even then I think you will need a relay
my PSP support the online without server
play sation p
What game is that?
is a console
I think you're talking about ad hoc local connections, but that's not really "online" in the usual sense
Exactly
Its local multiplayer
If you want actual online without servers, you need to use the P2P network solution. But even then you will need a relay.
that console have 2gb of ram
hmhhmhhmh
so much
my computer has 4 gb
and the ps4 has 8gb
ok?
Unity can build for PSP?
i don't want make a psp game
Even if it ever could, Sony isn't going to give anyone a dev kit anymore
yes
Ok so what was your question?
nothing........
k
@echo flower Don't post off-topic media.
hi
NetworkManager.Singleton.StartHost();
and
NetworkManager.Singleton.StartClient();
throw errors that
Assets\Scripts\MenuScript.cs(11,24): error CS0117: 'NetworkManager' does not contain a definition for 'Singleton'
even though i have assigned a player prefab to the network prefabs
please help
I'm trying to set up UI buttons btw
ok so I've been looking at ths MLAPI thing and trying to figure out how it actually sends messages, and as far as I can discern from looking through the source code, it uses UNet internally o_O
But if UNet is deprecated and that's such a big deal that Unity has warnings about it on every page of the manual saying not to use it, then uhhh
You should be able to select the Transport you like
How does MLAPI work then? Are they planning to change it to not use UNet, and if so, what will it use?
I can't find a transport system other than UNet anywhere in here.
Looks like your network package is not recognised, can you show the using directives on the top of the file ?
like, I found the MultiplexTransportAdapter class, but it itself seems to just lead back to UNet when I dig through the references in the code files.
You can selelct the transport from the NetworkManager component. Probably need to install some first ? DIdnt try the new MLAPI yet
That's what I did. The two options in the list are "UNetTransport" and "MultiplexTransportAdapter"
The really crazy thing is that just now I decided to step through the tutorial and it's telling me to select UNetTransport O_o
I know you can also use com.unity.transport but thats pretty low level you would code yourself
We plan to use our new transport the "Unity Transport Package" in the future to replace the UNetTransport
I tought you could use third party transports but I'm not sure know ^^
Also there are plenty of other non-official transports you can use with MLAPI https://github.com/Unity-Technologies/mlapi-community-contributions
Do I just add com.unity.transport as a package via the Git URL thingy?
ooooh those look cool
com.unity.transport is not supported yet by MLAPI. Most likely will be with the next version.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MLAPI;
As I mentioned way back last time I brought up this topic, I'm interested in exploring how to bend this concept to my own purposes via code, so it's good to know it may be getting support for new things but for the moment, while I'm poking around, it not supporting something is no problem ^^
that looks ok. wth.... do you have any *custom *script that is called NetworkManager ?
This com.unity.transport thing looks like exactly what I want. Thanks~
yes but its empty, should I delete it? (im not using it anyway)
yeah try to delete please, might confuse the compiler
or force namespace with smthg like MLAPI.NetworkManager.Singleton.StartHost();
oh great ๐
actually the code is compiling but i can't press the buttons. Also when I 'start as host' via the network manager in play mode, the player spawns normally but the camera doesn't change itself to the player camera
im kinda confused
man it sure is nice when sample code actually works >.<
The sample code from the Transport package documentation was completely broken and only just now did I get it to quit throwing errors ^^;
Please help xd
Transport uses DOTS internally -_-
I've gone insane and tried using .NET directly xD
https://imgur.com/ZP4CfX8
So i am creating a Multiplayer game using Photon Pun 2.
Right now, the game is pretty simple, a player spawns and can shoot some spears.
I am using everything correct, like photonView, PhotonTransformView, PhotonRigidBodyView, etc. But when the player moves or the spear is trowed, it moves and it goes like a little backward really fast and then continues to move and goes a little back again and so go on. If i am the player or if the spear is mine, the movement goes really smoth, but if it is another player or another spear, the movement goes like i described.
I am using PhotonNetwork.Instantiate but i think i may need to add a PRC function to set the position of the instaciated object in an players view, i am right?
I though doing the same on the bullets, when firing, i instaciate then i set a PRC function to set the position.
Or should i instaciate with a PRC function??
Or should i use the classic photon transform view?
Need help on this, because i am a little desmoralized because this multiplayer lag is kinda ruinning my expectations
So the current way my netcode operates, is every tick, the server just sends each client a list of entities with position/rotation etc and if the client sees that he doesn't have an entity on the list, or has an entity that the server doesnt have, he knows to spawn/delete that entity
should I just be doing RPC's instead, to spawn/delete?
If you are able to spawn the related objects from said list, don't use RPCs to send that. You can send byte[], int[], hashtables and other types in RaiseEvent. Do this on your network tick (10..20x per sec) and you're good.
What is raiseevent?
When you Instantiate a networked object (with PhotonView on it), you don't have to use RPCs to set values on it.
When you throw a spear but use OnPhotonSerializeView or RPCs to "observe" it's position, your local simulation and the updates may assign different locations. This can be smoothed and solved but apparently in your case, there is a delta, which is visible.
Simplified: use OnPhotonSerializeView (TransformView, etc) to sync characters.
You can use RPCs to shoot. As a projectile is easy to simulate, don't update it's position. Calculate this as good as you can (compensate for lag, move smoothly). The shooter or the hit target can detect and signal a hit (if one happens) via RPC.
Oh I don't use photon or any 3rd party libraries
I was just using RPC as a general term for sending messages
I see.
Well. Yes, then use a RPC / command / message for it.
alright
I think your implicit spawn/delete using set differences works better than having the server send a "Spawn this." RPC if that's what you were asking.
@dense hedge on point, i agree
Hey so ive been struggling for months to get this to work. So bassically when I get 2 players in a scene, it somehow switches and glitches out. At one camera theyre stuck together and moving. And at the other client theyre stuck together and its weird. I dont know how to fix it. If anyone can help thanks. I use C# and Photon Pun
I'm stumped on a general problem regarding UDP messages: I had a previously working Quest app which listened to UDP packets in order to do server discovery; as I switched over from Quest 1 to Quest 2 the app won't work anymore, it simply won't listen to the network
since I'm 100% sure that there's some thread fuckery involved in the background, what would you use for a barebones UDP listener? Keep in mind it's not being used for a multiplayer game, think of it as a remote controller from a desktop app
(sorry if this is cross posting but I just realized there is a networking section) can anyone help me my question is in general-unity.
do you guys know some good ways to write deterministic simulation code in unity?
Photon Quantum...
well, something i can use for free ? ๐ Quantum is like expensive right? ๐
For now it is, yes
Maybe in the near future we'll change that. But not possible yet.
Here's the thing:
- nothing in unity is deterministic.
- so, technically, you need to build every single system you need (physics, navigation, transforms, every-thing)
there are a few open source FixedPoint math libraries around (not super good performance, but valid nonetheless), a couple of physics engines (also not good performance, but perhaps useable)
Those are the super basic minimal things you need, besides a way to coordinate your either lockstep OR (better) predict rollback netcode
If you are only developing a 1v1 simple game, this last part can be achieved with GGPO over a p2p transport layer... But for anything with more than 2 players, the only solution I know of for Unity is quantum... That's the fact (at least AFAIK)
Disclaimer: I'm one of the developers of it...
hmm well i wana do an rts so i was thinking the deterministic lockstep is the way to go.
oh rly? well thats cool XD
ye, for RTS you also need to develop a few bespoke things
but still might be to much for a side project for me to inverst in
Like group path-finding (probably flow fields)
if it's a small scale rts ( a bit like warcraft 3), navmesh pathfinding (like ours in quantum) can be used
but for massive numbers, it's generally flow fields
well yeah i looked a bit in flow fields a while ago. Its a very cool aglo for navigation. But before i can go more detailed into that need some math basis to write the simulation. I dont want to write all the vector math myself so i am currently looking for libarays i could use.
at least the math to replace floats you have a few
full Vector, perhaps as well... I just don't search anymore because we have our own.
that's the easiest part
well 1k per month ๐ maybee when i own a company one day
250 if I remember correctly for a single seat
250 per month is still very expensive for a hobby project
well but thanks i guess i have to search a bit more for solutions
They might give you access if you ask them nicely ๐
XD
Hello !
I am trying to make the enemies follow the player when he gets closer. I am using MLAPI. How can I get the transform for everyplayer or how should I make this script ? Any advice, link, or code ?
Can you use ONLY steamworks to make multiplayer for an entire game?
And if not, would you guys recommend Mirror or Photon for a small fps game? It would be based on player-created lobbies and might go on steam at some point
@faint plaza I'd use mirror i were you
Mirror supports steam transport
You should be able to switch your transport at some point if you want and have your game working on steam
Ok, Ill try that out. Thank you
If you knew what you know today in the beginning of your project, what networking solution would you pick for a 3-5 player coop isometric action rpg?
Hello !
I am trying to make the enemies follow the player when he gets closer. I am using MLAPI. How can I get the transform for everyplayer or how should I make this script ? Any advice, link, or code ?
Have you tried Googling it?
Yes ?
Nvm, you got a good response in the MLAPI Discord
Well, still searching for a solutin ๐
Luke gave you a great one?
Its kinda slow, I am looking for a faster one maybe
Well currently you don't even have a solution, and providing you don't have 100 players I don't see why it would be slow?
How many players are you gonna have?
Its a MMORPG, wothout game sessions, so all players will be checked
Sigh You're making an MMORPG...

hey i'm using a .net Network library called Network. I can't connect with unity with a server on my own pc for some reason. Do i have to do something special in general for it to work?
can you invite me to de MLAPI discord?
There is a link in the pinned message of this channel
Well whats the ip your trying to connect to? And port?
Even with the same computer you can be blocked by the port, even if your using the ip 127.0.0.1 as the ip your connecting to.
i found out that its an error of the network library
some versions are not in sync with each other
Hi
I was actually trying to build my Unity project which had multiple scenes with WebGL and nodejs as backend so that I could also add some data
This is the error I got with 3 scenes
MoveMap.loader.js:1 wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'
When I removed the first and last scenes of the game, so that only one remained, it worked quite nicely without any such errors
Can anyone please tell what could be a possible solution
Show first line of code of MoveMap.loader.js ? Somehow your file is not recognized as a wasm. If you stream from a server I suspect you didnt send the MIME type in the headers. If it's from local system maybe the path is wrong ๐คทโโ๏ธ ?
Hi
I have two scenes which are lobby and game. I have two buttons which are to host or join a hosted game. So i have made a script for menu and attached codes into buttons to host or join onclick. Just like NetworkManager.Singleton.StartHost();
So it creates default prefab into scene when i press host button. But im stuck here with how it should be. Do I need to load next scene and then Start Host?
Or Start Host() in Game scene on Start(); after i press Host Game button to load Game Scene?
I assume it's MLAPI, but I imagine it's similar for other solutions too
Hello, so last week I went on a vacation and didn't open Unity for a week or so, and everything in my game worked great, but now all of a sudden when I try to click play in the editor, everything just basically disappears. It seems like at least my awake and start are being called considering I have them do some object initialization, and the objects are there, but everything else is not, and MLAPI says it's trying to destroy object 0, but doesn't exist anymore. I honestly have no idea how to go about this, nor know how to debug something like this (relatively new to Unity). My NetworkManager also does not seem to be instantiating my "player" prefab.
Thanks in advance! Here's some screenshots:
(game is super simple at the moment btw)
before clicking play: https://i.imgur.com/yY32XOu.png
after clicking play: https://i.imgur.com/hR7CzI5.png
tl;dr: everything disappears when i click play
Thx
close unity, delete library folder, open unity
What are the differences between MLAPI and something like Mirror? is one better than the other?
MLAPI is certainly newer
@slim ridge nope same thing :(
Lol what
Not that hard to understand what I. Said if you read that message after the one I put above it.
๐
Guys iam learning mlapi. I got stuck with a question. I want to create a lobby and list rooms there when people create a new room as a host. So would i need to hire a server to list online rooms which are created by people. Or mlapi has features to list host rooms which are active?
And free?
MLAPI itself does not have a room list feature. You will need to host your own system or use a service. The MLAPI Serverlist can be used to host your own server list https://github.com/MidLevel/MLAPI.ServerList
Ok thanks
Hi! Any of you has made a websocket server in Unity? I found some libraries but they don't seem very up to date
@frozen stump Does Mirror count? ๐
You probably could borrow the transport to have something that is more likely to be supported and in use.
@spring crane well, my best bet is to include a nodejs process and use the console to communicate with it
Hey im trying to download photon transport with this link:
Am i doing aomething wrong?
Im copying it into the 'add paclage from git URL'
It loads for a second and then nothing happens
If any of you have experience with Unreal Engine, which game engine is easier to implement multiplayer?
can i ark some question?
Of course, ask away
I have a problem with culling mask not working in game. but work on camera preview
And Collider not work
This problem happened after I downloaded 3D game kit
Paying someone for help ยฃ$ยฃ$
I don't think this is the place for that, you did also say it in #๐ปโcode-beginner ...
Thank you very much.
I'm using this code:
[Command]
public void CmdSpawnBullet() {
GameObject bulletClone = Instantiate(bulletPrefab, bulletExit.transform.position, transform.rotation);
bulletClone.GetComponent<Rigidbody>().velocity = bulletPrefab.transform.forward * bulletSpeed;
NetworkServer.Spawn(bulletClone);
}
to try to spawn a bullet across the network, but for some reason only the client instance can spawn it on both instances (like when I shoot on the host+client instance, it shows on their screen but not on anyone else's, but on the client-only instance it works as intended)
If there is a better way of doing this, please ping me and let me know, but I think I fixed it by getting rid of NetworkServer.Spawn() and making the CmdSpawnBullet call a ClientRpc that has all of the old CmdSpawnBullet code pasted into it (except for NetworkServer.Spawn())
I have TransformView on it and it has the same result. The movement of the player sometimes goes a little back and moves foward again. It doesnt feel smoth at all. I tried every option that i could find and i cant make the movement smoth. Thats killing my motivation for this
So you know how in some games, entities won't update on the client, if he's too far away from that said entity?
how does that work? Does the server determine length of vectors and just not send to that client? Or is it the client's job to just not update it to save cpu?
because right now I'm running into (not really a big problem yet) where if I'm updating 1,000 entities w/o colliders from server->client, it takes the client around 3/4 of a millisecond just to apply the transform.position to it
transform position seems mildly expensive in this case.
The server-side is called interest management (or area of interest). It's basically collision detection. You have some accelerated broad-phase, optionally followed by a simplified narrow-phase.
For example, Fortnite servers use a grids to filter the list of relevant objects down to those in the same grid cell. IIRC they stop there, but you could also iterate those filtered objects and check "Does this object's bounding box intersect a big sphere centered on Player X's avatar?" etc.
What about something just as simple as calculating the distance between the player and the entity? https://docs.unity3d.com/ScriptReference/Vector3-sqrMagnitude.html?_ga=2.19174456.1250729649.1620708794-1306739617.1608297847
If entity is too far away, don't serialize it for the player
In any case, you'd probably want to sort by distance so you can prioritize the closest entities, but iterating every entity for every player isn't going to scale.
You're absolutely right about that last part
so should I have the client do it instead? Just check distance to see if he's going to update that entity or not?
So you can have the clients pause updates, but tbh if setting 1000 transform.positions is slow, you're jumping around in memory too much. Branching might make it worse. I think you should keep similar objects/components packed together.
I have three separate entity types. Players, cars, and generic entities
I think diverging any more would be too clunky
I'm not sure though
You mentioned fortnite doing grid based stuff. Does the server calculate that and then re-serialize the list of entities for all players?
So Epic has this "replication graph" arch. where each "node" is a filter that lazily updates its list of matching entities. The lists are incrementally updated once per server tick.
When the server goes to build a packet for each client, it checks what nodes each client is subscribed to and just starts writing entities from the intersection of those nodes' entity lists.
The grid cell is just a kind of node for them.
That sounds complicated but alright
I still have no clue how I'm gonna solve this problem
for half of the problem, I guess I could just check if the rigidbody is sleeping or not, and not include it in the serialization if it is
Sure, I was just using them as an example. The grid is still pretty simple. On the client, you could also maybe treat the rigidbodies of entities who didn't get an update as kinematic / put them to sleep.
client doesn't use rigidbodies, only server does
client just translates using server data
I guess I could just rework my game to focus more on placeable static entities instead of rigidbodies
but I'll still need rigidbodies for my bullets ( at least I'd like to ).
Is it possible to get smooth first person gameplay on an authoritative server with prediction with a tickrate of 10-20?
You'd need some heavy lerping right?
So far I've been unable to get smooth movement with a tickrate below 30hz. It just looks jumpy
It's definitely possible. Plenty of CoD games have a 20Hz update rate. I dunno what you mean by heavier interpolation, you just delay it more.
If you imagine snapshot interpolation like scrubbing an animation timeline, you want your cursor at least 1 snapshot behind, so you always have something to lerp toward.
Lowering the update rate just increases the spacing between snapshots, so the interpolation delay has to increase.
You can have the server tick and send updates at different rates btw.
Like Joy said the basics of Interest Management starts from distance checks. Then there's Halo multiplayer who rates every entities some kind of update framerate score based on how relevant it is for the player client to witness it. There's a GDC talk about that, i could find it if you're interested
Actually you said distance and Joy talked about collision-like checks and grids, but that's the same spirit ๐
It's probably this one https://www.youtube.com/watch?v=h47zZrqjgLc&t=5229s
In this 2011 GDC session, Bungie's David Aldridge discusses the programming that drove Halo: Reach's online networking.
Register for GDC: http://ubm.io/2gk5KTU
Join the GDC mailing list: http://www.gdconf.com/subscribe
Follow GDC on Twitter: https://twitter.com/Official_GDC
GDC talks cover a range of developmental topics including game des...
Yeah, proximity or visual salience (how much something occupies your FoV) are usually the best heuristics, but to guarantee eventual consistency you really want all kinds of relevance to feed a per-client "send priority" value.
Whether it's distance, putting certain entity types in different frequency buckets, "relevant only to owning player", etc.
IMO the most basic filter is "Did this entity change?" Use that to set a non-zero send priority for that entity that then accumulates until sent.
Yeah Unity dots netcode does implemented smthg like that https://github.com/needle-mirror/com.unity.netcode/blob/3a82fef96a05f60cb7df178a3373874d79c3fe4e/Documentation~/ghost-snapshots.md#importance
grid-based + age
+ignore the overflow, but I never saw how this part behaves
wdym overflow
Entites that didnt score enough interest don't get updates sent
I guess you have to tweak it
depending on FOV and such
dependig on scale of your game
You don't need to do anything special for stuff that doesn't fit in the packet. The age contribution to importance always increases, so the leftover entities will generally be the most important for the next update. Really, everything will be sent long before age saturates.
"Once a packet is full, the server sends it and the remaining entities are missing from the snapshot. Because the age of the entity influences the importance, it is more likely that the server will include those entities in the next snapshot."
Exactly.
So you would say it's a hard limit regarding hardware anyway, hence the Interest management with any strategy you want to at least smartly pick which one get prioritised
A 32-bit integer should be more than enough to hold the priority value. The limit is bandwidth.
Really, everything will be sent long before age saturates.
That's the part I never tested so wasn't sure about how efficient it is
Yep sure, was thinking about bandwidth
Keep in mind that the priority resets to zero when sent to the client. Packet loss is generally far below 1%, so if you're sending updates 20 times a second, almost nothing should have a large age.
I can't detect this without more info, so my last resort is to point towards the PUN Basics Tutorial. It has characters in it and should sync them reasonably well. Maybe you have a go at that, read and code-along to check if that's any better. If so, apply the knowledge to your case.
I think i will one from scratch a see what is missing
Yes, this is usually a good idea and learning process. It could be a number of smaller/sneaky things that went wrong, so .. hard to say.
Hi. I have issues establishing a port forwarding and making it work with MLAPI. Has someone already done this?
So, is it viable to reserialize 1,000 entities for 60 players each
only serializing entities close to player?
assuming you're only serializing entity ID, position, and rotation
It's possible, yes, but half the point of doing interest management is so you don't have to send 1k entities all at once. Each packet can only fit ~1200 bytes (1280 byte MTU). ID, position, and rotation is ~32 bytes per entity.
If you were sending "full" snapshots and really clever about compression and not repeating work, you can pack a large number of entities and get away with only serializing a handful of snapshots (most of the time), but mixing interest management and compression is more complicated.
Hi all. I am trying to make a matchmaker system for my game using mirror and I need some way to have a list with current matches / status on the server. I need to be able to access and update this list by all three (client, roomserver, matchmaking server). Any ideas what would be the least resource intensive method to use about this? (I would like to avoid having to set up sql on the server if possible). Thanks in advance.
i wanna make a multiplayer game in which you can get into a room with an invite, the game is basically: you describe a word with single-syllable words, and people try to guess and rate it
the problem is that i didnt work with networking before, and have no idea what to use
Should I attempt at creating my own TCP/UDP socket or just use MLAPI? https://docs-multiplayer.unity3d.com/docs/tutorials/goldenpath
Tutorial that explains adding a command line handler, network variables (client and server-controlled), network transforms for auto-movement, and RPC introduction.
I'm looking for something reliable, but I understand how much of a pain it is to custom code packet handling
I'm trying to read the currently connected clients from a client through a MonoBehaviour. I called NetworkManager.Singleton.ConnectedClients.Count to get the count of clients, but it doesn't seem to work... Anyone knows why?
Don't you need a ".Singleton" in there after NetworkManager?
Ah, yes I do that as well. Let me edit my message.
I'm using a linter to make sure my code is following the standards and syntax, so I'm assuming there's something wrong with the logic.
Hi guys
im trying to reach UNetTransport script from NetworkManager object via another script that i attached to Network Manager object. But unity says its not found (NullReferenceException.)
GetComponent<UNetTransport>().ConnectAddress;
You included the namespace for it?
idk
Well neither do I, and I can't read your script
Don't you want to be deriving from NetworkBehaviour instead of MonoBehaviour
Presumably, this script is on the object containing the UNetTransport component?
Yes and it also has network manager script. I chose unetTransport from networkManager script so it added UNetTrasport script automatically. And i tried to reach this script to take connect address.
Move the text setting line below your IF, that will be more useful
Ok
Unity's invaders tutorial do it like this.
var uNetTransport = (UNetTransport)NetworkManager.Singleton.NetworkConfig.NetworkTransport;
if(uNetTransport) m_HostInput.text = uNetTransport.ConnectAddress;
No debug in console
Should i reach UNetTransport script via NetworkManager script?
im confused
So you got the error, but no Debug?
Yes as u say
In that IF remove the .ConnectAddress
why? i need to take this address and text it on scene.
I am well aware, but we don't care about the address, we want to see if you can get the component
Ok let me try
Although, I'm sure you can get the component
No debug in console*
Then unfortunately, I have absolutely no idea
Thx for trying to help
anyone here knows if you can do something similar to server select in club penguin with photon?
When in doubt, always begin with double-checking the docs ๐
@patent fog Yeah, I did! This indicates that it should be readable on the client, and modifiable on the server?
At least that's how I interpreted it. What I want is to read the amount of connected clients from a client. :)
Dude read it by server then take info into client
Literually what I did.
Nope, it says it will be populated on the serveur only. So I would expect it to be empty on clients
That makes sense! Thank you for clearing that up for me!
Hello, little advice to a noob here please. building an 1v1 online game running on photon (basically one of the two players acts as a host) and was able to hook up Playfab today, great tool, especially the json functions you can run serverside.
However, if my game is running on photon, is it even worth it having these functions on the server, not going to make cheating any harder?
multiplayer is new to me
You want to do checks on the client side first before passing them onto the server to validate again
Should each GameObject only have 1 script that extends NetworkBehaviour?
@faint plaza According to the documentation, a GameObject can have multiple NetworkBehaviours, but only one NetworkObject.
Hello Can Somene help me with installing MLAPI. It says i have to install Git in order to download it but i have Git and i can't still install it.
What happens if you try installing it?
I get this error
Did you just recently install Git? If yes restart your machine (not just Unity)
no i already had git
There is a "add to path" flag you need to set in the installer maybe try reinstalling it and make sure you set the flag. Else you can download the .tgz from our release and add it with the "Add Tarball" option in the package manager.https://github.com/Unity-Technologies/com.unity.multiplayer.mlapi/releases/tag/0.1.0
It worked thank you for your help ๐
I guess you should follow a tutorial
yeah, but a lot had paid solutions
I'm sure there are free tutorials?
ok
https://www.youtube.com/watch?v=4Mf81GdEDU8
This is good if you're using Unity's MLAPI
ok
Depends on your game
Yup, like asking is a screwdriver better than a hammer ๐ Depends if you need to put in place a screw or a nail
And to some extent, your money
True
Photon needs payment over a certain CCU limit (10 I think) but Mirror needs either dedi servers or P2P
I'm using Mirror and I added a script that extends NetworkBehaviour to a child object of an object with a NetworkIdentity, and it is trying to automatically generate a NetworkIdentity for the child object. Is there a way to not have this happen? Or do I have to just put all the NetworkBehaviour scripts on my parent object?
For now I'm just adding a reference to another script that extends NetworkBehaviour and calling methods through that, but I'm sure theres a better way to do it
Good day, I'm doing an FPS where the players have to collect bullets, I managed to collect them and add them to the variable but only in the host it adds to that variable and in the client not, and I no longer know how I have to put it so that it is added for each player.
what would be better for an fps mirror or photon
They're both capable.
but whats easier to put together
How relevant this table is, I do not know, but I've seen it a few times
Don't be fooled by "Free", in those cases you use peer to peer or host dedicated servers
peer to peer?
Think Minecraft LAN world
Also Photon does give 10 CCU free I think
ccu?
Concurrent users
concurrent?
I'm not your dictionary
ok
one trip to google later...
so a max of 10 users at a time can use it for free?
but over ten and it costs you?
Yeah, I don't know their exact terms and pricing
Photon Unity Networking framework for realtime multiplayer games and applications with no punchthrough issues. Export to all Unity supported platforms, no matter what Unity license you have!
Oh it's 20 free
Don't be encouraged by a 5 star "ease of use". If you're new to this, you're not going to have a fun time.
i know a little bit about mirror
Is TCP going to be significantly slower than UDP in terms of CPU usage?
can I turn off nagle's algorithm for more speed?
CPU usage is usually not an important factor when choosing between TCP and UDP. CPU performance of TCP is not significantly worse than equivalent RUDP protocols. You can turn off nagle's algorithm but it shouldn't affect CPU too much. Disabling nagle's algorithm will disable batching of your TCP packets which will mean more packets are sent out. This can reduce latency but increases the amount of bandwidth used (because more packets means more packet headers sent) if you send a lot of small packets.
Very informative. Thank you
Though no matter what you do, you can't prevent TCP from blocking newer packets when earlier packets are dropped.
I mean if you have a stable internet connection, that shouldn't be much of an issue right?
shouldn't be happening all the time, is what I'm trying to say
I sort of need reliability for order of packets due to the nature of my netcode. Entities only update when they're modified
If packet 4 comes in then packet 3, that's gonna cause some serious problems
Packet loss might be rare, but if the server just keeps going, your client still has to deal with being knocked out of its relative alignment by TCP re-transmission (it'll fall behind by at least RTT).
Reliability and ordering are separate. You can track what sequence number you're expecting to arrive next and buffer incoming packets in an array that you sort and dedup.
I'm not sure if there's much to be knocked out of, since my clients just accept info from the server as fast as it's being sent
I do use UDP however, to get movement info and such from client to server
since that always sends each tick no matter what
anyways I need to go to bed, I'll read your messages in the morning
Not trying to say TCP is bad, but its weaknesses in real-time stuff can't be ignored. They're worth knowing. TCP (in effect) stops the server from sending newer state data to a client until that client has confirmed receipt of everything older.
client
|--- ~ RTT/2 ---|
<-+-+-+-|-+-+-+-+-+-+-+-+-|-+-+-+-+-+-> ticks
^ ^
authoritative predicted
The main penalty with TCP is that ARQ can add significant delay on top of network latency. If you have packet loss server -> client, predicting clients will desync for longer, which means heavier, more jarring rollbacks when they finally get the data.
If the server just sends movement data uncompressed, the client can just ignore all but the latest update when it recovers from the stall. If the movement updates are delta compressed (changes only), you'd probably want the client to merge the stalled updates, so it can just do one rollback.
If your clients visually interpolate remote entities, you'll want their interpolation delay to be sort of "packet loss-agnostic" so they can fast-forward through the stale visuals, or else they'll fall more and more behind.
So "reliable, delta-compressed snapshots" are good if you need the smallest packets possible for a big game (at the expense of higher latency). But if you aren't doing that and you're just going to ignore or skip past updates when they're stale, there is no point in sending them reliably.
(You can do unreliable delta-compression btw, compress against the last acknowledged tick instead of against the previous tick.)
Yup, for realtime stuff like syncing transforms... TCP looks fun and easy - until pacektloss comes along.
Then things go of the rails in my experience.
Is there anyone with experience using Mirror networking I want to run multiple instances of my game on the Server on diffrent ports which works on one instance but when i start a second the first is still working but i cant connect to the second does anyone know if this is possible or do I have to use multiple independent Servers?
Presumably, you also set the connect address of clients using the different port, and not the default port?
Hello, Does anyone know how I could show Network variables of each client in a text?
yes but the connection times out at the second instance
How do multiplayer games generally handle "match instances" say for example cs go. Would the server launch a new process for each match or is there one process that handle all matches?
From my own experience it seems like having one process that handle all matches makes the networking more complex but on the other hand running a process for each match might create too much overhead
Hai, does anyone have any idea that aside from building the project for testing multiplayer, is there a way to create two instances of the project for testing/debugging multiplayer?
@olive vessel thanks a lot, the reason im not going for building is because its gonna waste a lot of time if im keep doing that
Yeah I keep using builds, but honestly I should set up ParrelSync
most of the time you dont actually need to build every iteration
you can also build debug features into your server
Hey! I'm trying to add online multi-player to my small 2D unity rhythm game. Could someone push me in the right direction please. Maybe a video tutorial? Thank you! :)
If you're using Mirror, here is a series by First Gear Games
https://www.youtube.com/watch?v=eFHDKflitqQ&list=PLkx8oFug638oBYF5EOwsSS-gOVBXj1dkP
is the unity MLAPI finally in a stable release? theres a whole tutorial and documentation page and i was just wondering if its worthwhile
If I want to spawn a bullet, can I just spawn it on the server and it will automatically be spawned on the clients? Right now I'm just calling a command that runs a clientRPC that spawns in a gameobject for a bullet and then when the bullet collides, deal damage (another command to change a syncvar)
It seems to be working, but most of the tutorials I'm seeing say to use NetworkServer.SpawnWithClientAuthority, but I don't want to give clients authority and it seems to work fine without this, so is it ok the way it is?
MLAPI is still technically in preview, however, Unity is suggesting to use it anyway. Iโm going to use it for my upcoming project https://blogs.unity3d.com/wp-content/uploads/2020/09/Netcode-blog-flowchart-e1599448324209.png
hi ive followed this tutorial https://www.youtube.com/watch?v=v8myO5BaZ-I ive followed it completly but when i run it it doesnt enable the controller, does anyone know why?
๐ Get the Mega Bundle worth over $1000 for 90% off at https://assetstore.unity.com/mega-bundles/grow-your-skills?aid=1100l9uzi&utm_source=aff
โค๏ธ Using this Affiliate Link helps support the channel
Join Our Community: https://student.dapper...
nvm fixed
hey all, I am trying to build a unity game using tcp communcation. I am trying to simulate lag and tried "clumsy" but the latency isnt working correctly in my local machine
what do you guys do for lag simulation?
I need to make lag simulation to see if i correctly implemented client side prediction
So i need to increase the latency between my client and server but they are both in same machine
with clumsy i set the latency as 20 or 2000 they both get arrived so late (like 10-20 seconds later)
If I am trying to spawn a bullet prefab on the server, I can just use Instantiate without any NetworkServer.SpawnWithClientAuthority, right?
Also, does my bullet need a NetworkIdentity and a NetworkTransform, or am I good to not use them?
I'm using mirror, and without the NetworkServer.Spawn... and without NetworkIdentity and NetworkTransform components on the bullet it seems to be working fine, but could this cause problems?
it'll only exist on the server if you use no net-spawning/net-sync/net-id/net-transform
I figured out what I did wrong, basically when I shot I was calling a Command that called a ClientRpc that spawned the bullet on the client, and then the bullet on the client would call another Command that would deal damage to the player it collides with, but I was getting warnings about sending commands on an object the bullet didn't have authority of, so I ended up putting all the spawning into the Command with NetworkServer.Spawn... and that works
It seems like I am still getting an error that I am "trying to send command for object without authority" within my bullet script, can I just ignore this? It is happening because I am accessing the TakeDamage command through PlayerControl script on the gameobject (player) that it collides with using
col.gameObject.GetComponent<PlayerControl>().CmdTakeDamage(damage);
and I guess it doesn't like that since it doesn't have authority of the Player GameObject
Should I just do something like CmdTakeDamage(gameObject) on the bullet script to fix this?
Simulate the bullet on the server, apply the damage on the server and have it (the server) send info about the effect to the client.
@faint plaza I think Mirror added an attribute to properly ignore authority
Hello there I have an issue using MLAPI, I was wondering if anyone could help me. It seems to be some sort of bug regarding the class NetworkVariableFloat. I'm only running as a host so I'm positive it's not something weird going on other than this thus far:
I have 2 NetworkVariableFloat variables, CurHealth and MaxHealth.
Whenever I do:
Mathf.Clamp(CurHealth.Value - amount, 0, MaxHealth.Value);```
***both*** CurHealth ***and*** MaxHealth get set to the value I only wanted CurHealth to be set to.
amount is just a parameter in a function, this is in a function that is meant to cause the player to take damage.
Debug messages before and after this call show that MaxHealth gets set as well, when I do not intend to change its value at all.
I only noticed when I happened to reach 0 HP, because it made it so I started dividing 0/0 when getting the normalized amount of health.
i dont know anything about MLAPI but if NetworkVariableFloat is a reference type and at some point you did CurHealth = MaxHealth instead of using .Value this would probably happen
@slim ridge First Debug shows "200/200", then the second debug shows "160/160"
yes, but there must be other places in your code that set the values
Nope, I checked
The SerializeField is redundant, but other than that...
I know how they are before I take damage because the first portion of code I have shown is the only way to take damage.
So I call Debug right as that function starts to see the values before I apply the damage
Then I apply the damage, and call Debug.Log again, only to see MaxHealth got changed unintendedly
The last line is the one that told me "hey, error, you are dividing 0/0" (it actually raised an exception telling me I was setting scale to NaN, 1, 1)
well the problem is probably that CurHealth and MaxHealth are the same object ๐คท
๐ค
Let me test that theory
You are correct and I have no clue how that happened
Just changing CurHealth also changes MaxHealth
Even in the editor, I try to change the value of CurHealth, it too changes MasHealth... this is bizarre
Does anyone who know about MLAPI know why this may be a thing?
Alright I found where in my code I set CurHealth = MaxHealth sheepeshly, you were right.
It only happened once at the start of the game.
QUESTION
I have started using MLAPI for unity. I'm trying to get a simple 2 player fps game setup. I have the editor running a host, and a build on my PC as the client. I can run the host from editor and it works, also joining as a client with the build outside the editor works too. The problem is that when i move the client, the host moves too. If you think this is a simple issue please DM me. I will link the unity tutorial im trying to modify code from.
https://docs-multiplayer.unity3d.com/docs/tutorials/helloworldintro
Tutorial that explains creating a project, installing the MLAPI package, and creating the basic components for your first networked game.
So, on the host, the client's movement script shouldn't be enabled
hm
Let me show you mine from Mirror
In dms?
oh ok
It's only a small screenshot
But yeah, if this is not the local player, I disable those components
Do you think you could hop in a call real quick. i just wanna make sure i do it right.
I'm a little busy rn sorry, but if you need me ping me here
Ah okay, will do.
I want to make a very simple game for me to play with my friends (4-6 people). What networking should I use?
Photon gives you 20 CCU free, and I've heard it's relatively easy to setup
Do you know any good tutorial I could learn from?
ok thanks
Is this right? I'm trying to make it so if you move the animation wont affect the other person. If it is right can you tell me if I have to write code for this to work?
Hello. Anyone knows a good tutorial for turn-based games using PUN2?
Photon Unity Networking framework for realtime multiplayer games and applications with no punchthrough issues. Export to all Unity supported platforms, no matter what Unity license you have!
How about for PUN v2?
It took me three seconds to search that up
Well thats for an older version of PUN
Hey, im using MLAPI for Unity and i cant get a pickuop script to work.
If anyone uses MLAPI plz DM me
Quick show of hands. I am completely new to unity and I am new to network programming. Should I use MLAPI or Mirror? (I am currently using MLAPI, and it's working .. but very early stage, so I want to make the transition asap if it makes sense)
does someone know if the order of execution for rpcs is fixed? Speaking if i call multiple rpcs in a code-block one after another on the server, will the client for sure receive the calls in the exact same order? (MLAPI)
@crisp prairie
Reliable RPCs will be received on the remote end in the same order as they are fired but this in-order guarantee only applies to RPCs on the same NetworkObject. Different NetworkObjects might have reliable RPCs called but executed in different order compared to each other. To put more simply, in-order reliable RPC execution is guaranteed per NetworkObject basis only.
RPCs are reliable by default which means they are guaranteed to be executed on the remote side. However, sometimes developers might want to opt-out reliability, which is often the case for non-critical events such as particle effects, sounds effects etc.
ah thanks that helps me a lot
i call them all on one object only so it should be fine then
Guys, I'm trying to get an int from photonnetwork.raiseevent, But I'm gettting Invalid cast exception, can someone help?
else if (obj.Code == OPPONENT_JOINED)
{
Debug.Log(" Received request for OPPONENT_JOINED");
object data = obj.CustomData;
int dir = (int)data;
if (dir == 0)
{
Debug.Log("Received request for OPPONENT_JOINED if dir = 0");
GlobalGameManager.mInstance.opponentJoined = true;
Debug.Log("Received request for OPPONENT_JOINED if hidepopup");
FFNotification.Instance.HidePopUp();
Debug.Log("Received request for OPPONENT_JOINED new raise event");
RaiseEventOptions raiseEventOptions = new RaiseEventOptions { Receivers = ReceiverGroup.Others };
Debug.Log("Received request for OPPONENT_JOINED Photonnetwork.raise event");
PhotonNetwork.RaiseEvent(OPPONENT_JOINED, GlobalGameManager.gameTimer, raiseEventOptions, SendOptions.SendUnreliable);
}
Alright
So I donโt expect an answer considering the guy before me didnโt get one
However Iโm going to try to describe this anyways
So basically, when my(online multiplayer fps, using photon and unity 2018) game is run with the editor, the player can die and respawn and such is counted on the scoreboard. However, players that are killed when in the builder version just have a negative health number; and do not die or respawn. Regardless of this, whenever they should die, such is updated in the scoreboard for all players, no matter if the players are on the builded ver or the editor ver, which brings us to the next thing; people playing on the builded ver can kill people playing on the editor ver, but not the other way around. I assume this is due to a build error, but I see none.
So, in summary; the respawn and death system works perfectly for a player using the editor, however not with the builded version; and yes, nobody dies if both players are on the builded ver. Any ideas?
Make sure you aren't observing masterclient vs .. normal client differences rather than editor vs build differences
What is the correct way to spawn a bullet using Mirror? I keep getting warnings about trying to run commands on an object without authority
Tip: There should be attributes for disabling authority checks
What do I do if I am?
Somehow everything else works from build client to build client but not the respawn event
But the death still registers on the scoreboard at the same time that the death event happens
So it should happen
But it doesnโt
Build vs editor and masterclient vs client are different issues, so knowing what is happening is important
Easy way to figure out is to just try changing which client is the masterclient
If the bug follows the masterclient, then you know it's most likely not editor related, which also allows you to more conveniently debug it with editor features
Hm
but aren't I doing something wrong if I am trying to do something without authority?
Well you might wanna think who is simulating the results of things, while keeping in mind that the server is generally the only part of the loop to be trusted
I've never done networking before so I'm not sure where to start exactly... I'm making a simple turn-based strategy game for my friends and I to connect and play from eachother's houses.
(If it's relevant to what networking system or method I should use: The game should have a grid for players to move around in and a couple actions to take during their turn, positional/strategy/pvp game)
I've found some tutorials but a lot of them seem a little outdated, and I've got no idea how to build networking code from scratch
Maybe start with a system like Mirror, Photon or MLAPI before diving into writing your own networking with sockets
I thought Photon had been deprecated. Is it still functional? Hopefully easy to use ๐
Hey guys, I've gone through the fun of writing a multiplayer game in Photon Pun and wanted to try out this newer MLAPI system. So far it's been great and the skill set has transferred really well, however I'm trying to make like a server list or like a lobby list but can't figure out how to get started with this since in pun there's like the overall server and then rooms within it, but from all I can tell MLAPI just conncets you directly to the server and doesn't have subrooms? If anyone has some tips on if / where I should start looking to figure this out that would be great!
TL/DR - How do I setup a room list or server list in MLAPI or where do I go to get started
Hi all, i made a Messenger chat system that consist of people entering in a room with id of their choice and being able to chat together, would that be useful ?
Well I got it working, thanks again!!!
So excited to finally make something online :D
I'm using Transport. The tutorial shows that I have to set the endpoint of the server to AnyIPv4
What if I changed that value, what will happen
Isnโt that so you can accept any IPv4 address
Ah
Is there any tutorial out there for setting up a Lobby with MLAPI?
DapperDino does good ones on Youtube, try this one https://www.youtube.com/watch?v=Pe2LVZGTK20
This Unity Multiplayer tutorial will teach you how to implement connection approval so that clients have to send the correct password to be able to connect to the server. For project files access, check out the repository here: https://github.com/DapperDino/Unity-Multiplayer-Tutorials
-------------------------------------------------------------...
ok thanks
I'm not really sure if this is related with networking, but I think so. How can I solve this problem I have when I build my project in Unity?
It's firebase but in my editor works correctly and when I build the project this error shows
someone knows if that mlapi transport uses new steam networking?
because i know steam fixed ip leak but if its that
how do I use this?
i want it to be set by clients and read everywhere else
but thier own client
yeah but it writes to itself
it doesn't move
What?
like ruberbanding on hosts to
Use a NetworkTransform component...
found why it was writing to itself
huh
guess that's why
my first time networking
That's reading the network var
is 0% packet loss normal?
Or will all clients communicating in realtime to a server over a network experience packet loss to some degree? Like under 1%?
I guess there is no guarantee you will drop a packet, so presumably 0% loss can occur
I guess I'm just trying to ask how much packet loss there's supposed to be under "normal" or ideal conditions
probably just 0 then I guess
It is quite common for stable connections to not drop any packets at all.
Do residential ISPs count as stable connections?
Depends on the ISP. Some countries have really bad ISPs. Bu even with a great ISP and little network traffic in your area you can still get packet loss depending on how your connection gets routed.
Hey all, I'm looking to hire some quality devs for paid work on a 2D turn-based strategy, just joined the Discord would this be the best place to look for people?
Does anyone want to make a 3D or 2d game with me ? i can program a little
@ancient falcon i also just joined
Perhaps "Networking" is a bit confusing
i got the game to connect and stuff, now i just need to make it only update other player positions and only take input from your client to control your character.
Guys, I was working on a photon game, I'm using Photonnetwork.raiseevent. It was working perfectly before like when I raise it, it was reflected in the opponent instantaneously before , but now it is having a delay in sending them, it is not the latency of network, what else can be the reason?
can somebody help me here?
Hey guys, I'm trying to use WebRTC to stream my WebCam but it seems that streammable tracks consist on MediaStreams which can be obtained from a Camera game object but I'd like to obtain it from a WebCamTexture, any tips? Thanks
Hey, I'm thinking about making a game similar to that of We Were Here. Anyone have any recommendations for tutorials/documents to follow for the networking of this? I would prefer anything that would mean the player can just jump in, press "host game", invite their friend via steam and off they go
how to make health sync with pun 2 and unity? im making a fps shooter, but health is not synced. On local player health is working, but on remote it isn't
im using this code every time im shooting but only if photonView.IsMine
DapperDino has a tutorial for using Steamworks with Mirror
Oh sick, thank you
someone knows how i can use SteamNetworkingSockets in mlapi?
i not speaking about steamp2p transport because its old system
I think (think) you may have to make a custom transport
Steam P2P is a community one as it is
Help
You might be better asking in the Photon Discord if they have one, or searching online
Does they have a discord?
@azure oracle try to use lowerCamelCase
What is it?
string shooter_nickname => string shooterNickname
because if you want to be a good developer, then you need to follow the c # standards
your level is lower than intern
I just said that you are not following C # standards and that your code is unreadable because of this.
Lmao
What would be best if I wanted to create a minecraft like multiplayer system? Like you know how over Xbox live you can connect to your friends worlds if theyโre on? Is it possible to do something like that in unity?
Iโm asking this because I want to be able to have like a multiplayer connection but have world โsavesโ locally on the computer. Idk if this is possible through photon because doesnโt it require joining temporary lobbies?
I would assume, that the host (or anybody really) could take a save of the world at that point, most likely saving done by serialisation, and can then load the save and host the world
I see, so what youโre saying is, when creating the lobbies in photon, there could be an option to choose like a saved world and then after the temporary lobby is created, the application on the clientโs side would access the serialized save basically
Idk owt about Photon, but yeah you could run some initialisation to load up a world, then allow others to join
Ok thatโs awesome. Do you know of any other multiplayer programs that would work better than photon or that are different than photon?
There's tried and tested Mirror, or relatively new but Unity backed MLAPI
Mirror has a tonne of Transports available, so you might find something really suited to your needs
Ok I think im gonna look into mirror more just because I think mirror has player side hosting which would be better for the game Iโm working on.
Thank you sm
One thing to note, players would need to port forward unless you make use of a relay service
But you'll be able to find all sorts of stuff in their Discord
Gotcha
is it common that yesterday my networking code was working and after doing 0 modifications it's now very laggy?
like if it could be a photon server issue
@nimble ermine you'd know easier if you use github
at least you'd know if the issue is with your new version
what happened?
Hey i need some serious help with setting each players material color to a custom one they set
i have a public color on each player that they all change
how do i make them send out that color for everyone else
right now it makes everyone the color you picked
Yo i got a question. Im using photon for a multiplayer game. The game is a 2d tower defense. Basically im wondering how do i syncronize player stats aka how many lives they have
Or how the variables are kept
Is there Discord channel for steamworks? or can I ask steamworks here? ๐ญ
This channel is for Networking in Unity, so yeah I guess so
Thanks, I see
Photon is awesome, all i had to Say here ๐ฌ
Hi. I read some warm discussions here but I still haven't found what I was looking for.
Photon really solves all the problems that need more knowledge of networks and this is too tempting to ignore.
Can anyone tell how to use MLAPI and some other API that allows to put a game in production? I only saw examples with localhost. Maybe SteamNetwork. But how to solve this for other platforms? VMs are really expensive.
MLAPI is not officially released and is not recommended for games to be published at this time.
DarkRift2 is better
Anyone here with good MySQL knowledge, especially using MySql.Data.MySqlClient namespace in C#?
thanks ... i've been waiting for this solution from Unity for a long time. I'm anxious. I very much hope that they will be able to offer a comprehensive solution, as is done with Unity tools.
What makes it better?
Hey, Is the new MLAPI not worth using?
Im working on a multiplayer fps shooter and cant seem to find my way with MLAPI. Is it better to downgrade to Unet or should i wait for more updates for MLAPI?
I wouldn't recommend using UNet. It has been deprecated for a while. If you can't find your way with MLAPI you will likely have similar problems with UNet as many of their features are quite similar. Alternatively there are some third party libraries you could consider instead of UNet:
https://blog.unity.com/technology/choosing-the-right-netcode-for-your-game
https://forum.unity.com/threads/what-are-the-pros-and-cons-of-available-network-solutions-assets.609088/
Unity now suggests not using UNet also. I've read that MLAPI isnt current sufficient enough for games yet since it's relatively new. I would recommend Mirror it's awesome
I just noticed the table in "Choosing the right netcode for your game" doesn't actually have any titles for the ratings
Just fyi, those ratings are super arbitrary/biased. You won't find any of the library authors agreeing with them.
On the whole, the post/white paper is very misinformative. It could have at least included a list of released games that use each lib.
Any suggestions on what we could change to make it less misinformative? We've been working with the library authors to correct the misinformation in that blog post and after an initial round of correction we didn't get any complaints about information which would need to be changed anymore. We hear a lot of just overall negative sentiment about this blog post but it would be awesome if we could get some constructive feedback so that we can improve it or at least not make the same mistakes again in the future.
Anything seemingly wrong with this script?(player movement; for some reason, again, both editor and build players can take damage but only a player on the editor can die and respawn)
I read some of the earlier feedback and I believe authors said as much, but I think people were mainly offended by Unity juking the stats and portraying their new but largely unknown/untested acquisition as the best all-around choice. There's an obvious conflict of interest.
Fairly showcasing games made with each library would have been more indicative of their capabilities instead of making guesstimates about performance and scalability, but I suspect this wasn't done because MLAPI didn't/doesn't have nearly as many. The post is also missing Photon Bolt for some reason.
A lot of the criteria seem like apples and oranges. PUN gets 5 stars for "ease-of-use" seemingly on reputation alone, but Quantum making it possible to build a working RTS prototype in a week is only worth 4 stars. MLAPI's section just lists stuff that's missing and it still has 4 stars lol.
The cost information seems entirely aimed at hobbyists. Quantum's subscription fees will be seem expensive to free users but at the small studio level and above: Would any business turn down paying $1000 a month for a fully-functional deterministic engine (that abstracts away the "networking") plus tech support in favor of hiring someone to build and maintain one? If MAU โ 400 * CCU is accurate, only successful games would see "large" CCU costs, but since they've sold well, they can easily afford 50ยข per CCU.
IMO the broader problem is that no matter how you reword the article, it doesn't change the reality that none of the free options actually provide much beyond the socket level (virtual connections, rooms, etc.). They all lose in actual utility.
Developers take cues on how their multiplayer should look and feel from the most popular games in the genre, who nearly always have tick-based simulations and local prediction (and lag comp, interest management, etc. if applicable).
AFAICT, none of the free/open-source options were really built with those in mind, so all attempts to implement them later look super clunky and project-specific.
The most important question that's never answered is: What game genres can easily (out of the box) and competently be made with MLAPI? Vs Mirror? Vs Photon products? Etc.
Honestly, from what I've seen of/heard about the upcoming Photon Fusion library, this blog post will look even more ridiculous after it's released. If Fusion makes good on even a few of its claims, everything but Quantum would get 1/5 stars in terms of ease-of-use, performance, and scalability.
First all, a lot of great feedback, thanks. I agree on many of your points, we could have probably framed this article in a much better way.
The cost information seems entirely aimed at hobbyists. Quantum's subscription fees will be seem expensive to free users but at the small studio level and above: Would any business turn down paying $1000 a month for a fully-functional deterministic engine (that abstracts away the "networking") plus tech support in favor of hiring someone to build and maintain one? If MAU โ 400 * CCU is accurate, only successful games would see "large" CCU costs, but since they've sold well, they can easily afford 50ยข per CCU.
Would you mind explaining this a bit further. I do not fully understand. We just stated product costs and mentioned that for MLAPI/Mirror/Darkrift 2 you would need to pay for server hosting in addition? We never mentioned anything like Quantum being expensive. We stated for both Quantum and PUN that they are rather cheap in comparison to self hosted servers?
I may be looking at an older version of the white paper.
Larger teams would probably see a reduced cost since they wouldn't strictly need networking experts on payroll.
I'm not fully familiar with Quantums cost model but based on their website it sounds like you pay 200$ per month per developer seat. I don't see any indication that this would be restricted to 'networking experts'. Any developer on the project would need a seat, at least this is how seat licensing usually works. 2400$ year is still a notable cost, that's more expensive than a Unity Pro subscription. You might be right that it is totally worth because it could allow a team to build a game much faster, with less engineers etc, but we were just focusing on raw product cost and not 'value' there.
I guess I can agree that I'm focusing on value? I was just making the assumption that the upfront cost of hiring an experienced networking developer is quite steep, considering it's so niche. Definitely more than $200 per month. And development time does translate to money spent, so idk.
I saw an interview with one studio using Quantum (Bomb Bots Arena) who attested to not having anyone on their team with the expertise. They were able to write a networked game with a sizable player count as if it were local multiplayer without really touching the netcode.
In terms of infrastructure costs, if we really wanted to price it out, I'd want to include the bandwidth costs of all the solutions when using dedicated hosting, projected over like a month/few months/year. Determinism should consume significantly less bandwidth. A handful of bit-fields and some floats to represent hundreds of buttons and several analog joysticks/triggers will be very small compared to non-input traffic.
Also, it would help to convey that how to replicate the simulation is mostly decoupled from how the data gets around.
Like deterministic games don't need to be peer-to-peer and authoritative games don't have to be client-server (not that you'd want P2P tho).
only developer who the team itself judges require full access to the premium support
That is what they pay to get direct access to the core development team...
So, not ALL developers in the team
Oh I see, that's good to know. Sorry I wasn't aware of that.
if you want to get only one or two in there, fine...
And because you mentioned, does unity pro gives me direct access to the CORE development team of the engine?
In a live Discord on a daily basis?
If yes, fair enough...
If not, it's again Apples to Oranges (I fully apologize if I'm wrong here)
Just trying to clarify
Oh I was not trying to compare Quantum to Unity. I mean you pay for very different reasons for a different product. As far as I know we do not have a live Discord but many other forms of customer services.
2400$ year is still a notable cost, that's more expensive than a Unity Pro subscription
Again... That is a comparison...
I'm clarifying what you get for the value.
On that topic Luke... I always wondered why it is stated only up to 32 players for quantum. where our limit is actually 64 (and we've benchmarked that here several times)
I know the super successful mobile games made with quantum are 32 player games, but they had other reasons for that (it's mobile), not that the engine can't be used for 64 player ones...
I ask this because MLAPI is mentioned as up to 64, and I don't see where is the exact backing for that
I never bothered much though, there are other things of concern in the post (that others have expressed about).
Good question, these numbers are more like rough guidelines and not hard numbers. We have a few customers who were able to run more than 64 players on Mirror/MLAPI as well. The reason why the number we chose was 32 instead of 64 was because based on our evaluation and feedback from other people about Quantum we came to the conclusion that 32 is the better overall number because mobile or certain game genres might not be able to scale to 64 with Quantum. Could very well be that we were off there, you definitely know better then we do.
Yes, but let me quote you:
"we came to the conclusion that 32 is the better overall number because mobile..."
"We have a few customers who were able to run more than 64 players on Mirror/MLAPI as well."
On mobile? Sucessfully launched tittles?
emphasis mine
You know I'm the first one to state when quantum is NOT a fit for something...
But I think what people complain about seems to be a lack of clarify, and a possible conflict of interest in the "evaluation". So it'd be nice to see where these numbers came from.
Yeah that's always a problem with benchmarks and performance comparisons often there is not enough information provided and it's especially bad in this article.
it is.
Hello, nor really sure where to ask this, but this is likely the channel where someone is likely to have encountered this problem. I'm going to work with an http api that uses access tokens and Oauth2. To get the token, I need to send , along with the credentials the user provides, client credentials given to us by the owner of the API. What would be a reasonable way to keep our credentials out of the build so it can't be recovered by a third party? Should I even bother ?
Bump
what does ```csharp
[SyncVar(hook=nameof(Method))]
do basically?
how would i connect to computers on a different network using mlapi
You must port forward whichever port you use, on the UDP protocol if using UNet Transport
Then, your friend connects with your public IPv4 address
https://mirror-networking.gitbook.io/docs/guides/synchronization/syncvar-hooks
Looks to me like that method is invoked when the SyncVar changes
okay thank you
How would I have a component in a synced object that exists in different states between server and client in MLAPI? I have a variable in one of my gameobjects with a component not likely to serialize (an IronPython function), so I would like to not transmit that over the network and instead have the client grab it itself and verify with the server that it's correct
well, I suppose the client version of AbilityFunction can just be a hash that it passes to the server and receives info on when it can be activated
wait, nvm, that's stupid, the client has access to the ability info
Is delta compression impossible without RUDP?
furthermore, is it possible to build your own RUDP protocol off of C#'s udpclient? Is it hard?
Can't be TOO hard right? Just send acknowledgements back to the server for every packet received, and a timeout to re-send it, if Mr. Server doesn't get the ack in time?
This is probably a stupid question and the answer is probably hidden somewhere in my brain. But how do you keep track of time like that on a server? Like detect if you haven't received the ack within 200ms?
C#'s built-in datetime stuff?
Right now I just do delta with TCP but only for entities, say if I drop a gun on the ground or something. I send the full state every tick with unreliable UDP for every player + every car. So max players is 60, 1 car per player, max 4 doors per car is around 300 entities maximum to process max at every tick. That's without the delta entities that get sent whenever a change is detected (probably not very often since the players can't interact with physx objects by walking into them)
Hey there, I'm having this problem where I'm using the LLAPI for a multiplayer game, and when one of the players pause their game (lose focus on mobile) thus the main thread stops calling NetworkTransport.ReceiveFromHost, soon enough my server get's bogged down trying to send messages to said player and starts failing to send messages to everyone else until that player refocus the game.
To make matters worse I can't disconnect the player immediately.
Any way I can have the NetworkTransport to not use a single queue for all players?
is there any free game server hosting for testing with the github student developer pack??????
Can anybody tell me how to do this correctly? I made multiplayer game with mirror. When character is animated and after animation cycle I want to move bones I can only do this in LateUpdate() but this is not synced over the network. Example: Character is standing with "idle" animation (moves a tiny little bit) and I want to make the head look around in camera direction.
yes ofc, you dont need RUDP or TCP or any reliability at all
yes ofc, but i would just use raw sockets instead
How would I do this without a reliable protocol?
Isn't that basically how rudp operates though? The 'id back to server' is technically just the ack?
ack != reliable
acking does not mean it's a reliable protocol
what happens if the message back to the server, gets lost in transit?
so server resends?
because it doesn't know you received it? I'm confused
it can if you are doing a reliable protocol ofc
but i generally never use reliable protocols
I thought the whole point of delta compression is to only send the latest changes, not the whole snapshot
Still confused. You said it doesn't need to be reliable. What if the client doesn't get an entity's last movement from the server then the entity stops moving
it's going to be in the wrong place forever then?
You're correlating reliable socket sends with how the game/higher networking layer itself works and how it deals with loss scenarios etc.
so how would I deal with loss scenarios
depends on the type of transfer system you use
delta snapshots, eventual consistency
etc.
so just send the entire snapshot every n seconds?
hmmm
in delta snapshot mode we never send full snapshots other than for the first one you get when you connect
in eventual consistency mode it works different, and never sends a full snapshot ever
So how does eventual consistency work
that's a large topic
Ok. I think I'll go with building a reliable protocol then, since thats the most familiar to me
so to make rudp, Everytime I send a packet from server, I store a new object that contains the sequence number, byte contents, and the time it was sent. Whenever an ack comes in to server from client, check against stored objects and delete the object containing that sequence number. and also check every n milliseconds to see which packets havent gotten a response in n milliseconds since they were sent, update the timestamp on those objects to present, and resend them?
Sound about right?
obviously i'd have an object pool so im not allocating memory on each send
and for the sequence #, do I just iterate on every sent message?
But then say the client gets the server's message, and sends the ack back, but the server doesn't receive the ack, so the server sends a duplicate message. How far should I store successfully received sequence numbers on the client to prevent processing duplicate messages?
receiveEventArgs.Completed += new EventHandler<SocketAsyncEventArgs>(ProcessReceive);
private void BeginReceive()
{
receiveEventArgs.SetBuffer(receiveEventArgs.Offset, 4);
if (!socket.ReceiveAsync(receiveEventArgs))
ProcessReceive(null, receiveEventArgs);
}
private void ProcessReceive(object sender, SocketAsyncEventArgs e)
{
// Handle errors..
// Make sure the whole packet is read..
// Do something with the packet..
BeginReceive();
}
This seems to be the way most people use ReceiveAsync but im a bit concerned about ProcessReceive basically calling itself over and over, cant this lead to Stack overflow? Or do we just assume that socket.ReceiveAsync will execute asynchronously most of the time and break the call chain?
It seems like ReceiveAsync will pretty much always execute asynchronously in a real world scenario, even just adding 1 ms between each send from the client (both server and client running on the same machine) will stop the receive from executing without raising an event. So no risk for stack overflow ๐
anyone worked with photon?
was that for me lol?
Yeah, just ask you question if you have one ๐
well I am making blinding ability system. I instantiate an orb object using RPC which is instantiated for all players in room. Now as the object is instantiated, I want it to call a function of showing flash (that function exists in UI code of player) on screen for every player who is looking at the object. I have made the logic to check if player is looking at orb or not but I want to know how can I make it call the function not just for local player but other players too?
Here's a reference to what I'm trying to make: https://youtu.be/1pL6NwrpoV4?t=135
This is an advanced Yoru abilities guide on the map Bind, and I want to show you guys some flash and tp lineups you can use in high ranked to be the deadliest Yoru main you can be! Valorant's new act brought us some insane outplay potential, and I want to show you how I like to use Yoru to rank up!
Everybody is always asking how to play Yoru on...
Does MLAPI deserialization work by calling the relevant constructor on the object?
I have an object that contains a component that can't serialize (IronPython functions) so I'd like the client to reconstruct it on their end based on what can serialize
(even if only to keep things consistent, as those functions are never going to be called on the client's end)
I don't use Photon so probably someone else will be able to respond, but I'd say: the same way as you instantiate the orb for every players in the room ? That is with a RPC call
Bump
btw what is Photon.MonoBehaviour?
when I tested PUN2
I used MonoBehaviourPunCallbacks (using Photon.PUN)
oh.. if it is spawned in network
I used IPunInstantiateMagicCallback for OnPhotonInstantiate
and also I used every public methods to be called by [PunRPC]
Just try to make rpc methods as public
should i use socket or tcp listener for sending the data for multi client user
Hello!
I have written some C# applications and also been "modding" several games before. Now I decided to take a look programming a game of my own. I consider multiplayer as the most enjoyable game type nowadays but I have got some security related concerns.
For a small scale project it would be reasonable to be able to host a room from the game client/related app so people could just create rooms and play with their friends.
If people made changes to the game or included some plugins or so could they use the connection to the host machine to deliver malware/take control of others' game/machine or something related? Even if the game was only supposed to send/receive player and object status and position data?
What if the host machine or a client was unintentionally infected/under attack, could that infection affect the connected clients or the host it was connected to?
Is there a way to prevent using a modified game or hosting system?
Would windows firewall detect attacks/weird behaviour that was not just wanted player/environment data transfer and break the connection or so?
Could I have "package checking code" in my game or similar methods? Could the unwanted action be just hidden to look like a normal data transfer to the game? Would even checking expose the system to the threat?
I found this for example https://www.youtube.com/watch?v=uh8XaC0Y5MA but is such "make a connection and use it" (as far as I understood it was something like that but there might be more details in other videos) type of approach enough not to leave possibilities for vulnerabilities and exploits?
I hope this was the right channel,
wwwwEPwwww
Says the one with the non latin letters as discord name
It is a joke
Also
That is a bad comeback
You need to work on your social skills
@normal hemlock Please don't spam the channel.
?
@normal hemlock There's no off-topic. If you don't have anything constructive to say do not spam channels.
So to simplify my longer thoughts in my previous message:
Is there a way to make a self hosted multiplayer game so there are no or minimal security risks?
As in the user hosts and is a client?
Yes, so that one user can make and host a room on their PC and other players can join (based on some kind of IP or other identification)
There are networking solutions like Mirror and MLAPI which do that
The user can host as a client, and allow others to join. Or a dedicated server build can be created
Ok. I read about Mirror and saw it only supports 20 players simultaneously in the free version (I'm not planning to make anything huge but it's still an extra restriction I would like to avoid) but I'm not actually sure if that is as a dedicated one server or for people using it for self hosting (so that they could set up multiple 20 player rooms for the same game individually). How does MLAPI work then? Are there any recommended use cases for each?
What I would say, is MLAPI is relatively new, but both have good documentation
There are a tonne of transports for Mirror too
So are those just some hosting apps (with built in security features) or actual dedicated physical server providers?
The Transport isn't a server provider
So there's a Steam Transport, that uses Steam's P2P services to connect players
Really the Transport handles the data transfer
hmmmm ok (sorry I don't know much about net traffic stuff...)
So is that Steam service free?
Well, you need a SteamAPPID, you can use the default 480 for testing but not for release
So you'd have to be on the Steam store for that one
It might be difficult to get something released on Steam I guess!
And if I use Mirror or MLAPI for transporting game data between clients is there a chance of someone using that data traffic for something malicious? Or are those APIs (/their actions) strictly connected to the code I make so it can only handle what I have intended?
If you're worried about cheating, you must have a million dollar idea
Mirror's docs briefly talk about cheating
Not necessarily cheating but rather forwarding malware and so... ๐ค
I don't know if that's even possible, a question for the Mirror Discord perhaps
Ok, it might be that such thing is not possible but I don't know and am just speculating
so
Usually, you expect packets to be formatted a certain way. A particular length and a particular layout. The socket layer just throws away unrecognized packets.
You'd have to be super trusting of incoming data to have a code injection problem.
aha
so is normal reading a received packet not enough? How do I make it recognise the assumed correctly formatted packets or is that all built in the network functions in C# and unity etc?
What kind of actions can be made related to the received packets without risks - what is trusting too much? Even something less extreme than "run any exe that I receive"?
A packet is just a bunch of raw bits until your application interprets it some way.
Normally packets split into a <header> and <data payload>, where the <header> tells you
- who it's from
- what type of packet it is, so you know how to read the payload
- how old it is
- a checksum to verify the integrity of the payload and verify matching version info
That's 4 potential reasons to reject a packet alone, all through low-level bit operations. The transport layer doesn't have anything to be tricked into executing malicious code. It's just format checking to filter out garbled junk.
Any vulnerabilities to exploit would generally exist in your game code. Like don't have a function that runs an arbitrary .exe based on a string that was sent in the packet.
I dunno if Mirror or MLAPI have encryption, but if you're using like Steam's backend lib, then it might also provide that.
Ok thanks for all answers. It seems like there is some sense in making a multiplayer game then I guess ๐ (I should have expected that as there are even official ways and documentation etc for it)
I have to start learning more.
Encryption for what? Packets?
yeah
just another form of validation, also helps prevent third parties from reading the contained data
hmmm there is something related to it in the mlapi documentation (I suppose it is docs-multiplayer.unity3d.com) so I assume such thing can be done somehow....
but if some authentication keys are needed are they generated by the host/client or are they something separate, already existing, similar to application signature? ๐
idk, I'm not super well-versed in authentication/cryptography
ok
I wish I knew what that means.... "It is strongly suggested that you sign the handshake."
But this seems like it is automatically done
ยฏ_(ใ)_/ยฏ
Any suggestions where I should look for help/tutorials to be able to code so everything happens in the server=host, not on clients and packets are handled in a secure way?
no, not atm
ok, thanks, I will continue my research on if coding a game is worth it and secure ๐
Found one tutorial. But if the network connection is just set like that, using some existing fields and checkboxes in the unity editor is it automatically going to make networking so that the host machine handles the events and clients only make simple requests (as was suggested elsewhere to prevent clients modifying what and how they do)?
https://www.youtube.com/watch?v=de4ey4ZM-zA
Dont Forget to LIKE and SUBSCRIBE!!!
-------------------------Unity MLAPI Git link-------------------------
https://docs-multiplayer.unity3d.com/docs/migration/install/index.html
Hello, any one has a idea how to make a leaderboard with network variables?
Hello, I'm currently trying to make a massive multiplayer shooter game! I've tried Photon and SmartFoxServers. Photon didn't work at all and SmartFoxServers needs me to host my own server and I can't really do that. I was wondering if anyone had any ideas on what I should use. I own a server that I pay for that I have access to via FileZilla. All and any help is greatly appreciated :D
I own a server that I pay for that I have access to via FileZilla.
So what was the problem with SmartFoxServers?
i couldn't figure out how to get it on my server
Booting up the application is one of the essential skills required for this sort of thing ๐
This shouldn't be a blocker considering all the challenges you are going to face to pull your project off.
Might wanna look into their remote desktop offering. If they don't have a remote desktop offering, it probably isn't intended for this kind of thing.
https://pastebin.com/6k80CM9Z I have a program that requests and sends information via a rest api, and the game is built to WebGL. When running the index.html file locally, the game container merely displays as a black screen. If I upload it to someplace like gamejolt, the same occurs. I've tried adding headers to expand request permissions as per https://docs.unity3d.com/Manual/webgl-networking.html, however the same still occurs.
here are the console errors
after fiddling around with the settings, setting http on the gamejolt package, changing the presentation from minimal to default, changing the compression setting of the build to disabled, I believe the error is fixed
now it correctly displays
welp same error, however from all of the changes above it now loads correctly; networking features don't function though
how might I do this? none of the above fixes have worked
I've been uploading the build to gamejolt if that helps
Hello.
Hello. I want to make a food order program when I order a dish, this dish should be seen to the another screen. But what technology should be used here? traditional sql ? or cloud? or firebase or what does it call? I mean it will be simultaneously.
Firebase is a good solution for synchronising apps in real-time yes. But not the only one.
The technology is usually called REST (JSON CALLS) its really the most efficient way to communicate with a database now days ๐ AUTHENTICATION can be a little rough sometimes, but maybe thats just me. ๐
If your using unity try Unisave https://assetstore.unity.com/packages/tools/network/unisave-backend-server-142705i believe the asset is free you only pay if you use a lot of traffic (i think) also MICROSOFT and AWS also have more complicated solutions (atleast they were to me) good luck! ๐
In game design its called "Serialization" lol ill shut up now.
@frosty crystal @weak plinth serializing your data has nothing to do with the technology you use. You serialize the data to be sent to the cloud regardless of the tech used to send it
@frosty crystal sql could work, cloud services like firebase or PlayFab could do that too. Even if you build a REST service you'd need persistance so you'd have to use SQL or a database anyways. Lots of options
thanks!!
hi guys, gooday! im working with photon and having an issue that 2 players are spawning at the same spot. Already tried follow different tutorials but still doesnt work, ofc the problem is me, if anyone could help.
in a nutshell: the game works fine from the menu, find some match and going to the lobby scene, I think the problem is that when the countdown from the lobby ends, the players spawn exactly at the same time at the game scene, maybe its because of that they doesnt spawn in different locations.
The following script is the NetworkManager from the game scene.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
do you have multiple spawn points set up
in your array
Your random number can only be 0
Because the length is 2, you subtract one, and ints are max exclusive in Random.Range
However, even if you do fix that random, there is no guarantee they will spawn separately
help both players have the same cameras
In your camera script, check if this is the local player, if not disable the Camera and maybe even the script
ok
how should I handle collissions (with colliders and rigidbody (im on 2d btw)) with mlapi (the server doesnt have to be authorative)?
also I made a basic online game where you can move and rotate and on Update() it gets sent to the server and clients update it and the cient lags in the host screen but the host doesn't lag on the client's screen (not as much)
if i just try handling the collisions on the client the player bounces into the collider then comes back, it's not instant
Hello.
One of my objective is to store some unity bundle assets into cloud and download them in runtime. (in the next version, client will upload their bundles into cloud by using webgl.)
but could not decide if I choose realtime cloud of firebase or firestore database
what do you think
?
Firebase at its simplest is only good for mobile apps
one question more
I want to develop a webgl instead of an ios or android
Is it possible?
because the documentations wants me to make project either ios or android
but I can make neither standalone or webgl
If you canโt make webgl, what are you doing
Anyone know with Photon if I can call an RPC that is in a class on one object with the photonview of another object
Well, I assume you can just call it like a function
anyone know how to use SQLite
looking for an mmo/mp rpg framework for unity, was looking at Ativision, but a little worried about if i want to change down the track and losing everything once i stop paying for it. Is there free alternatives anyone can recommend or any insight
Do i understand correctly that the lowest networking api are .net sockets, right?
you can always go native and bypass .net sockets
for example you may want to use IO completion ports for less overhead in certain types of servers
by native you mean using raw sockets from winapi/libc?
to be honest i think asio will be good enough
you can get a lot less overhead by using them when managing thousands of inbound connections or datagrams
yeah, i think you are right about it
but the use cases are specific of course.
Does not engine itself expose any networking/socket apis?
in regular client-server netcode with a Unity headless instance being a server to typical player count (<200 or so), no need to go deeper than .net sockets I'd say
If you are new to Unity... Nothing production-grade... THey are working on a new official package now (after a few old tries that did not succeed). THere are third party libs as well (I work for a company that provides some of these)
Is there any reason to use unity headless client for server instead using seperate c++ asio/raw socket server or just .net core application?
yes... most typical low player count games use this approach, because from the development perspective you write the same code for both server and client
i can understand this use case for p2p
Engine as server (unity, UE, etc) It's actually the recommended way to go for competitive FPS, etc
this is the RULE, not the exception...
You go for separate server code when building a mammoth MMO or so
OR when writing a service that will be used to supply "p2p" services (like a relay server). So perhaps the opposite of what you thought
P2P in the traditional sense of everyone connected directly to each other is basically not used at all anymore...
are there any other network architectures for games besides client-server?
im just asking, i just started with games network programming,
btw, thanks for help mate, You helped me a lot ๐
yw
hi guys! still trying to make a spawn in different positions in my game, but still not working (photon) ๐ฆ
i really do not know how im gonna make it
https://pastebin.com/r8Gtyeji
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
gotta copy + paste the details that i posted yesterday:
the game works fine from the menu, find some match and going to the lobby scene, I think the problem is that when the countdown from the lobby ends, the players spawn exactly at the same time at the game scene, maybe its because of that they doesnt spawn in different locations and always at the first position of the array
if anyone could help i would appreciate 
Well how is the playerId being set?
because from the looks of the script, they're all going to spawn at the spawnPoints index of zero
Also what's the spawnTotal
i didnt put, but inside the spawn() there is a playerid++, so when someone enter, the index would be 1
but still do not work
and looks like all the spawn points are 0,0,0
Yeah but you seem to overwrite that in your Spawn function?
When you create a new array of 2 Vector3s
@analog bear Basically, Photon is "free" until you hit 20 CCU. But Mirror and MLAPI require self hosting, player hosted servers or P2P
Also with Mirror and MLAPI, if you don't use a relay service, users must port forward to host online
Thanks for the info.
can anyone familiar with GET requests talk me through doing one in C# ๐
Hello @drowsy yoke maybe this would be a great help from docs. https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequest.Get.html