#multiplayer
1 messages ยท Page 287 of 1
You are over complicating stuff
maybe but I just dont see another way to solve it
Couple of other things, CMC already sets the camera height, so using what looks like animation to smoothly adjust the camera will conflict
Well the camera is bound to the head bone since its a true first person game can't really change that without breaking everything else camera related
So if animation plays for crouching it'll follow the head bone
If the animation isn't blending well then you'll get the snapping
Hacky solutions would be check for and waiting for the animation to finish similar to your validation
Or create a timer manually to call the uncrouch if your desired time elapsed in update
Hello, I made a custom movement mode for spline-based movement in the CMC.
It works fine for the autonomous proxy and the server, however the simulated proxies seem to have an issue with it.
Almost as if they get gravity applied, move down by a few cm (even if they shouldnt) and therefore get snapped back into place.
Does anybody know why this could be?
(cyan capsule is the server location)
the cube (the actual pawn) is bobbing up and down
Gravity still applied?
it looks like it, however in my custom Phys function there is nothing related to gravity.
Not sure whether its something specific to simulated clients, as it works fine for non simulated ones
Complicated answer would be to see if the position smoothing applied to the mesh doesn't like it
I already checked that, its not the mesh but the entire character.
yea thats what I did before but it doens't seem to animation issue
its entirely based on latency
Because if I test with 10ms then 100ms and with 1000ms, the amount of time I have to hold the crouch to prevent this from happening is completely different
Value precision in rep?
The issue is that locally the uncrouch begins before the server crouch begins
so it messes up the camera by correcting it
Your original code, since tags are redundant when biscrouching is the server rep, probably check the crouch state before calling
I know CMC uncrouch doesn't reset the intent of crouch so itll just constantly ask to uncrouch
if I check the variable won't it say that it is crouching because locally it already is crouching?
hm, all I do is replicating which spline actor the pawn currently uses and grab the desired location in the Phys function
Not entirely, biscrouching is repd from server, bwantstocrouch is local intent after calling crouch or uncrouch
Probably look into the cpp of CMC, otherwise don't animate the character yet until you got the baseline crouch working
can't be no? I'm using bIsCrouching as the variable that triggers the crouching animation and it triggers instantly locally os that variable msut be getting updated locally as well
It is, but it gets reconciled when biscrouching gets repd too
yea but you mentioned to check crouch state before calling uncrouch, but the crouch state (or the variable bIsCrouching) will always return true because it gets updated locally
I wouldn't think it'd be any more complicated than setting a pos along the spline, in a custom phys, I'm out of ideas though why it'd be the whole character
maybe its not the safest way to grab closest key at the spline and calculate the delta towards that location.
This issue only occurs when I am playing with variable ping. With a fixed one (up to 500) it is very smooth
CMC also doesn't smooth along a curve afaik, since it's just smoothing to positions
That shouldnt be an issue since my spline doesnt go upwards/downwards.
Idk I cant seem to find why it moves my character down
Ah, looked like it was climbing, only thing left is to step through to see why y position is different
okay nvm I was lying.
It indeed is the mesh itself bobbing up&down.
hmm, will try and see what i can do
Thanks for your time !
hey
i can't post in #ue5-general for some reason
Has anybody else had issues with UE5.7 and remote clients animations running at half speed?
The third person example is doing it for me, as in just a blank 3rd person template with 2 players as listen server and the main PIE window shows the second players animations running at half speed.
Is this just an editor bug? I haven't set up lobby/joining/ui flow yet to test in standalone
it's to do with listen server ticking the anim.
scratch that* just tested with a fresh blank 3rd person bp-only project and its not doing it on there. so i'm not sure if i've changed something to cause this
oh so is it just a bug with PIE and i can ignore it?
not a bug
oh its the network emulation that causes it
if i disable that then my animations run at normal speed
let me grab a video and i'll show you what i mean, i can see it starting/stopping by enabling network emulation
@wise depot something like this?
kind of. you can see it here, if i start with network emulation enabled my running animation is basically running at 50% playback speed, but if i run without it then it runs fine
I can even see the playback duration running slower with showdebug ANIMATION (look at last line of text on left)
this only happens with network emulation enabled in PIE
is this the same issue?
No, my issue is only apparent in shipping
is p.NetEnableListenServerSmoothing on or off here?
erm, whatever the default value is i guess, i don't recall changing that
but i'll try
Thats not the default tps template though?
I dont know what drives your animation.
Normally its just velocity
i tested it with the default
exactly the same
Can see it here with tps template on bp only project. only change is enabling/disabling network emulation.
p.NetEnableListenServerSmoothing makes no difference
tried with p.NetEnableListenServerSmoothing true/false and p.NetEnableListenServerSmoothing 1/0
had to tab to discord to remember the command name and cut recording accidentally
If I test it with 3 players, both the other 2 players windows look absolutely fine, so I'm just going to assume it's a PIE bug probably
looks like this has to do with how the listen server decides when to tick the pose
Not a bug, its to do with listen server.
You can run it as client and play with 3 players.
with your setup it is ticking during receiving a new saved move it seems UCharacterMovementComponent::TickCharacterPose runs from the rpcs only
The visual issue will only be apparent for the listen server.
I suppose you could override ACharacter::PossessedBy or just have another skeletal mesh component on there
@wise depot
if (auto* mesh = GetMesh())
{
if (mesh
&& IsReplicatingMovement()
&& (GetRemoteRole() == ROLE_AutonomousProxy && GetNetConnection() != nullptr))
{
if (HasAnyRootMotion())
mesh->bOnlyAllowAutonomousTickPose = true;
else
mesh->bOnlyAllowAutonomousTickPose = false;
}
}
You can try this on your CharacterTick
that should only need to be set to false after ACharacter::PossessedBy sets it to true
If this is a BP only project it would be possible to hack this in by somehow making IsReplicatingMovement false right before the possession occurs
the amount of control for non c++ multiplayer stuff is very low though... I'm kind of surprised this isn't a cvar at least
My project is c++ yeah, I just tested it with tps template to see if I'd done something to cause it
Will give that snippet a try in the morning thanks ๐
Sad that the tps template has this issue
which packet emulation settings were you using?
Ingoing and outgoing, 30 min 150 max
I guess just in case it's worth mentioning the packet emulation presets are pretty darn extreme compared to real life conditions
Just latency emulation
You can see them in that clip at 13 seconds
Still, this feels like a bug. Out of the box shouldn't make animations run slower on host if the client has 'any' ping, but idk what happens in packaged build.
your artificual situation of only the client having 30-150 ms does not help
I would suggest trying something where both sides have ping mutually to see if the timing fits better that way
Well, it just so happens in that clip I had only client selected. But yeah it's a very wide range for sure.
But doing client and server has the same results
I didn't try just server though
I wonder if this is why little nightmares 3 character animations looked sketchy when i played online with a friend a while back ๐
@wise depot If you only play as clients, do you see any animation issue?
I guess my point being having it be one side might make some things that rely on back and forth timing might be fooled by it being instant one way and not the other. I'm definitely confused that this just doesn't work nicely at all out of the box...
Haven't tried that but I'll try in the morning. That being said, I have no plans at all for this project to need a dedicated server.
this is just to check if Listen Server tick pose is the issue.
you could also override USkeletalMeshComponent::ShouldTickPose I guess
in which you can do ```cpp
if (auto* mesh = GetMesh())
{
if (mesh
&& IsReplicatingMovement()
&& (GetRemoteRole() == ROLE_AutonomousProxy && GetNetConnection() != nullptr))
{
if (HasAnyRootMotion())
mesh->bOnlyAllowAutonomousTickPose = true;
else
mesh->bOnlyAllowAutonomousTickPose = false;
}
}
to try and fix it.
Yeah ill try that in the morning too, thanks
well "fix" is a strong word. There may be issue with toggling the bool from what I heard.
It seems like it might force it to tick twice as much in some cases
as you would receive the rpc -> sim the saved move -> tick the pose and then the regular component tick would tick the pose again
Wouldn't that make the animation play at 2x speed rather than super slow?
depending on the sequence player yes
I'll try just throw the null OSS on it and try with a packaged build too, if its an editor only issue then I don't care
a wacker option could be to have the listen server have an entirely separate skeletal mesh but this would be not so nice
if you rely on root motion to affect behaviour the less of the old setup you mess with the better imo... not sure
Some anims will apply root motion yeah
I'll see what packaged build does and that tick snippet. Will let you know in 10-12 hours or so ๐
I'm kind of surprised it doesn't just feed in a longer deltatime and interpolate if it has to work like this
Oh I didn't actually upload the right video earlier but if I enable showdebug ANIMATION I can see my playback time ticking up slower than normal
Like 0.5x speed or so on the animations
I would suggest using insights to track when it actually evaluates the anim graph
That's kinda why I change the bool on tick ๐ข .
oh well , if I can dedicated server to work, I will chuck this code away.
Whats the movement mode during this ?
yeah even if i have "use less CPU when minimized" PIE will lag on multiplayer if it isn't the top screen
any idea why I am getting this error?
if (t != EItemType::E_Weapon || t != EItemType::E_Gear)` incorrect usage of `||` , you mean `&&` instead?
void APickup::OnTakePickup(class ACustomActor* Taker)
{
if (!ValidateInteraction(Taker))
return;
APlayerControllerBase* PC = Cast<APlayerControllerBase>(Taker->GetController());
if (!PC) return;
const FItemAddResult AddResult = Taker->GetInventoryManager()->TryAddItem(Item);
if (AddResult.ActualAmountGiven < Item->GetQuantity())
{
Item->SetQuantity(Item->GetQuantity() - AddResult.ActualAmountGiven);
}
else if (AddResult.ActualAmountGiven >= Item->GetQuantity())
{
const EItemType t = Item->ItemType;
if (t != EItemType::E_Weapon || t != EItemType::E_Gear)
{
PC->ClientPlaySound(Item->InteractionSound);
}
Destroy();
}
if (!AddResult.ErrorText.IsEmpty())
{
PC->ClientShowNotification(AddResult.ErrorText);
}
}
I know && makes more sense in here but || should not be an issue I think
need to wrap the 2 conditions you are trying to OR in brackets
if ((t != EItemType::E_Weapon) || (t != EItemType::E_Gear))
I always do it without brackets and there was not an issue but just this ๐
@nocturne quail You don't get any error when calling destroy Missty?
I crashed when testing with clients.
currently applying band-aid with SetLifeTime ๐ค .
wonder what I do wrong.
I don't have any crash, cause the pickup actor has done its job at this time by passing the item data object to the inventory and this pickup is not used any more so it can be destroyed
TryAddItem will create a new object from the item is passed, so this actor is completely not related any more
and that destroy branch is called when the whole item is fully added
non stackable or all amount of item
its cause of the comparison symbols.. compiler doesn't know the order to evalute them without the braces.. single comparisons that dont use != == < > ect wouldn't need braces
I have conditions like (a != b || b != c || c != a) compiler never complains before
even without compilation issues that code is kind of hard to understand at a glance
I would assume there were no issues before due to bool operator differences but I am not sure and that example you posted is incomplete (what type are a b and c?)
we can only see the code you show us
yeah but I can't compile
even with the parenthesis?
Correct
build output?
probably not the right channel for general c++ problems
and yeah show build output please
1>------ Building 4 action(s) started ------
1>** For ArmaEditor-Win64-DebugGame **
1>[1/4] Compile [x64] Module.Arma.8.cpp
12>C:\Arma\Source\Arma\World\Pickups\Pickup.cpp(278): error C6289: Incorrect Operator. Did you intend to use && instead?
1>D:\Arma\Source\Arma\World\Pickups\Pickup.cpp(278): error C2677: binary '||': no global operator found which takes type 'const EItemType' (or there is no acceptable conversion)
1>Total time in Parallel executor: 4.04 seconds
1>Total execution time: 6.21 seconds
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command "D:\Engine\Engine\Build\BatchFiles\Build.bat -Target="ArmaEditor Win64 DebugGame -Project=\"D:\Arma\Arma.uproject\"" -Target="ShaderCompileWorker Win64 Development -Quiet" -WaitMutex -FromMsBuild -architecture=x64" exited with code 6.
1>Done building project "Arma.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 11 up-to-date, 0 skipped ==========
========== Build completed at 16:57 and took 23.666 seconds ==========
12>C: is not vs confused?
That is weird.
12 actually means already 11 changes are compiled but in Build: 0 succeeded, 1 failed,
what does bool bIsWeapon = t == EItemType::E_Weapon do?
I'm suspicious of operator overloading here and I am curious to see the enum definitionm
This logic is very flawed, VS is right about that.
UENUM(BlueprintType)
enum class EItemType
{
E_Weapon UMETA(DisplayName = "Weapon"),
E_Ammo UMETA(DisplayName = "Ammo"),
E_Gear UMETA(DisplayName = "Fashion")
};
if (A != 1 || A != 2) will always be true.
lol
oh yeah lol, that explains it
unless they are trying to use it like bitflag style
I don't even know what a default enum class does for the size? is it a byte?
I can't find any example that doesn't include at least : uint8
Default is probably int32? (It's int)
well changed it the way vs want it ๐
if (t != EItemType::E_Weapon && t != EItemType::E_Gear)
{
PC->ClientPlaySound(Item->AddedRemovedSound);
}
Compile now?
Yes already compiling shaders phase
but as mentioned the condition was flawed.
this makes it look a little better but its very choppy
can you take a video?
i did notice that the entire chunk for smoothing on listen servers is commented out in the engine
show your code as well.
so the cvars for smoothing do literally nothing
my code is literally your snippet copied and pasted.
I also found this thread:
https://forums.unrealengine.com/t/player-animations-slow-down-on-listen-server/1262819
I saw similar questions on this topic, but they did not help me get rid of lags in animation playback. I want to clarify that I use blueprints, do not use Event tick nodes and do not overload the game with unnecessary events. I use Advanced steam sessions to connect and no other plugins for anything else. I tried every method I could find on the...
oh and also yeah, its a listen server issue, doesn't happen on play as clients
scratch that* its the network smoothing making it look choppy
nope
hopefully this tick change fixes it for now
look at the file you are reading
that is the async character movement component
it was a past attempt at making the cmc parallel that... was basically them copying the entire thing and pasting it and trying to stuff it into a struct with unique pointers
it's not a thing... mostly annoying as it shows up when searching for names
oh yeah you're right, my bad
I fall for reading that file all the time when looking up cmc code too lol
a custom one that I made
yeah but where do you call it?
in tick, like you said
which tick
my player character class tick
the movement component? the pawn actor?
but also, it does actually make it better, its the network smoothing that makes it janky
Player Character actor, i'm using default cmc
the network smoothing is janky because the difference between min/max latency is 30-150 which is pretty unrealistic
if i have a stable ping it seems to be mostly fine, its once there is a particularly sizeable gap the issue starts
also if I set NetEnableListenServerSmoothing and EnableQueuedAnimEventsOnServer to zero without the tick changes makes it a lot better too
the thing with having varied latency is that it's often a bit worse than having consistent but not great latency depending on the work involved
if you want smooth motion and the things arrive at random times it's a lot nicer than having them be slightly sooner at random
arguably it sends a timestamp but the issue here is the server is kind of also validating and returning the result
so it's like you are kind of serving as the arbiter of what their sent move even did but also trying to make it look nice for the local player
either way I'm kind of surprised this works so poorly out of the box and works with a hidden bitfalg on the skm
looking at that thread its been an issue in UE5 forever
did you try overriding the Skm to decide to tick with different conditions?
(USkeletalMeshComponent::ShouldTickPose)
the possibility of having multiple incoming saved moves in a frame is where it gets weird though imo
if that happens and the pose is meaningful it would tick twice
I would say it might be easier to have a second mesh for the visuals on the listen server for players
the expense is sad but it might be worth it for lower playercounts
you also might not even need server auth movement for some games
That's actually what I used to do in ue4, we would have an invisible root then a detached visual mesh for smoothing. Worked pretty well
btw I don't have the same issue on my end.
[/Script/SteamSockets.SteamSocketsNetDriver]
NetConnectionClassName=/Script/SteamSockets.SteamSocketsNetConnection
ConnectionTimeout=80.0
bNeverApplyNetworkEmulationSettings=true
InitialConnectTimeout=120.0
NetServerMaxTickRate=60
bClampListenServerTickRate=true
MaxNetTickRate=30
KeepAliveTime=0.2
MaxClientRate=120000
MaxInternetClientRate=120000
RelevantTimeout=5.0
SpawnPrioritySeconds=2.0
ServerTravelPause=4.0
[/Script/OnlineSubsystemPS5.PS5NetDriver]
ConnectionTimeout=25.0
bNeverApplyNetworkEmulationSettings=true
InitialConnectTimeout=40.0
NetServerMaxTickRate=30
bClampListenServerTickRate=true
MaxNetTickRate=30
KeepAliveTime=0.2
MaxClientRate=80000
MaxInternetClientRate=32000
RelevantTimeout=5.0
SpawnPrioritySeconds=2.0
ServerTravelPause=4.0
@wise depot someone gave this to me before, you can try it if you like.
forgot which .ini file this should go to.
altough it seems like it doesn't have anything to do with editor ๐ค
what network simulation settings are you using?
more like shipping issue.
the issue i have is when there is a large discrepency between min/max latency
never touched the one in project setting, I just go net.pktlag X
sounds like not an issue you have to deal with then?
that sounds like a given.
If someone have very unstable net, they are not going to have pleasant experience.
though, I have no issue playing with 100 ms or 300 ms in terms of movement and animation.
if i have a stable ping, whether its 30 or 500, its fine. the issue is when the discrepancy between min/max latency is huge, like 30-150 for the one client, which would be a catastrophically bad connection for sure
but there is still no reason the host should have animations running in slow motion because of that imo
like, idk why the animation wouldn't just tick.
But, again, your change actually makes it significantly better, the jankyness remaining is the network smoothing which is a given
just saying I do think its an internal bug ๐
Alright I fixed it.
My issue was that I was overriding UCharacterMovementComponent::IsMovingOnGround() to return true if I am in my spline movement mode. (I thought that would be reasonable as the spline should be some sort of floor to slide along).
In SimulateMovement() it checks whether IsMovingOnGround() is true, and would then proceed to check if the Current Floor result is valid.
If it isn't, it will set the movement mode to falling.
Which explains the bobbing for simulated proxies only, since in spline movement there is no Current Floor result...
Right right
Thats why id initially think youd want to set the mode to flying
So youd have full freedom
Well I am not using built-in modes as of now.
If you interact with the spline it goes directly into the custom spline movement mode
Makes sense
why is your ps5 stuff in your main engine ini
I have 3k pickup spawn points in the level, the pickup item is spawned on BeginPlay
UCLASS(ClassGroup = (Items), Blueprintable, Abstract)
class ARMA_API AItemSpawn : public ATargetPoint
void AItemSpawn::BeginPlay()
{
Super::BeginPlay();
if (HasAuthority())
{
SpawnItem();
}
}
this means 3k pickup actors are spawned when level starts
I can do
GetWorldTimerManager().SetTimer(UnUsedTimer, this, &AItemSpawn::SpawnItem, FMath::RandRange(10, 100), false);
than there will be 3k timers ๐ค
any good idea is welcomed to solved this issue
what issue?
what is the actual problem
I assume you are having a frame hitch?
I have not experience a frame hitch issue, I just feel like it can be improved or maybe there is another magic way to spawn thousands of pickup actors when level starts
do they need to spawn when a player isn't near them?
I guess I would say the nice thing would be for all of them to register to a global manager to time-slice the spawning. A random timer might be okay too but ideally you control them spawning N per frame (you could decide to force them to be immediate with some rule, or make distant ones less prioritized etc)
hey there, I have an odd issue. I'm testing my sprinting with a server + 1 client and noticed when the server runs, the running animation plays fine at the right speed etc. but when you're a client, and im looking at the client as the server, i noticed the running animation looks a bit odd / is slow, even though the client is definitely running
any idea what could be going on there? I've got a custom CMC kind of similar to what's in tranek's repo
debugging for now but incase anyone has immediate ideas. in my ABP, I am logging the velocity on both the server and client, and see that the speed when the client runs is 500 (which is the max/running speed)
yeah they spawned at runtime and also spatially loaded
a listen server or a dedicated server?
listen server
if the listen server runs, the animations look completely fine (if im a client looking at the server)
if the client runs, the animation looks weirdly slow (if im the server looking at the client)
on the listen server by default the character pose is only updated when you receive a new savedmove from the client, which is not being received every frame
this is... of course very annoying lol
unfortunately there doesn't seem to be a simple way to get around this without some C++ changes
some people seem to be turning off p.NetEnableMoveCombining which makes saved moves just send for every update which I assume just kind of makes them update... more
kind of a backwards solution imo but this is might help in the short term
I guess if it helps there's an important distinction here: Root motion or no?
and also if you rely on server authoritative movement with said root motion
the reason the cmc directly takes over ticking the pose on the server is to make sure it can consider root motion as part of the move in case it needs to follow along with what the sending client did
If you don't need root motion I don't think it will matter at all what the server does to tick the pose locally
nope not root motion, and dang yeah i believe i understand, noticed that other clients etc look completely fine on their screens, it's just the server that is seeing the animations oddly
do you understand what the cmc is doing on both sides in simple terms?
just to be clear here the cmc is locally predicted and server authoratative
the client says "I was here and moved a bit this way pressing these buttons" as an rpc and the server goes "okay, I will try that" and if it's close enough everyone keeps going. The server and client constantly negotiate to say where the character is with the server having the final say in most cases (by default)
server seeing odd animations is cause the cmc is ticking the animation
we had to fight this issue tons of times
the rpcs coming in will be what triggers the "resimulation" on the server but the listen server can still smooth the transforms with p.NetEnableListenServerSmoothing Frustratingly the listen server only ticks the animations when a new rpc comes in
so either you have two meshes where the basic cmc one is invisible and there is a new one attached on top that ticks normally, or you basically override some things to make this tick normally
UCharacterMovementComponent::TickCharacterPose
if your seeing ListenServer doing weird animations (like super fast or slow)
its always down to framerate also
also see ACharacter::PossessedBy for the code that actually ENABLES this way of ticking the component only when it says to
if the outcome of the animation graph matters for the character prediction then this is needed, if not I don't see any issue with removing it
// If we are controlled remotely, set animation timing to be driven by client's network updates. So timing and events remain in sync.
if (Mesh && IsReplicatingMovement() && (GetRemoteRole() == ROLE_AutonomousProxy && GetNetConnection() != nullptr))
{
Mesh->bOnlyAllowAutonomousTickPose = true;
}```
the issue is if clients updates are slow or fast to server
it will adjust the animation speed
yeah i follow, it matches how i set it up, client predicts -> sends inputs (saved move) -> server validates
this is helpful, let me try a couple things
so my hot take would be to override ACharacter::PossessedBy and call the APawn super directly, skipping the character code super
but I'm not sure if that covers every case
do you disable saved moves or just limit them a bit?
limit them
I think there's no way to perfectly account for both sides framerates but tweaking the values would help
[/Script/Engine.GameNetworkManager]
TotalNetBandwidth=2000000 ; ~2 MB/s
MaxDynamicBandwidth=500000 ; ~0.5 MB/s
MinDynamicBandwidth=200000 ; ~0.2 MB/s
ClientAuthorativePosition=false
ClientErrorUpdateRateLimit=0.015f
MAXCLIENTUPDATEINTERVAL=0.35f
MaxClientForcedUpdateDuration=0.60f
ServerForcedUpdateHitchThreshold=0.150f
ServerForcedUpdateHitchCooldown=0.100f
MaxMoveDeltaTime=0.125f
ClientNetSendMoveDeltaTime=0.05
ClientNetSendMoveDeltaTimeThrottled=0.066
ClientNetSendMoveDeltaTimeStationary=0.0833
ClientNetSendMoveThrottleAtNetSpeed=10000
ClientNetSendMoveThrottleOverPlayerCount=24```
if the client is running the game at 15 fps they will send rpcs slower no matter what cvars the server tries to set
and yeah in this case its t he running animation being weirdly slow lol ๐ it caught me off guard
but them going slow, is harder to solve
this happens if the client is alt tabbed out btw
it reduces the amount of resources
you might want to disable that in editor
what
like would the client be seeing this too?
no
I guess in my opinion I would rather just make the listen server tick the pose normally instead of trying to leave it IF you don't have root motion. Once root motion happens you need to leave this alone imo
just server
client lower fps = less packets sent over time
unreal sends the default packets at the end of each game frame
and reads them at the beginning
this works the other way around as well, the server running slower will mean the client receives less feedback (but it would not be as broken as the listen server animations are generally)
i untick this
cause this can cause this weirdness in editor
clients always tick there pose locally
so clients shouldnt see the diff
its literally server is not receiving updates quick enough so it ticks the remote clients animations slower
and they jump and look weird
yep
also fun fact the cmc is always jittering everywhere
it's just very highly smoothed on all sides
the mesh location is mostly faked
we disable it
you can tweak the interpolation settings a lot but it will probably be okay for 90% of unreal games
void XXX::PossessedBy(AController* NewController)
{
// Authaer:: Removed SetOwner call from here.
AController* const OldController = Controller;
Controller = NewController;
ForceNetUpdate();
#if UE_WITH_IRIS
// The owning connection depends on the Controller having the new value.
UpdateOwningNetConnection();
#endif
if (Controller->PlayerState != nullptr)
{
SetPlayerState(Controller->PlayerState);
}
if (APlayerController* PlayerController = Cast<APlayerController>(Controller))
{
if (GetNetMode() != NM_Standalone)
{
SetReplicates(true);
SetAutonomousProxy(true);
}
}
else
{
CopyRemoteRoleFrom(GetDefault<APawn>());
}
// dispatch Blueprint event if necessary
if (OldController != NewController)
{
ReceivePossessed(Controller);
NotifyControllerChanged();
}
}```
we just call all the stuff but dont call the autonomous thing
we dont really care
just call APawn::PossessedBy
ah okay, this is required then
cause we have an ownership system
oh yeah, I forget you have like players that control each pawn separately
yeah
might be possible to just cheese setting it back to nothing after but this makes more sense now
yeah that autonomous ticking is really bad
my one fear with copying engine code out is that an update changes it and I miss it... I might start adding static assertions all over
and cause Epic use dedi servers for all the games
they never fixed it
or addressed it
yeah it's frankly absurd this is not a cvar to tweak. For example if root motion is active this makes perfect sense
but without root motion this is silly
and even then it should at least interpolate
even if there was a path to make it tick if no updates received in x time
so it doesnt do that
like we got no updates for a couple of frames, we should tick it manually
would solve the issue
well for now i've set bOnlyAllowAutonomousTickPose to false which has "fixed" it as expected
yup
thank you, this is very helpful, saving this conversation as im sure ill come back to it, especially if i enable rootmotion ๐
and even with root motion I am skeptical about if it uses the correct deltatime for them... I would have to test
right now, just to get rid of the visual artifact. I changed the bool on tick.
If it's playing root motion then toggle bOnlyAllowAutonomousTickPose
How often unreliable not get called btw? Thinking if I should make an Item Pickup SFX a reliable / unreliable RPC.
haven't got the chance to have a real environment to test.
depends on settings and why they get skipped
there's sort of two things that can happen I guess, either the actual udp packet doesn't make it or one side rejects sending or receiving it
for example net.MaxRPCPerNetUpdate puts a cap on multicasts rpcs
the default is .... 2!
I think lyra cranks it to 10 from what I can see
thx!
https://forums.unrealengine.com/t/animnotify-inconsistently-doesnt-trigger-on-the-server/429809 I think I've run into this issue and I'm super confused
Hello, I have several animation sequences with custom C++ AnimNotify classes hooked up. The classes only override Notify and the constructor (and call super anyway). When these animations are played through a Montage, the server will often not trigger the anim notify. The clients all trigger it fine. If the server is a listen server and the ho...
but I think regardless I really shouldn't be doing gameplay logic inside anim notifies for multiplayer games. but my question is, how do you then make things looks visually smooth, like for example if you're doing an item change animation and you want the item to come out when you open it in a theoretical backpack, how do you make sure that it's timed with that animation
are people just using delays or something?
like a character has an item and swaps it out for another via an animation
idk it's just a theoretical example
I think if it helps the simple thing is to just have a fallback timer that is reset whenever a new action occurs or the intended one triggers
you can fake anim notify timing down to the exact frame if you are extremely careful to consider the ticking phase
and it doesn't change playrate
https://github.com/Vaei/LocoTips/wiki/Anim-Notifies there's also stuff like this that is a plugin that tries to make it better etc
interesting
and if the timer expires to zero it just does the missed logic is that what you're saying
yes, this would serve as a backup in case the regular one fails to make sure it happens even if the anim instance is being forced to not tick for ANY reason
I see
also montage notifies are incredibly fickle
by default they do not get cleared out unless the anim instance does so
so it is possible to start an anim -> stop ticking -> show up an entire hour later and trigger the hour old montage event
mostly an issue with not ticking when out of view, which not everyone does I guess
woah
yeah I mean I kinda knew that it was unreliable in the first place for relevancy and optimization pose ticking issues but I did not know that stuff
this applies mostly to the montage instance notifies I guess for that last bit
Am I correct in reasoning that if you initiate something from a client and predict bSuccess to be true, that when the OnRep_Success comes in, if the bSuccess matches, we predicted correctly ?
guess it depends on if the OldValue is based on the local value or servers value
If I have a component which has variables that replicates to all clients, can I somehow restrict it to only replicate to the owning client on some instances?
from Completed in this image it saves my car HP and then Save Game to Slot
pretty sure you can have custom replication rules if the default ones dont fit
Custom or Dynamic might fit
Isn't that just OwnerOnly in the lifetime props method?
For some reason my client is very laggy on the server. Even in builds its lagging and even if i disable network emulation. I tried a lot of things but nothing helped. Even using a brand new movementcomponent with all settings at default still lag. This is just a paperzd character and use default character movement component and all settings at default. Only input binding for movement using the normal move and jump functions you get from cmc. I also use the same class for ai and if controlled by ai there is no lag. only if controlled by client
server (left), client (right)
i tried using the mover component to see if that helps and when i use the move component i dont have this issue, just stronger input delay. But i cant use mover unfortunately because it doesnt work well with some systems i already have
Guys, what is the Correct way to execute something, that the Client Triggers in a Blueprint that gets spawned per actor?
I do it like this rn:
BP_Playercontroller on keypress -> calls "Start event" in BP_perActor via Event Dispatcher.
BP_perActor "Start event" Calls "Custom Event Client" (Not Replicated) and "Custom Event Server" (Run on Server, Reliable)
You can't call a server event on an actor you don't own.
So you'd need your controller, state or pawn to run the server event.
I do spawn BP_perActor per Player and set the owner for it, sry
Alright, that should be fine.
I just wanted to verify if thats a way to go as i just started with unreal engine
Yeah, it should be fine.
Nice thank you!
Is there a better way to do?
Oh it is an EnhancedInputAction
Just fighting with the complexity of so many RPC calls for differen things and loosing track
It just feels somehow "annoying"
Haha. Yes.
And I do find it hard to Debug or probably don't understand the Debugging tools enough
Hi everyone, I have a question, you probably know better than me, but which is better: the Varest plugin or Unreal's HTTPS?
I need an API but I don't know which one to use, or do you know of a better API for UE5?
VaRest is just a BP-specific wrapper for the native HTTP/JSON libraries in UE
I'm using Varest and I was curious about people's opinions on it because when I did some research, there were no reviews about whether it's good or bad. Hopefully, it won't cause any problems in the future ๐
ive been going crazy for the past few days. i have matchmaking in my game that works perfectly fine until i add steam. i followed everything in the OnlineSubsystemSteam docs but im unable to find any session after adding this. i remove it and it works fine, but doesnt have steam. Im using unreal 5.7 non-source.
Ive tried using Advanced sessions and the normal UE nodes. both have the same results. Im using steamworks 1.63(latest version) and the default name for the steam files in unreal is steamv161 so maybe i should downgrade?
Any advice or suggestions are helpful. thank you
Did you disable the Steam Socket Subsystem?
this?
No
[OnlineSubsystemSteam]
bEnabled=True
bUseSteamNetworking=False
bUseSteamNetworking=False
In DefaultEngine.ini
no i havent
im trying to use steam.
Oh
It sounded like you had an existing matchmaking system setup, then you wanted to add Steam ontop for Friends and distribution.
Probably better to ask in #online-subsystems
well. i was jsut using the regular BP nodes and it worked fine in standalone, until i tried adding steam.
will do
is there a proper way to prevent all automatic replication so that I can just selectively replicate what I need? I sort of did this in a previous project with client authoritive movement and stuff but in my current project with a custom controller Im having other issues, I just need both clients to play as if its singleplayer to start with
when I play as just one client it all works fine but if I open 2 clients at once, only one gets possessed and has a few movement bugs. probably entirely specific to my project itself in this case but I cant figure out whats doing this, Ive even used "is locally controlled" to run tick events
@oak pond You can use a DOREPLIFETIME_ACTIVE_OVERRIDE This lets you specify a condition for whether or not an individual property will be replicated.
Take a look at how some of the engine classes use it to get an idea of how it works.
oh I should mention Im on bp only though
oooohh wait Im stupid, it was a collision problem, which hadnt been an issue since it ignored self, nvm lol, simpler than I thought
a listen server only updates an ACharacter's anim graph when receiving new client->server rpcs from that character to make sure root motion is only applied when it resimulates the movement (by my reckoning at least)
this is probably the third time in a day or so someone has asked this question
there's not much you can do from a bp only setup besides maybe have a second skeletal mesh follow the "real" one to make this much nicer or just turn off move combining to make cmc rpcs very spammy but arrive faster. You can search "listen server animation" or something in here and find us talking about this like... a day ago
I am assuming of course that the paper2d setup here relies on anim pose ticking
i dont know if i dont understand you or you missunderstood my problem. i dont have issues with the animations and i dont use a skeletal mesh, only a flipbookcomponent. The issue i have is the movement itself is choppy. i made a character and used a staticmesh as the visible mesh and still had the same issues, so i dont know how root motion is related to this possibly.
ah, I might be off the mark
what do you attach the paper2d rendering thingy to?
Only the relative position of the mesh component is smoothed on clients or the listen server
its basically a capsule collider like a normal character but instead of a skeletal mesh it just has a paperflipbook component. additionally it has a animationcomponent (from PaperZD plugin which is just a way to have animation graph for flipbook animations). the rest is the same as the usual. A cmc and some other components like asc
you said "default character movement component"
it will have a mesh component on an acharacter
attach your visual representation thing to the mesh, not the capsule
and make sure p.NetEnableListenServerSmoothing is 1
no, i mean the character movement component. it doesnt add any mesh. its the one that is on the paper2d character as well
just show the actor's list of components please
i will open the project and try the few things you already suggested. since you already said some things i havnt tried yet, like the console command
it should be on by default so it would only be off if your config or an exec change the cvar
bring the Mesh component back
Even if it's invisible you are still going to want it here imo
what do you mean? there was never a mesh component. this is an inherited class from paperzd (which inherits from paper character)
Maybe the Paper2D character removes the Mesh Component?
unfortunately UCharacterMovementComponent::SmoothClientPosition_UpdateVisuals assumes you have a mesh
thats a base class from unreal itself. it comes from the paper2d engine plugin
it never had a mesh component
you could technically just do the math yourself on the client but it would be a bit of a doozy
i see, thats why you ask for a mesh component.
yeah I'm going to have to check this plugin for a second
Seems like Epic has probably completely ignored the fact that Smoothing needs the mesh to exist
i tried using the mover plugin just to see if the issues stay. when i replaced the CMC with mover i had no choppy movement, just big input delay. thats why i think the cmc causes the issue but i didnt change anything on it.
in the future i might use mover but unfortunately for now i cant due time constraints
Yeah, Id just say this is a massive oversight with Paper 2D
It never really did get a proper treatment
It was sort of slapped together
yeah I'm afraid paper2d is going to be like... super unsupported in general
i mean i downloaded the 3rd person template yesterday in my project just to see and there i had no issues too, so my project settings should be fine i hope
hm, if thats it that's sad. At least i tried my best then i guess.
well
you don't really need to care about this papercharacter thing
this is a really simple class that just puts a new component on a character
you don't need this, you can just put a paper2d component on a character that actually works
no, i mean if i use the character class with skeletal mesh or the 2d character but with mover instead of cmc it doesnt have that choppy frames
then just make a character with an invisible mesh that has a UPaperFlipbookComponent attached to the mesh
this is honestly broken and I'm surprised this is an official plugin
this does
Sprite->SetupAttachment(GetCapsuleComponent());
which will only work for singleplayer games
Paper2D was added a very very long time ago.
you think just attach a mesh on my 2d char would be fine or should i inherit from the official base character class?
the good news is the important part is just the flipbook, you can add a new flipbook in your own character that does what you want
i thought it wouldnt make much difference. i learned from you guys now that the smoothing requires a mesh at all, didnt know that
Use the official base character class, ignore APaperCharacter
APaperCharacter here is literally doing 2 things
- adds a UPaperFlipbookComponent (and attaches it to the Capsule which is completely incorrect here for multiplayer, it should be the mesh)
- calls
Sprite->PrimaryComponentTick.AddPrerequisite(GetCharacterMovement(), GetCharacterMovement()->PrimaryComponentTick);which I think can be done from BP. This is to make sure it updates AFTER the movement component
Yeah its a pretty useless class
tbh it's the cmc's fault for being so scuffed and assuming you have an skm but eh
Surprised they decided to do it that way
Agreed lol
i use it since the paperZD inherits from it. but its just some functions i have to copy paste over if i wanna make the same using the base character class so its fine
I really thought they would have made it more modular sometime during mid UE4 development.
nothing will change but the component for the flipbook. Just make a copy of this and reparent that one, then fix up the copied one
use source control. make SURE you can back this up if the reparenting breaks
yeah I mean in their defense root motion is kind of specific but IMO it would have been pretty easy to make a generic interface that just says "outside vector input" or whatever
Mover is a bit more freeform thankfully but it is very experimental and not nearly as battle tested (I don't know if I can safely tell people to use it without having even used it on a serious project)
yea i'll do. Just as a recap so i get it right. The possible reason why its choppy is because the cmc needs a mesh for smoothing, right?
Just another classic victim of "we dont need to change it, so its staying as is".
yep! It sets the relative transform of the Mesh component on the ACharacter
which is not really something is NEEDS but it just... happens to be coded that way and would be annoying to change
the cmc is possible to change in a variety of ways (beyond just tweakin numbers etc) but it's fairly complicated and will involve a fair bit of c++
yea, i was looking into it for a while, its just a big mess so i dont touch it often. Anyway thank you for the help, i was digging into the code a bit myself and did a lot of research but couldnt find any more clues on what could be the issue. hope this will fix it
the cmc is a bit nightmarish in terms of the assumptions it makes but I will also say it will be hard to beat
the key thing here being how it handles prediction and corrections + just general moving around on terrain
if your game is not competitive it might be worth considering just turning off client corrections altogether as you will save a lot of work that way (actually using the cmc correctly if you intend to predict client movement, which means you make your prediction actually part of the cmc's simulation)
but the problem here is more sim proxy interpolation than prediction, just something I like to mention because cmc extension is massively complicated compared to the needs of some projects
i think in the future i will look more into mover. It works with NPP which i like
I'm not sure about the future of the NPP setup at this point
I think the chaos replication setup is what they actually use
but I hope I am wrong there
interesting.. first packet sent through a UChannel MUST be reliable or the channel just... stops working.. that was a fun one to figure out lol
heyy guys, how can i get player id ? because i can't understand anything anymore, after Find node it goes to False, first screenshot is inside game mode event on post login, second is inside checkpoint blueprint
i tried with get player id i tried with get player name, nothing changes
run standalone game not fixes this too
You probably have the issue where the default/null online subsystem returns randomly generated name each time. You should print string/log the uid and check yourself.
If you use Steam, for example, then the UID is the 64bit uid representing your user in Steam.
yes, every time i enter the game i have different player ID
i use advanced steam sessions plugin
if you launch with -game and subsystem is set to Steam, it should return a consistent UID
remember in Editor steam is always disabled
but when i open the game in standalone i see in menu my nickname and image from my steam
i can't understand, sometimes my save is loading, sometimes after find node goes to false, this is a random thing๐คท
maybe to use arrays for my player data insead of structure?
You should print out the Player ID each time you Save and Load with it, make sure it's the same
I also found a commandline argument -StableNullID that looks like it might give consistent PlayerID on the null subsystem for editor testing
but i need to use player id integer called from player state? or get player name?
You should use the Player ID from the player state
users can change their name, and also not guaranteed to be unique
here nodes are correct?
ahh ok
this foreach loop will call same player id as other nodes from screenshot upper?
Yes I think so, my only question is that maybe the player state is not fully setup or replicated at the point you are doing saving/loading
do i need to create a custom player state blueprint? or its fine with default?
default should be fine
yes when run the game it loads the saved game so it shows for example 352 player id, when run inside checkpoint to save game, it shows same player id
but every time i close the game and run again this player id is different
oh hang on, I think there's a different UID...
๐ค
yes
cannot connect it inside string
you should be able to convert it to a string...
google said to check to string or hex, but still cannot find anyhting
I've only used it in C++
i can't๐ฅฒ
i don't use c++
Can you use the unique net id as the key for your map?
you mean to switch from string to unique net id?
idk if that will work...
i connected it but idk, now will test
runned to true from find node for 2 times, third time again to false๐
@silent valley to string i can use only this get id๐ค
Can you pass PlayerState->GetUniqueId into that same node?
nope
this is BPUnique Net ID
i think this is a modified node from advanced steam sessions plugin
right
from Find branch to False when is a new game, do i need to create another save game object or just call save game node?
I don't quite follow:
When saving, you should loop over all your players and add them to the map, then save the game.
When loading, load the entire map.
In PostLogin if you find the player, you can restore them, if you don't, it means they were not in the game but the next time you save they will be added.
but with this get local steam id from steam, i cannot run 2 clients on 1 PC to test the game๐ฅฒ
omg why is so hard?๐
no don't use the local id from Steam, change back to using the Unique Net Id from the PlayerState as the Map key
I think you just have your logic wrong
where?
Do this: #multiplayer message
this is the save checkpoint
i already made this foreach loop over all players and save their data to map
and this is the load from game mode
what is up with the delay
also looks ok
this is calling here, when player overlap the checkpoint which is replicated blueprint, and works fine for player location what is not inside this map
i tried to add it, maybe the engine is not making in time to load, but nothing changes
google gemini said to add it๐
You shouldn't need it - player state should be setup fine at that point
Ai making things up
idk man, everything looks OK, you might need to debug it
maybe there's some problem using Unique Net Id as a map key, idk. to get around that you'll need to add a little bit of C++ to provide a string converter.
Havw you view the value? It should stay the same with steam.
still running to False๐ฅฒ
Set some breakpoints and inspect what is inside the Map, what value you are searching for, etc
Just view if you have anything in the map at all.
Without debugging you have no idea what might be the problem
100%
Step one, look into the data.
R u running editor ? Doee steam even work in standalone? Im under the impression that they need to be either development or shipping.
Steam does work in standalone
You can also run with -StableNullID argument and test in editor. That flag should force Null subsystem to not generate a random UID each time.
(I never tested this, just found it in the code earlier)
steam works yes, it shows my nickname and profile image in menu, i tried standalone tried in editor, same problem
where to put this argument?
when i save them i see everything, but when load i see default values from map
Then you r not loading properly.
do i need to change the key to unique net id? in my map?
Did you call save game to slot?
yes, when player overlap the checkpoint all data saves
this
and load game from slot inside on post login event
ok
@silent valley i made this type of debug, when saving from new game, it save the game once on checkpoint, after restarting game and saving it again, it saves every time another slot
on first game run when i press once this button to debug, i see all my data once, after saving and restart my game when i press this button again i see my data twice
this is when i start new game and saving it to checkpoint, server 80 hp 1 1 1 are things in my inventory
i close the game, then when i respawn on my last saved checkpoint, the game is saving my data in another slot i think
because i see my data twice
Probably because the Player UID is randomly generated in Editor each time, so it will add a new map entry each time
try adding this to your DefaultEngine.ini (if you can't use the command line arg)
[OnlineSubsystemNull]
bForceStableNullId=true
or you can run this in the console OSSNull.ForceStableNullId 1
run this before start the game?
I have an inventory system where I have an inventory component containing an FFastArraySerializer list of FItemInstances, where each of these instances has a UObject pointer (UItemInstanceData) for stats that can be delta-replicated.
My question is what's the difference between going through the effort of AddReplicadSubObject/ReplicateSubObjects, and just storing these inner UObject pointers on a replicated TArray on my inventory component directly?
okay this inside console stopped to generate double saved data, now every time i run the game i see only 1 string of my data
@silent valleyi did not changed anything here but not it won't make cast to third person character๐คฆ ๐
So it looks up the data OK now?
yes but because of bad cast it cannot be set to my character when it loads
Probably the Character is not created at that point
There's a few places you could hook this up.
i connected that last print string to Find Branch True and yes now it shows my last saved data, i tried to save the game with lower HP, and when i restart the game in print string i see my lower HP than usually, so yes now data is saving and loading
I can't remember where the Pawn gets spawned, but you could add it to BeginPlay of your character for example.
i added a restart player node before cast to third person and now works, but another problem, if i run 2 clients, it loads same saved HP to all players, and if 1 player overlap the checkpoint it saves this HP to all players, and when restart the game it loads last saved HP to all players
Just gonna throw this in here but its prob redundant / irrelevant: tmaps dont replicate
That's because of the bForceStableNullId lol. You can also enable OSSNull.AddUserNumToNullId 1 which I think will make the UIDs unique but stable
but hopefully when you test with Steam it will also work now
Seem to be just a tmap in a save object server side to store player info ? With netid as key?
this not saved
yes
unique net id as key
Isnt that one of the things you cant test in editor / single pc setup
Feel like I did roughly the same thing when i tested the advanced steam session plugin
I vaguely recall it working ๐
It can be tested with Null subsystem in editor but you must enable a couple of debug flags, i.e. OSSNull.ForceStableNullId and OSSNull.AddUserNumToNullId otherwise it is randomly generated each time
so how can i do to test in editor, not steam for now
I just told you, enable both those debug options
i enabled second command but nothing changed
it must be both together
do i need to disable them when i want to test in standalone with steam?
no, they won't have any effect when running with Steam
ok
hmm you have a Unique Net Id to String node... did you add that in C++ yourself?
๐
ahh you're getting the net ID from controller not the player state, that's the difference
gotcha
so i need to use get unique net id from player controller?
What you have should work fine, but if you use the advanced session nodes like in that picture, you can convert them to string which might be useful for debug purposes
if i add that get unique net id from player controller i have this error
oh wait, i connected the input to New Player from onpost login event and now i see my desktop id
okay, i switched back to string key and using now these get unique net id, working as before, but only for 1 client
i can't understand why when i create a session i see Server for first Client, then when i join the created session with second client it shows fine, as Client2, why Client1 is showing as Server instead of Client1?
because you're running Listen Server config?
i started 3 clients, and i see sever and client 2 and 3 but not client 1 2 and 3
Net Mode is Play as Client
so i have to see 3 clients, not server and 2 clients no?๐ค
when i run Play as Listen Server i need to see this server and 2 clients
Do you have the "separate server" option ticked?
where
Go to the advanced options for pie and search for separate.
this?
That's the one.
It may be getting confused with thr server and client 1 in the same process.
Also untick run in the same process
Or one process. Whichever it is.
nothing changed
the issue seems obvious. lol
You put a delay in the event.
So, not all can get through.
So, client 1 and 2 probably load in super fast, then client 3 is a bit slow.
So, client 2 eats clients 1 function call.
I don't think that's a thing...
How deos that even happen if they're run in separate processes?
This is post login.
The server is running that
Then, it gets RPC'd through a different func
it doesn't changes anything that delay
Ah ha.
when i create a session that client who created it it shows as server
Darn, I was actually hopeful that was it. lol
Post login.
Is the controlled pawn ready?
Try to clear that, and just call a generic print?
i just removed it and dont see any changes
How are you determining which is the server?
Show the code doing the printing, where does it live?
Yeah, I would say simplify this.
Just call a hello printstring.
Remove the controlled pawn cast, and etc.
Cuz, I don't recall if the controlled pawn is ready all the time?
i have a print string here
and another inside checkpoint blueprint after all is saving it shows me everything inside map
Which actor is it in? What event? the text is cut off
and when i touch the checkpoint i see Server: 80HP bla bla bla, when i touch the checkpoint with anothe client i see Client2: 80HP bla bla bla
Why are the clients saving game? shouldn't it just be the server?
i have this Function inside checkpoint blueprint
do i have to change this into a custom event run on server?
just add HasAuthority node
between event overlap and cast to third person?
if i add this has authority, other players cannot see if that checkpoint was activated or not, when i run into that checkpoint with second player, nothing happening
the Overlap should fire on server as well as client?
i just added a custom event run on server but nothing changed
yeee finally i fixed everything
i think๐
now when second player join and with different HP touches the checkpoint and then restart the game and load all again, everyone have their saved HP
but the function of the checkpoint i keeped it unchanged, and works ๐ซก
wtf? when running in standalone game the camera is bugged and cant move cand do anything๐
10/10 id play that game
Assuming a setup like below.
It seems brittle as fuck to have to Add/Remove recursively in the SubObjectList manually each time an item is created or duplicated.
Is there something I am missing or replicated recursive UObject is just cursed?
// Does it work recursively?
auto DuplicatedObj = DuplicateObject(OldItem, RepOwnerComp);
RepOwnerComp->AddReplicatedSubObject(DuplicatedObj);
RepOwnerComp->RemoveReplicatedSubObject(OldItem);
// Using bReplicateUsingRegisteredSubObjectList = true on Actor/ActorComp.
// Using virtual bool IsSupportedForNetworking() const override { return true; } for UObjects.
class URepOwnerComp : public UActorComponent
{
//...
UPROPERTY(Replicated)
TArray<TObjectPtr<URepObjectA>> MyObjects;
//...
}
class URepObjA : public UObject
{
UPROPERTY(Replicated)
TObjectPtr<URepObjB> PropObjB = nullptr;
}
class URepObjB : public UObject
{
UPROPERTY(Replicated)
TArray<TObjectPtr<URepObjA>> PropObjsA = nullptr;
}
void URepObjA::ReplicationHierarchy(AActor* RepOwner)
{
RepOwner->RegisterReplicationHierarchy(this);
for (URepObjA ChildA: this->PropObjB->PropObjsA)
{
ChildA->RegisterReplicationHierarchy(RepOwner);
}
}
Nvm, I saw the conversation in #cpp message : |
u missed pointer/ref in declaration in loop for ChildA
is there a way to set a "max" of allowed relevant actors of a certain type?
Can anyone explain why replicated properties which have been set before the actor has finished spawning are null on the client in begin play in 5.6?
My understanding was that if you had the property set by the time the initial spawn actor bunch was sent then it was guaranteed on the client however that seems to not be holding true anymore... ๐ค
@abstract pike Depends on what it is, if its a pointer to another Actor, which has not yet been spawned on the Client as well, then it wont be valid.
You should never assume property replication at any point. Use OnRep_XXX to know exactly when they come through.
Hmm thats a good point about the pointer thing. Maybe it's a problem further upstream. Perhaps that actor it points to is not being spawned on the client for whatever reason.
I thought this was one case that was somewhat reliable, essentially this https://forums.unrealengine.com/t/are-the-initial-properties-of-a-replicated-actor-set-before-beginplay-on-clients/633851/2
But it's a good point that it can't point to something if it doesn't exist on the client either.
Thanks for the quick response!
I do believe that ifs its set before begin play/ finish spawn, the var will always be received as the initial bunch. (thus always be replicated)
But, yeah, if you point to another actor, said other actor may not exist on begin play yet.
assuming it stays under a certain size... maybe
there is a way to manually encode serialized stuff into the first bunch of about ~1000 bytes max
Maybe its special if its multiple vars.
But, I filled an actor with like 1000 array entries or something of MAX 64int vars. That would just mess up the entire actor, and fail replication.
At like 900, it worked, even if I spawned like 20 of those actors.
All 20 would succeed surprisingly.
OnSerializeNewActor for example will let you go "this is literally in the same packet that creates the object"
but it is limited in size
from messing around I am getting rather insanely huge string arrays to arrive immediately (post beginplay)... I still don't think I would trust this 100% under certain scenarios but I suppose you could ensure if it's unexpected
I am on Iris with rather high bandwidth settings so actochannels might not be the same
for posterity other replication objects could be arriving separately still
I am referring to internal serialization of non external net reference types (numbers/strings POD stuff)
Hi, I'm trying to set up a system where one of my characters has an ability that when active, will start spawning footprint decals for every other player (up to 8) at the location of each foot for every step they take while the ability lasts (30-45 secs), but the footprints should only be visible to the one player who is using the ability, every other player should have no idea that its happening..
I already have the set up for activating/deactivating the ability, cooldown ect.. but I am unsure on how to get the footprints spawning, only visible to the player using the ability, when the other players take steps and ideally without coupling the different character classes if possible, any idea's how I should go about doing this?
Iiiii would always spawn the footprints when a client has the ability
And just manipulate their visibility
So spawn them for everyone, then hide for the players that shouldn't see them? But how would I go about actually spawning them, using anim notifies when the ability is active or some other way?
And how would I handle that with correct authority? The ability being activated and deactivated is all server only, but spawning footprints via anim notifies would be client-side wouldn't it? Would that matter?
It depends as always , but spawning them for everyone with the correct trait sounds reasonable
Is it competetive ?
Right but I'm still unsure on how to actually do that, everything ive tried so far spawns them for everyone or hides them for everyone, I can't seem to get it only showing for the only player that should see them
Its not a competitive shooter or anything like that its a killer vs victims, not coop so I still want to prevent cheating as much as possible where possible
You could spawn footprints with some rpc but Id prob start out with client anim notifys tbh
Personally i wouldnt overthink it in regards to cheaters
In this case it prolly doesn't matter as much since the ability and cooldown is server auth anyways, but as far as getting them showing correctly is where I am having the issue..
Alright so right now when the ability is activated the On Rep function calls an interface that the other characters implement and sets its ABP's 'IsSenseHeighteningActive' variable and then I have the anim notifies on the ABP that spawns the decals, is that how I should be doing it so far or am I overcomplicating things again lmao? This gets them spawning but they obviously still shows for every player atm
You need to set its visibility per client based on if they have the ability active
This makes it dpawn everywhere and not only on the trait owning client tho
Couldn't decide if this is more of a multiplayer question or a umg question, so we're gonna try here first. I'm sure the tools exist to help diagnose what's happening but I need help learning what they are. Those buttons on the right monitor being purple indicate that they got focus from a player controller in a loop. How, I do not know, because I was under the impression I only have 3 controllers connected. Regardless of how it's getting the fourth, none of them are working because their actual focus seems to be stuck on the LEFT monitor as indicated by the blue outline that I hope is visible. I can move that around over there but nothing seems to get it onto the right monitor and into the dang game. That's why I have to use this awful picture of a screen instead of a screenshot.
This is LOCAL multiplayer that does NOT use split-screen.
Like I said, what I really need are the tools to diagnose this myself so I can leave y'all alone, so I would greatly appreciate some guidance in that regard.
Oh, and they only turn purple if I run it with breakpoints inside the loop that handles this. If I run it without breakpoints, they all turn red, which means they got focus and then lost it?
Actually, it's probably beneficial to be specific. It means they were added to the focus path and then removed from it.
Oh and if I run it like this from a blueprint other than the level, all the controllers get attached to the rightmost widget and all of them work simultaneously. The other behavior happens if you run it from the actual level blueprint. I . . . do not understand.
@stiff pine Not enough info tbh. Focus in umg is pretty annoying. You have to make sure you create the widgets in a way that the given controller is the owner and then make sure that you only set user focus and not keyboard focus.
Other than that, without seeing any of your code, no one here will really have an idea on how to help you
That can be done.
After quite a bit of experimenting, I have made nearly all of the functionality work. The only remaining issue is that it behaves significantly differently depending on the play in editor mode.
This is the result of Selected Viewport, which indicates that those widgets got focus like they were supposed to but then immidiately lost it.
(Sorry for all the images btw but I don't know a better way to describe what's happening) Here is the result of New Editor Window. This works perfectly and is what I want.
And this is the result of Standalone Game. This indicates that it never found the other 2 controllers at all. Or, for that matter, their associated Platform Users.
This can be made to work by removing the "Set Focus to Game Viewport" node for some reason. Not sure what's up with that, but hey, I'm not gonna complain about success. The Standalone mode remains broken.
I was able to confirm that Standalone does indeed not see platform users other than Player 1 whatsoever.
Turns out it was all because of the rearranging of when addnetworkactor is being called relative to begin play. Basically this addition at the end of AActor::FinishSpawning. It messed up when my replication graph was trying to add things and the logic wouldn't add things for replication.
heyy guys, someone is using Add VOIP Talker node? how to modify microphone and voice chat volume? and how to make it work in main menu too if i want to test it in settings menu?
i added a progress bar but can't understand how to get the microphone sensor to make this bar work when talking
or maybe is better to use Audio Capture plugin? will this plugin work with advanced steam session plugin?
VOIPTalker is a bit painful to get working. AFAIK it's not possible to get the Local Player voice volume either. I use an Audio Capture component for that purpose.
I have a couple of posts which may be useful:
#online-subsystems message
so i need to use voip talker for in session voice chat and audio capture for settings?
If a reliable multicast RPC fails (a client doesn't ACK), does that RPC retrigger for both server and the client? I'm trying to debug a really vexing intermittent bug where an event is happening twice...
Put another way -- is there any engine-side de-duping for RPC calls that get waylaid, or is it expected that you may get double triggers on reliable RPCs?
@silent valleyso to change microphone volume i have to use console command "voice.MicInputGain "?
By curiosity, what is that RPC do ?
Usualy core reliable RPCs should rarely fail
And since you said its a net multicast i think it can be changed to a repnotify property
Nay you shouldn't be getting double-calls on RPCs that fail
Hey folks, I am testing my own custom movement component for a top-down 2 player co-op game. Here is the screenshot of my "stat net" while both the listen-server and client are moving. Would these "In Rate" and "Out Rate" values be ok for a game? Or are they too high and would clog up the bandwidth?
They're fine
Got it, thanks!
Make sure to use Unreal Insights, specifically the Network Insights part of it, for stuff like this if you want to know more about what costs you those bytes.
Will do, thanks!
I am going to follow this documentation, is there anything I need to know regarding networking insights other than what's in here?
https://dev.epicgames.com/documentation/en-us/unreal-engine/networking-insights-in-unreal-engine
Don't think so. Might be a bit tricky to get it to show inside the Editor. Think you have to already start it tracing with the Net channel when you boot it.
Anyone have knowledge on why playing in Standalone mode prevents Unreal from finding multiple players?
Multiple players?
we are running into an issue with joining eachother through the steam plugin. it says level found and joins then it just kicks you back to the levle you started on. any ideas?
5.7
Start with what you have done so people don't have to ask you 20 questions to determine what the issue could be
There's some known issues, iirc steam-advanced-sessions doesn't work properly in 5.7 (also having issues fwiw)
Ther's a few convos about it in #online-subsystems that talk about fixes
Hi guys, my game uses async tick physics and I noticed that there is alot of rubber banding when this is used in multiplayer. The game doesnt use dedicated servers so is there a way to fix this rubber banding without turning off async tick physics
this is a pita
i have not tried it yet damn
For my 3 player co-op game with client-authoritative movement, I have a repnotify struct ClientMoveState that holds the movement data. I move the locally controlled pawn locally and then send the struct to server without any corrections checks back. Then I use OnRep_ClientMoveState() to move the pawn on other clients. Does this setup make sense for a simple game without the need for any cheating checks? Also, one bandwitdh optimization I have done is adding replication condition COND_SimulatedOnly for ClientMoveState, saving a few bytes. Are there any other optimizations I can do?
you don't need to make anything custom to turn off corrections for a cmc
assuming you are using that
it's a game network setting you can set from the ini, google should find some results
If you want it to be smooth you'll have to add some smoothing here.
I am using my own custom movement component(inherited from UPawnMovementComponent). I tested the default CMC with corrections turned off but it is taking almost double the bandwidth than the simple custom mc I made.
Yes, I have a simple smoothing implementation right now with RInterpTo and VInterpTo. Might do a 1โฌ filter later if needed. I have found success with that filter while I was working on VR MP projects.
that neat but you did just try turning the network quantization up a bit before giving up on the cmc? I would say it's hard to say what to optimize without seeing the actual data.
I can't imagine needing to go too far with just 3 players sending vectors down
Yes I tried with different network quantization levels for the CMC and my own implementation. Overall my own implementation performed a little better. I also want to learn so going my own way feels better and helps me understand more things.
I would say at least take a look at how the cmc interpolates
what does "performed a little better" actually mean in raw numbers? Not saying you are doing it wrong here, just more interested in specifics
When I was testing 2 player setup, my bandwidth in and out rates for CMC were between 2000-2800 bytes. For my own implementation, the rates were around 1600-2100. In both the cases, with different network emulations, the movement was smooth. So my simple mc performed a little better in terms of bandwidth.
Nice
And I think I can lower the rates even further if I remove velocity and timestamps from the movement struct. Since I am not doing any prediction, I think I can get away with it
Hello Guys! how to fix
Client_LoadBlock RPC โ 126 KB
Unreal max RPC bunch โ 64 KB
send this information in smaller chunks
you could also raise net.MaxConstructedPartialBunchSizeBytes but I would say it's not that hard to make a sequence of reliables to send
do 1500 now try
i see thฤฑs is document i use blueprฤฑnt
I would say try to be careful with spamming too many reliables are you could risk hitting certain internal limits. It's probably better to have an ack step back and forth to reduce the risk of things missing
I set the chunk to 1500 and the timer to 0.1, and I'm waiting for it to copy to the server.
I don't want to do small scaling like 100 or 200 because there are 50k blocks, and I don't think players would want to wait.
so you might not have access to asking the connection about things but you can still have a series of rpcs back and forth
It's not giving an error right now, I'll need to reduce the number.
the risk here is if you push things too far it might actually just break things like skip other important reliables or disconnect people
you can raise a lot of network limits but some are very set in stone
how many do ?
I'm more familiar with Iris than the built in setup (actor channel replication)
Iris vs actor channel replication is about the lower-level netcode that actually sends rpcs and replicates properties. This is not about using an actor or not. (Iris is experimental but will be the default eventially)
You are still sending this rpc from an actor, you are just being smart about sending batches of data
okey i will change now try
1000 blok ร 25 byte = 25KB
16,000 รท 1000 = 16 RPC
16 ร 0.1s = 1.6
its good ?
i use already timer
instead, the client should send back a report saying that it is ready for more sections
using a delay is better than nothing but it is not going to help avoid actual issues and is just praying it will not be overloaded
you don't have a lot of access to connection details from here (and honestly C++ doesn't expose a lot of context for this either!) but you CAN at least have your own back-and-forth series of RPCs to keep things consistent
brooooooooo
thank you very much!

you might find it useful to raise the default bandwidth limits too. These are just example numbers and might not work in all connection setups. Consider the defaults and what your actual target hardware does for bandwidth I guess
โจโจโจ```ini
game ini:
[/Script/Engine.GameNetworkManager]
; Increase from the base bandwidth, numbers need to match ConfiguredInternetSpeed in DefaultEngine
TotalNetBandwidth=200000000
MaxDynamicBandwidth=200000000
MinDynamicBandwidth=200000
engine ini:
[/Script/Engine.Player]
; These numbers should match TotalNetBandwidth
ConfiguredInternetSpeed=200000000
ConfiguredLanSpeed=200000000
I understood what you meant, and in short, I implemented it this way.
Thank you, itโs working properly now.
how can i make my lines look like that (non curved, manhattan style grid lines)
Electronic nodes plugin
how you set movment replication in constructor? ๐ค
Use the setter function.
ye, but is that not an error?
Probably fine to ignore it.
โจSetReplicatingMovementโฉ is what you want I think, not โจSetReplicateMovementโฉ
this is confusing but you can just see what the functions do by clicking on them
for a ctor call you want something that sets the field with minimal side effects
generally speaking
you are right and wrong xD
โจ```cpp
void AActor::SetReplicateMovement(bool bInReplicateMovement)
{
SetReplicatingMovement(bInReplicateMovement);
}
well
this is a virtual
some classes override this
you do not want code to run outside of this
โจACharacter::SetReplicateMovementโฉ for example will update a timestamp
well its only actor for me
please consider what I am actually saying here, you do NOT want to update dynamic runtime info inside of a ctor
I personally prefer to just call the actual intended function here. Yes effectively there is no difference provided nobody overrides it here
okok
so it won't matter, but you can see in the engine SetReplicatingMovement is used for setting defaults from ctors and early on
an insanely confusing pair of function names lol
one of them should probably be named something else
lol
make the engine your very own, mod it as much as you can if you are not comfortable with Epic namings
[CoreRedirects] inside defaultengine.ini doesn't work for plugins because they are independent modules?
seems like I need PackageRenames but it still not updating blueprints parent module ArmaVehicleSystem.uplugin
"Plugins": [],
"CoreRedirects": {
"PackageRenames": {
"/Script/FGearPhysics": "/Script/ArmaVehicleSystem"
}
}
since when could you add coreredirects to the uplugin?
so the plugin needs its own ini?
cause adding it to the defaultengine ini not working
DefaultEngine.ini as the one located under <project>/Config
the examples I've seen of plugin ones go in <plugin root>/Config/DefaultNameOfPlugin.ini
will try it now
Incoming literal DefaultNameOfPlugin.ini
well its not working, the blueprint classes inside the ArmaVehicleSystem/Content/Blueprints/somebp.uasset still looking for FGearPhysics, not for ArmaVehicleSystem
what is the file you made called, where did you locate it, what does it contain?
though I'm not sure why a coreredirects thing is in here
DefaultNameOfPlugin.ini
[CoreRedirects]
+PackageRenames=(OldName="/Script/FGearPhysics", NewName="/Script/ArmaVehicleSystem")
so you literally did name it DefaultNameOfPlugin.ini. @latent heart you win that imaginary bet
in this case it should be DefaultArmaVehicleSystem.ini
Default is necessary to add?
I am shocked ๐
no luck, its still not working
do I need explicitly redirect the class name also for a new module name?
finally foundd a working solution for redirecting module names after renaming
DefaultArmaVehicleSystem.ini
[CoreRedirects]
+PackageRedirects=(OldName="/FGearPhysics", NewName="/ArmaVehicleSystem",MatchSubstring=true)
(great for renaming modules)
Hey all , have this sort of issue , actor placed by hand on the world partition (5.7.2) makes function from player controller not authorized on Dedicated server - anyone have an idea why is that?
Server is placed, client join and when actor is in world partition - it destroys functionality to send RPC it thinks that instance of Server is not a Dedicated server (crash with IsRunningDedicatedServer().
while there is no actor everything fine... (AActor class)
this happen with any actor or a specific actor?
any just regular i thought its code related but tried with base and the same
create a bp actor under asset editor, open it compile it and save it, place it in world and test again
I'm not clear on the question actually. an actor placed in the world won't be owned by any particular player controller so client->server RPCs would expect to fail
Also, crashing?
Whats the crash stack.
I agree with sswires either way.
More info, but otherwise the result of not working sounds expected.
here its the video as You see just placing actor just block called RPC to the GameMode in World partition.
Oh, its a check failure, not a legit crash like I thought.
Gonna need more context, or code.
Cuz a random ass actor would 100% not cause issues.
have you checked the logs, maybe they say something?
Otherwise, can't go off much, especially with the visual confusion of a "create profile" function making a textbox appear, as if it were a game chat.
what is at line 119 in your scontroller?
post the whole function, I think if the world for an object is not valid you can't use isserver or isdedicated server
so the thing is i create a profile on the server and when i place actor to the world partition client lost authority and create it locally
cause it thinks its not dedicated server after joining - join to the server wont fail just actor mess up something that loss the knowledge is on the server
also don't use check for authority stuff
just to if (!IsRunningDedicated()){ your stuff}
no matter code i place there - aactor just disband dedicated server communication
also why is world partition related?
in non wp level it works?
Gonna need to post more code, or something.
There is no way just a random ass actor breaks replication.
That be a log entry saying something went wrong, or general code issue, for whatever reason.
But, a +1 actor is no way its the cause.
for the level without WP code that launch box to type profile name wont even launch looking why.
seems like only WP issue
check in level blueprints
okay so it also produced locally on the standard level but check isnt triggered wont crash as in WP 
code updated also needed Easy Multi Save Plugin to create such an profile
i have no a clue how placed actor can switch authority in that case iam to stupid maybe You can Guys help here
None of this code you posted actually calls the function causing the issue.
Thats the implementaion.
But, not the call
void AGoblinCharacter::OnRep_Seat(TWeakObjectPtr<USeatComponent> Previous)
{
UE_LOGFMT(LogGoblinCharacter, Log, "OnRep_Seat: Change from {0} -> {1}.",
Previous.GetWeakPtrTypeHash(), SeatComponent.GetWeakPtrTypeHash());
if (SeatComponent == Previous)
return;
if (Previous.IsValid())
{
DetachPlayerFromSeat(Previous.Get());
// This never gets called.
}
Hiya! Anyone know if the "with previous value" implementation of OnRep for some reason doesn't work correctly with weak pointers (or maybe pointers in general)?
The component referenced here should certainly still be alive.
That get player controller is already sus, cuz its a weird/ wrong function to use.
Try it with the expected get owning player, thats designed for widgets.
When/ where is previous ever set?
that looks like a user widget, so a little more permissable but the owner is already there
It's my understanding that this overloaded signature gets called with the previous value before replication.
Oh, its a function input.
I've never delt with on rep like that, so IDK then.
I always just known on rep as a on value change sorta thing, not a give other context function. ๐
Valid.
Otherwise, I guess check logging. maybe it says something.
Ain't no way +1 actor breaks replication, unless theres something really cursed going on.
Or, run with debugger, and see if the stack trace, or general var info says anything.
so actor wont me join to the server it does not accept my machine id. I think the case is maybe Actor somehow get authority and own the same "machine guid" - while code does not allow to push 2 instances of clients with same guid. and why i cant connect or being send locally
i think game mode takes actor to the account for authorization
yeah when actor is placed code takes guid to the account as machine id -
need some code then that game mode exclude other guids that not come from player somehow
LogNet: UNetConnection::Close: [UNetConnection] RemoteAddr: 127.0.0.1:7777, Name: IpConnection_5, Driver: Name:PendingNetDriver Def:GameNetDriver IpNetDriver_5, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID,
it wont me produce profile since iam like a second user that would like to join its wierd but thats is most logic explanation of kicking my player controller from the server
That just looks like the entire thing is invalid, cuz no owner, or PC.
So, that suggests something extra is fucked, and not that the actor is somehow magically talking context.
will try to figure this out steamid wont work for me also cant set for dedicated server atm- that i went with guids and machineid is unique for testing.
deleted core redirects, and the bp classes are again confused ๐
I did this many times
even added new variables to the bp classes
compiled, saved already
@daring narwhal whats this pre placed actor has anything to do with the cropped code you shpw earlier?
hey, yes it blocks other Guids - Machine IDS to prevent multilog from same client to the server. So propably that code takes placed actor with GUID fo authorization process somehow. Need to do some checks and problem should be resolved.
blooks other Guids? What is the goal here? The code doesn't says much but too send server RPC
goal here its build testing enviroment - Profiles and saving on Dedicated Server since i cannot get working steam api. Cannot connect locally with advanced sessions. Need some feature that simulates for me network solution - correct server placement. In Standalone saves going to the local folder so i cant see logic for that works as excepted so when profiles are build on te server and stored there i know that everything ok ๐
#multiplayer message
So what's creating profile or setting variable on server's game mode has anything to do with GUID or the pre-placed actor in the scene?
Here its Epic implementation of unique GUID for a computer -> my code just veryfiy placed actor on the scene instead that comes from computer somehow. Have no idea why engine is doing that but it read that actor guid first before my machine guid.
so why i have this problem of failed authorization and profile creates on the local computer
that is needed to load profile when user going back for take this number as verified user from this PC (Steam ID)
Why is steam unique ID alone not enough to indentify a player?
As for the Actor GUID you seeing on the scene, that is not the machine ID, that's just editor only GUID.
feel like we are not on the same page though, what is the actual goal here?
Client join, send profile data to server, then server saves to it's disk?
as i said steam api doesnt work for dedicated server cant test it locally for 5.7.2 with advanced seession and other stuff
server has stored GUID and player name and next login it recognizes this ID and name also load data back to this player
so you want to store / send the MachineID Guid, have you done this? because clicking on some actor in the scene and checking it's Editor only actor guid is not relevant.
yest it works but placed actors that have own guids are taken to the account for this authorization process - as logged user. Now need exclude them somehow and takes to the account only that Machine IDS as right place to read for the server
Not trying to be difficult here or condesending, just genuily lost why the pre-placed actor is a thing.
Can't you just
Client -> Server_RPC(MachineID, PlayerName)
Server(MachineID, PlayerName)-> Create Profile -> Save Profile.
its doing that exactly but code take this random palced actor to the account not the machine id. That is the magic here it just thinks that placed actor is active user... no idea why ๐
show code
Why is loaoding a save profile takes in UObject? where is this UObject created?
this is EMS class that ive send screen its own save that store profile credentials name and machine guid
and for authorization serve looks for this files to recognize specific user
somewhere code reads that placed actor guid is right machine id that exist and wont allow me to join
so i cant execute creation of profile
void ASPlayerController::Client_RequestMachineId_Implementation()
{
LocalMachineId = FPlatformMisc::GetMachineId();
//LocalMachineId = FGuid::NewGuid();
if (!LocalMachineId.IsValid())
{
Client_AuthFailed();
return;
}
Server_SendMachineId(LocalMachineId);
}
So server tell client to oget it's machine ID, then client send the MachineID back to server?
looks ok soo far
I never use _validate though hopefully that dont mess anything
thats iam confused -> client expose his machine id but first login code take actors placed in the world with guids that is the issue and
"oh hey i have id atm - user kicked" ๐
void ASGameMode::HandleMachineAuth(ASPlayerController* PC, const FGuid& MachineId)
{
check(HasAuthority());
if (!PC || !MachineId.IsValid())
{
PC->Client_AuthFailed();
return;
}
if (ActivePlayers.Contains(MachineId))
{
PC->Client_AuthFailed();
return;
}
ActivePlayers.Add(MachineId, PC);
PC->OnMachineAuthenticated(MachineId);
FString ExistingPlayer;
UEMSMultiCustSav* Profile = nullptr;
if (FindProfileForMachine(MachineId, ExistingPlayer, Profile))
{
PC->OnProfileAuthenticated(ExistingPlayer);
PC->SetProfileSave(Profile); // <<< KLUCZOWE
}
else
{
PC->Client_NoProfile();
}
}
just checking code here, kinda hard since I don't have your proj
btw HasAuthority check is useless here since game mode only exist on server.
So like, are you able to test if you always get the same MachineID all the time?
I suppose you test this with multiple devices too?
will do but now need to set my own computer the will try with a laptop that 2 concurent users are legit for this system so i can quickly work just in my pc
if (ActivePlayers.Contains(MachineId))
{
PC->Client_AuthFailed();
return;
}
If you've been testing with a single PC, it should fail here as everyone would be using the same MachineID.
as i said it works for single client - mine pc i can create profile and test on the local server without issues maybe server get the same Machine Id as example while actor is placed ๐ค
if you're planning on using Steam then I would suggest to fix the OSS running on the dedicated server since that will still be the most reliable way of uniquely identifying a player
also the "GenericPlatform" stuff is the base implementation for most platform things, usually there are platform specific implementations where possible
such a good Guy helped me to solve this puzzle so iam able to test things now wish with no further issues heh
thanks but i wasnt able to run with all the knowledge i could gather to test local for my dev puprose. Will left to that later just need some enviroment to see if saves works on the server and nothing breaks. For listen seems there are no issues . for dedicated just session wont apply client if server is running on same machine - treid sandboxie with 2 steam accounts and wont allow me also
that's always been a limitation, I would just suggest using a spare machine or renting a VPS for testing that
Hi,
Currently running into an issue where the client sees all the NPC movement as laggy in build, but in editor with BufferBloat / Bad connection, I can't replicate it.
I ran unrealinsights network profiler on the nightly and there were no high peaks there either in bandwidth
what is the refresh/frame rate of both sides in both cases?
low fps = longer spaces between rpcs/replication
Both capped to 60
any priorization/filtering?
is "movement" here actually their actor transform onreps? You can add something real quick to just track how fast it is onrepping
or just visualize it
Hi, I'm so confused on this.. I have an overlap that despite the player not being inside of, is still registering as if they are? I specifically leave the overlap, I can see the EndOverlap event fire successfully confirming I've left the overlap and yet when TriggerBells is called the if check circled in red can go true despite the player being way outside the overlap.. the weird thing is I can literally change nothing, run the game again and then do exactly the same and it'll fire false, how do I even begin to debug that?? Doesn't make any sense 
issue was that some data packets cant go thorugh if the default game map is set as lobby map actor change something that wont allow to travel between maps. well so i can only do the test without lobby for that specific setup i think. Will package server and see if the profile sits on the server
I never deploy a dedicated server but afaik you need to open the level with ?listen to allow replication / networking. Not sure if thats neccessary for dedicatded but i wouldnt be suprised.
that has never been necessary for dedicated
Hello, I was wondering if someone could guide me in the correct direction.
I am creating a game that uses a listener server, etc. I want the players to be able to move between a few various levels (lobby, main1, dungeon1, dungeon2, etc), while keeping the same game state properties. Lets say total score together. Its a co-op game.
I've read that Game State get's garbage collected between level transitions.
I was told to put this data into GameInstance or GameMode (obviously have the authoritative instance handle it.) Not really sure what I should do. Any ideas?
Are you using C++ or BP only?