#multiplayer

1 messages Β· Page 707 of 1

latent heart
#

As in, the player's hand has hundreds of cards.

twin juniper
#

trying to tell the second player to use the same fixed camera position as the first player

hidden plinth
#

i worry about every byte πŸ˜› -- but perhaps it is premature optimization. Just wondering if there was something i was missing

latent heart
#

It may be that fnames are replicated as ints anyway

#

Though I doubt it.

hidden plinth
#

don't think so since the table lookup is machine dependent

latent heart
#

@twin juniper that will only ever operate on the first player

#

Yeah, that was my thinking too, adam.

twin juniper
#

it's working on a listen server?

latent heart
#

I mean, it might work on a listen server because each client is also running that code

#

But the loop will do nothing except operate on the same player controller over and over

#

Forever.

twin juniper
#

what is the correct way to do this?

hidden plinth
#

@latent heart @fathom aspen thanks for the replies. i'll use just fname and see if it's an issue

latent heart
#

I mean, if you just want to set a player to a static camera (and it doesn't really matter about authority)

#

Just remove the loop...

#

It should work fine?

twin juniper
#

works fine singleplayer, doesn't work at all in listen server without loop...

latent heart
#

Oh.

#

It'll be because the server resets the client back to its old camera position maybe?

#

On that object is that graph?

#

The player's pawn/character/whatever?

fringe dove
#

doesn't seem to

full error on ctrl-C is:

[2022.04.12-00.14.20:366][255]LogCore: FUnixPlatformMisc::RequestExit(bForce=false, ReturnCode=130)
Exiting abnormally (error code: 130)
Signal 11 caught.
Segmentation fault (core dumped)```
twin juniper
#

yeah

latent heart
#

Try the get player controller that doesn't take an index, but is actually the controller of the pawn in the graph

#

That should work fine. Probably

twin juniper
#

I'll give that a try, thank you

fringe dove
#

isn't ctrl-C already the 2 signal?

#

it says sig 11 in the log, but that is from the segfault where it crashes

fathom aspen
fringe dove
#

9 will hard kill and can cause data loss if you need to do anything on exit

fathom aspen
#

Yes that's why I thought CTRL+C was causing you problems

dusky yoke
#

Hey guys, yet another pleb question here. πŸ˜… How can I make this apply to each player's specific actor? Using this to activate/deactivate the player's rendertarget scope when aiming, but right now it's just getting 0, which is the server:

fringe dove
#

seems sigint sigterm and sigquit all crash

latent heart
dusky yoke
latent heart
#

I mean, the player would be the one triggering the event.

#

So you'd need some link to their currently equipped weapon and then its scope

dusky yoke
# latent heart I mean, the player would be the one triggering the event.

Yeah, right now the character is triggering the event in this manner: on event begin play Im getting all actors of the 8x scope (Im finding it extremely hard to cast to this actor without getting a failed cast, rarely struggle this much with casting lol, which is why I ended up using the Getallactors for this), and getting the reference for this. Once I'm aiming I'm casting to the scope's event which is running on owning client.

#

The scope is independent from the gun, as it derives from its own "attachment" parent

latent heart
#

The trouble you're getting is that every player is trying to use the server's (or player 0's) scope

#

Since you always get hte first object of "all actors"

#

You need to examine the hierarchy more carefully.

dusky yoke
#

Yeah, is there no way to find each specific player's actor within that array? πŸ€” I'll examine the system more thoroughly tho πŸ™‚

twin juniper
#

what is the multiplayer equivalent to player controller index?

latent heart
#

index 0 is always the local index

#

simsissle: sure, just check parents

#

But it's the wrong way to do it.

dusky yoke
#

GetOwner is the correct "get" here, for an object deriving from the Actor class, right? Man, I dont get why it wont cast. Oh well πŸ˜…

latent heart
#

Why are you casting the owner of the player pawn to a scope?

#

If you cast an object, like an actor, to a different class of actor, it's not going to search around your actor and find something that matches.

#

It's just going to try to cast what you give it (in this case, the owner of an instance of B_DemoCharacter)

#

Which is probably a player state or controller? Don't recall which.

dusky yoke
#

Oh, yikes! Yup, too late for me to be coding πŸ˜† Will keep headbutting the wall on this issue tomorrow, thanks for the help so far though @latent heart! πŸ™

twin juniper
#

is confused

dusky yoke
#

Oh btw, one more question before I dip, is it normal to show 4 spawned actors when Im just simulating with listen server + client?:

latent heart
#

The listen server will have 2 actors, the client will have 2 actors

#

= total of 4

dusky yoke
#

My scope is even more crazy:

latent heart
# twin juniper is confused

That is to say, 0 is always the local index when playing with a networked game with 1 person per instance. If you've got some sort of splitscreen setup, 0 will always be player 1.

sonic frost
#

i sniff a ue4 user still

twin juniper
#

how might you differentiate between client one and two?

gleaming vector
#

so

#

GetPlayerController at index returns the first player controller created for that game instance

#

so it will always be the local player's player controler

#

secondly, player controllers for other clients dont replicate

latent heart
gleaming vector
#

so there is no way to distinguish them

#

if it exists, it's you

#

the Player State is what you are looking for there

latent heart
#

Unless it's split screen, then you have all the PCs on 1 machine.

gleaming vector
#

right, split screen, the first N player controllers are the N split screen players

twin juniper
#

player state?

gleaming vector
#

also, in a listen server situation, you do have access to all player controllers

#

it's best to not trust that though, because that creates scenarios where code works when running on the local host but not as a client

#

and those bugs are a pain in the ass to debug

latent heart
#

@gleaming vector he's trying to change the camera of the players on beginplay, so wants the player controller for the pawn

gleaming vector
#

right, so get the PC from the pawn

#

if it's valid, it's you

latent heart
#

That's what I keep saying. 😦

gleaming vector
#

if it's not valid, it's not you

twin juniper
#

ahh

gleaming vector
#

you can check IsLocallyControlled() as well

#

that's you and you control it

#

helps in the listen server scenario when you have not you but exists

twin juniper
#

what about not me, and not guy2?

gleaming vector
#

i dont know what you are asking

twin juniper
#

on beginplay I'd like to tell all the characters in a multiplayer match to SetViewTargetWithBlend to the same fixed position camera that has been placed in the level.

gleaming vector
#

check to see if you are locally controlled, and if so, do the thing

#

that's super straightforward

latent heart
#

On beginplay in the character, get the player controller, check if it's null, if not set camera position using pc

#

Do not use the node which is "Get Player Controller Index 0"

gleaming vector
#

before setting the position

#

because listen server has valid PCs

latent heart
#

True true.

jolly siren
#

Why is APawn::Controller replicated to everyone, if controllers only exist on the owning client and server?
DOREPLIFETIME( APawn, Controller );

gleaming vector
fathom aspen
lost inlet
gleaming vector
#

you can OwnerOnly that

lost inlet
#

yeah except the net owner is nulled out at that point

nova wasp
#

isn't it replicated for controller rotation etc?

#

unless that's already in the pawn

gleaming vector
#

i forgot to mention here, but Instanced Subobject Replication is fixed in UE5!

#

a TArray<UMyObject*> that is UPROPERTY(Instanced, Replicated) where UMyObject is EditInlineNew now behaves as expected

#

rather than falling apart completely in UE4.x

#

(In 4.x, it would create an instance of everything, then replicate the server objects to the client, creating duplicates of every object in the array)

pallid mesa
#

oh nice!

#

iirc this was part of the requirements of a new feature, prolly gameplay features

grave notch
#

i tried new lyra sample and with ping 200 you getting roll backs pretty much on every single action (even for just movements), is it normal that game basically doesnt work with high ping (200 is not that much high?) or its just bad implementation?

bitter oriole
#

200 ping or 200 lag ? Because this is often confused since Unreal commands are lag (PktLag 200 means ~420ms ping)

#

200 ping is definitely worst case stuff IRL today

grave notch
#

200 ping in emulation settings for client and for server

#

but consistent (200-200, 0 jitter)

pallid mesa
#

200 for client and for server is quite a lot

bitter oriole
#

Just to clarify

pallid mesa
#

I bet they mean in the new netem contextual editor, which lets you inject server and client latency separately

chrome bay
#

Yeah if it's 200 for all of them, and it's set for both incoming and outgoing, that's like 800ms lag - which is way beyond the limit for character movements default settings at least

grave notch
pallid mesa
#

yes 200 in + 200 out per component

chrome bay
#

just have to add 'em up

bitter oriole
pallid mesa
#

as for profiling, network profiler, or net insights... also could check PS ping

grave notch
#

btw i have multiplayer question, i watched a lot of talk about multiplayer in games, basically all GDC, and other staff like patrick wyatt on handmadecon, but i never seen network like in diablo3, where it feels like you playing single player (basically everything predicted) and it works even with high ping without any delay, skill casts, projectiles, damage, enemies death are instant, rollbacks exist but its very rare. Whats the idea of writing multiplayer that is very tolerant to high ping/gives you feeling of single player game?

bitter oriole
#

An enemy dying for example is only something that's gonna get rollbacked if the enemy has a healing ability, or someone cheats

#

So you'll predict its death with almsot zero risk of rollback provided no heal is in sight

#

it's not like health is randomly gonna go back up

grave notch
#

i was thinking about high level of client trust, but how would it look like

latent heart
#

You might miss.

grave notch
#

ye, you can just miss your ability on enemy, since there is a lot of projectiles, and they arent even fast

bitter oriole
grave notch
#

so miss ability = no damage, no death

bitter oriole
#

Every game random is or should be a deterministic PRNG - the server should be running the same

#

Provided it's a random miss

#

If it's not random - it's okay because you trust the client on aiming anyway

grave notch
latent heart
#

You either assume everyone is cheating or you give some acceptable level of trust.

#

The latter will provide you with an overall better experience, but worse specific instances (cheating)

bitter oriole
#

You probably want to in fact grant the kill, provided it's not obviously cheating, because the client may in fact have seen a valid shot on their machine

#

Ideally you want to reconstruct the past scene on the server and check how unrealistic that shot is but usually you'd just run a few checks

pallid mesa
#

also, predicting damage worth it?

#

don't think so 😬

bitter oriole
#

You probably want to predict everything locally

pallid mesa
#

I'd predict muzzle, explosions, vfx, particles, animations... but damage? I'd wait for the server to tell me: okay!

#

otherwise it's too much hustle

#

the amount of headaches by handling damage prediction is just brutal

bitter oriole
#

Personally I like the way some MP shooters show blood when the server confirms the hit, so sure, why not

#

But say Diablo like game, reducing health locally, sure

latent heart
#

You can predict damage, update health bars or whatever, but actually destroying actors is probably a bit too far.

bitter oriole
#

Depends on the game

pallid mesa
#

I think it's sensitive in this case, personally I wouldn't touch sim proxy health values until I get a memo from the server, but again you could be given a series of requirements that asks for this specific bit to be done

#

it's a complex problem for sure

bitter oriole
#

Again, if your enemies never heal, and an enemy's health goes below zero - it's pretty much certain the enemy was actually killed

pallid mesa
#

to an extent, there are edge cases for sure, for example doing it all extremely server auth beyond certain ping-point

#

so shoot leading and whatnot if ping > threshold

grave notch
#

well diablo like games also arent pvp, so even if someone cheating it shouldnt be a big problem, unless they doing something that absolutely impossible, so basically if client said that he hits enemy its okay to assume he did that, but still need to check somehow that it was possible in theory to do so, idk, something like that i guess

#

but how its gonna look for another players is a question too

latent heart
#

In a game like Diablo, I wouldn't be too worried about ohw it looks for other people, if it's off a little bit.

bitter oriole
#

In any case you'll find that multiplayer code always comes with decisions on timings and how to update data and resolve conflicts - you'll answer the questions yourself when they come up

latent heart
#

There's so much spam on the screen anyway

pallid mesa
#

aye, what stranger says

#

thinking about shooters most of the time in my case

#

not sure why I often associate that all of you here are doing shooters

#

🀣

grave notch
grave notch
#

Okay, lets say i have a skill that creates projectile that hits first target, deals damage and destroys itself. I replicate projectile actor, but first i need to predict it on client, so i assume when i cast ability i create projectile locally without replication, and then, when i cast ability on server i create another projectile but with replication (but not for client that casted ability, since its already predicted for him?) and after that when projectile hits someone on client, i need to tell server that i hit someone, so how should it looks like, because i cant just trust about any client hit, i need to check that hit was hit from specific ability/projectile, and probably check if projectile on server is not far away from that target i hit on client?

pallid mesa
#

you can always pass in the spawn transform in the server and predict explosions and such in the client, but actually perform the damage using the server projectile. So this is indeed a bit tricky with gas, because you should wait for the spawn transform to arrive the server

#

and you can indeed forward simulate client latency in the server projectile so client and server projectile are more or less in the same position

#

main recommendation if you want to use actors

#

look at this:

chrome bay
#

Epics own suggestion on all of this is "predict as little as possible"

#

Nothing about Unreal is lockstep or deterministic, projectile prediction in particular can be a minefield of miss-predictions

#

And it's far better to just accept a bit of visual latency, than starting/stopping explosions of effects mid-cycle because something went wrong

#

There's also different approaches to consider for fast vs slow projectiles, or really "bullets vs rockets" etc.

grave notch
chrome bay
#

That can't happen

#

The RPC's would have to be reliable, one to fire the shot, the other to say "I hit something"

pallid mesa
#

correct

grave notch
#

what you mean it cant happen, i predict projectile locally, so it doesnt exist in server yet

chrome bay
#

But you tell the server that you spawned one

grave notch
#

im looking into high level client trust kind of system

chrome bay
#

That RPC will arrive and execute before the client hit one would

#

The next problem is that because of jitter and because client/server are running at different rates, there's a good chance the server projectile hasn't moved anywhere yet

#

So verifying the projectiles position isn't any use

pallid mesa
#

what you can have in slow moving projectiles and high ping scenarios is that the client projectile hits someone even before the server projectile has spawned

#

in that case you can simply trust and verify

#
  • was this shoot possible? -
#

since the timeframe window is little (client ping)

#

you can get away with it

grave notch
chrome bay
#

That's not how I'd do it

#

And it also defeats the point of prediction

grave notch
#

how it should be then?

chrome bay
#

To do prediction properly, you send a "shot" RPC and a "hit" RPC. You also have to identify them with a common handle like an incrementing uint16

#

You also assign that handle to the server projectile so that when you receive it, you can reconcile it with your predicted projectile and "sync" your predicted one to the server one

pallid mesa
#

well it depends on the approach, but yeah

chrome bay
#

You can't replace your predicted one with the server one either, because effects and sounds will break etc. There's different ways of doing it, but UT's way sucks honestly

winged badger
#

it should be doable

pallid mesa
#

in the UT code I shared, they do spawn a client projectile until the server one replicates

winged badger
#

as long as you don't cheapen out on uint8 for IDs

#

but use something like a full Int

#

as long as server and client can spawn the projectile with exact same name reliably

chrome bay
#

Also UT gets away with it's system because weapons are heavily tied to character movement

winged badger
#

you can spawn it on client and network it after the fact

pallid mesa
#

right after the server spawns the projectile you can reconcile, but it will look like the projectile moved backwards a bit, won't it?

grave notch
#

well lets say sync visual part of projectile is not that important for now, im more interesting in how to trust client when he makes hit from that projectile, i didnt understand about sending 2 RPC

winged badger
chrome bay
#

The Client sends a hit, and says "I hit this person at this location"

#

The server receives it, rewinds the hit actor to where it was on the client when it hit, and verifies if the hit is close enough

#

It's a heuristic approach so you have to allow some tolerance

pallid mesa
#

won't u need to rewind the character movement aswell? o_O

#

ideally, I suppose

winged badger
#

first thing they'll try is having some other player teleport right in front of the bullet locally, as they fire

#

then report that as a killshot

chrome bay
#

If you want decent lag compensation then you will have to rewind the player back yeah.

#

And also check they didn't fire the projectile through a wall

#

We do this by resimulating the whole flight path

#

But that's fine because it's not an actor, it's just a data-based bullet

#

And we also don't replicate server projectiles back to clients either

pallid mesa
#

oh is there any example of player rewinding @chrome bay

#

i always wanted to implement it but I dont know where to start

chrome bay
#

not AFAIK, maybe UT has something but IDK

pallid mesa
#

i know for sure fsavedmoves can help, doesn't it?

chrome bay
#

It's not too difficult, you just keep a history of transforms on the server and timestamp them

#

When you receive a hit, rewind it back by the shooters' RTT

grave notch
#

i need it for pve, not pvp, and there will be a lot of hits happening every second, so i dont think rewinding everything would be a good idea, can i just trust client for his hits without rewinds, and somehow check if hit was possible at all (like it was hit from specific ability and that ability cast verified)?

chrome bay
#

you can but players will cheat

#

If you don't rewind and validate hits, it's an easy cheat

pallid mesa
chrome bay
#

capsule only

#

pointless trying to test mesh

#

capsule + a tolerance

grave notch
#

if cheats are just hitting targets that you actually didnt hit, but in theory could, then it doesnt rly matter

chrome bay
#

You'd be surprised what they can do

pallid mesa
chrome bay
#

We just trust clients for headshots

pallid mesa
#

oki

chrome bay
#

And check it's near top of capsule

twin juniper
pallid mesa
#

thanks for sharing!!!!!

chrome bay
#

The teleport cheat basically requires you to validate the hits

#

If you care about cheating ofc

#

in PVE you might not

grave notch
#

well i just need some validation so its not possible to deal more damage or damage to enemies that somewhere projectile cant be at all (like behind the wall)

chrome bay
#

ATEOTD it's a complex topic and there isn't really a one-size-fits-all solution for every game

#

What we do works for us because all our projectiles are bullets and visually we don't have to care about it

twin juniper
chrome bay
#

But you'd be amazed how hackers find their way around things

#

If you're using actors/slow moving projectiles, my opinion is it's not worth the hassle to predict them, just accept the latency and use SSHD

twin juniper
chrome bay
#

for bullets/hitscan stuff, it's a bit easier

pallid mesa
#

btw before i go, did you have time to do something about the master initialization thing we spoke about a while ago Jambax?

chrome bay
#

Fortnite doesn't predict projectiles

#

You press fire, a short while later the projectile appears

#

but fortnite has so many players that the latency is usually unnoticeable

#

Like 30-80 ping, you're probably not going to even see it

twin juniper
chrome bay
#

yeah figures

pallid mesa
#

I have a comment about this

#

but I can't

#

so just wanted to interject that what you are saying might not be true in the current version

twin juniper
#

Im still wondering if they have a custom PMC since they have some snipers projectile based with highhhhhh projectile speed

pallid mesa
#

so they indeed might be predicting projectiles

chrome bay
#

This is pre-proper hit reg

#

Can't find the teleport one

pallid mesa
#

anyways gtg take care you all

#

just saying, in fortnite they might be predicting projectiles πŸ˜„

chrome bay
#

Fortunately, they can't do that anymore in ours πŸ˜„

pallid mesa
#

also James saw the thing above?

chrome bay
#

yeah what did you mean master initialiation thing?

pallid mesa
#

remember that you told me u wanted to put some code together and possibly a blog post about a master initializer for stuff and tracking native events

#

you can click in the link for more info

#

ie: new players added to the ps array callback

grave notch
# chrome bay If you're using actors/slow moving projectiles, my opinion is it's not worth the...

i rly dont want to make latency, because in games like that you playing solo 99% of the time, it seems like a waste to force players to have latency, in diablo3 they predict everything. But now when i think about it again, simply trust to client hits form projectiles is not good, if its aoe damage projectile in theory it can hit everything on the screen, even if its small aoe, but i cant check if client actually hit everyone or just 1 enemy, without some projectile emulation on the server

jaunty stream
#

i have made an ue5 dedicated windows server but if i start it crashes but idk why or yes but dont know how to fix

chrome bay
jaunty stream
chrome bay
grave notch
#

well ye, since you need to show them to other players

chrome bay
#

Play the old ShooterGame sample and fire the projectile weapon, you can see how little impact low-latency really has visually

#

If it's any consolation we don't predict any of our explosive projectiles or grenades etc, and regularly have players at 300 ping or more - it's not even come up as a complaint once

#

Granted though, we're not a twitchy shooter

#

If you were making some super-fast high stakes arena game, it probably wouldn't suffice

grave notch
#

as i understand most part of the ping hidden in animation time

pallid mesa
#

do u implement projectile interpolation for non authority roles?

#

using pmc

chrome bay
#

nooop

pallid mesa
#

fairs! πŸ˜„

chrome bay
#

Literally the most primitive implementation ever

jaunty stream
#

Can anyone help me with my server problem?

pallid mesa
#

so the client rep projectile simulates aswell

#

receivelocandrot does this job

twin juniper
chrome bay
#
LogWindows: Error: Missing operator for attribute, type IntegerAnimationAttribute was not registered previously```
#

Get used to reading log files πŸ™‚

jaunty stream
#

Yes i know Tath i am missing files but don’t know how to fix

chrome bay
#

Sounds like you haven't cooked the project?

#

You know you have to package a dedicated server from a source build of the engine right?

jaunty stream
#

Yes

#

I did tath

#

I followed a tutoriul

#

U build from source

#

I*

chrome bay
#

Yeah then File->Package->Server. That should be it

jaunty stream
#

I selected server target package server

#

But if i start up it don’t work

chrome bay
#

Unfortunately there's not much else to go on, you'll have to attach the VS debugger and try to find out why it's crashing and where

#

Also since this is UE5, expect instability

jaunty stream
#

And how can i do tath

#

Do I need to press cook content first?

chrome bay
#

No, it should cook as part of packacing

#

Build a DebugGame version

#

Then launch it through visual studio

#

That's about as much help as I can be at least

jaunty stream
#

OkΓ© i am now building debug game

shell leaf
#

Anyone know whats up with advances sessions on UE4.27? I was testing my game with some mates yesterday. Didnt change any code, went to test it again this morning but cant find any sessions.

#

Here are my blueprints for creating sessions and populating the server screen

jaunty stream
#

i build the debug

#

but it is an exe

#

how can i open it in visual studio

#

@chrome bay

twin juniper
#

hello guys so how to do bool true and false in multiplayer c++

#

UPROPERTY(Replicated, VisibleAnywhere, BlueprintReadOnly, Category = WallSystem, meta = (AllowPrivateAccess = "true"))
bool bIsBuildingWall;

#

i set this var

#

void AHeroCharacter::Checking_WallorFire()
{
if (bIsBuildingWall == true)
{
GEngine->AddOnScreenDebugMessage(-1, 5, FColor::Red, FString::Printf(TEXT("%s"), bIsBuildingWall ? TEXT("true") : TEXT("false")));
}
else
if(bIsBuildingWall == false)
{
GEngine->AddOnScreenDebugMessage(-1, 5, FColor::Red, FString::Printf(TEXT("%s"), bIsBuildingWall ? TEXT("true") : TEXT("false")));
}
}

#

when ever i press 1 key it set to false and when i press z key it set to true

#

in server side its happening good but when coming to client its not setting to true

chrome bay
#

Probably changing it too quickly

#

Also you added it to GetLifetimeReplicatedProps yes?

twin juniper
#

yes i did

#

do i need to add server to checking_WallorFire() function?

bitter oriole
#

fwiw that entire function should be just ```cpp
GEngine->AddOnScreenDebugMessage(-1, 5, FColor::Red, FString::Printf(TEXT("%s"), bIsBuildingWall ? TEXT("true") : TEXT("false")));

twin juniper
#

i didnt get u @bitter oriole

jaunty stream
#

i build the debug
but it is an exe
how can i open it in visual studio
@chrome bay

twin juniper
#

You attach the debugger to it

bitter oriole
#

So, just remove all the if else

twin juniper
#

then its working fine in standalone and listen server

regal solar
#

have you guys tried AWS GameKit?
I just tried package project with this plugin & this showed

twin juniper
#

its not working in client only

jaunty stream
#

i did the debug and i got this

#

'ProjectXServer.exe' (Win32): Loaded 'D:\ProjectX\ProjectX\Game\Unreal\debug\WindowsServer\ProjectXServer.exe'.
'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'.
'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'.
'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'.
'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'.
'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\win32u.dll'.
'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'.
'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\gdi32full.dll'.
'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\msvcp_win.dll'.
'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'.
'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'.
'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'.
'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'.
'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'.
'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\shell32.dll'.
'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\shlwapi.dll'.
'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'.
The thread 0x47ec has exited with code 0 (0x0).
'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\msvcp140_2.dll'.
'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140_1.dll'.
'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\msvcp140.dll'.
'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140.dll'.
'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\xinput1_3.dll'.

#

'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\xinput1_3.dll'.
'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\setupapi.dll'.
'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\cfgmgr32.dll'.
'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\bcrypt.dll'.
'ProjectXServer.exe' (Win32): Loaded 'C:\Windows\System32\kernel.appcore.dll'.
The thread 0x123c has exited with code 3 (0x3).
The thread 0x1d4c has exited with code 3 (0x3).
The thread 0x20dc has exited with code 3 (0x3).
The program '[16596] ProjectXServer.exe' has exited with code 3 (0x3).

bitter oriole
#

You want the callstack, not the log. These are fine.

jaunty stream
#

and how do i get callstack?

bitter oriole
#

It's one of the windows in VS.

jaunty stream
#

i cant find it

bitter oriole
#

Debug -> Windows -> Call stack

misty peak
#

If on hit, I want an actor to attach itself to another actor, is it good idea to do something like this? Is this kind of attachment performence heavy or could it lead to issues?

OnImpact(const FHitResult& InHitResult)
{
    if (!HasAttached)
    {
    if (GetLocalRole() == ROLE_Authority)
        {
             HasAttached = true;
             AttachToComponent(HitResult.GetComponent(), FAttachmentTransformRules(EAttachmentRule::KeepWorld, EAttachmentRule::KeepWorld, EAttachmentRule::KeepWorld, true));
        }
    }
}
jaunty stream
fathom aspen
#

Also GetLocalRole() == ROLE_Authority can be substituted with HasAuthority()

misty peak
#

Hm, ok so thats comforting atleast. Now I just have to wonder if I even should be attaching or if I can achive this a different way.
Oh, and thats good to know, always nice to clean up a bit.
But yeah, I don't know why but I don't like my first idea of just attaching an actor to another actor on hit. Basically I want to make it so when this hit, after a time it will do radial damage based of where its attached too.

#

I just kept it an actor so the mesh and partilcle effects would still be seen and move with whatever its attached too

fathom aspen
#

Is this like a sticky bomb?

misty peak
#

Sort of yeah, like a sticky projectile since I want its effects to be implemented in different child classes.

#

Like some acting as a dot, or other like effects.

fathom aspen
#

Yeah attaching would be a good idea I think, considering that the target actor might move after the projectile got stick with it

#

As long as you want to render that projectile on the target actor mesh, you would need to attach that projectile to the mesh somehow

jaunty stream
#

I am missing aqProf.dll and VtuneApi.dll and VtuneApi32e.dll but were do I need to add these files is error when I launch my dedicated server

misty peak
#

Yeah, hah I've gotten the code to a point where it works fine but I'm always wanting to review it and optimize it...
Also, the destruction of an actor has to be multicast/ run on server & client right?
And yeah, thats another issue is making sure the component I'm colliding with i'm not jsut attaching to a collision box that looks like its floating.

fathom aspen
misty peak
#

Ahh, ok. I litertally just realized that I was only disabling my particles on clients and destorying on server so I got worried. Thanks for this!

jaunty stream
#

Does someone know where i need to add aqProf.dll and VtuneApi.dll VtuneApi32e.dll because my dedicated server error say i am missing these

blazing spruce
#

Hi, what's the deal with steam and ping only ever showing as 9999? is there an actual fix for this?

lost inlet
#

Is that a photo of a computer screen

latent heart
#

It looks like it's taken through a window too.

#

@jaunty stream if you're using Discord from your PC, win+shift+s -> paste into discord.

jaunty stream
#

No I am on my phone now I installed windows on my MacBook and don’t have discord installed

#

I know win shift s

latent heart
#

Oh. Okay. πŸ™‚

dark edge
#

You can use any computer that can fire up your server.

#

You're welcome. For debugging, have you started by just launching the game on seperate computers? It's a good idea to have a spare laptop or something that can launch the dedicated server without having to build, for fast iteration.

shell sorrel
#

Is that OK to do the possess/unpossess from the game mode (server side) will it get replicated somehow ? Or I do need to mirror the possess/unpossess calls ?

dark edge
low helm
#

definitely do not "mirror" possess calls

shell sorrel
#

πŸ‘

lyric skiff
#

Hey so i have a system where players moving a pawn drains a resource.... right now i have it so it on tick it checks if they're in the same position or have moved (only while the pawn was being controlled) but I was considering a way of doing it that uses the input (WASD) but no idea how to check that on the server to not allow cheating

#

also might wanna make it less resource intensive

#

any opinions or comments welcome

#

maybe just feed the input to a function thats run on the server to move them but it feels like it'd be jarring on the user end

low helm
# lyric skiff Hey so i have a system where players moving a pawn drains a resource.... right n...

Does the server need to know about this resource, can you just put it on client side? Are you really worried about cheating?

If the server really needs to know, a server-side Tick based calculator which modifies a Replicated Variable is probably necessary. The only optimization at that point would be to write it in C++. You can also run the tick slightly less often, and have the client interpolate his display to make it appear as if its smooth.

lyric skiff
#

server needs to know

#

and I am not worried about cheating as i don't think my game will get really big or maybe even get published but i'd rather do it correctly

low helm
#

location based ticking is probably ideal, do it on client side to relax yourself even more

#

just do it

lyric skiff
#

by server side tick are you referring to checking location and comparing it against last known location?

low helm
#

you deserve it

#

you gotta treat yourself

lyric skiff
#

lol

low helm
#

yeah just location checking is ideal, measuring movement inputs is a needless mess

#

unless there is some "other" forces that also affect movement that you don't want burning fuel

#

like explosions that push you

lyric skiff
#

there are other ones that effect movement so yeah another good reason to make it input based

#

there are movement decreases and stuff which the only effect would be increasing the resource used per unit moved

#

and yeah, explosions and whatnot

low helm
#

ok that's fine do that, but like I said, don't listen to the "Put Everything on Server" crowd. Unless your game is really in danger of attracting cheaters, don't worry about it.

In your movement logic, it's not uncommon to have some vector somewhere which is a combination of all movement input

#

And you can use that to determine fuel cost

lyric skiff
#

its like, not correct though to have it client side

low helm
#

dude this isn't kindergarden

#

you're an adult

#

correct is what you say it is

lyric skiff
#

this is how you get games like new world lmao

low helm
#

Doing it on server introduces all manner of "incorrect" inconsistencies

#

anyway, post pics of your setup if you want more feedback, but I gtg soon

lyric skiff
#

i'm trying to move completely away from the method of my current set up so i don't think it'll be much use but here it is

#

its also probably got a lot of issues

#

the exec is coming from ontick

low helm
#

So doing ABS off of X and Y is bad math

#

remember Mr. Pythagoras

#

just GETVECTORLENGTH off of the whole vector

#

Are you using a movement component or custom logic?

lyric skiff
#

its essentially the same as thirdpersonmovmeent

#

i'm actually getting kinda confused on how it works... i did this a while ago and originally had my controller feeding movement into the pawn

low helm
#

Yeah some other event is driving those ones pictured

lyric skiff
#

lol yeah i can't find it on my controller though

low helm
#

You could add up those vectors before they are applied

#

and GETVECTORLENGTH of it

#

to boil down movement into one number

#

then AddMovementInput just once instead of twice

#

gtg

lyric skiff
#

k thanks for the help man

lyric skiff
#

This "set brush color" keeps reading none but it works when tested, I think its because the server is also attempting to do it when playing on listen server and the server doesn't have access to the arrays or something.... i'm unsure what to do

#

like i said everything is working it just gives me an error for every time this is run

harsh lintel
#

I'm rep notifying an array of actors, but the items of the array are not valid on the rep notify function, what could I do?

fathom aspen
lyric skiff
#

from an server function

lyric skiff
#

its too big to get a good screen shot

fathom aspen
#

You don't have to

lyric skiff
fathom aspen
lyric skiff
#

same class as the function calling it

fathom aspen
#

SetSkillBoxColor is in widget class

#

But what is the name of the class you are calling the RPC from?

lyric skiff
#

bp_piece

#

its a pawn

fathom aspen
lyric skiff
#

sorry i'm dumb lol

fathom aspen
#

Ok the setup seem be fine, the thing is that probably the index you are accessing is out of array bounds

#

Did you debug your code?

lyric skiff
#

debug how?

fathom aspen
#

Ok you're accessing none on the array

#

This can't be the server accessing the array because the RPC is being executed only on the client

#

So it's probably an index that out of array bounds

fathom aspen
lyric skiff
#

the places feeding the numbers cannot be out of bounds?

#

they can only feed 2-7

fathom aspen
#

Watch the value of Level parameter when that RPC executes and make sure it's in array bounds

lyric skiff
#

kk

fathom aspen
#

How big is that array? I didn't see it

#

I don't know how you make it

lyric skiff
#

its 2-7 with 1 and 2 null

fathom aspen
#

Huh

lyric skiff
#

rather 0 and 1 null

fathom aspen
#

Ok that's it

lyric skiff
#

hold on

fathom aspen
#

You said it

#

1 and 2 are null

lyric skiff
#

yeah my bad

fathom aspen
#

That's what it's pretty much telling you

lyric skiff
#

no its 0 and 1 that are null and the numbers fed in should only be 2-7

fathom aspen
#

Still it isn't safe at all

lyric skiff
#

see its definitely running twice, this is a print statement that happens when i choose the ability which is where it starts

#

oh

#

i think its cause the learn ability function is multicast

#

crap

fathom aspen
fathom aspen
lyric skiff
#

yeah so i guess if you run a multicast function that calls a run on owning client it runs the latter function twice?

harsh lintel
#

can I use ReplicateSubobjects on an array of AActor* or is it only for UObjects?

fathom aspen
#

AFAIK it's for UObjects that aren't AActors

fathom aspen
lyric skiff
#

yeah i just figured that if you call another function that is run on owning client after that it would go back to only running on the client

fathom aspen
#

Client RPC executes on owning client

#

So a client is executing something twice

lyric skiff
#

it says client1 and server both run it though

fathom aspen
#

So you're doing something wrong

lyric skiff
#

well at any rate its fixed

#

lol

fathom aspen
#

Have you read about RPCs?

harsh lintel
fathom aspen
lyric skiff
#

alright i'll take a look. I've read about them a bit but I still get them confused a lot

fathom aspen
#

Practice makes perfect

#

But still you need to understand really how they work

#

Like calling a multicast + client rpc is something no one would want to do

lyric skiff
#

yeah when i get desperate for something to work i just start switching stuff around to see if it works

#

and then forget

#

anyway thank you for your help man

fathom aspen
# lyric skiff and then forget

That's why I keep that Compendium(#3 pinned message) by my side all the time. You aren't supposed to remember how everything works at any given second, but the more you look at things the more they sit better in your brain

lyric skiff
#

thanks for the advice

#

appreciated i'll keep it in mind

fathom aspen
#

You might need to show how you set the values and other related info

#

Also what type of actors are the array

harsh lintel
harsh lintel
#

bp

#

but I do know c++

fathom aspen
#

Cause one time you say RepNotify and now AActor* πŸ˜„

#

Ok good

fathom aspen
#

You would need to show the code that sets the values for the array

harsh lintel
#

that's how I add a value to the array

harsh lintel
fathom aspen
harsh lintel
#

When the ability system component is initialized on the server

fathom aspen
#

Hmm ASC

#

That's not something I have experience in yet

#

So probably that has to do with it

harsh lintel
#

I think it has to do with the replicated actors not being replicated yet, but the pointers are indeed replicated

#

Maybe someone else knows what's up

#

the ability system plugin wouldn't have anything to do with the issue

fathom aspen
# harsh lintel

So you say that Event BP Server... executes on the server?

harsh lintel
#

yes

#

I just need to know how I'm supposed to know when the pointers of the replicated array are valid

#

because they are valid, but not on the Rep Notify

fathom aspen
#

The array pointers point to actual objects in memory. The objects in memory need to replicate first of all, and likewise the pointers

#

So I'm not sure what you trying to say

#

Ahh ok so they are not null, out of that Rep Notify event

harsh lintel
#

They are null until the spawned actors are replicated, yes

fathom aspen
#

Yeah it makes sense

#

That's how it should behave

#

And because the rep notify is for the pointers(when the pointers change value, i.e from null to an actuall address in memory) then you get that call back only when the values change

#

So I don't think there are race conditions there

harsh lintel
#

Yeah but I was wondering if there wasn't some UE4 feature, to know when the objects/pointers of the array are valid

#

Yeah I guess it wouldn't make sense, but I thought of a workaround

dark edge
fathom aspen
echo pasture
#

real quick question, since theoretically there is only one player controller on clients, would calling APawn::GetController on a client return a nullptr if that pawn is not the player pawn

peak sentinel
echo pasture
#

: D

faint eagle
#

What the hell does it want from me? The signature of a function for an event seems to be correct but the compiler seems to complain on some unresolved constructor for an enum so what the hell do I do?

#

also this is UE5 (despite the folder names). It compiles fine in UE4

#

works fine with a lambda though πŸ™ˆ

thin stratus
#

Probably the one that refs the ENetworkFailure enum

livid mist
#

How would I go about replicating an action that applies velocity on tick? No matter what I try I can't get it working correctly.

#

Basically when you press a button, it enables ticking of the component, and the character takes the velocity from that and adds it to character movement. But the server is not seeing the velocity for some reason, only the client.

#

Also when I mess with the event tick within my character, sometimes it completely breaks my walk replication and they jitter all over the place, and it doesn't get fixed even if I undo my changes. No idea why that happens.

jaunty stream
#

Does someone know ue5 http api plug-in?

bitter oriole
jaunty stream
#

But blueprints

bitter oriole
#

Then no

thin stratus
#

It's mapped to timestamps

#

If you alter stuff from outside it will go offsync

#

You can't just set the velocity

#

I mean you can but then you have to do it on all ends, so server and client, and you have to live with an initial little correction whenever it changes

#

If you need it to change velocity speed on key press, like sprinting, you should tie it into the CMC directly

livid mist
#

You mean like editing it with C++?

thin stratus
#

Not edit but extend with your own child in C++

#

There is no BP solution to this, at least not with the same quality and without problems

#

Peeps will tell you the initial correction is tiny and not worth extending the CMC for but the truth is that it's not just sending the key input to the server that the CMC does. It also handles replaying moves on corrections and what not

#

It will forever be a hacky problematic solution if you do it in BP alone

livid mist
#

Well that sucks, because I don't know C++

thin stratus
#

Yeah.. multiplayer without c++ is a tough one

livid mist
#

I just happened across it, idk if it's legit

#

It's only a few days old

thin stratus
#

Idk

#

Like, the questions give you the same thing I would say: It's not possible in BP alone.
I've worked with the CMC and my own Pawn based one for years now and I would be very surprised that there is a BP only solution. The CMC has a lot of "inner" code, that handles a lot of stuff that is impossible to inject code into with BPs alone.
Just the saved moves the Client did that are replayed on a correction would not work with BPs. Your best bet is to buy it, check the code, see if it's absolute garbage or not and if it is garbage, refund it and leave a negative review.

#

Heck it's sometimes even impossible to inject code into it in C++ cause it's missing overrideable functions

#

I've seen a lot of BP Marketplcae Project that state XYZ and when you open it you want to puke

livid mist
#

Yeah...

#

So this, for example, is impossible to replicate? (this is just a test)

thin stratus
#

The title must be accurate and descriptive for the product to be approved by epic

twin juniper
#

hi guys

thin stratus
#

That's such a lame argument

livid mist
#

hmmm

thin stratus
#

Epic doesn't test the freaking code thatm uch

twin juniper
#

On the subject of dealing with client side latency, is there any good resource for reading about how do deal with these issues in C++? I'm trying to learn to code my stuff to support running in dedicated server mode more and I'm trying to find better resources then just the basics on unreals docs.

thin stratus
#

They check if it compiles and the folder hierarchy is fine

thin stratus
livid mist
#

So for me to make a proper flying system for multiplayer I would need to make a child of the CMC and do it entirely in C++?

thin stratus
#

I would advice so, yes

livid mist
#

internal screaming

thin stratus
#

So it... doesn't replicate, replicate

#

But it is set on everyone

livid mist
#

Wait, it does?

#

That makes so much sense because the other player gets the velocity too

thin stratus
#

But you are completely throwing client prediction, reconciliation and all those systems the CMC has out of the window

twin juniper
#

You mean system as in what systems i'm making or what im releasing on?

#

so iam trying to call weapon data using datatable when iam trying to in stand alone its working fine but when i did multiplayer i added server to its crashing and unreal is closing any idea how to do?

#

iam doing in ue 4.27 c++

thin stratus
#

Releasing on is usually named "Platform" (:

livid mist
#

Can I add the velocity in some other way besides event tick?

thin stratus
#

One thing you can do is play around with the AddMovementInput that the client calls

livid mist
#

That could possibly work too

thin stratus
#

Cause that is locally called for the Client to tell the server that it wants to move into a given direction

twin juniper
thin stratus
#

But that is obviously limited by all the things that modify the InputVector

twin juniper
#

so iam trying to call weapon data using datatable when iam trying to in stand alone its working fine but when i did multiplayer i added server to its crashing and unreal is closing any idea how to do?
iam doing in ue 4.27 c++

thin stratus
#

So, I mean, try it

livid mist
#

Yea

thin stratus
#

Otherwise, harsh truth, don't make a Multiplayer game

#

This is not the only roadblock you might hit

thin stratus
#

If you need help, you'll have to provide that

#

And alongside that the code that is causing the crash which you can identify using those two

twin juniper
# thin stratus That depends largely on the system you want to make "nicer" in terms of latency

Well, i think my issue is maybe more basic in terms of understanding. Most of the things I'm working on personally don't really care about clients input, but I want to better understand things that can come up if I did. Like, I've been working with some first person shooter templates to try and add features for learning sake but I guess besides the basics, I don't really know what pitfalls there are to watch out for

pallid mesa
#

if your sprint doesn't require any fancy, you can get away simply setting maxwalkspeed on cli (including owning) and server... that's the popular blueprint way

twin juniper
#

I'm sure some of the things aren't unreal specific, but I'm unsure where to look to learn more.

thin stratus
# twin juniper I'm sure some of the things aren't unreal specific, but I'm unsure where to look...

Hm, there are the concepts of:

Prediction: Performing the Action on the Client alongside the RPC that tells the Server to perform, letting the Server know about the result (via the RPC), and then sending a Correction in case the Server doesn't get to the same result, or acknowledging the move.

**Reconciliation: ** This is basically the idea of putting an incrementing number on your RPCs, and the Client saving a number of "moves" locally. If the Server sends back an update after performing the movement (may it be a correction), the client already performed a lot more moves since that original RPC was send. The Client can then use the number to check which exact move got correction, throw all the old stuff away, apply the data from the server and replay all the stuff the client did since then, which will stop it from being reset super far backwards (more on higher pings).

**Interpolation: ** Then the concept of interpolating between two sets of data, because you won't get an update every frame, you might start seeing jumps from last update to the new one. So here you interpolate based on whatever data you have between those.

https://www.gabrielgambetta.com/client-server-game-architecture.html

You can read a bit about this stuff here.

It is however very much a Movement Issue in this article and those concepts are mainly to be found when performing movement.

But some of it makes sense for general systems as well. Predicting the reload of a weapon.
Interpolating the float value of energy that your ability uses. Reconciliation of switching between your weapons when the Server notices you can't do the switch you did 200ms ago (don't have a better example).

#

There is also the point of it being unnecessary to even implement some of this for some systems

twin juniper
thin stratus
#

You will find a lot of peeps here who will tell you that having a super complicated system for reloading with all those concepts applied is a waste of time

twin juniper
#

here is the code

thin stratus
#

Which one is line 49

twin juniper
#

every time new line error is coming ing

#

Yeah, I'm sure the are a ton of cases where I don't want to implement something myself as its not necessary, but yeah I just want to understand what happening under the hood a bit more. This is perfect though, thank you a ton.

thin stratus
#

UE only really uses those things in the CMC

twin juniper
thin stratus
#

And maybe in the Network Prediction Plugin which is still not rlease..

thin stratus
#

What is calling the BuildWeapon function

twin juniper
#

when ever i press some key iam calling

#

it

#

its working in standalone

#

and also id i set this to owning client its working

thin stratus
#

Can you show me where you are calling it

twin juniper
#

when its coming to server or net multicast

#

its not working

twin juniper
#

this is in character .cpp

#

this is the function when i call it

#

from the above this function is calling

#

all the server side code iam doing in bp

twin juniper
thin stratus
twin juniper
#

yes it is

thin stratus
thin stratus
twin juniper
#

can i send u header one?

pallid mesa
#

only issue i see is that it's example specific, but otherwise it's pretty nice

thin stratus
#

If it's valid, you have nothing to lose

#

If it's invalid, you know that the issue is not inside the BuildWeapon function

vivid lichen
twin juniper
#

its header

thin stratus
#

Yeah that tells me nothing kinda

#

Despite the fact that you aren't marking it as replicated

#

So the Client would never have a value in that

twin juniper
#

@thin stratus dude can we connect? once

thin stratus
#

Cause the only thing I see is that you call SetWeaponRifle on input and you access the EquippedWeapon

#

Check if it's null

#

And the EquippedWeapon is not replicated, which is strange to me as usually Weapons in Multiplayer Games are replicated Actors spawned the by Server

#

But there might be reasons I guess, still check the pointer please

vivid lichen
#

Ok we will get back to you after doing this check

shell leaf
#

I know that the GameMode isn't available to clients. But I was under the impression if I called a server RPC from the client I could call a method on the gamemode. Is there any way round this? My server respawn event is never called.

#

This print statement isn't executed either, even though it's called before the client tries accessing the gamemode via a server RPC

dusky yoke
#

Hey guys, Im using my GameInstance to store a variable to track which gun a player picks before loading into a game from the main menu level. Kind of a dumbed down weapon loadout, but anyway. When I host a session and Ive chosen M4 for instance, and my friend joins after choosing a sniper, he still gets the M4. Is that because the gameinstance is controlled only by the server? What should I do to bypass this issue?

chrome bay
#

GameInstance is local only

#

The Client would need to tell the server what weapon they've chosen before the server tries to spawn it for them

dusky yoke
#

On begin play Im doing that, Im checking what weapon it is, but youre saying I should run that through an event run on server?

chrome bay
#

You have to

#

The server doesn't know what clients have selected in their local game instance

dusky yoke
#

I didnt think about that πŸ˜… Thanks a lot!

upbeat basin
#

Is there any difference on making RPC parameters const reference or not?

#

Okay correcting the question, what's the difference between declaring const reference and non const non reference paramteres for RPCs? I'm being forced to make my FString const reference. But not for my custom struct that I'm sending with the same function. What's the difference and why is the enforcement?

chrome bay
#

Because you can't modify RPC parameters

#

So to avoid any confusion, UHT encourages you to mark them as const ref to make it clear

#

Also the source data passed into the _Implementation portion of the RPC from the networking system is const

#

So the only option is const ref or copy

upbeat basin
#

I don't know how the underlying replication works, does it still make me get rid of an unnecessary copy if I make it reference?

#

And why it's enforced for FStrings to be sent as reference and not copy (and also why not for other structs)?

thin stratus
chrome bay
#

IIRC the point at which to pass a const ref vs a copy is usually if the type is >64 bits, or larger than the platform pointer size, but there's probably some other nuance I'm not aware of

shell leaf
#

It's an actor that a player can walk up to and when prompted, purchase a player respawn

thin stratus
#

The actor is probably not owned by the client

#

ServerRPC have to go through client owned actors

#

E.g. character, PlayerState, PlayerController, replicated components on those or actors that are spawned with the owner pin being set to e.g. the PC of a specific player

#

Or afterwards having their owner being set to a PC of a specific player but that must happen on the server

shell leaf
#

Ahhh, so could I route it through the purchaser's player controller?
Also, if the actor isn't owned by the client, who is it owned by? Are actors owned by the server by default? If so, is there any need for it to be an RPC?
(sorry for asking so many questions, I'm quite new) πŸ™‚

thin stratus
#

You can route it through the PlayerController, yes

#

They are owned by the server then iirc, yes

#

It being owned by the server doesn't remove the need of an rpc as you are still on client side with your code

shell leaf
#

Thankyou v much for the help πŸ™‚

terse nymph
#

hi

#

how to modding games?

#

to fortnite?

bitter oriole
terse nymph
#

Δ± need team can you help me guys?

bitter oriole
#

You haven't posted a question (this channel here is for multiplayer programming in Unreal Engine)

#

This isn't a Fortnite channel nor a recruitment channel

latent heart
#

However, if you want a team to make fortnite mods, you're going to either need 1) a lot of money or 2) made skills to impress people to join your team

#

I'm guessing you don't have the second one!

minor anchor
#

@terse nymph Hi! Please keep anything recruitment related to the Job Board channels, the #instructions channel has info on how to use them!

real ridge
#

guys tried someone make a dedicated server in unreal engine 5 ? i tried but I have problem when launching server from CMD some erorr i made it same way as in ue4 but id does not work

quasi tide
#

I'd say it's worthy of a pin personally.

copper jacinth
#

I'm trying to use RPCs to send GGPO data, which is in the form of char* normally, but I'm storing them in an FString so I can send them through the RPCs, but when I store the char* in an FString and convert it back, some data isn't the same. Specifically the very first character changes. Does anyone have a better solution for sending the char* or, if not, have any idea what I can do about the char* conversion issue? The conversion issue is probably a question for a different channel.

hushed maple
#

I'm inexperienced with multiplayer and have a question.

I want to create a single map where players online can buy/sell parts of the map to each other. I'm trying to get a general idea of what's possible (before I go looking to hire a more experienced dev)

Don you think EOS (online service) could handle these multiplayer trades? Also would it be possible to set it up so the maps metadata could be updated simply through amending datatables?

blazing spruce
#

Hi, im trying to make it so if there are 2 or more players in the session, it'll start a countdown timer to start the game after X amount of time, but im having an issue actually referencing the session, is there a way that I can reference the session properly so i can use the GetCurrentPlayers node?

dusky yoke
#

How can I play one sound for the owning player & a different sound for the other players & listening server? Need to make footsteps attenuated for players & non-attenuated for the owning player. I guess I could split it up with two different events, one multicasted and one for the owning client, but not sure how I would check if it's the player or other clients

thick scroll
#

If I set NetEmulation.PktLag to anything higher than 0 I get rubber banding / choppy movement on clients while using the CharacterMovmentComponent. What the hell is up with that?

short arrow
dusky yoke
nova wasp
thick scroll
#

@nova wasp I've not changed the default implementation and I'm calling the move functions as follows:

`void AAdvancedFirstPersonCharacter::MoveForward(float Val)
{
if (Val != 0.0f)
{
// add movement in that direction
AddMovementInput(GetActorForwardVector(), Val);
}
}

void AAdvancedFirstPersonCharacter::MoveRight(float Val)
{
if (Val != 0.0f)
{
// add movement in that direction
AddMovementInput(GetActorRightVector(), Val);
}
}`

nova wasp
#

is anything changing maxspeed?

thick scroll
#

Yeah, MaxSpeed is changed when sprinting, crouching or going prone. But the rubber banding happens even when the character walks normally.

#

I change the stances and sprinting by allocating new moves in FSavedMove_Character

thick scroll
#

Do I need to handle all changes in state in OnMovementUpdated rather than in UpdatecCharacterStateBeforeMovement?

glass cave
#

Hey there, i'm trying to make a online pong game but i have multiple problems with online, the first problem is that only the hosting player will have the camera, the one who is joining will not have it. the otther problems are about player not spawning, and score replication(I think I know how to fix that).

pastel escarp
#

How to spawn an actor on specific clients Only ? so only these clients can see it and other clients don't ?

bitter oriole
#

Spawn it, done

pastel escarp
bitter oriole
#

How to spawn an actor on specific clients Only ?
Make the actor not replicated, call Spawn Actor on those clients

#

If you want to do that from a server, you would use a Client event

vale haven
#

You wouldn't run the spawning function from your server, as that would generate it on the server, and then it would be very hard (impossible?) to replicate it to one client and not the others. Instead, you want to run the process on the owning client.

fathom aspen
vale haven
#

Yes. I guess it's really a question of what specifically is trying to be accomplished?

#

Because the server doesn't need to be aware of all objects, like things of a cosmetic nature, certain ui elements etc.

fathom aspen
#

Well I guess the only way to make the server knowledgeable about the actor and still replicate it some clients would be to use the Replication Graph

#

But considering I haven't used the RG before I could be wrong

vale haven
#

If it's something with physics, gameplay functionality, or any element that is going to interact with other gameplay elements, then you want the server to be in charge of it. If you're just trying to hide it from one player or another, there's probably a better way of going about that.

hybrid thorn
#

Hey people! Sorry for interrupting your discussions, I need some help with understanding extrapolation and position correction on moving and rotating platforms, is anybody familiar with this?

fathom aspen
hybrid thorn
#

My main problem is because of the latency lag, player jitters little bit on platforms, i did lots of research and still didnt fix my problem 100%, i got some improvement with this topic, but jumping is still a big problem, i could join vc if anyone is free

https://forums.unrealengine.com/t/multiplayer-how-to-get-smooth-character-interpolation-on-moving-platforms-without-jittering/108500/12

vale haven
#

Hmmm. You're already really breaking into the nitty gritty math here.

hybrid thorn
#

yeah, it is crazy thing
today i found out that multiplayer games are not real time, so that's my main point in a way of fixing my issue

vale haven
#

What's the use case? Maybe if I can understand the goal a little better here.

hybrid thorn
#

You asking me, right?

vale haven
#

Haha yeah it's a little nutty how much a fraction of a second can matter.

#

yes I'm asking you πŸ™‚

hybrid thorn
#

okay, so i have rotating platforms with little slice cutted out of them, and on my level 6 of those platforms stacked on top of each other, player has to get right timings to jump trough them to get on the top, it works great in singlepalyer, but in multiplayer with lag simulation via Clumsy i have really bad jitter going on

#

I can record video right now

vale haven
#

That's okay, I get the idea πŸ™‚ no need for a vid.

hybrid thorn
#

and also those are the same mechanic, but on differenent axis
they also have that jitter problem while player standing on them

vale haven
#

Competitive game?

hybrid thorn
#

No, its Coop platformer

#

Also this is how i do my rotations with Ping compensation
Basicly i get the server world time + ping and im getting float from curve by this time and applying this number to certain axis

vale haven
#

Your game is so pretty

hybrid thorn
#

haha, thank you, I'm about to release beta version on steam, so things going kinda crazy

vale haven
#

Tell me about it πŸ‘€

dark edge
vale haven
#

Whenever something like this pops up in a co-op situation my first thought process is, is there a way to help it along from the client side

#

Because if it's cooperative you're not really worried a much about cheating as you are a smooth, consistant experience.

hybrid thorn
#

yeah, that is true

#

So what i also did in my character is i turned True those two params
ServerExceedsAllowablePositionError and ServerShouldUseAuthoritativePosition

#

those two made 70% of the magic and I almost got rid of lag, it is still there but much much less than it was before

vale haven
#

Okay. So server is 100% driving control of these positions. There's nothing we can do then to manipulate them from the client side, right? If we've got server authoritative positions.

hybrid thorn
#

yeah, right

#

since it is all hooked up with steam, I'm hosting games as a listen server

#

give 1 min, i'm recording a video, its really hard to explain everything

vale haven
#

So just to clarify, is there any particular gameplay issue you're experiencing or is it just a jittering?

#

Like this isn't an issue of folks falling off the platform or anything?

hybrid thorn
#

no, player can stand on platform without jitter

#

but when it comes to jumping - here all lags kick in

vale haven
#

Ahhhh

#

would it be possible to coordinate the jump with the client-side rotation?

#

the issue you're having is when you jump the rotation you actually go is different, maybe just slightly, from the one the client thinks they are going in?

#

I'm not sure I understand what you're saying...

bitter oriole
#

Hard to do "really good" when the physics engine sucks - the one in 4 isn't deterministic and Chaos is way too new

#

If it works at 100ping it's fine

#

What's "bad" in your mind?

hybrid thorn
#

here, im uploading video

bitter oriole
#

fyi, that might in fact mean 400-800ms ping

hybrid thorn
#

for your information

bitter oriole
#

You should log the actual ping value and confirm what you're actually testing

bitter oriole
#

300ms ping is absurd

#

Realistic ping today is 50ms - 100 is already bad

hybrid thorn
bitter oriole
#

300ms ping is auto-kick stuff

vale haven
#

Hmmm. I'm also noticing that you seem to get electrocuted earlier than the lightning beam is displayed

hybrid thorn
#

yeah, thats known bug, dont mind that xd, i still didnt fixed it

#

its just not replicated yet

bitter oriole
#

Physics aren't replicated and yeah you want a custom movement component with rollback & replay

#

That or client auth

#

(but cheats)

vale haven
#

I'm just wondering if it might be related to your position issues. I get what you're saying though, because the issue only seems to show up when you jump. While walking your position remains consistent.

hybrid thorn
#

yeah, while standing on static platforms - player jumps and double jump in sync and everything seems fine

#

but when players stand on even slightly moving platform - its all junky

#

okay, here is question, for syncing platforms position i use server clock, and for clients I add ping value, should i actually add or subtract it?

eternal canyon
#

and u dont worry about cheating

#

i would just use client auth movement

hybrid thorn
#

whats that?

vale haven
#

That would mean making your client be in charge of a character's position, and having the server copy that information

hybrid thorn
#

yeah! that's what i need!

eternal canyon
#

can be enabled with like two checkboxes in CMC

eternal canyon
#

yup

hybrid thorn
#

yeah, still having that issues, should i also check something in replication section?

vale haven
#

Wait, you have ServerAuthoritative checked somewhere else don't you?

hybrid thorn
#

where it could be?

hybrid thorn
#

yeah, it in my character

#

in cmc

vale haven
#

So maybe this is a reading comprehension issue on my end but ServerShouldUseAuthoritativePosition sounds like it's giving authority over position to the server...

hybrid thorn
#

so you saying that i need to set it to false?

vale haven
#

If the client and server are competing for control over position, it would definitely create some weird interactions.

hybrid thorn
#

is making client auth movement in blueprints only possible?

hybrid thorn
#

i mean is it possible without touching c++ lol

eternal canyon
#

its prob something with ur platforms

eternal canyon
hybrid thorn
#

hm, okay

vale haven
#

It is possible, yes.

#

Do your movement events act on the client or the server?

hybrid thorn
#

on client and on server

#

well, i move on client, but jumps and other interaction are replicated to server

vale haven
#

That should be covered by the character's position being replicated. You shouldn't need to also replicate the jump on the server.

hybrid thorn
#

well, cause i have my own custom jump function, i'm replicating "Launch character"

#

or i should disable that for client auth movement?

vale haven
#

Even then, anything relating to changing position should be running either only on the server, or only on the client, like by using a "has authority" switch

hybrid thorn
#

oh i see

#

wow, okay, I should try that

vale haven
#

Things like playing animations and spawning the little puff effect are totally fine being run seperately, but because the character's position itself is already being replicated, if you have the client moving him, and then the server also moving him, with 150ms delay inbetween, then you have two competiting sources of position information for UE4 to sort out.

#

So since it's only an issue when jumping, I would definitely start by looking at your custom jump function and rule out any conflicts there. πŸ™‚

hybrid thorn
blissful saffron
#

Anyone have ideas why my subclass of PlayerState wouldn't be in use when it's selected in GameMode?

hybrid thorn
#

What do you mean in use?

blissful saffron
#

well, my code isn't working to use the ASC on the PlayerState. So investigating why, the PlayerState is not my CBasePlayerState, instead it's just the default PlayerState

#

I checked it with C++ logging and a blueprint cast, both of which fail to cast to my CBasePlayerState and instead it's just the standard PlayerState

hybrid thorn
#

Hm, don't know about ue5 much, but i guess its either something with gamemode overrides or just file error

#

well playerstate doesnt load instant after game is launched, it takes time to load

#

that's why it always failing at casts

blissful saffron
#

I'm putting in a 0.2s delay

hybrid thorn
#

i use this setup for getting playerstate

#

it takes sometimes 2-3 secs

blissful saffron
#

but it should be loaded pretty quickly

hybrid thorn
blissful saffron
#

ok

#

with a 5s delay, it still fails

hybrid thorn
#

hm, so something might be in your gamemode

blissful saffron
#

something is different in ue5, this works in ue4, not sure what it would be

hybrid thorn
#

yeah ue5 weird, still haven touched it yet, so can't say much just good luck :/

blissful saffron
#

thanks

solar stirrup
#

You should just fire an event in your playerstate's BeginPlay()

#

That way you get it the second it's ready

thick scroll
flint frost
quaint tendon
#

Is it possible to view the previous map that was loaded or if it's possible to tell the game just loaded?

Game loads a splash screen level on first load then if in game in a different map and the player gets booted by the server they get sent back to the splash screen map (because it's the default map). Want to only play splash video once on init load then if server boots player want to not show the video again in the splash level.

flint frost
chrome bay
flint frost
chrome bay
#

That will only work if the spline is relevant at the time you multicast, it would probably be better to replicate an array of points

#

Anything stateful should be done with properties generally

flint frost
#

Im sending the spline points to individual clients

chrome bay
#

yeah, you don't want to do that

flint frost
#

Oh, so i should have a property that is updated by the server and then the client fills in everything?

chrome bay
#

yep

#

From an OnRep callback or something

flint frost
#

Okay yeah that is more efficient

chrome bay
#

Otherwise, if a client joins late, or they leave the relevancy area and go back to it, the points will all be gone

past seal
#

How do i pass custom options through servertravel?

#

i know this is how you would do it with openlevel, but how would i do it with servertravel console command?

chrome bay
#

Depends, if you're seamlessly travelling to a new level with the same gamemode, the options string from the previous level should be preserved IIRC

#

Oh actually, nvm

past seal
#

yes im using seamless travel

#

but what is a preserved iirc?

chrome bay
#

I don't think you can do it in BP actually

#

Since ServerTravel is invoked via a console command right?

past seal
#

yup

chrome bay
#

yeah in which case I don't think you can in BP alone

past seal
#

was thinking i could do something like this

chrome bay
#

Worth a try

past seal
#

WinningTeam is a variable in the other gamemode

chrome bay
#

Ah you know what, you might be in luck

#

WinScreen is you mapname right?

#

You should be able to do it as you've done it above

#

And just keep appending options

past seal
#

yup

#

sweet πŸ˜„

#

was just unsure about if the syntax was right

chrome bay
#

UEngine::HandleServerTravelCommand is what parses the options from the map name

#

It seems to look for the first ? separator

past seal
#

or if i needed ?OptionString=? or something

past seal
chrome bay
#

So everything after that ? is treated as the options string

past seal
#

but are you sure that this variable i have in gamemode will be treated as an option?

#

or do i have to specify the game mode with ?game= first?

chrome bay
#

You might have to put the game mode first, but I'm not sure tbh,

neon phoenix
#

Heya! Me and my team are currently prototyping our multiplayer game idea. We're going for the simple solution of connecting to a listen server, but everyone (4 others all on different locations and networks) can connect to each other, except me. The one that's hosting it has opened the correct port and everyone can connect to it, except me. Does anyone know what the problem might be? I've tried different computers and different networks as well, so at this point it just feels like I'm cursed πŸ˜…

empty axle
winged badger
#

I find it and set it during InitGameState in base GameMode shared by both lobby and game

#

Works like a charm

past seal
#

wait so this actor is shared from matchmap to lobbymap then?

#

ah wait, it is all just gameinstance isn't it?

winged badger
#

No

#

Its a custom actor, instantiated by gamemode that has a pointer to it and added to GetSeamlessActorTravelList in an override in base gamemode

#

That actor persists through seamlrss travel both from l8bby to game and game to lobby

#

Travel map gamemode also has to persist it in same manner

#

It has nothing to do with gameinstance, its replicated, and gamemode also sets pointer to it on gamestate, so its sccessible by clients

past seal
#

does the gamemodes have to be a child of the same class?

#

also how do you add an actor to the travellist?

winged badger
#

It doesnt, but its convenient to have a base gamemode thst handles everything shared between lobby and game

#

Or youll find yourself duping code

chrome bay
meager fable
#

How to properly leave a session?

    Online::GetSessionInterface()->DestroySession(NAME_GameSession);
    GEngine->ShutdownWorldNetDriver(GetLocalPlayerController()->GetWorld());
    GetLocalPlayerController()->GetWorld()->ServerTravel(TEXT("/Game/DefaultMap?game="+UGameMapsSettings::GetGlobalDefaultGameMode()+"?returningFromGame=true")
                                                         , ETravelType::TRAVEL_Absolute);

Works for the client but if the listen server calls it kicks everyone(expected) but doesn't travel

forest bolt
#

Hey guys, can someone give me a quick explanation on Behavior Tree/Blackboard replication? If I try to access a blackboard key on the client, it will have the correct value?

low helm
#

I don’t think anything is replicated on behavior trees. Those types of variables should be present on the character itself

bitter oriole
#

Replicating AI at all is... a decision

#

AIs are Controllers - they typically do not exist at all on clients

#

Same way a player controller doesn't replicate to clients, other than the owner

high ibex
#

hi all, regarding patching system, youtube videos show upload and download from local server ( maybe setting in same PC) but how to upload pak files like amazon or google and download from there ? as applying the pak file is all how we code and requirement, but how to download from server ?

bitter oriole
dawn nova
#

Hello guys, when we upgraded to Unreal Engine 5 we have a problem when using ReplicationGraph, the game keeps perpetually creating and destroying the PlayerState, not allowing the player to spawn. When we turn off the ReplicationGraphDriver, it works normally. Does anyone have any idea what could cause this to happen?

chrome bay
#

Could be your custom implementation keeps thinking the PS is relevant/non-relevant?

#

Is it destroying it client side or server side?

hollow portal
#

im trying to get the interaction system to work in multiplayer only the server can interact with things clients can see the server interact but cannot interact themselves

high ibex
high ibex
hollow portal
#

only client 0/client 1

#

on the server i get only server

#

it seams to depend on the who interacts now

high ibex
# high ibex oh, google playstore is the platform

they have introduced some asset delivery concept instead of obb files .. (like i checked now and i got to know ) , so i am not sure whether this will give patching and also one of my tests is that .. individual files also should download ..like pubg mobile ( after login, maps, sounds packs etc will download and apply right) so like that i am trying to achieve

hollow portal
#

ok so on the server it prints client 0 and client 1 twice and server once
on client 0 it prints client 0 and on client 1 it prints client 1

fierce fiber
#

Does anyone have a tutorial for split screen multiplayer on how I can teleport the player pawn of different controllers?

prisma snow
#

Are there data limits (size) per RPC?

fierce fiber
#

Im trying to teleport all split screen players to a location, but for some reason it doesn't work, does anyone have any ideas?

twin juniper
#

Is it possible to have a listen server send its data through a relay server to clients and vice verse,

#

In case NAT traversal isn't possible?

#

If I want the calculations, work and processing to be still done on the listen server side but have a relay server between client and listen server?

#

Would changes have to be made to the actual networking of the engine to achieve this?

shadow aurora
#

So changing the relative location of a component on the server is seemingly not updating the location of that component's children on simulated proxies. The parent component itself is definitely having its relative location updated. What are my options here? Is there something obvious I'm missing haha

twin juniper
#

Are the components replicated?

shadow aurora
#

They should be... But I can verify

#

So neither the parent nor the child are set to replicate explicitly. Which is weird because the parent one is definitely getting its new position rep'd down from what I can tell

twin juniper
#

they should both be set to replicate iirc

sinful tree
# hollow portal im trying to get the interaction system to work in multiplayer only the server c...

You can only call Run on Server RPCs on owned actors, so this won't work unless the player calling the interact interfaces owns the actor. The appropriate way of doing this would be to run the RPC on the actor that is currently calling the interface (probably player controller or the player's character/pawn) passing through a reference to the actor you want to interact with, then when running on the server, call the interface.

#

Also, that multicast may not be necessary. You may want to make an onrep boolean variable to control the material being changed.

chrome bay
#

there's not

#

Use physics and make them client authoritative

#

It's basically the only way to do any kind of remotely complex vehicle sim

#

In UE, anyway

dawn nova
# chrome bay Is it destroying it client side or server side?

It works fine on our testmap, but when we load our main map, we can see in the world outlier that the PlayerState is being constantly recreated, and we are unable to move or do anything, like each second it destroys the playerstate and a new one is made, which makes it so the naming goes like PlayerState1, PlayerState2, PlayerState3, etc endlessly. I'm not sure if the world outlier shows the server or client side?

chrome bay
#

It shows whatever the main editor window is

dawn nova
#

I've also tried setting it to always relevant in the constructor, which unfortunately didn't work for the main map

#

And in our replicationgraph class rules we have AInfo set to always relevant too, which should technically add the playerstates to the always relevant node

chrome bay
#

worry about it when you have enough players to cheat

#

Put it this way - Fortnite uses client-auth and some basic anti-cheat

#

If it works for them, it can work for most others

quasi tide
#

Ah yes - the Fortnite test 🀣

chrome bay
#

The only test we need πŸ˜„

quasi tide
#

(Not saying I disagree mind you)

chrome bay
#

I wasted years trying to do server-auth physics, complete waste of time and effort

#

Net Prediction looked promising, but even Epic couldn't get it working

#

And even then, it's not scalable

quasi tide
#

I haven't needed to use the client auth part yet - does it just have the client tell the server the data and the server then just automatically replicates that to others?

ember dagger
#

Can someone help me understanding replicating add force? currently Im calculating the influence the floor has to determine slide direction and then, locally im adding force -> server event to add force -> multicast event to add force. This works fine at high latency for a single slide, but once I try to add chaining slides on landing and the built up speed increases, a lot of jittering is visible. Is there a better way I should be doing this?

dark edge
#

Something physics driven without prediction isn't too bad, I got a project that does it.

steel gust
#

Anyone used motion warping with replication?

quasi tide
#

Haven't used it at all personally - but I'd imagine it'd be mostly handled locally.

glass cave
#

does anyone know how to share the same camera across multiple client on a online project ? my camera is only working on host client

thin stratus
#

You don't really share the same camera

#

If at all you share the same ViewTarget with the same CameraComponent

#

Which then still might need replication in form what whatever changes the rotation of that camera

glass cave
#

since the camera don't move i guess it don't need replication, so do i need to create another one for each client ?

plucky prawn
#

so i have a UFUNCTION with the Client specifier yet its being run on the server? i put a breakpoint inside the function and its saying the netmode is NM_DedicatedServer

fathom aspen
plucky prawn
#

but really how do i even debug this?

fathom aspen
plucky prawn
#

ACharacter

#

its .. sort of working