#multiplayer

1 messages Β· Page 51 of 1

thin stratus
#

Without GameState, no BeginPlay

rotund onyx
#

I have an actor that is spawned by the gamestate, it stores other data about the common classes and has a HISM component that my multitude of actors needs to get their meshes spawned

thin stratus
#

And you spawn that on BeginPlay of your GameState, limited to server and replicated?

rotund onyx
#

my level is not placed by hand, it is generated, so I have a handful of "master" actors that hold all necessary information about the types of actors that can be spawned

thin stratus
#

Do you know what a Delegate or Event Dispatcher is?

rotund onyx
#

yes

thin stratus
#

Okay

#

Make an OnRep variable for your Manager Actor in the GameState

#

Make an Event Dispatcher called "OnManagerReady" or whatever fits better

rotund onyx
#

I store them in an array currently since i have multiple, will that work?

thin stratus
#

Call that in the OnRep

#

Do you need them all to be valid at once?

rotund onyx
#

I don't really know honestly

thin stratus
#

Well okay, I will just explain it with one for now

#

So you have the OnRep/RepNotify variable, and the EventDispatcher

#

You call the Dispatcher when the OnRep calls with a valid pointer

#

Your other actors have now 2 options

#

On BeginPlay, they get the GameState (that should always be valid on BeginPlay)

#

They can now check if the RepNotify variable is valid

#

If it is, great

real ridge
#

hello guys what's the discussion about

thin stratus
#

If not, they bind to the Event Dispatcher

#

That way they get notified when the manager replicated

#

That can also be setup for an array variable

#

But you need some condition for when to call the Dispatcher

#

One could be that you know upfront how many managers the client should expect

#

If you have x valid entries in the array, then everything replicated and you can call the Dispatcher

rotund onyx
thin stratus
#

Idk how you use those managers

#

But all it takes is to notify the waiting actors with the Dispatcher

#

That's basically the easiest setup

rotund onyx
#

thats a super smart setup

thin stratus
#

I'm sure you can figure out how to set this up with your array. I will head to bed now 😴

rotund onyx
#

Would it work if my actor can check if the expected manager exists yet in the array?

thin stratus
#

Yes

#

If you have some identifiers

rotund onyx
#

yes everything has an id that matches the master

real ridge
#

Guys how I can solve when I have non smooth movement but lagy in my game? also usage of my cpu and GPU is like 80% even my game is empty map with me and my friends playing it.

thin stratus
#

Then you could always call the Dispatcher and the binding actor can check if their info/manager is now valid

thin stratus
#

Or still pawns?

real ridge
#

I won't go with characters with planes heh

rotund onyx
real ridge
#

sometimes it peak at 99% usage which is insane

#

Witcher 3 uses less

rotund onyx
#

same for me, packaged game isnt exactly slow but it tries to cook my gpu. In editor its normal though

#

right now I just cap framerate which helps but is a bad solution

thin stratus
real ridge
thin stratus
#

If you don't use the character and the CMC you have to code this yourself

real ridge
thin stratus
#

Just replicating movement with RPCs won't ever cut it

#

Then I can't help you :/

real ridge
#

well my shits heh

rotund onyx
#

you are looking for prediction I think?

real ridge
#

i know CMC is top for replicating but doing plane with character is curse

rotund onyx
#

are your clients movements kinda choppy?

real ridge
#

i Can make video Tommorow now i am going to sleep hah

rotund onyx
#

theres some creative methods in this chat I've seen people do

thin stratus
#

The truth is that network movement is really involved.
And the pawn has no proper setup

#

This is nothing you just wing with a few BP nodes

rotund onyx
#

smooth sync is my best friend

thin stratus
#

If you ditch the CMC you need to code this yourself

#

The other alternative is the new movement component but that's too pricey for them

rotund onyx
#

I would be interested in a link so I can add it to my wishlist

real ridge
#

idk I think players are replicated fine but problem is in movement at my side I mean in my window it's laggy when I run editor it's fine smooth when I play standalone or client or exe it's laggy and really not nice

thin stratus
#

I can't find that via phone

real ridge
#

like I have big ping

#

i am at phone tho kek

rotund onyx
#

if it feels like big ping its probably just not having prediction implemented

thin stratus
#

It's a 300 or so euro plugin

rotund onyx
#

wowie

real ridge
thin stratus
#

Yeah I'm talking to sumrex

real ridge
#

ah sorry

thin stratus
#

It's fitting but too expensive for you :P

#

I know that

real ridge
#

so no it's not good for me

#

they are planing to finish it

#

i red their dc

thin stratus
#

Right

real ridge
rotund onyx
#

smooth sync is just a component you put on an actor

#

its really basic prediction (if you can even call it that) but its good for simple stuff

thin stratus
#

Yeah but keep in mind that smooth sync isn't doing any prediction or?

#

Only extra and interpolation

rotund onyx
#

yeah thats the word

real ridge
#

i think u should see a video what I mean what is my game doing I smell here a lack of communication from my side heh

thin stratus
#

So if you don't do client auth movement then this won't fully solve it

rotund onyx
#

smooth sync has a checkbox for client auth

#

dunno if it works bc I havent tried it lol

thin stratus
#

Well I'm using this engine for 7 or so years now. I've shipped multiplayer titles. If you tell me the movement is laggy with ping and that you use a pawn with RPCs then that's usually meaning that your setup is lacking all the stuff the cmc implements.

Prediction
Reconciliation
Interpolation
Extrapolation
Corrections
Etc.

#

And I can't give you a magic answer to your problem

rotund onyx
#

cmc is char movement component right

thin stratus
#

Yop

rotund onyx
#

or have i misinterpreted the whole thing lol

real ridge
#

i know but maybe I thought it can be problem in CPU when I have 99% usage it can lag no?

thin stratus
#

Sure then hunt your CPU problem first

real ridge
#

yea that's the problem no idea how to solve it I am not using any materials anything empty map with gray colours

#

and 2 players

#

weird

#

anyways it's late I am tired good night guys thank u for answers and forgive me my words if it touched u

#

i am sorry

thin stratus
#

You should try to profile your game to see what is causing the high cpu is what Max means. #profiling (:

zenith scroll
#

Hello, anyone here know about networking and custom movement modes? I'm trying to find someone to help me with those.

prisma snow
zenith scroll
#

Right, sorry this is my first time asking for help like this. I'm still fairly new to unreal and I tried to figure it out from an online tutorial on networked movement modes. It works on the server but the client keeps rubberbanding and I cant figure out why.

split siren
#

Dumb question, I found a variable FVector2D SpatialBias; in Replication Graph (GridSpatialization2D). By looking at the code, I think it's the offset from center, but I am not 100% sure. Can anyone please confirm?

dry pebble
#

Does anyone know if GetCachedUniqueNetId() is only set if you're using the OnlineSubSystem or can this be used for a custom dedicated server without sessions too? Trying to get a unique player id per player that joins but not currently using the online sub system

fathom aspen
#

if you're using a real OnlineSubSystem
FTFY. The default Null OSS is fake/limited

dry pebble
fathom aspen
#

It's not set, or it's not unique, meaning that it is meaningless in a Null OSS

#

You need to be using a real OSS like Steam/EOS

#

Null OSS is just for LAN sessions and works based on local IP addresses basically

dry pebble
fathom aspen
#

Yeah its name is weird too, but it's worth its name

dry pebble
#

Does it have any use? Or what do people use it for?

fathom aspen
#

Well you don't really care about your OSS at a very early stage of your game, as all your concern is to basically make sure your multiplayer features work. And iirc there must be an OSS by default for the engine to function, so it's a placeholder before it's anything else

#

Also it's there for the simple use cases and the ease of setup (well it's already setup for you)

#

But I don't imagine games being published with it really

dry pebble
fathom aspen
#

Yeah. Or you could roll your own method of assigning UniqueIds to connections (basically extend the Null OSS), but that sounds to me quite an overkill when it's already implemented in other OSSes

dry pebble
frozen pollen
#

Does anyone know what format of the URL ServerTravel expect me to send for "Game" option? It should be an game mode blueprint/class. Just name or full path?

fathom aspen
#

It should be the an alias name of the GameMode you want to load

#

Look into Project Settings at GameModeClassAliases and you'll understand

deep coral
#

how do I check if two actors have the same owner in multiplayer?

plucky prawn
deep coral
#

thx, is it possible in BP?

plucky prawn
#

Yes

deep coral
#

like if I have nested ownership, will it still work? ie, if actor1's owner is A, and actor2's owner is B, but B is also owned by A

#

if I use getowner(), i will get A and B, but they are not ==

#

I'm supposing

dark edge
kindred widget
quasi tide
#

I forget, replicated struct, does the entire struct get replicated or just the value that changes?

#

Only value that changed

pallid mesa
fathom aspen
limber gyro
#

game instance exists on the server right?

fathom aspen
#

On every instance of the game, so yes

kindred widget
fathom aspen
#

Yeah, it is basically the function the engine uses to check if an actor is capable of firing server/client RPCs. Also confirms your test a while back to when it is safe to do so (OnRep_Owner that was)

plush wave
#

So is there a way to know (from a client's perspective), when an actor successfully gets replicated?

#

Is it just "OnRep"?

thin stratus
#

Usually when its BeginPlay triggers

#

+- the condition of the Game actually having started of course

plush wave
#

So BeginPlay and then like "get the local controller and do something"?

thin stratus
#

Depends on what you are up to here

plush wave
#

Players that spawn in the match for the first time need to be viewing a camera on a replicated actor

#

For the Host the actor is there when BeginPlay starts on the controller

#

For the Client, the actor does not exist yet

chrome bay
#

PostNetInit()

plush wave
#

On the actor?

chrome bay
#

Well that'll be called the first time that actor is "initialized" from network

plush wave
#

I see

#

Is it called again if the actor leaves relevance but comes back?

chrome bay
#

If you want some other object to listen out for it, you'll need a global delegate you can subscribe to or something

#

It is since it's a new actor (so long as it's spawned at runtime, not placed in world)

#

I'd just use PostInitComps tbh

#

and broadcast the event

#

Listeners can decide whether they care or not

plush wave
#

Yeah makes sense

#

Thanks

plush wave
#

COND_InitialOnly will send the initial value even if it is set later in gameplay yes? As long as it is the first time it is set?

chrome bay
#

no, only ever once

#

Or at least, only when the channel is opened first time

#

And so long as it's different from the serialized value

plush wave
#

So if it starts out as null and gets set later, then COND_InitialOnly won't actually send it?

chrome bay
#

correct

meager raptor
#

Hi everyone, I'm having a hard time to use the Teleport function with a replicated pawn. Sometimes the teleport don't work and the pawn just stay at his place. Check the picture to know how I teleport in BP. I'm posting in multiplayer because I'm not sure if it's related but since the pawn is teleported client side and the client send the location to the server maybe it interfere somehow ?

real ridge
#

guys what can cause this? I was trying my game now and I was shooting this plane on the right in circle life was replicating exactly like on left window everything was fine but suddenly I saw on the right that my plane in square on the left has different direction even I was still hitting him and then few second later my plane on the right dissapeared from map of the plane on the left like he got disconnected and both were on the map alone

#

little bit weirdo

#

πŸ˜„

prisma snow
#

I don't think we can know what's really happening, it's too broad of a description and we don't know how any of this works at all. Have you tried to debug the related logic?

real ridge
prisma snow
thin stratus
#

They would show if the Player disconnected quite clearly though

real ridge
#

or i can upload right from the chat?

#

but this time I am running it via standalone and I dont have big cpu usage

#

This is how it looks, movement is laggy as I said yesterday and I have feeling that replication is not exact + then that plane just dissapear which is weirdo i will try debug it somehow

#

oh video is big I try to convert it

thin stratus
#

Idk about the freezing while playing

#

But the other window is simply reducing frames cause it's in the background

#

The actual lagging you get is something you'll need to #profiling

real ridge
real ridge
#

at 1:28 +- one of the plane dissapear

woven basin
meager raptor
#

ok, I didn't want to go that route but will try that πŸ™‚

woven basin
meager raptor
#

yes I understand that but here since the client sends its location to the server, the client sends its new location to the server. Here the server never says which location the client should be. The teleport currently works something like 80% of the time. But yeah... Will do :p

#

thanks

late scarab
#

Hello, I have been fumbling with an idea to get an ability to stay active while the owner hold down a button. Basically a held ability.
However, the spawned class needs to get info from the owner that the button is still being held.
My first thought is to have a function on the server that asks the client if the button is held and returns true or false but this sounds like a lot of back and fourth.
I'm reaching out here to see if i'm on the right track or if there is a better option. I appreciate any help πŸ™‚

thin stratus
#

It's a boolean on the AbilitySpec that says InputPressed

#

Together with 2 RPC Events for Pressed/Released

#

It has to be said though that Epic had to add a security measurement to allow the Server to kill off the Ability if the Client ended it, because otherwise it could get stuck, waiting on Input forever

late scarab
#

Is the 5.1 version needed or is 5.0 okay for the ability system?
I have an asset im using that has an issue in 5.1

thin stratus
#

We shipped games with 4.25 with GAS :P don't worry

late scarab
#

Woot, Thank you πŸ™‚

rocky topaz
#

so I have a projectile that can add a radial impulse to my vehicles that are fully client simulated and I'm unsure how I should go about adding the impulse

#
void ARacingTankProjectile::OnHit(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp,
                                  FVector NormalImpulse, const FHitResult& Hit)
{
    if (HitComponent && HitComponent->IsSimulatingPhysics())
    {
        HitComponent->AddRadialImpulse(GetActorLocation(), ImpulseRadius, RadialImpulseStrength, RadialImpulseFalloff, bImpulsionIgnoresMass);
        
        SetLifeSpan(0.1f);
        
    }
    
}```
#

for now I added this to the projectil's OnHit but I'm not even sure it's called in the client

thin stratus
#

Hit will be called on everyone that has the projectile and the vehicle

#

And has the same sort of setup and actually causes a hit fwiw

olive kraken
#
Epic Developer Community Forums

Reported this bug about a month ago, it is a new behaviour in 5.1. I’ve been able to reproduce it in a blank scene. Steps to reproduce: -Make a character with an AI controller and focus the AI on a moving player. Make sure that you let the character rotate towards the desired rotation in the character BP. -Add some logic in the character AI t...

prisma snow
#

I've got a doubt about how to go in the networking of GAS abilities in our game. Since it's an RTS, we use manager actors to replicate data (having one channel per unit is not feasible). We're using GAS to do everything related to combat, melee attacks, ranged attacks, special abilities, etc. I think GAS components replicate through the actor (in this case, each unit) but we're trying not to do that - is there any way to have the ability system components on each unit, but replicate through a manager?

A workaround I can think of is to not replicated the GAS at all and let it run independently on client/server, but only generate the effects on the server and replicate the results (for example, if one unit gets damaged, the damage calculations happens only server-side and the new health gets sent to the clients as a server update). Client-side, only the aesthetic effects would be played (animations, fx, etc)

quasi tide
#

So - I want my characters to move slower when strafing left/right and walkin' backwards. Is there a smarter way than to just update the MaxWalkSpeed of the CMC when those inputs are given?

olive kraken
#

in settings

near basin
#

guys how do i implement multiplayer in ue5 can somebody please dm me a video or something to explain

quasi tide
#

Way too broad a question. Check the pinned posts.

quasi tide
#

Not sure how well it would work under a GAS scenario though

rocky topaz
#

and if the server decides how can I replicate the effect of a radial impulsion on a client's vehicle when it's potentially not at the spot where it got hit in the server

trim plume
#

Thank you for your help. I moved the multicasting into the character parent cpp class instead of the movement component, and now everything seems to be working.
You pushed me in the right direction. Thank you, it's greatly appreciated. Have a great day ☺️

prisma snow
tidal kestrel
#

Hey all new to unreal. Does it make sense to use a replication graph or override AActor::IsNetRelevantFor for things like pawns hiding behind walls or something along the lines of a smoke screen to prevent something like wall hacks? Seems like it would be computationally expensive to add stuff like collision detection, and there might be problems with like people coming around walls or out of smoke becoming replicated network relevant out of nowhere on the client that might feel jittery. Is this a path worth going down? Just trying to get a sense on networking in unreal.

twilit radish
#

I mean regardless of Unreal, there will always be latency in place when you go around a wall. I believe the creators of Valorant do it but with some adjustments to the technique (and also done in Unreal) πŸ˜„

#

They have an article about it somewhere on the internet. So β€˜technically’ sure you can do it.

quiet fjord
#

Guys, one question, to replicate the information of my stat of my character, that is, my chosen character, my nick and my statistics, to the rest of the players when I start a game, we must do it in the player stats or is it correct to do it in the player controller and then do the replication in multicast

#

I currently collect the values ​​in my playe controller and then from there I call a replication function that I have in my pawn controller so that it is displayed to all players but I don't know if it is correct

tidal kestrel
#

I was watching the valorant video on how they rewind for actors only within a sphere collision that extends throughout the map, but I just found this: https://technology.riotgames.com/news/demolishing-wallhacks-valorants-fog-war which seems to answer my question! Looks like they went down the Ray tracing / collision issue and said it was too expensive and decided to make grids

Anti-cheat lead Paul Chamberlain walks us through the technical guts of Fog of War, VALORANT's anti-wallhack system.

twilit radish
real ridge
#

guys is there in game mode any function for override which can end match? Or restart map? or anything like this I mean when one team will lose it will tell You won or you lose and then it will kick them out and restart current match

twilit radish
#

If you do not have seamless travel enabled just open a (different) level and it will kick all players.

#

I believe there's a state somewhere in GameMode or GameModeBase for ending a match, starting it etc. but it doesn't really do much on its own, might as well make your own enum or name for the current state or similar πŸ™‚

real ridge
#

i found this so i thought if for game over

twilit radish
#

Sessions have nothing to do with kicking players or not. Sessions are a way to find others and give some info. You can still kick players just fine by opening a level πŸ˜‰

real ridge
#

is there way how I can get player variables (his team, name) in game mode?

#

I cant get any of these info

#

it is stored in his game instance

quasi tide
#

That should be in the PlayerState

sinful tree
#

Game Instance is only ever accessible on the local instance of the game. You can have the client send an RPC to the server (on their playerstate or player controller) with the data and then the server can store it wherever it wants.

winged flare
#

Can someone tell me how i can show and update my teams hud like this image. Or at least point me in the right direction. Like add the team widgets to as a child and update each teams widget at least the health portion like in the image. So far im getting the info from the teams player state but its not reflecting at all.

#

Any help would be greatly appreciated

short arrow
# winged flare Can someone tell me how i can show and update my teams hud like this image. Or a...

Kind of complicated to explain that through text. First you need to make the playerinformation UI (name, health, mana, etc)

Then you need to make a panel UI which serves the purpose of managing these playerinformations UI's.

The panel UI should have a vertical box or whatever you want to use as alignment, and then it creates a playerinformation UI for every teammate you have, assigns the player ID of that teammate, and then finally, you add that UI to the panels vertical box

#

Does that make sense?

#

If not then I don't mind showing you after I whip up some coffee

winged flare
#

Well i i got the add team hud frame to ui as a child to a Vertical box, but now i cant seem to update the info like if a team members health has updated it should reflect on his Team Frame widget, instead it updates everyones widget on the team, ive tried thru event dispatcher as well and same results

short arrow
#

Don't need any of that. You can do that if you want but a simple timer by function or timer by event is just fine In this

#

I usually do every 0.3 seconds

#

Update all the relevant information by getting it and then setting it

#

If you wanna be giga Chad max performance than you can deal with event dispatchers but I dont think it's necessary for small UI stuff like this

noble sentinel
#

How can I start multiple singleplayer clients to check host/connect buttons?

dark edge
quasi tide
#

@fathom aspen Has GMC received your seal of approval yet?

stiff fractal
#

I'm having a weird issue that happens when I launch standalone instances of my game from in editor. My game runs with with a server and clients. I have a bunch of replicated actors that fail to spawn on clients. The left window is a client and the right window is a server. All the white squares, the timer in the center and the green divider flames seem to be failing. The kicker is that everything works perfectly when I do a packaged build, but that's too slow to iterate on so I'd prefer to do my work launching from in editor. I also get this crazy log output. The top is the server and the bottom is the client. Does anyone have any idea why this is failing?

near basin
#

can someone dm me or tell me how to make a simple multiplayer so i can play with my friends

winged flare
slender forum
#

Hello, guys shil0uHi

#

I have strange problem after updating to unreal engine 5 from 4. It seems that dedicated server works after building, but not the listen server

slender forum
#

slots in the server browser are shown incorrectly, cant join, servertravel doesnt work, like it launches on the non existing server or idk. But if i check that event on server only then it still launches in client atleast as far what i see in console

graceful flame
near basin
graceful flame
#

Have you made a game before?

near basin
#

yes

graceful flame
#

Sure it does, it teaches you multiplayer concepts which apply for both BP and c++

near basin
#

its just that im not the best at ue so i need help with doing it in blueprint

graceful flame
#

Well feel free to ask questions, try to be as specific as possible when describing the problem you're facing. But if you want a private tutor or something like that maybe you could look into hiring one of the many suitable candidates over at #hire-a-freelancer ?

near basin
#

ok

graceful flame
#

@near basin Also you may want to read through the pinned messages on this channel. There's tons of good free resources to help you make a multiplayer game.

shy yarrow
#

when using 2 different mesh for fps multiplayer game, one mesh is for hand and other for full body , is it better to use 2 weapon meshes ? or only use one mesh and make different attach socket for them?

quasi tide
#

I'd just parent it to a different socket, depending on which view I'm in. That'd be my first approach.

shy yarrow
#

so how can I make it ? because a view is for player itself , a view is for other players , I used IsLocallyControlled() , but it does not work good for switching weapons

dark edge
#

name the sockets the same and it'll all Just Workℒ️

#

Just change what MyMesh points to depending on local or not

#

Gun attaches to MyMesh.GunSocket

shy yarrow
dark edge
shy yarrow
#

because for switching weapon not work

#

I used that

dark edge
weary badge
#

Hey everyone, I'm still stuck at my old issue,
I used onswap controller and got a reference to all the player controllers. I also spawned characters on the level.
When I try to let the client possess a character, it does not work.
If the very same code has a delay node, it works and the client possesses the character. Does anyone know why that is please.

shy yarrow
#

wait a min

short arrow
#

it's all commented if you need to pause

shy yarrow
quasi tide
short arrow
#

it was literally you lmao

quasi tide
#

hahahaha

#

I'm trying to reach you about your car's extended warranty

winged flare
short arrow
winged flare
#

will do Thank you

dark edge
#

Don't have the server say which mesh it's attached to. Have the server say which socket or just the fact that it's attached.

#

let each machine decide whether to attach to 1st or 3rd person mesh

glad escarp
dark edge
#

why not just spawn/destroy on server only

glad escarp
dark edge
#

Assuming your weapon actor is replicated, just spawn it and destroy it on server

#

Until you really know your way around networking, assume a multicast is a mistake.

glad escarp
dark edge
#

Ignore equipping and attaching for now, just spawn and despawn the weapon and make sure that works

glad escarp
#

Equipping/attaching is done with a rep notify.

dark edge
#

so CurrentlyHeldObject is replicated and has a repnotify?

glad escarp
#

Correct

glad escarp
#

Oh shoot. Wait.

#

Standby

glad escarp
#

Hmmm. This is strange

fathom aspen
outer sphinx
#

hello guys, how are you? I have this error when compiling, does anyone know what it could be?

glad escarp
outer sphinx
verbal tendon
#

🀷

glad escarp
#

Can I not call a server RPC from a client on a listen server model?

quasi tide
#

Same rules as normal apply.

#

Client must own the object that is calling it

glad escarp
#

Ok. That's what I thought. And I'm calling it from the PlayerCharacter so the client definitely owns it.

#

Do I need to spawn the actor and then set its variants during a rep notify? I thought I could just set things up in it's construction script using one exposed variable

fathom aspen
glad escarp
#

I don't get it man. This really makes no sense. It works just fine on a different server RPC that is almost identical to this one.

fathom aspen
#

General Movement Component version 2

#

Basically it's more of a revamp and improvement to the GMC

magic helm
#

OOOOOhhhh fancy!

#

Sweet

grizzled stirrup
#

Can a multicast RPC arrive before an actor has begun play on a client similar to how an OnRep function can be called before being play is called on a client? Or is it guaranteed to call after?

fathom aspen
#

I mean if the actor hasn't replicated yet then the multicast won't be called on client

magic helm
fathom aspen
#

At least that was what I had last time I tested it (but I need to investigate it again)

grizzled stirrup
grizzled stirrup
#

Which is annoying, guess I just need 2 checks in code

fathom aspen
magic helm
#

Order of function call matters with actor spawning and RPC's

fathom aspen
#

However, I noticed that there is a setting/cvar that you can play with so they are queued

#

Or I'm prolly hallucinating

#

It's really something I'm investigating as I write my next article

magic helm
#

@fathom aspen if you find it, please let me know because I'm gonna try it out

grizzled stirrup
#

So if you were tasked with spawning a replicated actor and on the same frame as the spawn, setting a rep notify struct on it, how would you handle it to ensure the client calls their OnRep function with valid info? Just two checks, one in the OnRep func to check if already begun play and another in begin play to check if the struct is valid (and if not call the OnRep func)?

fathom aspen
glad escarp
magic helm
grizzled stirrup
#

Ok so the hacky dual checks are needed in that case, seems to be a common thing unfortunately

#

If you don't do the two checks clients will often call their OnRep too early and the func won't call correctly as the actor hasn't begun play yet

magic helm
#

Yeah because OnRep is On Replicate, which we only replicate values to remote clients. While the server already has the source of truth for everything

fathom aspen
magic helm
#

One thing I've done is basically pool a bunch of the actor ahead of time and then your only having to deal with replicating the correct data and then you call that TryInit function(or whatever you want to call it)

#

But that's actor pooling and it's a whole other can of worms

fathom aspen
#

Even if you had to pack those properties in a struct, they won't really be valid at the same time if they were unmapped properties (those that are assigned NetGUIDs)

grizzled stirrup
#

It looks like this snippet from Exi is the common way to do it, was curious if Multicast RPCs could get around it but sounds like they don't

magic helm
#

Yup, networked multiplayer is "FUN"

fathom aspen
grizzled stirrup
#

I mean in my case it's a once off init so OnRep is probably the worse option

fathom aspen
#

However seems like in Iris if you fire an RPC (prolly a client one) on BeginPlay you force the actor to replicate

#

Didn't 100% validate if it's true but I don't know if I like it (if that was true)

magic helm
#

I don't even know what Iris is trying to solve at this point, I've heard 20 different explanations of what it does from Epic's own employees. I wouldn't even bring it up honestly until they finally do a live stream on it or something

grizzled stirrup
#

I haven't heard of Iris before what is it?

#

New tech coming to UE?

magic helm
#

Their new online multiplayer networking stack

#

It's SUPER WIP, with 1 document on UND that talks about how to turn it on... And that's it, no explanation of what it does, what it's for, and what it solves, etc. Just that it exists, it's new, here's how you turn it on but that may change!

#

Basically don't touch it till they tell us what its for

grizzled stirrup
#

Hahha definitely won't be touching for a while in that case

#

I mean I'm still on UE4 so can't if I wanted to

magic helm
#

Ah yeah... UE5 exclusive

short arrow
magic helm
#

I mean... You can... I don't speak for Wizard... But that was my recommendation when it comes to asking about Iris atm

glad escarp
#

https://blueprintue.com/blueprint/wm2-e7r8/

Alright so this is what is confusing. The top one works but the bottom doesn't. In the top, it just spawns whatever actor I pass.

In the bottom, it needs a specific actor so I can expose a variable and pass it. This variable has all the info for the weapon such as the meshes (going to be used for weapon customization if/when I can get this to work) and it sets the meshes in it's construction scrip. The Currently Held Object variable is replicated with an rep notify. In the rep notify it attaches the spawned item to the first or third person meshes depending on if it's remote or local.

Any ideas why the bottom one isn't working?

fathom aspen
#

I'm still determined to give a try in a few weeks (after I knew how to make it work in binary versions πŸ˜„ )

magic helm
#

I have a suspicion that it's running on the wrong machine(simulated proxy) so it literally cannot make server RPC's

glad escarp
glad escarp
fathom aspen
#

Not really. Pawn can be simulated too

#

That's not Controller

magic helm
#

Yeah, simulated means there's no controller for this pawn on this machine, so it can't run RPC's without a controller

glad escarp
magic helm
#

Might be your running the top one on the autonomous proxy so it's working fine, you can run a "Is locally controlled" check or get the actor's local role

glad escarp
fathom aspen
#

I didn't look into the code, sorry, but also doesn't have to be from the PC

fathom aspen
#

IsLocallyControlled is a really handy method that ends up being an oversight for most peeps

magic helm
#

Even on your own machine you are a proxy for what the server has but you are autonomous because your a human on the computer, so your player on your friend's machine is simulating your proxy

#

Language is fun

glad escarp
magic helm
#

So it may be the thing where equipping an weapon is getting called on the wrong machine

#

So you can print out the local role of the actor(which is how you know if it's simulated/autonomous/authority) to debug it

#

Also as a heads up owning client is autonomous proxy

glad escarp
#

ok. Very interesting. I'm gonna try to absorb this little master class you've just given. πŸ˜‰ Much appreciated! So no by running IsLocallyControlled and pulling from the true branch, it's working fine.

quasi tide
#

Is Iris even getting commits?

#

All I know about Iris is what Epic claims - a new networking thing that is supposed to improve how many actors we can replicate

fathom aspen
#

Considering @pallid mesa isn't talking about it here, seems like the answer is no

quasi tide
#

But world partition is still a roll of the 🎲. So we'll see how it turns out in 2028.

#

And WP was supposed to be a big feature for UE5

magic helm
#

I'm in the camp where UE5 needed more time in the oven...

quasi tide
#

Eh - it's been largely fine for me honestly. I mostly don't use the new stuff though πŸ˜…

#

Right now, the biggest benefit to using UE5 is using UE5Coro πŸ˜…

fathom aspen
fathom aspen
magic helm
quasi tide
fathom aspen
#

I see too many 🎢

dark edge
#

It doesn't exist any more

#

so it doesn't have a class to get

#

Break your function up, it's not obvious that spawning an item should destroy the item you currently hold

glad escarp
dark edge
glad escarp
dark edge
dark edge
#

This is how this part should be

glad escarp
dark edge
#

The only thing that passing it from client does for you is to allow one client to tell the server to destroy literally any actor in the game

glad escarp
#

ah. Hmmm. So since the Currently Held Object is set in the server rpc after it spawns, destroying it on the server will be fine. Got it. I'll try it out when I get home.

dark edge
glad escarp
dark edge
#

That'll get you most of the way there

glad escarp
dark edge
#

Transient stuff like animation is where you start thinking about multicasting

#

You'd multicast an animation

#

you would NOT multicast picking something up

#

because after a little while, it doesn't matter if the animation played or not, but it DOES matter that the thing you picked up is still picked up

#

transient vs stateful

glad escarp
glad escarp
dark edge
#

that's when it really gets hard

glad escarp
dark edge
#

making a tight shooter with prediction is not trivial

glad escarp
hollow bridge
#

There's something I don't understand with dedicated servers, if I have an open world with ~70 players + AIs, the server has to compute all their Physics/SkeletalMesh/Movements in the same thread (game thread) at 60+ times/second?

kindred widget
# hollow bridge There's something I don't understand with dedicated servers, if I have an open w...

Yes/No. It depends on your technical requirements. You can make a game where the client simulates a lot of stuff in between while the server is only ticking at 10-20 fps. A lot of the heavier stuff is not used on Dedicated. Animations are off by default, they don't run a render thread so no materials and such. The server only needs a general approximation. A lot of tiny details really aren't important to gameplay code as much as they are to make a player 'feel' like the world is more alive. You don't need to have AI running that aren't near a player, etc.

hollow bridge
dark edge
#

I mean it could be

#

but in general, tons of players is HARD

grim pumice
#

For local multiplayer, how would I go about detecting the amount of connected gamepads to spawn the right amount of PlayerControllers?

rose torrent
#

Hello, the variables are not replicated to new joined players? by session subsystem?

magic furnace
#

why does the client have authority when I test in editor?

#

I swear it should be remote

verbal tendon
#

Play as Standalone, Play as ListenServer, Actor is spawned from the client

magic furnace
#

play as client

#

actor spawned by gamemode

#

possessed by player

woven basin
magic furnace
#

so it was messing with me, as I was using the remote pin

#

and it didn't work

#

debugging

verbal tendon
#

So

#

This is why it's always important to provide context

#

Most likely the actor is not actually owned by the player

#

Which is why the code is actually executing on the server, which has authority

#

A print string would've revealed that

magic furnace
#

might be

#

gonna check

#

thx for the help, now I know what I have to look for

verbal tendon
#

πŸ‘

#

Since presumably you're doing custom stuff, spawning an actor and manually possessing it

#

you also need to set the owner and you'll be golden

#

always debug first using print strings, or logging from C++

thin stratus
#

In the MainMenu at least

#

And then have players press a button to "join" the game

#

A Gamepad can be connected, yet the players might not want to use it

magic furnace
lament garnet
#

has anyone implemented saving system for streaming levels?

#

i have a situation where i save an actor location on the server when the streaming level unload and the location is loaded back in when the level is loaded

#

everything works fine on the server but the location is not updated on the client

grim pumice
thin stratus
#

Yeah and that's theoretically fine

#

It's been a long while since I worked on a local coop game

#

But back then I didn't know how else to solve it

#

Specifically since I wanted input from the Gamepads

#

So I needed the PCs to exist

#

Later on I marked them as "This PC actually is actively being played." with some boolean.

#

And then did further stuff with that

#

I think I destroyed the ones that weren't marked as active before traveling to the actual gameplay

#

Just so the automatic Pawn spawning of the GameMode didn't bite me

#

But it's been surely 3+ years. So I can only vaguely give you an idea of what you could try

grim pumice
#

Agreed, there is likely something a little more streamlined, but for now your approach will do for me.

thin stratus
#

Maybe yeah :< but not a lot of peeps do local coop sadly

#

At least not this specific setup

#

Or at least no one freaking talks about it

grim pumice
grim pumice
thin stratus
#

Not sure if Mario and Rabbits was UE or something like that

#

Although that might have been snowdrop

grim pumice
#

The Canadian branch (Next Level Games) maybe?

#

Yoshi’s Crafted World apparently.

glad escarp
#

Hey folks. So if I wanted an actor that just exists in the map to be able to call a a server RPC, to spawn things for instance (let's think mob spawner in a multiplayer game), how can I do that? I'm still learning but server RPC's can only be called by the owning client right?

chrome bay
#

If it's a mob spawner then you shouldn't really need a Server RPC at all. The clients wouldn't be requesting anything, the spawner logic would just run server-side anyway

#

You use RPC's when a client wants to ask the server to do something, or vice-versa

glad escarp
chrome bay
#

If the actor is part of a level, the functions will run on all instances.

#

If the actor is replicated, then you can use the HasAuthority() check to guard against clients doing things

#

If it's NOT replicated, you could/would guard using IsNetMode(NM_Client)

#

latter is probably better in both cases IMO

glad escarp
#

Hmmm.. Ok. Thank you for answering. I need to do more research

chrome bay
#

Essentially what I'm saying is there's no inherent mechanism to stop code running in any network domain

lament garnet
#

so i dont understand whats going on, i have to try ask again.. im setting an actor transform on the server from a save that is stored on the server. why on the client the actor location is not replicated? if i use a literal transform it works fine

chrome bay
#

A client could call the body of a Server RPC if it really wanted to

chrome bay
lament garnet
#

yeah it is a character

chrome bay
#

Who owns the character? A player?

lament garnet
#

server

chrome bay
#

And are you also sure that the client isn't also loading + applying that transform?

#

If so, they may override whatever the server is setting locally

glad escarp
chrome bay
#

You just need to decide when and where to call that code

lament garnet
glad escarp
lament garnet
#

yeah it doesnt mean 100% that is not being overrided but yeah. all of this is running on the server..ill check once again tho

magic furnace
verbal tendon
#

There's an easy way to handle those with subsystems, because you can very explicitly state the dependences and avoid race conditions, for game initialization

#

Ofc there's a gazillion other ways, happy that you found and fixed it

lament garnet
chrome bay
#

ffs πŸ˜„

#

I've been trying to find your "use of templates" graph meme/pic for a while

#

Now realising I could have just MSpainted it

glad escarp
#

Specifically in this case, I'm spawning keyfobs that each have their own unique password. The password displays on a widget component on the fob. This works fine for the server player but not for any of the clients as stated before. I'm not sure how to ensure that these passwords are passed to the spawned items. The variable being passed is replicated.

#

And I have tried OnRepNotify to manually set the fob's password value when I generate the random number and set it as the replicated password variable.

#

Nevermind. Solved it. The variable on the fob that stores the password was not replicated and now it is and is working.

near granite
#

pawn's location and movements also can be automatically replicated like character if replicate options is checked?

weary badge
#

Hey everyone, I'm still stuck at my old issue,
I used onswap controller and got a reference to all the player controllers. I also spawned characters on the level.
When I try to let the client possess a character, it does not work.
If the very same code has a delay node, it works and the client possesses the character. Does anyone know why that is please.

lament garnet
#

whats not working exactly?

blazing spruce
#

Hi, im having an issue with sessions.. from what i can tell if you have a session created you cant then find sessions as it'll just fail, but im using advanced sessions so if i have a session created and then use the find advanced sessions node the On Success pin gets fired but it wont actually find any results, so can you not find sessions at all while currently hosting one?

#

the reason i ask is because im trying to make a party system, most games have it so on the main menu you can invite friends then you can find a game / host a private session, but to have a party you would need to create a session to invite friends in, but then im unable to find sessions to join a game? i can host a private one by using the UpdateSession node and moving all players to the pre lobby level but if i wanted to invite friends while im on the main menu and then find us a game that im not the host of, im unable to find sessions whilst hosting a session lol so how am i supposed to be able to find games with a party of friends?

near granite
#

how to get the other computer's pawn location to my pawn when using same pawn class in all clients?

dark edge
weary badge
#

@lament garnet the client's possession of a character

#

Sorry for being late. Had to leave the house

lament garnet
weary badge
#

yh

#

i can show you what i did

#

i think it would be better to stream it tbh. Because i changed the original code, checking , if it solved the issue

#

but results stayed the same

lament garnet
weary badge
#

im trying to possess character pawns. it always works with the host, but it only works with the client, if i use a delay node at the beginning of the event. otherwise the client wont possess it

lament garnet
#

where are you trying to possess it

#

what event

weary badge
#

inside the game mode

dark edge
#

Show your code

weary badge
#

im grabing the player controller variable i got from the onswapcontroller and using the possess node to possess the pawn

#

that pc ready stuff is there, because the delay made me think, that something wasnt ready yet. and i tried to make sure that everything was ready

cosmic yoke
#

hello i have a dedicated server running on Linux and when i connect to it with a client through the editor on Windows with the same codebase i get:

LogNet: Error: Server is incompatible with the local version of the game: RemoteNetworkVersion=2689847860, RemoteNetworkFeatures=LegacyReplication vs LocalNetworkVersion=3278373821, LocalNetworkFeatures=LegacyReplication
LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = OutdatedClient, ErrorString = The match you are trying to join is running an incompatible version of the game. Please try upgrading your game version., Driver = PendingNetDriver IpNetDriver_2

#

am i missing anything, or its giving different network version because the client and server are running on different platforms?

#

the last one doesn't make much sense, because that would be too troublesome

verbal tendon
cosmic yoke
#

@verbal tendon i assume with the net.IgnoreNetworkChecksumMismatch=1

verbal tendon
#

Different platforms give different checksums. Implement your own version checking. Tie it in with CI/CD version history, debug symbol files, yadidadida

magic furnace
#

I have a bit of an odd issue and don't know where to look. I am setting a charge value for an AnimBP to use. I tried setting it on client, on server, didn't matter. The value gets set, but my AnimBP doesn't work on server. On the Client it works no issue. On the Server it doesn't update at all, even though the value is set in the AnimBP. Play in Editor as Listen Server. The Player (host) does not see the animation update. No other clients.

dark edge
magic furnace
# dark edge Show how you're setting that variable.

Does it matter tho when the variable is set and shown in a print? It is set on the Actor currently, using a get anim instance and cast. Tried running that code on client and on server. The variable is set.

dark edge
#

Have anim instance fetch it

magic furnace
#

Tried that too

#

and tried setting the variable it's fetching

#

as replicated

#

as datura suggested

dark edge
#

have anim instance print it in the logic graph, does it print correctly?

magic furnace
#

let me launch up unreal again

#

as I was heading to sleep

dark edge
#

Show the whole chain of logic from where you initially set it to the anim instance

magic furnace
#

If I can get it fixed, absolutely worth getting less sleep haha

magic furnace
#

Gets called in a gameplay ability

#

Runs this event with no replication set, just default custom even and does this. (Tried running it on client and server as well before)

#

and also tried this approach with removing the set from here ^

#

and moving it here

dark edge
#

This is the first mention you've made of using a gameplay ability for this. Gameplay abilities change things up quite a bit.

dark edge
#

I don't know a ton about gas but I'm fairly certain you shouldn't be calling run on server events inside of abilities. That's the whole point of abilities is that they kind of self-manage and predict

#

If you are using gas I would think the charge should be a attribute, especially if lots of things can charge up

magic furnace
#

it's just a visual representation and it's a bow charging

dark edge
#

So if you print that float on update animation, is it synced up? You going to find out if the problem lies in the float on the actor not being synced, the float not being received by the anim instance, or the float not being applied in the animation graph. Just start printing it

magic furnace
#

well for now it's really late and I'm going to sleep, thank you for your help, I'll check everything tomorrow

glad escarp
#

Guys. Quick question: For accurate testing of a listen server model, I have my net mode set to Play As Listen Server but I get different results/issues when running in Standalone vs New Editor Window (PIE). Which one should I be testing in for accurate results?

fathom aspen
#

Standalone, because PIE is just basically same process by default

#

Though I'm not saying just go standalone-only. I still adore PIE and use it when I can

glad escarp
fathom aspen
#

Yeah, but well you have -log windows

#

And you could also come up with your own solution to that, but never that I cared

glad escarp
#

I know how to make a batch file to run a build of the game standalone with a log window but I don't see a setting in the editor to open log windows for my standalone windows

fathom aspen
#

There could probably be a setting in editor to make that appear, but I usually do it from commandlet

glad escarp
#

roger. Thanks.

magic furnace
slender mortar
#

Hi, is it possible to create a session/lobby without changing a map? πŸ€”

versed elbow
#

Greetings i hope you are all well. am on lecture 21 "call backs to our subsystem functions"

void UMenu::OnCreateSession ( bool bWasSuccessful )
    {
    if  ( bWasSuccessful )
        {
        GEngine -> AddOnScreenDebugMessage
            (
            -1,
            15.f,
            FColor:: Red,
            FString (  TEXT ( "Session created Successfully" ) )    // this is successful
            );
        UWorld * World = GetWorld();
        if  ( World )
            {
            World -> ServerTravel ( "Game/ThirdPerson/Maps/Lobby?listen");  // !!!! but this doesnt happen.
            }
        }
    else
        {
        if  ( GEngine )
            {
            GEngine -> AddOnScreenDebugMessage
                (
                -1,15.f, FColor::Red ,
                FString ( TEXT ( " Failed to create session"))
                );
            }
        }
    
    }

i can successfully create the session after clicking host.

problem.

the problem is the game doesn't seem to be teleporting me to the lobby after i click the "HOST" button.

verbal tendon
#

Expose the level as a DeveloperSetting that you can read from in C++

#

I would also recommend using UE_LOG rather than screen messages, that way you look for your own and other errors in the log rather than looking on the screen

versed elbow
#

am following and udemy coarse . i apreciate your input either way . very much . i hope you have a good day . i have moved the server travel to when i click a button on the ui . that seems to work . no issure or crahes

fierce fiber
#

Hello! I am trying to create a local multiplayer game but having some problems with player interaction, for some reason, the enable and disable input wont work, which causes my interact input to not read, was wondering if anyone would know what I'm doing wrong? Thanks :D

#

Im essentially trying to enable the input of a interact actor blueprint so that I can use my interact action input, I've tested the BP and it definitely reads the entire line for both begin and end overlap, but when I press E, the interact node isn't registered (just some more details just incase :D)

hybrid crown
#

Just architecture and replication question :
If i got a struct with inside 2 FText, and One Bool (UPROPERTY)

This struct is stored into a TArray<MyStruct> replicated.
What happen when i change a bool ? Replication work correctly ? is it the whole struct who is send, or only the bool ? is it better to have two TArray, one for the two text wrapped into a struct, and one for the bool and replicate only the bool as only the bool is interessing for replication, with the same index ?

fathom aspen
#

Only the bool is sent/replicated

#

The latter question is design-specific

#

If they relate to one another, then yes it's a good practice

#

If you want them to replicate together then look into atomic replication (pinned messages)

digital knoll
#

Hello, I have a problem with widget in multiplayer, I have custom variable energy and for debugging when I press M it subtracts energy by 5 points, but I can't get widget working, when I debug it with print string it showing correctly, but the widget doesn't change the value, can anybody help? I'm don't know what am I doing wrong.

twilit radish
#

My guess would be that it only updates on the server and not the actual client. Your "Energy" variable is not a replicated property and "updateEnergy" only executes on the server. But I might be wrong.

digital knoll
#

I changed it and now when client press M it's subtracting correctly for client but also for server but just in widget, but when server press M the widget doesn't do anything

twilit radish
#

Where do you call "GetEnergyText"?

digital knoll
#

It's binded function

#

(FIXED IT)

twilit radish
#

Can you make sure that the Energy variable doesn't have some weird condition for replicating?

hybrid crown
twilit radish
#

You can't mark a struct as "replicated" inside the constructor, only actors have that ability (and components? Don't remember exactly how components work lol).

#

You simply mark a certain variable that holds your struct as replicated with a uproperty but in the end it's the actor that is networked and passes on that struct πŸ™‚

hybrid crown
#

(i mean, i don't think we can't call them in get replicated override so...)

twilit radish
#

If you don't have a custom net serializer you need to mark inside your struct all variables with a UPROPERTY() but not replicated. But in the actor you would however do that.

UPROPERTY(Replicated)
FMyStruct ReplicatedVariable;
hybrid crown
#

Yup, thanks !

limber gyro
#

is there a way to get the playerstate from UPlayer?

sinful tree
cosmic yoke
#

hello is there a way for a client to access the options from the game mode? Since the game mode is not replicated to clients i'm thinking like game state, or something like that

limber gyro
cosmic yoke
#

but i was asking if it's built-in

#

or i need to do it myself

limber gyro
#

as far as i know u need to do it urself

#

unless those options are static

#

which i assume is not what u want

cosmic yoke
#

what do you mean?

limber gyro
#

well if those options dont change u can just put them on the gameinstance and you can have a copy both in the server and in the clients

#

altough with no comunication

cosmic yoke
#

but those options are only stored in the game mode when you call the map when creating the server

#

so there would need to have some communication between server and client

woeful ferry
#

Hey,

I have a issue where I have a component with a replicated array of vectors that doesn't get replicated to the new client, until I add a entry to the array on the server.

#

Any clues?

sinful tree
cosmic yoke
#

@sinful tree i'm doing variable replication right now, just wandering if that information was automatically replicated

#

thanks for the help πŸ™‚

weary badge
#

Hello everyone, I'm still sitting on the possession problem.
The first image will be the code and result with delay.
The second will be without delay.

#

Does anyone know what could be causing that problem?
I don't believe that putting a delay there is a proper solution.

lament garnet
#

you spawn characters in advance?

weary badge
#

characters are spawned on begin play

#

all characters were found when doing the print as shown in the image

lament garnet
#

what about the player controllers?

weary badge
#

also found as shown on the image

lament garnet
#

if this is the game mode you are only display what the server see

#

maybe at that point the client does not have yet the characters spawned on the server

weary badge
#

alright ill try something with that information

#

thank you

lament garnet
#

of course delay is not the proper way to go, if thats the issue you have to find the correct event to use

blazing spruce
#

Hi, is it possible to find sessions whilst having a session already created?

lament garnet
#

yes

blazing spruce
# lament garnet yes

are you sure? ive got it so that it creates a session as soon as the main menu is loaded, then if i try to find sessions the find sessions node will fire the on failure pin every time

#

but if i dont have a session created, it'll find them just fine

limber gyro
#

any 1 has any idea why this line "AProjectArenaPlayerState* myPlayerState = Cast<AProjectArenaPlayerState>(NewPlayer->PlayerController->PlayerState);" would crash in the login function of the gamemode?

lament garnet
blazing spruce
lament garnet
#

it works with the normal sessions too

#

nothing special, just destroy the session before joining

#

but find works fine

blazing spruce
#

So im trying to make a party system, main menu loads, creates session, then you can invite friends

#

if i destroy session before finding sessions, wont it kick all friends?

sinful tree
limber gyro
#

i just wanted to be sure

#

should i be parsing options in the login or postlogin? login has an option argument but the game mode has a "optionString" variable, so i am quite confused on wheres the best palace

#

is the options argumente in "login" even the same as "optionsString"?

lament garnet
blazing spruce
#

so far im not having much luck tho πŸ˜…

limber gyro
#

does the gamemode wait for postlogin to resolve before accepting a new connection or are Login and PostLogin async?

#

does ue4 accept player connections async at all?

twilit radish
#

The packets are handled async, the logic is handled sync but that should be so fast that you'll probably never notice. Imagine if Fortnite had to wait on every player joining their game haha. Be prepared to spend hours waiting on a match to start if that was the case :D

limber gyro
twilit radish
#

If you have one single variable for a specific player, then absolutely not. There's time in between it.

limber gyro
#

i have a steamID

#

ok so, whats the best way to handle this

#

should i do the optionstring processing in the postlogin?

#

it seems a bit odd since they give you that as an argument in the login function

twilit radish
#

What do you want to do?

limber gyro
#

i want to get the players steam ID

#

which i pass as an argument

#

and then i use that ID to make some calls like inventory

#

and seting up teams

#

and im not exactly sure if login is the best place to get it, even tho it seems like it

#

why would "login" even have options as an argument if things werent ment to be parsed there?

#

the thing is, PostLogin doesnt have the player options

#

so i am a bit confused as how to pass that information from Login to PostLogin

twilit radish
#

Hmm.. It kind of depends I guess. And I'm not entirely sure, the docs seem to say you shouldn't use any game logic in "Login" because not everything is initialized yet, but I don't actually know if that means whether or not you should use it to initialize your own stuff yet (has the client passed all necessary login processes for example yet?) but I feel like it makes no sense to not keep those options around longer than just the very login process. Looking at if I can find anything.

limber gyro
#

my issue is passing the information, since u told me that things can change in between those calls

twilit radish
#

With knowing now that you meant the actual player given values then no. I thought you meant keep track of your own global variable and hope no two players join at the same time.

#

It would be very odd if a value has been set like the player ID or whatever and it suddenly changes out of no where πŸ˜›

#

Assuming it does exist at that point though.

limber gyro
#

well its not out of nowhere, my concern if for example, player 1 and 2 connect at the same time or try to connect, function login is called for player 1 and sets the variable then player 2 connects and overwrites that variable, by the time player 1 is getting to postLogin the variable has the value of player 2

#

is this not an issue?

twilit radish
#

Not sure. The docs say "shortly afterward" is when PostLogin gets called.. But that could be seconds or directly afterwards :/

The player controller is not fully initialized within this function as far as networking is concerned. Save "game logic" for PostLogin which is called shortly afterward.

limber gyro
#

😭

#

i need to know this fml

#

weird this info isnt anywhere

twilit radish
#

Welcome to the wonderful world of the lack of Unreal documentation πŸ™‚

#

Are you using C++?

limber gyro
#

ye

twilit radish
#

Ok then you can retrieve the URL parameters from the player controller I think.

#

APlayerController has the method UNetConnection* GetNetConnection() and UNetConnection has a public variable FURL URL which seems like it has the parameters.

limber gyro
#

i was actualy searching for that but didnt find anything

#

i will give it a shot

twilit radish
#

Yoo @fathom aspen you should add this to your persistent data compendium. Makes absolutely no sense why this isn't written down any where xD (As in "persisting data" between client -> server travel and retrieving it).

limber gyro
#

it might be "RequestURL" instead of URL no?

twilit radish
#
public:
  struct FURL URL; // URL of the other side.
```pretty sure no.
near granite
#

Is it okay to continue to working in editor during packaging the project server or editor?

limber gyro
twilit radish
rose pollen
#

I am trying to do line traces for a melee attack on the server in multiplayer, the players sword is set to replicates, replicate movement, and it replicates when i run around with it (can see the debug traces moving) but it doesn't move on the server when i swing it via an animation, only the client side traces work then, how do i make the server consider the movement of the swing animation for line traces, the sword itself visually swings for all players so players can see each other swing, but when the server does a line trace it does it as though the sword was just being held stationary. I am using sockets on the weapon to get the position for line traces

twilit radish
limber gyro
#

ye i will

#

gotta compile first tho

#

i will let u know if it works

twilit radish
#

The URL that the client sends to the server yeah.

fathom aspen
#

πŸ˜›

#

As in the UNetConnection.URL it's not, but the idea is there ^^

twilit radish
#

Yes but no.

#

Your version is client side, that's exactly why I couldn't find it.

#

In this case we want to know on the server where to find the already send URL from a client in PostLogin πŸ˜„

rose pollen
dark edge
rose pollen
fathom aspen
#

Thanks for the insights/suggestion!

twilit radish
#

No problem πŸ™‚

rose pollen
limber gyro
#

@twilit radish im not getting the full thing for some reason

#

76561198006820266/Game/FirstPerson/Maps/Play/harbor/AR-Harbor

#

thats what i get from

#

NewPlayer->GetNetConnection()->URL.ToString()

#

its missing my options unfortunately

#

URL has a options field so it might be there

twilit radish
#

Those first numbers are a Steam ID.

limber gyro
#

ye but they are from the server

#

i tested with the one you said that wasnt

#

NewPlayer->GetNetConnection()->RequestURL;

#

this one actualy works

#

has the full request

twilit radish
#

Weird comment next to "URL" then lol. But good to know that's the one.

limber gyro
#

its not in the same format as the options string tho

#

no nvm

twilit radish
#

"format"?

limber gyro
#

i didnt test it properly

#

im gonna do 1 test and if this works i will post a code snipet

#

of how to get the thing

#

ye now i just need to figure out the best way to get that ID out of there

#

im trying to do "if (UGameplayStatics::HasOption(NewPlayer->GetNetConnection()->RequestURL, FString("SteamID")))"

#

thats why i was talking about the formating, the options must be formated differently thats why u can get them using that function

shadow aurora
#

What is the best way for me to get the info of what gamemode is active on the client? Got a few different gamemodes, and want to be able to toggle UI element visibility based on which one is being used.

twilit radish
#

Alright now I'm confused xD
Are you asking whether the server wants to know what gamemode is active on the client? If so not. The gamemode only exists on the server. If you're asking for the server to let the client know then I would just have a replicated property set to "initial only" in the game state which you can then use an on rep for to see when it arrives.

rose torrent
#

does APawn::OnRep_PlayerStates doesnt executes on server?

sinful tree
#

OnReps typically don't in C++

limber gyro
gritty phoenix
#

is there a console command or hotkey to add another player to a listen server in PIE? basically to test out a player joining the game but not instantly

rose torrent
sinful tree
#

You can πŸ™‚

dark edge
gritty phoenix
dark edge
shadow aurora
rose pollen
dark edge
#

try that

gritty phoenix
dark edge
#

also look at single process etc

gritty phoenix
#

will do, thanks !

rose pollen
#

thank you, I had it on always tick pose

pallid mesa
#

A new button will appear to add clients right next to the play button after you start a listen or dedicated server PIE session

#

Also @dark edge in case you didn't know, it's pretty handful

pallid mesa
rose pollen
pallid mesa
#

Montages got a specific optimization setting that allows only to tick bones when a montage is playing

#

rather than all the time @rose pollen

#

ticking bones is quite expensive

rose pollen
#

that makes sense and is very helpful, is that something I have to enable somewhere, or will just switching the attacks all to montages take care of it on its own?

pallid mesa
#

you have to tweak again the variable you changed in the mesh component

rose pollen
pallid mesa
#

you have anim montage tasks in GAS that you can use to play animations predictively @rose pollen

gritty lantern
#

I've got a game where players have the ability to pick up an object in the world and carry it around. What's the best way to have a server resolve the situation where two players try to pick up the same object at the same time?

sinful tree
quasi tide
#

I say transport them to a colosseum and let them fight to the death.

pallid mesa
#

even if its simultaneous, events happen sequentially in the server so there'll be always a loser

gritty lantern
#

Hrm. Right, so the player requests a pickup and it runs on the server, and that way the server controls the order in which everything occurs and can mark a particular object as unpickupable which prevents any subsequent requests

quasi tide
#

Pretty much yeah - it's incredibly common in games and gamers understand at this point.

gritty lantern
#

cool, thanks!

dark edge
#

I would never try to predict picking something up, that's a slow enough action that letting the server confirm it is probably the best course of action

dusky yoke
#

Hey guys, trying to make my players respawn if they die. What should I input into RestartPlayer's "NewPlayer"?

Edit: If I call the OnPostLogin event in GameMode, I set the NewPlayer variable and I reference that in the controller as the NewPlayer variable, the clients restart fine, but not the host.

gritty phoenix
graceful flame
#

You can dispatch an event from the character and bind to it on the player controller, or just reference the player controller and call the server event directly from your character, either or works as long as you're spawning and possessing characters on the server.

winged badger
#

server knows if a player died, there is no need to send any RPCs in order to respawn them, unless you're waiting for PlayerInput to trigger it

#

also, PostLogin is a terrible hook to trigger respawns, what you want is RestartPlayer

dusky yoke
#

Hmm thanks guys @graceful flame and @winged badger - I ended up doing a Restart Game instead, but I rather want the ability to make it so it only restarts or quits the game if all players in the session has died. What would be the best way to achieve such a functionality?

dusky yoke
graceful flame
dusky yoke
#

AnyDamage is replicated aswell right? In my usecase Im calling an event when the health is 0 πŸ€”

sinful tree
#

And if apply damage value is set as 0, it doesn't execute at all.

dusky yoke
#

Ahhh, gotcha! Well in my case the variable was replicated, so I guess thats why it was working πŸ˜…

jaunty panther
#

Can someone help me set up a launch character? it currently isnt working on clientside

dark edge
cerulean lintel
#

Hey there guys, quick question. Do I need to use Advanced Sessions plugin in order to be able to send invite codes for friends to join an open session? (Open because it’s a team deathmatch and may require more people to fill teams)

fluid summit
#

Hi! has anyone published a game on epic store while using match marking from advanced session of steam?
Has anyone tried epic networking solution for matchmarking?

quasi tide
valid bough
#

idk how to really ask this, but im trying to update the other player that gets hit by a projectile. What weird is i followed the tutorial and the UI 1. isnt consistently updating(only updating at 0hp) and 2. its updating its owner, not the other actor which i have recasted to. I dont understand what im doing wrong

hollow bridge
#

Does UE know to ignore my calls to spawn sound/particle when in dedicated server or should I do it myself?

meager raptor
#

Hi everyone, I would like to add a minimap in our multiplayer game where net cull is enabled. I was thinking about the architecture of it and only saw a possibility to use either game mode or game state to get all players location (server side) and send that data to each client. Would it be the the right way to get everybody's location ?

ocean mortar
#

Morning yall. Im purdy new to the UE scene so do forgive me if my question seems dumb. Im currently working on a mobile game that will take the numerical values that the player has in its attributes and applies it in an automatic fighting scenario against another players character. The outcome of the fight is weighed on 6 different stats that will take in account of how well a character will fight. Is there any current plug in or blueprints that would help with this task? If it makes it easier the game is designed in a 2.5D setting.

kindred widget
meager raptor
kindred widget
#

Probably better to just make the call. Adding extra netcode checks in your BP code will just start making things messy.

And Authority is not the same as a dedicated server check. If you release a game that can run both locally as a ListenServer, but also run on a Dedicated server, you'll end up with issues where the Listenserver won't play particles or have sounds.

#

Would also actually break any singleplayer code as well.

vagrant grail
#

Why this code doesn't print "Hello" ?

shy gust
#

Also hello everyone I curious if anyone had any insight/proper vidoes on steam networking for unreal? or an equivalent for unreal. I used steam over on Unity because it was "free" but im not sure if unreal engine has a "free" server of some kind to work with

twilit radish
fathom aspen
# fathom aspen

I should have talked about that a client RPC is not dropped but instead runs on the server, thanks me!

twilit radish
#

Also I don’t see why the gamestate or similar should send that data. If you have a player running around in your game for example that should already exist on the client πŸ˜„

shy gust
meager raptor
#

the other players are culled by network

twilit radish
meager raptor
#

so one player doesn't have all players location

twilit radish
#

So you want all players to show up on the minimap while not being at all times visible on the client?

meager raptor
#

yes

shy gust
meager raptor
#

currently the net cull works well

twilit radish
#

Then I would just use the game state yeah. Set for example a timer in there that every so often loops through all players and updates their location and any other information needed in a replicated variable πŸ™‚

meager raptor
#

thanks !

rose torrent
fathom aspen
#

It's still a very WIP, so I don't want to mislead at this point.

twilit radish
#

I thought it was Vori's post at first, but nope xD

fathom aspen
#

I will make an announcement on Twitter when it gets published

fathom aspen
pallid mesa
#

lmao

fathom aspen
#

That should tell you how monolithic cool MP is

twilit radish
#

Multiplayer is cool. But hear me out. It takes way too much time lol.

limber gyro
#

@twilit radish yesterday i actualy ended up getting the options like this

#
    FString left, right;
    rawOptions.Split(TEXT("?"), &left, &right);
        
    FString options = FString("?");
    options.Append(right);```
#

@fathom aspen had interest in this too i belive?

twilit radish
#

I still can't imagine there not being some kind of URL parser within Unreal though.

limber gyro
#

but as long as it works right...

fathom aspen
#

Okay I'm convinced. Just make it an addon for 🎡

twilit radish
#

Ever worked with Instanced Static Meshes? πŸ˜›

limber gyro
#

i never did quite understand if variables can change betwen login and postlogin tho, does any 1 know? like if 2 players connect at the same time?

shy gust
#

Im reading some info about the extent of steams servers with UE and they say you cant connect players between regions? in the case of the US is it East, central and west? in Unity you could connect to anyone in the US but i never tested with anyone beyond that , just making sure its not different for Unreal games for whatever reason,

fathom aspen
limber gyro
#

i think yes, thats the URL

twilit radish
limber gyro
#

something like "1.1.1.1/mapname?option=2000

fathom aspen
#

And it's done on server I assume?

limber gyro
#

its on the game mode

fathom aspen
#

Yeah cool. I wanted to look my way through that a while ago, but probably just forgot to do it

twilit radish
#

But Wizard, can we talk about it being a stupid FString though xD

limber gyro
#

it leads me to belive u should get options in the login

fathom aspen
#

Ah you're talking about the FString itself

#

I thought the Split thingy

#

@twilit radish Why is it stupid?

twilit radish
#

Why is it not a FURL?

#

It's literally a FURL as a FString, why not just parse it to FURL and make everyone's life a million times easier xD

fathom aspen
#

I literally just noticed that it's an FString and not an FURL

twilit radish
#

RIGHT?

#

πŸ˜‚

fathom aspen
#

lol

#

RIP Epic if that was an oversight

twilit radish
#

Although I do suspect one of the FURL constructors can be used to parse it, but I was too lazy to look further at it lol.

limber gyro
#

the URL var only gives the connection string without the options, it does have an options array tho

fathom aspen
#

What's the deal with TUniquePtr? Seen that a couple of times.

#

Good to hear that it was fixed at least

#

Other things were not

thin stratus
#

I'm trying to set up the CMC to allow Characters to be moved "Inside of each other" but not automatically get "Pushed away from each other".
But if they walk outside of each other's collision I still want to to block if they try to move towards each other again.

#

Wondering if anyone has done that for their Game before, cause I doubt I will find someone outside #multiplayer to have touched the CMC

twilit radish
#

So you want to teleport them inside each other or something and then when they move away not be able to go inside each other again?

thin stratus
#

Yeah

#

Like, imagine you have a stationary enemy and a player who dashes towards them.
The endlocation of the dash is exactly where the enemy is.

#

Default behavior is that the engine will resolve the collision or "Penetration" and push the two characters away from each other

#

I want them to be marked as "They can be inside of each other, but only until they moved away from each other, then it should go back to blocking"

#

First idea was to keep a list of Actors in the CMC or Character

#

And to skip ResolvePenetration if the Hit Actor is part of the Array

#

And then hoping that Overlap End Events still trigger

#

To remove the Actors from each others lists

#

Sort of like IgnoreWhileMoving works

#

But I fear that IgnoreWhileMoving, being called on a PrimitiveComponent, also stops any form of Overlap event, so I can't undo anymore on EndOverlap

twilit radish
#

Maybe a stupid question, but if it's a stationary enemy why can't the player stop in front of it instead of colliding with it / going inside of the collision?

#

I kind of assume that functionality already has to exist right? What would otherwise prevent you from going through a wall for example.

glass vector
#

how to check if you are the host in a listen server?

twilit radish
#

In C++ with the net mode. With BP.. Uhh.. Not sure.

glass vector
#

ie, I want a widget that shows you are the host

limber gyro
#

@thin stratus cant u turn collision on and off, apply a force until they arent colliding and then turn it back on?

#

i mean, its probably not the most elegant way to do it but im sure it can be done

#

if ignorewhilemoving can be triggered on hit, u could also do it on hit, store the actor u hit and then do a proximity check instead of using the event

fathom aspen
limber gyro
#

if the physics dont get triggered on hit aswell

thin stratus
#

@twilit radish @limber gyro I'm probably bad at explaining this. The Stationary Enemy was an example.
The whole thing is mainly about any form of ability that can cause Player Characters to be inside of each other (which is wanted).

#

Maybe some attack that pushes all Players in range to the same location

#

I want them to be inside of each other

#

And I want them, if they don't move away by hand, to stay inside of each other

#

Default behavior by UE is to force them away from each other

twilit radish
#

Then I'm not sure, sorry 😦
That definitely goes beyond me for now.

limber gyro
#

thats such a weird concept lol, i dont know man, i was just throwing out ideas, first i would mess around with collisions to see if i get good results, CMC seems kinda overkill and is a bit scary

thin stratus
#

Yeah I will try the ResolvePenetration functio nand override that

thin stratus
#

You can make 2 actors that have a blocking root component

#

They will be able to be inside of each other just fine

#

That's why the CMC is the logical thing to look at

#

And it's multiplayer, so movement and CMC is probably also the best matchup here

#

The concept might be weird, but I'm not the one designing this

#

I just have to implement it

limber gyro
#

CMC is way above my head

thin stratus
#

That's fair

#

But thanks for answering (:

limber gyro
#

only messed with it a bit and it didnt go so well haha, the resources out there for CMC are really lacking

#

well u should check if the overlap events trigger first with "ignoreWhileMoving" before digging into the hard stuff

#

who knows u might be lucky and they might trigger

thin stratus
#

Ah the CMC isn't too difficult for me

#

I've been dealing with that thing for a few years already

#

Mainly thought someone might have done that already (the collision shit)

limber gyro
#

you should do some tuts about the CMC if you have time, would really help the community, ur stuff is always very helpfull

#

also thanks for the stuff you put out, helped me a lot

thin stratus
#

Some peeps here, including me, were thinking about that already

#

Just have too many other things to do atm

#

There is some stuff in the works for extending it. LIke adding a sprint properly

#

Not by me though

twilit radish
#

By Epic?

thin stratus
#

Haha

twilit radish
#

Imagine revamping the entire network system but yet not making it easy to do one of the most crucial things in the existence of games 😦

thin stratus
#

Yop, they basically handle it as a "If you need it, you need to be good enough to figure it out yourself."

#

Real Life Skillcheck lol

twilit radish
#

Which is not the case for 99% of people lol.

thin stratus
#

Yeah well, they also kinda f'd up with the whole Blueprint thing in general

#

Epic: "Allows designers to turn on lamps by themselves!"

#

Random Dev from the Internet: "Cool, I'll build my whole multiplayer game with it."