#archived-networking
1 messages · Page 97 of 1
Then you don’t have any “free” option
There is no free lunch
Online games require servers, even if just to relay data or coordinate the punch process
But if you don’t have many players, why not use@the free tiers of normcore or photon?
As long as this is just a hobby project (you mentioned no money)
Perhaps other complete services also offer free tiers. Just remember these
well i'm not sure that how many players will play my game.
there's 5 players/room. photon is heavily limited to 20 ccu, so only 4 team of players can be able to play the game? that would suck..
normcore? never heard of that.
It’s similar to photon
20 ccu limit?
Same limitations, but works
hmm.
I mean, if you don’t plan to make any money with your game
Perhaps you should not try to make an online one
well i do want to release dlc-s and earn some extra money from that
Online games cost money to run, there is no other way
well i maybe can figure out hosting my own servers, but i'm not really sure about that.
These relay based services are the cheapest options in the long term
If@you understand what you are@doing
Hosting your own servers will only@sabe you some bucks (compared to photon or similar) if you are really an expert on this
But sure...:)
You can try
well i know some people that host servers for free. i know them from my minecraft age haha
i'm not sure they are still hosting servers tho.
Well, do that then
it's been a long time
I normally answer considering potential for growth, etc
Hobby projects you do whatever you feel happier with
It’s about having fun and learning in that case
Just started talking because that lib looked like a dead end
true, but i don't really like to learn something that i can't really use in the future (for exm. photon because it's heavily limited and costs a lot of money)
Perhaps someone who really tried it can save you the time
Photon is one of the cheapest options
well yes, but mirror beats it in some ways.
If you mean pun (photon has many different products)
Mirror is not a service
And I won’t comment on its qualities, I am not a user
It’s a library. You need@to host servers somewhere
oh. i see.
If you think@mirror makes any sense, you should check mlapi
Was acquired by unity, and it is now official
yeah i was about to try it out, but i wasn't been sure how it really works
it has a lot of features though.https://mlapi.network/features/
The MLAPI is a library with strong development behind it. As a result of that, it has many more powerful features then HLAPI. Here is a comparison of features between the two. Feature MLAPI HLAPI Host Support Spawn Management Messaging System Custom Transport Multiplex Transport Scene Management Behaviour Based Messaging Network Time Send Channe...
yep bro
uh yeah i wanted ask does it work?
nope
yeah.. does it work on lan atleast?
I did not look for anything after networkcommans
I'm looking
no
what? really?
then it should be lan
WHAT
does it support unity?
oh
im dumb
ofc
its only lan, isn't it?
browser without search box and it can act like exe by installing unity webgl plugin very good haha xd
P2P disadvantages
Data flow congestion
Poor performance
Security.
The source of the data is not noticeable
You can use p2p for now, as you grow your project, you get a server buddy no problem
works with p2p on skype
yeah
😉
hmm but webgl should work pretty fine tho
imagine playing a game without needing to download it
and its online
webgl also downloads every time it enters: /
well true but you just have to open your browser and you can play instantly
imagine that :D
what do you mean by good ?
unity webgl game
yeah
I played a lot when I was little
btw where can i download webrtc?
oh dang this game seems familiar to me
When unity compiles the project
what
If you are going to use webgl, you shouldn't improve this game too much, it downloads too much data
here.
A Unity Plugin that makes it easy to build a peer to peer multiplayer game using WebRTC
For alpha access, join our discord: https://discord.gg/ZErYVu9
Hello there! Is anyone familiar with Unity's FPS Sample
Just a tip no one is able to help you if you say you need help badly.
Write a proper question so we can help you with your problem
oh sorry i was just looking for a server
i followed a toturial on making a basic server with photon but for somreason it tries to instantiate before it even connects to the server
What Is Best OS For Game Server?
place your player into the resources folder
it is in there
well it says its in photonPrefabs/photonPlayer
are you sure you're instantiating the correct object?
yeah look
well you just have to write the Player object's name instead of the path.combine if you placed the player in your resources folder.
do get it out of the photon prefab folder??
Resources, you have resourses ;p
ok i changed code and did put in resources and it still has the same problem
you gotta be kidding me
yeah it fq works now thank you for letting me know how stupid i am
Vaguely, why?
should i favor many small packets over fewer larger packets in udp?
udp is much faster than tcp so generally you would send small packets via udp
especially because if you send small packets @slim ridge you can send multiple copies for redundancy and a packet miss isn't a big deal
packets have overhead (headers)
But sending multiple packets in one go can also result in losing multiple packets
Are you familiar with the networking for it? Setting up local games on the same wifi network in the same room is perfect, but networking across different IP addresses does not
And with a very conservative MTU of 1380, packets aren't going to be very large anyway with udp
I'm vaguely familiar with the code, not the actual game/project
@weak plinth tcp is much slower than udp though per packet
ok, thanks fellas. I'm gonna go with fewer larger packets because i also want to enforce order 👍
You shouldn't need packet order. If you do, consider using tcp
I see, i mean anything you know of the code would be super helpful as well, im not as familiar with programming/backend of it as i am the frontside of Unity
i've already got that sorted 😄
i'm using udp just for the time-sensitive stuff
i guess i'll see when i get there. I've made it easy to switch between the two.
You can also opt for something like ENet
Built on top of udp, but has the option for reliable/in order packets
There's been this tentative "UNet is being deprecated soon" message on all of the networking documentation for awhile. Is it work waiting for the (eventual) successor to UNet? Or should I just move onto a more established networking framework?
Unity's current first party networking solution for game object/monobehaviour is the MLAPI
Is the number of players per session equal to the total number of players connected to the server?
That is, with a dedicated server we can connect 1000 players to the server?
That all depends
Games like Halo (assuming the dedicated servers they have nowadays) have 2-16 players per session
But the total amount of players connected to their server(s) is going to be far more
That is, with a dedicated server we can connect 1000 players to the server?
That again depends on your game
If you are talking about Runescape with a tickrate of 0.6, you're probably going to run 1000 players on one server
Is MLAPI Use One Core Of CPU?
No idea. Never used MLAPI
But one could (and that's what happens in reality) run multiple instances of a server on a single machine
Which results in the usage of multiple cores anyway
A lot of these choices really depend on the type of game you are making (and scale)
a physical server with 4 hardware cores can run an average of 2-4 unity instances only... (from my experience with customers and companies I know use that approach)
so if your game has around 10 players per (logical) server-instance/unity-process, a physical machine you rent can run around 20-40 players only...
Unity (or Unreal) headless instances are still very expensive. Even if you run a game that can fit 100 players (like fortnite), you will be maxing out CPUs at an average 250 players or so... Don't expect a lot more than this... Unless you are really really optimal (MLAPI is Not optimal)
1000s of players per (physical) server? IMHO Not really if you are talking about engine headless instances... This is what you can get when running logic-less RELAYS
Perhaps you can do a bit more than what I said if:
- game runs very slow, like 10 or 20Hz update rate
- you don't care if gameplay is sloppy
I also know that Among Us, which run a very simple relay-only server can fit around 400 players in each server Node (they run cheap Linode servers).
Do you remember where you learned that Among Us detail? Would love to read how they did their servers
The developer shares a lot of technical details on his own Twitter
Thanks! Time to do some lurking
Does C# have any included libraries for TCP connections like Java does with Sockets?
ServerSocket*
Thanks
Alternatively, you can look at this more resource-friendly variant of a TcpClient/Listener
https://github.com/DennisCorvers/UnityNet/tree/master/UnityNet/Tcp
Code is still wip
Ok nice, thanks for the help!
hey guys, question.... i have dedicated server, without unity, and i need to have in the server, the walkable path. Any way to export from unity to any file or format to the server, and manage what places can walk?
So how my netcode is setup, each new user gets his own thread for the TCP connection
I was told this is going to scale badly. Any suggestions?
https://mp-docs.dl.it.unity3d.com Multiplayer Networking Docs sub-site is live
This site provides Unity Multiplayer documentation, references, and sample code tutorials.
@distant bolt Kinda nice site, was hoping for a Transport update to go with it
Hey,
is about com.unity.transport currently as I read it, its really barebones right? You can easily send/read messages between client and server.
Is this package going to have new features, like mirror for example networktransform or smoothing components or do we need to make them our selfs with this package?
I'm not sure using the jobs system, but regular mono behaviours
As i'm reading the roadmap
https://resources.unity.com/unity-engine-roadmap/multiplayer
is it even worth investing time using the com.unity.transport?
The Unity transport is meant as a transport library. So it won't have high level components like NetworkTransform. We have a package called MLAPI (Netcode Core in the roadmap) which is similar to Mirror and provides components like NetworkObjects and Transforms etc.
Wednesday, time for another stream on Creating an Online Roguelite (with Photon Quantum)
22h CET on https://www.twitch.tv/erickpassos76
Summary on what to expect:
- UI with nickname, healthbar and damage received
- physics based rotating door
- moving props
- gameplay tweaks and game design discussions
- Playtest with Audience (again)!
you mean export the unity application server?
Hi guys. Anyone knows what is the status of Unitys networking system? MLAPI?
If the MLAPI (netcode core) based on the transport libary?
The MLAPI has a flexible transport system which allows you to plug in any transport library. The Unity transport will be one of them but we also support other transports such as UNets LLAPI and community based solutions like Enet, LiteNetLib or Ruffles.
Is Unet still operational in unity 2019+? I'm stuck on 2018.4 here because all my networking is built on unet
i mean about the export the nav mesh for manage the walk position in server without server
@versed rock Gotcha, I don't speak spanish sir, sorry.
?
Mirror is an open source "replacement" and should be similar enough to get you unstuck.
You can use UNet HLAPI in Unity 2019+ by adding the "Multiplayer HLAPI" package to your project.
Hi! Im using mirror, but in the client connectionToServer and connectionToClient are both null. Am I missing something?
@azure mango maybe your object isnt "spawned"?
so I tried upgrading my project to 2019.4 here, but this is a 3+ year old project, full of assembly shenanigans and assets from multiple locations... things did not go smoothly
rolled back to 2018.4 for now... will try again later with more patience
I did get a weird issue where I got some compiler errors about things like NetworkManager being defined in both UnityEngine.Networking and the new com.multiplayer-hlapi package assembly... is there a strategy to sort that out?
@high night Yeah it is, because its what im controlling. It seems that only the player assigned in the networkmanager can check the connection
So i will pass it to whatever it instantiates
NetworkManager is gone now
@high night Don't post gifs, please.
It looks very much like it's there still, in the hlapi package
yeah but it's not the same anymore and probably why you got all the errors.
if your project used networking you'll probably have to re-build the whole solution with mirror or hlapi
idk... that kind of error is about the type definition... if it was different only internally I would have gotten other errors
but yea, I do have to rebuild the whole thing from the bottom up... I have some assemblies that are built against build dlls, so those require an up-to-date build to get started
so they were likely referencing old assemblies in teh build folder
for that error specifically it's because UnityEngine.Networking only has web request stuff now
hmm, yeah, so I probably have references to old unityengine.networking in places
yeah, this isn't going to be a quick-n-easy upgrade... it will take some planning
my project is actually three or four separate projects, sharing assembiles and libraries and making things especially complicated
I think you should get those issues only in old Unity versions where UNet is still included.
hmm, yeah, so it definitely looks like there's parts of my code still referencing 2018 assemblies
so just to be clear, UnityEngine.Networking doesn't contain hlapi types anymore?
Maybe we still shipped HLAPI in 2019, I'm not sure.
hmm
I do see a UnityEngine.UNETModule.dll in the 2019 files
not sure what's in there though
in any case, I'm refactoring some library code here to remove dependencies to the networking dll
hopefully make things easier to work with next time around
@high night I can't remember if I asked you this or not, but say I have a tick rate of 60hz, but the client's updates per second drops below 60hz and he cant keep up with the tickrate
that would surely cause problems?
Well you got to be sending the 60hz of input to server
so he'd be screwed if he cant keep up?
If he cant keep up i guess server will have to make do with latest recieved inputs
but wait
hm
this is the logical update we are talking about
you have to keep up with the logical update
if you cant, you'll crash
my game, for example, on server and client both tick inside fixedupdate at 50hz
but if fps drops below 50, that cant happen
render fps can drop
but fixedupdate must keep up wothout skipping frames
since your fixeddeltatime must be fixed, it can be hard to keep up
but i think thats not the issue here
?
Well I did a test and locked my server at 30fps, and it definitely caused problems
its about rendering at lowfps but fixed update is okay right?
I think fixedupdate will try to catch up, but it will catch up too late
so it literally cannot process 50hz tick if client is at 49fps
which leads me to another question. CSGO / source engine has variable tick rate of up to like 144hz
surely not all players are getting over 100fps
I think battlefield does the same thing
One "solution" I guess, would just to be have a 30hz tickrate, since anything below 30fps is unplayable and most likely clients will always stay above it
that's more of a band-aid if anything
@teal obsidian if server uses the last recieved input from client for each tick it processes, i guess it would be fine
does csgo run different logical tickrate for clients?
that would make local player prediction less deterministic
but i guess it would be fine if you dont use physics and reconsiliate with states
@teal obsidian your clients tick simulations should be cheap though
since its just the local player
@high night Well that would cause the tickrate to go out of sync. If the server receives ticks in the past, it just drops them
so wouldn't that be a bit of an issue?
maybe im overthinking this
@teal obsidian client time offset could take into client tickrate into account
but it would still be a very small part of that offset
if client runs at 20hz, you'd be adding 1/20 seconds
which is 50ms
id double that
number before adding to my client time offset
to compansate for oscillations
@teal obsidian if you dont discard inputs right away after using them on server, you could read the same input for the next "missing input ticks"
until the other inputs time comes in the buffer
.
I'd just want each input to get executed at least once in correct time
And then that input would be reused for missing inputs until its next inputs time
Anyone use MLAPI? The mlapi.network site now redirects to the unity site, and the docs only reference the new MLAPI version. I can't find the previous version docs anywhere for the version of MLAPI we're using
Sorry about that, I'll see whether we can provide a solution for that. You can still open the sources in Github directly( /_docs folder) or clone the v12 tag and run the site locally hope that helps: https://github.com/Unity-Technologies/com.unity.multiplayer.mlapi/tree/v12.1.7/docs
Thanks 🙂
Semi-Pseudo Code```
Players = PhotonNetwork.Instantiate(PlayerPrefab.name, new Vector3(-66, 2, -52), Quaternion.identity, 0); //Makes an instance of the player
And then later in the code
Players.transform.position = new Vector3(-65.9f, 1.1f, -54.2f);
Guys, I have a doubt regarding photon,
will OnPlayerEnteredRoom callback be invoked only for new player or will that be invoked to a player who is rejoining room
Depends on the rejoin
If you manage to use ReconnectAndRejoin before the server times out the client, no callback is called
If the reconnection goes through the master server again, you are technically joining the room again, as a new client (you get a new actor number) then the callback@is called
The fast reconnnect can only be used when the disconnection was caused by a socket closed reason, like when you pick up a call in an iOS phone. And it works if you call it within something like 3 seconds after socket was destroyed by iOS etc
@lapis vapor
@gleaming prawn , is there any callback I can use if my player is joining back with reconnectandrejoin()
You get a callback on your own client that it succeeded.
On others no. Technically from server and others perspective you never left the room, only was inactive for a few moments
I don’t exactly remember the callback you receive, but this is documented on the website docs about photon realtime and pun2
Sorry, typing from phone
Yeah got it @gleaming prawn , I was using OnPlayerEntered callback, so I guess in my case I have to send an RPC to the other player when the player rejoined successfully
Ye, you can use that
@weak plinth This is game networking and that post is one year old.
I have a question regarding photon - I have a script attached to a game object that uses public game objects players. if I spawn that players I dragged into the script slot in the inspector, they are ofc named as "clone". - and the functions of the script are not working as they are reacting to the name of the prefab, but without clone. is there any way around this? hope its clear what I mean lol
very simple solution would be to just use Trim("(Clone)"), but you should consider refactoring your code in a way that it doesn't need a specific name to work
thank you, that sounds cool - I think that for me is enough for this little test project tbh, and I'd also like to learn it. I tried various ways with what you said and what I found on google, but it did not trim it - is there anything wrong? I tried:
PhotonNetwork.Instantiate(player.name.Replace("(clone)","").Trim(), randomPosition, Quaternion.identity);
PhotonNetwork.Instantiate(player.name.Replace("(clone)",""), randomPosition, Quaternion.identity);
as using only trim gave me an error I cant convert from string to char
(I can make it work with tags, but still would be cool to undertand the trim!)
@gleaming prawn Sorry to bother you, but how should I be ticking my client and server? People are saying fixedupdate is inadequate and I'm not sure what else I would do
because if the fps dips below the fixedupdate tick rate, the client starts sending packets too late. For example, for testing purposes, I had my tickrate at 60hz, and locked the client's FPS to 30fps. It worked fine for a bit, then around every 7 seconds, the client would send a late packet to the server. Just want to know if you know of a way to fix this, or if it's even that big of a problem in the first place
'late packet' in what sense @teal obsidian ?
Hey, I want to send the RPC to both players in the game. However, it does not work like I usually use RPCs?
I get the following error: RPC method '{0}({2})' not found on object with PhotonView {1}. Implement as non-static. Apply [PunRPC]. Components on children are not found.
However there are no children nor are the objects children of anything. Also, there is a photon view on the object. Not sure whats up with this...
I don't know pun and have no right saying this but are you sure you're supposed to use Collision collision at line 30?
Maybe not but I think collision events are a special case.
I'm supposed to be working on some PUN2 networking for a work project, but I've just moved house and only have limited mobile data. Am I able to test the netcode locally across 2 clients or do I need a connection to the PUN servers?
I think they are probably but cant find something to solve it :/
Calamari, I think you need connect to the servers
at least if I do not start with that, a lot wont work
Try removing the parentheses and the parameters from the first rpc argument
you mean delete collision2d collision from the punrpc function?
Messages don't usually need parameters, look into unity SendMessage for a similar idea
Like you can't call it as a method as it is right? Maybe photon doesnt know what to do with that
Sure you can, it just needs to know what the parameters are
Just like how you can call Start() from a different method
let me try
Never had to, interesting 🙂
but you mean like this do oyu
view.RPC("OnCollisionEnter2D()", RpcTarget.All);
as I cant remove the parameters from the oncollision itself
hmm I cant imagine its not possible to use oncollision with photon :/
I would think you sync the results not the method itself
I found an old post from 2014 where someone says he thinks its not possible..not sure but it seems to be the case
yes probably, would you point me to the direction how to?
not sure how to "save" the results and then call them...
I truly believe there must be a photon tutorial where they have two characters battling- trigger/collision event must take place at some point sorry I can't help I'm just learning myself- in a different library
no worries, I am searching but no luck until now ^^
@graceful zephyr 'late packet' as in the tick assosciated with the packet is less than what the server is at, when the server actualy receives the packet
it's caused by a low FPS. If I'm running at 30fps and my fixedupdate runs at 60hz. Packets are sent at the end of every fixedupdate
so it literally just gets out of sync and cant keep up
When you're running a high tick server like that, should you expect all of your users to maintain frames per second higher than the tickrate?
¯_(ツ)_/¯
w a t
I thought you were big network man
I guess I could just run multiple servers with different tick rates. "If you don't average 60fps, go on a lower tickrate server"
by 60fps you mean the client cannot run the local simulation fast enough? Is that a common problem with your game?
Nobody does that
this should be a very generic problem though
If the client can't average 60 updates per second. How can be expected to run the 60hz tickrate
and send packets to the server at 60hz? Since the server is expecting every client to stay in sync
if you mean they cannot render at 60fps how can they simulate at 60hz, one is likely gpu bound the other cpu, right?
No, so the client ticks at 60hz right
every fixedupdate
if the client is at 30fps, he gets out of sync
and starts sending packets late, randomly, every few seconds
then when the fps goes back up again >= the tickrate, the client says in sync fine
I'm not sure how else to explain this problem
because logically, how can the client tick and send packets at 60hz if he's only doing 30 updates per second? If that makes sense to any of you guys?
My server drops all late packets btw, so it sort of expects clients to stay in sync to play properly, unless this is the wrong way to do it?
Hey fellas, do you know from small mirror network discord servers?
I guess I could sort of fix my problem by allowing the clients to sync his tickrate more into the future
that way if he sends a "late" packet by 1 tick, its still in the future to the server's tick
@teal obsidian you can never expect your updates to come with even 1/tickRate spacing to the server
even if client can keep the render rate, which has nothing to do it really
as you're talking about a fixed rate step
So just increase the allowed spacing?
¯_(ツ)_/¯
bruh
because if I do that, clients will have more perceived latency, for non predicted controlled objects like vehicles
How much of a spacing would you personally allow for the games you build, fholm?
Assuming fast paced, first person type game
not sure what you mean
How far would you allow clients to send packets into the future
until you tell them to resynchronize with the server's tick
i don't do it like that
i never synchronize to server tick like that
and sending packets into the future doesn't make sense, how would you send a packet into the future? it gets sent whenever you send it
Right, but it gets stamped with a tick #, to tell the server which tick to process the packet on
so anything greater than the server's tick, when the server receives it, is destined to be processed "in the future"
is what I'm trying to convey.
Ok, did some more testing, increased the allowed spacing by 1 and that seemed to fix it?
if it works it works, I guess
I'm just worried about increasing perceived latency to the client.
anyone know a good asset available with fairly simple setup for client-server multiplayer setup?
Mirror and MLAPI should be relatively simple to get going
I'm in the middle of writing the health and movement scripts for my game but i haven't done much else yet so it should be a fine point to add this, right?
is anyone here familiar with AssetBundle.LoadAllAssetsAsync()?
can anyone help?
How can I check/be sure a request come to the server from my unity app using webrequests? if i use a public/secret key system it is secure considering unity is setup in users devices/they can get it or not?
Can we use PhotonRPC outside of room but still connected to the master server and inside a photonChat channel
I basically want to sync the player character in the scene when a player joins a photonchat channel
anyone know how to exclude certain players from interacting with certain canvases on multiplayer?
Hello I have been stuck on this issue for hours and cant figure out why, after watching this video (https://www.youtube.com/watch?v=l2ybEFWHsz8) at 9:45 he shows what should happen, but for some reason at the very end my player wont spawn in (In the consol it says object reference is not set an instance of an object (idk what that means))._.
Code that should spawn player:
oh wait only the start button is not working
when I click the button to spawn the charcter in
nothing happens
WAIT
hold up
can you put a Debug.Log in your SpawnPlayer method to see if it's actually called when pressing the button?
i fixed the button
BUT NOW
it says failed to instantiate prefab
and character wont spawn
I have no idea of networking, as said, but try removing the .name in your instantiation
oki
it says error
cant work
but yeah for that instantiate prefab thing this is what it says fully
the player is called Player 2 1 (btw)
i also made my own movement and camera fallow instead of fallowing the tutrial for that part
should I delete my movement and camera fallow code and try to fallow the tutorials version or should that not matter?
that shouldn't be the issue
just saying in the tutorial they put the camera within the player mine is not
I say it again, i have no idea of networking, but (obviously) your client is not in a room, whatever that means 😀
seems like your connection is not established at the point where you're trying to create the player
but I may be totally wrong
oof
you could also try putting the cam inside your player, as in the tutorial, but I doubt that's the issue
since it's not about the cam but the player itself that's not being created
when I do that I get a new problem
mabey I shouldjust delete my movement and camera code
and just fallow the tutroirals version
mine might not even work for multiplayer
May be possible 😀
oh wait
but he does not show how to make player jump
NOoOoOoOOOo
oh wait he says next video he shows hot to jump
HE LIED
🤣 🤣
idk what to beleive anymore
can anyone here help me with AssetBundle.LoadAllAssetsAsync()? I setup what I think is a good loader here ```csharp
public static class BlueprintLoader {
static AssetBundleRequest LoadRequest;
public static void Load(Action<IEnumerable<BlueprintScriptableObject>> callback) {
var bundle = (AssetBundle)AccessTools.Field(typeof(ResourcesLibrary), "s_BlueprintsBundle").GetValue(null);
LoadRequest = bundle.LoadAllAssetsAsync<BlueprintScriptableObject>();
LoadRequest.completed += (asyncOperation) => {
callback(LoadRequest.allAssets.Cast<BlueprintScriptableObject>());
LoadRequest = null;
};
}
public static bool LoadInProgress() {
return LoadRequest != null ? true : false;
}
}
and here is some code that invokes it ```csharp
public static IEnumerable<BlueprintScriptableObject> GetBluePrints() {
if (blueprints == null) {
if (BlueprintLoader.LoadInProgress()) { yield return null; }
else {
BlueprintLoader.Load((bps) => {
blueprints = bps;});
yield return null;
}
}
yield return null;
}
``` and yet I never see my static property `blueprints` (sorry for non standard naming) become non null
I can do regular background threading and all that no problem but this funny cooperative multitasking stuff is confusing to me
what are addressables and how can I switch to them?
basically I am in a mod and calling into load some game resources I need
I saw that briefly but I am not creating the assets just getting them from an existing game
no clue then sorry
guys is there any scenario where a Photonnetwork.Raiseevent be invoked in the client and not being received by others, ? in my case a raise event is invoked in the client where it was called, but not in the opponent
I'm adding the code here
public override void OnPlayerEnteredRoom(Player newPlayer)
{
base.OnPlayerEnteredRoom(newPlayer);
FFNotification.Instance.HidePopUp();
Invoke("DelayedRaiseEvent", 2.0f);
}
void DelayedRaiseEvent()
{
FingerHandler.mInstance.RaiseOpponentReconn();
}
public void RaiseOpponentReconn()
{
PhotonNetwork.RaiseEvent(OPPONENT_RECONNECTED, 1, null, ExitGames.Client.Photon.SendOptions.SendReliable);
}
probably better to go to that games modding discord then
this is for unity Networking (as in game multiplayer) help
server link?
no clue
this was the closest thing to a channel on async programing lol
definitly the wrong place 😛
Can someone help me on this?
does anyone here know where to start when making a multiplayer game
like a tutorial link
first link in pinned messages
Anyone know why this is happening with photon
that the player
and thats the player container
I would explain the issue I for one am not downloading that
@warped marten If you are using OBS, remux the mkv to mp4 before putting it on discord to have it embed
Hey guys i need help when i try to upload the image I get a Bad Request. But works fine when i dont include the image. Am i doing something wrong here
byte[] bytes = userData.avatar.EncodeToPNG();
//form.AddBinaryData("[user]avatar", FileSystemScript.Instance.LoadFile("Application.persistentDataPath/TestFolder/ImageTest"));
form.AddBinaryData("[user]avatar", bytes,"testImage.png","image/png");
form.AddField("[user]first_name", userData.first_name);
form.AddField("[user]last_name", userData.last_name);
form.AddField("_method", "put");
using (UnityWebRequest www = UnityWebRequest.Put(url, form.data))
{
www.SetRequestHeader("content-type", "application/x-www-form-urlencoded");
www.SetRequestHeader("access-token", authentication.token);
www.SetRequestHeader("client", authentication.client);
www.SetRequestHeader("uid", authentication.uid);
//www.uploadHandler.contentType = "multipart/form-data";
//www.uploadHandler = new UploadHandlerRaw(System.Text.Encoding.UTF8.GetBytes(jsonData));
yield return www.SendWebRequest();
if (www.isNetworkError || www.isHttpError)
{
Debug.Log("THERE IS ERROR " + www.error);
}
else
{
if (www.isDone)
{
string jsonResult = System.Text.Encoding.UTF8.GetString(www.downloadHandler.data);
Debug.Log("Server Put Response" + jsonResult);
if (jsonResult.Contains("error"))
{
Debug.Log("Error Received : " + jsonResult);
}
else
{
}
}
}
}```
Means you didnt send a request complying to what the server expected. Could be a wrong format, missing argument or syntax error in one of those, ...
Check the API
make sure you send everything as expected
but is there something wrong on my code?
I don't know I didnt look
If it emits the expected PUT request with expected params, then it's good, but I don't have a way to check that on your behalf
I'm guessing no one can help on this or have an idea how? 🥺
Anyone who knows how to sync game objects using mirror?
it's pissing me off that I can't find a solution
thanks, hope i'll find the solution i need
hmm according to my friend, he read it but it wasn't helpful for him
how to sync game objects using mirror
That's literally what mirror is for, syncing gameobjects through the network. And the best place to start is always the official documentation, when there's one.
🤷♂️ Don't listen to your friend, learn from the doc. Go through it at least one time before quitting. Network is really a complex topic if you can't even finish the doc you won't go far, as you will face a lot of bigger blockers
Photon Chat does not support properties per user. In theory, you could send a binary message describing the character but this doesn't scale well when users join/leave the channels a lot.
If you are OK with this, you could show the characters for some users you already know (because you were in a room together or because they are friends). Each user can set a status (which is sent to friends) and this (again) can contain a character description.
Ahhh i see and well i tried using rooms the thing is i'm trying to make a party system like apex legends, fortnite, warzone where friends can join each other before going into the game i can't do it using room since if i make a room named party and then create another room and try to put those players into that game room even when removing the players from the old party room i get errors
so i used photon chat to make a party system which works
i just dont know how to make it so whoever joins his character is showed to every player in that channel
ig using mirror for party system and other stuff using photon
Well you do have a fair point, I just read it and found some interesting stuff..
the weird thing though is that after i dragged in the prefabs in the Registered Prefabs List in NetworkManager, it still doesn't show up on the client side
and yes, the prefabs do have a NetworkIdentity object on them
MIRROR 35.1.0 IS LIVE ON THE ASSET STORE
Download: https://assetstore.unity.com/packages/tools/network/mirror-129321
ChangeLog: https://mirror-networking.gitbook.io/docs/general/changelog
You have one occurrence of the prefab instantiated in the scene ?
Yep they do spawn in the scene
I also discovered this, but as said, not working (edit: i already mentioned this list, my bad)
You made a new build after your last modifications ?
got to go eat, they also have a discord for mirror if you need detailed help
I don't know exactly how you want this lobby-room to work. Here's one idea: You can put everyone in the actual room but run it as lobby, before it's full. Then, don't close the room and start the game (load scene, etc) with everyone in that lobby.
No need to change rooms, actually.
If you got errors with the lobby when someone leaves, I am quite sure it's easier to understand and fix those errors instead of using yet another networking solution in the mix. If you try again, let us know what's up.
Hey guys, i'm making a server for a MMO (only for lean about how MMO server works) and need some place or any documentation or site with information that how to manage the server side of a MMO?
there is none
nothing?
It Hare has some books to learn some of the overall ideas. Not only specific to MMOs and won't go into the details because there is just too much to cover.
I have a question. I need to connect players to another player who is the server. How the clients are supposed to know wich is the ip of the player who is the server?
I want to avoid using dedicated servers.
@versed rock not really no, if you are looking for someone to teach you how to make an MMO via book, etc.
That doesn't exist
Yeah i know, but maybe some basic architecture, examples of server loop, some ideas the how manage the packets
I see the books, u know any other books with ebook format? Or any owebsite with resources
Thanks for the info about the books
I see a lot of people use node.js for server mmo, im trying create with .net core
nobody using node.js for any mmos lol
at least not anything serious
we meet again luke ...
😄
🤣
😉
.net core (.net 5) would probably be my platform of choice as well when creating an mmo, also allows you to possibly share parts of the code base with the Unity client side. I don't think there are many other good resources around, maybe if you are looking for a specific topic there's some stuff I could link. If you need more high level overviews the talk from David about Albion is pretty good: https://www.youtube.com/watch?v=x_4Y2-B-THo
hello anyone can tell me the best networking for unity to develop a networking game
First pinned link
This site provides Unity Multiplayer documentation, references, and sample code tutorials.
the best networking
subjective
but id say the challenge is more in design of your game then what networking you use
so use whats easy to prototype with and whatnot
there is the new networking mlapi i think its good i am watching tutorials by dapper dino he is so good i think i will use it
https://hordes.io/ i think use node.js
Hey everyone!
I'm trying to instantiate a gameobject using Photon, and then parent it to the player that instantiated the object. However, when I try to do this, the object that got instantiated only gets parented to the player for a split second, and then becomes a child of the scene. I read that you have to call an RPC instead of Instantiating it directly, but you can't set parents inside of RPCs, so how would I go about doing this, because I honestly have no idea. Any help is appreciated.
Here are my scripts
thanks
yea same here
.net 5 + project orleans (this is the core sever/storage) maybe some sort of unity inside a docker container (if i need specific unity stuff for 'parts' of the game world, but keep this low) + a bunch of asp.net core web apis/signalr apis
i think in use orleans too but i don't know...
@teal obsidian I was thinking for myself, i'd serialize the heavy data every fifth second or something
And boolean packs per each tick so i wouldn't miss anything on them
Yeah originally I would just send a TCP message to each client whenever someone entered a car, and if a player joined, send him all the TCP info that he needed if players were already in cars
but that was way too messy
Maybe you are thinking about serializing booleans like that with less frequency
And thats why you are worried that if you used a boolean as a "trigger" thats true for only one frame, it might be missed?
@teal obsidian Either way, i think rpcs have their uses
I assume you are also implementing your own serialization correct?
I use unity's serialization
But you have control over it per tick?
yes
I think maybe also somehow being able to pack RPCs for same tick wouldve been nice
So the rpc gets called when serialized data is recieved
in the same tick the rpc got called in the server
For right now I'm just building a system where server sends ALL data every tick, then client just checks if player is now in a vehicle, that he wasn't in when he received the last update
that seems to work, Probably optimize it a bit later
I mean when an rpc is called from an object, server would also include that "function call" into that ticks data
So you are able to use rpcs
without causing a mess or breaking the tick based simulation
yeah but then you have an issue, where if players are already in vehicles before the client joins
you would have to account for that too
ah, yes
that's sort of the messy part I was talking about. I got it working, but I just thought this would be a little more efficient
and safe
I guess its just the "view"s job to reposition the character to fit the data
And "view"s job shouldnt possibly get too complicated
So i guess i wouldn't worry about a little code volume to make the process more efficient
@teal obsidian
yeah I suppose
sometimes I write really shitty code then I wake up in the morning and im like "why the fuck would I do it that way"
i listen to eurobeat while i am coding and my code is always shitty
then i spend days debugging
and debugging the client is sure pain in the ass
i cant simply step into the next tick, by then the server have already moved on without the client
yea that really sucks for networking programming
i can kinda debug client playback now, Since i use curve data I can 'scroll' the time on the client as if it was video
for a weeklong issue from some time ago i had buffered the server states on the client
onoy then i was able to figure it out
yeah something like that, it was messy and i didnt keep it, but i will probably remake it again when i face a big issue like that again
yea mine is more of a side effect of my networking/data layout
the issue was reference type inputs that i fed to character, i was modifying them in prediction 😫
thinking of exposing some dev/debug tools that allow editing of it
sounds nice
I used to think I was good programmer until I started doing game networking 🤣
takes me 30 minutes to write 10 lines to make sure I didnt break anything
im trying to build a networking kit/library so takes even longer
i have to think of as many cases, and then build examples
and soon build tests
I should've just done more research
My serialization part is mostly a mess
This fps sample unity talk has some good points on serialization
my initial serialization was a .net library
How does that work?
just add it to the project 😛
like json style?
it just serializes the data right?
yup
no classname and stuff
um kinda yes kinda no
there was a mode for 'typeless' or something like that
so you can serialize anything and the client would discover the right type and deserialize into that
had some smarts so any types like that were optmized into a int lookup after the first
was cool
I think i'd rather include my type info as headers myself
but now im using Unity.Transport and just include my own TypeId
yea
my issue now is a packet can only contain 1 type of data
but since its a RTS kit i fill up most packets
need to optmized the data down a bit, then see if i can pack more into a packet
rts kit?
you are making an rts networking kit?
yup
what kind of architecture is that?
i see
using Curves
what curves?
Technical deeptime into the unique networking architecture of Planetary Annihilation.
basicly break all data into keyframes
and only sync those
and in many cases that data can be predicted quite far, which also allows optmizing the data down too
hmm very interesting, i am still reading it, i am trying to understand in what way curves better than snapshots with timestamps
@sonic marsh
yea its a tough read
very interesting
i think vs normal snapshots you can reduce further
depending on how smart your snapshot system is
you can fully exclude data that has no changes
is it like
when you move a unit,
a curve with units current position and next position in end point and in 15 seconds(future) are sent?
but in the example of a RTS you could probably safly assume that 20ish secs of future path can be predicted
but something like health shouldnt
the trick is the server is a head of the clients
not by much
my tests show around 200ms works well
but need to test higher latancys
server wouldve already sent the new curve if something has changed before client can see the wrong image @sonic marsh
its not the client predicting
its the server predicting the future
yeah pretty cool
clients are very dumb, they dont predict (tho maybe some things could)
thanks for sharing, this article looks nice
all good
tough to find much info around that style of networking
so nice to have discussions around it
also i do think it only fits some game types
the faster the game needs to be the worse the 'delay' will be
i wonder how they do the tanks wiggling out of each other when they are packed tightly
in planetary annihiation
since their paths are not linear
hmmm not sure
i guess curve lenghts shrink
that could be something done all client side
up to the point where its pretty much snapshot interpolation
the path curve is synced, but then client could test if something is close and allow 2? units of pushing or something
i feel that could open other issues tho
eg a bullet hits on server, so the build end keyframe is sent
but on client the tank has moved 0.6 X and that will visually look like a miss
i think server could send curves with same len without caring if there will be collisions or anything
if something goes wrong, server would send a new curve next frame
and clients would only use the beginnings of these curves since the new curves override previous ones very quickly
@Roycon#3914
cients are probably all curves
so the curves sent in these situations have completely useless "future" parts
any client prediction/visual things cant really mess with most cutve data
yeah clients dont need to simulate/predict anything
that curves + DOTS feels really nice to use
hoping to have a 0.1 alpha out in a month or so
tho i kinda want to sell it too
can someone help me i am installing the new network system mlapi and thats error coming what i can do
hey guys in pun2 is there any override function where we can check that while we are in a room and when certain condition meets we get transferred to final scene in every connected players device synchronously...because in update its creating hierarchy overloading like this
would PhotonNetwork.AutomaticallySyncScene = true; help out?
and then you can just load the scene for the masterclient and all other players would follow
Hi! How is the new multiplayer system called?
Hey! Trying to add voip in a project using Mirror and haven't found any good alternatives yet. I tried https://github.com/TehMightyPotato/Heliograph however last commit was 2 years ago and the example scene doesn't even work properly. Any suggestions on where to start? 🙂
@patent fog Yeah! That one thx, I couldnt find it
How can I start with multiplayer. I’m working on a multiplayer car game. I really don’t know too much about networking
This "Hello World" guide walks you through creating a project, installing the MLAPI package, and creating the basic components for your first networked game.
This (MLAPI) is the new experimental networking library we are working on.
Thank you, have a great day
I have the same question, any tips of a free voip alternative that works with Mirror would be awesome!
Did you try Vivox ?
Have not, will check it out thanks!
anyone here good with photon here
Does anyone know why when I play my game the camera's for both players are opposite? so when I play the game with someone else I see his camera and he sees mine?
On my end it feels like the camera isn't following but the other player it shows it is following and vice versa, photon cloud?
If I have a view of any kind on an object (let's say a Photon Rigidbody View for the sake of the question), do I still need to use OnPhotonSerializeView to synchronize it or is that taken care of? (if this has been asked let me know :0) )
@weak plinth Not a place for ads. You can find it on forums, link is pinned in #💻┃unity-talk
Is there an easier way to make other clients see your moving without the hello player manager and player script
Hey I need help
I was trying to get MLAPI working so I can make a multiplayer game
But when I paste the link into the package manager, I get an error saying I need to install git
but I have git installed
Can anyone help me
Did you just installed it now ? If so, I'd recommend a restart of your computer to reload env vars. Can you type git --version in your CLI ?
@hoary glen
Tbh, I got know clue what im doing. I have some coding experience but really im just messing arround
Command Line Interface
available from cmd.exe in windows or somtimes in your IDE for example
yeah git not found by Unity
SO i still recommend a restart to refresh environment variables
Assumed you installed git correctly
restart Unity and/or your computer
okay
hmm
do you think it has something to do with the fact im running 2020.2.2.f1
instead of 2021
the page says you need 2019 + but idk
ill restart my computer brb
2019.4+ should be ok
@patent fog Ok im back
unity is starting
Its loading
installing git package
AYYY it worked
thanks for the help
ill tell you if i need more help
@patent fog I need some more help
Im at step 5
When I hit add compoent, there isnt an option for MLAPI
Nevermind it just showed up.
sorry for the ping
Hi can someone help me?
Is there an easier way to make other clients see your moving without the helloplayermanager and player script in the unity documentation because I already have a player movement script
im not sure
does anyone have learning resources for aws connectivity here
I’m having a problem where I’m using a Logitech g29 with the sdk and it won’t register input. There is a player script on my player that takes the input and moves the player but when I make a prefab the player doesn’t want to take input. There is an sdk file with a dll, lib and pdb file in the project. Any idea why when I host a game or join, the player doesn’t take input?
Its okay, glad you made it work. Have fun !
Hey guys, any tutorial or reference for make Relay server in .net core for Unity?
nope
I have a .net core relay server service, something like Photon, I'm thinking of publishing it to the public. So I can share the source with you if you think you can learn something from it
Hey guys, anyone here has experience implementing video chat using Agora SDK on a multiplayer game using photon?
Should commands, like "reload weapon", or "shoot weapon" be sent inside the same packet as the movement and such?
because what if your player predicts "shoot weapon" or "reload weapon" animations, but the packet gets lost in transit
Hello, is anyone here experienced with google firebase firestore and realtime database?
Hey I am trying to implement Mirror in my game, but there is a problem. Both players (Host and client) are moving together. When I move the host the client automatically moves with him
They are shooting to the mouse position
You're probably missing a check for hasAuthority in your input handler. Mirror has its own Discord for support, link is in Asset Store page.
dont mind the server icon lmao
I used Firebase with the JavaScript SDK, not the one for Unity, but maybe I can help
i am sorry about this
and what i am suffering from is i am trying save a custom object in firestore
but its not working for some reason
i can save the normal dictionary object
but i cant save this customized object for some reason
no idea why
yea
i am using this documentation
and i doubt i am doing anything wrong its something weird
Looks okay from the docs yeah.
Is there any error or just nothing happens ? I would catch exception to make sure
Is the Uri field supported ? Is it boxed to smthg else like a string? I would just ignore that field to rule it out
What are the warnings you get from your IDE on the fields of the first screen?
I would also Update instead of Set, maybe it worked first time with your first example and Set does nothing if already exists ? need to double-check that
That's all I can see right now with that much info
I assume you're up-to-date, but if you don't use latest version I would check if the class payload support is a recent addition or not
Anyway catching the exception should help in the first place instead of guessing 🙂
omg it was because of the Uri -_-
god i wasted so much time
i tried capturing exception btw
it was giving me nothing
it was like just stuck no error or anything
thanks for your help alot
Can i export projects which contains photon pun 2 to webgl platform
trying to enable ragdoll in multyplayer, mirror responds with "networkClient is not ready" anyone any ideas? I'm trying to enable it with a key input then running a [command] function then i run a [clientRpc] function
also when i go into ragdoll as host the clients disconnects
can i ask a question about Photon Pun here?
channel description says and networking solutions, so ill just ask
im trying to play an animation whenever a player gets hit, but the animation plays on all players, regardless of the fact that having those animator's bool value set has nothing to do with Photon or Networking
here's the snippet that does the RPCs:
private void OnTriggerEnter2D(Collider2D other)
{
if (photonView.IsMine)
{
PhotonView otherPhotonView = other.gameObject.GetPhotonView();
int id = otherPhotonView.ViewID;
if (!otherPhotonView.IsMine)
{
photonView.RPC("Damage", photonView.Owner, 1);
_plrHud.TakeHudDamage(_health);
photonView.RPC("Boost", otherPhotonView.Owner, id);
}
}
}```
here's the Player HUD script, that should set bools to true for the local player and only the local player:
```cs
using Photon.Pun;
using UnityEngine;
public class PlayerHUD : MonoBehaviour
{
[SerializeField] private Animator _healthAnim;
public void TakeHudDamage(int health)
{
switch (health)
{
case 2:
_healthAnim.SetBool("2Health", true);
break;
case 1:
_healthAnim.SetBool("1Health", true);
break;
case 0:
_healthAnim.SetBool("0Health", true);
break;
}
}
}```
it should be noted that the player hud is instantiated only on the client which returns true to `if (photonView.isMine)`
this is how that happens:cs private void Start() { if (photonView.IsMine) { GameObject _instantiatedHud = Instantiate(_HUD, transform); _plrHud = _instantiatedHud.GetComponent<PlayerHUD>(); } }
where _HUD is a prefab set in the Editor
Hey everyone. I'm having some trouble. I implemented a database in my game using sql. I used a dll to conect the game with the database. The thing is that when I compile it for android in IL2CPP the dll doesn't work but it does in mono. I'm trying to upload it to google play so I must have the IL2CPP compiling method in order to use the 64 cpu architecture.
Hi friends. If you were in charge of setting up an authoritative server for realtime movement for dozens to hundreds of users per map, the client is unity and the host is google cloud, any suggestions? Nothing is decided besides unity client and gcloud backend, target is desktop and mobile. I'm eager for somebody to convince me to use something for server architecture and unity client framework
Cant use photon?
what kind of game is it
@mystic tangle vehicle riding essentially
@paper sleet funny, I was given the requirement of "not photon" by a developer. I just started. I didn't press it
the photon solutions are amazing products
that work well
and have good pricing
I would be interested in seeing the reasoning
otherwise you can use any of the open source solutions
I would recommend mlapi over mirror for the sole reason that mlapi is owned by unity now so you have official unity support
do keep in mind that mlapi is in the middle of a big refactor at the moment because unity bought it
the unity update
up, i really need help with this, ive been stuck for a while
Mirror also good
I wish there was a way to generate RPC's and such, I feel like I'm repeating myself sometimes and I hate it
I get everything has to be manual because otherwise it'd be super inefficient not knowing what to send where but if it started dumb but got the job done- then gave the option to go in and manually edit them as you need.. I just want to prototype shit and keep getting carried away in the messy structure of code that follows a programmer new to net code
new programmer in general more like it, maybe it's not just me though
@somber drum this is a common criticism of the Mirror/MLAPI style of netcode, in that it tends to make for fragile code. So not just you
note that with MLAPI there are ways to sync the state of the game outside of RPCs (NetworkVar)
Yes I've been using mirror, hopeful there's other solutions out there but I hear MLAPI is in a bit of a limbo atm
Photon does stuff differently I'm assuming?
Photon has a few packages available. They have PUN and Bolt, which both work a bit differently, but are also working on a new one called Fusion, that has a really nice abstraction layer between gameplay and netcode
MLAPI was acquired by Unity recently and so has some changes coming in the pipeline. They have a pretty active discord if you're looking to use it
I've signed up for fusion a while back so I'll probably wait that out hearing all the good things planned/implemented
it's really good. Has a very strong architecture, very easy to code against. Is tick based, so can do client prediction/rollback
exciting stuff, can't wait!
up. still having this issue
I use a dictionary, wouldn't see a point in my case saving to database
Hello! I can't seem to install SSH.NET through a Git URL in Unity. I get an error saying a manifest is missing and it could not install the package. If you could help me with that it would be appreciated, otherwise please reccomend a good SSH client asset. Thank you!
Alright, probably not going to online anytime soon so please DM me if this answer get's drowned.
okay thanks! :>
Any sample for code for uploading picture or file to a server? All i could find online are some outdated codes that doesnt seem to work
Anyone here?
I’m working with mirror and when I host a game, the host’s gameobject which is a car, makes the texture look weird. The car is in a LOD group. It’s a model I found on the asset store.
@fringe fossil Seems odd to be networking related, unless there's a link somewhere. Sure it's not just various LOD models being screwed up?
Is mlapi in preview because when I add it to the project from git URL it shows preview in front of its name in package manager.
MLAPI is an experimental package (we changed our package lifecycle a bit) https://docs.unity3d.com/2021.1/Documentation/Manual/upm-lifecycle.html
guys what do you all use for networking? I've seen people use Mirror and Photon. Any others there? Which one is preferred
Fusion pretty much is in the works, but actual release date is still squishy.
Hey fellas, I'm using Mirror with Authoritative server. My player component has a NetworkTransform component. The network transform is client authoritative. I'm trying to teleport the player after a scene load to 0,0,0. I have tried ServerTeleport on the server, I have tried setting the NetworkTransform's transform position on client.. nothing seems to do.
code snippet or hatebin
make sure you're not overriding your 0,0,0 call via spawnpoint or something pre established
in the net manager
@somber drum Thanks, I appreciate your response. I'll be trying again later maybe. For now I worked around it.
Mirror has it's own Discord for support...link is in Asset Store page
@gray pond Thanks. I would click on the Discord link on Mirror's site and it would never open the actual invite apparently, I was assuming it was just using this server. Got it now. Appreciate it.
guysssss
"Running the game over internet currently requires setting up a Photon Transport for MLAPI, which uses Photon relay server to facilitate communication between clients and server living on different networks."
that's... surprising, don't they still support their own transport too?
Oh the wording is a bit confusing. This means "running over the internet without port forwarding". Basically if you want to run Boss Room as a listen server game and play with friends you will need a relay server based transport instead of a direct ip connection based approach unless you open ports on the hosts router.
yeah I get that 🙂 but doesn't unity have their own relay servers too?
I haven't ever used unet so I wouldn't know better
thought that was one of the key points on using unet though
(or Unity's service for it rather)
The UNet p2p service is at the end of its life cycle. We are not taking any new customers anymore as far as I know. We might offer a new relay service in the future but currently we don't have one.
ah, I didn't know it was that far gone already 🙂
here's hoping someone does EOS transport then
This is available in Mirror.
There is a Photon Relay Transport for MLAPI? What reality did I wake up in?
Can anybody with Addressables experience help me out with this one?
I'm wondering what the current good/best practice is, when instantiating and removing objects which were loaded in with Addressables.LoadAssetAsync()
Is it a good advice (or maybe even necessary) to still instantiate these objects with Addressables.InstantiateAsync() instead of GameObject.Instantiate(), even though the object is already in memory and doesn't really need an async operation to be instantiated? I've read on the Unity boards that only this way the Addressables module knows when to release an asset from memory.
Thanks a lot for any input!
@fleet lagoon Wrong place, this is for networking/multiplayer
Hey, which networking solution i should use ?
should i use the "Long discontinued" Unity networking
Or mirror
or photon
is there anyone making a game who needs a sound designer & composer? HMU i've never worked on a games project it'd be fun to work on something collaboratively
wait is the networking title as in like, packet transfer kind of networking not talking to people networking
Does anyone know why over pun2 network things might be different like on one a moving object can do one thing smoothly on the other it's not so smooth and player jump heights are different
It sends the positions of networked objects and the receiver will try to reach the last known/received position in some time. If you jump and send updates before and after peak jump, the receiver will never know how high you jumped.
The built-in network synchronization is not perfect. You need to adjust it your game's requirements.
You could send additional info to avoid this. E.g. you could send "i jumped this much" so the peak height is known.
The Smooth Sync package from the Asset Store seems to do much better than the included sync script.
We are working on a replacement for PUN 2, which will do much better...
Nice, just saw that #unity put out the first example of the new MLAPI development, a example scene called boss room.
I have really high hopes for the new MLAPI setup.
https://docs-multiplayer.unity3d.com/
Found the download here:
https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop
Time to experiment 😉
I am not really sure where to start with implementing something like a lobby system with MLAPI. Are there any tutorials or docs that could explain something like this?
I know there are YT tutorials from the old MLAPI, but i am not sure about the new adaptation since
Unity took over the asset.
Surely there must be changes, i am looking forward to it, because i all want is traditional Peer2Peer, no servers, no online mode required, etc etc.
how can i sync two GameObject in photon without instantiating the GameObject
@stiff ridge does this apply if the other machine (The second game open) has a different jump height...
Each client can send their own jump height (or other input needed to reproduce the movement smoothly and as close to the original as needed).
You can have a networked object in the scene. By default, the Master Client will control it.
You don't sync two objects as such. Both clients show the same networked object.
is that somewhat the same for say i have a object that constantly rotates on one side it smooth on the other it kind of just teleports back and forth while eventually getting to the area?
Hi guys.
In my app I want to spawn item by id from the server to my client (my items are stored in a array on client side).
This work well only if the server enter an id before the client connect to the server.
Everything else show me the error Key not found.
My goal is to spawn different items at the same location but each item must disappear before an another one spawn.
I use tcp/udp to send and handle data.
I've been struggling a lot on this one so if you could help me i'll be really grateful ! 😄
If I understood this right, then yes. The client which receives updates will not move the object, except with the updates coming in. As there is not an update per frame, the receiving client needs some way to interpolate between updates (and maybe extrapolate where the object goes, should no update arrive in time).
ok thank you i will try to see what i can do
oh wait one more thing, is it possible to downgrade Pun2 after updating it, it is a different version, i am using the same method i did before on other projects and it worked so maybe it could be that, im not sure
sorry, the asset store does not provide older versions. you could possibly rollback in your version control...
from which version did you upgrade and to which?
if the synchronization is giving you headaches, Smooth Sync from the asset store could help, allegedly (didn't try it myself).
2.18 to 2.29, big change, but i am lucky in this situation from other projects, so i will try to copy the files from another project and put it in the new it seems like its working as of now but i havent tested it, ill test the smooth sync if this does not work
that's some jump but not as bad as some projects, which still need to update from 1.95 🙂
yeah i tested it still nothing i cant exactly try smooth sync yet as i dont have money for it but, i will see if i got any differences in the projects
Is there a way to create custom NetworkVariablePermissions on MLAPI?
I know there is a NetworkVariablePermission called Custom but I do not know how to use it
JoinRandomRoom failed. Client is on GameServer (must be Master Server for matchmaking) but not ready for operations (State: Authenticating). Wait for callback: OnJoinedLobby or OnConnectedToMaster. does anyone know why i get a bunch of these, even though i get in the game
Are you sure you are in the game?
ah, you are trying to do an action that can't be performed in a room
@rich narwhal
Hey, im trying to use photon pun. and im just testing it out by putting this launcher script on a canvas. I get the "Attempting to connect to master" log but nothing else. i have the right appid and everything. what is it?```csharp
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Photon.Pun;
public class Launcher : MonoBehaviourPunCallbacks
{
void Start()
{
Debug.Log("Attempting to connect to master...");
PhotonNetwork.ConnectUsingSettings();
}
public override void OnConnectedToMaster()
{
PhotonNetwork.JoinLobby();
Debug.Log("Joined master lobby.");
}
public override void OnJoinedLobby()
{
Debug.Log("Joined Lobby");
}
void Update()
{
}
}
I put that as a script on the canvas and i only get 'Attempting to connect to master"
i waited like 10 minutes and it doesnt show anything else
thx in advance.
i did this (i had some other things in the script but i beleive this is more of what you need, i was able to connect with this) @weak plinth
{
Debug.Log("syncing");
PhotonNetwork.AutomaticallySyncScene = true;
Connect();
}
public override void OnConnectedToMaster()
{
Debug.Log("Connected to master");
base.OnConnectedToMaster();
}
public void Connect()
{
Debug.Log("Connecting");
PhotonNetwork.GameVersion = "0.0.1";
PhotonNetwork.ConnectUsingSettings();
}
Thanks! ill try that :)
How long should it ussualy take to show connected? this is my first time lol
hmm, for me its around 5 seconds
alright
Connecting
mmm
public void Awake()
{
Debug.Log("syncing");
PhotonNetwork.AutomaticallySyncScene = true;
Connect();
}
public override void OnConnectedToMaster()
{
Debug.Log("Connected to master");
base.OnConnectedToMaster();
}
public override void OnJoinedRoom()
{
StartGame();
base.OnJoinedRoom();
}
public override void OnJoinRandomFailed(short returnCode, string message)
{
Create();
base.OnJoinRandomFailed(returnCode, message);
}
public void Connect()
{
Debug.Log("Connecting");
PhotonNetwork.GameVersion = "0.0.1";
PhotonNetwork.ConnectUsingSettings();
}
public void Join()
{
PhotonNetwork.JoinRandomRoom();
}
public void Create()
{
PhotonNetwork.CreateRoom(" ");
}
public void StartGame()
{
if (PhotonNetwork.CurrentRoom.PlayerCount == 1)
{
PhotonNetwork.LoadLevel(1);
}
}
that from the github?
try this its a really basic launcher i found on youtube
Let me try it
Launched....
syncing....
connecting...
I must be doing smth wrong
like maybe with my unity version?
or something
im runnning 2020.3.0
hmmm
well i have the canvas
and with the canvas i have that script
And thats about all i have so far
hmm i usually put it on its own gameobject seperate in the scene but that would be a almost no chance change
I can try that but i dont think that would change it, still in the scene
I was just following a tutorial so i thought i might as well
Let me get it
Support me on Patreon! 👉 https://www.patreon.com/rugbug 👈
Today we're going to be making an online multiplayer FPS game using Photon PUN 2. This isn't just local multiplayer, you can play with anyone all over the world.
I've worked on a few multiplayer games in Unity using Photon before, and decided to make a tutorial series. Hopefully this can...
im on like 6:26
more like 6:40
hmm alright since its fps i followed this series a while back and i still use most of the photon parts
Welton shows us how to setup Photon Unity Networking (aka PUN) in our multiplayer fps project so we can get into the nitty gritty on Wednesday brah
(JOIN OUR DISCORD FOR A DOPE COMMUNITY, INFO, AND HELP: https://discord.gg/vrErfxa)
(CATCH UP ON OUR GITHUB: https://github.com/Kawaiisun/SimpleHostile)
Over the course of the next couple weeks, Wel...
he has really good tutorials and quite a few of them
i usually for implementing basic connection between watch 11, 12, 13 and then 14 if you want rpc, then go ahead and skip to 22 for a short bit for a menu
the rpc episode is more usefull for if it actually is a gun game
and good learning material
Yeah
hey @rich narwhal u still here?
using System.Collections;
using System.Collections.Generic;
using System.Transactions;
using UnityEngine;
using Photon.Pun;
using Photon.Realtime;
public class TheLauncher : MonoBehaviourPunCallbacks
{
public void OnEnable()
{
Debug.Log("Connecting...");
PhotonNetwork.AutomaticallySyncScene = true;
Connect();
}
public override void OnConnectedToMaster()
{
//Join();
Debug.Log("Connected");
base.OnConnectedToMaster();
}
public override void OnJoinedRoom()
{
StartGame();
}
public void Connect()
{
PhotonNetwork.GameVersion = "0.0.1";
PhotonNetwork.ConnectUsingSettings();
}
public void Join()
{
//PhotonNetwork.JoinRandomRoom();
}
public void StartGame()
{
Debug.Log("StartGame was called.");
}
}
```This is what i wrote
Only get connecting*
this callback just does not want to do its job ```csharp
public override void OnConnectedToMaster()
{
//Join();
Debug.Log("Connected");
base.OnConnectedToMaster();
}
ok
no problem
Sorry if I am being ignorant but the last time I was involved with network programming was over 10 years ago.
Are "we" still limited to 64 entities in a high-paced action game and a couple of hundred entities when "we" are talking about slow-paced games like RTS and MMO's?
Hy guys !I need to spawn different Prefabs, all at the same location on Client.
Let's say server sends : "Spawn Prefab 1" and some time later : "Spawn Prefab 2"... and so on....
Now when I do this, Client says:
KeyNotFoundException: The given key was not present in the dictionary.
Any idea on how to Spawn different Prefabs from Server to Client via TCP-UDP ?
Any help would be more than appriciated 🙂
Matters what networking sollution you use. Photon pun is 20 players for free. Mirror is higher but you need a server.
Pretty sure you can have more then 64 as long as your networking sollution lets you
Yes that is, of course the truth, but there will still be a tipping point where the actual logical design of the TCP/IP stack won't handle any more traffic or the network congestion of the "internet" makes it unusable
Yes. Im not that good at networking either. But I think its still more then 64 before like packet overload and stuff. i wish i could give you the exact number, i dont know it, im sorry.
If you go with something that has you run a server as long as you have good internet you can easily get more then 100 i know for sure
Yes I have no interest in a peer-to-peer design but a true authorative server-client setup
You should be good. If it lags im pretty sure there is ways to reduce it by the way you load levels or smth. but you dont have to worry about 64
Well, I am looking for potentially 800-1000ccu
anyone here use mirror?
@inland fog nothing that exists out of the box for unity does 1000 CCU on a single unity world/instance/etc.
@graceful zephyr Thank you for confirming this.
If you put server outside of unity you can get to that
But inside unity? espc. classic-gameobject-workflow, not happening
whats a good fps tutorial for photon bolt?
Honestly, you should just line up for fusion
Quick video on fusion’s client side prediction, server reconciliation, lag compensation. All with full server authority: https://www.youtube.com/watch?v=MfEbjFH3Zwo&ab_channel=ErickPassos
Core principles to follow when developing a competitive FPS using Photon Fusion. This is the companion video for the "Hello Fusion FPS" sample.
Features demonstrated in this video (all server authoritative):
- Character controller movement with client side prediction and seamless reconciliation.
- FPS Camera setup for lag-free controls at rend...
Part 2 will show tick-accurate animation syncing with playables and using that to get each body part injected accurately into the lag compensation system
Expected for early next week