#multiplayer
1 messages · Page 617 of 1
@dark edge Seems like it detected the file as corrupted as i pass it from the other PC. Just creating a blank one and adding the info fix the issue. Thanks!
When an object is spawned by the server and set to replicate, the construction runs only on the server right?
I think both client and server would construct the object
@meager spade curious, why do you client RPC to confirm the hit when you’re going to multicast immediately after to confirm it for everyone? Is it just because the multicast is unreliable and the client RPC can be reliable?
client rpc is reliable, multicast is not, correct. also that runs different logic specifically for telling the client your hit was good.
the multicast does not go to owning client FYI.
i mean its run, but owning client does not run the logic inside
cause the clientrpc handles that
something broke my code somewhere between updating to 4.25
the AGameState::PlayerArray has the wrong amount of players, but i cant find out whats wrong by debugging...
seems like RemovePlayerState isnt working or something
Is the Game instance local for all players? I'm trying to do something in the game instance of all players but only works on the server, even with a multicast
That gets me thinking, how bad form is it to set an MC as reliable? I imagine for frequently occurring events it's horrible (and I tend to avoid it), but it's still a valid strategy if you don't spam the connection, is that right?
It depends on the use case. I wouldn't set a multicast that spawns a particle as reliable but if it does something important, sure it's fine. What's your use case?
No specific usecase, just looking for general best practices and trying to gauge just how bad it would be.
But seems like I'm on the same page, that there should generally be a good reason to set it as reliable.
Yeah it's very rare that I end up reaching for a reliable multicast. I typically like to use rep notify for that kind of stuff
Can anyone help me with this strange multiplayer bug I have with tracing my Mouse Location and settings my Tank Rotation.
I've uploaded a short 2 minute video with my case explained
So I can control the server tank, but why can't I control the client tank?
I also found this Forum and he seemed to have the same problem, which is unfortunatly unawnser. https://answers.unrealengine.com/questions/511699/replicating-get-hit-result-under-cursor-by-channel.html
If anyone might wanna hop in a call with me so I can Show my Case Realtime then let me know
Show the nodes from the trace to setting the rotation.
if i pass a struct by const& to an RPC, will it work, or do i need to pass by value any time i'm going to another machine
@elder ravine Looks like you're doing something weird. All you should have to do is make a variable in the tank if it's controlled by a controller and then on tick, in only the locally controlled version of the tank, get it's controller, cast to player controller, locally set the hit cursor result, then ServerRPC that result to the server version of the pawn to set it for it to replicate to all except owner(Since owner is setting it locally). Then you can do your rotation stuff like on tick or whatever.
going to try this
@elder ravine that looks all sorts of fucky. To start, on tick, branch on IsLocallyControlled, and calculate either the aim position or rotation
Then, set AimPosition or AimRotation and also send it to server via a run on server event.
The aiming variable should be set to replicate, with condition SkipOwner
gonna try this now. And you mean to do this all in Tank Blueprint right? Not in PlayerController
Yes, PlayerController should only come into it when you're doing the trace to calculate where to aim. You can also just use the ControlRotation if that works for your setup.
copy copy. I use the trace from the mouse. So i'll locally calculate that mouse location in my PC, and then cast to it from my Tank to get that variable from my PC.
No you don't need to do anything in your PC. All in the tank.
Anyone here knows how to make linux dedicated server build that uses steam?
or like this? @dark edge
@elder ravine not quite. After you check if it's locally controlled, you do a local aim, and then you call send aim to server.
And then on both the server and client, you rotate turret to aim at aim location
Your run on server event needs an input, which will be the aim location or aim direction
@dark edge It's sort of almost working now.
Server can not control itself. But Server sees clients moving now.
@elder ravine both local and not locally controlled need to use the variable to set the rotation of the turret.
Just if it is local, you calculate the variable, set it, and send it to server.
So if not local, just set turret rotation
I feel so dumb, can't get it through my head. Can u Sketch it out ? I'll pay u on paypal
Sec
@elder ravine
I don't have the calc aim location math in there but that's basically it
I've set this now and it works! (apperently I also needed to tick Component Replicates on in the top right)!
Make sure the send aim to server is NOT reliable
@elder ravine that will sort of work but it's unnecessarily complicated. Now you have to replicate the turret component instead of just replicating the data required to set its orientation. Also, with any sort of lag, the owning client is going to be rubber banding like crazy
As soon as i switch that off it does not work anymore
Because you aren't doing it the way I showed you.
Oh yes I see, i'll now do exactly as you showed
I'm trying to build linux dedicated server, but this is the error I get
LogWindows: Error: === Critical error: ===
LogWindows: Error:
LogWindows: Error: Fatal error!
LogWindows: Error:
LogWindows: Error: Unhandled Exception: 0xc06d007e
LogWindows: Error:
LogWindows: Error: [Callstack] 0x00007ffafec73b29 KERNELBASE.dll!UnknownFunction []
LogWindows: Error: [Callstack] 0x00007ffa464f6d45 UE4Editor-Kingshunt.dll!__delayLoadHelper2() [d:\agent\_work\5\s\src\vctools\delayimp\delayhlp.cpp:312]
LogWindows: Error: [Callstack] 0x00007ffa464ebcc5 UE4Editor-Kingshunt.dll!_tailMerge_steam_api64_dll() []
LogWindows: Error: [Callstack] 0x00007ffa463a5eeb UE4Editor-Kingshunt.dll!AMainMenuPlayerController::AMainMenuPlayerController() [E:\KingshuntAwsLocalRefresh1\Source\Kingshunt\Private\Kingshunt\MainMenuPlayerController.cpp:31]```
Any ideas?
AMainMenuPlayerController::AMainMenuPlayerController(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
}```
And to be more precise the Development server Linux code compiles fine, but the error comes when trying to package the server target
And I have libsteam_api.so and steamclient.so in Binaries/Linux and I have added those as RuntimmeDependecies on the server target in my Build.cs
HI! I'm trying to use the Gameplay Abilities UE4 plugin to replicate abilities and root motion animation montages across players. I'm also using SmoothSync to smooth normal movement but found that SS does NOT work with root motion if the server is using it (the server pawn jerks around real bad on the clients' screens).
Anyone else have a similar setup and maybe some idea of what I could change to get the SS to work better with the server player?
__delayLoadHelper2 seems to indicate that your game module is linking the steamworks SDK but it can't find the DLL on disk
is there a reason you are doing this?
@random nymph
I shouldn't be linking it on server target
well this is the editor target
plus I wouldn't link the steamworks SDK in a game module anyway
What indicates that?
UE4Editor-Kingshunt.dll
UE4Editor-Kingshunt.dll
Hey guys, I'm creating and joining a session but after a while I want to go back to a main menu, however there I can't create other session to play again in the same instance. I assume that the old session is still created, how can I fix this so I can create new sessions without closing and opening the game again?
for online stuff, I prefer to go through the OSS. but if you really need the Steamworks SDK then I would recommend you use SteamShared as a dependency instead
since that manages the dependency order and loads the appropriate DLLs
What do you mean by going through the OSS?
i have problem with RPC
UFUNCTION(NetMulticast, Unreliable)
void Multicast_SpawnMeleeWeaponImpactEffects(
TEnumAsByte<EPhysicalSurface> PhysicalSurface,
FVector_NetQuantize ImpactPoint,
FVector_NetQuantize ImpactNormal,
int32 MeleeWeaponItemID,
int32 MeleeWeaponSkinID);
void Multicast_SpawnMeleeWeaponImpactEffects_Implementation(
TEnumAsByte<EPhysicalSurface> PhysicalSurface,
FVector_NetQuantize ImpactPoint,
FVector_NetQuantize ImpactNormal,
int32 MeleeWeaponItemID,
int32 MeleeWeaponSkinID);
online subsystem
can i set TEnumAsByte in RPC?
Yeah but how does that help?
And how can the build target be editor if I select Server as build target and then build for linux 🤔
void AHVS_Character::Client_EnableCustomRenderDepthForTeam_Implementation()
{
for (TActorIterator<AHVS_Character> It(GetWorld()); It; ++It)
{
if (It->GetTeam() == GetTeam() && !It->IsLocallyControlled())
{
It->GetMesh()->bRenderCustomDepth = true;
It->GetMesh()->CustomDepthStencilValue = 252;
It->GetMesh()->MarkRenderStateDirty();
if (IsValid(It->CharacterWeapon))
{
It->CharacterWeapon->GetMesh()->bRenderCustomDepth;
It->CharacterWeapon->GetMesh()->MarkRenderStateDirty();
}
else
{
UE_LOG(LogTemp, Error, TEXT("Client_EnableCustomRenderDepthForTeam It->CharacterWeapon was nullptr. It was probably not initialized yet."));
}
}
}
}
void AHVS_Character::PossessedBy(AController* NewController)
{
Super::PossessedBy(NewController);
PlayerController = Cast<AHVS_PlayerController>(NewController);
Client_EnableCustomRenderDepthForTeam();```
So I made this Client RPC which is called from the PossessedBy method.
However, CharacterWeapon is not yet initialized, and sometimes (at least in PIE) there is only one character at the time of using TActorIterator
Where should I call this method, if not in PossessedBy
well you weapon should pull it if its not ready at the time
in its beginplay
or w/e
can help me?
The biggest issue I still have in Unreal is race conditions
i have this error
error C2511: 'void ACPP_FL_Pawn::Multicast_SpawnMeleeWeaponImpactEffects(EPhysicalSurface,FVector_NetQuantize,FVector_NetQuantize,int32,int32)': overloaded member function not found in 'ACPP_FL_Pawn'
I mean I've used Unity to make multiplayer games and never had this issue, but it's because they make a separate solution for this called "Script execution order"
UFUNCTION(NetMulticast, Unreliable)
void Multicast_SpawnMeleeWeaponImpactEffects(
TEnumAsByte<EPhysicalSurface> PhysicalSurface,
FVector_NetQuantize ImpactPoint,
FVector_NetQuantize ImpactNormal,
int32 MeleeWeaponItemID,
int32 MeleeWeaponSkinID);
void Multicast_SpawnMeleeWeaponImpactEffects_Implementation(
TEnumAsByte<EPhysicalSurface> PhysicalSurface,
FVector_NetQuantize ImpactPoint,
FVector_NetQuantize ImpactNormal,
int32 MeleeWeaponItemID,
int32 MeleeWeaponSkinID);
i make it, but have this error
^
void ACPP_FL_Pawn::Multicast_SpawnMeleeWeaponImpactEffects_Implementation(TEnumAsByte<EPhysicalSurface> PhysicalSurface, FVector_NetQuantize ImpactPoint, FVector_NetQuantize ImpactNormal, int32 MeleeWeaponItemID, int32 MeleeWeaponSkinID)
{
}
``` here will be uint8 to?
but how i can convert to TEnumAsByte
if (ItemMeleeWeaponInfo.MeleeWeaponImpact.Contains(PhysicalSurface))
i have TMap with impact effects
Looks like I got the linux packaging working by removing the steam bUsesSteam from the server target. Gotta test if I can use it without it
@gritty pelican just cast it
btw
{
}
compiles just fine
void ServerTest(EPhysicalSurface Surface);```
if (ItemMeleeWeaponInfo.MeleeWeaponImpact.Contains(static_cast<TEnumAsByte<EPhysicalSurface>>(PhysicalSurface)))
no
just do this
void Multicast_SpawnMeleeWeaponImpactEffects(
EPhysicalSurface PhysicalSurface,
FVector_NetQuantize ImpactPoint,
FVector_NetQuantize ImpactNormal,
int32 MeleeWeaponItemID,
int32 MeleeWeaponSkinID);
void Multicast_SpawnMeleeWeaponImpactEffects_Implementation(
EPhysicalSurface PhysicalSurface,
FVector_NetQuantize ImpactPoint,
FVector_NetQuantize ImpactNormal,
int32 MeleeWeaponItemID,
int32 MeleeWeaponSkinID);```
and it will work just fine
thanks, will try now
error LNK2019: unresolved external symbol "__declspec(dllimport) class UEnum * __cdecl Z_Construct_UEnum_PhysicsCore_EPhysicalSurface(void)" (__imp_?Z_Construct_UEnum_PhysicsCore_EPhysicalSurface@@YAPEAVUEnum@@XZ) referenced in function "void __cdecl `dynamic initializer for 'public: static struct UE4CodeGen_Private::FBytePropertyParams const Z_Construct_UFunction_ACPP_FL_Pawn_Multicast_SpawnMeleeWeaponImpactEffects_Statics::NewProp_PhysicalSurface''(void)" (??__E?NewProp_PhysicalSurface@Z_Construct_UFunction_ACPP_FL_Pawn_Multicast_SpawnMeleeWeaponImpactEffects_Statics@@2UFBytePropertyParams@UE4CodeGen_Private@@B@@YAXXZ)
i need to add PhysicsCore to private modules?
now compile success, thx
So its been a while since i worked in multiplayer. When i did it in the past it seemed confusing how to do it in c++ properly. You have a function that calls a RPC to server that calls a RPC to multicast and there are other functions that have to be added if you want it to be reliable and so on... So i went looking for "best practices" or "standards" for how multiplayer should be structured and most of what i come up with is old. So has nothing really changed with multiplayer that i could follow those guides and be fine? Or does someone have a link to a better more up to date guide?
eXi's compendium is definitively a good start
given that you are starting over after so many years
So that older document still is completely relevant then. Not much has changed with how it operates.
In PIE, there is a massive problem
If you spawn two players, in dedicated server mode and then try to create a Client RPC to enable GetMesh()->bRenderCustomDepth = true; on the characters spawned it will not work for some reason
You know. Race conditions are considered an exploit by the federal government in the USA lol
Does anyone know why my server is sending weapon A and my client is received weapon B? This has been slowly driving me mad
I'm sending the weapon as a weak object pointer that's a uproperty inside of a replicated state property
not sure why ur even doing that tho
Its the active weapon being used, as part of the character state
Is there another way?
Yes, my player state has several things that describe what its doing: imagine position, velocity, and active weapon pointer, that struct is called FPlayerCharacterState
Because I have my own prediction system, I am maintaining a cyclic buffer of FPlayerCharacterStates, upon which I do things like prediction and rollback
Each state has a tick ID (some int in [0, 127]) which I use for time placement, since that tick is incremented in fixed time intervals
And the server is sending the wrong value?
Have you tried to step through it using a debugger step by step to see what's being sent?
As far as I can tell? The server is sending the correct value, it's that the client is receiving the wrong value
Yes, this is what's being sent: in blue:
For state 62, server sent weapon 'SphereThrower', but the client received weapon 'JumpMove'
Well who is sending the value?
Are you sure those pointers aren't just mapped to different things on either side?
The weapons are actors that are replicated
It works 99.9% of the time, but it's that 0.01 percent where sometimes there's a mismatch
I tried that as well, it's the same issue
I think this is a bug with pointer replication of some sorts? Like all my non-pointer values are replicated perfectly
So much that I can guarantee that if I map my weapons to unique IDs and send those IDs instead it'd work
But it feels like a completely silly workaround
I've never had this issue before
I bet you the same weak pointer during either end points to something different. That's what it smells like to me.
I think you're right, but how do I track it down? Am i the one at fault here?
Those actors aren't new as well, they've been relevant for the client for quite some time
I don't know is there any particular reason you're using a weak pointer instead of just a typical pointer or reference?
The main reason is that these states are stored in a buffer over time, and if a weapon is destroyed, I want the weak pointer to just be invalid
I'd rather not rely on UPROPERTY chains
I am still fairly sure it's not the weak pointer that's at fault, since the same issue existed without them as well
I suppose not
The offset is consistent regardless, its driving me crazy XD
Trying to make a basic menu to start/join a listen client (all from my local machine at this point)
My Bp looks like this
however when joining with that join button I get this
The start game button appears to work (game loads the 3rd person example map fine).
What am I doing wrong?
I have tried loading the level and then connecting but I get the same error (tried that so I would not be in the main menu map)
replacing localhost with 127.0.0.1 makes it work... are dsns not allowed in there?
If a replicated character spawns a replicated pickup but then that character gets destroyed, will the pickup stick around, owned by the world?
Or will it also get destroyed?
if the pickup is an actor, it should just have a nullptr owner when the actor gets GC'd. that said if the pickup requires ownership that can leave it in a bad state, so you might consider doing something before the owner is destroyed.
Does a replicated actor's static mesh component's location replicate if the static mesh component is set to simulate physics?
I have players dropping items by walls and then bounce away and its in a different spot than on another client's end
If the pickup is a separate actor and not a component of the character then it should
Thanks!
@grizzled stirrup just saw it, but you should take into consideration what Grimicus said
#multiplayer message
Could you elaborate on when it would require ownership? If the character owns it but then gets destroyed, would the pickups owner simply be nullptr and nothing bad would happen as long as you don't need to call GetOwner?
when something owns it, like for instance in my game my items are not visible when they aren't equipped so when the character dies, if I don't do anything they'll just be invisible, so I have some code to make them going into a bag that drops when the character dies instead, then other chars can loot the bag. so just letting the actors implicitly be de-owned isn't necessarily good for your game, so just think about how you want it to behave. Yes, anything with UPROPERTY() referencing the destroyed actor would be set to nullptr
Great many thanks for elaborating!
In my case I do want the pickups to exist independently from the character but spawned from them (as different enemies drop different things)
So perhaps I just won't set the owner in SpawnParams
And that'd be enough
ugh T_T. It seems like Oculus OSS CreateSession creates both an oculus room and an unreal session, but if you're using Moderated rooms, you create it with API calls instead. How then am I supposed to create a session for it? Joining a room with an ovr_JoinRoom2 call does nothing without actually having a session on the server (to no ones surprise)
you're supposed to be able to find a moderated room with the FindModeratedRooms node, but it doesn't return any useful session information either. At best it tries to connect and returns
Warning: GetAddressInfo failed to resolve host with error SE_HOST_NOT_FOUND
I need a master server and far as I underatand it, that's done with the online subsystem.. So, couple questions: can I use the steam subsystem before I release on steam? If I use vanilla subsystem, how das that even work, big picture.. Do I create a level or aomething?
when the character or actor replicated and spawned from server. what function will call for both autonomousProxy and simulatedProxy , seems beginplay only call in autonomousProxy , but I want both
hey guys for some reason the server doesnt see the correct actor tags on the client
@modern swift every instance on every machine calls BeginPlay
unless you broke your GameState, then no Actor on any client will call it
zlo u talking to me?
no, you didn't ask a question that anyone here can answer, as there could be a million reasons for that and you didn't narrow that at all
I'm trying to add on EventBeginPlay a HUD Widget for all players on the PlayerController, but for some reason the IsLocalPlayerController boolean is returning False.. Why would that be?
use a HUD derived class
to manage widgets
it doesn't have those concerns, as it exists only for the local controller
oh.. so on the character bp?
oh right.. I've been thinking about this all wrong then. Thanks I'll give that a go
its pretty much designed to manage all widgets that aren't menus or loading screens
(its lifetime prevents it from handling widgets that might persist during level transfer directly)
I initially had tried to do that but it wasn't appearing for anyone (including the listen server). I then tried it this way on the PlayerController and it was working but only for the Server
What I'm trying to create is a "Player Wins" screen that pops up at the end of a round
that should be invoked by the GameMode via a client RPC called by the GameMode on each controller when the game is finished
Hey guys, so back to dedicated servers and clients. How would I not make client to connect to server upon starting? I have some login/reg menus before user actually can login to server. If I select client as a mode in PIE - it connects me to server immediately along with starting standalone dedicated server. When I set mode to standalone - it starts as both client and server, so I cant actually differentiate if specific server code actually runs on server or client.
What is the correct workflow to develop client/dedicated server parts without mixing them together?
Before 4.26 running client mode would not spin up additional dedicated server
@stoic acorn RPCing each controller is one of the few cases i approve of GetPlayerController(Index), you go GetNumPlayers => for 0 to NumPlayers -1 => GetPlayerController(Index) => CastToYourPC => SendClient RPC in GameMode
(iterating through every PC in the game and sending a RPC)
That would be surprising
I got a weird bug/issue hoping someone can help me brainstorm over...
Material with translucency rendered in front of fog until I checked Compute Fog Per Pixel
but it doesn't fix the issue for clients! 😮 😦
Is it still a thing where you cant reliably test multiplayer functionality in engine? Used to have issues that either wouldnt show up in a build or would break something in a build that works fine in editor and was a pain to have to constantly build out a server and test.
nvm I fixed the issue by syncronizing the fog between clients n server better
It's generally fine.
@dawn glen launch the game outside of the editor, no need to package. i create batch files for this
client:
"C:\Program Files\Epic Games\UE_4.25\Engine\Binaries\Win64\UE4Editor.exe" "C:\Users\USERNAME\Documents\Unreal Projects\Project\Project.uproject" -game 127.0.0.1 -log -ResX=1280 -ResY=720 -WINDOWED
server listen:
"C:\Program Files\Epic Games\UE_4.25\Engine\Binaries\Win64\UE4Editor.exe" "C:\Users\USERNAME\Documents\Unreal Projects\Project\Project.uproject" -game FirstPersonExampleMap?listen -log -ResX=1280 -ResY=720 -WINDOWED
server dedicated:
"C:\Program Files\Epic Games\UE_4.25\Engine\Binaries\Win64\UE4Editor.exe" "C:\Users\USERNAME\Documents\Unreal Projects\Project\Project.uproject" -server FirstPersonExampleMap -log -ResX=1280 -ResY=720 -WINDOWED
So how does does one spawn in an actor attached to another actor in a way that parent actor has a reference so that it works in multiplayer. I have a VRPawn attempting to spawn in the motion controllers. the client players motion controllers are spawning but are not connecting. I think it may be some problem with replicated events, but I have tried several combinations of casted events, and I am not getting any clue how to get it to work.
so in the Pawns begin play it calls a casted event to server to spawn the controllers, that much seems corect
but where do I attach the controller to the pawn, I have tried both in the same event they were spawned on the server, to no effect, as well as in a casted to clients event.
I just would like some info as to where the actor attachment should be occurring, I have tried so many times to get this thing to work over the past 3 months
is it need to be attached to the actor only on the server(And I just did it wrong), is the correct method to attach it within a casted event to all clients?(that I just implemented poorly when I tried). or could it need to be done witha repnotify
Isn't the motion controller a component actually?
@celest sleet Not really sure what a casted event is? I think you mean RPC. And no. If you have two actors, they both need to be set to replicate, they both need to be spawned on the server, and the attached one needs to simply be attached on the server. The attachment replication will affect all clients after that automatically.
@empty axle I built this project off of the VR template, and how it worked was the vr controllers was an actor that contained the Motion controller component. with alterations the motion controller component is now part of the pawn, but the hands are still part of this other actor that I am trying to attach to the motion controller component in the pawn
Anyway, yeah basically what Authaer mentioned
Probably that motion controller also have to be set to replicate in order for the attachment to replicate to clients
@kindred widget very interesting. as that very much seems to describe the latest test from this morning. they are all being spawned on the server and are all set to replicate and were being attached on the server, yet it worked for the host of the listen server but not the client. could it be a problem that the actual AttachActorToComponent node is inside of an interface call?
@celest sleet So you are attaching the hands actor to the motion controller component on your pawn. Is the motion controller component set to replicate also?
yep
hello guys, basic question :
When we say we have 70ms (net pkt lag command for exemple)
Does this mean I have 70ms to reach the server including the server answer ? Or Should I add an extra 70ms to have the return ? Do you see my point ?
Net packet lag 70 means 70ms additional to reach server and then 70 more back assuming client & server are set up the same
- frame time on server to get ping
Looking at 160 ping
Thanks for the advice @meager spade @winged badger I have saved all my connected player controllers in an array that is on my GameMode. I'll try using that.
My server(top image) does a line trace just fine
But my client's always apppear to have an offset line trace
Hi, does anyone know if there is an out of the box replication of when a gameplay ability ends on the server? Or do I need to watch on GameplayAbilityEnded delegate and do it myself?
Hello guys!
I am having hard time making a packaged game and making it work with Steam. The error I get is the following:
What I have tried:
- cleared all Saved/Intermediate/Binaries folders and regenerated these
- I have all the modules included in uproject file + everything works when launching the game when not packaged
- I have check the Plugins in project settings multiple times, everything is also checked there
Any idea, what might be causing this?
Anyone know how a game like Satisfactory is able to allow co-op multiplayer without having to manually set port forwarding or opening ports in the firewall?
using a service that does NAT punchthrough
or publicly exposed dedicated servers
one of the other
I dont think they use exposed dedicated servers so must be this NAT punchthrough, will have to research that. Threw me offguard when i let a friend join my game and it just worked.
steam sockets will automatically punch through NAT for example
all you need to do for that really is have the host send a packet to clients IP:port
so the host's router expects a packed from clients address
and doesn't ignore it
as they all communicate with steam servers first, steam servers set that communication up
simple as that
If manually destroying replicated actors on the server right before unloading a sublevel and loading up a new one, is there any reason the client occasionally doesn't have these replicated actors destroyed for them?
Does unloading a sublevel cause all replicated actors spawned in that sublevel to be torn off or something?
When joining a server (open ip) there is a slight moment when I see the map before my player controller loads a ui widget. How can fix this? It feels like I load the map before I have a player controller.
You can manually keep the loading screen up for a bit longer
That's what I do at least
what would I search to find info on that?
Think I got it, will work on it and see if this solves my problem, thanks
Hello everyone, we are trying to connect a listen server to an outside client from the internet. We already port forwarded a specific port in order to make the connection, but how do we specify which ip and port the server listens to when starting the game (other than 127.0.0.1:7777)?
Trying to figure out how to get Oculus Moderated Rooms to work with their Find Moderated Sessions node is literal hell. Thank you for coming to my ted talk.
Is there a way to use different DefaultEngine.ini file when building for client or for server?
Hi everyone, I'm working on a dedicated server project, and I want to create a UI on the players when they connect. I've pretty much have the same structure as the MultiplayerShootout but I can't get it working. Any idea what can I be doing wrong? Here is the code:
@shy flicker sould be on remote
@shy flicker use a HUD
engine RPCs clients under the hood, providing a HUD class they should instantiate slightly after PostLogin (same frame)
and unlike the PC, HUD is a good place to manage widgets from
That worked 🤩 ! Thanks!
@karmic briar You mean the function should be called on a remote side? The PostLogin event is called from the gamemode, if I have not misunderstood, it's only on the server side so calling it from the remote side won't work.
nvm
PostLogin isn't a good place for generic gameplay logic btw
it only works after hard travel
it doesn't get called during seamless
zlo knows i didnt think bout using HUD
you do have HandleStartingNewPlayer that is called from both PostLogin and HandleSeamlessTravelPlayer
so it works no matter what method of travel you used
(HandleSeamlessTravelPlayer is BlueprintNative, meaning it has default c++ implementation - which spawns the default Pawn for Controller, so if you need default Pawn spawning you need to add call to Parent function when overriding it in Blueprints)
I have linux dedicated server running, but when client joins the server the server crashes with this
[2021.02.11-09.08.51:613][825]LogCore: Error: appError called: Assertion failed: GetType() == FName(u"NULL") [File:../Plugins/Online/OnlineSubsystemNull/Source/Private/OnlineSubsystemNullTypes.h] [Line: 12]
In defaultengine.ini I have ```[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemUtils.IpNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
[OnlineSubsystem]
DefaultPlatformService=NULL
PollingIntervalInMs=20```
Should the DefaultPlatformservice be Null instead of NULL? That was working on windows dedicated server with NULL
Got it working by commenting out one check from the OnlineSubsystemTypes.h
How can I reference to my ui that i am creating in player controller?
Also I want to reference it in my player character
I am having a strange issue maybe someone can help. if I place my characters and spawn them to far away from my other characters, certain replication is not being replicated, how can I make sure things are replicated no matter how far away the other player is?
mark them always relevant
will this cause lag?
if u are calling it once then no it wont
@eternal citrus what do you mean calling it once, I only see a check mark thats says always relevant
Anyone know how I can make a camera placed in the world apply to all players? I have one in my lobby positioned exactly how I need it, but it only works for host.
I've attached a Set View Target coming off of OnPostLogin but that only seems to work for the first non-host joining. Any ideas?
I'm currently running three standalone instances, will get proper network testing done but so far it doesn't appear to work as intended.
@sharp kestrel Rather than relying on Networking for that, why not just have a camera in the level that registers itself locally for each client in GameState. Then each client can get their own version and set view target. No networking involved.
Hello, quick question! How do you package a dedicated server with UE 4.26? When I go in visual studio and build "Development Server" I get "Server targets are not currently supported from this engine distrivution"
Are you working from a source build of the engine?
I saw on youtube videos you have to download it from github, but can't find the build source!
Yeah you need to build the engine from source (aka github), change your project to that engine version and then you'll be able to build the server
ok thanks!
Hi all, when testing multiplayer in editor, my client window has suddenly gone blank, black screen. I can't understand what might have caused this, since I loaded up an earlier version of the project where it was working before, and it's also not working on this either. Are there useful commands to help me debug the point of failure?
I also rebuilt, same result :/
Hi, a quick one but I was wonderin why this BP shows the anims perfectly fine across all clients:
but the picture below, with the variables replicated the same doesn't show client to client:
They're more or less identical - is there anything different i need to do for a looping animation?
( BP 1 unsheaths a weapon once - BP2 is for constant walking.)
are you using MaxWalkSpeed in your anim bp?
are your rep conditions set correctly?
The Start and Stop walking events are Run On Server
on the variables, not the event
and the booleans are "replicated"
are the characters still walking or just playing the anim?
The movement speed and everything checks out okay, just no animation client to client
It works client to server though
you should be driving your anim from the character speed
you shouldn't have to create these variables for walking
because character movement component is already replicated internally
So instead of "IsWalking = true - do animation"
Try "If player speed == 200 - do animation"
yes
I'll give it a shot!
but more complex than that
your locomotion animations should be driven by a 2d blend space
so the speed should be an input to the blendspace
not just (if speed > 0 animate)
is that required to get this work or just advised?
just advised
For a multiplayer racing game that I want to work over lan, would you guys recommend cpp or blueprints or both?
always both
Ok cool
What would be the reason why, I cannot get the error messages to show up? The goal, is to have the client get a UI and Sound message if they are camping
I cannot get anything to go to the view port; wondering if something is wrong with this logic
I would just debug it until you know exactly at which point it goes wrong, it's a bit difficult for us to guess where your exact problem might be.
Also a question from me, does Unreal support anything out of the box for weapons that use raytraces to hit an enemy? To my knowledge weapons in multiplayer games rewind time to see if a 'bullet' hit an enemy to compensate for latency. I couldn't find anything however, I would also be happy with something that allows me to rewind physics to a certain time frame so I can do it my self 🙂
hey guys i am having a problem with replication...The client spawns a projectile and it is in the previous location of the barrel... i have an image of my code before running on server and after...is there away way to compensate for the lag?
@twilit radish a line Trace is super easy. Validating a hit on the server with past position is a lot trickier
For multiplayer shooting, just do client side hit detection and worry about cheat prevention later. if you have to ask the question, it'll be too much to deal with right now.
Why would it be "too much to deal with right now"? I'm just asking if Unreal has something built in for this so I don't have to reinvent the wheel.
No it doesn't have something built in right now.. You have to reinvent the wheel.
I'm sure there's some systems on the marketplace that you can looking to. I guess the reason why there isn't any stock lag compensation in the engine is because different games have different approaches to it
Fair enough, was just curious as some things are built into the engine. Like the movement component as an example :D
There is a more generalized Network prediction plug-in being worked on right now, but who knows when it'll be finished
Thanks for the answer! 👍
@twilit radish Realistically, cheat prevention is nice to program in early if you know what you're doing, but it's not a daunting task to fix later. Truth is, you may never get to the point that it's necessary if the rest of the game is bad. It's better to polish the feel and style of your game rather than a feature that only competitive players are going to care about. You can have the most secure, unhackable/uncheatable game ever created, but no one's going to touch it if it looks bad and feels bad to play. On the other hand, if this is for learning purposes, then that's a different story. Realistically no system is perfect. Anything purely uncheatable is all done on server, and stuff done purely on the server will feel bad for a client. So you have to find a way in your design style to let clients say they've done something, but also allow your server to validate it as much as possible. For instance, it you want some quick and dirty protection, simply record the player's location at like 0.1 second intervals on the server for up to two to five seconds. Let clients say they hit something at a supposed server time. When that RPC reaches server, you can math it out based on the hit player's capsule size, and see if a shot from the shooter's rewound position could possibly hit a part of the capsule within reason. This will at least prevent shooting people through walls and such. It's an over simplified method and still very prone to cheating, but that's the basic idea of the cheat prevention without making it feel bad for the player. Otherwise you end up will things like ARK. Shoot an arrow at a Dodo bird, and the client can see an arrow literally going through a Dodo's skull, and it just trots along happily because the arrow didn't actually hit it on the server. Where as line trace guns never miss because they're done differently than the projectiles.
I guess that's a fair point as well. I was mostly just looking at what the possibilities are to make it secure, but that all falls apart if no one wants to play it yeah. (Although in my defence I don't think if this would work properly anyone would notice anyway). But no matter what I make it's not going to be the next CS:GO or something similar, and if I ever have to do make that I guess that's a different story at that point. So maybe it's better to not waste my time on that yeah, thanks for pointing that out! 👍
As long as it doesn't entirely ruins games of course. My idea isn't against others players, so it shouldn't matter in this case with shooting 😛
It's something that major games have third party teams for. It can be a fairly comprehensive topic, but at the same time it can also be very simple depending on what you need.
Howdy everyone! Finally decided to be social and join the UE discord.
Ok, so I'm having a weird issue with replication, and I'm not sure where to start.
https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/1861518-odd-issue-host-to-clients-replication is the relevant forum post about my issue with some pictures.
To be specific, I'm just playing with replication at this point using my own custom character and custom animations. I started working on crouching, and everything works fine in single player, but something seems to be missing.
Host player can obviously run the code no problem (It's a Multicast event for host player only), but for some reason the clients see the transition to crouch happen in full, then the relative location of the mesh on the character pawn snaps back to it's old spot, thus making the clients see the host in the ground. Host is fine. Any ideas would be very welcome as I'm new to multiplayer in Unreal. I played with Mirror and Unity and got a few projects up but I clearly have a lot to learn in general.
I have a custom event that my host uses to crouch, shrink their capsule collider, and show everyone they are crouching. See attached.
It works, but at the last second, the client sees the host sunk into the ground, and the host is just fine. I've verified that the correct data is being replicated to clients via a print string
Oh for sure, I wasn't planning on making some advanced Anti-Cheat with machine learning or anything. But some security couldn't hurt were my thoughts. Which I still have, but I guess I should just prevent the things that really ruin the game like infinite items, crashes etc. If someone was going to use an aimbot I couldn't stop them anyway, even if I would protect my self from false hits.
@twilit radish as long as you don't release susceptible to the hack where client has authority to calculate shots, then when fire is pressed it locally teleports an enemy in front of the bullet you'll already be better off then most games that got released in the last couple of years
Hey guys, I'm using replication graph and I'm having an issue with it crashing when the player is supposed to respawn, our respawn system works so that a new player pawn is created and that the player unpossesses the dead pawn and possesses the new one, this seems to cause it to crash with the error message "No Classinfo found for FirstPersonCharacter_C", we've already added it to Global Actor Replication Info Map
I am assuming I somehow have to remove the unpossessed pawn from the replicationgraph and register the possessed one?
Anyone got a project they have for third person , where you can poses and drive a car with none of the default sedan involved ?
When joining a multiplayer game there is a split second that I see the map from 0,0,0 (and then my player controller load the spawn selection screen), this only happens to clients and not the host. Is there way to stop this from happening? Like keep the screen black until the widget loads?
here is a short video
https://streamable.com/7vqb6z
I have tried loading a widget in the level bps begin play, but it does not fix the problem
Remove the background and just don’t add it till it’s in the last click with a delay
the 1st menu is on a different map
Keep the jelly fish away
If u set it up on a camera just put a black wall behind the view
Then u don’t have anything to destarxtnfrok
put up a loading screen from your GI @supple crypt
remove it from HUD's BeginPlay
there are several ways to control the camera too
Was hoping to avoid using a GI (it's a BP project)
Can i do a GI in BP? here I have been thinking I could only use it with a cpp based project
you can't really manage widgets that have lifespans not completely inside the lifespan of a PlayerController
from anything PC or Level related
you can just make a blueprint inheriting from GI and set it up in project settings as game GI class
thats it
with loading screens in particular
you open it on menu level, you close it on game level
to do that you need to keep a reference to it, and blueprints don't offer too many alternatives to GI to do that
I will give that a try, I had found some solutions using a GI but they were all cpp based and were using a movieplayer (So I had assumed GI was something you could only use with cpp)
depends on how far you want to take this
to just show a widget, you don't need anything more then this
if you want widget to animate in any way, for that you need movie player
as it doesn't run on Game Thread
This project was just a way to learn some replication stuff... and now I'm getting hung up on some finishing touches (just a basic black image widget will be fine for this).
so it won't get blocked while loading the level
btw @supple crypt if you're in any way familiar with c++ i do recommend avoiding doign any networking in blueprint
Once this project is done I plan on doing the same thing in cpp
the networking parts were quite simple so far (I mean all I have is a basic team system and spawn selection)
it can replicate variables, it has some replication conditions available, it can send RPCs and it has a hack instead of replication callback
and i just summed up entire BP networking functionality
its also very limited in its ability to fine tune seamless travel
Does netserialize get called on a struct within a struct? Meaning, if I have a struct with netserialize handled, but it's a UPROPERTY on a parent struct with net serialize, will it still handle its own serialization?
can any one tell me if ping from the player instance needs to be times by 4 for the correct value?
the player state you mean?
it might be times 8, im going to look and confirm
yes, you were correct, you need to multiply it by 4
the Ping property on the playerstate that is
wait, they actually didn't put in a getter that already mutates that for you in PS? 🤯 🔫
i dont think so, at least not in the version im using (4.23)
i wish i could say im surprised
@winged badger they made a getter in 4.25+ but you still need to do the multiply yourself
that is somehow even worse
yup
should had made the variable private and a getter that delivers *4.f
and avoid all confusion related to this
yeah its weird that you even need to do that just to get the ping like everyone reads it
they might've as well just added * 4 there, not sure what the base one is used for?
dunno but yeah
Thanks guys yeah its some what confusing lol
use override of SetPawn to toss the new Pawn into PC's bucket
haven't worked with it, just loosly familiar
I know one of you gurus knows about nested NetSerialize...
@winged badger was that a reply to the question i posted earlier?
yeah, seems like a good place to do it
runs on both server and client in AController
from Possess and from OnRep_Pawn
im just wondering if its actually that, because the error message makes it seem like it
says it cant find classinfo for the FirstPersonCharacter (character blueprint), but I have been playing with that before I pressed respawn, so thats why I am thinking its something like the old pawn needs to be removed from the graph and the new one added?
old one should just go away when destroyed
so i don't think you need to remove it by hand
Maybe it's something where I need to notify the replicationgraph that a player possesses another pawn? I'm fairly new to it and the documentation on it is quite limited
i don't know what replication does and doesn't do by default
implemented a custom push model before they rolled the replication graph
so it wasn't needed
I'll try rephrasing. If you have a struct that defines NetSerialize, will you need to handle how all of its UPROPERTY's are serialized even though one of them might be a struct that has a custom NetSerialize defined?
I think you might have to call the NetSerialize from the struct within and add it to the result of the serialization of the other UPROPERTYs? if that makes sense
it has to call NetSerialize to serialize it
its just not the default implementation anymore
So the UPROPERTY inside of the parent NetSerialize would just do Variable->NetSerialize()?
it would if its a UPROPERTY struct
Gotcha
Ahh no wonder I couldn't find any examples. That makes sense, thank you.
anyone find any help with smooth snyc ? like a discord server for the asset or anything like that?
@winged badger Had time to try and use the game instance to add a full screen widget but even that goes away on level load
it shouldn't
widget that is on screen is referenced by the viewport
which belongs to local player
which doesn't have its lifecycle tied to a level
so it needs to be explicitly removed
this is what is in the GI
and here I am calling it before doing open ipaddress
I made the widget just white to make sure it was opening and whatnot and now the same thing happens like in the original clip I posted but now with a white background then the random part of the level at 0,0,0 and then into my normal spawn selection
give it owning player
tried that
same outcome
and it's only clients that have this problem, host is fine
I am confused, I made a button in a widget and everytime you press the button it adds 600 seconds to the match duration in the game state before I join the server.... but when I start the match it stays at 0
in my game state its set to 0, but I thought my button presses were suppose to set the new value?
If you are doing this before you join a server then I think you need to handle passing it along when you do your server travel, I believe.
yeah its before joining the server
@winged badger if your struct does not define a NetSerialize, but contains UPROPERTY structs that do, will it automatically use the NetSerialize for each struct or do you have to call NetSerialize on the parent struct and invoke each property? I know you said if I specified it I would need to, but what if I don't?
I think you need to pass it along during seamless travel using Event Copy Properties
Actually. What is the point of you doing this beforehand?
You should travel to your server and modify match duration when you're there and then start the game some other way.
Or, store this variable on GameInstance if it's just something that your owning client passes along after travel.
Basically when you travel it's wiping your game state.
Here the person ended up doing what I said. Store in game instance then pass it along when you get there.
ok im going to see if that method works. I wanted to be able to set the time before the match, but it seems that I might h ave been saving the variables in the wrong place, I will try it out and let you know how it goes. thanks @steel vault
What is a good method for holding and writing player scores in a 2 player non split screen local multiplayer game? Would I just check for player index each time? Or use get owning player?
If anyone can see where i need to look to figure out why when i join a lobby i get a hard crash. https://pastebin.com/aaf4p2Va
i can't see any reference to any bp errors
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Im getting a weird issue where in a Standalone version of my game, actor component variables on a Character are being set to the actorComponents default values, instead of the values set in the Characters actual Blueprint. Playing in Editor, the values get set correctly, but in Standalone its wrong. Im playing only as Server. Anyone had this?
Is it possible to have replicated properties or RPCs in a WorldSubsystem?
possible... kinda
worth it? absolutely not
with the unreal's quirk to change the Outer of replicated UObject to the Actor that replicated it on clients
might not even be possible
okay, thanks for clearing it out
@empty axle world subsystem can spawn an actor to do its replication for it
its way simpler
yeah that is my current approach. I just though if it might be possible to get rid of that replication outsourcing
UObject needs an Actor/Channel to do the replication for it
it can't replicate on its own
plus the Actor doing the replicating would have to implement several functions to get it to replicate
virtual bool IsSupportedForNetworking() const override;
virtual void GetLifetimeReplicatedProps(TArray<class FLifetimeProperty>& OutLifetimeProps) const override;
virtual bool CallRemoteFunction(UFunction* Function, void* Parameters, struct FOutParmRec* OutParams, FFrame* Stack) override;
virtual int32 GetFunctionCallspace(UFunction* Function, FFrame* Stack) override;
virtual void PreReplication(IRepChangedPropertyTracker& ChangedPropertyTracker);
``` something like that
and you'd still have to handle Unreal swapping Outers for replicated Subobjects
sorry, above functions would have to be implemebted by subsystem
Actor would need to implement ReplicateSubobjects
you'd also need to prevent clients WorldSubsystem to initialize locally
cost quckly exceeds the benefits
What you could do although it's not quite the same thing... is add an actor component to your AWorldSettings class
I used to do that for manager-like stuff until UWorldSubsystem came along
But yeah otherwise proxy actor would be the safest way I'd say
Yeah, looks like it is much more work than the benefits from it
hi guys if my pc spawn a actor and set ownership when it spawn, when that actor replicated and spawn in client, how can I identify the owner is that pc, I tried to get owner but it return None
PlayerController is only replicated to the client that owns it not to everyone that is probably why you are getting None here
Theoretically, the owning client's Owner variable should be a valid player controller, since that object exists there.
for example I have 2 pc spawn 2 actor, I expect on client 1 actor can get pc, 1 actor return none, as on client only 1 pc is exist, but my case is all actor return none
I tried to use delay try to wait the pc spawn on client but I still got none
By setting ownership you mean pawn possession?
Oh wait, there's a "set owner" node, didnt realise.
Doesn't spawning come with an owner parameter ?
Gives you (as a client) the ability to call RPC's on it etc.
Righto.
Connected to a bunch of stuff really
Alright.
On an entirely unrelated note. How can I ensure data read from a user's PC gets shared to everyone?
I'm using functions in the game instance to read/write variables for the local player's appearance.
When they enter a match, their player controller will get that data, so at this point it should all be locally held.
It gets passed to the pawn who stores it as a replicated value, meaning everyone should be able to see it, right?
Player state.
It can't be done via pawn?
It's not that it can't, it's that player state makes a lot more sense
It's not going to be killed or go out of bounds, it'll exist earlier at boot, and it can persist data between levels
Right. Current outcome is that the local player see's their own outfit, but everyone else has default settings applied. Happens to all clients.
Also always relevant etc
The proper way here is to RPC the server-side controller and write the player state
Okay, I'll give that a try.
That said; I don't think persistence between levels is too critical here. Its already stored on local PC and in the Instance on game start, and I don't believe a single Get Instance to get the data would be that taxing on processor, right?
I mean, it's up to you. If the appearance is only character related, feel free to do the same but store in pawn instead
Shared player data in general makes more sense in player state
Since, you know, pawns die and stuff
True, true.
Though when the pawn dies, the appearance becomes irrelevant since there isn't respawning (at least not yet).
Yeah, if it's truly pawn specific the pawn is fine
In that case, do you know why non-client pawns seemingly use the default data?
Did you write the replicated data on the server ?
ah
If its just a regular event (no server/multi) setting a replicated variable, that data still won't replicate?
The event would need to fire on the server
Replication is entirely server-to-clients, so client-to-server data needs to go through RPCs (server event in BP)
Basically your player controller needs a "server send data" server event to send the data at boot and then the server side PC writes the pawn style
Right, I'll give that a try. Will need to make a build before I can test it though.
Cheers.
I think it really just depends on the outfit selection. If it's a one time thing that persists through death, etc, probably best to put it on State and all clients can just get that character's state on beginplay and set it up when the actor is relevant If you lose the appearance via something like dropping your inventory, probably better on the Pawn since you don't want it to persist death.
Would it be enough to just set the event call to "run on server" or does this need to call something in game mode?
Set it to run on server and call it from an owning client with a replicated version of the actor
Out of curiosity, does anyone know what the basic replication cost of an actor component is in bytes?
I'm trying to simplify my inventory system. Right now my current working model is to have many different struct types for very different items. Putting most of this in the same struct would be an unnecessary amount of extra replication. But I'm wondering if putting this information into components and copying them from actor to actor for use and movement is going to be worth that simplification.
Tool for displaying network traffic and performance information captured at runtime.
Yeah. Thanks. Already working on that. But it was worth the question to see if anyone knew before going through a lengthy test.
So check out this method to replicate manually if you want to use within actor components
https://docs.unrealengine.com/en-US/API/Runtime/Engine/GameFramework/AActor/ReplicateSubobjects/index.html
Method that allows an actor to replicate subobjects on its actor channel
@winged badger How do you mean? I thought that only worked to stop certain things from replicating on all versions of the struct? For instance, if I have an item that has seven different things that need to replicate, and an item that only has three, I can't use the same struct I thought?
As in there wouldn't be a way to tell the seven property struct just to not replicate these four properties for this exact struct, but do for this one.
what is your item, struct, uobject?
At the moment it's just a struct. I was considering moving over to actor components and using two different arrays. An array of simple structs for the simpler objects, and then an array of pointers to a parent class of the more complex items that were all likely going to end up being placed on actors anyhow when used.
will you need logic inside your items?
Some. The more complex stuff I was considering components for were eventually going to be weapons/armor. The original plan was to use actors for the weapons and handle the armor in the pawn classes, and spawn the weapon like actors from the item ID in the struct, but I quickly started realizing I need quite a few more variables saved for my upgrade system. Quickly started feeling stupid to have all of that stuff on one struct when representing basic materials in the inventory that only needed three variables.
as long as items are UObjects of any kind
you can replicate the lot in a generic way
fastarray with item that has a UObject* or TWeakObjectPtr to the replicated UObject
and a TArray<uint8>
your UObject base for items would have 2 functions - to encode and update itself in the fastarray
and to interpret the byte array as its own data
so your fastarrayitem callback would look something like
if (Item.IsValid())
{
Item->PostReplication(ItemData); // ItemData being the byte array
}
you can have other members in fastarrayitem that are common to every item and always need to be replicated, ofc
I'm honestly starting to wonder if this effort is worth it right now. I know that each struct would initially replicate the full amount for an item, but after that it would only replicate the specific property changes. I might honestly just go with a simple TArray of a struct for now and reuse all I can in that struct for the items and make some getter functions that sort the data for me. I can always refactor later if necessary, but I don't think inventories are going to get too large to the point that this would be a serious issue.
Hey lads, how do I make my game mode to spawn player at desired location(depending on transform coords that im getting from server) I know we have FindPlayerStart(). But I cant wrap my head around how to do it. I was thinking of creating spawn point inside function and returning it. Or is there "better" way of doing that?
If you want to programmatically create spawn points then you can use SpawnActor<APlayerStart>(FTransform(x, y, z)) to spawn a APlayerStart at a given location and then use FindPlayerStart() to get a reference to the ones you've created, or you can just save the result of the spawned APlayerStart in a property and use that
Thanks, thats what I was about to do. Is it worth to remove it sometimes later, because I might get flooded by spawn points at some point
Can you link to any learning sources on Fast Arrays? The best post I'm finding is this one https://bebylon.dev/ue4guide/networking/network-replication/fast-tarray-replication/ but it is pretty limited as it apparently relies on some UDN post I don't have access to
Gamedev Guide: Programming with Unreal Engine, Houdini, Math, & Graphics
I'm replicating arrays of structs in more than one place so it might come quite handy to master
nice!
hi guys! Tell me please what is the correct pipeline for launching abilities in turn? What I mean, First Ability -> Execute and apply gameplay effect, I want to run second ability after first finished, but this gameplay effect block second ability. I remove this effect in first on end. In standalone it works fine, but in network not.
p.s. If I just use only gameplay tags(without gameplay effect) in ability properties all works correctly
I'm trying to start a dedicated server without a steam client I keep getting this error Failed to initialize Steam, this could be due to a Steam server and client running on the same machine any one have any ideas?
Is there a clean way to create a unique netid while developing and testing with PIE? That is to say, when you spawn 2 clients, they (probably logically) have the same uniquenetid
They're not like "proper" ones ofc, just internal to the editor
@tulip ferry server keeps all actors at all times
if the actor is static it will persist on client even if not relevant
dynamic actors that are not relevant get destroyed on clients and are respawned if they become relevant again
You're right, I think I screwed something up in my own logic. Did a debug print and seems to be different. Cheers 😄
foliage - instanced static meshes
just do a procedural spawn, replicate a seed to clients so they do the exact same thing
then its one actor for all foliage
Hi guys, I'm testing multiplayer, and really kind of stuck here since it spontaneously stopped working last night ... That is, it stopped working for ALL projects ... If I start a new project and open a multiplayer session, I get a black screen, the only message that really stands out from the log is: LogNet: ReplicationDriverClass is null! Not using ReplicationDriver.
If anyone has any knowledge to share on this, I'd much appreciate it since the documentation is returning nothing, and this is super discouraging ... :/
that becomes significantly more complicated if you're BP only
then a fastarrayserializer with item for each foliage + status
check NetSerialization.h for documentation on it
Nevermind, this fixed itself on restarting the PC ... that took all of 5 hours to figure out ... 😳
Hello. Quick question today: If a variable is set on the client, and then an RPC call is made to set the variable to the same value on the server, will the OnRep callback function be run on the client? Do OnReps fire when the value is replicated or only when the value is changed?
Yeah only when you receive a different value
Unless you specify REPNOTIFY_Always
In which can the OnRep will get called whenever you receive that var from the server
Thanks, Jambax. I don't know what I'd do without you. 🙂
Someone else would answer 😄
😅 Maybe.
That has not often been my experience.
It's a niche subject.
Between You, Zlo, and Kaos, you guys have cleared a lot of air with UE4 networking. Not sure it would make half this much sense otherwise.
Stranger too.
This is fair. He's done a lot for my C++ learning more than multiplayer.
Unreal Slackers nomination awards anyone?
Jambax would probably rather us just buy and play his game. 😄
It's pretty awesome, too!
something something check out Hell Let Loose something something
@tulip ferry the real bonus is that its capable of client side callback per item
which makes keeping large sets of object in sync real easy
with fast array you'd generate the foliate
stash it into the fastarray and let clients mirror that
as a simpler of 2 options
if your actor with ISMC has a fastarray, basically any foliage instance is uniquely identified just by its instance index
now you can let server and clients generate the same ISMs with same seed
then replicate just the changes
or you can have server generate, add the item with Index, MeshAsset, State to fast array for each instance
then clients would add the instances from replication callbacks
personally i still prefer the seed option for initial generation
with seed option, syncing late joiners will be more complicated though
as when the foliage actor replicates, the item callbacks would happen before replication callback for the generation seed
so you'd need to handle that as a special case
(don't execute callbacks if foliage wasn't generated, then after it is generated manually iterate fastarray.items and apply changes)
I do the reverse with fast arrays and foliage. I record where foliage has been removed. You could seed it initially with a simpler variable, and then only record the changes to that.
Probably less to replicate in the end.
if the clients and server separately generate the foliage from a seed and use instanced static mesh component for them
they will have exact same meshes, in exact same location at exact same instance index in ISMC
so if server updated something like 17, Harvested the client knows that ISMC instance 17 has been harvested
but yes, the client would have to RPC interaction with foliage to the server
Anyone know where I can find the ShooterGame with ReplicationGraph example from Epic? The content example I download doesn't have ReplicationGraph
Where did you get it from
It's in all versions from 4.21 onwards IIRC
Certainly in 4.26 as I DL'd it yesterday
I have 4.23 and I cant even see the replicationgraph in there
in the solution
I'm downloading 4.26 now to see if that one has it
Hi! I'm trying to start a dedicated server, and switched unreal version to source build 4.26, but when running the Server.exe, i get these kinds of errors, any idea how to solve this?
Are you trying to load a whitesquare texture in that Canvas class?
If so seems like there needs to be an if check to see if the texture object has been found
Or you need to correct the resource path
You might also be getting this because its related to UI and the server doesn't have anything visual
Hmm, what i did was just take an empty ThirdPerson project, package the client, switched version to source build and then build development server
So the server does not have a UI, i guess
Seems to be saying "Package contains EditorData only which is not supported by this build", I think it's related to that as well
Maybe it’s because i didn’t include the starter content in the project?
it's in Source/Private/Online
I've tried this with Has Authority but that doesn't seem to change anything
Perhaps just a logic gap on my part, but I can't seem to wrap my head around this. Why is it generating two numbers on one client?
Just trying to generate a random number every X seconds per player that everyone can see
The clients are generating twice it seems
Possibly because one client is the server and the client at the same time, should not happen with a standalone server I believe
So it seems all clients do this with my current setup (just switched to "Play as Client" and it happens also
Hmm, it seems like the timer by event thats triggering the event is maybe firing twice?
Or the RepNotify is firing twice
So maybe this is a known thing, but if I connect the event to a timer by event node, it no longer lets me modify the settings above
Okay, so I figured it out
The "Set Timer By Event" has to be run on the server
Anyone else know about the order of NetSerialize in structs? I need to know if a struct without NetSerialize defined allows UPROPERTY structs inside of it to run their custom NetSerialize without needing to invoke it and call each one manually?
how do you imagine it works?
I am hoping it just lets them do their own net serialize
it iterates over UPROPERTY fields and serializes each one in turn
when that property is a struct only way to serialize it is to use its net serialize
it can't work any other way really
Gotcha. So the only case where it wouldn't use that net serialize is if you made one for the encompassing struct and forgot to call serialize on it
Allowing you to skip serialization
but if you have a custom net serialize
you're overriding that
which means that you have to call the serialize for each property you need
Noted. Thanks for the explanation.
can someone please tell me how i can see the cull distance of a blueprint in the editor?
Net Cull Distance Squared is what you want
when i enter the cull distance its not working
you have to take the square root of that to get the actual net cull distance
its Squared, so what you enter will make it so the square root of net cull distance squared is the actual distance
i just linked my code to set the sphere collision same size as cull distance
and when i am right on top of the object its not showing to client
when i make the net cull distance a huge size it works but if i put it at a reasonable size it doesnt work
1000 means the actual net cull distance will be 31 units, is that what you want?
i want it small the cull distance is the same size as that collision sphere in the blueprint picture..and for some reason its not working :/
that Cull Distance object in your blueprint picture, is that the name of the Sphere which you are trying to use the size of?
yeah that represents the cull distance
in the construction script i set it to the same size as the cull distance
and when i am right on top of the object its not showing up
this works
but why does it have to be so high
to me it looks like the cull distance in that blueprint is actually a scene component and you are adjusting its scale according to the square root of net cull distance squared times 2
yeah it needs to be quite high for it to work, the default net cull distance is quite a high number, let me look up real quick what i have it set to just to give you an idea
thanks so much man!
float CullDistanceSquared = 225000000.f;
📹 Part 4 of our replication series unlocks limitless potential with Multicast and RepNotify! In this video, we dive deeper about how Unreal Engine's Actor Replication really works as well as introduce ourselves to a variable replication and how combining the power of variable replication with an event driven design can help us build a multiplaye...
this is quite normal
I think you might not be using the right function for that
Scale multiplies the size by the scale that you pass, thats what you want or not?
i just want the sphere collision to represent the size of the cull distance
ah shit i sent the wrong vid
ugh
ah thanks
ill do that
that was it man!~!!!
thank you!!!!!!!!!!!!!!
quick question, when you play a game and are acting as the host. Does that make you the "listen server"? or is the listen server just a server running in the background and you're still playing as a client
if you are the server and the client at the same time you are using a listen server, if you are using a standalone server then it's not
hmm ok i see
Neste vídeo demonstro o sistema de dropagem de itens. MMORPG de mundo aberto. Jogo multiplayer online. Link para download: http://pristonbgeproject.servegame.com
when I change its new size in the editor, the clients still think it is 90, any idea why or do I just need to make sure I always update it in C++?
Doesn't it update while playing or?
Hey guys, I have a little problem and was wondering if anyone would know what causes this behavior:
I currently have set up the Steam integration and in my PlayerController i initialize SteamID and SteamUsername
In the GameMode: OnPostLogin i get the Controller Reference and Cast to my custom PlayerController where i get SteamID and SteamUsername
Problem happens when I have a Dedicated Server out of the Engine, for some reason SteamID returns 0 and SteamUsername returns Null in the GameMode
I know the values initialize right tho cause in my Main Menu widget they show up just fine.
PostLogin = server exec, it can only pull data from steam client on the machine running the dedi, unless you sent it as a login optional string
Yeah, and both SteamID as well as Name should be available through the PlayerState it if needed
Yeah cause i was accessing it directly from the PC in the GameMode, is that a problem?
But yeh, DisplayName
Basically what i was doing is
Event OnPostLogin
Returns New Player (Controller)
Cast To MyPlayerController
Get ID and DisplayName initialized in MyPC
Use them in GameMode
Well, SteamID and DisplayName are already available on the PlayerState
UE4 grabs the Steam DisplayName and put it into the PlayerName variable.
And SteamID is available through C++ via the UniqueNetId iirc
Good to know, but in this case, is me calling the variables from MyPC in the GameMode the problem and not through PlayerState or wot?
Using SteamCore btw so have the possibility to get the ID and DisplayName through BPs
im having some weird issues, if I join as the client to my game, I cant see the host player, but the host player can see me in a packed game, what could cause something like this
I'm trynna get some networking up
yet I can't find replication settings in events
ok got it figured out
I’ve seen so many tutorials now where they do a lot of gameplay BP work on the character. I was under the impression that this wasn’t best practice, is this correct?
That question is too vague :P What is "Gameplay BP Work"?
i.e. calling variable stat values from the character to HUD. Wouldn’t it be better to do that on the player controller as the character pawn can be destroyed
Still too vague. What's the use case?
this is weird, I am using streaming levels in multiplayer I have 1 persistant map and 3 other sub maps, if the server player is in map 3, and a client in map 1 going to map 2 wont stream in for the client unless the server player moves to map 2. But this only happens with a client VR player if I use a clietnt FPS player it works fine
is this method frowned upon?
I found this with a quick Google search: https://docs.unrealengine.com/en-US/API/Runtime/Engine/GameFramework/APlayerState/GetPlayerId/index.html
Gets the literal value of PlayerId.
I have 3 players (one of which is the Listen Server) I've created an Information Widget screen for each player from the PlayerController but have everything hidden. On an event during the game I want each player's Information Widget to update (ESlate Visibility = Visible) I'm controlling this from the GameMode. For some reason the 'Get All Widgets of Class' is returning only 1 widget. Is this correct? I was expecting 3 to return
This is my event on the InformationHUD widget
That's the Found Widget
So when this is triggered only the server is updating and the widget elements become visible, but not for the clients
Hi guys, can someone explain to me why a multicast function does not run sub functions e.g. allowfloating multicast function runs allowinteraction multicast function but that function #doesn't trigger
Hi, is it possible to make a prediction system for replicated variables using blueprints?
E.g. there is a replicated actor with a RepNotify integer variable, which can be changed by everyone.
I was hoping for client to change the local version of the integer variable and then send the change to the server (using RPC) to replicate for everyone, but this approach can desync clients.
E.g. for the integer variable set to 0 initially for everyone, if ClientA changes the value to 1 and the ClientB at the same time changes the value back to 0, the server will end up with 0 and does not correct the value for the ClientA, because he thinks the value of the ClientA is still 0.
Please, is there a way to sync the variables?
@sweet marsh Wait. What? If I read that right, you're running a multicast function from a multicast function?
Yeah, well it calls a function that inside does a check on authority and will either run it via server then multicast or multicast direct if the authority
You should check out the RPC doc page. In short, the only RPCs that work from clients are ServerRPCs. Clients cannot RPC to other clients. So if you were to run a multicast from a client, it would only run on the client. If you run a multicast from the server, it will run on all clients, and then if those clients tried to multicast, it would only run on that one client.
Ahh no i understand that, sorry here's a code example
Launched item is called from a gameplay ability
{
// Launch the item
if (Launched)
{
FTransform ModifiedTrans = FTransform(GetActorRotation(), GetActorLocation(), GetActorScale3D());
UGameplayStatics::SpawnEmitterAtLocation(GetWorld(), Launched, ModifiedTrans, true);
}
// Play the collected SFX
if (LaunchedSFX)
{
UGameplayStatics::PlaySoundAtLocation(GetWorld(), LaunchedSFX, GetActorLocation(), 1.0f, 1.0f, 0.0f, nullptr, nullptr);
}
AllowFloatingStateUpdates();
}```
That code is the code for launching which in turn triggers
{
if (GetLocalRole() < ROLE_Authority)
{
ServerAllowFloatingStateUpdates();
}
else
{
MulticastAllowFloatingStateUpdates();
}
//GEngine->AddOnScreenDebugMessage(-1, 3.0f, FColor::Green, FString::Printf(TEXT(__FUNCTION__)));
}
void AIGCCarryableBase::ServerAllowFloatingStateUpdates_Implementation()
{
AllowFloatingStateUpdates();
GEngine->AddOnScreenDebugMessage(-1, 3.0f, FColor::Red, FString::Printf(TEXT(__FUNCTION__)));
}
void AIGCCarryableBase::MulticastAllowFloatingStateUpdates_Implementation()
{
// Start ticking and checking for vicinity overlaps and whether the item can float
SetActorTickEnabled(true);
// The item is now carryable again
SetIsCarryable(true);
// TODO only allow interaction after a delay to stop grabbing straight away
// Re enable the interaction collision to allow vicinity checks again
AllowInteraction(true);
// No one is carrying anymore
CarryingCharacter = nullptr;
// Make note of the time we were dropped or launched
NotCarryingTime = GetGameTimeSinceCreation();
GEngine->AddOnScreenDebugMessage(-1, 3.0f, FColor::Green, FString::Printf(TEXT(__FUNCTION__)));
}```
in here i noticed that the MulticastAllowFloatingStateUpdates_Implementation is getting called but the values only update for the server
@sweet marsh Hmm. That's odd that a multicast only runs on the server. You're certain that this object is replicated? And if it's a component, that it's part of a replicated actor? To be fair, something like this looks very statebased and I'd recommend something more like a replicated value for it. Is it possible to do this in something like a Repnotify using the CarryingCharacter value?
i had the system using rep notifies and it worked better but still similar issues, but i still think there is some odd disconnect that causes it to drop out
let me try and put that back in then post the results
I'm trying to store the winners of a round in the game instance, but I can't have a TArray of FUniqueNetIds because FUniqueNetId doesn't derive from a U class
How would you generally do that? (I'm storing in game instance as I want the winners to persist through levels)
I guess I could ToString it and store that
Actually, the game instance can't replicate apparently. I guess I need to have the game instance send the array to the game state every time the game state changes (such as switching levels) somehow
Should be fairly easy to do. Could just update the server's GameInstance right before changing levels, and pull the information in GameState's Beginplay.
Hey guys I fixed the issue with ReplicationGraph I was having, seems the issue was that I was giving items to the new player pawn when it respawned too early, I moved the code from BeginPlay to PossessedBy and that stopped it from crashing with "No ClassInfo found for ..."
what would cause a player not to be able to steam in a level in a packed game? my VR player cant make the level stream but a FPS player can make the level stream
Should a separate User Widget be created for each player?
Sure. I thought that but I can't work out why the client widgets aren't updating on my player win screen.
#multiplayer message This is my issue
you can't use RPC's in a Widget
nor should the server loop through widgets
you should send a client rpc to the player controller
player controller gets that widget (on local player) and update the widget.
np
I can't get crouching to replicate
the other code isn't very important rn, only worried about the crouching
this is passed into the character class itself from the player controller
the crouching itself doesnt work
the print strings work and even tell me which client is receiving this input
meaning it does work
if I use "set capsule half height" it simply leads to it not being replicated
despite the fact capsule component replicates
fixed it
forgot to set Can Crouch
I thought that was only for AI that possesses characters
I'm trying a simple SetActorLocation to attempt replication on a Listen Server setup (locally for now), and I have terrible stuttering on the Client one
I've also tried to set the ShouldSprint locally after the RPC but same result
Anyone knows what could cause that stuttering?
It seems that unchecking the Replicate Movement of the Character, and doing the movement through RPC -> Multicast solves the issue, but I then have to manually replicate all movements (even AddMovementInput), could it be that Replicate Movement is clashing with SetActorLocation?
I have a very quick question about dedicated servers. I'm on build 4.26 do you still need the github source version to do a dedicated server build or is that a legacy thing?
you do still need engine source
so...your variable "ShouldSprint" is only contextualised in the server @rigid zinc therefore that SetActorLocation is happening in the server only, so you'll have an incongruence happening
why is the engine source required, can someone enlighten me?, I don't remember
is it because of this?
I wonder why they have not just rolled it into the precompiled engine
you can still run a server, just can't have a server-only build
as for why they haven't distributed server binaries...
¯_(ツ)_/¯
I'm guessing there is nothing I really have to do to move over the the github source compiled version though at a latter time, or should I do it now before I get further into my project?
it's not much hustle
I had a feeling but thought I would double check just encase
in addition upgrading the engine is trivial if you set your engine in the release branch
I've also tried setting it in the client side as well, no difference
It's not a sprint I'm trying to implement, sorry for the confusion I've badly named the variable here
I was just doing some test and used the sprint key input that I had set for something else in the project settings
I'm trying to make one dash quickly upon pressing Left / Right bumpers
but there's a giant stuttering when I do that, so the picture I've sent is an isolated dubbed down version with the same issue
yeah that's because of how CMC works
in theory as long as both server and cli report the same location you shouldn't have much rollback stutter
for dashes and these kind of things it's better to apply velocity directly
It's due to the server sending a location with a delay?
well not quite... cmc execution flow is quite complicated
you are setting a location for your character in the server however the autonomous proxy isn't there so it has to get there
but there is a fight back because there is no client input
more or less
Are you talking about the ShouldSprint boolean?
Because I've tried setting in both the RPC and locally, same effect
no, I'm talking about setting a location in the server
Here's what I have now, it doesn't just send it in the server
I also call it locally as well
there's an ugly jitter effect on the client, but not for the listen-server player
so...
client location -> server location -> rollback location
the jitter will be explicit
because the server is going to correct back the position of the character whenever it reaches to the point
why does it happen here but not when I move with AddMovementInput
Regular movement doesn't get corrected
because addmovementinput is going through the cmc execution pipeline
And when I uncheck "Replicate Movement" on my character, there's no jitter
but wouldn't that lead to a disconnect in position?
hmm in that case I should probably leave Replicate Movement checked to avoid having weird position issues to debug later
So for a dash, I should do change the Speed of the character temporarly and use AddMovementInput?
Instead of manually doing so with a SetActorLocation
yeah, or add velocity in a direction
I do not seem to have that function / node by default, do I need a specific component?
cmc -> velocity
Hey guys, my game is crashing because a Ghost NPC falls and gets damaged (triggering an RPC Flinch()) before the players connection is properly initialized, I am using ReplicationGraph and this is resulting in the error No ClassInfo found for Ghost_C. Is there a way I can check the player is able to receive this before calling the Flinch() method if AI were to get falldamage before being properly initialized? I am overriding the method ACharacter::Landed for this
I don't know if I understood correctly your question
Thanks for the help! I'll try the AddMovementInput / SetVelocity approach 🙂
but you need to have a way to avoid your AI character to call a function in an early initialisation stage, am I right?
the more you'll tinker and read about the cmc, the fancier stuff you'll be able to do
Do you have any way to know if your AI is initialised?
This was not a problem before ReplicationGraph, I had a similar error which I fixed by changing the method in which something was done from BeginPlay to PossessedBy for example
but this one is a bit different scenario so im not sure
If you want a quick fix
just aggregate a boolean in the Finch function
but this seems very specific, maybe you can debug a bit to understand what is happening
but if you need to deliver this asap
a boolean should do
I'm not really in a rush but it's blocking me from progressing
I've tried checking explicitly if the pawn is properly possessed by its AIController
That was not it
it's very specific tho... hard to help you without more data
The AI is supposed to be spatializated on the 2D grid
but it dies beforehand
real quick question
go ahead nbond
From unreal wiki on dedicated servers: "Dedicated servers are more expensive and difficult to configure, requiring a separate computer from all of the players that would participate in a game, complete with its own network connection. "
well it falls a short distance and triggers the Flinch method where it crashes
is this technically correct? cant you run a dedicated server and connect to it on the same machine?
and why does it say it crashes? @dawn nova do you have a stack trace?
yes you can
that line is general advice
not technical limitations
^
there's no reason to run both a dedicated server and a client on the same machine except for testing
so yes, you can
but you wouldn't in a shipping game
and you can run N dc servers in the same machine
okay thanks. and in general, im assuming code for listen server and code for dedicated server are going to be pretty much identical, except listen would have graphics support?
yeah @dawn nova knowing why it crashes will make it easier to check, if there's a null value or something, just check against whatever is crashing it
The stack trace shows it going through TakeDamage because of the overridden Landed method from ACharacter, and TakeDamage ends up triggering the Flinch RPC, and that's whjere it crashes, the error is "No ClassInfo found for Ghost_C" but the error message doesn't really pertain to the problem in this case I believe
yes, though you can run a dedicated server from the editor to test things
you don't need a source build just to run a server-only instance... you just can't tear out client code
i.e. if i want to give players an option between dedicated or listen its not really too hard to switch between
are these all blueprint?
But it crashes before it even gets to execute the Flinch implementation
Like it crashes inbetween because of a replicationgraph error I believe
and where does the rep graph error out?
When it calls the Flinch RPC, right before trying to execute the implementation
there's no difference in connecting to a dedicated server vs a listen server unless you yourself make that distinction
so that's correct
we had both in galaxy in turmoil, so yeah.. it's a bit too much of a hustle because you have to support two setups, but it's possible
but yeah the way you have to connect to them
equal
@nimble sinew dedicated you might not want to do any visual logic to optimize it
i mean less about the connection
but like, am i going to need to be writing seperate logic for a listen server vs dedicated
or can dedicated basically just be the exact same as a listen server just minus the visual logic
it would be very helpful seeing the stacktrace tbh
you may just to disable certain things on the dedicated server that are purely visual
some cases yes: if(NetMode() == NM_Dedicated)..
I'll show you guys a picture of the stack trace and where it errors out, its something related to the AI falling too early and it erroring out
but generally things are mostly the same between dedicated/listen
as long as you don't assume you have a local player
not necessarily fully separate logic, just different things to enable/disable sometimes
I mean I could solve it by putting the AI decently on the ground but still this shouldn't happen
alright cool. thanks for letting me interrupt guys. i will likely be here a lot more in the coming days/weeks lol.
Hold on I'm just going to run it and let it crash to show you
From a dedicated server cost perspective, what is cheaper: a 10 player multiplayer game or 5 player multiplayer? Is it cheaper the more people you can host on one game process since they use more shared resources(compute/memory) at the same time? On the flip side, network load exponentially increases with more players, how much would that factor in to cost if any?
it depends on the game
hmm, RTS in my case
I don't mean the type of game
i mean it entirely depends on the specifics of everything in the game
there is no general answer
number of replicated variables/number of rpc's... server logic... etc
so it comes down to the actual compute/optimization of that game towards the different configurations
because it can go either way..
complying with the base requirements of the game, yes
for example, if you have a gun that shoots very rapidly in a shooter
you'll be generating some traffic that is required due to the nature of your game
so it's about game specifications + optimisation
So you can see it goes through Landed, to TakeDamage, to its super, in its super it calls Flinch, and in the generated file it crashes
so I assume its just the problem of it being called too early before initialization
@dawn nova Might wanna get symbols for engine to help see more
What information is missing?
all I see is hex haha
the engine callstack, it would tell u which actual functions are being called, which line of source, etc, what you're actually crashing on
yep
Because the process event is what calls replication graph eventually, so it's out of the Flinch() function at that point
the other stuff is in engine, its a problem with it just falling too early in game initialization, i just need to know if there's a check I can do to prevent it from being called this early
of course it is in engine
but to figure out what is happening you better grab the symbols
I should have said "why" instead of "what" in that last sentence
I know what is crashing it, the AI calling Flinch too early - but I will grab the symbols but I'm not sure if that will help me
yeah but you don't know why, that's the thing
the symbols will tell you what is crashing explicitly
trust me
@dawn nova when you break in there, on the "this", look at the values, is it already possessed? What type of controller possess it(AI? Player controller?) Look at any variables in the "this" object to see if you can use any of those to indicate whether or not it is not initialized
compare the "this" object values to when it is already initialized. And if that doesn't work, set a new variable when your player does possess it, and check that variable
I already checked if it is possessed by adding a condition that didnt work unfortunately
That fixed the last time I had this issue though
By moving from the methods that were called from Beginplay to OnPossessed
possessed is not good enough if it's possessed by an AI controller and not the player yet maybe?
because it can automatically be possessed by an AI controller first, before the player possesses it
so you might get that triggered twice
Oh yeah but the one making it crash in question is actually an AI
you want to wait for the player to possess it right?
No the player doesnt have to possess it, the problem is that the AI falls somewhere in the map making the Flinch RPC fire too early before it was ready or something, I'm getting the symbols right now though to tell you guys the exact engine lines
I'm saying OnPossess will trigger ON the AI possessing it, which is not what you want to check for, you want to check that it is the Player possessing it. So you have to do an extra check to see maybe what Kind of controller it is.
Ok, yeah I'm not sure how your possession and controllers work
anyways, before I go to sleep, I'll repeat again, get the symbols
Well the particular pawn that is making it crash is supposed to be controlled by an AIController, so non player controlled at all
I am getting the symbols
I didn't think it would help since I thought its a matter of putting a certain condition around Flinch or even moving where it is executed, its checking for the ClassInfo before its present which is why I get that error
Any idea how I can add the debug symbols when I already have it installed?
I'm not sure what you mean by that
The one I'm testing it on is non source, but I also have a source one installed
