#multiplayer
1 messages ยท Page 639 of 1
you should check but usually you just need to pass "who own the call, who own the mesh, and what I am doing now"
the motion controller hands are kinda special case?
So I could just pass a reference to the actor as self and then on multicast get the skeletal mesh and set its morph target?
I wound't go as far as saying it's special case but they do have special syncing for that component compare to other pawn components.
eh, actually don't need to do that.
let me quickly explain
the playercontroller class have a mirrored counter part on the server
so each client have a client controller, and server have all the mirrored playercontollers(think of it like a remote control receiver)
it's a one to one relationship that's also the basis for all RPC things to run
so you just need to know which player controller owns the current RPC call and sends request to server
server tells other clients to do "this face" cause I got a request from player A
Thats the easy part
what it does is it tells the server pawn that player A owns
to replicate the face values(blend values) to all other clients.
since that pawn also exists on all other player's local copy
(BUT, the actor reference won't be the same if you compare them.)
I hope this make sense. @severe tendon
Kinda
I'm aware of how UE4 handles spawning and actors I was just lost on why the lip-sync actor wasn't replicating.
Turns out if you send the packets out of order by not forcing Reliable then you get either nothing or random jank ๐
that's where you need sort of input "queues" and do input reject/replace and smooth interpolation.
it's a whole different kind of ball game but if you look for a blizzard GDC presentation about player inputs it should get you started
yeah, if you have like only a couple players that should be fine.
I've written C++ based networking, its just getting around Unreals networking that is a struggle
how do people do client side prediction (predicting local input) without waiting for server to reply first? I figured I could simply do:
- ClientDoFoo - owning client does some action and calls ServerDoFoo if not authority (client still does t he action and predicts it can do it)
- ServerFoo - simply calls MulticastFoo so that every other client runs the Foo action and all the related effects and such it might contain
- MulticastFoo - Now this runs on server and all clients. But now the owning client runs the same action twice? ๐ค
I'm not sure if a simple HasAuthority check works there in the multicast because then all clients wouldn't execute the action on the actor? Should I check if it's locally controlled instead? ๐ค
You're correct, except 3 needs reconciliation to decide what's been shown, whether the server showed something different etc
so basically I'd need to think of the locally predicted action as a transaction that gets rolled back in the multicast if the server says no can do
Yeah
it's like in games if you happen to have network glitch, you usually have these kind of thing happen. 1. gun fire won't stop or can't trigger you can't move at all 2. you can fire or do things and run around but all the others are running in circle spinning, then suddenly rollback to whatever server tell you to.
just remember that whatever happens on client side is just visuals, and we try to make it as in sync as possible.
I guess this is exactly the kind of stuff the gameplay ability system does?
sorry, I am totally out of loop of that gameplay ability system as I just came back.
(like my last project on my disk is from 4.15. ha!)
How do you guys replicate audio? Have a function in something like GameState that Multicasts to all clients?
I think the general way is to replicate the event that triggers the audio and let the replicated actor handle the part that spawns the audio.
Yes, gameplay abilities using GAS can have client side prediction
there is another side of it as well like, if you are on the client, you want to play the audio asap from your action instead of waiting for the replication.
(as that will kinda masking out the perception of input lag, etc.)
makes sense
so yeah, will dig GAS as well later when I have time. ๐
If you import your Skeletal Mesh to your Project and choose to use an existing Skeleton in the Project, does the Skeletal Mesh uses the Skinning from the chosen Skeleton or the one Skeleton within the FBX you imported?
oh ups, myB, but thanks
hi everyone
got 2 actors in a word, and a weapon pickup
I've setup the code to only make the player jump if he runs into it, just for testing
UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepHitResult)
{
Super::OnOverlapBegin(OverlappedComponent, OtherActor, OtherComp, OtherBodyIndex, bFromSweep, SweepHitResult);
if (Player)
{
UE_LOG(LogTemp, Warning, TEXT("Weapon : %s"), *OtherActor->GetName());
PickupWeapon_Implementation();
}
}
void APickup_Weapon::PickupWeapon_Implementation()
{
Player->Jump();
}
bool APickup_Weapon::PickupWeapon_Validate()
{
return true;
}```
the parent pickup class, just Casts the OtherActor and saves it to a ACharacterBase* Player variable. that all works fine
my question is : the UE_LOG in the OnOverlapBeing method, prints out the Actor name for the actor running into it, then the other actor, then the main actor again
eg:
Base is the parent class, and Weapon is the class from the code example above
so I have 2 questions basically : why?
and also : should I check if the player IslocallyControlled before attempting to pickup the health?
then ask the server to give the health?
if I do a if (Player && Player->IsLocallyControlled()) then the server code still gets executed and only once, so I'm assuming all is ok?
well overlaps are done on both client and server
and the name on server will be C_1 and client will be C_0 (if you have only 1 client)
so not sure i see the issue here?
@upper lynx
hey, I am trying to make a multiplayer game with Chaos Vehicles. It's kinda working out of the box, but since physics is getitng replicated on the server, the vehicles are lagging on client side. If my ping is high, I cannot even control the vehicles. What is the proper way to fix this? (with blueprints)
physics, networking and blueprints is a combination that just doesn't work
ok, if it's no issue then, then it should be ok
thank you ๐
I think this may be what I'm seeing
thanks for the feedback
Hey lads! Can GPU affect rubber banding?
If a client is running at a low framerate (due to GPU or game performance) then it will likely see more corrections.
What types of things are missing?
Hi guys,
I've been trying to get a simple multiplayer up and running and have run into some issues, here's the brief of what i am trying to achieve:
- players join the server and are made spectators looking through a specific game world camera
- Upon hitting X spectators in the server the match begins
- A timer pops up on screen and counts in the round, players can then move and there is a countdown from x which ends the match
- Players return to spectators looking through a specific camera
So so far i have most of this working with the following setup
- The game mode handles players joining, setting them to spectators
- The hud reflects the current number of spectators by asking the gamestate about its replicated values (current spectators etc)
- When the correct number of spectators are in game the game mode starts the match
- This spawns the players automatically startMatch()
- The game mode owns the game timer and the game state has it's own version which clients have access to
- The game mode activates it's game mode timer and is registered for delegate feedback (timer end etc)
- This then replicates its state to the game state timer causing it to start
Now the issue i am seeing here is there is always a delay prior (1- 3 seconds) to the clients game timer starting, now realistically this isn't a big deal as the game mode (server) handles the stopping of the match as it is the only class tied to delegate callbacks from the game timer. But it seems odd, its almost like the game starts quicker on the host than the clients. One big thing to mention here is i am testing in the editor (not sure if this makes a difference).
Does anyone have any suggestions why this might be happening, or alternatively suggestions to the setup, i let clients have their own game timer so it ticks smoothly and the game doesn't have to replicate the time continually, rather just the start, stop etc.
I would appreciate any info on good practices for gamemode vs gamestate. i've read a lot of descriptions, cedirc's multiplayer compendium, multiple tutorials but i still wonder best approaches. I've tried multiple ways where the gamestate (server) owns the timer and handles starting based on match start.. but it seems more sensible to have that type of logic in gamestate.
Anyway any help would be appreciated.
oh and fyi this is all in C++
alternative is using replicated server time in gamestate, but its less accurate
does anybody here have experience with implementing in-game economy, meaning that players can sell in-game items between ech other?
Not exactly easy stuff there
@meager spade @winged badger Thanks guys, do you mind elaborating a little on how that would work?
client sends a RPC with its timestamp
I was thinking firing the timer to start at the same time would do the trick (the clients version is just for show_
server replies with RPC with original client timestamp and its own timestamp
time when client receives the reply - original client timestamp is round trip time
so then server delta is servertimestamp - receilvedresponsetimestamp + half round trip
you cache that and afterwards when you want to get server world time, you just return your own world time + serverdelta
Hi. I'm trying to setup vehicle passengers system for multiplayer use. My current prototype looks as:
class AMyCharacter : ACharacter {
UPROPERTY(ReplicatedUsing=OnRep_ParentVehicle)
ADriveablePawn* ParentVehicle;
UPROPERTY(Replicated)
int32 VehicleSeatIndex;
}
AMyCharacter::OnRep_ParentVehicle() {
if (ParentVehicle) AttachToVehicleSeat(); // attaches character to seat socket
else DetachFromVehicleSeat(); // detaches character from seat socket
}
class ADriveableVehicle : APawn {
UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly)
void Board(AMyCharacter* Character);
UFUNCTION(NetMulticast, Unreliable)
void BroadcastBoarding(AMyCharacter* Character, int32 Seat);
UPROPERTY(Replicated)
TArray<AMyCharacter*> Passengers;
}
ADriveableVehicle ::Board(AMyCharacter* Character)
{
int32 SeatToBoard = FindEmptySeat();
// register passenger within vehicle
Passengers[SeatToBoard] = Character;
// register vehicle within passenger
Character->ParentVehicle = this;
Character->SeatIndex = SeatToBoard;
Character->AttachToVehicleSeat(); // attaching instantly on server
// triggering for other players
BroadcastBoarding(Character, SeatToBoard);
}
void BroadcastBoarding_Implementation(AMyCharacter* Character, int32 Seat)
{
// teleport to the boarding location
// play animation
}
Do i need to wait on animation finishing on server and then attach it to the seat or do it only on client-side
Are there any possible tips/hints on how to set it up or what should i look at?
Ok, that all makes sense, however as the timer is purely visual on the client would i need to do this? As when the server triggers the timer to start it should be synced right? as in it happens on client and server at the same time. If not would i have to tell the server to start their timer the server delta after it has told clients?
I'm having trouble replicating the Set Anim Instance node; the usual methods of replicating variables and RPCs aren't working. Any thoughts on this?
I've just tried to implement a Sprint movement to the character movement component. It works but now as an autonomous proxy it seems to be like it is correcting my movement even though on the simulated proxy it is smooth. can anyone tell me why this could be occuring? Thanks
Edit:
Lots of network corrections.
Edit the Second:
Don't let resharper name your parameters because you wont realise the difference between InDeltaTime and DeltaTime
Anyone experienced overlapping collision (beginoverlap and endoverlap) sometimes not work on server?
its like random time. when i come closer to temple, as expected HP filling is work. but when randomly closer to temple sometimes not work. then i gonna get far and come closer again, then its work.
I used print string. as from log says begin overlap text didnt printed. when i was trying far/closer again, then it printed succesfully.
-No collision changes
-No small collisions
-No fast moving
-Using overlapall profile.
-Using query only collision enable (since i dont use physics so)
Then why this happens?
Has anyone had experience using seemless travel in a packaged game? I have everything working fine in standalone version in editor, but when I package the game nothing happens. I've added the transition map and map to travel to both in packaging.
I am using seamless travel, it is working for me in the packaged game
are you running it via console command node?
what do you mean by not working on server? do you mean on a listening server and you leave/enter the collision and nothing happens?
Like opening the level using console command with additional options?
Then no, I am using servertravel function
Yes @silk abyss It is set up and working fine when I run the editor in standalone. I can travel to and from and all my items saved, etc but for some reason when I export the game, I run through the trigger box and the node fires but I am not sent to the other map like I am when running in editor standalone mode
the only difference is exporting
@shadow hornet are you sure you set your game mode and other default blueprints proper for your export?
ya, game mode is set in project settings and Im running the command on game mode via custom event replicated and run on server
@shadow hornet have you added the map you are opening in the packaged maps list in packaging settings?
no its on a dedicated server. and yes sometimes nothing happens like randomly %10-20
if you have print or log functions, try log those to log file and then check log for your packaged game.
@eternal briar Yea, I thought it was because my transition map wasn't added yet but I added it also and still same.
cause server should try do something and log plenty other default information to log file
Did you check the server log? Does that say anything weird?
all my maps are listed in the "Directories to include" with proper location
not yet, i'll look at that.
@bronze arch basically, it's tough to call but 10~20% is a bit much isn't it? it sounds to me that something doesn't seem quite right and probably have logical error in your server authenticate event flow.
like maybe you have a data race and set the flag wrong somehow.
not only on server. it happens same thing on client but its more lower than server error rate
like depends framerate 
so something to do for checking? on the server log the actor/component that should generate events.
no only printed directly from begin and end overlap event
for testing
im using 4.24
see how you can replicate that and if you think frame rate could be an issue, do client side check and request a server overlap check.
doesn't matter which verison, overlap event is there for a very long time.
it's how most "pick up" works, so you overlap ammo/gun, you pick up ammo/gun
also, who is actually doing the call?
isn't these all be done on the server?
actually its placed on level. so its replicated automatically. and made it work both on server&client side so both are printing with no checking (branch, boolean etc)
its like when fps drops coming it doesnt print more chance to not fire overlap event %50 (maybe GC?)
for test used just print text. but in normally yeah im using pawn health for filling HP from temple
@eternal briar I got it. It was the transition map not being added originally to my export map list. For some reason after I added it, it still hadn't taken in settings so when I exported it wasn't there. After restarting the project and exporting again it worked this time. Ty for the help though..
@bronze arch okay, just kinda double check. what component on the player you used to generate overlap events with the temple?
you said something like even if you run locally it will still have lower chance of not firing event, that is super weird.
capsule component(main root one) on pawn and a big sphere collision on temple
i think its related to framerate, when came a fps drop it sometimes not fire
is your actor always spawn outside of the temple shpere?
while GC deletion
yea
i was thinking to do this but it takes a lot time, since its randomly happen and hard to fasten timing
maybe 30 min later maybe 1hr maybe 5hr
atm looking for another method to prevent this,
is your temple sphere overlap everything or just pawn?
because I thought someone had the same trouble, maybe there is a solution.
guess im gonna delete those events and using getoverlappingactors within Set Timer
there are so many overlap not working issues on the internet man.
overlap everything
ill try tomorrow but i doubt it worked tho, there is only a landscape and pawn
if not ill go with settimer
well, take it as a lesson to figure why.
cause if you can't figure this out, most of the trigger box mechanism will bring you trouble.
i dont use much triggerbox but guess i would go with timer every overlaps if i couldnt find the solution
how to do a lobby ? currently my ame don't have lobby when join game
Have a look into the Sessions system
Oculus has a good example on how to do sessions with their subsystem which should be relatively easily translatable to most of the other online subsystems
Oculus ?
Are you using a subsystem?
Like the Steam subsystem
Yeah, so the sessions system
Ok so I can't really write anything at the moment but a lobby is just a pre-match menu.
So at a base level what you can do is join everyone in and then force their camera or add a UI overlay and disable inputs.
I thought you were using C++ and had direct access to the online subsystems, which is why I was talking about Oculus, that plus they have a good example of hosting/joining sessions and lobbies
i use BP
Yeah
so just create a multiplayer match and force users into an empty or pre-designed level with a UI and enable UI and mouse
disable controller inputs
yeah but i need to save in real time player info and show them on the lobby
Something like https://www.youtube.com/watch?v=FLYLfNdKkjc?
Dunno how good it is though
But you should be able to get player info on the client side and send it to the server on connect to then create a widget across all clients and fill it with that info
Hey, guys! I have a couple of newbie C++ multiplayer questions.
- When declaring a Server function with a parameter, like this...
UFUNCTION(Reliable, Server, WithValidation)
void ServerGrab(AActor* GrabTarget);
...and invoking the function from a Client, will the AActor* GrabTarget parameter still be referring to the same Actor when the ServerGrab_Implementation function is called on the server side? It is almost impossible for the Actor to be in the same memory address in both the server and client, so does Unreal take care of this behind the scenes and converts the value of GrabTarget so that it points to the same Actor that the client intended?
- Are
_Implementationfunctions static? In the ServerGrab example above, I end up with avoid ServerGrab_Implementation(AActor* GrabTarget);function in my CPP file. I tried to usethis->GetMesh();in that function's body so I could attach the grabbed actor to my Character's SkeletalComponent, but Visual Studio is saying "'this' may only be used inside a nonstatic member function". Is this one of those situations where Visual Studio gives a nonsensical error because it doesn't know how Unreal works, or are _Implementation functions actually static?
Thanks!
unreal doesn't replicate memory addresses, it replicates a NetGUID that gets resolved into a pointer on the other side
and _Implementations are definitely not static by default
i don't think your problem is likely a static, but a non-member, because you likely forgot the bolded part of void **AMyCharacter::*ServerGrab_Implementation(AActor GrabTarget)
(in your .cpp)
Thanks for the reply! I tested my function (it still compiled despite Visual Studio's error) and you are right about _Implementation functions not being static!
I put a breakpoint in the line where I call this->GetMesh() and it does work. (I only forgot to put AMyCharacter:: in my message, not in the actual .cpp file).
It's really cool that Unreal replicates the NetGUID instead of the memory address. 
Yeah, that's what I figured... Since this was a new error than the ones I usually get from Visual Studio I thought it might have been a real one this time, but I guess it got confused because there's no _Implementation function in my Header file.
So thanks, you two! And nice cat in your avatar, Lorash!
Is it possible to rely on a CDO pointer replicating reliably? Or do we need to make sure the clients/server have loaded the class first?
Or maybe I should replicate a TSubclassOf instead?
Yeah, will be easier
CDOs are replicated by name
if UObject::IsNameStableForNetworking returns true, then UE4 will replicate by name instead of netuid
IsNameStableForNetworking returns true for assets, CDOs, and constructor-created components
so, short answer is, replicating a TSubclassOf (under the hood, a UClass*) and a CDO is the same
they are both replicated by name because UClass is name stable and CDOs are name stable
it is worth it to note, neither UClass pointers or CDOs are evaluated for property changes
only things replicated by an actor channel are evaluated for property changes (so, Actors, Components, and UObject instances explicitly replicated with UActorChannel::ReplicateSubobject)
Good to know
yep
these rules bit me in the ass when writing my plugin ๐
and I'm currently fighting with ReplicateSubobject right now, since it's delayed a frame
that's some good detail thanks ๐
but do you know if I replicate a CDO, internally UE will convert to NetGUID and send that. But will it load the class on the receiving end and provide a valid pointer?
ah sorry yes ๐
(the name in this case is not a string, but a different identifier)
UE does not attempt to resolve the object on the other side. It just returns whatever UObject* corrisponds to that name
so if you replicate like BP_MyBlueprint_C, it will give you whatever is named that object on the other end
so, if you load that object beforehand and the name matches what the server has, all is good ๐๐ฝ
if no object exists by that name, you get a warning and nullptr
if a different object exists by that name, there is hilariously no checking
it just returns that object
(dont ask how I learned there was no checking... that was the bit that really got me when writing my plugin)
morning guys. I have an ActorComponent with a method that handles HandleTakeAnyDamage
when I'm done updating the health, I then OnHealthChanged.Broadcast(this, Health);
on my BP I have this
The value comes through correctly, but it's Server Only
so when I try and update the UI, it doesn't update, cause it's only happening on the server, and not the client
how do I fix this?
I've set the var to Replicated
set it to RepNotify
float Health = 100.0f;```
right
so you want a notify here as well
because you don't just want the health to be replicated, you want to know when server has changed it
like this? UPROPERTY(ReplicatedUsing = Rep_HealthUpdated, EditAnywhere, Category = "Health") float Health = 100.0f;
yep
tried that too
when Rep_HealthUpdated is called, update your UI
though, personally, I use UMG bindings to do stuff like this
not BlueprintCallable, but yeah
UFUNCTION()
void Rep_HealthUpdated()
{
//Update your UI with the newly updated value
}
ok, I had it first without the BlueprintCallable, and didn't work either
no, you need the UFUNCTION(), you don't need the BlueprintCallable
cool
UFUNCTION() with nothing just marks the function as a UFunction
also, I thought you didn't need to put anything inside the Rep_HealthUpdate function?
which is what you need
nah, you need something there
so, conceptually
Actor takes damage, health is decreased on the server
it changes Health, sends the change to the clients
the clients now, when it sees that the Health value changed, do something with the new value (update the UI with that)
you have the taking damage and the replicating to the client
the client is just doing nothing with the value change
Rep_HealthUpdated() is where you actually respond to that change on the client
no problem!
also, it's worth to note, personally I do not follow this pattern
in UMG, there is a binding feature, and I bind UI values to replicated variables
yeah I know there's the bind function, but I've read that this is not always the prefered method. It works, but something about it being expensive
yeah, it can be slow
it's called every frame
and your health probably wont change every frame
so it's not the best
but I like binding conceptually because I treat my UI as a "View" in a MVC pattern, and having your data know about the view is kind of a anti-pattern there
it does have performance considerations
It really depends on the value and how you use it. It's fine for a few small things. But some people put bindings in places like lists. And if you have like.. ten bindings per list button, and then you start populating that list with a hundred buttons, you now have a thousand bindings.
ARGH@#!@# !@!@# HOTRELOADS!!!!
ok, will feedback shortly if it works
need to restart and rebuild BP
Should ditch hotreload too.
yeah turn off hotreload lol
Just enable Livecoding.
You don't have to use it, but it'll stop Hotreload from running. And if you change things in the .h file or class constructor, always reload the editor.
what is so frustrating, is that every time I make a change to the ActorComponent, then that component goes blank on the BP
Welcome to hot reload with Blueprint changes
Don't compile with the editor open if you are doing UPROPERTY/UFUNCTION/constructor changes
I have this on my variable
UPROPERTY(ReplicatedUsing = Rep_HealthUpdated, EditAnywhere, BlueprintReadOnly, Category = "Health")
but for some reason, the Rep_HealthUpdated() method is still not being called when updating Health variable
full text
float Health = 100.0f;
UFUNCTION()
void Rep_HealthUpdated();```
{
UE_LOG(LogTemp, Warning, TEXT("Rep_HealthUpdated %f/%f"), Health, NewHealth);
}
void UHealthComponent::HandleTakeAnyDamage(AActor* DamagedActor, float Damage, const UDamageType* DamageType,
AController* InstigatedBy, AActor* DamageCauser)
{
if (Damage <= 0)
{
return;
}
NewHealth = FMath::Clamp(Health - Damage, 0.0f, MaxHealth);
Health = NewHealth;
UE_LOG(LogTemp, Warning, TEXT("HandleTakeAnyDamage %f/%f"), Health, NewHealth);
OnHealthChanged.Broadcast(this, NewHealth);
}```
surely if the Health variable is update in HandleTakeAnyDamage, then it should call the Rep_HealthUpdated method?
and yes, I have ```void UHealthComponent::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(UHealthComponent, Health);
DOREPLIFETIME(UHealthComponent, Shield);
}```
Assuming you have called HandleTakeAnyDamage() on server, then you should see the Rep_HealthUpdated() being called on Clients (but not the server)
not seeing it anywhere
Also the component have to be set to replicate, the same goes for the owning actor
OnHealthChanged broadcast to the BP shows that it's being called on the server
OM MY F!@!#%^$^
that's the problem
component wasn't set to replicate
argrrggggghhhh
thank you
Does anyone know whether the NetworkPrediction plugin is here to stay and it's worthy investing time in it? Last updates are relatively recent (7 months ago) but many comments in code give the hint that this is yet to be optimized / solved, but I might be wrong.
my guess is that it was a test bed / WIP of whatever UE 5 will have
I also have a question: Was there any built in way to have replicated simulated physics?
I think there was a plugin for it ๐ค
with new power, comes new responsibilities problems
2 clients.
Client 1 gets hurt - Can see the updates on client1 and on client 2. So all good there
Client 1 picks up health pack - ONLY client 2 is aware of this.
Are you using listen server or dedicated server?
dedicated
Show us how the health pack works
UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepHitResult)
{
Super::OnOverlapBegin(OverlappedComponent, OtherActor, OtherComp, OtherBodyIndex, bFromSweep, SweepHitResult);
//Player is set by the parent of APickup_Health, namely APickupBase
//Returns valid
if (Player)
{
PickupHealth_Implementation();
}
}
void APickup_Health::PickupHealth_Implementation()
{
if (Player)
{
ACharacterController* Controller = Cast<ACharacterController>(Player->GetController());
if (Controller)
{
Controller->GivePlayerHealth(HealthAmount);
}
}
}```
ACharacterController class
{
if (HealthAmount > 0)
{
CharacterBase->GetHealthComponent()->GiveHealth(HealthAmount);
}
}```
I made the health pickup run on the server, so that the server is the only one that has the auth to give the health.
Using C++:
If I add or remove items to/from a nested TArray on a replicated TArray<FMyStruct>, does the onrep still trigger? ๐ค
Stuff like this is an issue in Blueprint, wondered if this was also a limitation in C++?
E.g. a class has a replicated (onrep) TArray<FMyStruct> MyProperty below:
struct FMyStruct
{
TArray<FMySecondThing> Things;
void AddItem( FMySecondThing Thing )
{
Things.Add( Thing );
}
};
And I do MyClassReference->MyProperty[0].AddItem( NewThing ).
I assume PickupHealth is a server method. You shouldn't call it with the _Implementation suffix. Just call it like: PickupHealth()
Should work, make sure that the Things array is also marked with UPROPERTY specifier
Oh you mean OnRep for the whole structure if the inners are changing, then I am not sure if it is called
Right yeah, if I change the inner array of the outer array's element, I want the outer array's onrep to trigger
yip. server call. I changed to call PickupHealth(). problem persists
check the console log
the first few where the numbers going down is when client1 gets hurt. you can see the health bar is being updated on both clients
at the end, when client 1 picks up health, only client2 gets the 100
strange
anyways
I'll dig around some more
@upper lynx that's a problem with your logic between triggering the pickup and actually adding the health.
it was this. I never saved the file when I made the change
it's working now
I was calling _implementation directly.
I understand now why that was incorrect
thanks
Did a quick test, answer seems to be "yes!" @empty axle
Praise be C++
Yeah if the array or data within changes at all it'll fire
Hi all, can please someone with Firebase Database experience in connection to multiplayer drop me a message, I have a couple of questions. Thanks in advance.
It's such a breath of fresh air over Blueprint's behaviour
Yeah the blueprint callbacks suck big time. They aren't really OnReps either. No idea why Epic decided to use totally different logic for BP.
Hi anyone have any good source on advanced network concepts applied in unreal?
I'm familiar with gafferongames, valve client side prediction paper etc., but looking for anything applied in unreal
ah that sounds great, I'll check it out
sorry a bit new to this, where is it pinned?
also, do you know if it covers more advanced topics like how to handle client side prediction etc. in unreal?
Gaffers' article is hard to apply to UE tbh, due to the nature of it.
Prediction stuff is usually very specific. Epic has "general" support for it in Gameplay Abilities, and there's an upcoming network prediction plugin that will help with custom movement and interop with gameplay abilities too.
yeah, I've dabbled with my own implementations of client side prediction myself so aware of the "specific" nature of it
would still want to know how you'd handle something like a moving platform in unreal
upcoming network prediction plugin sounds great, is there any info on this, or just soon โข๏ธ
Anyway, I'll do some more digging. Thanks for the info, it's very much appreciated!
its already in the engine
its just not finished
yet
Yeah, best bet is to check master branch but it hasn't been updated for a while. Probably being done internally now for UE5
they have more stuff in 4.27 which is on master like the base CMC for it
doesnt do much tho
Ahh nice, that's good then
yea
there still working on a lot of it so its not really ready for a shipped build
Still some physics stuff going on too, that's exciting
I'm a noobie to the whole multiplayer replication stuff. I have a sprint system which will reduce stamina by x amount every tick. Should I be doing this with a rep notify or should i just write something along the lines
/* In the tick() */
if (GetLocalRole() == ROLE_Authority)
CurrentStamina -= 1 * DeltaTime;
Docs seem to say rep notify but they don't do their example every tick.
hi i use free plugin advanced sessions for create game lobby
but look like when i quit the lobby for return to main menu
my lobby is still present on the list
and only dessapear when i quit the game
what to do ?
how to close this session ?
Use the DestroySession method
You'll also need to call it on clients otherwise they can't join a new session if the host quit or they got disconnected
i need to paly this function on all clients ?
it is a advanced session method ?
how to play it on all users ?
Just make a SessionActive boolean on your game instance and set it to true if you start or join a session. And if you're back to the main menu (because you left the game or got kicked/disconnected) you call DestroySession there if SessionActive was true. And then just set it to false again.
So i need two functions
one for host like my screen ?
one for clients who kick or disconnect
@craggy void
bc currently that don't work even for me
If your host terminates the session, the clients get redirected to the default map automatically
So if you set MainMenu as your default map, and do the DestroySession there if a session was active, you'll always close the session properly no matter the reason
Hook up the player controller
Like I said, I just change the level and destroy the session in the MainMenu
so on main menu event construct
destroy session ?
currently i load the map so i m on success
but game still on lobby
here ?
or here
@craggy void
I would imagine either would work
ok but on widget i need to use get owning player
and not get controller
i did this
don't need get instance variable
because if true he destroy
if false he failured
but failures isn't a problem
@craggy void
but does that will work for people who are not the host of the server?
I suppose that would work yeah, I just don't like executing code unnecessarily because it might cause side effects
ok but here what side effect can happen
That's the thing, you don't know that in advance. Might completely crash the game if there's no session under certain circumstances for all you know
xd
but so this dsetroy sesion thing
for a client that don't destroy the server
but only left his place on the server
and for the host that destroy the server.
No, the session is local. So if you call DestroySession on a client it basically exits the session gracefully
Won't kill the server's session
Yeah
ok
Anybody used Firebase backend for a multiplayer project? Also, I know it might be a pointless question( I am still pretty much new to networking ), but is it possible to connect clients to a database server, without having a dedicated server build for the game? So for example clients position is updated from the database? Thanks
Even if, Firestore costs per Read. You really don't want them to constantly read and write to it :D
Anyone using UseAdaptiveNetUpdateFrequency? Just found about about it
Wondering if it's hot or not
What MP solution you can use except the Advanced Sessions plugin ?
Yes, I am aware of the costs ๐ , but is possible to assign the authority to the database server instead of having a dedicated game server? Thanks
With a lot of work maybe, not sure
Hello, I have a question about rotation replication.
It would appear that SetControlRotation only functions when called on the owning client, eh?
Does anyone know a way I can instead call it on the server and have it replicate out? I'd like to do this so that I can handle it in the same place where I'm calling SetActorLocation at that moment.
Any advice would be appreciated.
Cheers.
So the easiest option would be to have a dedicated server side and that would communicate with the database I guess?
You're right, controllers and the pawn they currently possess are owned by the client. By using Control Rotation, you can rotate a pawn via the controller.
actually no, controller is owned by client, but pawns are owned by the server. just that the server's controller mirror possess those pawns.
(ie you can kill a pawn on the server but not on client, if you somehow C++ kill it locally it won't reflect to other clients anyway.)
Pawns should be owned by whatever client is possessing them.
Hi everyone, is anybody here Good with splines ? I'm experience a weird bug where my character follows the spline as expect but he fly to outside the world after that, i have tried to remove the last Point of the spline, but no success, could anybody PLEASE help me ?
na~, imaging this. you have player pawn and vehicle pawn and the air-strike tomo-hawk guilded missile with camera pawn
can client own all those? you would be asking for lot's of cheat!
server game mode can kick player controller out of their possession anytime, in fact that's how you do lobby/spectate pawn and respawns on the server.
The client just possesses the vehicle pawn, or a seat in it, which allows them in input controls through the vehicle.
But that doesn't change the point. SetOwner is called on a pawn when a controller possesses it.
still, client don't actually own the pawn.
I mean the "owner" call is a bit misleading, they should just call it "possessor"
whatever is less misleading.
Except that they do. because their controller is set as the owner. Anything owned by their controller, they own.
that's more like a framework terminology vs who actually have the right to do stuff debate.
This was my impression and this is how it's described in eXi's guide.
in server authenticate env, all the inputs are going to server and server "replay" your input and do all the movement on the server.
Server calls Controller->Possess. That calls Pawn->PossessedBy, That calls SetOwner and sets the owner of the pawn to it's new controller. Owner is a replicated variable. The client now owns the pawn it just possessed.
client can do some sort of prediction but eventually you need to interpolate back to where server pawn currently is
that owner variable is just so it's easier to maintain player inputs and relationship to the pawn(s)
"Owner" is very much a UE thing and the client does 'Own' the pawn they possess. Without that you would never be able to send RPC's to the Server for that actor.
Thanks, Jambax.
I just found it misleading by having it named like this
You're mixing it up with "Has Authority"
like it actually leads to discussion like this one, imagine trying to teach someone replication and they said, but client owns the pawn why I can't do some stuff to it
Owner = This player can do stuff and call network functions on this object.
Authority = This actor was spawned on the local machine or torn off, and the instance can do whatever they want to it
Ownership != Authority though, that's the key difference. Authority is what determines whether you have the final say on something, and that only ever matters if the Server has authority since replication is one-way.
this is what people get so confused with cause the naming. ๐ฆ
It's like having a Steam account. You might own it. But they have authority over it.
IDK I'm used to it ๐
I am used to it but still never liked it one bit
like before the compendium out, it's very difficult to convey the idea.
(especially like English isn't my native language)
Ah, that's probably what it is
so when I try to explain to someone new, I try to tell them the clients don't actually "own" anything if they are doing game mechanics.
but now adays I just tell them to read the compendium(most of time)
Before this ownership (which is nine tenths of the law) debate opened, my question was the following. Do you have any advice for me on this issue?
--
It would appear that SetControlRotation only functions when called on the owning client, eh?
Does anyone know a way I can instead call it on the server and have it replicate out? I'd like to do this so that I can handle it in the same place where I'm calling SetActorLocation at that moment.
--
If there's no way to do that, could you tell me if it's safe to disable and reenable ReplicateMovement on characters midgame? I just need to do this little flourish animation when the pawn spawns and then let the player take over.
Control rotation is indeed client-side, but IIRC the character movement system sends the control rotation as part of it's movement updates - and the server will just accept the rotation.
Effectively client has authority over their controller rotation
And APawn has a replicated 'RemoteViewPitch' which is a heavily compressed pitch rotation so that 3rd-party players can see where others are aiming.
So calling SetControlRotation on the server won't do anything unless the controller is owned by the server and there's no way to get around that?
It'll set the control rotation of that controller locally, but almost immediately after the characters' owning client will send it a new one.
Yeah, that's what I figured... So! My other solution, is it advisable to disable ReplicateMovement on a character, move it locally on each client and then reenable ReplicateMovement and reenable input to let the player take over?
Tbh I would just play the animation locally and ignore networking altogether
So what all would I need to disable to do that?
I guess you can disable replicated movement but AFAIK the client will still be sending movement info to the server, unless you disable CMC from ticking too.
Then reenable after
But you might get a spike or jolt from it
It's only for two seconds of timeline animation or so.
It will be disabled off screen, fly onto screen, and then reenabled.
So if there's a jolt during the disabling, it will be offscreen.
But reenabling will be onscreen.
Would probably work, just disable CMC tick and replicated movement (which itself is replicated, so needs to be changed on server). Then reenable
Not sure though
Disable CMC tick on each client, and disable ReplicatesMovement on server?
just the owning client
Or, better yet, just animate the mesh and disable network smoothing
then you don't need to do anything
Ah, that sounds good.
Wait, you don't mean a skeletal animation? I'm just moving it along a spline with a timeline for my "animation".
they are better?
Advanced Steam Sessions just exposes current engine functions to BP afaik
So (again, afaik) none of the session plugins (anything related with steam, eos, discord, anything else) dont add new features/functionalities they just expose the framework
EOS/Discord aren't built-in, only Steam is
The one thing that always pops up when reading about multiplayer, is ownership
that always needs to be what you think about
I'm getting the following error
ProcessRemoteFunction: No owning connection for actor BP_Pickup_Weapon_2. Function PickupWeapon will not be processed.
I've googled now and tried to fix it, but not getting it right
on my CharacterBase class
{
Super::PossessedBy(NewController);
SetOwner(NewController);
}```
one of the sites I found mentions this:
Because the Actor which invoking server function on client doesnโt have Connection.```
so should my pickup_weapon have an owner set?
Hi my character animation is not replicating. Here is pastebin link of code.
https://pastebin.com/7LZPKGP6
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.
Video: https://youtu.be/dHxHwbX06Hw
if the owner is obvious, then yes, but for pickup it probably isn't.
In this case you have to execute the RPC on something that you own like Character, PlayerController, PlayerState
Ok will try tomorrow evening. Got a busy work day tomorrow, and already 23:00. So will try again tomorrow. Thanks
@peak pollen Animations don't network, they should be driven from the animation blueprint by properties that do though. Typically it is enough to set up the animation blueprint to be driven by the velocity at the most basic, which is networked.
How is your anim bp set up?
What is AnimMoveInput pulled from
ANimMoveInput is just InputX
InputX in Character Movement Component
In the video it looks like the values are being reset because it prints clients twice and the second one is zeroed out. Server is printed 3 times and last two are zeroed out as well.
What do you mean InputX? The properties of the movement component actually networked is like velocity and such. "input" broadly speaking, is not networked. Can you be more specific where it is being pulled from?
Its my own variable
So what is that set from?
I posted code here
https://pastebin.com/7LZPKGP6
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.
Just to be more transparent. I am moving through curves that I extracted from animations. I use inputX and inputY play animations. While animations are playing I get the curve. Than I set actual movement to that.
I need root motion but it does not work so well networked so I am making a "virtual" rootmotion system.
I have seen this done before
It sounds like something well outside the purview of the prediction system, so you are in for nothing but problems in MP.
No not really since I am moving using this
CharacterOwner->AddMovementInput(CharacterOwner->GetActorForwardVector(), 1);
The movement works fine.
Just not being animated.
Anything not captured in the saved move is basically not predictable, and rollback and replay will not function properly. This won't be obvious until you play under more laggy conditions.
But anyways, I won't lecture on that.
So I should get InputX in the SaveMove section of my code?
Sorry I am new to networking.
We don't care for the rollback and replay stuff
My advice would be not to try and circumvent the mechanisms built in. It saves moves for prediction and correction. I don't know why you would want to intentionally break that. You are pushing input data that is largely redundant with the information that can be derived from the movement speed.
do you need to set bRequestMovementInputChange in your Server_SetMovementInput_Implementation ?
looks like you do that on the client side, but the server doesn't
No let me try that.
Ok that got the clients animating on server window
The problem is that the second Client and server print is set to 0. So its being overwritten. That is the problem
I did above and now both Server prints say 1
Input only exists on local client
He's RPCing the input
So bypassing all the prediction in CMC? All to make a dude be able to sprint into a wall?
Lol
I am trying to do something like this.
https://www.youtube.com/watch?v=1VxdxYzriAk
Virtual Root Motion System Preview V1
(No root motion is enabled, no root motion system is used in the engine)
- Can be used for dedicated servers
(Currently, the packet data of the mobile component is increased by 2~4 bytes, and the packet data of the original root skeletal system is N times that of the system) - It can be used for all animat...
@peak pollen What do you want to have happen when you press forward but can't move forward?
What makes you think he's networking input to do that?
I don't care for that at the moment.
Its just a test
I know there running into the wall because there player controllers tell them to set Movement X to 1 on start. I do that so I can watch both of them without having to manage one.
He's talking about neural networks subsampling animations to generate fluid blending. Without more detail I can only speculate what he's doing, but it looks a lot like https://www.youtube.com/watch?v=6JNkhj2krm0
Answering questions about motion symphony and setting up some additional motion sets.
I talked to him. He said its not like motion symphony. He is extracting curves from the animations for movement, rotation and such. He told me he is not using motion matching.
I am using a tool I bought from him that extracts the same curves that he uses.
I think @dark edge point is if you drive your animation blueprint with RPC'd input properties, running into a wall is going to have them playing the run cycle in place against the wall for as long as you are holding the button. Contrast that to a character stopped at a wall by physics whose velocity is 0 wouldn't be doing that. You are creating problems with this approach. This is going to scale poorly. RPCs are probably the lowest class of networked data
I mean there's always rpcs being sent but you should animate based on the results, not the inputs. But I guess if it's just for testing then it's no thing
Ok. I understand. Still wan't to know why the client variable is being overwritten.
Are you sure it's not being overwritten locally? By inputs that are by definition zero? Idk what your input to variable setup looks like.
Are you replicating MyNewInputX, MyNewInputY ?
Right now I got rid of Y all together for testing lol
sorry, InputX, InputY
So client sends input to server, how does it get back down to other clients?
For a simple test you would just pass input value to server then server would save to replicates variable. That's if you're doing it totally independent of the CMC and just want to see what the inputs are. I guarantee you the CMC will not play nice with replicated inputs, it replicates the input internally by itself
In Animation Blueprint I got this
AnimMoveInput = FluidCharacter->GetFluidCharacterMovementComponent()->MoveInputX;
I am not using MoveInputX anywhere else.
Server_SetMovementInput_Implementation doesnt echo it back out to clients, so how does it get to them? Is it replicated?
If you aren't checking for local control, you're probably setting move input X to zero
your pastebin snippet doesnt show MoveInputX, just InputX so not enough info
Sorry I renamed InputX to MoveInputX.
@peak pollen are you passing the inputs on tick or on the move input events?
I am setting it once in begin play
I think this is the problem.
where are you calling SetMovementInput, can you show the bp
Only setting it once
//Movement Input
UFUNCTION(Unreliable, Server, WithValidation)
void Server_SetMovementInputX(const float Input);
UFUNCTION(BlueprintCallable)
void SetMovementInputX(float Input);
Like you said I am not sending it to the client from the server right?
not in the pastebin unless the variables are replicated
They are not
sounds like the problem then
Yha
It's as simple as only setting it IF YOU ARE SERVER then letting it replicate out.
Like I said I am new to to networking but I do feel dumb now lol
I noticed that ShooterGame uses uint32 bPendingReload : 1; instead of a bool in the weapon class. Is that a practice that we should follow? That particular variable bPendingReload is replicated but some of the others aren't.
usually this is to pack bools together into one int bitflag so they can all get sent over the network/stored at once afaik
but I can't tell where they do that here...
maybe the property system packs them?
Hello, what's are the advantages of a dedicated server in front of using advanced session plug-in with steam?
Dedicated servers are better than listen servers if you need competitive games with anti-cheat, or if you have massive player counts (> 6-10)
Unrelated to sessions though
Hello I am first time trying a multiplayer game I am successfully connected to a pc over lan. But not able to connect via internet with a friend
Steam pop up is coming and I have used advance session plugin
Can anyone please help?
Please it's urgent
Are you using your own app id or the spacewar 480 one?
I asked in #cpp, turns out they are packed automatically, but only if they are declared contiguosly
Hi guys ! Do you know how to get the local PlayerController from a client session ? I'm trying to color the outline of other characters in blue or red depending if they are enemies or allies. For that I need to get the PlayerController of the instance to get the team of the player. (If you would do it in a different way I would be happy the hear it) ๐
GetPlayerController works just fine ! You rock thanks !
#multiplayer hardly the place for it
Hey, I have a UObject which inside holds an array of character references. I'm using an actor (other than the player character) to spawn these characters and then adding them into this uobject. I'm spawning the spawn actor and charcters in a server RPC within the player character, but can't seem to get a reference back for the UObject. Is this because UObjects cannot be replicated and how can I fix this?
@brittle tulip why are you using an object for this and not making it some property of the game mode or whatever?
All these characters are AI characters that a player will control. So the player has a reference to this UObject (which contains all these AI) which has functions that can be called to enact certain behaviours, such as move to location, make a square attack this other unit etc. I hope that clears it up.
also players will have multiple of these Units (the UObjects) that will form an army which will also have functionalities. If that makes sense
I am using spacewar 480
Hey guys, my game has people connect to a friends pc to use there pc as like a server, and i want to do it so I can change maps. I'm trying to do server travel but nothing seems to be working, except a slight jitter when i go through the overlap
The spacewar id is region bound I believe, so doesn't always work if your friend is in a different steam region. Does it work when you're on a different PC in the same network?
Don't need to specify ?listen for server travel. Note that server travel doesn't work in Process In Editor, you'll need to package it or use standalone
Ah okay, is there any other way to do it, or is that the most effective?
No, server travel is the way to go
Okay, thank you
I tried standalone and instant crash haha
When going through the trigger for the next map I mean
Try just typing the console command on the host to see if that works
Otherwise try a packaged build
Updating a rep notify variable on tick than doing some stuff in the on rep function, will it affect performance or not?
@charred marsh@twin juniper For future reference, I used to use GetPlayerController for client stuff like widgets and local interaction. I fell on my face with that at the new work place. It won't always work correctly in Listenserver setups because there are rare conditions where a client's controller can be created first, which will make them 0 instead of the listenserver. and if you use that to get the listenserver's controller, you can end up with a client's. The safer way if you're not blueprint bound is to use GetGameInstance()->GetFirstLocalPlayerController().
Hi so I have a question, in my games I'm using only one run on server event for doing things, but when I downloaded someone others project, I saw that he was doing it twice in run on server and run on owning client event . My question is, which one is correct and when would I use which. Thx for reply.
so I implemented my replicated weapon firing logic based on Tom Looman's survival game repository code and I'm wondering if it's actually a good way to do it, mainly how hit effects are spawned on other clients.
For anyone who doesn't know, it changes an FVector RepNotified variable (that skips owner) that is used to spawn effects at some world location and the fvector variable is changed every time the owning client tells the server that it fired somewhere. Server then does a trace to verify it hit something and replicates the hit location to other clients via the repnotify.
Now, is this actually a good way to simulate weapon firing and hit effects on other clients? Wouldn't it make more sense to just replicate the firing state of a weapon (firing or not) and then do the traces on other clients and have them simulate the firing and hit effects locally instead of waiting for repnotifies from server?
for rapid firing weapons that is
I guess at most there would be some de-sync in the firing times between owning client and other clients
@kindred widget wait how is that possible? a player controller is created when you successfully log in to a server.
how can a client controller be created before the listen server controller?
Seamless travel.
Hello, i implemented voip talker to my game and it works, but I want to give the option to mute other specific player. It works only to the server, the host can mute other players, but on the clients it dont work. I am calling an event on the player controller from the widget when click the mute button. Anyone know how make it work?
could anyone share with me a resource to setup a simple listen server so other players can join my game?
OpenLevel with ?listen option is basically enough. If your ports are open and the other person knows your IP, then a simple open IPADDRESS in the console would work
what's the best way to persist player choices in lobby before seamless travel to game map?
put them in playerstate
copy properties over
and its best just because its by far the simplest
what about SeamlessTravelTo(NewPlayerState) ?
I don't know if this is the right channel to ask this but how would I move my "dedicated server"(Just local host right now) to a actual vps such as DigitalOcean? I followed a tutorial on how to make a dedicated server but that only works for your own IP and not another one.
if you have different PS class for lobby/game @warped berry
make a base with all the members holding the data that needs to be transferred between the levels
and override CopyProperties to copy it over
if its the same class, just overriding CopyProperties is sufficient
server will have all the info the lobby PS had and Copyied over before it attempts to spawn a pawn for the player
sounds great, thank you @winged badger , will try it
but I've seen people in answers hub say that I cannot make those variables BlueprintReadWrite but idk why is that
you don't technically need the common base for PSs, but its a much more elegant approach
what variables?
the ones i want to persist on seamless travel
it doesn't matter one bit
it doesn't even matter if its UPROPERTY if you're overriding the COpyProperties in c++
ok, so those variables do not replicate by default, i have to make them replicate myself?
i mean since PS is replicated on its own
if you need them replicated yes
okay thanks again
is there any performance penalty for doing like
calling 40 rpc functions
as opposed to calling one rpc function handling 40 things?
like are RPCs batched?
they are not batched
but you can do it manually
aggregate the related data and RPC once instead of a dozen times
You just saved my futur self what a hero of time !! Thanks a lot ! 
I used CopyProperties in C++ PlayerState to copy a string value during seamless travel but only the host(listen server) is able to persist it when map changes, client's version still hold the default value, what am i missing ?
anyone can give me heads up?
@dark edge @hollow saffron
I got it working on server and all clients.
Here is what I came up with. I am checking for input change so it should not be bad. Again I need these inputs to tell animation what direction to go in. Than I will get curves (movement speed, yaw rotation and so on) of current animation and than do actual movement based on those curves.
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.
Alright so... I am just really struggling with this.
I have a controller which I need to unpossess its current pawn, do a setviewtargetwithblend over to another pawn, and then possess it.
Everything goes sort of alright, except that on the client (works fine on server) the newly possessed pawn rotates to match the controller/old pawn orientation from BEFORE the setviewtargetwithblend.
Does anyone know what the hell I'm doing wrong? Because this is really frustrating haha
The player controller's viewtarget is replicated?
Hey guys, I got a question.
I know that I have to be using a source build of Unreal in order to use the dedicated server method
But do I really have to give up the ability to use any blueprints?
If so, I almost only ever see tutorials for blueprints, is there a site that shows you the methods which appear in blueprint nodes, and how to access them in a C++ IDE?
For example, this node: https://docs.unrealengine.com/en-US/BlueprintAPI/Utilities/GetCommandLine/index.html
Get Command Line
If you wanna know BP to C++ for the IDE then you can just search what you need with the word C++ and UE4 and it'll appear in a google search
Returns the command line that the process was launched with.
Usually they are named similar or the same as the BP one indeed
But yeah, Dedi Server doesn't stop you from using BPs, not at all
You must have a C++ project that can support server-client multiplayer gameplay.
If you are using a Blueprintb project, you will need to convert it to a C++ project before you can proceed.
Then what does this mean?
Dedicated Server needs C++ to be compiled in the first place :p
It doesn't come out of the box, so you just need to compile it yourself to use it shortly
Okay, I'm glad to hear that although I'm still confused about what that blurb from the unreal documentation means
I have a friend and he's never programmed before (and this is my first unreal project) so I was like "Man, is he really gonna have to deal with pointers? That'd suck."
That's the definition of converting BP to C++ they are referring to in the docs
Yeah, pretty weird wording tbh
Yeah it is. I think what's happening is that for some reason, when I perform an unpossess and then possess the new pawn, the controller seems to revert to whatever its rotation was before the setviewtargetwithblend
I appreciate the help, but this is already starting to go over my head.
Good to know that when I start the project I can use Blueprints though
I believe it does. I did a project a week and half back and I was switching characters at runtime. I did notice for some reason the rotation was being reset.
I to was using setviewtargetwithblend
That's super annoying... I really want this transition between the original pawn and the new pawn to be smooth...
Anyone have any suggestions or ways they've tackled something like this in multiplayer? Like I said, works fine on the server and in single-player. Just on the client that it doesn't want to function.
You don't need to compile a dedicated server to test it in the first place, Editor has the testing options out of the box for you :p
Just take it slow and steady and learn what you need, experiment, have fun especially
Correct I just graduated college and I was working full-time while I was going to college so I was non-stop work work work.
Now I'm doing this project for fun with a friend to learn and to push myself to create something.
I've never created a multiplayer network game before and I want to create one which uses docker architecture to only spin up exactly as many servers as it needs.
I'm being a software professional enforcing my friend and I to follow a very loose Sprint schedule.
The Sprint for me was to get a dedicated server that we could connect to, even if we can't do anything, up and running.
If scrum becomes unfun, I will pick fun
For his sake more than mine lmao
Grats for graduating!
My advice is to learn Replication first of all if you don't know it already, have it all work in the integrated Engine Dedicated Server option then look on how to Compile one and perhaps push it on a platform where you and your friend can connect together ^^
Is it possible to use the same logic in the game for assuming that I am the server (client listen server i think?) and then still build it to work with a dedicated server?
Or would that be a significant amount of tech debt?
Listen is just you being the Server in the end
Cool
Dedicated is just a server without physical presence
headless in other words
All animations should just play on client machines right?
That's what is assume.
One of the things that will be weird to me will be making two visual effects for everything
One that the player sees when they do it, and one that everyone else sees.
E.G. when Ashe throws her dynamite in Overwatch, her animation is only for her. And she can't see the one everybody else does. Only sees the dynamite when it spawns in the scene.
Same with muzzle flash.
Animations are run on Client, it's up to you to decide which ones are Replicated
So you could see yourself doing an animations but everyone else sees you just standing still
Well, none.
The event of ThrowDynamite is broadcasted to all clients with the owner of that event, and the client's play the animation on that player.
But if it's the same player as casted throw dynamite they'll only see their first person animation.
That's how I imagine it at least.
Usually in FPS, First Person has a separate model vs Third Person and UE4 enables you to only see First Person one on yourself
If First Person = Third Person then time to get creative!
That's true haha.
I've done some basic replication using the 2 player play mode in editor.
It can be done in a multitude of ways, from AnimBPs to Anim Montages etc etc
It's just about getting there
I'm trying to change the walk speed of a pawn and I need to do it on the server so that it replicates to all clients but when ever I try to run any server custom event I get:
"No owning connection for actor BP_PlayerShip_2. Function SetSpeed_Server will not be processed."
but i don't want the ship to have an owner i want the server to own it so how do i change the speed?
I'm using steam sessions, a friend opened my setup and he could make and join sessions, but I can only make them
What type of pawn is it?
hi pls help i make characther selection it works but when i moved the characther they dont play that anination they just play idle and this characther is acopy from the main one but main one does work plss help
btw this is multiplayer
not single player
character
You won't get around setting an owner then. Server RPCa won't work otherwise.
Or you need to run the RPC through another actor that is owned.
I have very little knowledge of how networking works but maybe someone can help me. I have a UObject which I think ive extended to replicate like an AActor (used this resource https://jambax.co.uk/replicating-uobjects/). I keep getting freezes however which is a bit annoying to say the least. The blueprint only freezes when I'm running everything up to and including SetFormation. Both RankCount and FileCount is set to replicate. Can someone see where I'm going wrong (I know there is probably a lot).
void UMWUnitManager::SetFormation(int Ranks)
{
RankCount = Ranks;
FileCount = UnitEntities.Num() / Ranks;
}
Replicating UObjects is pretty tricky and error-prone, to be honest I'd only advise it as a last resort when a standalone actor or component won't do the job.
I say this as the person who wrote that ๐
Also potential divide by zero there
Also as that page says you have to replicate the UObject instance itself via an actor, they can't be replicated independently.
๐ Yes I did read that you had said it was better to use an AActor but for my use case it didn't seem necessary to use the AActor class. You are also correct in saying that there was the potential to divide by zero - this of course was exactly what it was doing...
These UObjects will always be linked with an AActor so I thought that would be fine. Idk in the future I might change this all up because I want these UObjects to be inside another UObject idk how it gonna work
Just beware of premature optimization, the only reason I originally setup that code was because I needed to subclass inventory slots - but if you can reduce it down to just data, like an array of structs, it's probably better in the long run.
Well maybe you can help me because this UObject is basically a controller for an array of AI characters which are all spawned on the server this object is created with them and then passed back to the character and set. Is it necessary for the replication or is there another way?
If it's just an array of controllers, why does it need to exist in a separate object? Can that not just be stored in some global state actor?
It's not an array of controllers, it is an array of characters references. The UObject (UnitManager) is almost like a controller where the player set formations, tell the whole unit to move to a location, attack, defend etc.
The player of course could have many of these and thats why in the future I think im gonna add another UObject which stores these and can do macro commands to the units
If it were me I would just avoid that overhead altogether and just group them arbitrarily to be honest, but obvs without knowing the project I can't say
It's an RTS game, each player will have an army and the army has n number of units. All these units can be controlled individually by the player and have x amount of AI characters that can fight etc.
I'm only working on the unit control at the moment so I spawn 20 of these AI characters for example add them to this unit object which is the UnitManager (i.e. the interface for the player to control this unit by) because although I want the AI characters to interact some what individually in most cases I want them to act like a single entity. The AI characters can be different but every character in a unit will be the same for example, melee or ranged.
This is similar to Total War
Don't know whether that was helpful ๐
Why is my clients not having debugging? Not even "AddOnScreenDebugMessage" works.
How complex are these individual units?
Unit or AI character?
AI character - unsure as of yet how complex they would become but they will have to fight and move at minimum.
Unit - well they will handle player commands like forming the characters into formations, telling each character to walk, run or attack etc.
Instead of sending over UObjects or Actors, I would send over a string (Command Name) and value pair over the network.
Like for my inventory system. Its all Data orientated. If I wan't a certain inventory synced I just set it to sync with a bool. Than when I add or remove item I just send Inventory ID along with Item ID or Item Slot Index. Depends on the situation.
I think I see what you are saying....
You could map controller with a TMap (Map in blueprints). Have ID as Key and Controller as Value. Than over the network send singles to which ID the unit is using.
Are you using any C++?
You would just need a way to identify the Units with a FName variable.
So instead of setting the unit manager I just return like an ID for each unit instead of the whole unit
^^
The spawn unit spawns the characters then adds them into a new UnitManager which is returned as a reference and set for the player
Yes. Do you know of GameInstanceSubSystems?
no I hardly know RPCs and replication ๐
A subsystem is one instance per client and server. It can hold data and logic and can be accessed anywhere. You make it in C++. I can try and wiip you up somthing to get started.
I use these for each part of my game.
why do I need something like this though?
I can even try and provide a simple networking example in it.
Because it is created and unloaded when game starts and ends for you. You don't need a reference to it like your doing. Its easier to get access to it in code and blueprints.
^^^^^
Think of it as a global singleton
A world subsystem is probably a better fit for this case
But Subsystems can't have network functionality natively, so you're still back to using an actor for some part of the networking.
Having an "AUnitManager" actor for each team doesn't seem outside the realms of sensibility
True but the subsystem can act as a wrapper and you won't need to think of having a reference to it because it hold a reference to it.
yes but players will have multiple unit managers
I think either way having each unit be it's own object still seems like overkill for something that is just conceptual
In theory, each controllable unit will just have an integer value which determines what "group" it's in - and the group arrays can be locally maintained on each machine from that.
AKA take the simplest approach first, then add complexity as you need it
NexussOG you should research this game called Manor Lords. Its a toltal war like game being made in Unreal. Each Unit is its own entity but in return the battles are smaller than toltal war since it would be to resource intensive.
But they are grouped together when fighting.
Does anyone know how to enable debugging for clients?
Clients have their own worlds etc, they have to draw their own debug stuff locally
debug messages always draw to the primary viewport though
I believe I am doing that.
https://pastebin.com/HatcMfY0
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.
I am using Character->GetWorld()
I know about this game and yes something like that is what I'm going for but I'm going for something on the scale of total war but have the characters have their own decision making honestly sounds impossible at this point.
of course i'd be able to turn off some decision making if necessary at the time and let the manager handle it
Probaly for Unreal yha. Even drawing that much characters would be really hard. My current project lags around 230 characters.
๐คฆ
That is why he groups them when fighting because CPU running on each character would be crazy. Plus each sending controller data over a network. I think that is crazy.
Having bad performance with 200 characters is completely normal, it's a full-featured AAA player character class
Autonomous decision making is not the costly part here
just CMC's check for overlaps takes a huge chunk of your CPU budget
^
Well yes but when I move 200 characters my ms in cpu go up about 8. Its basic movement to points on a map.
Ok I see. Sorry I feel a bit dumb now lol.
The real reason to centralize decision making for your AI is that
- it's player driven so it only needs one networking entry
- it's easier to have the server compute decisions and broadcast them through replication
But him rendering that many characters without a instancing would be a problem alone.
for a RTS if using vanilla unreal networking you'd generally want to group 20 or so soldiers into a single unit actor
you don't want to be evaluating 500 actors for replication either, if you can get away with 25
Toltal war has over thousand, several thousand per fight.
total war is on a custom engine designed to do just that
thats been in development for what 15, 20 years now?
So that is why I am saying that if he tried to render that many characters he run into problems.
render is also not a problem
^
you can have niagara fake a million units really
your 2 chokepoints are movement and evaluating actors for replication
And you're probably going to run into the first one of those first.
You can see for yourself by just spawning a ton of randomly moving AI and profiling it. Sweeping movement from the CMC is stupid.
what you can do is have a Unit/Squad/Company Pawn
that has its own AIController handling what its 20 SkeletalMeshes are doing
1 Pawn = 20 Soldiers
and while it takes a bit of work to write that Pawn right, it should have acceptable performance
does the pawn class not use CMC then?
CMC is designed for the character class. CharacterMovementComponent.
then you can think of Total War not as using 1200 soldiers, but using 30 unit Pawns instead
and suddenly its not as intimidating
You don't want CMC in anything but a shooter
But he said he want's them to be individual as well
That is why I told him about Maner Lords and why they that dev chose small numbers. Because each unit is individual and grouped.
can you explain how I'm supposed to control the movements of the 30 unit pawns?
bottom line - it doesn't matter if the soldiers are individual or not, if the player thinks they are
it does matter for performance
if the player thinks they are this is what I'm trying to get. Problem with 30 unit pawns if I then have a first person player movign around and trying to fight these. then what.
The point is, if you have 4 players with high level commands, it doesn't make sense to replicate anything but these high level commands
If you can actually control 30 pawns individually, maybe you just want to replicate "unit 4 of group B goes there"
The unit doesn't need to actually be an actor or independent object
It certainly doesn't need to replicate
or use CMC
The granularity of your unit depends on how good its individual movement has to be
If it has to performs sweep, climb above obstacles or that kind of stuff, well..........
Total War units are dumb
So creating a unit controller as a pawn which then has many meshes inside is the way to go?
It's definitely one performance-sensible way
As long as the units stay kind of together and make sense
unless you want to go on a crazy half a decade long engine exploration like GlassBeaver
๐
We don't speak of GlassBeaver
and basically turn unreal into a half-custom engine
I need to watch that again.
honestly think my brain might explode if I try writing this
because you are trying to account for all the steps you need at the same time
atm
you can't, and you'll run into plenty of dead ends
before you get it right
You feel like that now. Do some simpler stuff. Mess around with performance metrics. Believe me, stuff that felt overwhelming last month will seem easier.
also, if its BP only, i'd recommend going for a side-scroller instead
nah its cpp i just have some in BP
Like my teachers said. Break things down into small steps. Someone mentioned above to group units based on a integer. Do that first. Have Debug draw a color over the units head to see what group there in.
instead of trying to do skeletal meshes, do spheres with arrow components pointing forward
You could use a pawn but that is how I would do it.
or capsules
for prototying or real game?
You could even just render the capsule in code. No need for components.
DrawDebugCapsule(GetWorld(), Lcation, Height * 0.5f, Radius, Rotation, FColor::Green, false, -1, 0, 1.5f);
prototyping
Even a arrow can be drawing with DrawDebug
i was gonna say thats a bit too much performance ๐
Nahh honestly definitely gonna be fine doing this just time to delete some code...
I'm trying to get seamless travel to work in a PIE session using the listen server configuration. I have 'use single process' disabled, but still get the 'Seamless travel unsupported in single process PIE' error. The Play as Client netmode works fine. Any ideas?
seamless travel doesn't work in PIE
It does seem to work, just only in a very specific configuration (dedicated server + multiple processes). Given how much Epic favors this approach to travelling, it's odd to me that the PIE workflow is so compromised.
PIE is a very special case, lots of stuff behaves weirdly there
Multiple processes is basically not really PIE
It's more like right-clicking the uproject + launch, except with auto join
Is there a way to use the editor session as a dedicated server for two clients in different processes? I'm trying to understand the iteration loop. For example, how would you debug server-side blueprint code?
honestly, by having enough c++ to debug from there
Fair enough
we also have our game levels in PIE set so we can fake around the fact players weren't in a lobby prior
so MP in PIE, even single instance behaves like a packaged game level
(at least for most stuff that matters)
For sure
In seamless travel, would the server handle CopyProperties in all player states or each client would call his own?
Server does it
Hey just in case you're curious or have this issue again. I found this post from back in 2014 which completely fixed the issue! https://answers.unrealengine.com/questions/124855/what-can-change-the-rotation-of-a-newly-possessed.html
Wow thanks so much.
Im trying to seamlessly travel from lobby to gameplay map but only the host's data make it to the gameplay level, the client is set to default value!
The properties need to be replicated of course. Seamless travel doesn't keep the same player state, a new actor is created so any client-only data will be lost.
If you need to preserve data client-side during a travel then you may need to keep it elsewhere.
Some folks use game instance for that
so the player state being replicated to all clients by default does not guarantee that the sever would copy it for the clients?
If the data you want to preserve only exists on the client then it will be dropped, server won't have any clue about it
copying props between actors for seamless travel only occurs on the server essentially
okay so then when i make them replicated, it should be changed on server first through server RPC ?
Basicaly if you want client-only data to persist through seamless travel, move it out of the playerstate would be the best way
Put it in some object which doesn't get destroyed with the world
This may seem like a weird question but with context I hope it makes sense.
Is a FVector2 var more bloat than if I were to make a custom struct with just 2 floats. I ask this is because when I used Unity they made a big deal when DOTS first came out that they made a new math library. In it was float2, float3, and float4. They said it gave better performance than using Vector2,Vector3,and Vector4. I am sending a FVector2 over network and I was wondering if I am better off making custom float2 struct.
No point wasting bandwidth on replicated properties if they don't need to be replicated ultimately ๐
@peak pollen will be exactly the same cost
Thank you.
but what if it's not client-only data,, like a player team or character type, what's the best way to persist through seamless travel?
In which case then yeah you should set it on the Server, but in practice you'd be doing that anyway right? Otherwise how would the server know what character or team to put them on?
Thanks for the explanation. I found it annoying in the Unity 3-4 days where I could not use new .Net stuff and was confused why Unity would do such a thing.
yea true I would do it on server ofc, but then player state would be a good place for such setup?, I just wanna make use of seamless travel
Yeah in that instance it would probably make sense yeah
thank you for your time, I will try it
Ok I swear I'm not an idiot... Does anyone know why casting this AI Controller is failing on the server but not the client? I have the AIControllerClass set to the proper class, but it just keeps failing.
do it as a custom event run on server
also it depends what class this is you're running it from
I'm using steam subsystem and in the editor I can create sessions when playing in the editor but I can't join them. A friend opened the project in the editor and he could create sessions and join sessions without issue when playing in the editor with the very same code/setup I made.
Any idea what's happening
I use steam OSS as well and I never was able to test steam in the editor, it doesn't work as expected when it detects the editor
it shuts itself down
I'm trying to better understand the behavior of "Net Load on Client". I have a couple of actors where I disabled it. On one, the actor static mesh loads and displays as expected (on the client). On another, it just appears as a grey bounding box (in the correct position though). My understanding is that if the param is disabled (false), the object should not be loaded with the level but will still ultimately appear on the client if the object is configured to replicate. Is that wrong?
Unfortunately, same issue... It's also all occurring in the same class where I've set the AI Controller Class. Is there maybe a setting I'm missing somewhere which would cause this to not work?
Don't think there is but for the most part : no sessions, no seamless travel (except in multiprocess maybe ?), some things are shared like debug prints are shared on every viewport in single process because it goes through GEngine, etc
Well, it doesn't work doing this in the pawn's blueprint. But I did a sort of "work-around." Essentially just used the OnPossess event in the AI controller to achieve what I wanted, because I could see that it was possessing the proper pawn.
Can i safely call a multicast implementation on the server?
every time i've seen "peoples cant run 500 or more CMC/AI/Players in a map with stable performance" What this actually mean then?
I just spawned 500 ai there.
even 2700x mid range CPU that im using
even i able to get 500 fps if i do tick optimizations within 100~ ai in a MOBA map

Everybody talkin 'like it's a hardest thing
So your 500 CMC ran run and skeletal meshes can render in a listen server model without any performance impact on average computers?
Now run them all with layered animations etc
never tried listen server so idk
Also looks like you are using TPS/FPS camera, its easier to manage lods, even the movement tick frequency based on rendering data
Try a top-down angle
thats means narrower field of view and more FPS.
LODs and render things not related about game thread
its already running standard AnimBP that comes with mannequin. also animbps running with multithreaded
thats means narrower field of view and more FPS.
I barely can get 60fps on RX570 with 50 characters (2k vertex, cheap material, very cheap c++ animbp)
LODs and render things not related about game thread
Idk the technical details, whenever any of my threads cost CPU power they all rise together, mainly CMC causes that and when rendering is too costly CMC also rises with render thread
Anyway not in intention to argue, good job if you could run it
My ryzen 2600 and rx570 cant handle 50+ CMC with 4 players + listen server
Since also my AI and rendering thread also consumes a lot of CPU
Especially hosting player goes crazy
disable your cmc then :D
I have 20 CMC limit max and 50 FloatingPawnMovement limit for my AIs
i am happy with that performance even server side
Is multiplayer world origin rebasing a thing?
This is for a coop spaceship roguelike in 2d. Either a square playfield or spherical one.
Right now I've got a large spherical playfield feeling pretty good without rebasing but if it's easy, rebasing might help.
I've setup a listen server like this, but for some reason AddMovementInput looks like this:
https://www.youtube.com/watch?v=GEia6qYGfqw this is how the movement input looks with a listen server
Hi, Is there a way to determine if the level your on is a listen server?
Never mind. I found GetWorld()->GetNetMode()
Hello, can someone point me to a right direction? I would want to implement origin shifting with multiplayer. How would I do it? Like the basic idea
I have lobby where players can choose a character, when a player chooses a character I want to lock it from other clients, so now I have a server RPC to check if the player can choose this character or not,,, THEN what would be better: sending back a multicast to lock that choice on other clients or just make that property replicated?
Merged. Hello everyone. Probably everyone knows about floating point precision issues with big worlds in UE4. Sometimes some jitter (anims, camera) starts to appear only 2-4 km from origin (especially noticeable in first person games). Since UE4 uses single point precision - only possible way to fix it is using world origin shifting. But it n...
I'd say replicate the property and use a Rep Notify would be better practice than multicast
Uh what? None of that has anything to do with AddMovementInput
I guess I can take a look at that ๐ thanks
Repnotify is the answer pretty much any time it can fit the design. Make things state driven when at all possible.
The video below the image shows jittery movement, I don't know if it's because of the listen server
What's the path between the input and AddMovementInput?
Just key value into AddMovementInput or are you doing anything weird?
{
AddMovementInput(FVector(1.0f, 0.0f, 0.0f), InputValue);
}
``` key input calls this
@twin juniper @dark edge yea but at first I thought replicating could be congesting network since it just changes once when the player chooses it
Either way you need to replicate the choice. It's the difference between having replicated DATA (Player A's character is Wario) vs a replicated EVENT (Hey everyone, Player A has chosen Wario, please remember that) for tons of reasons. If a player joined the game after the choice was made, they're be out of sync if you used events but in sync if you used repnotify.
That same pattern applies all over the place. Replicate the fact that the door IS open, not the opening event. So later when someone comes into relevancy range or joins the game, they see the door open even though they weren't around when it was first opened.
oh I missed on that, I'm still a noob xd,,, but yea that makes total sense to me, thank you
but if I'm storing this data on the server and have newly joined players check on them, would it still be better to replicate?
That's exactly what replicating the data and using repnotify handles. New player joining and player coming into replication range and the action just now happening all are the same. Read up on RepNotify.
It's pretty rare that you need a multicast RPC
An overview of the Network Features example level, example 1.4: Variable Replication (RepNotify).
my listen server is spawning a pawn since it uses the same game mode pawn class as clients, is there a way to avoid spawning the pawn if it's the listen server?
@twin juniper Uh, doesn't the listen server have a player playing at it?
What do you want the player on the listen server to be doing?
I didn't know the listen server could be a player too
That's exactly what a listen server is. Client + host
Listen server has a local player, dedicated server does not
Like old school Halo would have been done with listen servers, one player is the host.
the listen server is not executing client RPCs code though
is there a way to identify the listen server? something like if (IsListenServer()) {...}
you can GetNetMode() and compare if it equals NM_ListenServer
if you just wanna know if this instance of the game is a listen server or not just check on the net mode
if(GetNetMode() == NM_ListenServer)
if it's true for all, then each one of them is a separate listen server and they're not connected on the same server
but they can see each other so I'm pretty sure it's the same server, this is how the listen server is created and how the players enter the server
@twin juniper every instance that clicks the start game button will launch a listen server, whatever instance clicks the join game button will join the listen server on localhost. If there are multiple listing service open, I don't know what will happen.
I'm only opening one listen server
There is effectively no difference between a listing server with only the local player on it, and playing standalone.
So what is the problem?
That this code: if (GetNetMode() == NM_ListenServer && GetLocalRole() == ROLE_Authority) is true for all clients, I need a way to identify which pawn/controller/player state/etc are the ones given to the listen server by the game mode
Cmd: Net PktLag = 5000
Command not recognized: Net PktLag = 5000
how can I now simulate lag ?
You don't game from the LaGrange points?
5000 ping is what you would have if your server was hosted, like, out beyond the moon
Moon I think is about 2.5 secs round trip, so 5 seconds is like twice the distance.
(remember you can fit all the other planets in solar system into the gap between earth and moon)
@silk abyss that's why I said beyond the moon LOL should cover for pings from 2500 milliseconds to 1 billion years
Hey so I just started unreal, like just just started (like a week ago) coming from unity, I'm trying to understand the multiplayer thing, I've been stuck for an hour on the replication of spawning an actor and I swear I'm going to bang my head on my table
I can spawn it from the server and it shows on the client, but if I spawn it on the client, it only shows on the client, even though I'm using an RPC on the server
I do have to point out that starting with multiplayer when you just started with ue4 is a bit crazy :P
The ServerRPC needs to run in a client owned Actor. Otherwise it's dropped.
Read the compendium that is pinned to this channel about multiplayer, replication and ownership
@tough phoenix
it is in a client owned actor (i believe)
and idk i thought it would be as easy as unity lol
you just type in "Network.Instantiate" and it goes to everyone
Yeah but unity is not ue4. You might not be able to utilize any of the knowledge from coding in unity when doing ue4
Can you show me how you spawn the gun
Is that happening on the server?
the gun spawn?
Yes
i can see the gun through both client and server, so I guess (?)
But either way you need to specify the owner pin on the spawn actor node
It's hidden so you need to expand the bode at the bottom
No
this ?
Best would be the controller that controls the character.
But idk where you are calling the spawn code, so try self
ok ill try using that wait a sec