#multiplayer
1 messages Β· Page 707 of 1
trying to tell the second player to use the same fixed camera position as the first player
i worry about every byte π -- but perhaps it is premature optimization. Just wondering if there was something i was missing
don't think so since the table lookup is machine dependent
@twin juniper that will only ever operate on the first player
Yeah, that was my thinking too, adam.
it's working on a listen server?
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.
what is the correct way to do this?
@latent heart @fathom aspen thanks for the replies. i'll use just fname and see if it's an issue
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?
works fine singleplayer, doesn't work at all in listen server without loop...
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?
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)```
yeah
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
I'll give that a try, thank you
Try kill -2 pid
isn't ctrl-C already the 2 signal?
it says sig 11 in the log, but that is from the segfault where it crashes
I actually don't remember, maybe 9...
9 will hard kill and can cause data loss if you need to do anything on exit
Yes that's why I thought CTRL+C was causing you problems
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:
seems sigint sigterm and sigquit all crash
Is the "actor class" the class of the actor in that graph?
The actor class that Im getting is the scope, which contains the code for applying the material. I want that to just run on whatever player's activating the code in my aiming function
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
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
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.
Yeah, is there no way to find each specific player's actor within that array? π€ I'll examine the system more thoroughly tho π
what is the multiplayer equivalent to player controller index?
index 0 is always the local index
simsissle: sure, just check parents
But it's the wrong way to do it.
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 π
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.
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! π
is confused
Oh btw, one more question before I dip, is it normal to show 4 spawned actors when Im just simulating with listen server + client?:
My scope is even more crazy:
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.
how might you differentiate between client one and two?
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
Is that tick running on the player's pawn/character? There should be a function on that actor "get controller" one that doesn't have an index parameter.
so there is no way to distinguish them
if it exists, it's you
the Player State is what you are looking for there
Unless it's split screen, then you have all the PCs on 1 machine.
right, split screen, the first N player controllers are the N split screen players
player state?
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
@gleaming vector he's trying to change the camera of the players on beginplay, so wants the player controller for the pawn
That's what I keep saying. π¦
if it's not valid, it's not you
ahh
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
what about not me, and not guy2?
i dont know what you are asking
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.
check to see if you are locally controlled, and if so, do the thing
that's super straightforward
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"
- check if player controller is locally controlled
before setting the position
because listen server has valid PCs
True true.
Why is APawn::Controller replicated to everyone, if controllers only exist on the owning client and server?
DOREPLIFETIME( APawn, Controller );

Goes and submits a PR
Epic: Your PR was rejected
Maybe for unpossess so itβs cleared on the client that used to own it? My only thought as to why
you can OwnerOnly that
yeah except the net owner is nulled out at that point
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)
oh nice!
iirc this was part of the requirements of a new feature, prolly gameplay features
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?
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
200 ping in emulation settings for client and for server
but consistent (200-200, 0 jitter)
200 for client and for server is quite a lot
So like - PktLag 90?
Just to clarify
I bet they mean in the new netem contextual editor, which lets you inject server and client latency separately
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
Is it actually that high? Is there built in network statistic in game to check?
yes 200 in + 200 out per component
just have to add 'em up
Get the real measured ping on screen first
as for profiling, network profiler, or net insights... also could check PS ping
net insights looks very cool, i will try it
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?
Prediction/rollback, deterministic gameplay, high level of client trust
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
i was thinking about high level of client trust, but how would it look like
You might miss.
ye, you can just miss your ability on enemy, since there is a lot of projectiles, and they arent even fast
You can make missing deterministic too!
so miss ability = no damage, no death
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
how can i make trust to client aiming, or overall high trust to client?
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)
A classic example of trust issues is when a shooter player kills someone and on the server the replayed hit goes through a wall instead
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
You probably want to predict everything locally
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
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
You can predict damage, update health bars or whatever, but actually destroying actors is probably a bit too far.
Depends on the game
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
Again, if your enemies never heal, and an enemy's health goes below zero - it's pretty much certain the enemy was actually killed
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
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
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.
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
There's so much spam on the screen anyway
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
π€£
thats true
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?
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:
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.
you mean if i hit target locally before projectile even spawned on the server?
That can't happen
The RPC's would have to be reliable, one to fire the shot, the other to say "I hit something"
correct
what you mean it cant happen, i predict projectile locally, so it doesnt exist in server yet
But you tell the server that you spawned one
im looking into high level client trust kind of system
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
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
i think i understand what you mean, but i cant send "hit" RPC, because i need to have replicated server projectile actor on client first, since im gonna send RPC about hit from that actor, and not from predicted projectile, something like that if i understand it correctly
how it should be then?
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
well it depends on the approach, but yeah
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
it should be doable
in the UT code I shared, they do spawn a client projectile until the server one replicates
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
Also UT gets away with it's system because weapons are heavily tied to character movement
you can spawn it on client and network it after the fact
when you receive the server hit you reconcile? or when do you reconcile?
right after the server spawns the projectile you can reconcile, but it will look like the projectile moved backwards a bit, won't it?
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
depending on the projectile you can eat up some lag, by having them travel at different speeds
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
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
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
oh is there any example of player rewinding @chrome bay
i always wanted to implement it but I dont know where to start
not AFAIK, maybe UT has something but IDK
i know for sure fsavedmoves can help, doesn't it?
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
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)?
you can but players will cheat
If you don't rewind and validate hits, it's an easy cheat
u hit against capsule or mesh? thats another topic because i guess that in the perfect world u rewind anims aswell, the complexity of the problem gets quite broad
if cheats are just hitting targets that you actually didnt hit, but in theory could, then it doesnt rly matter
You'd be surprised what they can do
okay + extra math for headshots i imagine
We just trust clients for headshots
oki
And check it's near top of capsule
Explain that to people with magic bullets
thanks for sharing!!!!!
The teleport cheat basically requires you to validate the hits
If you care about cheating ofc
in PVE you might not
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)
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
Yeah this is very game dependant for real
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
I know fortnite are doing trace when receiving the hit to check if there was not smth between the start and end position of the hit, but idk if they also applies that to projectiles
for bullets/hitscan stuff, it's a bit easier
btw before i go, did you have time to do something about the master initialization thing we spoke about a while ago Jambax?
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
They donβt predict anything for firing, the projectile is spawned from the camera on server, hided by some smoke fx so client donβt see the difference
yeah figures
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
Im still wondering if they have a custom PMC since they have some snipers projectile based with highhhhhh projectile speed
so they indeed might be predicting projectiles
Behold magic bullet hacks:
https://www.youtube.com/watch?v=c9upIOPq6Js
This is pre-proper hit reg
Can't find the teleport one
anyways gtg take care you all
just saying, in fortnite they might be predicting projectiles π
Fortunately, they can't do that anymore in ours π
also James saw the thing above?
yeah what did you mean master initialiation thing?
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
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
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
Ohh right yeah, no I haven't done it π
To clarify, you always simulate the projectile on the server anyway
well ye, since you need to show them to other players
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
as i understand most part of the ping hidden in animation time
nooop
fairs! π
Literally the most primitive implementation ever
Can anyone help me with my server problem?
There is no real context you just dropped a log file
scroll down
LogWindows: Error: Missing operator for attribute, type IntegerAnimationAttribute was not registered previously```
Get used to reading log files π
Yes i know Tath i am missing files but donβt know how to fix
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?
Yeah then File->Package->Server. That should be it
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
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
OkΓ© i am now building debug game
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
i build the debug
but it is an exe
how can i open it in visual studio
@chrome bay
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
Probably changing it too quickly
Also you added it to GetLifetimeReplicatedProps yes?
fwiw that entire function should be just ```cpp
GEngine->AddOnScreenDebugMessage(-1, 5, FColor::Red, FString::Printf(TEXT("%s"), bIsBuildingWall ? TEXT("true") : TEXT("false")));
i didnt get u @bitter oriole
i build the debug
but it is an exe
how can i open it in visual studio
@chrome bay
You attach the debugger to it
Your else if() statement is useless (else already implies that the bool isn't true) and then you have the same statement in if and else
So, just remove all the if else
then its working fine in standalone and listen server
have you guys tried AWS GameKit?
I just tried package project with this plugin & this showed
its not working in client only
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).
You want the callstack, not the log. These are fine.
and how do i get callstack?
It's one of the windows in VS.
i cant find it
Debug -> Windows -> Call stack
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));
}
}
}
That's how you would attach regardless of how heavy that gonna be
Also GetLocalRole() == ROLE_Authority can be substituted with HasAuthority()
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
Is this like a sticky bomb?
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.
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
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
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.
Nope. Destroy is called only on server, considering the server has authority over that actor and it's replicated to clients
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!
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
Hi, what's the deal with steam and ping only ever showing as 9999? is there an actual fix for this?
Is that a photo of a computer screen
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.
No I am on my phone now I installed windows on my MacBook and donβt have discord installed
I know win shift s
Oh. Okay. π
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.
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 ?
That's the correct way to do it. A clientside possess will do nothing? I think.
Yes this is correct
definitely do not "mirror" possess calls
π
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
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.
Yeah I already have the system working for location based but its not very reliable
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
location based ticking is probably ideal, do it on client side to relax yourself even more
just do it
by server side tick are you referring to checking location and comparing it against last known location?
lol
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
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
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
its like, not correct though to have it client side
this is how you get games like new world lmao
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
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
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?
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
Yeah some other event is driving those ones pictured
lol yeah i can't find it on my controller though
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
k thanks for the help man
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
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?
Show the error
Also where do you call the RPC from?
from an server function
its too big to get a good screen shot
You don't have to
I meant what class it is in
same class as the function calling it
SetSkillBoxColor is in widget class
But what is the name of the class you are calling the RPC from?
Thank you!
sorry i'm dumb lol
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?
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
Watch the value of Level parameter when that RPC executes and make sure it's in array bounds
its 2-7 with 1 and 2 null
Huh
rather 0 and 1 null
Ok that's it
hold on
That's what it's pretty much telling you
no its 0 and 1 that are null and the numbers fed in should only be 2-7
Still it isn't safe at all
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
Paste this code here https://blueprintue.com/
I haven't seen such a RPC, probably
yeah so i guess if you run a multicast function that calls a run on owning client it runs the latter function twice?
can I use ReplicateSubobjects on an array of AActor* or is it only for UObjects?
AFAIK it's for UObjects that aren't AActors
Multicast executes something on server and all connected relevant clients
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
it says client1 and server both run it though
So you're doing something wrong
Have you read about RPCs?
hmm I didn't have this issue when using UObjects, but apparently I do when using an array of actors
See #2 and #3 pinned messages in this channel(from the top)
alright i'll take a look. I've read about them a bit but I still get them confused a lot
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
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
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
Are you sure you are setting the values on the server?
You might need to show how you set the values and other related info
Also what type of actors are the array
Yeah, the AActor* array replicates, but the replicated actors are not valid when the array replicates (On Rep), when the actors are properly replicated is when they are valid in the array
Ok so you are on C++ or BP?
That still doesn't answer my question, that is a rephrase of what you said earlier
You would need to show the code that sets the values for the array
it's just a replicated array and an "add" node, this is called on the server
Ok where is this function called from?
When the ability system component is initialized on the server
Hmm ASC
That's not something I have experience in yet
So probably that has to do with it
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
So you say that Event BP Server... executes on the server?
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
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
They are null until the spawned actors are replicated, yes
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
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
Oh shi..... hadn't thought of that. So if you're spawning an actor and setting a ref on it, just use the ref repnotify to respond to everything being clientside and ready to go.
I was thinking of this C++, you have pointers there, where in BP it's only references, but anyways that container holding the data of replicated actors need to replicate too
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

: D
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 π
It's missing either an include or a module in your build.cs
Probably the one that refs the ENetworkFailure enum
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.
Does someone know ue5 http api plug-in?
HTTP is built-in
But blueprints
Then no
Replication has to go through the CMC directly
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
You mean like editing it with C++?
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
Well that sucks, because I don't know C++
Yeah.. multiplayer without c++ is a tough one
https://www.unrealengine.com/marketplace/en-US/product/replicated-sprint-in-blueprints/questions Thoughts on this?
I just happened across it, idk if it's legit
It's only a few days old
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
The title must be accurate and descriptive for the product to be approved by epic
hi guys
That's such a lame argument
hmmm
Epic doesn't test the freaking code thatm uch
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.
They check if it compiles and the folder hierarchy is fine
That depends largely on the system you want to make "nicer" in terms of latency
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++?
I would advice so, yes
internal screaming
Well, this replicates, don't get me wrong, Tick runs on everyone.
So it... doesn't replicate, replicate
But it is set on everyone
Wait, it does?
That makes so much sense because the other player gets the velocity too
But you are completely throwing client prediction, reconciliation and all those systems the CMC has out of the window
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++
Making
Releasing on is usually named "Platform" (:
Can I add the velocity in some other way besides event tick?
One thing you can do is play around with the AddMovementInput that the client calls
That could possibly work too
Cause that is locally called for the Client to tell the server that it wants to move into a given direction
blush
But that is obviously limited by all the things that modify the InputVector
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++
So, I mean, try it
Yea
Otherwise, harsh truth, don't make a Multiplayer game
This is not the only roadblock you might hit
If you crash, you will have a Callstack and an Error
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
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
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
I'm sure some of the things aren't unreal specific, but I'm unsure where to look to learn more.
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
This the crash
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
here is the code
Which one is line 49
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.
UE only really uses those things in the CMC
WDataRow = nullptr;
And maybe in the Network Prediction Plugin which is still not rlease..
Feels like the AWeapon itself is not valid and it's just pointing you wrong?
What is calling the BuildWeapon function
when ever i press some key iam calling
it
its working in standalone
and also id i set this to owning client its working
Can you show me where you are calling it
ya
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
pin it?
for now iam committed this set rifle line and iam calling it from bp
Is EquippedWeapon valid?
yes it is
Ehhhh, I'm not too comformtable with that. I might have explained it a bit wrong :P
Because it looks like it's not. Could you try to checkf it with a message, just to be sure?
can i send u header one?
only issue i see is that it's example specific, but otherwise it's pretty nice
Just put a checkf where you access the EquippedWeapon
If it's valid, you have nothing to lose
If it's invalid, you know that the issue is not inside the BuildWeapon function
Actually we are using an if check to check if it is a nullptr if it is then we return out of the function
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
Where?
@thin stratus dude can we connect? once
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
Ok we will get back to you after doing this check
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
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?
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
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?
You have to
The server doesn't know what clients have selected in their local game instance
I didnt think about that π Thanks a lot!
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?
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
This is what I was trying to ask actually, what's the difference between them?
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)?
Where is the RPC called in?
My guess is it's because FString is basically a TArray underneath, so it's easy to enforce that (same way TArray is also advised to be const-ref) - whereas a struct might be large, but might also be small
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
It's being called from a blueprint class called 'RespawnPurchase'
It's an actor that a player can walk up to and when prompted, purchase a player respawn
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
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) π
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
Thankyou v much for the help π
Gonna need to turn that into a sentence
Δ± need team can you help me guys?
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
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!
@terse nymph Hi! Please keep anything recruitment related to the Job Board channels, the #instructions channel has info on how to use them!
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
idk - the explanation makes sense to me and lines up with my understanding of the concepts.
I'd say it's worthy of a pin personally.
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.
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?
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?
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
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?
I believe IsLocallyControlled which returns a bool can help you with that
Oh right, because that's per-client and not checking if it's the server? Thanks a lot, exactly what I needed! π
are you changing their movespeed locally without overriding the cmc?
@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);
}
}`
is anything changing maxspeed?
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
Do I need to handle all changes in state in OnMovementUpdated rather than in UpdatecCharacterStateBeforeMovement?
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).
How to spawn an actor on specific clients Only ? so only these clients can see it and other clients don't ?
Make the actor not replicated
Spawn it, done
Spawn it like "Run on server->Multicast" or just multicast ?
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
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.
That way though the server won't know about this actor though
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.
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
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.
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?
Right, he just didn't tell what kind of actor that gonna be
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
I can confirm that Zhentouk is right. Unreal is location based, not rotational. Having the same problem here; I need to get character to jump along a rotating column⦠and a small delay will cause players to miss the end of the columns. Our solution was similar to Zhentouk, We extrapolate the client into the future with the lag amount. Such then...
Hmmm. You're already really breaking into the nitty gritty math here.
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
What's the use case? Maybe if I can understand the goal a little better here.
You asking me, right?
Haha yeah it's a little nutty how much a fraction of a second can matter.
yes I'm asking you π
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
That's okay, I get the idea π no need for a vid.
and also those are the same mechanic, but on differenent axis
they also have that jitter problem while player standing on them
Competitive game?
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
Your game is so pretty
haha, thank you, I'm about to release beta version on steam, so things going kinda crazy
Tell me about it π
What is it. What are you trying to do?
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.
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
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.
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
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?
no, player can stand on platform without jitter
but when it comes to jumping - here all lags kick in
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...
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?
just jitter
here, im uploading video
fyi, that might in fact mean 400-800ms ping
for your information
You should log the actual ping value and confirm what you're actually testing
So in video i linked, server is on right side of screen and he jumps and walks on rotating platforms really well, but the client is not, looks like the server location and client location of platforms little bit ofsetted
300ms ping is auto-kick stuff
Hmmm. I'm also noticing that you seem to get electrocuted earlier than the lightning beam is displayed
yeah, thats known bug, dont mind that xd, i still didnt fixed it
its just not replicated yet
Physics aren't replicated and yeah you want a custom movement component with rollback & replay
That or client auth
(but cheats)
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.
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?
if this is just a co-op game
and u dont worry about cheating
i would just use client auth movement
whats that?
That would mean making your client be in charge of a character's position, and having the server copy that information
yeah! that's what i need!
can be enabled with like two checkboxes in CMC
those?
yup
yeah, still having that issues, should i also check something in replication section?
Wait, you have ServerAuthoritative checked somewhere else don't you?
where it could be?
You mentioned here
So maybe this is a reading comprehension issue on my end but ServerShouldUseAuthoritativePosition sounds like it's giving authority over position to the server...
so you saying that i need to set it to false?
If the client and server are competing for control over position, it would definitely create some weird interactions.
no
is making client auth movement in blueprints only possible?
i mean is it possible without touching c++ lol
its prob something with ur platforms
yes
hm, okay
on client and on server
well, i move on client, but jumps and other interaction are replicated to server
That should be covered by the character's position being replicated. You shouldn't need to also replicate the jump on the server.
well, cause i have my own custom jump function, i'm replicating "Launch character"
or i should disable that for client auth movement?
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
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. π
yeah, i will see what i can do with that
thanks for help!
Anyone have ideas why my subclass of PlayerState wouldn't be in use when it's selected in GameMode?
What do you mean in use?
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
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
I'm putting in a 0.2s delay
but it should be loaded pretty quickly
at least in mp
hm, so something might be in your gamemode
something is different in ue5, this works in ue4, not sure what it would be
yeah ue5 weird, still haven touched it yet, so can't say much just good luck :/
thanks
You should just fire an event in your playerstate's BeginPlay()
That way you get it the second it's ready
After loads of hair pulling ( single tear) I found the solution to my problem If anyone ever has a similar issue. I had ticked the Replicates box on the capsule component of the PlayerCharacter while desperately trying to fix another issue (lol). This caused the issue described above. Hope that helps someone out in the future π
Hey, I'm trying to make a spline replicate across the server and clients but I've got this weird behaviour where when a client creates a spline, it doesn't update for them, and only updates on the server. Does anyone know how i can solve this? https://www.youtube.com/watch?v=HyhYjTXLmNA
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.
I fixed this, in a very inefficient way that future me can worry about.
Spline points themselves do not replicate, replicating the spline component itself does very little. If you want the points to replicate as well, you'd have to replicate arrays separately
I learnt that the long way, now im just using multicast to update the spline on individual clients.
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
Im sending the spline points to individual clients
yeah, you don't want to do that
Oh, so i should have a property that is updated by the server and then the client fills in everything?
Okay yeah that is more efficient
Otherwise, if a client joins late, or they leave the relevancy area and go back to it, the points will all be gone
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?
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
I don't think you can do it in BP actually
Since ServerTravel is invoked via a console command right?
yup
yeah in which case I don't think you can in BP alone
was thinking i could do something like this
Worth a try
WinningTeam is a variable in the other gamemode
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
UEngine::HandleServerTravelCommand is what parses the options from the map name
It seems to look for the first ? separator
or if i needed ?OptionString=? or something
ok awesome, thanks a lot!
So everything after that ? is treated as the options string
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?
You might have to put the game mode first, but I'm not sure tbh,
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 π
I would start by checking yours and your host log file for any useful information.
I opted for transferring an entire custom actor, carrirs match setup data to game map and results back to lobby
I find it and set it during InitGameState in base GameMode shared by both lobby and game
Works like a charm
wait so this actor is shared from matchmap to lobbymap then?
ah wait, it is all just gameinstance isn't it?
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
does the gamemodes have to be a child of the same class?
also how do you add an actor to the travellist?
It doesnt, but its convenient to have a base gamemode thst handles everything shared between lobby and game
Or youll find yourself duping code
Figure some peeps here may be interested in this:
https://github.com/EpicGames/UnrealEngine/pull/9087
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
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?
I donβt think anything is replicated on behavior trees. Those types of variables should be present on the character itself
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
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 ?
If you're doing patching - check first that your platform doesn't do it by itself (Steam, GOG, itch, some consoles)
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?
Could be your custom implementation keeps thinking the PS is relevant/non-relevant?
Is it destroying it client side or server side?
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
oh, google playstore is the platform
what's the result you are getting when you tested with two clients ?
only client 0/client 1
on the server i get only server
it seams to depend on the who interacts now
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
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
Does anyone have a tutorial for split screen multiplayer on how I can teleport the player pawn of different controllers?
Are there data limits (size) per RPC?
Im trying to teleport all split screen players to a location, but for some reason it doesn't work, does anyone have any ideas?
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?
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
Are the components replicated?
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
they should both be set to replicate iirc
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.
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
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?
It shows whatever the main editor window is
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
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
Ah yes - the Fortnite test π€£
The only test we need π
(Not saying I disagree mind you)
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
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?
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?
Isn't it prediction that's the hard part, not server-auth physics?
Something physics driven without prediction isn't too bad, I got a project that does it.
Anyone used motion warping with replication?
Haven't used it at all personally - but I'd imagine it'd be mostly handled locally.
does anyone know how to share the same camera across multiple client on a online project ? my camera is only working on host client
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
since the camera don't move i guess it don't need replication, so do i need to create another one for each client ?
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
Congrats, you made the impossible possible!
do i get official recognition from Tim senpai?
but really how do i even debug this?
What actor is this RPC being invoked from?