#multiplayer

1 messages · Page 724 of 1

winged badger
#

the OSS will fire HandleSessionInviteAccepted

#

even if accepting invite makes steam start the game up

crystal crag
#

Oh nice

spark ivy
#

hey guys small problem, im new to this but you guys might know the answer pretty quick... in multiplayer mode Player one spins on a chair and player 1 can see the chair spinning.
But player 2 if watching ... only sees player one spinning and not the chair.

crystal crag
#

Ok, so that's a pretty solid solution then. That's great. I'll have to research that. I'm building my own UI to show friends and invite / join them.

#

I appreciate you steering me in the correct direction Zlo! That was really helpful.

spark ivy
#

Also same with the webbrowser... if player1 changes the website only player1 sees the webbrowser change. Player2 doesnt see any change

winged badger
#

        OnSessionUserInviteAcceptedDelegate = FOnSessionUserInviteAcceptedDelegate::CreateUObject(this, &USolsticeOnlineSubsystem::HandleSessionUserInviteAccepted);
    IOnlineSubsystem* OnlineSub = IOnlineSubsystem::Get();
    
    if (OnlineSub)
    {
        const IOnlineSessionPtr Sessions = OnlineSub->GetSessionInterface();
        if (Sessions.IsValid())
        {
            OnSessionUserInviteAcceptedHandle = Sessions->AddOnSessionUserInviteAcceptedDelegate_Handle(OnSessionUserInviteAcceptedDelegate);

crystal crag
#

Ok cool

#

I'll take a look at that signature and see what all I can get out of it

dark edge
#

Steam and EOS are both implmentations of OnlineSubsystems. That's what I was asking you, if you were trying to get a party working on the OnlineSubystem level or INSIDE a specific server.

dark edge
#

Your replication setup isn't set up right. Show how you're spinning the chair.

lean surge
#

Hey all, so I use a setup in PIE that is a listen server and a client. For some reason, though, when I hit play and the server and client pawns are instantiated (this happens through the game mode) the client instantiated pawn does not have its owning connection set. Output log is as follows (when trying to send an RPC to the server from a client pawn):

LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor BP_ThirdPersonCharacter_C_1. Function RPC_Server_UpdatePing will not be processed.

I've overriden some functions in my game mode class such as OnPostLogin, so am I supposed to be doing something there? Nothing internal (engine code or unet code) has been modified in the slightest, so does anyone have any knowledge of issues that could cause this?

spark ivy
dark edge
sick acorn
#

how to sync server and client ticks???

bitter oriole
sick acorn
# bitter oriole You can't

Yeah got it. Look, I have a train in the game and it moves on the client and on the server, but I don’t understand how to synchronize them, since the client is faster than the server by 1 tick, I wrote the math correctly

bitter oriole
sick acorn
sick acorn
bitter oriole
#

Synchronising objects between client and server is like, the entire multiplayer support. It's the problem. There's a different solution for every situation. For a train, since you likely have an idea of when it's going to start, or what its position should be, you'd simply define it based on the server time, and have your clients use that too. GameState has a basic version of a shared time

sick acorn
#

how will this help me

bitter oriole
#

Because you'll do train location = FVector(Speed * (CurrentSharedTime - TrainStartTime))

#

There, completely synchronised train

cyan drift
#

Hello, I'm attaching the characters to a moving platform, but to the clients the character keeps jittering a lot even with the platform not moving(it works fine if i don't emulate lag, but it is impossible not having lag). It starts jittering on the moment I attach the player. It don't happen if I uncheck the replicate movement. There's some way for it to work with replicate movement?

spark ivy
leaden atlas
#

that's not working for me

graceful flame
#

Finally solved it. It had to do with "Use Controller Desired Rotation" vs "Use Controller Rotation Pitch/Yaw". So much time wasted on this ughhhh....

leaden atlas
#

unpossess isn't called on client

dark edge
#

2 clients = 2 controllers

#

Client 2 should never be getting input meant for Client 1 unless there's something routing it to both, either on the OS level or the Unreal Editor level or something

#

Did it replicate with 2 launched instances or only in PIE?

graceful flame
#

Still having issues working on resolving other things to get 2 launched instances connected in a session, but so far fixed on PIE.

#

Can't find the session with a standalone launched instance, but can find and connect to it with standalone mode PIE.

#

For some reason both launched standalone instances have to recompile all shaders. So it basically stalls. I'll have to do a fully packaged build overnight and test it in the AM.

dark edge
#

Have you tried just right clicking the uproject file and hitting launch game?

graceful flame
#

ill give it a shot

#

I'm also on 5.1 direct from ue5-main so that might have something to do with it lol

#

yeah it still has to recompile all shaders when I right click the uproject file and go launch game.

loud steeple
#

i put this function of print just to see if it s working or not
and the print worked perfectly
Hello show up after 3 second when the all the players join
the exact problem it s when i try to Travel from a level to an other
and i think the problem came from the difference of the Unreal version
i m using Unreal Engine 5

winged badger
graceful flame
#

Hmm the logs indicate that there is no DDC.ddp file being generated anywhere.

regal geyser
#

Can I run event in PlayerController that is going to trigger only on the owning client? If I understand it correctly every client gets its own PlayerController, but does he also own it? I'm trying to call event from Server RPC to Owning Client RPC, but it's only triggered on Server (all from inside of PlayerController)

regal geyser
#

When I print get owner from inside character it prints his player controller, but when from inside of that player controller I call Owning Client RPC it isn't triggered..

loud steeple
#

are you making a transition ??

fathom aspen
latent heart
#

Unreliable you'd use for something like look direction which is updated constantly so it doesn't matter if it misses a few.

wicked brook
#

Does anyone know how to visualize the server position to see the difference in the server and proxy positions? I thought there was like a debug command or something but I cant remember and google not coming up with anything for me.

latent heart
#

Well, the server and client don't know each other's positions.

#

How would you visualise it?

#

Only thing you could do is visualise the on rep for the position on the client.

sharp pagoda
#

Hello everyone!

I'm having a bit of trouble with multicast RPC at the moment (UE5). The multicast function is getting called in server and the chain of ownership is correct too, as far as I can tell. However, that multicast function is only getting called at the server and is not being broadcasted to all the connected clients. What could I be doing wrong and where should I start looking?

For some context, what I'm trying to do is really basic. The function only sets variables in an ActorComponent.

shell forum
#

I had a similar problem and it was an ownership issue

sharp pagoda
#

OHHHHHHHHHHHHHHHHHHHH

#

Got it. Thanks! I think I'll review the networking compendium. 🙂

winged badger
#

you won't be able to see position on the other side, but you'll see debug capsules when server corrects the client position

lean surge
#

Hey all! I just implemented a lag compensation system for attacking in my project, and it's pretty normal, it saves the transforms of each pawn on the server in the last x seconds and then when someone wants to attack instead of just doing the attack logic it gets the location of each pawn not at the current time, but at the current time - the pawn's current ping and uses those locations in the attack logic instead of every pawn's current one.

This is all very standard, except I'm wondering; Is it sensible, when getting the locations of each pawn to account for ping, to not get the location that was current ping seconds ago, and to instead get the location that was (current ping * 2) seconds ago? This reasoning comes from how the server also takes time to replicate the pawns' positions to each client. Can anyone advise me for or against this idea?

P.S.: I tried to explain this as best as I can, except I still feel it isn't very clear so if anyone needs more info to help me with this, feel free to ask.

shell forum
#

I think it’s better for the receiving clients to have a slight delay than to introduce any additional latency to the attacking client, essentially causing his attack to lag on his end.

This is obviously without knowing how your attack works or the mechanics of your game.

lean surge
regal geyser
# fathom aspen Yes PC is client owned. And yes you can run client and server RPCs in the PC. I'...

Well its rather straighforward, in PlayerController on Begin Play I call Server RPC InitializePlayer, from within this event I also call Assign Quests, this event calls another event from GameMode that sets players quests on server. Now what I want is after the quests are set, client should spawn all of them as actors (Quests is array of classes from which client spawns objects)

I tried to call Owner RPC Assign Quests right after Server RPC Assign Quests but it's only being triggered on server, or rather host because I use listen server

shell forum
#

So if someone with 100ms attacks

#

And someone else has 10 ms

#

Then it will be glitchy if it’s blindly multiplied by 2

lean surge
#

I see your point and agree, thanks for the help

chrome bay
dreamy terrace
#

Is there a weird thing with UE5's physics thresholds? I've been making the UE5 VR template into a multiplayer template but I've noticed that editor placed physics actors will not start simulating on the client unless they are a certain distance away from other actors. eg the yellow boxes in the template will just hover if they are within about 10cm of another surface.

torpid girder
#

Hi, i was wondering, with UE5 would there be any processing offloaded to a GPU for a dedicated server?

winged badger
#

it won't

#

you can't really count on most dedicated servers to have a GPU worth offloading stuff to

#

so even if you could do it, there would be little point to it

wicked brook
hybrid zodiac
#

Hi all, I had a question earlier which wasn't picked up. When I run stat net in the console, does anyone know what the in/out rate (bytes) actually refers to. Is this the amount of data in bytes being sent/received per tick, or per second? I'm trying to arrive at a basic figure of how much data the server is having to upload, and how much the clients are having to download per second. If each client is receiving 4kb per second, that's fine, if they're receiving 4kb per tick, that's an issue potentially...

winged badger
#

its per second

fresh chasm
#

Hello, I was wondering if replicating 10 arrays of length 1 has approximately the same network usage as replicating 1 array of length 10?

chrome bay
#

no

#

1 array would be preferable

fresh chasm
#

Alright thank you, I'll stay with one array

#

btw I saw your article on your website for creating an inventory with UObjects, and that was very helpful !

hybrid zodiac
#

@winged badgerAwesome, thanks!

glossy plover
#

How can I allow clients to trigger a "Run on server" custom event on an actor in the scene? In my case i have a balloon; if a character hit the balloon actor it calls an event on the balloon which adds a force impulse to itself...(i think) the problem is that event is not run because the character does not own the balloon. I know I could stick the event in the gamestate instead (and Run on Server from there instead)...but this is seems messy seeing as the force is specific to this balloon actor

latent heart
#

Route it through the player controller

#

"InteractedWithActor(BalloonActor)"

glossy plover
#

Thanks....ive routed it through the player controller, and works ok that way....but i notice that the replication on clients looks stuttering (the force added to the balloon create a lot of quick spinning and stuff)....so currently the server is adding the impulse force and then the clients are replicating the balloon movement. Would it be better to turn off movement replication and instead multicast the event, so that all client adds the force locally?

#

Note that increasing the network update frequency on the balloon to, for example, 1000 seems to smooth it out, but i'm assuming that is a bad idea to rely on crazy fast network updates? (also it's not an issue with a bunch of network corrections)

#

oh wait having all clients add the force locally is not an option anyways due to my first point 😐

winged badger
#

and you can't send a server RPC from GameState

dark edge
#

Replicating physics movement is a whole topic unto itself. There's a ton of tuning settings in the project settings and you also want to experiment with applying forces and impulses on server only or everywhere. It's not just a fire and forget setup

dark edge
glossy plover
#

I'm assuming force is deterministic, so all results should be fairly similar, then resync at the end of the force, so: 1) Pause replication on movement 2) Apply force locally 3) Unpause replication

dark edge
#

Now if it's not important to game play at all, you can just simulate physics locally everywhere.

#

Is this for gameplay or is it just cosmetics?

glossy plover
#

It's important to gameplay

#

Everyone is trying to hit the balloon

dark edge
#

Then yeah, don't try to outsmart yourself. You are going to want to get the server authoritative replication working. Do you need prediction or no?

#

If you do need prediction, good f****** luck. It's going to be hard

glossy plover
#

prediction?

dark edge
#

When you hit the balloon, does it need to move immediately or is ping delay okay

glossy plover
#

It needs to move right away, like soccer or something

winged badger
#

physics in unreal is not deterministic

dark edge
#

Yeah you're going to have a bad time. It's doable but you will really really need to know your stuff to make it smooth and not janky with latency

winged badger
#

combined with network its a geniune nightmare

glossy plover
#

What would you suggest instead of using forces?

dark edge
#

I'm working on a multiplayer physics-based game I have one thing that makes it a lot easier. I do not need to locally predict anything. All I do is send the inputs to the server and watch things happen

dark edge
# glossy plover What would you suggest instead of using forces?

Read up on network prediction and lag compensation. Stuff like this is super hard because everybody is in the future on their own machine versus the server. So when you have interactions between multiple clients, like two people trying to kick the ball at the same time, things get really weird really fast.

glossy plover
#

Just move the balloon to a specific location type of thing (so kind of fake physics?) Would work better?

dark edge
#

Cuz on my screen, I kicked the ball. On your screen, you kicked the ball. Who kicked the ball?

twilit radish
#

The Rocket League video actually had a decent explanation on how they did that stuff. It's pinned in this channel 🙂

#

Assuming that's similar-ish

dark edge
#

Yeah this is fundamentally the same problem as rocket league and yes, I would never in a million years want to have to actually do that as a one-man show. Not going to happen.

glossy plover
#

Yeah it's pretty similar to rocket league

dark edge
#

Now, if your players are physics driven as well and you are okay with not doing local prediction, it's fairly simple. But the higher you're peeing, the longer it will take for something to happen on the screen from when you send your input

twilit radish
#

What Rocket League does is predict the ball (and even vehicles they said? But I'm still completely unsure how on earth they did that).

dark edge
#

Their approach is very complicated and it involves like rewinding and resimulating physics etc. I'm doing multiplayer physics vehicles but they are big and slow, so waiting 30 milliseconds for the throttle to increase is fine.

twilit radish
#

If you don't have to do that I would totally not yup. Their rewinding is rather crazy work. Also to be fair they swapped out their physics engine too.

dark edge
#

So if you were like making gang beasts soccer, and a little bit of slop in your controls is fine, it'd be easy.

#

If you try to make Unreal tournament soccer, with real snappy movement, good luck

quasi tide
#

Reject real-time. Make everything turn-based.

winged badger
#

everything is turn based, just when turns are ticks they are lying to you 😄

pallid mesa
#

funnier ticks = Always Tick Pose And Refresh Bones

halcyon totem
#

when setting up HUDs for players should the setting up of the HUD be in the player controller or the actual character?

winged badger
#

it should be in a class derived from HUD

#

and set as HUD Class in the GameMode

dark edge
halcyon totem
#

@winged badger what if I have multiple different huds for different players?

winged badger
#

it still provides safety of being local only and 1:1 relationship with the PC

#

which means it will prevent you for slapping the client widget on server's screen, at minimum

#

if it needs to show different widgets based on player setup, if can do that just as well as character or PC could

short arrow
#

So is there a way to make a multiplayer game where players rotate towards their mouse location without it being super costly?

#

I've done this before in the past using event tick where the server would update and multicast everyone's new rotation, which had to be reliable to avoid lots of snapping. Safe to say I'm sure it was the cause of most of my traffic problems

grand spire
#

Hi! I'm using chaos vehicle and it works fine in single player. But in multiplayer my vehicle wheels sometimes start to fall through the floor and it occurs more frequent with more clients. At 4 clients wheels fall through the ground almost instantly and with 1 client they fall when I drift at high speeds. Any ideas on how to fix this?

quasi tide
bitter oriole
#

It simply needs inteprolation

#

(And yeah, it should in fact never be reliable)

short arrow
static garnet
#

question, so im running this setup in a replicated actor, to scale the fx in it client-side with time. this works on server but not on client. however, i checked with a print node that the value that is supposed to be written to radius is indeed calculated correctly on client. it just doesnt seem to write to the niagara system properly. howeverever, if i set it to a static value instead of this dynamic one, that works correctly on client. can someone tell me whats going on here? im kinda out of ideas

shell forum
static garnet
shell forum
#

The server should call the event

static garnet
#

how does it replicate tick here?

#

this is just normal, local tick, no? there is no network event here

shell forum
#

Yeah, but you still need to replicate the start event

#

Or it won’t run

static garnet
#

the start is the creation of the actor

#

which is replicated

shell forum
#

But the particle system shouldn’t be replicated

#

You simply use multicast to run that logic on clients

static garnet
#

its not replicated

#

its just part of the actor

#

its spawned independently on client

#

when the actor replicates

shell forum
#

It’s not unless the component is replicated

#

Which you shouldn’t do

#

You need to spawn the actor on the client

#

Not on the server

#

Otherwise the client can’t change the variables as it doesn’t have ownership

static garnet
#

then why can it change the variable if i just set it to a specific value and not this calculated one?

shell forum
#

Changing a variable is not the same as changing the Niagara particle system.

static garnet
#

no i meant the niagara parameter

shell forum
#

Yea

#

You don’t have ownership

#

That’s why it works on the server

static garnet
#

then why does this work?

#

and also, why does it not work when i spawn a new system client-side?

#

cause i tried that too

shell forum
#

That’s good then

#

See if time created or something else is returning a different value on clients

static garnet
#

i already said i checked that

#

it gives the same value on client

shell forum
#

Or height

static garnet
#

the values are all calculated properly, i checked all of them with print nodes on client

shell forum
#

Have you tried just incrementing the value on tick?

#

If you can’t change the scalar parameter on the client, then it’s an ownership issue

static garnet
#

then i wouldnt be able to change it at all

#

but if i set it to a static value, it changes on client just fine

#

which is why this is so confusing

shell forum
#

It’s the same size as the server

#

So not replication is needed

static garnet
#

no replication is needed in any of the possible setups with this, because they're calculating the value independently

outer drum
#

Anybody know why my "Locomotion" State wont transition to "Jumping" State on Server but will on client?

Transition rule is a bool checking if the jump key was pushed. Yes it is replicated. It works properly if simulated in the preview. On Standalone it works. But once its a multiplayer setting it breaks. Everything else about my locomotion system works great except the Jump Animation.

Just to clarify the Jump itself is working and replicating but the animation is not.

shell forum
#

You’re running it in a multicast

#

When it’s a replicated variable

#

You only need to run it on the server

#

And jump is already replicated iirc

outer drum
#

So remove the variables fro mthe Client comment

shell forum
#

You just need to set the variable for all clients to see

#

Try calling Jump on the action button and remove everything else and see if it’s still replicated

#

It should be assuming you’re using character movement

#

And movement is replicating

outer drum
#

nvm i found my issue

#

im suprised u didnt spot it lol

#

Take a closer look at the green commented section xD

shell forum
#

It still isn’t the correct way to do it

#

What’s the point of a replicated variable

#

If you’re using multicast

#

Also jump is already replicated in character movement

outer drum
#

Im confused and still learning. Are you syaying I wouldnt need the variable at aall?

#

Im aware of that but some things I wanna do will end up breaking that default replication

outer drum
shell forum
#

Just set the jumping variable on server only

#

isJumpkeyDown

outer drum
#

Ohhh yha, i was trying to figure out what was wrong i did that during my wtf phase lol

#

this is how i do thjat stuff

#

my walking example

#

Correct?

shell forum
#

No

#

You don’t need to multicast movement

#

Only do it on the server

#

And it will replicate

outer drum
#

So dont replicate on CL?

#

Im very confused lol

shell forum
#

Only replicate it on server

#

Movement will be automatically replicated to clients

#

If the actor is set to replicate movement

#

So do it on the owning client and server

#

And that’s it

outer drum
#

Oh Yha I dont have character movment auto replified

dark edge
#

Does printing Is Jump Key Down on server result in a true when you jump on client?

outer drum
outer drum
#

Didnt hook up an exec smhMyHead

dark edge
# outer drum

Jumping should be handled by the CMC, you shouldn't have to do any of that stuff

#

Now you'll get a lag when you jump

fresh chasm
#

Hello, in cpp, is there a way to automatically call the OnRep function on the server when a ReplicatedUsing variable is changed? I see that in blueprint RepNotify variables automatically calls the OnRep function on both server and clients

shell forum
#

you're setting a replicated variable in multicast

#

which defeats the purpose of using a replicated variable

#

and calling the jump method on each client

outer drum
#

I stopped replicating the variable

outer drum
shell forum
#

why not replicate it on server?

#

that way you dont need multicast

hardy seal
#

Hello! Anyone can explain me how unreal handles UTexture2D assets in the server? Does the texture gets created in the server and replicated?

fresh chasm
# outer drum I stopped replicating the variable

Multicast are designed for one time event (example an explosion), if the variable should be known by every player even if they was not close from the actor that has this variable, it should be replicated. I don't know what you are trying to achieve but keep that in mind

crystal crag
#

If you a grabbing your list of friends through the friends OSS, wouldn't you be able to get a valid FUniqueNetId from the response?

outer drum
#

@fresh chasm Hes saying this isnt correct

crystal crag
#

I can get the list of friends and their display name, but calling GetUserId() is returning an empty object

#

Do they have to be connected to the same server / world in order for that call to work?

fresh chasm
#

Jump is replicated by default

#

If you want to keep the variable "IsJumpKeyDown" you can make it replicated and set it like you did after the input you have to make a server event that set the replicated variable, or use a multicast without replication like you did

#

But do you really need all players to know the "IsJumpKeyDown"? If it's for replicating the animation, there is a variable in character movement that is set to "Falling" (I don't remember the name) when your character is in air (ie jumping)

shell forum
#

Yep, he said the exact same thing I've been saying

#

but you don't want to listen to me for some reason

outer drum
#

Yha but he said it in a way I understood lol@shell forum

#

@fresh chasm@shell forum So is that just bc its integrated in? What about for something like sprint would this method be correct?

shell forum
fresh chasm
outer drum
#

Youtube tutorials suck -.- Is there any vids of this you can link me too. All the ones i have found are of how I did it

shell forum
#

Just set the max walk speed on the client and do the same on the server

#

you dont need a tutorial

fresh chasm
#

Also you can download the Content example from epic, there are a lot of examples

regal geyser
#

How can I setup references to players controller and his HUD? First I spawn pawns as NPCs and then server lets some clients possess this pawns and after client gets control of his pawn I need to setup references on this pawns BP for its controller and HUD.

I have this BP created but it always fails at assigning players HUD

crystal crag
#

Wow, that hurt my brain to try to read >< but one thing to check as a general thing is dedicated servers don't load widgets. If you are running a dedicated server I would check to see if the load UMG flag for dedicated servers is on

#
const IOnlinePresencePtr Presence = ServiceContext->OnlineSubsystem->GetPresenceInterface();
    if (Presence.IsValid())
    {
        const FUniqueNetIdRepl ReplId = GetLocalUserNetId(0);
        const FUniqueNetIdPtr NetId = ReplId.GetUniqueNetId();
        Presence->QueryPresence(*NetId.Get(), InQueryUserIdArray, IOnlinePresence::FOnPresenceTaskCompleteDelegate::CreateLambda([Presence, InQueryUserIdArray](const class FUniqueNetId& UserId, const bool bWasSuccessful)
        {
            for(const FUniqueNetIdRef& UserIdRet : InQueryUserIdArray)
            {
                TSharedPtr<FOnlineUserPresence> PresenceInfo;
                if (Presence->GetCachedPresence(UserIdRet.Get(), PresenceInfo))
                {
                    UE_LOG(LogCommonUser, Warning, TEXT("Found user precense - current status: %s Is Online: %s Is Playing This Game: %s"), *PresenceInfo->Status.StatusStr, PresenceInfo->bIsOnline ? *FString("True") : *FString("False"), PresenceInfo->bIsPlayingThisGame ? *FString("True") : *FString("False"));
                }
            }
        }));
    }

So upon inspection of the PresenceInfo, it looks like the data there is correct (IsOnline is true), but the GetCachedPresence call is returning false...

#

So I can see the data with a breakpoint, but the GetCachedPresence method always returns false

#

Ah, nvm

#

I thought it returned a type of bool

#

it's returning a type of enum

#

problem solved

fresh chasm
regal geyser
fresh chasm
regal geyser
#

But another issue which this solution brings is that when I call Owner RPC from Event On Possess which is called on Server, this Owner RPC still may not have the possessed pawn reference. How could I avoid this?

crystal crag
#

Isn't there like an OnRep_Pawn or something?

#

That would get called on the client once they possessed it

#

Then couldn't you just call the server to do its thing?

#

I don't see how you get out of making another full round trip with the way you are designing this

regal geyser
#

Well basically Server sets up bunch of quests for Client, and after Client receives a pawn, I need to setup Clients HUD with all these quests.

crystal crag
#

Probably better off to just use an OnRep for your quest array and have your HUD just fill out after getting the rep

regal geyser
#

Yea thats one way to do it for sure

crystal crag
#

Are you doing this in blueprints?

regal geyser
#

Yes

crystal crag
#

It's been a while since I've looked at it, so I can't recall if it is multiplayer-supported, but there is a free mission component project on the marketplace you could always take a look at

#

That might give you some ideas

#

or it might not support multiplayer and be a complete waste of time, so I would confirm that first

shell forum
#

Just call a run on owning client event during event possessed.

regal geyser
#

Found "Easy Quests" but it says: "Network Replicated: No"

regal geyser
gleaming kite
#

Does anyone have tips on replicating chaos? Simulating with 500 ping provides a pretty jumpy result. Didn’t know if there’s some kind of client side prediction somewhere in the engine

crystal crag
#

Quick shout out to @signal lance for being awesome and helpful

signal lance
#

But I haven't done anything now 😅

crystal crag
#

lol you helped me yesterday

#

It just entered my mind out of nowhere

#

Most people just complain; gotta take time to give postive vibes too.

signal lance
#

Ah the shared ptr stuff, I remember

Most people just complain; gotta take time to give postive vibes too.
True true

crystal crag
#

I hope you have a wonderful weekend!

signal lance
#

Thank you, you too

grizzled stirrup
#

I've been debugging this for an embarassingly long time. Would there be any reason that Character->GetActorRotation().Yaw seems to return a yaw of 0.0f when querying other clients? I had thought that yaw was replicated (clearly is somewhere as they rotate)

#

Where can I get the current replicated yaw of a character?

shell forum
#

you can simply replicate the yaw on the server on turn input event.

fathom aspen
fathom aspen
fervent leaf
#

Hey, I'm creating a small multiplayer fishing game demo. When i start fishing, the player should only be able to control the fishing rod with mouse. When the bait hits water, camera goes underwater and you can see fishes swimming around it (other players cant see these things and you dont need to see their baits either when camera is under water ). You can press another button to switch back to thirdperson view and there you can see if other players run around you. Does anyone have idea how this kind of functionality works or even small hint to get me started. Surely you cannot just switch gamemode when you start fishing. Should the thirdperson view be on the main level where all the characters move and when bait hits the water, it switches the level on the players computer, other players then sees the character standing on rod in his hand? How would u even make that happen? Even small tips are gladly appreciated, thanks 🙂

shell forum
#

Add a camera to the bait

#

And then set the view target of the player to be that camera

#

You can’t change gamemodes mid game

sharp pagoda
#

Is it normal that I have to create a multiplayer logic first in BP before converting it to C++? Or should I start practicing creating it using C++ from the ground up?

rocky night
#

HI, can i set a boolean just to rep notify and dont put the fuction code in the rep notify? or does a rep notify only works when code is in the repnotify function?

shell forum
#

I found it easier to make in blueprints first

#

Then switch over to C++ once the actor is complex enough to warrant using code

sharp pagoda
#

I see

shell forum
rocky night
#

i have a door with is locke dand unlocked with a particle system active when closed and inactive when open.. SO if a player disconects and joins back.. i need that he see the actual state of the door

shell forum
#

You will need a rep notify for that

rocky night
#

can i set the bollean closed and open just to rep notify? or do inned to put the activate and deacctivate particle system in the repnotify function?

shell forum
#

I believe you would put the activate/deactivate in the repnotify function. I can’t recall whether particle system components handle replication for you.

#

I don’t believe they do though

rocky night
#

i see ok i gona try that... not sure at all... rep notify is pretty new to me

rocky night
#

aother question th enetupdate rate is set to 100 on most actoris where and when i shoudl reduce this? On all meshes? or only moving ones or ai ?

rocky night
#

so reducing them to 50 wouldnt make any change at all?

fathom aspen
#

Seemingly it would make your actors be considered less frequently for replication and it would save some performance. Though a better case would be to use the Push Model which works without using the NetUpdateFrequency(you consider a property for replication only when changed) however it has been tested quite too many times and little that helps

errant sonnet
#

Hey, do someone knows the method to get the subnet mask of the current local network ?

rocky night
grizzled stirrup
#

I could separately replicate another float for yaw as I'm doing for pitch but it seems that the info is already there on the client somewhere

errant sonnet
fresh chasm
fathom aspen
#

Well technically you can wrap your OnRep function with a server RPC and call that inside your OnRep. Would I do that? Hell nah

fresh chasm
fathom aspen
#

Correct

fresh chasm
#

Well I would not do that too ^^ I thought there was a easier way since the blueprint onrep do that by default

fathom aspen
#

Well BP OnRep work much differently than how cpp OnReps work

#

In BP they are called when the property changes, so even when client changes the property the OnRep is triggered which is a dumb way of doing OnReps

thorny saddle
#

how can replicate AI anim bp var for clients ?

winged badger
#

usually inside the AI Pawn

#

the animation blueprint is not replicated

#

and most common/recommended way to run it is to fetch the data from the TryGetPawn inside the (Blueprint)UpdateAnimation and get everything prepared in advance for the animation graph so it can run on a separate thread

thorny saddle
winged badger
#

if you multicast from anim BP, nobody will receive that, except the machine that called the multicast

thorny saddle
#

if i replicate it replicate on Net Cull Distance

#

but if i multicast

winged badger
#

you can MC there, but its generally better to run replicated variables here

thorny saddle
#

it run for all of client

#

right?

winged badger
#

all relevant clients

thorny saddle
#

let me make my question simple

#

multicast check Net Cull Distance ?

winged badger
#

it checks relevancy, which might check NetCullDistance

#

if something doesn't make it relevant or note relevant by default

restive gull
#

Hi all, i am new to game development. I have a basic question that, how we can share other player locations realtime with another players?. I searched internet and i found out about websockets but idk if we can make http call from unreal engine or not. Also what are best practices are followed to perform this operation. Please share some reference blog or source for it.

winged badger
#

like bAlwaysRelevant, bOnlyReleventToOwner and such

#

in that case it will never check the cull distance

winged badger
crystal crag
#

Hey Zlo, if you are still here, I have a quick follow up question about that session invite stuff

#

I've been looking at the signatures of the delegates and the methods / etc.

#

But I am not seeing where to get who is the target person to join

#

am I missing something? I mean there is the session invite accepted, but its signature only contains the person being invited from the looks of it

#

there is nowhere in there that holds the invitee

#

so how would I know internally to join the invitee and the invited in some internal data structure based off of that?

#

Especially if they are joining from the overlay, which means I have even less visibility into that

ruby ruin
#

How does one keep track of which functions are only being called on the server or client?
I'm not talking about RPCs, but functions that are called from gamemode or from RPCs or from an if(hasauthority) for example, hope that makes sense.

twin juniper
#

I have a question

#

If I want to set a player score do I have to set it in the playerstate?

#

How do I avoid so that a player can't mess around with this score?

quasi tide
quasi tide
twin juniper
#

Yeah but we're having trouble understanding the logic flow here

#

I want it so that my client when it overlaps with something else gets a score increase

#

Where is the actual score variable located? In the player pawn class? the player state?

ruby ruin
quasi tide
twin juniper
#

Each player state can have multiple player controllers right?

#

If there are multiple coop players in the same client

quasi tide
#

It's up to you to architect the game. Having some kind of standardized flow would help give you a general idea where a call should be.

twin juniper
#

If I set my score in the player state then I need multiple variables for each player controller right?

quasi tide
ruby ruin
#

Ahh, I was wondering if there's a best practice/standard other than just remembering, for example you have a 100 functions on an actor, it becomes impossible to remember which ones are called on client and which ones on server

quasi tide
#

Prefix them

#

As I said earlier

twin juniper
quasi tide
#

You just do the important calculations on the server.

twin juniper
#

yeah but what I don't get is how to talk to the server and set his score

#

my pawn overlaps, I check if it has authority then what? My pawn doesn't hold any score variables

#

Ideally I would want to talk to my own player state?

near bison
quasi tide
ruby ruin
#

That's good to know, I think maybe postfix might be better than prefix so as to not confuse them with RPCs

quasi tide
quasi tide
ruby ruin
#

yup

quasi tide
#

Oh, that's completely personal preference. I don't think anyone actually does stuff like that. At least, I haven't seen or heard people do it.

twin juniper
#

I'm trying to understand using the most simple example. Let's have it so that my player when it presses a button it increases its own score

quasi tide
#

Gamemode, gamestate, playerstate, w/e the heck you want.

twin juniper
#

So my pawn presses a button -> what?

#

Sends a rpc to the server?

quasi tide
#

Yes.

twin juniper
#

And then the server adds it to my player score by accessing the variable in the gamestate/playerstate?

#

I assume I have to pass in my playerstate/playercontroller or something in that rpc function

quasi tide
#

Yes.

ruby ruin
quasi tide
quasi tide
#

Or if you're RPCing from the controller itself, just get the player state. UE knows which actor is doing the RPC call.

twin juniper
#

Right now I press a key, it calls the server function, in the server function I do get controller and cast to my custom player state and set the score variable

#

in the player state does the score have to be an onrep notify?

#

or is it replicated by default?

quasi tide
#

Did you tell it to replicate?

ruby ruin
twin juniper
quasi tide
#

Then it is replicating.

twin juniper
#

Blueprint Runtime Error: "Accessed None trying to read property CallFunc_GetController_ReturnValue_1". Node: Cast To PlayerStateKeivn Graph: EventGraph Function: Execute Ubergraph BP Third Person Character Blueprint: BP_ThirdPersonCharacter

#

This is a nullpointer right? I'm not sure why I keep getting it

#

Shouldn't I be able to cast my playerstate as a custom type from my own pawn?

#

I do get controller -> get player state -> cast player state

ruby ruin
twin juniper
#

The error was that I wasn't checking before hand if the pawn had a controller

#

doing a check for a controller fixed the issue

halcyon totem
#

I keep getting errors and lagging on my server logs

#

Warning: ServerMove: TimeStamp expired: 85.747459, CurrentTimeStamp: 86.849335, Character: Marine_Fixed_C_2147482366
does this mean I am having replication issues?

#

I am tyring to do a pung style auto run

undone plinth
#

If I call SetOwner on an actor that controller should be able to call annotated Server functions right?

normal quartz
#

I've tried it about 20 different times at this point, without exaggeration. the anim reference is correct because a different function for switching weapons with the exact same event setup works fine. it's a simple run animation blendspace and only the local screen can see it, client or server. any ideas? missing something simple? doing it all wrong?

sinful tree
#

Also, you can't take the float value from a different execution path over to the multicast. It'll likely always result in you multiplying by 0.

normal quartz
#

awesome, that was it, thanks a bunch for the quick response

fathom aspen
royal isle
#

Hey guys, when someone is the server in a listen server scenario, post processing on the world works just fine but if a client connects to it it has no post-processing. Any ideas?

regal geyser
#

I have a simple Light BP, if actor overlaps its trigger he can turn it on and off, and I would like it to be replicated. Can I do it somehow inside of this BP? Because calling Server RPC to change RepNotify light visibility isn't working because client isn't the owner of this BP Light.

winged badger
static sable
#

hi all ue4.27, one question. I have a client/server game. On the client I use SpawnDefaultController() for a pawn. When I play as client and try to do GetController() for that pawn on server, I get nullptr. How to spawn/access pawn's AI controller on server? thanks

fathom aspen
#

GetController returns the controller possessing the pawn. Make sure the pawn is possessed

static sable
#

@fathom aspen thanks. Where to spawn the pawn's controller on the server then?

fathom aspen
#

You should spawn it on the server if you want the server to know about it

royal isle
fathom aspen
winged badger
#

and player pawns should never spawn default controllers

#

that is more of an AI pawn thing

fathom aspen
#

Exactly. AI = Server

static sable
#

from the client I call SpawnController()

winged badger
#

yes, no

#

goto pinned messages on this channel

#

find Cedric's network compendium

#

and read it a few times

#

you currently lack even the most basic understanding how the unreal network architecture works

#

because what you did there is shockingly wrong

static sable
#

well blame UE official documentation : )

fathom aspen
winged badger
#

i do that only in rare cases where its virtual

fathom aspen
#

At least not if you're overriding it 😄

crisp sable
#

What the best way to spawn replicated props, such as

-Pickupable props ( ammo / health )
-Destructible Glass

On a large level.. For example, PUBG has thousands of these props on the level.

  1. Are ALL of the props spawned on the server at the start of the level?

  2. Or are the props dynamically spawned when a player enters a zone on the map.

winged badger
#

pubg has 100 players at the start

#

so tracking all 100 of them to spawn stuff when they are near would be somewhat of a pain in the arse

fathom aspen
#

PUBG prolly has a replication graph

winged badger
#

maybe they upgraded, but its way older then rep graph

fathom aspen
#

Yeah considering it came way before fortnite

winged badger
#

pickups are relatively simple

#

you put them dormant and you just spawn them

crisp sable
#

i see

winged badger
#

they will be interacted with just once, then they are gone

#

so you don't want to keep them as active replicated actor

#

just flush net dormancy, force net update post interaction, if you need to do some effects, and destroy them

crisp sable
#

gotcha , thanks

#

makes sense

winged badger
#

dormancy will still spawn them on clients as they become relevant

#

so they should see the pickups just fine

crisp sable
#

👍

#

cool, so in terms of the spawning logic.. The server will just spawn everything at the start of the level

winged badger
#

rest of the stuff, simple interactibles that persist on the level, i find network manager approach works perfectly

crisp sable
#

and the dormancy will handle what gets spawned on the client when they get close to the pickups

winged badger
#

you might want to stagger it alittle

crisp sable
#

right, so there's no huge hiccup

winged badger
#

as not to cause server hiccup at start

crisp sable
#

gotcha

winged badger
#

they work well for non moving actors

crisp sable
#

ah nice article. thanks

#

this is only for UE5 though?

winged badger
#

no

crisp sable
#

sadly, I'm still on UE 4.26

winged badger
#

i've been using them in 4.18

crisp sable
#

ahh cool

static sable
#

@winged badger did you refer to this? "If you check out the table again, you will notice that, for example, a Server RPC will be dropped if a Client calls it on an Actor
that he does NOT own." ?

#

I am reading UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf

winged badger
#

read the entire thing, then ask questions please 😄

#

but that was one part of it, yes

#

you created a chicken or the egg

shell forum
#

What does isStandalone return? Does it return true if you’re in a single player game with no session created or only if the game uses no replicated events at all? I can’t find any documentation for it.

shell forum
#

Still kind of confusing as to when it returns true/false.

#

So a game running with create session would always return false, even with 1 player.

#

And a game that was simply opened with OpenLevel would return true, even if using replicated events and such?

fathom aspen
#

local session from my understanding is a session running over the LAN

#

Has nothing to do with replicated events

#

OR single player games

static sable
#

that's weird though, in _Implementation I get GetNetMode() == NM_Client ; so that's why SpawnDefaultController() returns, _Implementation is called on the client's side

shell forum
#

Hmm

shell forum
#

not sure how it will function in a packaged game

fathom aspen
#

Depends on how you run your packaged game.

#

A packaged game can be listen/dc/standalone

lavish charm
#

Hi, i've been playing with anim layer linking in a multiplayer project and have some issue with relevancy.
The anim layer comes from an equipped item, when the player loose relevancy and come back, he's now in T pose since the anim layer is no longer linked.
Who can i make it works ?
I tried setting the variable of the weapon as OnRep and include the anim linking in the OnRep function but that dosent trigger when relevancy is back

shell forum
vague spruce
#

sup. i've got an issue that's driving me absolutely mad right now. i've got a CapsuleComponent that isn't moving on the server. i've drawn a bunch of debug points on tick to demonstrate what's happening.

you'll notice the red looks like a perfect circle. that's the radius of where my character is initially swinging (the CapsuleComponent just isn't moving). the blue is the simulated proxy of my weapon actually moving the collider. the server stays completely still but the simulated proxy moves everywhere.

what do i need to do to get the collider to move on the server as well? does this have to do with ChildActorComponent? basically, my character's weapon is added at runtime as a ChildActorComponent to my ACharacter. the weapon itself has the collider. the actor, AWeapon, is set to Replicates, and my Collider is set to Component Replicates as well.

anyhow, sorry for the sudden word vomit. this is just driving me mad

#

looks like it's common for ChildActorComponents to not properly replicate 😦 it looks like the simulated proxies themselves create child actors. i'm reading that i'd need to create just a regular actor and then attach one to the other

vague spruce
#

that's hilarious. i was talking around that time too. thanks @fathom aspen

fathom aspen
#

Haha yeah I noticed that, thought he was talking to you, but he wasn't 😄

vague spruce
#

so i'm still having the same issue though. :\ the collision capsule doesn't move on the server

vague spruce
#

the capsule is attached to the weapon

#

the weapon is replicated

#

the capsule is moved by an animation

#

the weapon is attached to a mesh

#

maybe the mesh isn't moving on the server?

#

unlikely, because other clients see the mesh moving

dark edge
#

Is the capsule just riding the weapon which is riding the skeleton which is driven by the animation?

vague spruce
#

@dark edge

#

blue = simulated proxy. red = authoritative

#

i'm just printing out the location of the collider during the ticks in which the ability is active

dark edge
vague spruce
dark edge
#

Dig around in settings, there's some setting about animations on dedicated server

vague spruce
#

omfg

#

dude

#

i am so frustrated right now

dark edge
#

Does it work?

vague spruce
#

i've spent 4+ hours debugging this

#

yes

dark edge
#

lmao

vague spruce
#

it was set to Always Tick Pose

dark edge
#

when in doubt, think of the stupidest reason it could not work. The skelmesh's on server were literally not animating

vague spruce
#

i cannot fuckin believe it lol

#

but the clients were seeing the animations!!!!!

dark edge
#

that'd be WAY too much data

vague spruce
#

so is this way too much data now then?

dark edge
#

No the same data is going across the network. Just now your server is playing animations when before it wasn't

vague spruce
#

lmfao

#

oh

#

my god

#

i want to destroy something

dark edge
#

But most games probably just do clientside hit detection then on the server you do a sanity check. It sucks to have your sword hit a guy on your screen but not on the server.

vague spruce
dark edge
#

It'd be like
Client "Mr. Server, I hit these guys"
Server "uh they're halfway across the map, no you didn't"

vague spruce
#

hmm i see

#

so i RPC to the server and ask if they're in range

#

essentially

#

this is so much more complicated because of GAS

#

the ability is technically happening both on the client and the server. so i guess i could do the hit detection on the client, RPC to the server, client and server continue in sync

#

anyhow, i'm now further than i was before. ty

marsh gate
#

You did the debug thing too, nice animations btw

vague spruce
# marsh gate You did the debug thing too, nice animations btw

appreciate that. not mine tho 😦 one is a marketplace asset and the other a contractor made but we're no longer chatting. oh well.

so everything was working fine with bones on the server. but because i'm a freak, i just implemented this: #multiplayer message

it's jank.

  1. ability is triggered locally and on the server.
  2. on the server, ability just hangs.
  3. on the client, collision is set up. animation plays. the two capsules collide.
  4. the client sends an RPC using AbilitySystemComponent to a custom function i made that all it does is call a static function on the ability.
  5. the ability runs some server-side code applying effects to the hit character.

i have not yet written any validation for this, and i'll probably just end up going with the other, less optimal solution that turns on bones for the server. but at least now i understand what's happening.

#

is there any way to add fake lag into the networking code during runtime?

#

wow, yeah. feels horrible on GAS as-is.

#

with 250ms it looks terrible

light iron
#

Nice stuff dex. I've been looking into the validation part, still not 100% sure how to confirm client data on server.

vague spruce
#

good call. i ended up noticing this and this is now how i'm doing it with GAS. i'm starting to understand what prediction keys are for.

twin juniper
#

okay so at first the clients can't decide who to be so they rapidly interchange between autonomous proxy and authority, and then they collapse their superpositions but don't get entangled as they both choose authority

steep flame
twin juniper
#

ah yes, the cars don't appear in the same level

fathom aspen
#

The client has authority over them(each client has authority over the car he spawned)

twin juniper
#

my head needs a break and a reset, how do I get them to yield authority?

fathom aspen
#

They already do?

twin juniper
#

okay so my requirements are that I need the cars to appear in the same level and respond to the lag params I've set up

fathom aspen
#

You need to spawn them server side and make the car actor replicated(set bReplicates to true in ClassDefaults)

twin juniper
#

one gets ROLE_Authority and the other shows up as ROLE_AutonomousProxy

#

give me an hour, please, I need to digest this age old code and get back in form or I'll lose my job

steep flame
#

For the clients one car should be ROLE_AutonomousProxy and the other one ROLE_SimulatedProxy.
Both cars should be ROLE_Authority on the server.

fathom aspen
#

Take it easy

twin juniper
#

for reference

fathom aspen
# twin juniper Okay, so this isn't happening

Well we still don't know how you output that text widget on the car. But I can clearly tell that you don't have a SwitchHasAuthority before printing, that's why it's rapidly interchanging between the two

steep flame
fathom aspen
#

But before you care about that, you should care about having the cars see each other...

fathom aspen
#

Don't worry about the job, you'll get a better one once you get the knowledge 🧠

graceful flame
#

1000 incoming and outgoing with 20% packet loss is quite a lot of lag

#

I usually test with min 72 and max 150 with around 2% packet loss

fathom aspen
#

Oh yeah. That's not a realistic amount of lag at all 😄

graceful flame
#

Unless you really think some players are gonna stick around playing on a server with 1000ms ping?

fathom aspen
#

Honestly I would quit rage at that point

graceful flame
#

For sure

twin juniper
graceful flame
#

Even half those amounts is a lot of lag, that would be like your ISP is doing maintenance while the server is being ddosed at the same time.

twin juniper
twin juniper
#

and it can go up to 300-400ms for connections across continents

graceful flame
#

okay so maybe something like min 100 and max 450 with around 5% packet loss then

fathom aspen
twin juniper
#

close enough!

twin juniper
#

I hate memory in this instance

steep flame
#

@twin juniper don't try to solve so many problems at the same time. This will definitely melt your brain. Try to fix your game first and then test latency.

twin juniper
#

Okay so I know how the text gets printed:
TickComponent

    DrawDebugString(GetWorld(), FVector{0.F, 0.F, 100.F}, RoleString, GetOwner(), FColor::White, DeltaTime);

BeginPlay

    RoleString = UEnum::GetValueAsString(TEXT("Engine.ENetRole"), GetOwnerRole());
vague spruce
#

LOL

twin juniper
#

GAS is a doozy

twin juniper
#

I'm sorry but while the document is really clear and concise in terms of what I can expect on the server and client, I'm still in the dark about why my pawns aren't showing up.

#

@fathom aspen@steep flame
I'll try to sleep over it but I'm feeling abysmally dismal after trying to grok the text

atomic barn
#

Hi, I have a particle system attached to my player, how do i make it replicate? (I have set component replicates to true however it still doesnt replicate to the client)

twin juniper
#

I believe the answer is to have the server spawn the actor

#

otherwise the actor is local to the client and won't appear anywhere else

atomic barn
chrome quest
#

Call the spawning function from a server only event/function

winged badger
#

it can be pretty much whatever you like, a boolean, enum, integer, it doesn't matter, choose whatever makes your code most readable

#

then set that variable to replicate, with RepNotify

#

and from OnRep_MyState spawn the particle system locally

#

in blueprints, OnRep will also execute server side

atomic barn
#

its a component of my player

winged badger
#

same difference

#

technique to show it on clients is exactly the same either way

atomic barn
spring dawn
#

any book recommendation for UE4 multiplayer ?

winged badger
#

pinned messages, Cedric's network compendium

spring dawn
#

plz how can i go that message ?

#

ok have dowloaded a pdf

fallow shadow
#

i have a weird issue where i have a projectile which is supposed to stick to whatever it hits and then explode (Destroy itself) after some time has passed
and on the server it works as intended
on the clients not so much
the client sees the projectile bouncing off whatever it hits
and exploding after the time is up

twin juniper
fallow shadow
#

i dunno

twin juniper
twin juniper
# fallow shadow i dunno

I believe a little bit of faking may be required here. Spawn a proxy sticking mesh on the client once the "attach" event (RPC) is triggered. Recycle the actual projectile.

I say with 0% knowledge of networking and 100% knowledge of setting up the stage props inside a game level.

upbeat basin
#

This is not directly a programming related question so please direct me to the correct channel if this isn't. Is there any suggestion/encouragement/recommendation regarding to connecting to databases from dedicated game servers? Would it affect anything performance or security wise? As to my knowledge there isn't anything coming from the engine to establish a connection with a database, are we bound to the plugins/external code for this? Other option is I guess having an external server where I communicate with my game server to do database related operations. For my case both seems like fine, what other criteria I can consider to make my decision regarding to this?

fallow shadow
#

ok so update

#

this is really odd

#

if i fire the same projectile from the client it sees it sticking to whatever but the server doesnt see the projectile at all

winged badger
#

so your sticking part is probably gated behind an authority check

winged badger
fallow shadow
#

which is weird because i call a multicast to fire the projectile which is NetMulticast, Reliable, WithValidatation and the _Validate method just returns true (for now)

#

so shouldnt the server allow all RPCs from the client?

winged badger
#

you can't multicast from client

#

its just a normal function if you do

fallow shadow
#

Oh that makes sense

cinder quartz
#

Anyone who has modified networked slide to the character movement component? Do you think it's better to:

  1. Make custom movement mode and custom Phys function for it (like PhysWalking has) or
  2. Keep movement mode as walking but override stuff like CalcVelocity etc? Slide is pretty close to walking anyway, just with different acceleration and velocity and turning. Currently trying to go this route but CMC is a beast lol.
winged badger
#

generally, you'd need to subclass FSavedMove so it carries the Sliding movement flag

#

and use it, which would require subclassing the CMC as well

cinder quartz
#

I already do that

winged badger
#

did you get it working single player yet?

cinder quartz
#

no, I'm trying to understand how CMC calculates velocity when walking. Even when I override it with static value, something is projecting it on slopes etc, so it seems like CalcVelocity isn't the only place that affects velocity for example, so I don't have full control whats happening

#

thats why I'm thinking maybe custom movement mode would be better

winged badger
#

probably, since without it you can't really configure it from editor

#

unless you hardcode the values relative to an existing movement mode

#

and that is not pretty

#

and you're likely going to have few days worth of tweaking it until it feels just right after its working

fallow shadow
#

i think that i should do stuff like animations and sounds client side and then call a server RPC for actually spawning a projectile?

winged badger
#

depends on the game

twin juniper
winged badger
#

FPS will never feel right if you don't let client calculate its own shots

fallow shadow
#

first person shooter

#

oh yeah shit

cinder quartz
#

the reason why I'm trying to modify PhysWalk to support slide instead of custom movement mode, is that it already handles stuff like collision well. I will keep trying and switch to custom mode if I can't get it to work right with walking + overriding the functions

fallow shadow
twin juniper
twin juniper
fallow shadow
#

oooooh that yeah that's definitely it

twin juniper
#

Glad I could be of help but I have 0 idea how that works lmao

#

and in fact, I do need to know how to do that?

winged badger
#

most people will opt for using a particle system to look like a projectile then spawning actual projectiles, if they can get away with it

twin juniper
#

After all it's a matter of hurtling a mesh across space and having it stick, so it could very well be instanced.

winged badger
#

problem here is prediction

#

for it to feel right, client needs to see the projectile before it gets a round trip later information from server

twin juniper
#

If it's a Simulated Proxy one could use some interp/extrap to get it right, right?

winged badger
#

spawning an actor separately on server and client and having it replicate is doable, but the timing is a bitch for a rapid firing weapon

#

having each machine spawn its own projectile is probably better if you're going with an actor projectile

twin juniper
#

That makes sense for bullets or rapid fire as you said, even hitscan benefits from this

#

but how will this work for a sticky rocket, like say the Redeemer missile?

Okay maybe this example is too contrived as the missile can be treated as a fully replicated pawn

winged badger
#

hitscan has no reason to spawn full actors for bullets

twin juniper
#

Sure, basically any projectile can be spawned locally, we just need to know when it was fired and when the shot connected, and maybe derivatives (start and end velocity)

#

Speaking of prediction, my entire prediction logic is not working and looks useless from the listen-server's side.

atomic barn
twin juniper
atomic barn
#

@twin juniper i did that, it doesnt work

twin juniper
atomic barn
#

one sec

#

Here @twin juniper

winged badger
#

that is not the OnRep for that variable, hate blueprints

#

delete that OnRep function, swap your varaible to non replicated then back to repnotify now after it was renamed

#

and don't do this set on Tick,

#

you can just use NitroActovated as RepNotify here

twin juniper
#

The pdf by Cedric really does a good job explaining these basics!

blissful saffron
#

Does anyone have an example unreal project utilizing steam for matchmaking and lobbies?

fallow shadow
#

ok so

#

i set it up this way for now

#

i spawn the projectile on the server

#

and right after that a client rpc is called to play all the animations and sounds and stuff

#

but the projectile just doesnt spawn

blissful saffron
#

is it spawning for the server?

#

if it is, ensure bReplicates = true. If it's not, you need to figure out how to spawn the actor

dense egret
#

What's the recommended method of binding a widget to a delegate, when the delegate is broadcast on the server?
I'm unable to bind to delegates to events in UMG widgets, because I assume the widgets don't exist on the server.

pallid mesa
#

well... there are many ways to do this but I personally like to handle this using a messaging system ie: the engine's ULocalMessage system

#

which allows you to broadcast and send events from the server to your clients

#

BroadcastLocalized and such

#

so yeah... if the event is server side, just get the controller you are interested in

#

and send a client RPC

dense egret
#

I see. So send a client RPC using ULocalMessage? Does it allow me to broadcast once and listen for it anywhere?
I'm having trouble to find a guide on how event-driven UI updates are usually done in UE and the documentation is spotty.

twin juniper
#

Well I'd wager you treat your UX as purely views. In this case, separate all data and use this messaging system to transmit whatever you need.

dense egret
dense egret
twin juniper
dense egret
#

Would you mind elaborating why it wouldn't be in a networked case? I feel like I'm missing something obvious 😄

twin juniper
#

I believe it's because delegates aren't really designed for the networking case (afaik). Looks like it's meant to handle cases only on the client-side (so you can use RPCs and then dispatch via delegates?)

dense egret
#

Ah okay, then I was misinformed about their use case. Thanks for the clarification

twin juniper
#

Again you must best look at the source and figure out how they work tbh

vague spruce
#

sup. i have my enemies all to replicate movement. this works great in settings with no lag. however, as soon as i introduce lag, applying any kind of impulse locally doesn't do anything until the server registers that the impulse happened. is there a way i can the movement component to respect local impulses and eventually correct server-side if necessary?

dense egret
vague spruce
#

i think it's this:

dense egret
vague spruce
blissful saffron
twin juniper
#

Okay so the years-old example demonstrating smooth movement interpolation using Cubic Hermite Interpolation without physics is working... smoothly. However the issues there are that the position, rotation, and velocities map roughly. The end state is 99% of the time what's present on the server, but delta movements can get exaggerated or outlandish. This is all fun and games, but the game I'll be working on:

  1. Requires Chaos Physics
  2. Will use EOS for matchmaking (dealing with in the next week)
  3. Requires precise replication of the transform at any given point (airplane dogfighting, ships and naval warfare)

How will I tackle these specific challenges? Are there any resources I can grok before descending into this task?

For reference, here is KrazyKarts: https://gitlab.com/Vivraan/krazykarts

twin juniper
# blissful saffron Not sure how you'd do it. The AI are owned by the server, not clients, so the en...

I don't believe there's any shortcomings here, since networked FPS was the primary function UnrealNetwork was designed to deal with (Unreal Tournament et al). I guess we're looking at a situation where we replicate physics in a buffered fashion -- record moves and play the impacts in a sensible fashion. Granted, no two clients will see the same thing, but this may ensure a smooth experience on all clients.

vague spruce
twin juniper
#

With max ping at 500ms and packet loss at 10%, the game always disconnects, causing the clients to load into their own levels as ROLE_Authority.

LogNetSerialization: Error: FBitWriter overflowed! (WriteLen: -1, Remaining: 7625, Max: 7625)
LogNet: Warning: Closing connection. Can't send function 'ServerSendMove' on 'GoKartMovementReplicator /Game/VehicleCPP/Maps/UEDPIE_2_VehicleExampleMap.VehicleExampleMap:PersistentLevel.BP_GoKart_C_0.MovementReplicator': Reliable buffer overflow. FieldCache->FieldNetIndex: 3 Max 4. Ch MaxPacket: 1024.
LogNet: UNetConnection::Close: [UNetConnection] RemoteAddr: 127.0.0.1:17777, Name: IpConnection_61, Driver: GameNetDriver IpNetDriver_47, IsServer: NO, PC: PlayerController_1, Owner: PlayerController_1, UniqueId: NULL:NARVRUL-F734C23F4F553B96089526802AC1D373, Channels: 11, Time: 2022.06.19-18.26.31
LogNet: UChannel::Close: Sending CloseBunch. ChIndex == 0. Name: [UChannel] ChIndex: 0, Closing: 0 [UNetConnection] RemoteAddr: 127.0.0.1:17777, Name: IpConnection_61, Driver: GameNetDriver IpNetDriver_47, IsServer: NO, PC: PlayerController_1, Owner: PlayerController_1, UniqueId: NULL:NARVRUL-F734C23F4F553B96089526802AC1D373
LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = ConnectionLost, ErrorString = Your connection to the host has been lost., Driver = GameNetDriver IpNetDriver_47
LogNet: Warning: Network Failure: GameNetDriver[ConnectionLost]: Your connection to the host has been lost.
LogNet: NetworkFailure: ConnectionLost, Error: 'Your connection to the host has been lost.'
LogNet: Browse: /Game/VehicleCPP/Maps/VehicleExampleMap?closed

Is there any way to prevent this from happening? I'm just testing extreme cases.

hollow eagle
#

500 ping is more than extreme, it's entirely unplayable so I'm not sure why you'd even care.

#

10% packet loss is also kind of crazy

vivid seal
# dense egret I'll look at some examples in Lyria I think. Thanks for the advice

Little late response, but you can absolutely use delegates, you just need a way to fire them on clients. Usually I fire delegates in OnReps of variables if the UI needs those variables, and on the server wherever I set the variables I just manually call the OnRep (just make sure you either guard stuff in the OnRep that shouldn't run on the server, or just manually fire the delegate on the server instead of calling the OnRep)

dense egret
vivid seal
#

some other keywords would be RepNotify (thats the blueprint version) and the uproperty specifier for it is ReplicatedUsing

marsh gate
#

Any tips for having two pawns for a player? I'm using Lyra and at first attempt it feels like there's no support for quickly switching between two pawns.

At least, the mapped inputs don't carry over. Its like Lyra binds inputs in the pawn.

Any pointers, cuz I'm pretty confused where to start. Atm when I switch the 2nd pawn none of my Gameplay Abilities can activate anymore

winged badger
#

it should run SetupPlayerInputComponent after possessing i think

#

you comfortable with c++ debugging @marsh gate ?

marsh gate
#

That makes sense, I'll look into SetupPlayerInputComponent

winged badger
#

can you locate the code where it binds gameplay ability inputs?

marsh gate
#

Yes

winged badger
#

also, i assume first pawn is not destroyed, so does it activate its abilities after possessing 2nd one?

marsh gate
#

I don't know yet as I am having a hard time even repossessing the first pawn, because it can only be done server side, and I'd like to do it via GA and not a RPC

winged badger
#

dedicated server setup?

marsh gate
#

PIE runs as client, so yes. I haven't build a dedicated server yet. But plan to

winged badger
#

your PIE option

marsh gate
#

Yes I checked dedicated server

winged badger
#

net mode when you drop down next to play button

#

well, for start you can switch to listen server

#

its a host and a client in one

#

figure out what you want to do without having to fight the network

#

then swap back to dedicated and implement it

marsh gate
#

interesting workflow

young spoke
#

Where would be the best place for a client to connect to dedicated server? Currently I have it in MyPlayerController::Begin() , but seems like that causes the map to be recursively opened over and over

winged badger
#

you should really go to pinned messages and read cedric's network compendium you'll find a link to there a couple of times

#

since this demonstrates that you don't know the very basics yet @young spoke

young spoke
#

i read it...

winged badger
#

your problem here is that your controller at the start

#

opens a map, which spawns new instance of that same controller class which calls BeginPlay, which opens the same map...

#

etc

young spoke
#

yeah, so how do you tell a client to connect to a server?

winged badger
#

you should really have some UI involved, so you need to click to connect

#

some automatic connecting can be done

young spoke
winged badger
#

but not if your MainMenu of whatever it is has the same class as your controller on the server map

#

and it is generally a good idea to have separate PlayerController classes for MainMenu, Lobby and Game

#

makes things... less convoluted in the long run

#

a very hacky fix would be to put that travel command inside if (GetNetMode() == NM_Standalone) block

#

then it would not trigger after the first connection, as your NetMode would be NM_Client then

young spoke
winged badger
#

yes, and GameMode GameState,, HUD, PlayerState and whatever else makes sense

young spoke
#

so MainMenu PC would open Lobby PC, Lobby PC would open Game PC and then no recursion

winged badger
#

no MainMenu PC would open Lobby Map, which has a LobbyGameMode, that says PC class is LobbyPC, which would not have the code to connect in BeginPlay

young spoke
#

Ok, i see

#

in the interim it seems like i need another check if(getNetMode() == ENetMode::NM_Client and is not already connected to server) to get my single PC example working

winged badger
#

when you start you will be NM_Standalone

#

if you're either server or client, that won't be the case

young spoke
#

cool, ill try that

random verge
#

are there any example repos out there to help get familiar with push model replication?

winged badger
#

the FDoRepLifetimeParams and MARK_PROPERTY_DIRTY_FROM_REPLICATION ?

#

push model

random verge
#

yessir. I see notes about checking out APlayerState for a real-world example but wondering if there's any repos out there really making full use of it throughout

winged badger
#

there is very little to it

#

you create FDoRepLifetimeParams

#

you do something like

#
void APowerConsumer::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);

    FDoRepLifetimeParams Params;
    Params.bIsPushBased = true;
    
    DOREPLIFETIME_WITH_PARAMS_FAST(APowerConsumer, bPermaDisabled, Params);
    DOREPLIFETIME_WITH_PARAMS_FAST(APowerConsumer, bHasSectorPower, Params);
    DOREPLIFETIME_WITH_PARAMS_FAST(APowerConsumer, bOverriddenNetworkManager, Params);
    DOREPLIFETIME_WITH_PARAMS_FAST(APowerConsumer, bLinkedObjectDestroyed, Params);
    DOREPLIFETIME_WITH_PARAMS_FAST(APowerConsumer, bIsActivated, Params);
}```
#

then mark property dirty when its changed

#

and thats pretty much it

random verge
#

no advanced scenarios that aren't documents in the comments?

winged badger
#

it can take replication conditions as well

#

and you can change the params then DOREPLIFETIME other properties

#

note that gains are fairly minimal

#

don't expect more then 10% shaved off of NetBroadcastTick

random verge
#

Appreciate the insight 🙂

vague spruce
#

should a projectile be replicated? i'm currently replicating a projectile because it's easier to get it to appear on everyone's screen but it feels laggy af

winged badger
#

hitscan never, physical projectile probably better to spawn it on each machine locally

vivid seal
#

there's a couple approaches, you can replicate a projectile with projectile movement component but it will have a delay for the person firing it. You can set up a system for predicting a fake projectile on the shooting client and then replace it (or not) with a server-spawned replicated projectile, and do some compensation to catch the server projectile up to where the firing client's projectile would be, or you can just straight up spawn local projectiles on each machine

winged badger
#

hitscan projectiles shouldn't be actors at all

vivid seal
#

also what zlo said, usually by projectile you are talking about "not hitscan"

vague spruce
#

yeah it's not hitscan. it's a fireball

#

takes some time to hit target

#

however, what you mean by hitscan? like, i determine the target ahead of time?

#

do a trace beforehand?

winged badger
#

you can replicate a starting point and the trajectory

#

instead of replicating an entire actor

vivid seal
#

hitscan just means instant hit, there's no actual travel time, you just line trace and instantly generate a hit

winged badger
#

then spawn them locally

vague spruce
#

yeah right but i'm wondering how that would be applicable to a projectile

vague spruce
winged badger
#

or, you can increase the actors net priority, recommend around 2,7

vivid seal
#

shooting client RPCs origin and direction to the server, server multicasts that to all other clients, who spawn a fireball projectile at the origin facing that direction, then u let each machine handle its own fireball

#

obviously only the server's can actually deal damage or whatever

#

the others are just visual

vague spruce
#

now that i'm here and there's some ppl around, i'm applying root motion to an actor and dude it's stuttering like crazy for the predicted one (but all of the other clients are fine)

winged badger
#

i think best network performance, especially if there are many of those flying around is single high priority, high frequency actor replicating (class, start point, trajectory)

vague spruce
#

like, the player that initiates the root motion on the simulated proxy sees a bunch of stutters but the other clients don't

winged badger
#

and spawning the projectiles locally when it get a new entry

vague spruce
winged badger
#

fastarray is better then tarray for this

#

as it has cleaner callbacks

vivid seal
#

i love that every conversation i've ever seen with Zlo in it ends up at fastarrays 🙂

#

they are pretty cool tho

winged badger
#

it is better, you don't need to diff the tarray which is annoying

#

especially since those projectiles don't live long and get destroyed as well

vivid seal
#

oh i agree, i just remember asking a really similar question a few months ago and you giving a similar answer

winged badger
#

it is the single best network tool in unreal engine 😄

vague spruce
#

@winged badger do you have experience with root motion and replication? i'm doing some network emulation and it looks horrrrrrrible

#

not sure how it would look in real world but i can't imagine it'd look any better

winged badger
#

use gameplay tasks

#

very little experience, as i didn't code that part myself, but i know they work well

vague spruce
#

so there's a gameplay task for this but it only applies to the current mesh, not another mesh

#

i have experience with gameplay tasks, i'll take a shot at it

winged badger
#

we have predicted abilities like jetpack jump that uses a root motion animation and a float curve for z offset

#

and its smooth

vague spruce
#

i'll try a gameplay task

winged badger
#

you using GAS?

vivid seal
#

can you use them outside of GAS? i vaguely remember trying to set root motion tasks up with my own ability system and it was kind of a pain

winged badger
#

you can we don't use GAS but we use GameplayTasks

vague spruce
#

yea i'm using GAS

winged badger
#

as far as i understand it best way is to give the enemies KnockedBackAbility

vague spruce
#

ah, right

#

i see

#

that's wild

#

ok

safe marsh
#

hey, is it possible for a client to send a request to a dedicated to change map?

#

before they connect in, basically the standalone has a map selection, and a server selection, it then sends a command to the dedicated to switch to the map they selected and connect to it

fathom aspen
#

You can talk to a server you haven't connected to yet using OnlineBeacons

safe marsh
#

thanks, So I am guessing I need to call the beacon while the server is running to run code to switch levels?

#

each level needs its own beacon actor, so I should spawn them via gamemode?

fathom aspen
#

I haven't played with them just yet so I can't clearly tell. Though my inner inclination says the GameMode class would be a good candidate

#

Or prolly whatever does the action of switching the levels, should at some point spawn the beacon actor

safe marsh
#

ok, Ill look into it thanks

civic seal
#

Hey guys, got a question for ya - what's the difference between SetClientTravel and OpenLevel when connecting to a server? I know either one is meant to work when passing in an IP, but the latter has an options parameter. That parameter is what I need for authentication with the third party thing we're using, to get the session key over to the server when the connection occurs.

Is there a way to pass in options with SetClientTravel? Anyway, I just don't know much about this so info would be great.

fathom aspen
#

You can tell what's the difference if you look at the source code:

void UGameplayStatics::OpenLevel(const UObject* WorldContextObject, FName LevelName, bool bAbsolute, FString Options)
{
    UWorld* World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
    if (World == nullptr)
    {
        return;
    }

    const ETravelType TravelType = (bAbsolute ? TRAVEL_Absolute : TRAVEL_Relative);
    FWorldContext &WorldContext = GEngine->GetWorldContextFromWorldChecked(World);
    FString Cmd = LevelName.ToString();
    if (Options.Len() > 0)
    {
        Cmd += FString(TEXT("?")) + Options;
    }
    FURL TestURL(&WorldContext.LastURL, *Cmd, TravelType);
    if (TestURL.IsLocalInternal())
    {
        // make sure the file exists if we are opening a local file
        if (!GEngine->MakeSureMapNameIsValid(TestURL.Map))
        {
            UE_LOG(LogLevel, Warning, TEXT("WARNING: The map '%s' does not exist."), *TestURL.Map);
        }
    }

    GEngine->SetClientTravel( World, *Cmd, TravelType );
}

As you see OpenLevel calls SetClientTravel and appends the Options string param to Cmd param in SetClientTravel.

#

OpenLevel is BP oriented with that Options param and the sanity checks, but essentially you can make your own CustomOpenLevel and do whatever you find suitable before calling SetClientTravel

civic seal
twin juniper
#

I'm having trouble possessing my pawns in the network mode of the editor. How can I possess my pawns?

twin juniper
stoic summit
#

Except EOS what are other options for voice chat on dedicated server?

#

Especially for multiplayer

twin juniper
#

Guess there's Steam

stoic summit
#

I've been facing lot of issues with voice chat lately

bitter oriole
#

No shit

#

So here's my 2 cents: a lot of players never want any voice chat with strangers if they can avoid it, and a lot of those who want voice what will rather arrange it with their friends on Discord

#

Having public server-wide voice chat is a great way to get everyone's game wasted by one 13y old edgelord

#

So you have technical options here that may work, but consider the impact on players

twin juniper
#

Alright so I've finally opened the sample I need to work on.

Here, these two airplanes can fly as usual, and they get replicated as one would expect, quite normally. It's just that there's a lot of rubber-banding and nonsense physical interactions that are going through.

I have a sample for replicating smoothly without using any physics, which utilises cubic interpolation. What are the steps in which I'll need to solve these current replication issues? The path seems to be to write a bunch of components which help replicate and commit movement (separately). There must be a buffer of movements that has to pass from the autonomous proxy to the server, but I don't know how to access that for Chaos Physics (writing one for vanilla Newtonian movement is fairly easy). Any light on this will be crucial for my sanity and continued efforts!

twin juniper
twin juniper
fallow shadow
#

how do i check if code is being executed on server in c++?

bitter oriole
fallow shadow
#

so i have a server RPC that runs

#

and is on server

#

i checked

#

but the RPC is supposed to create a line trace and execute a function on hit

#

and it just

#

doesnt

bitter oriole
fallow shadow
#

nah it is

#

i mean my weapon is not an UCLASS

#

so idk really

bitter oriole
#

Not an UCLASS obviously means it has no network support of any kind

#

Also that it's not UObject so I doubt it really isn't

#

What's the parent class?

fallow shadow
#

FGCObject

bitter oriole
fallow shadow
#

shit

bitter oriole
#

Just use an actor component

solar stirrup
#

Hey! Any idea why an actor replicated from the server would sometimes fail to spawn on clients? Reconnecting solves it.

[2022.06.20-11.57.33:500][979]LogNetPackageMap: Warning: InternalLoadObject: Unable to resolve object. FullNetGUIDPath: [421]NOT_IN_CACHE
[2022.06.20-11.57.33:500][979]LogNetPackageMap: Error: UPackageMapClient::SerializeNewActor. Unresolved Archetype GUID. Guid not registered! NetGUID: 421.
[2022.06.20-11.57.33:500][979]LogNetPackageMap: Error: UPackageMapClient::SerializeNewActor Unable to read Archetype for NetGUID 2474 / 421
#

It feels like if you connect too fast, it just doesn't spawn

worn wagon
#

So say you have a fire weapon function, and at the end of it you spawn a bullet decal or blood particles/whatever. Currently I am calling this on the owning-client to get the instant effect, and then doing a multicast to make it appear on the other clients. The issue is, this makes it run twice on the owning client. One solution is not to run it on the client, but then you get lag on the decal/effects, another obvious one would be only to send it to all other clients, but I don't believe there is a way to "skip" a specific client on the multicast. Is there a better way to approach this?

solar stirrup
#

Just check if the weapon is locally controlled in the multicast

worn wagon
#

Do you mean just check the owner?

solar stirrup
#

Oh right, yeah check the owner I suppose ^-^

worn wagon
#

Thanks for the suggestion

solar stirrup
#

Np!

fallow shadow
#

that makes sense

#

in more ways than one actually how havent i thought of that

bitter oriole
#

Good question

fallow shadow
#

quick question: i have a nonuclass class that's just a line trace for hitscan bullets, do i need that to be a UCLASS too or?

bitter oriole
#

No idea what a nonuclass is

#

Generally speaking, you want to use UObject for long-term objects that need GC support, networking, config, editor or Blueprint support

#

You can use structs, USTRUCT or not for simple data objects

#

For objects that have zero multiplayer or UObject stuff you can use raw C++ classes

fallow shadow
#

anyways i have this Multicast

#

it notifies every client that someone got hit with a bullet

#

i call it from the server

#

and then im told

#

if the multicast function is static, "static functions cant be replicated" but if its not static it finds an "illegal call of non-static member function"

#

so im kinda stuck now

fallow shadow
#

nvm

glossy pelican
#

hi, im new to unreal and im trying with a multiplayer fps, until now i have fixed every issue i was having unless one wich is that when the server shots the client sees the projectile but when the client shots the server cant see the projectail, im using a simple unreal engine 5 first eprson template and i have searched for a lot of tutorials but all of them are for ue4

marsh gate
#

@glossy pelican Most tutorials for UE4 are applicable to UE5.

Read the compendium:
https://cedric-neukirchen.net/

If you don't want to read it watch this:
https://www.youtube.com/watch?v=JOJP0CvpB8w

An overview of the essential concepts for writing multiplayer game code in Unreal, in under 25
minutes or your money back.

Sample project: https://github.com/awforsythe/Repsi/
Patreon: https://patreon.com/alexforsythe
Twitter: https://twitter.com/alexforsythe

00:00 - Introduction
01:24 - Net Mode
03:33 - Replication System Basics
05:13 - Acto...

▶ Play video
worn wagon
#

Is there any way I can access a replicated by default player pitch variable without the control rotation using the player's pitch? I don't want the whole player to rotate so I need that off, but outside of that I can't find a way to get the player's pitch on other clients. Will I need to manually replicate this?

#

I've been told this is expensive on the network

#

I have tried GetActorEyesViewpoint, and GetControlRotation

#

One value that works is GetPlayerViewPoint but this is part of the player controller and thus only exists on the owning client and the server

dark edge
#

@worn wagonGetBaseAimRotation?

#

The whole ControlRotation GetBaseAimRotation Aim yaw garbage BS is a clusterfuck.

#

Must be old cruft from back in the early days.

chrome bay
#

defo

#

UT/Gears stuff

worn wagon
#

Must have missed this function

dark edge
#

The question mark is because I wasn't even sure it was what you're looking for, I just know it's a thing that exists.

#

My game only has yaw aim lol

worn wagon
#

Worked like a charm 😄

dark edge
chrome bay
#

I think most people use it for characters tbh

#

It's pretty ingrained into them

fallow shadow
#

OOOOOOOk back with this issue again

#

User presses lmb -> The game does a server RPC that spawns* a hitscan bullet and it checks for hits, when it gets a hit it executes the OnHit function -> The server then executes a client RPC back making all the client stuff happen like playing an animation and sound

#

now following breakpoints this is what's supposed to happen

#

and if im testing with a listen server, the server user can fire and this is exactly what will happen

#

everything will work like a charm

#

but if its a client the issue is with *

#

it doesnt spawn the bullet

#

at all

#

the code runs

#

it just doesnt happen

#

the bullet class is an AActor that spawns in the world and does a line trace, then deletes itself

dark edge
#

@fallow shadowShow your code

#

Also why not just have the gun do the trace, why spawn an actor at all

dark edge
fallow shadow
#

The character you are playing as

dark edge
#

Show your code

fallow shadow
#

also I will later, i cant right now, but what part of the code do you need?

dark edge
#

Assuming everything is set up correct, want to make sure the bullet being destroyed isn't your problem.

quasi tide
#

I just use a Gun actor and then do firing logic there.

#

Subclass from it if you want different guns, or use data assets

dark edge
fallow shadow
#

i just want to make sure this works now, ill polish and optimize later

dark edge
#

So it's
Input -> RPC -> Spawn shot actor -> shot actor tells character -> rpc -> effects?

fallow shadow
#

Its more like
Input -> RPC (server) -> Shoot bullet and if hit registered do something -> RPC (client) -> effects

#

the client RPC is also called from the character

#

in the code the method that calls the client rpc is literally physically right after the line that shoots the gun

#

so it has to shoot the gun first before doing the client RPC

dark edge
#

If you're doing ANY rpcs within the shot actor you've painted yourself into a corner.

safe marsh
#
[2022.06.20-16.30.18:749][145]LogNet: NotifyAcceptingConnection accepted from: 86.20.33.198:51087
[2022.06.20-16.30.18:749][145]LogHandshake: SendConnectChallenge. Timestamp: 1483.425649, Cookie: 202199119232093004111184148088164050088252049082247037007247
[2022.06.20-16.30.18:814][147]LogNet: NotifyAcceptingConnection accepted from: 86.20.33.198:51087
[2022.06.20-16.30.18:815][147]LogHandshake: SendChallengeAck. InCookie: 202199119232093004111184148088164050088252049082247037007247
[2022.06.20-16.30.18:819][147]LogNet: Server accepting post-challenge connection from: 86.20.33.198:51087
[2022.06.20-16.30.18:820][147]PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)
[2022.06.20-16.30.18:820][147]LogNet: NotifyAcceptedConnection: Name: 0_AA_EntryMap, TimeStamp: 06/20/22 16:30:18, [UNetConnection] RemoteAddr: 86.20.33.198:51087, Name: IpConnection_2147482510, Driver: GameNetDriver IpNetDriver_2147482550, IsServer: YES, PC: NULL, Owner: NULL, UniqueId: INVALID
[2022.06.20-16.30.18:821][147]LogNet: AddClientConnection: Added client connection: [UNetConnection] RemoteAddr: 86.20.33.198:51087, Name: IpConnection_2147482510, Driver: GameNetDriver IpNetDriver_2147482550, IsServer: YES, PC: NULL, Owner: NULL, UniqueId: INVALID
[2022.06.20-16.30.18:880][149]LogNet: NotifyAcceptingChannel Control 0 server World /Game/Maps/0_AA_EntryMap.0_AA_EntryMap: Accepted
[2022.06.20-16.30.18:880][149]LogNet: Remote platform little endian=1
[2022.06.20-16.30.18:884][149]LogNet: This platform little endian=1
[2022.06.20-16.30.18:946][151]LogNet: UChannel::ReceivedSequencedBunch: Bunch.bClose == true. ChIndex == 0. Calling ConditionalCleanUp.
[2022.06.20-16.30.18:946][151]LogNet: UChannel::CleanUp: ChIndex == 0. Closing connection. [UChannel] ChIndex: 0, Closing: 0 [UNetConnection] RemoteAddr: 86.20.33.198:51087, Name: IpConnection_2147482510, Driver: GameNetDriver IpNetDriver_2147482550, IsServer: YES, PC: NULL, Owner: NULL, UniqueId: INVALID
[2022.06.20-16.30.18:950][151]LogNet: UNetConnection::Close: [UNetConnection] RemoteAddr: 86.20.33.198:51087, Name: IpConnection_2147482510, Driver: GameNetDriver IpNetDriver_2147482550, IsServer: YES, PC: NULL, Owner: NULL, UniqueId: INVALID, Channels: 2, Time: 2022.06.20-16.30.18
[2022.06.20-16.30.18:951][151]LogNet: UChannel::Close: Sending CloseBunch. ChIndex == 0. Name: [UChannel] ChIndex: 0, Closing: 0 [UNetConnection] RemoteAddr: 86.20.33.198:51087, Name: IpConnection_2147482510, Driver: GameNetDriver IpNetDriver_2147482550, IsServer: YES, PC: NULL, Owner: NULL, UniqueId: INVALID
[2022.06.20-16.30.18:979][152]LogNet: UNetConnection::PendingConnectionLost. [UNetConnection] RemoteAddr: 86.20.33.198:51087, Name: IpConnection_2147482510, Driver: GameNetDriver IpNetDriver_2147482550, IsServer: YES, PC: NULL, Owner: NULL, UniqueId: INVALID bPendingDestroy=0
#

trying to connect to a beacon on a dedicated server (works on local)

#

any idea why it automatically closes?

fallow shadow
dark edge