#archived-networking

1 messages Β· Page 63 of 1

jade wharf
#

I thought it was my own code

#

So i spent nearly a whole week just trying to analyze the problem

jade glacier
#

once you reduce your entire system to a near deterministic simulation of Inputs + State[x] = state[x+1] then you are ready to network

#

yeah, its hell

jade wharf
#

Heres a challenge for ya

#

Compute a delta state

#

And combine them at runtime

jade glacier
#

Its problematic because RPCs and Syncvars give you a real sense of fast progress. You have have two players moving around in like 30 minutes... so you are like "fuck, that was easy.... this is going to be a breeze"

echo spire
#

What's your all's thoughts on the new netcode? I've been looking into different solutions for deterministic/lockstep. Thought about photon quantum but thats really expensive for a non-established project

jade glacier
#

Then 4 months later you are still trying to unbork your "who shot who first" garbage

#

ECS can lick me balls πŸ™‚

echo spire
#

lol

jade glacier
#

Not touching it

jade wharf
#

Partial states that are commutative

#

Oh yea you made your own ecs

jade glacier
#

Nope, just won't touch it in general

jade wharf
#

Am i thinking of wrong person?

jade glacier
#

I don't build for games that needs 10000 entities swarming

jade wharf
#

Ou..

jade glacier
#

fholm has his own experiements

jade wharf
#

I am

#

@jade glacier heres something that will even utilize the newest threadripper to its fullest

jade glacier
#

but with Unity ECS he has tried a few times and thrown in the towel every time. Its just too much work to get basic stuff happening.. and you run into "Not implemented yet" every step of the way

jade wharf
#

User space threads

#

128 worker threads

jade glacier
#

That is another thing... big networked games do not want you threading stuff

jade wharf
#

Unless you can achieve partial states that are commutative :)))))

jade glacier
#

threaded server = cost. If you chew up 4 cores to run your net game - that is bad.

jade wharf
#

Then it doesnt matter what order the states come in the result will synchronize to the same thing

jade glacier
#

In theory yeah

jade wharf
#

Oh for the server part i just let golang handle it

#

With its goroutines and all

jade glacier
#

the networking chans are full of guys trying to bend treading to their will with networking, and the results are mixed.

jade wharf
#

Its touchy

#

And takes a lot to do

#

I had to use assembly to achieve user space threading that is

jade glacier
#

If you are after some insane level of player/entities net objects - and have succeeded with single thread at making a solid engine... for sure why not.

jade wharf
#

Had to look at shit like SysV ABI’s just to see what registers to save

#

Yeerp

#

The only issue with user space threading is that if you want full utilization, EVERYTHING needs to be thread safe

#

Because literally all of it will get turned into jobs

jade glacier
#

My net work comes at it from the opposite angle. I am fully component based and OOP... my goal is to make components that all drag on and play nice together for users. And I worry about scale as a secondary concern.

jade wharf
#

For sure, i mean a vast majority of games only go to a few dozen players

#

You know, in order for the last of us: remastered, to achieve 60fps on their ps3 they had to create user space threads

#

Let me get the article

#

Everything became jobs

#

Networking

#

Graphics

#

Etc

jade glacier
#

It makes sense on the client side to make use of any cores you can make use of

#

But the client side of networking typically isn't going to need that much CPU, not like the server does for huge state transfer systems

jade glacier
#

I can't get my vid capture to not screw up the frames for some reason, but this is the stuff I am making for PUN2. All of this stuff going on with weapons, heath, movement/anim sync are all without any coding. This kind of stuff I could not even think of writing with DOTS in its current state.

#

seems that codec is even worse and isn't recognized by discord

jade wharf
#

and isnt recognized as an mp4 either

jade glacier
#

weird

jade glacier
#

Not sure why capping video is such a problem on this laptop

jade wharf
#

windows or linux

jade glacier
#

windose

jade wharf
#

Win + G might work for you

#

its meant as the game overlay, but it records stuff too if you want

jade glacier
#

I'll play around with that stuff and see if its cap does any better, thanks

gaunt zealot
#

personally I dig shareX

#

takes some config tho

jade wharf
#

be careful when you google it

#

i once accidentally googled Xshare

gaunt zealot
#

lmfao

jade wharf
#

got something WAY different

jade glacier
#

I am using ShareX, but its making videos that encode some messiness on the frame order

#

Or maybe they just play back wanky and they are recorded fine

jade wharf
#

the vp9 codec right now is the best one i think

#

make sure your using that one for encoding

gaunt zealot
#

heres my shit it works great

jade wharf
#

ah its vp8 not vp9

#

my b

jade glacier
#

yeah, only seeing vp8

jade wharf
#

youtube uses vp8 for videos that recieve a lot of traffic

#

so its high quality

gaunt zealot
#

discord seems to like it

jade wharf
#

that video source is GDI though

jade glacier
#

I wonder if maybe because I am dragging to select the cap area I am ending up with a non-8 factorable size

gaunt zealot
#

could be- except I never make sure its the right size

#

maybe I always get lucky πŸ˜›

jade wharf
#

i guess this is why OBS is a thing

#

make capturing easy

gaunt zealot
#

whats wrong with GDI source?

jade wharf
#

from my experience its slower

#

at least for things like CSGO

jade glacier
#

Capture at like 30 or 60fps?

#

When I say 60... it definitely doesn't look like its delivering that

jade wharf
#

30 for reduced size, 60 for smoother picture

gaunt zealot
jade wharf
#

take your pick since its discord

#

so theres size limits

gaunt zealot
#

thats true

#

30fps to squeeeek under that 8mb limit πŸ˜›

jade wharf
#

this server close to level 2 tho

#

which would up it to 50mb

gaunt zealot
#

for non-nitros?

#

thats cool

jade glacier
#

trying the slow post build and seeing what that comes up with

#

if it ever finishes

jade wharf
#

KEKW

#

actually what do you mean by post build

jade glacier
#

record uncompressed

jade wharf
#

oh

paper ivy
jade glacier
jade wharf
#

looks like 30 fps to me

#

thats just what 30 fps looks like

jade glacier
#

was capped at 60

jade wharf
#

oh..

#

then yea thats pretty weird

jade glacier
#

I'll play around the the xbox stuff tomorrow

jade wharf
#

lel

urban jackal
#

can you just make use of vector3int for all of your simulation and never let it go to float? @urban jackal
@jade glacier what? I need highest resolution. Vector3int?

safe crypt
#

Hello all, I wondered if you guys could help me.

I'm working on a survival multiplayer game and I started working on placing items. Then I found a strange bug, when sending the data for a new entity, it only sends the packet once and then never works again. But if I put a Debug.Log in front of it, it suddenly starts working?
(I work with a self coded server btw)

public void SendData(byte[] data)
{
    Debug.Log("test");
    handler._clientsocket.Send(data);
}

I pasted my senddata class in hastebin. The bug is happening at SyncEntity() (at the bottom).
The 'SyncEntity Finished' debug always gets triggered. Even if SendData doens't get called.

https://hatebin.com/veluzbzrbi

jade glacier
#

@urban jackal I didn't look at your code, but you said you are doing compression of your vector2, so is your compression lossy and is that error not expected as a result of that loss? If you hatebin.com your code I can take a peek at your compression.

steady kite
#

hi

#

"The object type 'AudioSource' has been destroyed but you are still trying to access it"

#

The Coroutine still runs after the object was destroyed and gives me 500+ errors..

gaunt zealot
#

stop the coroutine ondestroy

#

save a reference to the coroutine when you start it, ondestroy, stop it

steady kite
#

how do you store a value for a coroutine?

#

or i mean

#

set it

#

nvm i just changed the method πŸ‘

sour chasm
#

Is there a way to add multiple Ioperation handlers of peer in v4 photon server?

marsh marlin
#

I got this issue using networkanimator that doesn't exist for the user's client side. When my character sees another character running (using the network animator) they're facing the direction that they first pressed. So lets say that you pressed W to go forwards, and then started pressing A before letting go of W then it'd still play the animation for W.

jade glacier
#

You are also using a transform sync?

#

And this is owner authority?

#

And unet?

marsh marlin
#

yeah I'm using the transform sync and using the unity multiplayer thing @jade glacier

#

but wdym by owner authority? the player is using local player authority in the networkID component

jade glacier
#

You also are disabling your controllers on all non authority versions?

marsh marlin
#

yes

#

the player has no control over the other character's animations or movements

#

^ is on the player prefab

#

all of those are on the "Player" (root) object in the prefab and the traditional animator is on the "player" object which is the child of "Player"

weak plinth
#

@stiff ridge I made a test project file that still exhibits the problem...i uploaded to google drive: https://drive.google.com/open?id=1EymvpEulTnwHtPMJMFJnVgTNxpxHocS6 I cleared my photon app IDs before compressing. W key to move cube up, S key for down.....key input is only allowed at master client. Make two copies of the directory so you can open up project in 2 unity editors. WHen running, you will notice that the scene object IDs do not match across the 2 clients. USing Unity 2019.3.0f3

jade glacier
#

@marsh marlin you should probably consider moving to Mirror if you are sticking with UNET HLAPI. They can also probably help you figure out where things are going wrong with that.

marsh marlin
#

what's Mirror @jade glacier

jade glacier
#

Group that has an open source lib going that is actively expanding on the hlapi library.

#

Worth looking it up

marsh marlin
#

alright

#

I'll switch and see if the problem persists

marsh marlin
#

alright I changed to mirror

#

uhhh

#

so it's much snappier

#

and I like it since unity isn't screaming all the time

#

but the issue is persisting

#

I'll get a video recording of it

#

I think this has less to do with the actual networking than it has to do with the way I check for up/down/left/right

marsh marlin
#

uhh they came up with that I had to put all the animations on one layer for networkanimator to work

#

and just... if there's any other way then hmu

marsh marlin
#

yeah I'm not doing that

#

if there's any other framework (like photon), or if I can just make my own script etc. hmu cause I'm pretty lost for what to do from here

sturdy mountain
#

@marsh marlin DM me and let me know what you're looking to do.

#

We're the team behind Scene Fusion. We have something that might be able to help.

jade glacier
#

I make an asset store asset that handles animator and transform sync in a much better way, but I don't officially support mirror with it. It does work with Mirror/MLAPI/UNet if you are desperate. @tough siren

jade glacier
#

With HLAPI and Mirror, I believe all NetworkBehaviours have to be on the root, so not sure there is any getting away from that with the built in components. @marsh marlin

weak plinth
#

I'm just getting started, anyone here messing with the new NetCode preview? I cant get this to work https://docs.unity3d.com/Packages/com.unity.netcode@0.0/manual/getting-started.html I found t issues with it and found fixes here https://forum.unity.com/threads/getting-started-with-netcode-error-cs1503.820878/ but no matter what I do I cant get the cube to spawn when I join using playmode tools

jade glacier
#

@weak plinth Not many people in here are playing with netcode for networking, you might want to ask in the DOTS channel as well.

weak plinth
#

thanks, I found the pin with the project code working. I'm now comparing it to what I did to see where I went wrong.

gray pond
#

@marsh marlin Please join Mirror's discord for support. I don't watch this channel much but I'm active over there.

#

Discord link isn't allowed here, but it's in the Asset Store description.

jade glacier
#

If you are using Mirror or even UNet HLAPI the Mirror discord will get you faster responses for sure.

marsh marlin
#

@jade glacier all the network components are on the root, but what I heard in another channel (which is most likely the reason that it's not working is that there are blend trees in the animation, and I can't really afford to put them into individualized blocks)

jade glacier
#

You can try my asset, people have used it with blend trees. You can put in for a refund if it doesn't do the trick. I don't like recommending it for Mirror, but you seem to be running out of viable options.

#

@marsh marlin

marsh marlin
#

alright, I'll keep it in mind

#

and thanks emotitron

jade glacier
#

np

stray scroll
#

@weak plinth did you find the problem?

weak plinth
#

I didn't find what I did wrong but the package from the pin works so I'm just reading all of it

stray scroll
#

If you don't find it you can DM me your project and I can give a quick check

marsh marlin
#

@jade glacier I just got your asset and it works perfectly. All I did was attach it along with the mirror networking objects and there have been no new problems ^^ tysm

jade glacier
#

Glad it worked for you. Let me know if any future Mirror/Unet/MLAPI changes break it. I don't actively monitor their breaking changes (which is why I don't officially support them), but I will make fixes when I can if they do break things. @marsh marlin

marsh marlin
#

alright, will do so

frosty crystal
#

Hello. In photon I have a problem. My player is not colliding with the platform when I build the game. Why? Thanks.

jade glacier
#

PUN2? @frosty crystal

frosty crystal
#

yes

jade glacier
#

would need to know a bit more about what you are doing

#

What does your player object consist of for components and such?

frosty crystal
#

Ill sent photos 1 min.

#

the player has these componentes.

#

rigidbody is not kinematic.

jade glacier
#

non-kinematic is going to ignore colliders

frosty crystal
#

in unity editor works. but in the build one, not colliding

#

sorry. not not kinematic

#

I mean not clicked

jade glacier
#

are you telling your non-owned versions on the network to not apply any of your controller code?

#

Which versions of the player are not correct? The owner is incorrect? Or networked clones of that player?

frosty crystal
#

there is no problem on owner. but remote player is not colliding

#

falling down to endless

jade glacier
#

I would switch to the transformviewclassic, that transform sync is super limited

#

I am working for Exit on a replacement system for all of that you are welcome to try the beta of.

frosty crystal
#

Ill take a look now.

#

Ill prepare a video to clarify for 30 sec.

#

thank you for your help.

frosty crystal
#

thank you so much

#

Ill let you know.

jade glacier
#

The tutorial file needs to be reuploaded though, right now I have some stuff in it that shouldn't be there.

old creek
#

Anybody wants a job ? Rewrite the 3rd person controller into mobile & with TNet sync DM me with your price

steep wolf
#

Which 3rd person controller?

#

@old creek

old creek
#

The standard asset one if possible

steep wolf
#

Right, will you supply the project with it setup or do you expect that being sent to you?

old creek
#

I can send you a character and the things you need. I think it's pretty much drag & drop once it's done, or am I wrong ? If you need the whole project let me know. It's only a login system and then it spawns you, I just need controller/animations form the standard asset to sync, and make it work with mobile, I can purchase a joystick asset if needed

steep wolf
#

Right, which price range are you expecting here?
(Doesn't the standard character come with mobile controls? I know Unity has a joystick package as well)

old creek
#

I don't know how long such a job would take, is it a big job ? I read the script quickly there is a define for mobile input somewhere, I think it semi supports it, don't take my words though.

#

I am not on pc atm. But I can go through it again later

steep wolf
#

Not particularly big, the joysticks isn't a big deal, they supply you with input axis

#

2-5 hours tops, assuming you just want the network position synced, as is

old creek
#

Yes, want it to work with mobile input, and the animations from the 3rd person character, ducking and jumping that is. Adding 2 clickable buttons that toggle ducking and the other jumping.
The networking is TNet.
Tell me a price in private and I will reply

steep wolf
#

You've seen the TNet 3: AutoSync Example In-Depth right?

#

for the transform sync

#

Been a while since I dabbled with TNet, switched to other solutions instead

#

seems familiar enough though.

old creek
#

I have made myself a basic movement controller. Works great and is synced. However the amount of time that it would take to get to where the already made controllers are would be a long time for me. Hence why I am checking if anybody wants to do me a mobile joystick script that uses TNet. I have a hard time understand the third person controller script.

#

It should be yes. There are example scripts I can show you as well, there is a car controller script for example.

cedar marlin
#

hello can someone help me on a small networking issue concerning tcp sockets ? i managed to make my unity send some data no problem. but the reading data is blocking the program and unity.

dawn crater
#

@cedar marlin you are never calling readSocket() but you are calling theReader.ReadLine() which will wait until their is data

#

so it will freeze

ocean slate
#

question, does the HLAPI package support playing with people far distances or just lan/local players?

dawn crater
#

if you have a server @ocean slate you could use wan too i think

elfin jolt
#

Asked on the dots channel, but Has anyone ran into Unable to find internal function Unity.Networking.Transport.NativeBindings::network_sendmsg when building NetCode for iOS?

gleaming prawn
#

It seems the netcode features are not yet supported by iOS il2cpp, which I don't know why does not surprise me.

tough flint
#

Is Zero tier one good software?

#

I've been looking for something to use since evolve died

#

and its ok but i just dont like how its always on and there

#

Does anyone know of any good also slightly more user friendly options?

vital hawk
#

@gleaming prawn are you trying it on 2019.3 or 2020.1?

#

IL2CPP is broken with 2020.1 and entities in general

gleaming prawn
#

I'm not trying... Just an educated guess based on the message

#

And some cases we had when trying to manage threads on iOS (and then we found IL2CPP generated code with this kind of comments: // not implemented yet.

rugged crater
#

Is there an easy way for making a multiplayer game?

spring crane
#

Make sure nicknames aren't identical

rugged crater
#

They're not the same (because I choose them...)

elfin jolt
#

@vital hawk @gleaming prawn I tried it on 2019.3 using entities 0.5.0 and NetCode 0.0.4. Everything seems to run fine in the editor, but as soon as I install it on iOS devices, it dies when trying to send network request. App just crashes. I tried building out a MacOS one and it runs fine. Seems to be iOS specific the errors.

vital hawk
#

have you checked netcode docs if IOS is even supported atm?

strange ravine
#

hi!
I'm currently using a very simple php program to do some multiplayer communication and I've come across a bit of a snag with the webrequest. I'm trying to do a flush() / ob_flush() and get a quicker responsetime. The problem is that I don't receive the data after the flush but only after the whole programm is done. I have not found much when googling this. Anyone know if this is possible?
I'm currently doing a

yield return request.SendWebRequest();

Do I need to check it repeatedly and how do I know if the data I have is complete or not etc... :)

jade glacier
#

@rugged crater I very common oddity with PUN/Photon is the editor tends to find a different region than builds. For development I always enter a fixed region into the PUN settings to avoid that.

rugged crater
#

@jade glacier can you give me An example?

jade glacier
#

Go into PUN settings and set the region to like us, eu or sa

grave ledge
#

What would you guys recommend, outside of using UNet?

#

I'd like to make simple matchmaking, possibly with a master server and possibly some server side code.

#

It's a very small project (or atleast should be) and everything is done except the networking logic, which I don't even know where to start with..

rugged crater
jade glacier
#

yup

rugged crater
#

it worked!! thx

jade glacier
#

np

grave ledge
#

Is there any public matchmaking solution with Forge Networking?

jade glacier
#

Not sure. Best to join their channel for questions about Forge though. Don't find many users in this channel. @grave ledge

grave ledge
#

Yeah I'll ask when I get back, no phone number on my work discord and they are annoying like that πŸ˜›

humble socket
#

Can anyone help me understand how to implement Online Multiplayer (Network Manager) into my game?

quasi tapir
#

Quick question, can I use OnPhotonSerialiseView on a game object in the scene instead of spawning it?

#

If not, is there any way of adding any conditions or something to those OnPhotonSerialiseView?

#

Like I have two variables, I only want to change or write one of the variables if it is the master client and change the other if it is not the master client.

#

I don't have any issues if I spawn it as prefabs, just curious if this is possible without spawning a game object?

#

If it is I could technically avoid spawning prefabs for players and just the two default gameobjects in my scene as player objects as it looks a little bit hassle free

gleaming prawn
#

You could technically use a single serialize view to send complex updates, but why would you? It's a super complicated design trying to do something that would be much better done if you don't use pun

#

I mean, if you want to do custom state transfer, you better start from photon realtime (flexible transport layer with reliability options)

#

Or just use photon bolt (which does all that automatically in a well designed approach)

#

Pun is great as it is because it lets you finish a game with very little effort

#

If you are trying to design around it, chances are you would be better using something else entirely

quasi tapir
#

It is super complicated like you said and I'm not going to use it, I was just curious it an approach like that is possible.

#

The game I'm working on is pretty simple, all I have are two players who don't move or do anything. They are empty game objects where the only thing I have to keep track of is their health. There is no shooting or anything as well since this is a 2D game, all I have to do is press an UI button on player 1 and that automatically reduces player 2's health, and the button on player 2's instance reduces player 1's health.

#

When I spawn them as prefabs, this works, I have no issues at all. Just the idea of having them in an empty gameobject in the screen where I could change their variables seemed a wee bit easier instead of spawning prefabs and referencing them.

gleaming prawn
#

ok, so in that case it makes sense, you can do either OnSerializeView of each one, or use a single "manager" game object per client to do it separately from the objects you want to control.

quasi tapir
#

Thanks, this is exactly what I was looking for. Will let you know if it works out πŸ˜„

jade glacier
#

You don't actually need any gameobjects at all if you are controlling the entire system. You just raise events, which just lets you send byte[]s between connections. @quasi tapir

#

PhotonNetwork.NetworkingClient.OpRaiseEvent() might be worth looking into

#

Though at that point you aren't really using PUN, you are just using the Exit relay servers. Not that it matters much.

weak plinth
#

I'm using Photon Network and I'm getting a bug when the third client joins.

On the third client, players are seen flying. However on the first and second client it's normal.

quasi tapir
#

@jade glacier The method @gleaming prawn suggested works, will check this method as well, thanks mate

jade glacier
#

Mine is the same, its just skipping the creation of net objects to serialize through, so its a little less traffic and skips the middle man of running it all through that component.

stray scroll
#

(using NetCodE) I have these empty "build spots" in my game, the player can go close to it and a world gui pops up where she can select what she wants to build. Apart from changing net engine, what would be the best way to solve this x) req; within vicinity of build spot, multiple players can choose build on spot (first one will be approved).

#

I was thinking either checking input on server, but that would require me to resim the world gui sort of. Other way I thought of was to basically send a state with my input to server which is basically tickOBuildRequest + buildSpotID, where if the server notice a change of requestTick, it has to make the distance check for the player and approve or not.

graceful zephyr
#

@stray scroll client side prediction should be able to handle this

stray scroll
#

@graceful zephyr So having the world GUI part of the server simulation? Just thinking if there would be some hickup by packet loss or something and the server instead notices the player "clicks" on a adjacent button instead, that would be sad.

graceful zephyr
#

@stray scroll Store the state of the GUI in the simulation

jade glacier
#

That is pretty much always the answer, even for not networking yeah

jade glacier
#

Sim should produce callbacks on changes, GUI code should subscribe to those and defer them and whatever accordingly.

jade glacier
#

There is no server code, since it's a relay. You would need to look into server plugins for photon server

#

@weak plinth

past wren
#

Anyone here got experience with Photon Pun? Trying to setup OnPhotonSerializeView to stop the syncing being all 'glittchy' but its giving me a cast error butit looks fine to me

#

im pulling my hair out

#
    {
        if (stream.isWriting) //iam the owner
        {
            stream.SendNext(transform.position);
        }
        else if (stream.IsReading) //im a client 
        {
            transform.position = (Vector3)stream.ReceiveNext(); //InvalidCastException: Specified cast is not 
        }
    }```
jade glacier
#

I never make use of that since its kind a recipe for garbage (what you are doing I believe is going to produce a fountain of garbage collection), but at a glance it seems right.

#

@past wren

#

That i how the built in synctransformview does it. does the second test need to be else if (stream.IsReading) rather than just else?

past wren
#

i dunno if i change the else if to just else i get a nullreferenceexception

#

im about to give up with photon tbh

#

it either doesnt work or if it does its just glitchy

jade glacier
#

The components that are in the vanilla are largely placeholders and demo code. You can give the beta of the SNS stuff we are making for it a shot, it automates all of this stuff.

#

what are you getting a nullref on with out that else if ?

#

Because that seems a bit odd.

#

stream.isWriting that is being lower case is suspect

#

Are you using PUN or PUN2 ?

#

@past wren

past wren
#

i'm using PUN2, tho i did notice 1 issue im just checking now. It should be 'IsWriting' not 'isWriting', somehow i hda created a local bool and so it wasn't actually using the photons stream.IsWriting

jade glacier
#

That would definitely break things

past wren
#

ok cool that works, it will sync over network now. Shame its still jittery asf

#

but at least that explains that ><

jade glacier
#

all the libraries that are not full stack will be jittery

#

Bolt, Quantum and the SNS stuff in beta are really the only libs that are going to be able to be smooth, because they are the only ones that work on proper tick based systems

past wren
#

ah isee, i had looked into bolt briefly what solution would you say is the best?

jade glacier
#

I really recommend giving the SNS lib and tutorial above a try. Its going to become part of the PUN2 library eventually and it handles a lot of the stuff people get bogged down in with PUN

#

There is no best, they are all very different

#

and have very different use cases

past wren
#

fair enough, i'll give the SNS lib and tut above a go see how that pans out

jade glacier
#

You can also use messaging/transport libs like Mirror/MLAPI/Forge

#

But you will run into the same issues of things not just being "smooth", because they are messaging layers and not simulation management layers

past wren
#

ah yeah i dnt want that my goal here is really just to making something that syncs up smoothly

jade glacier
#

ping me if there are any faults in the tutorial. We haven't had many test it outside of the PUN2 dev circle so its still early

past wren
#

to make sandbox games for me and my daughter to play on

#

will do, ty

jade glacier
#

For casual coop stuff PUN2 is likely going to be the preferred option.

jade glacier
#

I'm heading out, so you are on your own with the tutorial for a while. GL. πŸ™‚

stray scroll
#

@graceful zephyr I still didn't get how to deal with packet loss that would change where the player is looking in turn marking wrong GUI? Or just ignore such slim cases?

jade glacier
#

It is possible to send your intended target along with the tick

#

you can then use that when the server applies your "use" or whatever. You just turn that from being a state to being an input

#

Its just an input that the server has to verify, with a distance check or whatever you deem essential

weak plinth
#

Why are ports for TCP: 4530, 4531, 4520 working but not the UDP ports? I'm using Photon Server.

stray scroll
#

@jade glacier Ok, so both of my options I presented are valid x)

stiff ridge
#

@weak plinth: This is related to your local setup. By default, the server listens to UDP and TCP ports. Check firewalls.

weak plinth
#

@stiff ridge My firewall allows TCP and UDP for Photon. I also have TCP and UDP port forwarded. TCP only works but not UDP.

#

After checking that the UDP ports didn't work I tried the TCP and it works for some reason.

stiff ridge
#

The upper screenshot shows a lot of settings. Some of which are for a specific path, some are generic. Hard to say if that's correct.
The lower shot is .. what?

#

I am not an expert in setting these things up. Head over to our forum and I'll ping my colleagues to have a look.

weak plinth
#

The lower shot is the port forwarding.
The upper shot is the firewall. It shows different paths because I have 2 Photon Servers that I tried testing but it didn't work.

#

I think this image will be better:

stiff ridge
#

Two Photon Servers won't work at all, because they can't both listen to the same ports.
I can't really help with the port forwarding aside from high-level knowledge. Get it going with the client on the same machine, then change the Game Server "public IP" in the config and try from the outside.
Use Wireshark to see if network traffic arrives from the outside.

weak plinth
#

I can connect to the server, it's just the the UDP isn't working.

#

The TCP ports 4520, 4531, 4530 work but the UDP don't work for some reason.

#

I can connect to the servers fine even without the ports, it's just the UDP won't work, but TCP does.

#

I even tried changing the UDP ports to 20000, that didn't work either.

#

@stiff ridge I posted on the forums, but haven't got any replies yet.

#

This is my PhotonServer.config, it's default.

stiff ridge
#

Yes, the forum can be slow. We are always busy. I will ping the server guys.
Keep in mind that we try to give free support. It has to be done on the side.

#

I use canyouseeme.org to check if the ports work.
I don't know them and can't say anything about it. Maybe Photon won't reply to them via UDP.

weak plinth
#

@stiff ridge So you don't exactly know what's the problem? It can't be a port forwarding issue because TCP ports work fine.

stiff ridge
#

No, I don't know exactly what the problem is. It has to do with your setup and .. I only know the few things about it that you posted.

weak plinth
#

I also tried different port checking site besides canyouseeme.org, it still says UDP ports are closed.

stiff ridge
#

Most likely they don't get any reply. Which is fine, as Photon won't just reply to any random message.

#

I'd say forget about that and use a photon client instead. You can use TCP in the client for the time being.

weak plinth
#

@stiff ridge I didn't change any setup too, I downloaded the Photon Server SDK straight from the Photon Engine website then port forwarded the UDP ports and TCP ports.

#

TCP works, UDP doesn't work.

stiff ridge
#

You are skipping a few things...

#

Try to get TCP working. For the time being, forget about UDP.

weak plinth
#

TCP works perfectly. It's just that UDP doesn't work.

stiff ridge
#

Follow the guide I already gave you and make sure TCP works with Photon from external.

#

Did a client connect via TCP from the outside?

#

A Photon client?

weak plinth
#

Outside my network?

stiff ridge
#

Why do you setup port forwarding?

weak plinth
#

So players can connect outside my network.

stiff ridge
#

πŸ™‚

weak plinth
#

I can connect perfectly with TCP but UDP doesn't work for some reason.

#

What could be wrong with UDP @stiff ridge ?

#

Just tested that TCP works fine, UDP still doesn't work however.

#

My firewall allows TCP and UDP to go through too.

#

@stiff ridge I sent Photon Engine a mail, maybe it's a bug in the latest Photon Server SDK?

#

Is there a possibility that TCP is running instead of UDP in Photon Control?

gleaming prawn
#

The server runs both

#

It's an issue with the port forward + the server IP setup....

#

Your email will be taken care of

#

Here we normally answer quick inquiries about the APIs, etc

weak plinth
#

Is it possible it's a bug? Both TCP and UDP ports are port forwarded. TCP ports are working but UDP ports are closed.

gleaming prawn
#

It's not a bug

weak plinth
#

My firewall is off as well.

gleaming prawn
#

Do you connect fine locally to UDP?

#

If yes, server is running normally

weak plinth
#

UDP and TCP work fine locally.

gleaming prawn
#

Udp port forwarding is tricky

#

If the router is acting on behalf of the external client correctly, for the photon server it should look like it is a local client

weak plinth
#

I also tried changing the UDP ports to 20000 and 200001 to see if any ports were interrupting it but that didn't work.

gleaming prawn
#

I think I know what it could be

#

The first connection is with the master server role, then the master sends out to the client the IP of the game server

#

If that is not configured correctly for port forwarding in the server config, clients will receive a local, in accessible IP

#

Wait for the email

#

This has been done several times, there's not a bug, it's just tricky to do

#

I got this issue when running from inside a VM (in that case it was easy to fix)

weak plinth
#

This is my server config.

gleaming prawn
#

I'm just telling you what it might be. I'm not from the server team

#

Wait for your email answer

#

I'm from the photon quantum team (I cannot directly handle server support, sorry)

#

I might bljust help with a few guidelinws

weak plinth
#

I port forwarded TCP the same as UDP, it's just the TCP works and UDP doesn't work.

gleaming prawn
#

(typing from phone, btw)

weak plinth
#

It says it successfully registers the game with the UDP and TCP too. No errors.

stiff ridge
#

That log shows that the Master knows the Game Server. This is not related to connections from the outside.

#

As Eric said: When you setup the port forwarding correctly, the connections from the internet will look like local clients. The router will translate the connections accordingly.

#

I would run wireshark once to confirm that external clients can send UDP data to the local client (via port forwarding).
Maybe the server's responses (also Datagrams) are not forwarded correctly and never reach the client.

#

There is one thing you have to config manually for the external users:
Photon-OnPremise-Server-SDK_v4-0-29-11263\deploy\Loadbalancing\GameServer\bin\Photon.LoadBalancing.dll.config
Has a node "PublicIPAddress". Set this to your public IP. Else, clients will only be able to talk to your Master Server and not reach the Game Server.

#

(So you could not join a game from outside.)

gleaming prawn
#

That is the one... The public IP in the config must be set to the router external IP

weak plinth
#

For some reason it's automatically set to the public IP already.

#

@stiff ridge I'm not sure how to use Wireshark with the Photon Server.

stiff ridge
weak plinth
#

@stiff ridge Looks like I'm getting TCP and UDP networks connecting.

#

I checked by connecting through TCP and UDP clients.

#

However the UDP ports seem closed.

weak plinth
#

This is the result I get when I check if TCP or UDP are working.

#

The top is TCP and the bottom is UDP.

stiff ridge
#

Again: Photon will not reply to some service. It may be able to detect that a TCP connection is possible, yes, but UDP does not have connections.

#

So if Photon itself does not reply to random UDP datagrams, then this test is not telling you much.

#

Use a client.

weak plinth
#

Thanks @stiff ridge it appears that after checking with a UDP port checker it seems to be opened.

#

I never knew that UDP had no connections.

#

But it appears that UDP is open.

stiff ridge
#

UDP is a so called connectionless protocol.

#

So it's not as easy to check IMO.

left cobalt
#

Hey i'm working on mobile game similar to worms this is my first contact with multiplayer games so i decide to use networking engine like photon instead of code it by myself, i thought about photon or unity multiplayer services but im not sure wll photon be enough for game with 250-500k estimated users

gleaming prawn
#

We have games with 100M

#

or more

#

500k users will give you around 1k CCU only...

left cobalt
#

so i have to choose something else than photon bcs photon pro has only 100ccu, thx for help πŸ™‚

gleaming prawn
#

?

#

You mean because you want something free for 500k users?

left cobalt
#

no

gleaming prawn
#

we have plans for any number of CCUs

#

we have games with 100 million users...

#

500k is a small game.

#

this is my first contact with multiplayer games
I suggest you first try to make the game...

#

If your game is successful, than you'll a "good" problem to tackle.

#

Here we normally discuss more the technical aspects of online multiplayer (which approach or SDK to use, based on your game itself).

#

@left cobalt I think you got confused by the link on the Unity Asset store (selling from there you can get the 100 ccu plan for 5 years). Check our website for all plans.

fair cosmos
#

@left cobalt u can choose mirror networking same as unet but have some little changes

jade glacier
#

If you are using deprecated Unet, moving to a Mirror/MLAPI might not be a bad idea. Just be aware that both are regularly making breaking changes since they are being actively developed.

urban jackal
#

Hi guys how can i implement TCP at transport package?

#

I read pipeline but its implement a pipeline with an structure, where is behavior?

twilit lion
#

Hey guys trying to use photon, whats the easiest way to just connect the user to the server. its not for a game just a demo

jade glacier
#

There are two built on components

#

In the prototyping folder

#

ConnectAndJojnRandom our something like that, and OnJoinInstantiate

#

@twilit lion

weak plinth
#

When does the new unity networking thing come out?

vital hawk
#

it's in early preview now

#

but who knows when it's actually going to be production ready

weak plinth
#

That's what I was wondering... Thanks for the link though, I will take a look at it when I have time

weak plinth
#

Also, does the photon networking use unitys current deprecated net code or is it something else entirely

graceful zephyr
#

@weak plinth Photon has it's own netcode, doesn't rely on anything from unity when it comes to socket/transfering of data/etc. it's all bespoke

urban jackal
#

@jade glacier do you know how can i implement tcp at transport?

jade glacier
#

Just use a tcp transport

weak plinth
#

Can I use Photon Chat for Photon Server?

urban jackal
#

Just use a tcp transport
@jade glacier
? How? Its not contain tcp.

jade glacier
#

Use mirror our MLAPI or some library that is tcp

#

What lib are you using now? @urban jackal

urban jackal
#

Unity multiplayer transport package. @jade glacier

jade glacier
#

You mean netcode?

urban jackal
#

Yes but without netcode

jade glacier
#

Not familiar with unity has going atm. But pretty sure it's all just rudp

timber mauve
#

hey, can any one give me a easy tutorial lik /how to setup my first little unity server?/ wood be very nice

remote sail
#

Pliex, keep in mind that networking is HARD, and it's going to take a lot of time to learn. There is nothing "easy"

timber mauve
#

@remote sail hmm. the problem is that I can play my simple game with my friends

#

@remote sail do u have an Idea what i shoud do?

gleaming prawn
#

do you already have a multiplayer game?

#

running with server + clients in a LAN?

timber mauve
#

@gleaming prawn no only like a little shooter

gleaming prawn
#

not multiplayer? ok...

#

So...

timber mauve
#

yea

gleaming prawn
#

Sorry, suggestion is first study a lot about how to make a game multiplayer

#

Setting up a server is the LAST thing you'll do (if you'll need at all)

#

Check the tutorials on how to use Mirror or Photon Bolt (these are the most convenient ones for a shooter).

#

But as said... this is HARD

#

Making games is hard... Making network games is 100x HARDER.

timber mauve
#

hmmm

remote sail
#

don't be discouraged, just recognize the effort and patience required with networkign

gleaming prawn
#

Many of us here have 10+ years experience with game development (a lot with netcode development), and even for us it is never trivial

timber mauve
#

ok so I shood make my game like on local host and practise more

gleaming prawn
#

so don't give up fast...

#

yes

#

make it work multiplayer with super super basic things

#

Check Mirror, PUN, Photon Bolt, etc

#

These are easy to use APIs for multiplayer. Mirror is open source, photon has free plans for small games

timber mauve
#

ok thant you. I do programmiring like 3 months 🀣

gleaming prawn
#

one has to start somehwere, right?

#

Hope you're having fun

#

Programming = super powers

timber mauve
#

@gleaming prawn i done check mirror, but can I play it like with my friend with (hamachi)

#

@gleaming prawn yea u are right

gleaming prawn
#

Didn't understand the question

#

If you can play online from different locations?

#

In that case mirror is a bit more challenging because you'd need to host a server...

remote sail
#

hamachi is a LAN emulator. makes your PCs think they're on the same LAN

gleaming prawn
#

Try PUN or Photon Bolt

#

ohh

#

should work

#

Should work over VPNs

#

as long as you can bind the server to an IP that is in the VPN range

#

Just don't know if out of the box, or with some setting up... Mirror has a discord and people are normally nice there

#

Photon Bolt runs without Hamachy (it has builtin pucnh through)

timber mauve
#

ahh. ok I will try both

gleaming prawn
#

so you can run the server on your PC, and your friend connects no problem (falls back to relays in case punch doesn't get it, etc... always works)

timber mauve
#

thank you for you help πŸ˜„

gleaming prawn
#

Disclaimer: I work for photon (but on the Quantum team). Mirror is an open source SDK (based on the deprecated UNet). I'm not involved with it.

timber mauve
#

oh ok (;#

gleaming prawn
#

there are guys here from the Mirror team, but they also have their own discord

#

Same for Bolt. Ramon Melo (lead dev) + Stanchion

#

bolt originally developed by fholm (now lead dev of quantum).

timber mauve
#

ahhh

solid crow
#

Hi folks, I'm currently a complete beginner to using Photon PUN and I'm having a pretty bad bug in both of my projects using it that I'm unsure how to fix:

My current setup has me on a second monitor actually building the game with the launcher, and then also playing through the Unity editor so that I can have both clients at once. The trouble is, JoinRandomRoom() fails on the second one despite maxPlayersPerRoom being 2 and the first client already creating an empty room. Instead my second client creates a new room that works just fine, it's just that my two clients aren't in the same room anymore. I tried using a Debug statement that called PhotonNetwork.CountOfRooms and displayed it to console but that turned up 0 for the second client as well, even after the first room was created
As far as I'm aware, I didn't touch anything in my launcher script or in the PhotonNetwork scripts (save to make that debug statement i mentioned a second ago) and I'm really confused on what the problem is

jade glacier
#

Be sure to set the fixed region in pun settings to something.

#

The editor often can get a different best server region choice @solid crow

solid crow
#

may be a silly question but how exactly do i do that

#

it gives me a whitelist but im not sure what im supposed to be typing or looking for

weak plinth
#

Open Window > Photon Unity Networking > Highlight Server Settings

solid crow
#

okay yeah i put only usw in and it worked, wasn't expecting that to be that easy, thank you guys so much!

jade glacier
#

Np

burnt axle
#

Is there any statistics on how many active users there are of Play Games Services? Im thinking about which authentication method i should implement

weak plinth
#

is it easy to make a online game in unity? o.o its 2020 now

hallow zinc
#

what this error means? im trying to sync player positions

jade glacier
#

Probably should mention what library you are using

stable epoch
#

Whats the Update() equivalent in Photon for a "Bolt.GlobalEventListener"

jade glacier
#

Not sure what that does in Bolt, but I assume its registering a handler for a certain message id? @stable epoch

timber mauve
#

hello, I have a problem with mirror. If i try to conect to my server, but than the spawn prefeb is spawning but nothing is happening on my client

jade glacier
#

you'll probably want to hit the Mirror discord channel for that

#

@timber mauve

timber mauve
#

yea, i did it and somebody helped me

#

its working now. πŸ˜„

hallow fractal
#

Hello there, can i get some little gelp

#

Help

#

I is there any script that instantiate a object, soo every player that joins can see it

#

I have a object that moves, soo every player eho joins sees it

#

I have a script, but that script instantiate for each player joining another object

#

So i want just one object for all players

jade glacier
#

You should first say which net library you are using. Then show the code you are using to try and do it. @hallow fractal

#

And one object for all players is not a thing. That involves changing authority dynamically and is one of the more complex tasks in networking.

hallow fractal
#

@jade glacier im using pun 2

#

I just want to instantiate one object, and all player who join behind me can also see it

jade glacier
#

That should happen naturally if you are using PhotonNetwork.Instantiate

#

How are you instantiating now?

hallow fractal
#

how can i send the code here

#

how can i quote it?

#

or just write it down here??

jade glacier
#

or if its small paste it here inside of
```cs
// your code
```

hallow fractal
#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Photon.Pun;
using UnityStandardAssets.CrossPlatformInput;
using UnityStandardAssets.Characters.ThirdPerson;

public class MobileFPSGameManager : MonoBehaviourPunCallbacks
{
    [SerializeField]
    GameObject playerPrefab;


    // Start is called before the first frame update
    void Start()
    {

        if (PhotonNetwork.IsConnectedAndReady)
        {
            if (playerPrefab!=null)
            {
                int randomPoing = Random.Range(5, 15);
                PhotonNetwork.Instantiate(playerPrefab.name, new Vector3(randomPoing, 0f, randomPoing), Quaternion.identity);
            }
            else
            {
                Debug.Log("Place playerPrefab!");
            }




        }


    }

    // Update is called once per frame
    void Update()
    {
        
    }
}




#

thats what i use for the players

jade glacier
#

Start is a bit of a risky place to call your instantiates, you generally want to keep those in a callback like OnJoinedRoom or something

hallow fractal
#

hmm

jade glacier
#

Use the built in prototyping classes for starters to get it working before trying to guess the correct code

#

OnJoinedInstantiate

hallow fractal
#

i actually got this from a video

jade glacier
#

Videos mostly suck - I can't speak to what you have going there

#

If you followed the video and it doesnt work, either the video was wrong, or you made a mistake copying it

hallow fractal
#

it woks, for the playrs

jade glacier
#

Not sure what that means

#

it works for the local player you mean?

hallow fractal
#

but i want to instantiate a moving platform

jade glacier
#

Then just put that in the scene with a PV on it

#

and it will become the property of the MasterClient

hallow fractal
#

does the moving got translatet to all?

jade glacier
#

if you put on a transform sync

#

nothing happens automatically in networking

hallow fractal
#

wait, i try

jade glacier
#

you have to be very explicit

hallow fractal
#

hmm, well it works, im wondering, i thought i have tried it before

#

but theres a issue that im noticing

#

the player that im playing from my scene looks good and moves along with the moving platform good, but the player from the build i made dosent move smooth, its like teleporting

#

@jade glacier you know the reason maeby?

jade glacier
#

You mean the owned version is smooth, and the networked clone is not smooth?

#

The built in transform syncs are notoriously not good, they are just for prototyping, so you may just be dealing with that.

#

There are also two transform syncs, try the classic version as well.

hallow fractal
#

@jade glacier hmm should i add only the classing or both

#

now i have both addet to photon view

#

but it looks weird

jade glacier
#

One or the other

hallow fractal
#

theres a issue when i put only the classic version, the players dont syx anymore

#

even i didnt touch them

#

can i show you the error it show me?

jade glacier
#

Can post it in the channel sure. Someone might have an idea.

#

I don't use any of those components. I work for Exit/Photon making a replacement for most of that stuff, so I don't actually know it limits.

hallow fractal
#

this happens only when i put the classic tranform to the moving object

#

and this is how its set up to the object

jade glacier
#

Those are a bit more of basic how to use C# and Unity questions with the unassigned reference issue there. I guess first question is if you have made a single player game with Unity before?

#

You cut off the error message so I can't see where outside of of PUN in your code the error originated

hallow fractal
#

No, i made some projects in single player

#

But not an actual full game

jade glacier
#

Line 369 in PhotonView for me is a comment, so we are on different versions.

hallow fractal
#

Where did i cut the error message?

jade glacier
#

Are you using PUN or PUN2 there?

#

I may just be out of sync since I am working on other stuff with the lib, and may have modified my code

hallow fractal
#

Pun 2

jade glacier
#

It was just clipping your component ss in my windows, was fine once I opened the source - so ignore the thing about not having the full error.

#

It might be because of the second empty slot in your PV, but I doubt that. No idea why you are getting a script error there.

#

Either of those transform syncs are pretty rough regardless, they are just there as a reference and for prototyping. People typically make their own or buy 3rd party assets like mine.

hallow fractal
#

Soo you might think of the empty slot? Might try it

#

I never got the error before

#

Its werid

jade glacier
#

No idea, seems like a problem with the classic component. Which again I never use so I can't speak to. But I am not aware of any such bug in it.

#

Which var is not being set? What is the error pointing at?

hallow fractal
#

Its pointing to that PhotonMono under the dontdestroyonload

#

Thers the screenshot

#

Need ti try it till it works

jade glacier
#

Not sure I understand, how is that the undefined field?

#

it saying that a field that is being used has never been set... which field is it referring to.

#

I can't debug this stuff for you, I only see what you have pasted so you have to dig a bit yourself.

#

Or just don't use Classic, if its being busted.

hallow fractal
#

Hmm sure i will see what i can do, maeby the empty field is the issue, if i fix it i will tell you

#

Thank you alot for the help πŸ˜„

#

@jade glacier thanks

jade glacier
#

I would start with a working tutorial before trying to figure anything out

hallow fractal
#

How to give thanks point or so ahaha

jade glacier
#

Or deconstruct one of the built in sample scenes

hallow fractal
#

@jade glacier soo i fixed the issue, and it comes out that i dont need the classic one, but the problem was solved when i put the photonview in child gameobject, because the object i was talking about was made by mother and 2 childs, the mother was the rotating

#

before it the mother had the photonview script that was just an empty gameobject with the moving script on it

jade glacier
#

ah, yup

shrewd jolt
#

hello guys..

i'm trying to upload an image to the server using unity webrequest...however when i do so i got an error code return with

"Curl error 7: Failed to connect to (website url) port 80: Timed out"

I research a bit and i heard something about firewall blocking..but when i check my firewall it is allowed for unity...anyone got any idea for this error?

shrewd jolt
#

this error would only happen sometimes...and if it happen, it will keep happening for a few minutes...

native anchor
#

hi does anyone here still use unet?

high night
#

@native anchor you know about mirror?

native anchor
#

mirror

#

@high night whats mirror?

high night
#

it's the community replacement for unet

#

api is same i think

native anchor
#

where can I learn about that?

#

are there tutorials on it?

high night
#

i guess you can look up unet tutorials since api is almost same

#

there should be some mirror tutorials as well

native anchor
#

can I use that with the current versions of unity?

high night
#

yes

native anchor
#

im using unet right now and im having trouble synchronizing animations

#

im just trying to make a pretty basic local multiplayer mobile game

high night
#

@native anchor maybe if you syncronize the inputs, animations should syncronize pretty well

#

if you are also run the inputs of other clients

gleaming prawn
#

@native anchor search for Mirror's Discord. Guys can help you out better in there. It's in active development, so you can expect some nice support from community + updates.

native anchor
#

@gleaming prawn thanks I'll give that a try

maiden sundial
#

With the release of unity 2019.3 is it possible to make multiplayer games using DOTS? tried searching for it but got vague answers. Any answer is appreciated!

gleaming prawn
#

[Almost] everything DOTS seems to still be in an Alpha state (buggy, not complete, etc)

#

So ok for learning/experimenting

#

Not-ok for developing a game for real... Specially the networking part.

plucky bramble
#

Hey, so I would like to do a Multiplayer game with a dedicated Server, as this is used for the learning effect, not for publishing, I will try to go for a relatively low level networking library (Lidgren).

Now I stand in front of my last setup decision, should I go for a plain C# project as server (maybe possible to import the unity dll and use physics functions for serverside calculations?), a detached unity project to run headless on a server or an integrated project that switches between server / client based on a configuration.

Again as this is for learning effect I'd like to write much of it myself, but I am scared that without unity functions this is to much of a task and even stop me from learning by just being to much of a workload. Anyone to talk to about this or who could give me his opinion about this?
General networking already works in a test build, I am familiar with the basics.

#

Also I'd appreciate a ping if you answer to this πŸ˜€

gleaming prawn
#

What are you trying to learn? Because your post goes "all over the place"

#

I mean, are you trying to learn how to implement netcode strategies like state transfer, scheduling, compression, etc?

#

Or more like how to code the gameplay parts for a networked game?

#

Or are you trying to learn scalability of server components.

#

Also important to understand what kind of GAME you are aiming at, as the gameplay dictates a lot about the strategies you'll have to use.

#

Assuming you want to learn how to create a state-transfer-style netcode library from scratch, I'd start reading resources like the Tribes Networking model... And would go for Unity headless instances as server (no need to re-write physics etc). Importing Unity libs on a server is ilegal unless you acquire proper licenses for that with them (not even sure if they let you do it)

#

And last, if you are trying to create a GAME (even for learning), don't write a library...

plucky bramble
#

The game I am orienting at is dead by daylight

What i want to learn is calculating physics/movement serverside with interpolation, client side predictions and other lag and cheat prevention techniques, basically I know how net code works (dont get me wrong here, I know the bare basics) and I am able to sync a game object to one on another client without a problem but I want to learn further than just the basic yeah he moves and thats it

#

For your question, learning to program the gameplay parts would be the fitting answer yes

#

Also I'm not about to write a library, I'm implementing the Lidgren library

gleaming prawn
#

Lidgren is just a transport layer, isn'Γ„t?

#

so in that case you ARE implementing the netcode library

plucky bramble
#

Ok then I understood you wrong, but yeah then that is part of what I want to do, that has been the best way to learn for me, just doing it. All of that has no time limit so if it takes long that's the way it is

#

But my question for now is rather "Should I use UnityEngine to implement the server, or use a bare C# project"
I removed the dll option as you said it's not in scope with their ToS

gleaming prawn
#

For learning purposes, yes

#

otherwise you'd have to write your own engine (physics, navigation, etc)

#

If you were going for predict/rollback determinism (which is what I work with), then you'd have to write your own stuff... But not the direction you are choosing.

plucky bramble
#

Ok thanks for the answer, any patterns I should have a look at / consider before starting when looking at dead by daylight as a base?

gleaming prawn
#

read the tribes networking model paper

#

and other references

plucky bramble
#

Ah yeah you mentioned that one above, I'll take a look at it, thanks

gleaming prawn
#

check out the features in Photon Bolt (for reference), the Unity netcode, and the old UNet (and Mirror, its FOS version)

#

IMHO the state of the art Unity lib for most of these features is still Bolt... So look at how you'd implement stuff like scoping, scheduling, lag compensated raycasts, etc

#

for these, of course... There's a lot more to netcode than state transfer...:)

plucky bramble
#

Bolt offers self hosting right? Might even switch over to that at first

gleaming prawn
#

yes

#

If you want to finish a game, Bolt is a good choice

jade glacier
#

Yeah, for server auth with a Unity build as the server - Bolt is pretty much you only option on the full stack side of things. You can go with a transport or messaging library like Mirror, but you will have to learn and apply the concepts of how to transfer states and make your simulation net friendly on your own that route - which may or may not be your goal. @plucky bramble

lofty ferry
#

since UNET has been deprecated. what can i use instead? i really dont want to use photon tho

spring crane
#

Mirror has very similar API to UNet. Strong community support.
MLAPI seems to have more powerful API. Don't know anyone who uses it.
Forge Networking used to have a lot of problems, still might have, but it used to, too. They went open source at some point, so maybe it has gotten better.
Photon provides some great out of the box solutions, so don't ignore the whole shop for no reason.

timber mauve
#

hello, I need help with photon. I want that other players can see my particals and dont no why it is not working. And I want that I can demage one, but it dont work too here is my code: https://hastebin.com/ekevevecid.cs

nimble eagle
#

@lofty ferry Photon PUN is well worth it, it's a very reasonable price and works really well; They have some nice tutorials online too, I'd definitely recommend it as a UNET replacement!

#

(Plus you get 20 CCU for free!)

lofty ferry
#

@nimble eagle thanks and it dose seem like pun is the best bet since unity is always changing their system

prisma girder
#

Anyone have any practical experience with SpatialOS? Seems like a really solid ECS-oriented system for medium to large game worlds

nimble eagle
#

@lofty ferry Yeah! I was in a similar situation, I first implemented UNET, but I got super frustrated when I realized that if the host leaves the room the entire room closes, and that there was no work-around. I was ambivalent about switching to Photon, but I got it set up in about a week of work, and it was really powerful and well made! It's pricing system scales nicely too πŸ™‚

spring crane
#

Consider what networking model you are going for. Peer to peer over relay is not for all games.

solid crow
#

in Photon PUN, is there a solid way to do lag reduction? additionally you can also see a simple teleport to coordinates turning into something really wacky for the other player - this game is dependent on being able to see what the other is doing too

#

specifically how the jump on the local client looks like a weird little jumpy-floaty thing on the other client

jade glacier
#

Teleports are a tricky aspect that requires special handling with the sync transform. The vanilla transform syncs in PUN I don't think handle them well, but haven't really tried.

#

lag reduction is a much larger topic, but are you referring to doing extrapolation? Or are you talking about lag compensation, where the server tries to correct for client prediction?

#

@solid crow

solid crow
#

whichever one would be less complex in getting the movement and position of a player synced over the network or as close to accurate as it can get i suppose

#

im like brand new to this and i dont know all the big words oops

jade glacier
#

They are all complex, because you are dealing with trying to hide the fact that players exist in completely different timeframes

#

you have to bend time in creative ways to hide that fact. It's the voodoo that is game networking.

#

What you are describing requires extrapolation. Which involves making a guess about the world around you before it arrives, to push it into your timeframe. It is prone to rubberbanding

#

which is why most games opt for snapshot interpolation. In that case the player is allowed to live in the future, but reality is tinkered with to work through the paradoxes

solid crow
#

that sounds like its not as good for something like player movement

jade glacier
#

Player movement usually uses prediction... the player moves locally immediately

#

In a server based environment, the server will just rewind other objects to match the players timeframe to test things like weapon fire.

#

OR... the game is just designed to be tolerant of the differences in time.

#

OR.. the clients extrapolate other players, and constantly resimulate as real info arrives.

solid crow
#

this sounds like its out of my scope for now

jade glacier
#

for your first attempt just make whatever. You will run into all the paradoxes, and then discussion about how to work around it will make more sense.

solid crow
#

ill give it a shot, i'm just worried about messing up my game into some sort of irreversible state at this point

jade glacier
#

save your work before starting

#

I promise its going to be a trainwreck

#

Networking games is about the hardest thing there is to do in game dev atm, especially with Unity. Your first attempt is going to try to make all kinds of shortcuts work, and you will end up with a huge pile of out sync race conditions

#

and you will code it into knots trying to make things just work

#

You have to try though, to understand the problem before doing it for real.

solid crow
#

is this something where i can at least keep my launcher? i'm using the tutorial you sent

#

as in like keep the photon pun stuff i have already

jade glacier
#

You are using the SNS stuff?

#

The PUN launcher stuff will still be valid either way yeah, thats just setting up the connections

solid crow
#

i'm going to look into it before i start but yeah

#

just want to be 100% certain before i do anything

jade glacier
#

Fork your project and give yourself a month to just make a mess and refactor a bunch of times

#

You have a near 0% chance of your first attempt being anything but hot garbage. You just have to be ok with that.

solid crow
#

i'll give it a shot i suppose

#

i dont know if i have a whole month for this but if its what i have to do ill try

jade glacier
#

Then you really should rethink doing networking as a game project. Most people who fall into the networking hole end up there for years.

solid crow
#

fair

spring crane
#

Just ship it and fix it in v2

#

Or don't if it ends up being good enough

jade glacier
#

Not usually ideal for networking. Adding multiplayer after the fact is brutal work

solid crow
#

oh im just a kid learning to make games haha

jade glacier
#

Just start by making some very basic net games

#

and run into all of the pitfalls

solid crow
#

thats the idea yeah

#

im sure there are tons of like seasoned veterans at it on here, so i apologize if im like oblivious to anything here haha

jade glacier
#

We all started in that exact spot

#

I would recommend as a starting game to try to make Pong, passing control of a ball between two players highlights a lot of the difficulty in networking, in a very easy to digest problem.

weak plinth
#

Can Photon Network get hacked since it's client side?

gleaming prawn
#

You mean PUN?

#

on Mono builds should be easy... IL2CPP also possible, yes, but not so easy.

#

Photon Bolt is server-authoritative, and Photon Quantum is deterministic, so these are a lot more hack-resistant by definition.

weak plinth
#

I'm using Photon Server, while using PunRPCs to transfer information. Can the game still get hacked? I haven't wrote any network code for the photon server, I just downloaded it and connected to the server with the client.

#

Is it still the same or different?

gleaming prawn
#

it's the same...

#

IF you want to have full control, don't use RPCs... Fallback to RaiseEvents, and write server logic with server plugins

#

But this would be a lot of work (but you can go very very far with it)

#

This is the approach used by some top grossing games like Golf Clash (full server authority, not hackable) - photon server plugin implementing logic + raise-event messages from the clients.

jade glacier
#

Where you will have a hard choice to make is if you are relying on clients for physics and simulation. Trying to replicate physics and such on the server will become more work than its worth, and at that point you should consider Bolt or Quantum. @weak plinth So the first question is really what does your game simulation consist of, and what kind of network architecture are you ultimately needing to make that game type work.

spring crane
#

IL2CPP is quite trivial too with very basic CheatEngine usage.

#

You can make it less trivial with memory scrambling plugins

jade glacier
#

Its more to do with the server being out of their control, and it being able to enforce some level of control over what players claim.

#

In a pure client authority environment, a player can literally send a packet that says "I just shot you all in the head"

#

In a server auth environment, the user's cheats become limited to valid inputs. They can do things like use shader based aimbots and such, but that still has to translate into valid user inputs.

#

PUN2 without any server plugins is full client authority, so its not a great candidate for competitive real time shooters and such. It is viable though for coop or casual competitive stuff.

high night
#

I am saving whole scene state into a byte[]
And i can load the scene the same way

But i have some weird stuff going on, i don't think i am able serialize or load a scene completely.

I stuff that changes for example: positions, velocities, ang velocities etc. etc.
But when a collision happens, it gets weird.

My system on host:

initials;
-host only has one scene and uses that for both prediction and reliable
sim by switching states
-host has a reliableState stored in byte[].
-localInputs: host's local inputs
-reliableInputs: recieved inputs from everybody
-host's scene is always in future with a varying offset to realiableState
when it's displayed on the screen

everytime a tick occurs;
-host reverts its scene back to reliableState LINE A
-host simulates its the scene with reliable inputs of next tick
-host saves the scene back into reliableState
-host adds it's local inputs LINE B

every frame;
-host simulates it's scene until realtime (future)
-simulated frame count is higher just after a tick happened otherwise just 1

.
What i did was to disable the LINE A
And i still saw that a collision happened
A collision that reliableState and reliableInputs have no way of knowing about
.
I saved all the frames occured in "everytime a tick occurs" part
And i replayed it
I saw a collision without the object that caused the collision
.

[question]
What do you think i am doing wrong when serializing or loading the scene with bytestream states?

Does destroying an object don't immidently destroy it's instance in physics scene?

I think it's clear that at LINE B, information is leaked from last prediction state into the reliableState.

#

Oh wait, i think i got it.
I had to use DestroyImmediate instead
That seems to instantly destroy the physics instance

jade glacier
#

That's a lot of text. Lost me a bit at host loves on the future. Host typically is there final word on the present. So your model is already too far from the norm for me to comment.

high night
#

host is not in future when it's sending the state
it sends the state and jumps back to future

It's fine, i fixed it.
It was about information leak when switching between states

#

A destroyed objects information leaked to the next state i was loading and caused a collision.
Because i didn't call DestroyImmediate

jade glacier
#

ah

ripe stratus
#

Hey, any good networking library for c#?

#

I already Trier lidgren but i dont Like it

weak plinth
#

I always get failed to get server instance, but the server works after restarting the server. But how do I fix this?

jade glacier
#

if you are just looking for a transport, LiteNetLib is C#. @ripe stratus

ripe stratus
#

Tried that too, didnt worked @jade glacier

jade glacier
#

The transport didn't work? Not sure how that's possible.

weak plinth
fair cosmos
#

@weak plinth do port forwarding

weak plinth
#

@fair cosmos What do you mean? Sorry, I started recently with a few tutorials

jade glacier
#

You'll need to research Port Forwarding. It's something you do to your router... not something you do in Unity.

#

Assuming that is the issue and you are trying to connect from outside of the local area network to your server.

#

"another computer" is not descriptive enough for networking talk. You need to indicate how that other computer is connected.

weak plinth
#

Its in the same network (I have the computer at my side)

#

I found the problem, it is that the UdpClient.BeginReceive callback wont trigger from another computer but it will in the same (tcp works even from another)

#

Now I need to find why

prisma girder
#

Sounds like a firewall issue if TCP works and UDP doesn't

#

Potentially Windows firewall

weak plinth
#

I think I allowed it when it asked

prisma girder
#

Can always go check, or explicitly add it again, or make a custom rule for UDP, etc

weak plinth
#

I just disabled it, but same thing

prisma girder
#

I'm looking at something

#

UDP is fundamentally different than TCP and lower level socket read/writing calls can have different semantics

#

You're using NetworkStream for both types

#

Sorry, misread. You're calling methods on the Packet type in the UDP class.

weak plinth
prisma girder
#

Helps yeah. What port are you using, btw?

weak plinth
#

@prisma girder 26950

#

For nothing in special

prisma girder
#

So, couple things. In your server's handle receive callback, you're restarting the listener. Which makes sense for treating it as connection-oriented. But you're not using a Connect call on the client side. I suspect you are running into an issue that happens when binding to IPADDR_ANY, which is 0.0.0.0, and using unsteered UDP packets

#

There's like 5 different stacks and systems involved here, but I think all you have to do is use the .Connect in the client

#

There's a strong chance it can work on localhost connections but not remote

#

Which matches your problem

#

local->local works a bit different than local->remote and remote->local

azure mango
#

@prisma girder Thank you! Ill take a look as soon as I can

prisma girder
#

np, hope it helps

high night
#

A question about networked physics:

When a collision happens, it looks like unity buffers that information and invokes OnCollisionEnter for next physics update.

When i switch states, that information becomes irrevelant.

Can i serialize this information?
How do you handle such things?

jade glacier
#

There is no test for collisions in real time. After all FixedUpdates run, physX simulates, and that produces the collision events.

vital hawk
#

you can do overlap checks immediately if you need to

#

it's extra cost for each check

#

they are queries like raycasts etc

high night
#

I think i'll switch to dots, i heard i can serialize a physics scene without missing stuff like unapplied addforces
Looks like i can force-apply them before executing the next update
I'd just finalize the frame (have all the addforces and collision calls done with) and then i could serialize without missing anything

#

It doesn't look like i have that kind of control with default physics

gleaming prawn
#

Now you know why we had to develop our own as well...:)

weak plinth
#

anyone had tested zapnet ? seems very very close to bolt (entities,states.. even has AssignControl(player))

gleaming prawn
#

Author claims they AIM TO support up to 300...

#

" with an aim to support up to 300 players with our scoping system."

#

I didn't see any real numbers with a proper Unity-based server build... Not that is not possible, just didn't see it stated (maybe I missed it).

weak plinth
#

you are right, didn't found any real benchmark just his feelings

gleaming prawn
#

if it can, it's awesome

#

but normally this comes at a cost... in a unity build for the server, serializing packets to 300 clients is a serious task (depends a lot on how efficiently you can traverse the entity graph, detect delta changes, packet and compress, dispatch)

#

I expect these guys to know what they are doing, but this is not super simple...

#

Doing this at 10Hz is not super difficult, but doing this at 60Hz is a different story...

#

It has a lot of implications on how the gameplay code is exposed to the game developer as well. I mean: if you expect the game loop to happen from a single unity main thread, and applying changes to regular MonoBehaviors, etc...

#

It's interesting that a few new libs are coming out trying to do what Bolt does (or better, since 2015)

#

@graceful zephyr new goal is to support 20k connections/players + 200k NPCs from a single server running 30Hz updates, so you get the point...:)

weak plinth
#

its just weird how much it takes from bolt even have setScope, so i guess its just flattering to the bolt terms

graceful zephyr
#

Β―_(ツ)_/Β―

weak plinth
#

also i know bolt can run 100 players, I've seen it in the forest 128 players mod with stacked up server, donnu how much Hz thought

graceful zephyr
#

forest ran at 20hz AFAIK, and its not possible to change via config

#

its baked into the asset resource

weak plinth
#

its not that option from settings ?

graceful zephyr
#

yes but not when game is built πŸ™‚

weak plinth
#

or you guys removed it

graceful zephyr
#

forest has a custom bolt version i modified

weak plinth
#

in what way it made it different then the normal bolt ?

graceful zephyr
#

dont know if i can say technically

#

@weak plinth There's a lot of these various mid-range type libraries popping up, saw at least 2 others vs the one above. My take is this... they're aiming way to high and they tend to trivialise the problems that they will run into. Saying things like "300 players", etc.

Also if you're aiming that high you will need your own custom socket library, and most of them use Lidgren (not very good) or LiteNetLib (good, but not feasible for a 300 player scenario imho)

#

Most cases its a lib built by 1-2 guys, they have never shipped a multiplayer game, etc.

weak plinth
#

btw you don't mean the world grid in the forest is that something special for bolt right ?

graceful zephyr
#

dont remember details, its like 6 years since i worked on the forest

weak plinth
#

but you do remember if you modified the bolt's core itself for it

#

don't you ?

graceful zephyr
#

i really dont

#

6 years dude

#

:p

weak plinth
#

k i'll compare the two dlls and see for myself

graceful zephyr
#

compare what dll? current bolt vs forest bolt?

#

its a huge difference

weak plinth
#

same versions

graceful zephyr
#

Β―_(ツ)_/Β―

weak plinth
#

i have archive of bolts versions somewhere

#

btw 50 players in one place, crazy achievement πŸ™‚

#

The Forest is full of survivors. Lets see how Megan holds up!
β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬
COST FREE DONATION ON MOBILE βž₯ https://rechaaarge.com/maddvladd
MADD Army Merch βž₯ https://akquire.ca/maddvladd/ %5 PROMO CODE : Vladd
PATREON PLEDGE βž₯ https://www.patreon.com/user?...

β–Ά Play video
gleaming prawn
#

My personal take (might be wrong here @graceful zephyr ): 50-100 player range with Bolt is possible. Higher part might mean you need to relax on update rate, of course. That's the trade of for the GameObject/MonoBehavior/Single-threaded architecture it uses...

#

Going after anything higher than that is not trivial, as discussed.

jade glacier
gleaming prawn
#

That is DoA...:=)

jade glacier
#

Its listed on the store as $30 to buy right now. Which is like about double what I am charging for just my Transform/Animator sync components.... so the support to $$ ratio is going to be painful, unless he is just writing the most immaculate and self-explanatory code ever. @gleaming prawn

#

Which I have never seen be the case with networking. Even the best code is going to require a LOT of documentation, forum support and generally just being available to help.

gleaming prawn
#

That's what I mean

jade glacier
#

He's going to learn it the hard way

#

I can't tell looking at his code how he is handling timing. Seems like he is trying to recreated Bolt, in which case it should be all ring buffers and fixed ticks. Which means this does stand out as being one of the few complete networking stacks available.... but not enough info to tell atm (or I have not looked hard enough)

#

He makes references to Mirror and such, which indicates he is trying to throw into that ring, which suggests he's just making another messaging layer.

#

All verbiage relating to syncing and timing is just super vague "Automatically syncs" stuff

#

My gut says that he is just making another MLAPI-like library, and the rewinding he is talking about is all RTT based... but again... can only guess from what I see.

weak plinth
#

@jade glacier very accurate

jade glacier
#

Which part? @weak plinth I actually can't tell anything for sure so I'm speculating like mad. πŸ˜•

#

Which is why I suspect he isn't doing a lot of hard interactions with the simulation.. that would be something he would want to mention.

#

Did you read or see anything relating to how he is dealing with state sync /input sync and controlling the simulation?

weak plinth
#

all of it, specially recreate bolt part, he admitted in chat he ex-bolt user and uses the exact terminology (entities, states, event, commands, freeze, setscope... etc) but uses lidgren instead of udpkit and relies on its delivery methods

jade glacier
#

All of the terms can line up, but that doesn't mean he did the really hard parts - which is controlling the whole simulation/player inputs/controllers part of the stack.

weak plinth
#

sure.. lineup

#

he did add input and controllers

#

but no delta compression at all

jade glacier
#

that's pretty easy to add later. The place most of this libs faceplant is that they are just messaging layers, so good on him if he is competing the stack.

#

How he deals with the whole delta and state consistency stuff for each connection is a whole other set of questions... esp when he starts talking huge player numbers like that.

weak plinth
#

hmm from what he posted in public

#

seems ticks simulation are in fixedupdate so guess not multithread

jade glacier
#

I wouldn't expect anything to be multithreaded regarding simulation/serialization

#

But he is calling Simulate manually in that Fixed, so that does indicate he is going the route of respecting the simulation timing with his networking. If that is in a Singleton I am surprised he isn't producing callbacks prior and post that Physics.Simulate() call.

kindred surge
prisma girder
#

@kindred surge First one you need to grab pl.NickName, second one needs a player object as first arg

#

I know nothing about Photon, just looking at your code and a brief glance at their docs. Read your error messages and code carefully

onyx blaze
#

Hi, I'm trying to get started on addressable's and I'm having trouble understanding how it works. I want to have Assets( models, prefabs, etc. ) on a server that I can load at runtime and instantiate as needed in my game. The official unity docs for addressable's v1.6.2 were not clear to me on how I would go about setting up the connection between game and server. I understand Unity does not provide server setup but I'm just not sure how set up a link from game to server at runtime. If anyone has resources or insight on how I can begin solving this would be greatly appreciated.

prisma girder
#

That's a strange name for networking

#

This is the networking channel, poking fun at you :P

#

Animation? Game-design? 2d? 3d? I mean, there's a few options I'd expect will net more fish than Networking ;P

jade glacier
#

Not that kind of networking.

sudden cosmos
#

oh damn xD sorry

sonic marsh
#

Hey Guys, has anyone played with DOTS/NetCode for a RTS? I had a older prototype based on Planetary Annihilations Curves (https://www.forrestthewoods.com/blog/tech_of_planetary_annihilation_chrono_cam/). I'm wondering if I should brush it off and update it, find some other package (not heard of any), wait for unity's rts netcode (no news that I know) or adapt/extend unity's netcode myself somehow

#

If anyone has any ideas/recommendations that would be awesome πŸ™‚

weak plinth
#

without a doubt photon quantum for rts

sonic marsh
#

never even heard of it, researching now

#

might be a bit out of my price range πŸ˜›

jade glacier
#

Its not really targeted at hobbyists or people just making a game to see if they can yeah.

sonic marsh
#

yea, i'm definitely in the hobbyist category

#

and im crazy enough to be willing to custom build something πŸ˜›

jade glacier
#

Just be aware that getting into that kind of netcoding on your own is about a 2-5 year learning adventure.

sonic marsh
#

yea

#

that prototype took me ages, to make it actually solid... will be a very long time

#

but for DOTS compatibility i think its the only way

jade glacier
#

If you are doing this in dots then you pretty much have to keep an eye on netcode. Most of the higher level options for networking are MB based.

sonic marsh
#

yea, i've already figured out that most of the high level options wont fit

#

tho that photon quantum would be the closest ive seen

#

except for the $$$$$

jade glacier
#

its also not going to like dots all that much. You build with quantum using its math library and simulation mechanisms, and then networking just happens as a result.

#

It would not work well for a retrofit of an already made SP game.

#

Though really, almost nothing works well for adding MP after the fact. You typically start with networking to ensure your simulation is fully networking friendly.

sonic marsh
#

its a new game, mostly prototype atm aiming for a small MVP to confirm the core loop/gameplay works

#

then will build in MP

#

so ill have to rewrite stuff, but not as much as the game wont be done

#

my current thought it use unity's netcode for the low level sockets and some smaller high level stuff

#

but mainly build on the curves based on Planetary Annihilation's networking

jade glacier
#

Keep us posted on how that evolves. Not a small undertaking for a first networked game.

sonic marsh
#

yup, pretty sure im insane sometimes πŸ˜›

#
  • having a full time job 😦
#

but about to get a 4 day week πŸ™‚

jade glacier
#

I wouldn't personally recommend trying to go it alone making an MP RTS just as a hobby, unless you really are ok with never finishing it and will really just enjoy the process.

sonic marsh
#

yea i know

#

and thats the same advice i would give anyone trying to do this πŸ˜›

#

Β―_(ツ)_/Β―

stiff ridge
#

@kindred surge : OnJoinedRoom should not be a RPC. It's a callback of PUN 2 and it's called on all clients anyways, so you don't need to write network messages regarding joining.
Do the Basics Tutorial from your doc page to get a grip.

cedar marlin
#

hello can somebody help me get a functional socket in unity ?

#

i have already try this like 2 weeks ago some people help me there but coundt get it to work so switched to something else

graceful zephyr
#
var socket = new System.Net.Sockets.Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
#

thats a fully working tcp socket

cedar marlin
#

ok i was unclear in my request functional tcp server/client in unity would be maybe more precise.

#

if i recon u were the one to help me last time fholm

graceful zephyr
#

Β―_(ツ)_/Β―

cedar marlin
#

so jsut to put some context i need to send some data from a linux computer to my unity on another machine i suppose sockets would be the easiest way

graceful zephyr
#

yes, could print it to paper and scan it on the other computer of course

#

but that seems cumbersome

cedar marlin
#

cumbersome meaning like its too much for that application ?

somber drum
#

Hey, so I'm trying to get a replay plugin working over a small photon room.
The levels themselves are fairly small mainly only vehicles, but I'm told in order to record I would need to first have a scene for gameplay, and a scene for replays.. Is this accurate, also is this the preferred way of doing it

#

basically I'm being told it's not possible or reasonable to expect photon to be able to handle that kind of data exchange between players

#

If I'm only recording say a handful of transform, and the rest (static) ignored.. still not possible ?

#

really just wanting the last 5 seconds of action before player death.

jade glacier
#

That really is more a function of your simulation buffering, and how friendly it is to being rewound. I wouldn't networking any kind of replay.

somber drum
jade glacier
#

I would not start your travels down the path of networking with an asset dump

somber drum
#

I've come across some others but this seems to be optimized enough to work.. but then again I'm not a network guy.. If anyone here is available for this kind of work feel free to dm !

jade glacier
#

Have you made a MP game yet?

somber drum
#

Yep, working within a functioning project already, Implemented some more basic syncing like animations or damage, that kind of thing

#

I do love a challenge I'm not afraid to work for it, just seems a fairly sparse topic on the forums

jade glacier
#

That isn't really a game though, most people get basic movement and some weapons firing in a week with just a messaging library. If you want to to proper rewind and replays, you need to circle back around to designing your simulation to be a tick-based buffer system

somber drum
#

But possible within PUN2/realtime I'm assuming?

jade glacier
#

Its separate from any library, your simulation is how you reduce your entire system to a fixed tick that consumes inputs and produces states.

#

the networking part is just sharing those as needed.

#

your replay isn't tied to networking, you would use the same input/state history to rewind

gleaming prawn
#

Replays, ahhh

#

:)

jade glacier
#

replaying over the network would be a brutal waste of internets πŸ™‚

#

point being, make your game properly for networking, and replay after your game is done will be pretty simple.

#

I wouldn't start there.

somber drum
#

Well the basis is already there

#

I was just hoping it would be as easy as recording movement in a separate instance and sending the compressed changes to the player haha.. Guess my work is cut out for me

jade glacier
#

Messaging <-> Input/State Buffer <-> Fixed Time Simulation that is the architecture you want to be building to.

#

You have buffered states/inputs as numbered ticks and your simulation is abstracted from your messaging already?

somber drum
#

Ah no when you mentioned "replay after your game is done"

#

But if I have to change the foundation for replay instead of using a plugin, seems a bit tedious

jade glacier
#

Sounds like you are pretty firm on a path you have in mind, so yeah... just go for it and see.

somber drum
#

Thanks, appreciate it

gleaming prawn
#

Without determinism, at least use sparse full snapshots + inputs in between to interpolate with a loose SIM... Full state based replays are massive

#

Just love that with quantum nothing is needed. Replays are a given.

#

Full match and killcams

hallow zinc
#

what these errors means?

#

im trying to sync player position

jade glacier
#

That your values are corrupt

dense oxide
#

anyone ever make python scripts talk to unity game?

graceful zephyr
#

@dense oxide sockets

#

IPC also works

dense oxide
#

I got it working using sockets, what form of IPC would you recommend ?

#

Also im using ironpython so pretty difficult to integrate any python packages/libraries that aren’t already in ironpython so I think I’m pretty much stuck with sockets which is fine

woven loom
#

Hello guys. Is there any chance using addressables with PUN2?

jade glacier
#

really just depends on how you handle anything asynchronous. I don't see any inherent reason why you wouldn't be able to use them.

woven loom
#

Mh, because PUN2 says it needs to have the Prefabs in /Resources/. That's a little confusing.

jade glacier
#

If you want to use the standard instantiation method, but if you trace that to what its doing, its just using that so it can find resources by the prefab name.

#

Looking at the spawning code, I think you would have to recreate their Instantiate methods, and replace the string -> prefab lookup with your addressable lookup.

#

But nothing like that is built in currently that I know of.

woven loom
#

Okay. Thank you @jade glacier .

jade glacier
#

in PunClasses.cs you can see the Instantiate() calls, and how they are turning the string reference into a resource prefab... so I would think you would just need to create your own method to replace those.

#

The addressables use strings as well? or IDs?