#multiplayer
1 messages · Page 200 of 1
there could be a case where the player is moving so darn fast maybe it's worth predicting them opening the door to avoid corrections
Currently working on projectiles atm. Right now the client sort of say, I hit this person. Trust me bro. Which is okay for my use case but I want to have some treshold before the server says. Nah you are too laggy, your request will not be proccessed
there are a few different aspects to consider here that I consider distinct parts
The act of shooting from your local client is generally predicted and simulated locally by most games... which sure beats the alternative of quake 1 style leading your shots
okay, so now you send that information to the server... what does the server need to do?
I guess server can roll back and simulate in his machine based on the timestamp. Also check if the shoots are possible. Right now, I am skipping those check just to see if the game is tolerable under high ping.
Oh and I'm spawning the projectile locally in each client... so I think each machine may see different results based on their latency... not sure how to tackle this for slow moving projectile
what you would need to do to have a threshhold imo
is to know where the player was roughty when the shot happened
and be able to get a fuzzy idea of if the simulation they proposed made sense in context
🙇♂️
this is mostly me talking from how I would approach it, I've never fully implemented something like this myself
making everything 1:1 is going to be difficult... Valorant actually does this and they basically had to completely replace how unreal animations work to rollback skeletal mesh state lol
If you use C++ I learned a method using a TDoubleLinkedList variable to save 1 second of hitboxes on the character and if the clients hit it would rewind the timestamp to the frame saved hitboxes and run another line trace to confirm but since then someone else told me to look into sparse arrays and I haven't yet
Also Unreal has a component for predicted projectiles
There's an engine type FPredictProjectileParams that's not custom and a few functions I use with it to locally predict the entire path
hello, if i were to make a multiplayer RTS, what would be the best way to replicate stuff? can unreal handle replicating thousands of units reliably? or is it better to replicate commands and simulate everything on every client? are there any other solutions?
Pretty much every RTS is going to only send commands and simulate them.
UE is not designed out of the box to support RTS games.
Their network requirements are massively different to FPS games (which it is designed for).
yeah, fair
reason i was asking is because if a player disconnects youd probably have to resimulate everything up to current time right?
Im not going to speculate on what you may or may not need to do for an RTS game, you may as well be asking how long is a piece of string.
Maybe you should try architecting these things yourself and see how far you can get.
You will learn much more that way, then asking broad questions here.
It takes years and years to build these types of games.
alright, i will keep that in mind
Is there a way to increase the server's "tolerance" for the difference between client and server movement? My character is moving fast enough to cause prediction errors, but I seem to be transmitting data correctly, using flags, applying Velocity correctly, etc.
You're looking for this section of the CMC. For example the two SmoothUpdateDistance properties should usually be near your actual max movement speed or a bit above.
I looked at this section and didn't even guess that if I exceed the maximum speed of the smooth update, it won't be executed, although it's logical... Thank you very much!
Where to store players XP in multiplayer game, in character or player state?
Where ever make sense for your game.
If you look at red alert, each unit have exp of their own. And it's not like they can get revived so it make sense to have it on the character
You are asking for something that really depends on your project needs
I have like logic where whenever player deals a a damage, he receives 1 xp per 1 damage, from server function, but i want to keep players xp if it dies
I am new at ue
if you want to keep it persistently then probably their player state?
If you have to ask that, you shouldn't do mmorpg
.
until game becomes super successful and starts to overload your system there is no real diff what DB you will use. For now you can choose from sql vs nosql
sqlite
i am using PlayerState for my AIs because they have shared functionality with players
could this cause some performance lose since playerstates are always relevant ?
maybe i should try to move the functionality somewhere else like the Pawn
(in my game Pawn is never destroyed, so switching to Pawn doesnt impact the design idea)
and since the PS have a ASC, the current net update frequency is 100
i aim to have around 20 playerstates max in a single game (players + AIs)
if it does you can override relevancy behavior for AI PS (mb introduce extra baseclass)
all AI behavior is that important? then what's the question? you just have to have it in PS.
also relevancy is flexible thing, e.g. "distance" feature, it won't introduce lagginess though reduce overall load
can someone help me with that?? how to make it replicated???
Widgets don't replicate
ok so how to replicate it
Not sure if this should be here or in Blueprints but it is for multiplayer so here goes. (Context: turn-based multiplayer ability/action) when selecting an ability/action is it best to spawn a separate actor with collision and a decal for target previewing on the player controller for owning client and pass through a location/transform and class for the server to spawn effects/tags on targets etc.... or should the spawned actor be run on the server from the player controller and looped through by the server for with actors of class to spawn effects/tags and show/hide the decal as appropriate... TLDR - should spell previews be a seperate actor or not from the ability/action?
did you know how to do it???
XY problem
XY?
Kinda proves his point
???
describe case in few words e.g. Player does X, server does Y, then it's expected Z on client
from Player's perspective, not in terms of your current code
Widgets only exist locally for each client. Replicated events do nothing on widgets. And posting a video moving all around is quite annoying
Provide some context of what you want to achieve
i know bro but what can i do lol i thnik thats the problem is the replication of widget anyway
i want to make a replicated quest system if you know a video tutorial...
cause i follow a tutorial which is made not in multiplayer...
and i think i can do it myself :/
first make it as State (data), then replicate to client, and only then it make sense to tie it with UI
So APawn::NotifyControllerChanged should be called on both server and clients according to the comments above it. However for the clients there is a check inside APawn::OnRep_Controller (where NotifyControllerChanged is being called from) to see if the controller did not have any pawns before possessing the current one. This causes possessing another pawn to not recieve the NotifyControllerChanged call on clients, since setting the pawn inside the controller to null isn't being replicated, as it's being set to another value in same frame. Is this a bug or are we users supposed to be aware of this and implement our logic accordingly?
oof, single vs multi is a huge diff
i know
and you can't even blame author of tutorial, it's just has different goals
i didnt blame someone just said i follow a non multioplayer tutorial
With the mindset i can do it myself the replication
did you know a replicated quest system tutorial
?
learn about replication (properties + RPC) then things may become more clear
it has nothing to do with quest system, quest is just a bunch of data (mostly primitives e.g. numbers, text, bools etc)
- RPC ("client <-> server" actions)
also I guess you have to implement some kind of persistent storage on server to keep players progress. (Database)
i think no cause its a small horror game with start and end
anyhow thanks for respond ill rechech all of the code
- Player gets quest from npc (RPC client -> server)
- Server handles it, changes state, and state gets replicated to client.
- Quest is in progress, when client receives update it can reflect it on UI (OnRep_ callback may be useful)
The rest is kinda similar pattern e.g. client notifies about it's actions, server handles it, updates replicatable state, client receives updates and so son
can we make a small call to understand it better???
I believe when you start reading UE5 networking docs it will make sense for you
I am trying to replicate jetpacking using a custom movement mode, but I don't understand why I get server network correction just few minutes after the player starts jetpacking. Should I change the way I apply the force on the Z axis to the player ?
void UEsLyraCharacterMovementComponent::PhysJetpacking(float deltaTime, int32 Iterations)
{
if (deltaTime < MIN_TICK_TIME)
{
return;
}
/* Amount of resource in seconds needed to use the jetpack for this round */
bool bIsJetpackResourceEnough = false;
if(IsValid(JetpackComponent))
{
const float MaxJetpackResource = JetpackComponent->GetMaxJetpackResource();
const float ResourceNeededForJetpacking = deltaTime / MaxJetpackResource;
bIsJetpackResourceEnough = JetpackComponent->GetJetpackResource() >= ResourceNeededForJetpacking;
}
if ((!Safe_bWantsToUseJetpack || !bIsJetpackResourceEnough ) && CharacterOwner->GetLocalRole() != ROLE_SimulatedProxy)
{
UE_LOG(LogTemp, Warning, TEXT("Trying to cancel jetpack ability"));
Safe_bWantsToUseJetpack = false;
if(!CancelJetpackGameplayAbility())
{
UE_LOG(LogTemp, Warning, TEXT("Jetpack ability wasn't canceled"));
}
SetMovementMode(EMovementMode::MOVE_Falling);
StartNewPhysics(deltaTime, Iterations);
return;
}
Iterations++;
bJustTeleported = false;
CharacterOwner->LaunchCharacter( FVector(0,0, JetpackVelocity), false , true);
auto CurrentRotation = CharacterOwner->GetActorRotation().Quaternion();
FHitResult Hit(1.f);
FVector AdjustedLocation = Velocity * deltaTime; // x = v * dt
SafeMoveUpdatedComponent(AdjustedLocation, CurrentRotation, true, Hit);
}
YO YO YO I F-ING DID IT anyhow thanks for your time!

Hey, im in the process of trying to update my project to use the newest unreal version 5.4.3 and my previous version was 5.2.1 Im having a pinch of issues with compiling my network session code now
looks like some build in variables are now undeclared identifiers
I was wondering if anyone could tell me where the identifiers are defined now or if their names have changed?
a find in all files would likely help
previously all I needed to include was
#include "OnlineSubsystem.h"
well if you got away with it then unity builds were likely helping you out
I see these all defined in OnlineSessionNames.h and all I did was find in all files
Yeah that was my first idea was the recurse the search
and I included that already
but it didnt work
yeah can you be specific with didn't work
one moment
it's also in a plugin called OnlineBase
im halfway in between reading error messages
so that'll need to be included in Build.cs
thanks, thats all I needed was to include Online/OnlineSessionNames.h
my dumbass forgot to put the Online/ prefix on it
How do I invoke an RPC from owning client to server to multicast in order to change camera rotation. But skip setting the camera rotation for the owning client so that client can do it locally and not rely on server?
Where are you RPCing in?
The player controller
You Multicast in the PlayerController?
I somewhat expected you to write Character or Pawn
Sorry, the code to add input is in player controller, I set the camera rotation in the character
Right, so the Character has the Multicast?
Then just do "IsLocallyControlled -> False" and then apply the Rotation.
Why do you even need the Camera Rotation like that? Would "GetBaseAimRotation" be enough?
I'm using a quaternion to simulate zero-g camera control
instead of control rotation
Player Controller (adding input):
void AXKPlayerController::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(AXKPlayerController, QuatControlRotation);
}
void AXKPlayerController::AddQuatYawInput(float input)
{
const FRotator INPUT_ROTATOR = FRotator(0, input, 0);
QuatControlRotation *= INPUT_ROTATOR.Quaternion();
}
void AXKPlayerController::AddQuatPitchInput(float input)
{
const FRotator INPUT_ROTATOR = FRotator(input, 0, 0);
QuatControlRotation *= INPUT_ROTATOR.Quaternion();
}
You are doing things twice
You are already replicating the Rotation via DOREPLIFETIME and then you also use a Multicast.
The DOREPLIFETIME Part will already cause your Local Client to get the data back from the Server, which will jitter
You probably don't want to actively replicate the Quat
let me try that, I was wondering if it was better to just replicate the QuatControlRotation or only replicating the camera rotation
I mean it's two different things, cause replicating in the PlayerController won't reach SimProxies
What's the best approach to making an FPS where you see an "arms" viewmodel yourself (with dedicated animations), but the regular character model for everyone else?
There's suprisingly little resources about this
you can hide models from owner
Two SkeletalMeshComponents, one for the FP Arms, one for the TP Body.
Then the Booleans that haft posted.
"Owner" is a bit misleading, it's mostly the ViewTarget that controls this.
So if the Character is the ViewTarget, which it usually is in that case, it will work with those
There is also "OwnerOnlySee" for the FP Arms then
I thought you were talking about the net owner for a second
Na, which is why that boolean is shitty named
lol
If you spectate another player, and you make that Character the local player's ViewTarget, it will also hide the TP Body, which is usually wanted.
So if I have a weapon actor, what do I attach it to? It can be picked up, dropped, and passed between players so spawning and despawning the actor(s) is not viable
I stopped replicating the quaternion and changed the bp to look like the screenshot. The player view seems fine with no stuttering but from other players perspective its flickering and not accurate
You attach it to TP Body on SimProxy and FP Arms on AutoProxy
Which you probably need C++ for, cause by default, Attachment is replicate, so whatever the Server uses as AttachTarget will replicate to everyone :P
I don't really understand proxys lol
But wouldn't that break the spectating thing you were talking about?
AutonomousProxy is the local Player that controls the Character
SimulatedProxy are the other Characters of other Players that the local one sees running around
Yes, needs some custom logic for that I guess
You should probably limit the Tick call to IsLocallyControlled
this hasn't really been much on the multiplayer side
Or maybe I could just always use the "real" actor in the world model and create a separate "viewmodel" actor
and I did work on a game with first person spectate
why do you need different actors? the first person mesh is just a separate component
makes sense :D that worked thank you!
Maybe I misunderstand how actor/component parenting works.
If I parent an actor which uses a mesh as it's base to an attachment point, won't all its components also follow it
If you parent an actor you basically parent its root component
In which case you'd need another actor to display on the viewmodel, which isn't connected to the world model
So yes, everything else follows
One Actor is absolutely enough for the Character
And then one Actor for the Weapon fwiw
still, why would you? thought I think in the end we may have just spawned a component at runtime and attach it to the hands mesh at runtime
but it's a while back now
But is it possible to parent the viewmodel component of the weapon to a different mesh & attachment point?
What is a ViewModel Component?
The component that is the viewmodel mesh
viewmodel is a term for 1st person meshes
Which we're saying doesn't need to be a different actor from the world model
I only know ViewModel from MVVM
well I'm familiar with the term from Goldsrc/Source
Either way, 2 Components with the OwnerNoSee and OwnerOnlySee that you can parent the Weapon to is enough
Can you parent the first person component to a different parent than the main actor?
One Character, 2 Components
I'm talking about the weapon here
though instead of the OwnerNoSee stuff, we ended up with an UpdateFirstPersonPerspective function that toggled visibility of meshes when the camera mode or view target changes
somewhat related, I'm looking forward to the FPS mesh stuff in 5.5
Yeah you can probably solve it in different ways .Depends on the game and needs. There are also cases where you don't have any spectating and you might as well just spawn the TP and FP Components runtime to not even have them exist if not needed.
Idk how your Weapon works. In most Games it's a separate Actor that one parents to the FP or TP MeshComp when equipped.
Another big consideration is that you can drop the weapons on the ground and they become physically simulated
There are, again, of course other ways fwiw
Yeah that's the plan
But you can only parent it to the first person or the third person model iirc
Not both
why not just attach the individual components to whatever parent you want?
Can you do that?
Cause then I could spawn a duplicate mesh component which is parented to the FP arms
Also, will OwnerNoSee work if the camera is in the parent actor?
o.o duplicate mesh Components?
Just parent it to FP or TP based on the IsLocallyControlled or not
And disable the default Attachment Relication fwiw
That breaks spectating tho
Or override it and handle it manually
Then reparent it when the player starts spectating..
It's all local anyway. The same frame you handle the viewtarget change, you can just change the attachment fwiw
Fair
If you pack that into some functions that do all of that based on some "IsViewTarget" or so logic, you can probably automize the whole stuff
UpdateWeaponAttachment -> IsValid(Weapon) -> IsViewTarget -> Attach to FP Mesh
/** Called when this actor becomes the given PlayerController's ViewTarget. Triggers the Blueprint event K2_OnBecomeViewTarget. */
ENGINE_API virtual void BecomeViewTarget( class APlayerController* PC );
/** Called when this actor is no longer the given PlayerController's ViewTarget. Also triggers the Blueprint event K2_OnEndViewTarget. */
ENGINE_API virtual void EndViewTarget( class APlayerController* PC );
/** Event called when this Actor becomes the view target for the given PlayerController. */
UFUNCTION(BlueprintImplementableEvent, meta=(DisplayName="OnBecomeViewTarget", ScriptName="OnBecomeViewTarget", Keywords="Activate Camera"), Category=Actor)
ENGINE_API void K2_OnBecomeViewTarget( class APlayerController* PC );
/** Event called when this Actor is no longer the view target for the given PlayerController. */
UFUNCTION(BlueprintImplementableEvent, meta=(DisplayName="OnEndViewTarget", ScriptName="OnEndViewTarget", Keywords="Deactivate Camera"), Category=Actor)
ENGINE_API void K2_OnEndViewTarget( class APlayerController* PC );
That's base AActor functions
And that just checks if the controller is looking through the owning pawn's camera?
ViewTarget is a concept of its own
It's what actually defines where your Camera Location originates from
The CameraComponent is just an offset + extra camera settings fwiw
Is there a way to set blendout time for montage preemptively, i need to do that for multiplayer replication, before stopping montage?
I already posted the answer to that
Oh doi
Although, a generic one, I would need to check
For the player in particular
Then just the functions I posted above
Generic there seems to be this FGameDelegates::Get().GetViewTargetChangedDelegate().Broadcast(PCOwner, OldViewTarget, NewTarget);
That's called in the same function as BecomeViewTarget
getting a lot of net corrections trying to use a root motion source for dashing (no GAS), with 1%pkt loss each way and 100ms. anyone know what I might've missed? I apply it locally, save off a flag into saved moves, then on the server apply it from the flag as well. it works most of the time but when i do get corrections they're pretty huge.
@thin stratus i saw a lot of messages from you a while ago having a similar issue (but using GAS), did you ever figure out how to avoid such violent corrections?
Well, 1% Package Loss is not what you should test with
So start by putting that back to 0
i mean setting it to 0 i get basically no net corrections at all, but do i really want to not test the game with any packet loss?
And then it was mostly due to the following factors:
- Start Location of the Character on Server and Client were not the same. We ended up sending the Server the Location we started the RMS with
- End Location of the RMS on Server and Client were not the same. That was mostly due to using teh Start Location to calculate the End Location. And with the Start Location being not 100% the same, the End Location wasn't either
- We had Latent Nodes that destroyed the Prediction Window in GAS, which we had to recreate. And then we had to additionally call "FlushServerMoves" on the CMC (had to be exposed to BPs for us) before the RMS
What do you expect from Package Loss being enabled?
A totally smooth game?
no, some hiccups probably
but for this specifically it almost seemed like it was doubling the distance of the dash
Package Loss is the worst case. The only reason you want to debug that is to ensure you don't soft-lock the player
You can't really fix Package Loss. For Movement, some Systems send additional older Input Packages to the Server, but for the time the Server didn't get the Input Package, it will just assume you kept doing the same as last Frame.
That's all just Band-Aid fixes for something that isn't really solvable.
hmm, okay. well it works fine with no loss, just thought i should be testing with some
It shouldn't result in anything different with Package Loss fwiw
Despite if you literally lose the package that started the whole thing from a key press
Cause then the Server never dashed and teleports you back fwiw
The only thing package loss should do is cause correction in general
i only get 1 player controller in the editor when playing 2 standalone games. any ideas?
both connect to the same world and has 2 characters but 1 controller
seems to only give control to whoever is hosting
@spice pebble That wouldn't make any sense. Why do you think there is only one PlayerController?
because when i try to control the second character there is no movement despite using the same class. & The world outliner shows only one controller
Keep in mind that every player always only has access to its own PlayerController
PlayerControllers are not replicated to other Clients
The Outline can be set to view different "worlds"
And you then join manually?
Your Outliner shows that it's currently displaying the Client - 1 World
Switch it over to the Server and you should see two PCs
i have set the net mode to listen as server and i still only have one
This is my joining code, could it be something to do with when i setup the local server
void ADLG_TemplateGameModeBase::BeginHostGame(bool IsLan)
{
if(IsLan)
{
//String Manipulation to get map asset location, prevents Hard coded Values
FString ServerLocation = "";
ServerLocation = _FallbackMap.ToSoftObjectPath().ToString();
ServerLocation.RemoveFromEnd("."+_FallbackMap.GetAssetName());
GetWorld()->ServerTravel(ServerLocation + "?listen");
GEngine->AddOnScreenDebugMessage(-1,5,FColor::Red,TEXT("SERVER HOSTED"));
}
}
void ADLG_TemplateGameModeBase::EndHostedGame()
{
//Exit All Players to Lobby Map and assign new host
}
void ADLG_TemplateGameModeBase::JoinGame(APlayerController* Player,bool IsLan)
{
if(Player)
{
Player->ClientTravel(_MyLocalIP,TRAVEL_Absolute);
GEngine->AddOnScreenDebugMessage(-1,5,FColor::Red,TEXT("Joining Game"));
}
}
You are still viewing Client 1
Or rather 0 in that case
ah i see, i do have both controllers, but one doesnt do anything when i select the viewport of it
and its the client character that doesnt move
There is only one PlayerController per Player
The Server has access to all
The Client only to its own
You can't see more than one PlayerController in the Outliner of a Client World
Unless you spawn local coop players fwiw
i see, thank you.
so i have mis identified my issue initially.
the issue is that both controllers possess their pawns. but one of them doesn't move.
(always the client)
when i try with 3 the two that are not hosting do not take input it seems
It appears that on the controller when BeginPlay is called and i set up the mapping context GetLocalPlayer() for all the joining controllers is NULL
well yeah... there's no local player for a remote player
so how should i be setting up player input for a controller if not local player
the server doesn't apply IMCs
the client willl
so BeginPlay is still appropriate, but the server doesn't need to do anything
i use that on the player controller, thats the only place i add mapping contexts, still the client doesnt have input
Hey, another day another question, maybe someone has a idea or tip 🙂 I have an actor (harvestable) that drop items (actually its a fixed item) but I want to implement a "loot" table where I can set two or three items with a chance. I actually thought I can set it up with a map where i can list items and chance but maps aren't replicatable. Otherwise the Server Run the Loot Event so this data hasnt to be replicated right? Is a map legit for such stuff?
its calling begin play twice for that actor in my debugger, i know one is for the Client and one is for the server, how can i stop this code firing on the server
Why does a loot table matter for clients? Client should interact with it, and get the item they looted replicated back to them. If you want to show the map on the client, it should be in static data somewhere related to the lootable. Shouldn't be a need to replicate the table I wouldn't think.
Yeah that was my second thought on it, only the server need it
replication is not neccesary
I mean you're setting that data on the object itself, so it's static data
everyone will have it anyway, but like said, you would decide the outcome on the server and process the loot there
I don't see why you'd need to do anything? Getting the subsystem will fail because there's no local player
But on the client, getting the subsystem will be fine since there is a local player
it physically doesn't let me have control of any clients.
then the problem is elsewhere. did you at least set a breakpoint on the AddMappingContext call?
it doesnt even get into the adding for the second controller because getting the local player is null
Is there a way to replicate only variables on an actor and not all of its other properties? I dont want the transform to be replicated to the clients i only want the variables to be replicated
well the default BeginPlay accesses the local player so I'm not sure this is true, but I'm not sure you checked what the net mode is or which client it is when your breakpoint hits
and now it's suddenly in OnPossess?
which only happens on the server?
and if this is only needed for when a pawn is possessed, you might as well override SetupInputComponent on the pawn and just set the IMC there
i shall try it in setup then
override SetupInputComponent on the pawn
though I'm still not sure why you won't debug it
it already is overridden by default. do i need to do anything in the override
yes, since that's usually where you'd set your action bindings and IMC
control for a character should be on the player controller though, thats what my uni lecturer taught us???
we should just call functions on the character from the controller
lol why?
because the characters can be destroyed, player controller shouldnt be
ok, i will try to figure a way out with that then
got a potentially really dumb question, but here it goes
does the mesh simply not scale correctly for actors in UE5? Even though I've turned the bool for replication on for both the capsule and the mesh, the mesh displays correctly only for one client (but not the other)
I'm doing this mostly in c++, blueprint in the back is mostly for quick tests and debugs
this is such a common misconception with the replication of components
having a component marked as replicated does not mean it'll suddenly replicate every property
it'll only replicate properties marked as Replicated
and scale isn't one of them
I'm aware, I simply assumed it would replicate transform properties
you will need an alternative means to replicate the scale and then set the scale of the mesh from an OnRep
will do. Had to ask for scale specifically 'cause I found some info on the net, where Epic staff themselves said they might address this, but I couldn't find whether or not they did address this at any point
so figured I'd ask here as well as couple of other places
well it's a pretty simple solve, and replicated movement only does position, rotation, and velocity
ye
I just had to make sure I'm not doing something wrong, and that this is the intended behavior
is there any reason a collider won't attach to a mesh on the server, either post init or begin play
not sure if a timing issue or I'm messing smth else up
ah ok, didn't have 'always tick pose /update bones' thingy checked
-----------------quick request
is there a better way to handle when new player joins the lobby ? for now , players are moving in lobby , but whenever someone joins , they restart at their current position
basically i want when new player to join , others wont have to restart /refresh at their position
works, thank you very much @lost inlet for confirming
still a bit peeved that 2/3 transform components replicate with no proper indication that the scale wouldn't
@dusk fableyour adding the new player to your array, then making everyone in the array restart. Why not do all of that but instead of making everyone in the array restart, just the one person who joined?
If anyone has an idea of how to get around Actor Location automatically being replicated when set on the server let me know. I want the client to set the location of the local version, then do a server RPC to tell the listen server version to set itself and not replicate the GD location back to the client when the location is set. I need the actor to be replicated for the other variables on it, but I dont want the built in location replication to work
Hi, I have a problem in working with multiplayer, I can not create an Actor on the server on behalf of the client. But from the server side, the client side Actor is created without any problem. I followed this video step by step https://www.youtube.com/watch?v=sZ0zSj3Z3aA&t=28s , but at 13:50 on the client side of the video on the server creates Actor, but I do not. The screenshots are my code and the game footage. On the top it says on whose behalf the screenshot was taken, and on the spheres it says by whom the sphere was created
Patreon: https://www.patreon.com/SneakyKittyGaming
Discord: https://discord.gg/W5g6pZXfjh
In this video we create the implementation of our theory and discussions from the previous 1.0 video with our projectile by learning more about and using a Server RPC!
In photo two can you post the rest of the function?
In the code you are checking if they do not have authority and if not you are calling ServerSpawn.
If they do have Authority you need to call run the spawning code I believe.
All the multiplayer logic happens here, I also added Multicast RPC, but nothing has changed
To test real quick, on phone so hard to read everything. So just going to run through very roughly what I think happening.
So first we have function:
AClass::SpawnShot(FVector Location)
{
blah blah blah spawn logic
}
Now we want to spawn stuff from the server so in the Fire we go
AClass::Fire()
{
if(HasAuthority())
SpawnShot(MuzzleLocation);
else
ServerSpawnShot(MuzzleLocation);
}
Then we have ServerRPC :
UFUNCTION(Server, Reliable)
AClass::ServerSpawnShot(FVector Location)
{
SpawnShot(Location);
}
So if they have Authority they can just run the spawn code normally. If they do not, then they use the ServerRPC to run the SpawnShot. I don't believe you need to multicast anything because we only want the spawning to happen on Server.
I've done this before, but it doesn't work. I tried creating a new 1-person template project and completely repeat the script from the video there, but again it doesn't work.
Share rest of Fire() aha. Just realized you posted more code but not the function I wanted lol
Let me check I know I've seen a github repo you could look at to check for difference, just have to see if I can find it.
https://github.com/tomlooman/StealthGameUdemy/blob/master/Source/FPSGame/Private/FPSCharacter.cpp
May help. Also is the class being spawned set to replicate?
By the way, we can only edit the _Implementation and _Validate functions in the .cpp file, right? The ServerShot function should remain only in the header file, we should just apply it, but not put logic into it?
void AWeapon::SpawnShot()
{
AActor* Sphere = GetWorld()->SpawnActor<AActor>(SpawningActor, GetActorLocation(), FRotator::ZeroRotator);
}
void AWeapon::ServerShot_Implementation(FVector MuzzleLocation)
{
SpawnShot();
}
void AWeapon::Shot()
{
if (HasAuthority())
SpawnShot();
else
ServerShot(MuzzleSocketLocation);
}
Yes, replication is configured
comment out the 'if(!HasAuthorty())' and just run ServerSpawn() no matter what. That's the only thing that looked off from what I saw. Multicast you don't want because client shouldn't/cant spawn so no point in running
All the same, when creating an Actor from a client, neither the server nor other clients see it
There is another point, the created Actor from the client appears on the server in the list of objects in the Outliner, but it is not visible
So the server is spawning it so it's running properly. Looking at the spawning you are just spawning it at the AWeapon's location so I believe should be fine.
I was kind of unsure about how you are setting replication currently. I think ideally you would have AProjectile class and in the constructor there set the bReplicate and bReplicateMovement or whatever they are true.
In yours you spawn the projectile (just AActor) and then set replicate true after it has been spawned. If I was on computer I could test but I think because Server spawns it setting its location and then it's toggled to replicate, that intial location spawning is never replicated as it happened before turned on.
As an object that will spawn, I just have an Actor blueprint, inside which an ordinary sphere is a primitive. Replicates is already installed in the Blueprint settings
Hmm I got then. If it's showing in the outliner and you can double click and view it, it exists and is spawning properly so I'd just go review the logic on the location and you'll prob find the issue
It would make sense that it moves to zero coordinates, but it's not there)
You are just spawning at the AWeapon location. Is it colliding with something and messing up the spawn. Theres a settting somewhere, SpawnCollisionHandlingMethod or something
If I don't use GetActorLocation(), but enter just any coordinates on the level - nothing will spawn there either..
The client shows that it's there, but the server shows nothing
Other clients have nothing, either
Is it all right for RPC to happen kind of a lot?
Server needs to know client pawn's Z rotation, which for some reason rotation is not automatically syncing up from client to server on CMC the way position does
I could RPC it up but it would need to happen like multiple times per second...
Doesn't work
The client has spawned the sphere, he has it, the server and other clients do not have it, the Outliner has it
I put the cube on the level myself before the start of the game
Client can't spawn things for anyone but themselves. Need to ask the server to spawn it, is my understanding.
Yes, that's how it works for me, the client contacts the server and it creates a cube
void AWeapon::ServerShot_Implementation(FVector MuzzleLocation)
{
SpawnShot();
}
🤕
Hmm so I am rotating via controller with Set Control Rotation and I have CMC option Use control rotation enabled, but it still is not syncing from client->server 
From searching this channel it sounds very much like CMC is supposed to handle syncing of rotation from client->server/others
What am I doing wrong I wonder
settings are pretty close to stock
Oh I have to turn it off and on to use it with Orient Rotation to Movement 
Ah yeah that's it
Are you sure the weapon actor that is spawning the shot is a replicated actor that is spawned by the server and that the client is set as the owner?
Yes, that was the problem. From the character's script, this script works correctly. Thank you all for your help
Then if that's the case, if the character have 1 second delay, they will see the projectile 1 second after
In other words, your ServerRPC doesn't reach the Server?
Oh, chat didn't scroll
:D nvm
Hi, got a doubt there, I should be AutonomousProxy of an actor on my local client only if I own it right ? Otherwise I'm the simulated proxy ?
AutonomousProxy is usually reserved for things you possess, not own
So vehicles, pawn etc
Literally just learned it rn after 4y of working with mp stuff lol, always thought you was Autonomous on your local version of the actor
Alright, good to know, had a doubt about it for my Pickups
Thanks !
The roles are more like what "control" you have over that actor but the rules aren't as clearly defined really. IIRC by default it's only your pawn the engine sets your role for
Is there a simple way to force atomicity with two replicated properties that isn't just merging them into one struct?
I suppose you could have a pair of onreps wait for both values to show up (ugh) but man
yeah struct with NetSerialize() is the only way
it would be nice if I could bully unreal into considering two members one atomic thing
maybe with Iris member descriptors but... yeah I would rather just make a giant struct lol
Only place I ever saw Epic do that way by using the same OnRep for both variables and testing them in the OnRep. But that was a special case and sounds quite hacky :D
Hello, does anyone have experience with VOIP talker? I'm trying to use it, but it doesn't seem to do anything. That's what I have in my character begin play. I don't get any warning/error in the log. I'm using Redpoint EOS for backend, I don't know whether it matters though. I tried it in PIE standalone with two different EOS accounts, I don't know whether trying it in packaged version would change anything
anyone smoothed out autonomous proxy client corrections before ? sadly calling smooth correction is only for simulated
CMC should already do that for you, or what is your setup?
Lag comp question: For a server-side rewind system, what do you think from your experience should work better?
- Rewinding based on ping/synced network clock.
- Client sends ID of the UCharacterMovementComponent move he's currently performing predictively and IDs of the two moves the character he hit is interpolating between on his local screen, and then the server can find those moves and rewind to them.
Option 2 seems more promising but I've barely heard people talk about it so just wanna discuss this with you.
And btw the ID I thought of in option 2 is the TimeStamp that the UCharacterMovementComponent already sends to the server (for simulated proxies a custom ID might be needed).
I use the GMC which gives access to the simulated proxy current simulation timestamp
So whenever I do hitreg, when the client hits something I have it send the target's simulated timestamp along the hit info to the server
That way the server can just rewind the target to that timestamp (within reason)
Yep! I generally add a margin of error that's allowed
If you wanna go for cheap checks, you could use bounding boxes
That's really cool. And you're saying I have timestamps by default I can use also for simulated proxies?
I use the General Movement Component which does
I'm unsure if the CMC provides something similar
Yeah I'll check it out cause it is quite crucial. And I guess you're considering simulated proxy interpolation right?
@thin stratus it smoothes simulated proxy corrections but not autonomous, with autonomous it just teleports u to correct
The GMC does this out of the box
It provides that, a simple rewind to timestamp function, buffering simulatedd proxy moves
My problem is that currently everything's in theory for me. I'm not even sure how critical the interpolation might be. So currently I just assume it's mandatory and without accounting for it in the rewind, the rewind wouldn't work.
CMC smooths local corrections too
is there some setting for that ? coz i tried messing with them and doesnt seem to affect the local client
There are settings on the CMC to control how it behaves, but you should not teleport with default settings either
ClientAdjustPosition_Implementation just calls SetWorldLocation
Yeah cause the Capsule will be teleported
That's normal
The Mesh will be smoothed though
thats the behaviour i get for sim proxies, but with autonomous it teleports for me even on a blank project
sec lemme grav a bid
Is the smoothing just linear interpolation between the 2 last moves from the server?
Thanks I'll check that out
@thin stratus default project with the camera boom attached to mesh, simulating "average" network conditions
average my ass but still
i cant seem to find anything to smooth out the corrections for auto prox
im fairly certain its teleporting the mesh as well or its just not smooth enough
yea i was hoping i could just override ClientAdjustPosition_Implementation and call SmoothCorrection like whats done with the simulated proxies but there are some asserts in there that kick off, plus it doesnt anyway
so ig im gonna have to spend some time figuring out the internals abit more so i can smooth the correction over a few frames while it runs the rest of the auto prox logic
was hoping someone would have done this before and documented it but i couldnt seem to find anything
such an ugly default behaviour
also very tempting to just go for GMC but really expensive
I had similar issues with default cmc, only the mesh component interpolates, but not when it gets corrected, lyra solved this somehow by replicating the acceleration...which the unreal docs say cmc does already, welcome to the mover waitroom
And yes there is zero documentation or runtime examples
Any place where to start in order to learn how to solve latency / bandwidth issues in networking for a beginner ?
unreal docs seem not to contain nearly not even enough information about the networking debugger
define the issues first?
Well, I used what I learned about RPCs and Replication initially to make my game networked correctly.
Now, I'm not so happy with how smoothly the player is replicating really, and my assumption is that it has smth to do with networking optimisation in term of latency and bandwidth.
Now, I'm not nearly as enough versed into how those 2 things work or just how optimizing the networking part works .. so I'm seeking resources to understand what are the common causes to such things .. how to do actual simulation of multiplayer on pc .. cause the stuttering when using 2 different devices is much bigger compared to launching the game in listen server mode on the same pc .. which is normal.
I've no idea what your issue is, stuttering could happend because of reasons.
If your character anim is stuttering in packaged game. Try to look at this
Anyway gonna sleep gl
Well yeah I don't know that much about networking to explain my issue to you nor to myself.
But thx for pointing me at a direction at least.
Have a good night Sir 🙂
So what does all of that really do ?
Okay thanks
@ashen plume does that mean lyra has an example of smoothing the autonomos proxy correction by replicating acceleration ?
tyler ahoy
Where can I store data relevant to the player across all multiplayer sessions?
Like the player character cosmetics
regarding COND_OwnerOnly
i've been recently confused on what the actor's owner truly is
is it only the server or any client connection ?
autonomous proxy, it can't be server only cuz replication make no sense in this case 
listen server is out of equation
is there a way to know who owns an actor? printing the owner just prints a blank string
Actor can have no owner, so GetOwner() is fine
Hey
I am trying to obtain the Hit result from the Get Hit Result Under Cursor for Objects function.
I can retrieve it without problem with my client-server however, for my client, even if the function is fired on server side, it doesn't return any value
Any idea?
When I was debugging, both actor component pass the Is Server condition. Also, I can see the execution line in runtime and it does pass well the condition
first of all listen server is a special case it's both server and client at the same time, second true Server(dedicated) has no mouse cursor, it's client-side thing
I am only on Listen-server, I am not doing dedicated
for second player it's kinda the same as dedicated
I guess you have to grab hit result on client and feed it to some of the ASC function
which replicates/transfer to server things for you
What is ASC function?
ability system component
do you mean RPC ?
hi , I have a question , how to make the client and the server both own the actor ?
server owns everything, so it's more about autonomous proxy who has "remote ownership"
unless you create local only non-networked entity
ok so every actor on the level the server owns it ?
ok ? but if I set the owner of the actor to the client will the server still replicate it ?
have replication worked for this actor before?
replication can work for any client, not only owner unless specifc setup llike COND_OwnerOnly
btw ASC just an example, maybe your case not about GAS 
yes
but why custom events not replicated with them even if i set it to run on server or multicast?
I think I understood your advice
I will retrieve from client my Hit actor then send it to server via RPC
RPC and Properties are different things
each requires specific setup
hello, does anyone have a clue about what could be an optimal way of replicating lots of turrets for a game like a tower defense? my idea was to have the turrets do everything locally, but only the server can actually apply the damage, and while that would work it would cause visual desyncs and differences which isnt very optimal... if anyone has any ideas, please let me know
how many is lots?
However, I am not sure to understand something..
On listen-server, server has all the player controllers. It should be able to retrieve mouse cursor for each client, am I wrong?
not sure, depends on what the players build... technically the map is very big and theres no defined limit
lets say, two hundred?
server has it's local versions of remote Player controllers
have you experience "visual desyncs and differences" or it's just your assumption?
Has anyone ever done client side predictive actor spawning + client side targetting hit results (/w server validation)? (e.g. for a projectile)
I have it mostly working but am reconsidering the entire design/approach.
My current approach fully encapulates all the logic in the projectile itself. Client spawned gets reconciled with the server replicated one.
But I'm considering dropping and having some kind of secondary world subsystem for reconciling it later. But I feel like every approach is littered with edgecases :/ I guess that's multiplayer for you
also check for smaller count e.g. 10-20 maybe it's setup issue
just my assumption
i havent done the replication yet, im asking precisely cause im trying to make sure i can have a good idea of what i need to do before i do it
Ok, that what I needed to hear, thanks!
I think 200 is doable, though UE isn't very suited for RTS-like games with bunch of entities
but those local version has limited data, that's why mouse is absent
you have to send extra stuff manually
mh, I see!
Is it by experience you know that?
or was it written somewhere on a documentation?
Well PlayerController itself may be fine, the thing is that its function just communicates with another "system" which is obviously client-specific
e.g. viewport
so could you please tell me how to do this set ups?
retrieve stuff on client, then send via RPC for example
thanks for sharing
I definitely need to check in cpp before asking!
You have messed up things, RPC can send data (params) out of the box, you don't have to tie it to replicated properties
so maybe start with reading docs and exploring examples
replicated props is a "Server -> Client" thing. To send stuff in the opposite diirection use RPCs (client -> server)
ok so how RPCs work in actors ?
don't forget that RPC should be used from "net owning" client
kinda semi panicking on this one, but i basdcially attempted a bunch ofthings and now my project is seeemingly unopenable and i've tried rebuilding it but it fails due to plugin issues, etc.
im planning to take a recent backup of the project in 5.3 and then using that to then migrate specific assets i need to a fresh project in 5.4
are there going to be any issues im missing w this when it comes to the migration? of course, plugin stuff, but other than that, can you just migrate stuff from 1 project in 1 engine version to another project with a different engine version
perhaps wrong channel to ask
what's the best way these days to serialize a float or FVector and quantize it a little? I see SerializePackedVector but maybe Iris has some better library methods for that now?
hello again, ive noticed the player state of a pawn isnt immediately valid on BeginPlay. is there an event i can call when it becomes valid? on Possessed? receive restarted?
on client: AcknowledgePosession
on server: ReceivePossessed and ReceiveUnpossessed
i can't find AcknowledgePossession... is it exposed in blueprints?
ooo annoyingly I only see it in C++ and on the PlayerController, not pawn (whoops sorry)
I'm getting alot of unreachable code when building DebugGameServer!
1>[1/696] Compile [x64] Module.ChaosCloth.cpp
1>E:\Projects\GithubClones\UnrealEngine\Engine\Plugins\ChaosCloth\Source\ChaosCloth\Private\ChaosCloth\ChaosClothingSimulationSolver.cpp(1400): error C4702: unreachable code
1> while compiling Chaos::FClothingSimulationSolver::GetWindVelocityAndPressureField
1>[2/696] Compile [x64] Module.ChaosCaching.cpp
1>E:\Projects\GithubClones\UnrealEngine\Engine\Plugins\Experimental\ChaosCaching\Source\ChaosCaching\Private\Chaos\ChaosCache.cpp(374): error C4702: unreachable code
1> while compiling UChaosCache::FlushPendingFrames
1>[3/696] Compile [x64] Module.ChaosNiagara.cpp
1>E:\Projects\GithubClones\UnrealEngine\Engine\Plugins\Experimental\ChaosNiagara\Source\ChaosNiagara\Private\NiagaraDataInterfaceChaosDestruction.cpp(2490): error C4702: unreachable code
1> while compiling UNiagaraDataInterfaceChaosDestruction::PerInstanceTick
1>[4/696] Compile [x64] Module.Chaos.20.cpp
1>E:\Projects\GithubClones\UnrealEngine\Engine\Source\Runtime\Experimental\Chaos\Private\GeometryCollection\GeometryCollectionConvexUtility.cpp(484): error C4702: unreachable code
1> while compiling ``anonymous namespace'::CreateNonoverlappingConvexHulls'::`2'::<lambda_4>::operator()
1>[5/696] Compile [x64] SharedPCH.Engine.Project.NonOptimized.ValApi.Cpp20.cpp
1>[6/696] Compile [x64] Module.Chaos.2.cpp
1>E:\Projects\GithubClones\UnrealEngine\Engine\Source\Runtime\Experimental\Chaos\Private\Chaos\ChaosDebugDraw.cpp(1048): error C4702: unreachable code
1> while compiling Chaos::DebugDraw::GetFirstConcreteShapeType
1>E:\Projects\GithubClones\UnrealEngine\Engine\Source\Runtime\Experimental\Chaos\Private\Chaos\ChaosDebugDraw.cpp(1062): error C4702: unreachable code
1> while compiling Chaos::DebugDraw::GetFirstConcreteShapeType```
Any what is the possible cause of this
Don't build from source. Or use a stable version of the source.
kk
Does the character movement component automatically replicate movement speed updates to the client?
No
why wouldn't it be possible
it's a pretty common thing to do
and since the player owns the player controller, it usually just works. player controllers generally won't multicast because that makes no sense
so the client and the server wont be syncing?
???
How should a server authoritative system for bomb planting work?
Let's say that you start planting a bomb, you start animation, you see a progress bar, when the progress bar is at 100, you plant the bomb. Now, to make it responsible as much as possible, you probably don't wait for the server to allow you to start the planting process, but instead you immediately start the animation, fill the progress bar locally and then when you want to plan the bomb, you tell the server to plant it, thus it's replicated everywhere and it's server authoritative. But this would allow the cheating client to just tell the server to plant the bomb immediately, without any animation and progress bar. Is there any "win win" general approach for this type of issue, or all alternatives have their pros and cons? As for example making the progress bar being replicated and server authoritative, so you just tell the server to "start the planting process" and "stop the planting process".
I mean like the RPC does something so will this thing be replicated to the server ?
I'm not sure you fully know what an RPC is, as there's 3 types. If it's running on the server from input on the client, then anything you want the client to know about has to be replicated back to them either through replicated properties or another RPC.
I know the types of it , but there is something in the code maybe. so take a look
and thats how I call it
you don't use multicasts on a player controller, they're only relevant to one connection anyway (the client the PC relates to)
so how to make it relevant to other connection ?
up to the server, down to the clients
how to do that exactlly ?
damn dude, you are asking same question second day in a row, are you sure you are ready to cook multiplayer game? it's a tricky task event for experienced devs
its a dream for me to finish this project
so I am trying every day to get any help to just finish it 🥲

use something that is also relevant on other connections
like the player state
or game state?
this is bad setup to grasp hard topic like networking. Make fresh Actor/ or even Project and test RPC with minimal overhead, print logs (BP shows whether client o server prints the log).
you can trigger RPC in player controller from begin play (with a delay node for convenience)
HasAuthority node can help you trigger code on client or server
How do I get this replicated?
animation generally doesn't
There has got to be a way though
You replicate through the owning actor.
You have the animation blueprint read the values from its owning actor.
you replicate state that allows the animation to match on the client
so in this case, you'd have to replicate the "look at" position so other clients know about it
How would I go about doing that?
well you implemented this as a multicast for some reason?
so each client (and the server) will just compute its own camerahitlocation anyway
Multicast is the only way I thought It may work
why would it? that's kinda not how a multicast works anyway
multicast runs on server and all relevant clients
so the relevant client running this code will just overwrite the replicated variable, though sometimes the server copy might overwrite it, that order really isn't guaranteed and is based on server framerate anyway
So should I just feed the code to tick instead of all these custom events?
Well that half worked
the server OR the client could compute the "camera hit location". if it's the client, it sends it to the server which then replicates it to others (though I don't think you can do COND_SkipOwner in BP)
lol
if it's the server, the server is just setting the replicated value with no RPCs
Prob fighting each other
Or server don't update fast enough, and it couldnt
For movement you always interpolate to the new value
I'm not sure, but the option is there for skip owner
Is there a delegate I can attach to as a client that will notify when all server actors have been spawned on the client on join? Because I’m having an issue with getallactorsofclass returning nothing on clients that join mid game as the actors haven’t all spawned yet.
there is no way to know that
How about putting a blank screen or loading screen and just do a check if the server already finished spawning? If already finished, get rid of the loading screen if not, wait for server to finish spawning the actors
you cannot know when "all" actors have finished spawning and replicating, there can always be more.
you can build your own system for knowing how many to expect, however
Ahh yeah I see, I thought it's just about spawning some number of specific actors
the server would have to replicate the number of actors you should have, and you'd have to check against that. There are other ways too but it generally comes down to that.
but there's no generic way to know when you're "done" receiving replicated actors because there is no such thing as done, as soon as you receive the last one you might already be missing a newly spawned one.
Ah darn. Guess I’m gotta refactor.
Got a weird problem. I have an inventory component attached to the PlayerState object. It, of course, is replicated. I am using RepNotifies with log statements in them so that I can see log messages when replication occurs. When I pick up an item I do see the count of items in the inventory going up. But then when I try to print a dump of the inventory contents I get that there are zero items in the inventory. If I pick up a second item, the inventory count goes up to 2, but still the dump says I have 0 items. I have no idea why this is. I've attached two BP images. The first is the code for picking up an item, and the second is the code for printing the item dump header showing the number of items.
Any ideas would be greatly appreciated as this has me stumped so far.
The only thing I can think of is that the PlayerState is being gotten from different sources for some reason. In the first screenshot, that is code on the Box item that I am picking up. I get the PlayerState associated with the interaction event's InstigatingPawn, which should be the player.
In the second screenshot, that is code on the actor that is the player pawn.
So I should be getting the same PlayerState in both BPs, but maybe I'm not?
Oh, and the interaction code in the first screenshot runs on the server, while the inventory dump code runs on the client.
i want the server sided code in the gamestate to retrieve the player choice from the playerstate using this interface
but i want the player choice to be only stored locally right until the server requests it
im drawing blank on how to make that happen
How can you actually do that? Can you un-replicate something that's replicated in the parent?
Actually, what would happen if it attached to something that wasn't replicated. I'm thinking a non-replicated "weapon attachment" component that changes its own parent depending on the context.
Hey guys, how should the client properly exit the dedicated server? I use the Quit Game node, but I noticed that sometimes the server doesn't receive the client's exit message, causing the client to black screen when reconnecting to the server.
You have to RPC the player choice to the server.
i thought of creating an event set to run on server and it would set the player choice variable on the server side but is there a way to do it all in the interface implementation i showed in the pic to make it more compact?
No. In order for a client to send any data to the server it must be sent through an RPC. So once you make the choice, you'd have to send it then, or have the server send a request to the client to the send the RPC. Once you're running on the server, you can then call the interface.
just to be sure i will call this event from the client to update the value for the server right?
This is on your playerstate yea?
yes its inside a component in the playerstate
Yep, then that'll do it.
alright thanks!
I am getting an error in my Output log that says, "LogUdpMessaging: Display: Added local interface '192.16x.x.xx' to multicast group '2xx.0.0.1:6666' LogUdpMessaging: Warning: UDP messaging encountered an error. Auto repair routine started for reinitialization". Does anyone know what I can do to resolve that?
hey guys, so i have this event thats called every 0.01 seconds when placing a building in my game. i want the distance from the player to the building to be variable depending on where the player looks. The weird thing is, that the lerp node you see on the bottom only replicates to the server, but not to the clients. does anyone have an idea as to why that is?
Because the rotation of the camera is likely not replicated. But this seems like the wrong approach.
What you should do is to trace it locally on each owning client, then send the new location to the server to replicate through "Replicates Movement"
Just for more context why do you say not to build from source? And what do you mean by stable version of the source?
Building form source is a bad idea unless you need to do it for some reason. You're just opening yourself up to compilation errors and things taking a long time.
When I say a stable version, I mean not the latest from git, but the version from a release tag like 5 4.
somebody help? plz....
interesting. makes me think the last few days maybe there arren't as many errros as i think.. i just started to build out the game (package) and got loads of errors from building from source have now redownloaded my project from old drives from days ago becasue i've broken the project so many times
Actors have a replicated Property for Attachment. That's why you can't split what it attaches to by default, since the Server's choice will override the local client.
You'd need C++ for that. Either disable the whole property from replicating (via DOREPLIFETIME macros, there are some that can disable replication of parent properties), or by overriding OnRep_AttachmentInfo (I atually don't know what the exact name is, but I'm sure you will find it) and doing custom stuff.
Possibly problems. The Attachment Info is in the Actor that gets attached iirc.
So if you Attach to something that isn't replicated, so either doesn't exist on Server and Client or if it does, it's not stabley named and replicated, it will fail to resolve the pointer on client side and possibly not attach there.
I would see that more as a bug than a wanted result
no, this was all done on 5.3.2.. i just was attempting to solve issues and bascially just kept making things worse, so keep going back and now attempting to migrate things from 5.3.2 to 5.4.3
So not a source build?
lmao, i think i was misunderstanding the term build from source
i get this error sometimes that tells me to "try compiling from source"
or "build from source" etc
that's where that term / phrase has been mainly implanted in my mind and i usually associate that w any type of build in an IDE but im also very limited in this side of thigns
Guys, I have a problem in a multiplayer mechanic when it comes to assigning clothes to my players when they have their respective pawns. It turns out that as the graphic quality increases, the characters sometimes do not appear and I get an error in the skeletal mesh of my players.
Is there a trick to smoothly assign the change of clothes to my players?
Na that just means that the Binaries you currently have (or don't have) aren't working out
That often happens if you primarly work in IDEs and compile only for DebugGame, and then suddenly decide to open the Editor via UProject file, which needs the Dev Binaries
ahh that makes sense. cause sometimes the solution is to just remvoe binary/intermeditae folders and let them do their thing
ey @thin stratus do you have your compendium updated in pdf? I have 4 hours flight soon🥲
because I dont know how to download the website made in React js etc
Sadly not, no
im about to build from source 5.3, is it problematic this red minus symbol?it says "Ignored"
I downloaded from github 53. then double click Setup.bat
then I double click GenerateProjectFiles.bat
following this tutorial https://youtu.be/jFe37SviLk8?t=325
In this video, we'll walk through the process of building the Unreal Engine from source. We'll cover everything from setting up the development environment to compiling the engine and creating a custom build. Whether you're a developer looking to contribute to the Unreal Engine project or just interested in the inner workings of one of the most ...
Failed to load /Game/MAiBLUEPRINTS/CHARACTER/BLUEPRiNTS_2D/2DCHARACTER/NEWSPRITE_CHAR/ANIM/ABP_NEWSPRITE.ABP_NEWSPRITE_C Referenced by Animation
i get this error when loading in but everything w this asset works fine in the editor and nothing isn't properly referenced that is being used. is there a way to solve this error? or maybe something im missing?
god damn, I'd be insane working on that project
lmao my b, i know the folders are redundant
lol damn am i in for a world of trouble?
the folders are not redundant. The caps are
and very much so
🤣
i love it, but yes the caps were before i realized the error in my ways
or should i say... MAi ways
you do you
my man
Somebody?
tutorial to build ue from source o_0 w/e next haha
but just build it
not sure what "ignored" means
but if it builds it builds
Ok maybe is some plugin of VS
I think the red dots mean that those project files will be ignored in source control (Git). This makes sense because the Visual Studio generated project files should not be committed o source control anyway.
🙏 thanks
In general is it preferable to call fewer RPCs with heavier amounts of data than it is to call more RPCs with light amounts of data each?
For example a shotgun blast could create 16 different damage events each happening within 0.1 seconds of each other.
In a client auth game (PVE) where the client has authority over damage, would it be smarter to batch damage events into a single array that then gets sent via a single RPC every 0.05 seconds (if there is something to send) rather than sending 16 different damage events each with their own RPC?
I should note that these have to be reliable RPCs (pretty much the only mandatory reliable RPC in the game)
batching will almost always be more efficient but you're paying for it with a lack of responsiveness for other players.
it's not really worth it for that purpose
I'll do some testing as my projectiles have travel time and if doing potential batch RPCs 30 times a second it may feel similar to firing off the RPC on the same frame as they hit
Ideally the result will feel pretty much identical but with far less RPC overhead, can even re-use my damage struct so instead of sending separate ones and separate RPCs I can just add damage to the batched struct if hitting the same person multiple times
AFAIK usually batching is only worth it per frame. EG shotguns. are the most common case.
Unfortunately can't quite do it per frame in this case as even the shotguns have projectile travel time but it's possible to have many damage events in a short space of time (but not neccessarily the same frame) depending on upgrades
It will be an interesting experiment anyway
May as well batch all the hits that occur in the same game frame at least
That's probably the most common case even if you have travel time.
hey i want to make this replicated but i already have all the variables replicated and all of the characters and components and actors can someone help me please!
yeah makes sense! Just with extreme cases with like 100s of projectiles dealing damage in short spaces of time I do wonder if just having a local func called 30 times a second that will send an RPC if BatchArray.Num() > 0 could feel very similar but be much more efficient because no matter what, a max of 30 RPCs will be sent rather than potentially 100s more if you have unlucky situations where loads of shots are hitting on slightly different frames
It's PvE with no real limits on player power so RPC count starts becoming the bottleneck on long games. An interesting problem to think about though
these effects are random right?
i mean if you dont need to try and anti-cheat, you could just use a random stream with initial seeds matching, then you dont need to send anything except check total damage every once in a while
In this case the bottleneck is just the player delivering damage info to the server via reliable RPC, everything else doesn't really need to match and is unreliable. Just basically reducing that one reliable RPC count is the goal
I think the batching will work nicely though
if its only damage idk if i would bother sending 30 times a second, you dont need 30 corrections per second if they dont match up?
Well in the case of damage it needs to feel quite responsive so if sending even 10 times a second the percieved responsiveness could start being noticeably delayed randomly (depending on the shot) but still 30 times is still hugely lower than some of my current profiled worst cases where like 2K RPCs get sent in a short timeframe 😄
But yes even 10 could work, will find the magic number of responsiveness and efficiency
wait are you making the player wait for a response from the server to apply any damage on their side
Yes server still needs to have authority over health, it's just that player is allowed decide how much damage is dealt
It works fine it just needs to be sent regularly just not quite every single damage event as an RPC on the same frame as I have it now
if youre looking for responsiveness you usually do whatever the client does on their machine, send data to the server, the server checks it then either sends back a response saying yes or no and then the client either continues or has to rewind whatever action just happened like taking health
Would this include things like health bars and such? The way I have it now works fine (client waits for server before getting damage confirmation, seeing enemy healthbar go down etc.) and doesn't have to rewind but it's interesting to think about doing even more prediction locally
have you tried doing a ping simulation?
Yes of course, it works fine in practice even on really bad pings like NA to AUS
The problem with prediction is you also have to be able to roll them back and notify clients when they failed to predict correctly. Predicting damage is pointless IMO since it's not like the client can kill the object anyway, so you're getting some latency regardless.
Right! I'd prefer to see guaranteed state a bit late than predicted stuff being incorrect
And feeling cheated
I believe an older call of duty game used to do this and you'd get damage feedbaack locally which lead to really frustraating fights
Where you'd deal way more than enough damage but it was actually faked
isnt the idea to make sure it almost never predicts incorrectly
unless theyre cheating
yeah but GL;HF doing that
Well at the end of the day in this case waiting for the server to report back is completely acceptable in most cases, it's just trying to optimize what the client is sending the sever to prevent crazy amounts of RPCs is the goal which I think batching should nicely solve
Anyway thank you for the help gents!
can someone help me 🙂
btw its replicated as you can see but i want to replicates too into the quest log.
what would cause replication to not happen between server and clients
i cant find anything obvious on why its not replicating
Back on the character thing? 😄
yeah @kindred widget
Hello. I have a flying AI and I want to follow some points, so I have to use Set Actor Rotation and Set Actor Location, but the AI is very jittery when it's moving. What I'm doing wrong here? Thank you 🙏
i recomend you set actor as following path points
well i know for a fact its not calling ServerMovePacked
Can you please explain?
https://youtu.be/jjvPoTSTjsw?si=sjU0-Y8in1mBNZqG or you can use this system
Hello guys, in this quick and simple tutorial we are going to learn how to move a character along a spline in Unreal Engine 5!
↪️Join my Discord Server, NOW: https://bit.ly/GorkaGamesYouTubeDiscordServer
Check out my Steam Game! https://bit.ly/3rVlXU1
Follow me on Twitter: https://twitter.com/GorkaGames
Follow me on Instagram: https://bit.ly/In...
if i understand correctly
I also need to follow the client in some conditions. I don't need a pattern
I have a weaker understanding of networking so this may be dumb question but: UI doesn't run on Server, I know that. But with a UserWidget, is this running on the Server? I originally thought yes, but I didn't know if there was something else, like while yeah, ListenServer there is still some separation from the Player/User and the Server part.
so you want to chase the player??
Yes (this also), beside the roaming to random points.
Showed the example, for a simplified explanation
so you want randome roam and chase a player when it see??
Yes. I already have this built. The problem is the movement. When it's chasing the player, or going to a random location, the NPC is jittery (movement & rotation).
I can't use simple move to location, because it's a flying actor.
UI is entirely local to a player. It should have no concept of "The server". It reads current gameplay state on that machine. This is regardless of whether it is a Client or Listenserver.
For example you have an ammo counter widget to display ammo used/left. You have an ammo variable in your character or a component on the character. The widget gets the character/component and binds callbacks to listen for when that value is changed, or polls it each frame.
Your net code replicates the ammo value on the character/component alone, nothing to do with the UI.
When the net code affects the ammo value on the character/component, the UI updates itself.
in multiplayer or single
??
Multiplayer
did you have enabled the replication movement??
on ais settings
Yes, it's a child of a character actor.
The character actor is used for the clients, so it's working as expected, since I'm using the movement component (built in replication)
I was just kinda thinking, and thought maybe when Player is ListenServer there was kind of two things running for them. The game/client and then the server and their was some separation. I may have worded it weirdly trying to fit in my reasoning for why I thought that way for a second aha
ok go to the ai and in the movement character component go to rotation and check the 2 settings and the rotation rate 180
There's nothing extra. A Listenserver is simply the ServerMachine, with a LocalPlayer, which gives it inputs, UI, playercontroller, etc just like any other client. It does allow you to abuse some things on the listenserver, but realistically you should never code like you're on a listenserver. Always assume client stuff is for a client, and server stuff is for the server.
Ah ok I get it (:
ahmm can you help me for something??
Don't multicast quests.
wdym??
It looks like the problem is Set Actor Location. This is jittery, since I've removed the rotation atm, to debug it
basically the problem the quests is not going to quest log in the client... if you mean that
can you send me a video to understand it 🙂
You multicasted showing the widget.
In general. When you're learning networking. Don't multicast. For any reason. 97% of the time, you want to replicate things and use OnReps, not multicast.
thats the problem actually
so what i must to do??
you want to replicate things and use OnReps, not multicast
so where i use custome events and generally multicast events make it OnReps??
Depends on the thing, but multicast is rarely the right call.
is this answer for me??
Yes
ok you know about replications??
such a weird question
I have a generally good understanding of how replication works, yes.
ok so the problem is the multicast i have??
i dont think so cause the real problem is the quest goes only to the serever and not on client
I haven't read about your problem. Just making a comment about multicast.
thats the problem
if you can help me 🙏
and this
does anyone know a replicated quest system??
May be a bit of a stretch because I was handling this wrong and others may not but for 5.4 users, did anyone else notice an increase in issues with Client input while having input setup in their character's BeginPlay()?
I was previously calling AddInputMappingContext() in my character's BeginPlay() and I had an issue when testing maybe every 25 plays. After changing to 5.4 the issue was pretty much every other run haha.
I fixed the issue with the ReceiveControllerChangedDelegate, but I was still curious if anyone else noticed something, or the increase was more so my machine haha.
Hi ! I have a question about Inventory System.
I'm making Item-Drop function at inventory in Multiplayer.
Inventory is TArray<UItemInstance*> (UObject, already Replicated).
Item drop be triggered in Client-side DragDropOperation.
but when I was about to implement drop, I'v realized that ItemInstance in TArray need to be removed at Middle-Index using ServerRPC.
I think removing at Middle Index is not cheap in server-side (maybe O(N)).
can anyone advice to me in terms of Data structure or Server-side Logic?
I don't know that either choice TMap instead, or removing at Middle Index can be tolerated in Server.
I have a character that when placed in the map works fine (it moves), but when i spawn it dynamicly in game it doesnt work( doesnt move), im doing the movement like this GetCharacterMovement()->AddInputVector(finalDirection) in flying mode
what am i missing here?
found the solution, so apparently when you spawn a character it doesnt come with a controller and you have to do "spawnedEnemy->SpawnDefaultController();"
I got a primary solution.
Instead remove element, mark as nullptr.
before add, find nullptr element first and fill it with ItemInstance to add.
when finding nullptr element, caching index of nullptr in queue may makes better.
let me know if anyone have better opinion 😄
anyone have thoughts on how i would server authorize a "hold to interact"?
You have an item object. Which should be a replicated uobject. You don't need to care about indexes. And you shouldn't care about them. If you need to remove it from the array, it should be as easy as calling remove with the object pointer. The array shouldn't care if it's reordered. Gameplay logic at least shouldn't care about the array order and when you put it in UI you should be sorting and filtering the objects anyhow.
Hi, Im making a multiplayer game with a dedicated server. I normally built my server and launched it and I can perfectly connect to it. When I implement Advanced Sessions Plugin for steam I cant connect to my server it gives a PreLogin failure: incompatible_unique_net_id. How can I fix this can anyone help me? Thanks.
i had this issue, let me give you the run down
whats happening here is that you are trying to connect to a steam server through an IP connection
and so it doesnt let you, you have 2 options as far as i know, you can extend your game mode class and override prelogin and pass an empty net ID
OR
you can connect through a steam id
it goes something like open steam.23123123131312
now that begs the question, how would you get that 12312313123 number from steam?
you need to implement one thin from the steam SDK, i think its a function called "pingServer" if i am not mistaken.
Then you can ping whatever server you want to connect to and it will give you the steam ID in the response and you can connect using that
The SteamPing stuff was something I got told isn't even needed. But I don't know the alternative.
thanks for reply. I have one more question. "calling remove with the object pointer" means call like Destroy without remove element (of course in server)?
I'v almost understood except it.
Handling UObjects you don't really destroy them. You mark them as garbage. So to remove the item from the inventory you would need to call remove on the array of UInventoryItems with the UInventoryItem you want to remove. This removes it from the array. Then you need to remove it from the replicated subobjects. This stops it from replicating to clients. Then you need to mark the UObject garbage.
void UInventoryComponent::RemoveItemFromInventory(UInventoryItem* ItemToRemove, bool BroadcastChange)
{
if (IsValid(ItemToRemove))
{
RemoveReplicatedSubObject(ItemToRemove);
InventoryItems.Remove(ItemToRemove);
ItemToRemove->MarkAsGarbage();
if (BroadcastChange)
{
OnInventoryUpdated.Broadcast();
}
}
}```
For example
yes... I think my question brought misunderstanding.
What i'm curious about is removeAt() operation's time cost. when I remove element in TArray in server, it's expensive except last index.
because of successive memory allocation.
It's an array of pointers so it shouldn't be that costly. And if it's an issue you can just RemoveSwap. Which will only invalidate one pointer.
Oh. thanks. it's a good option.
and.. I searched about RemoveSwap, I think TArray isn't completely with std::vector.
it's enough UE Document to learn TArray's low-level feature ?
I'm unsure. I've never personally used the standard library stuff.
I'm gonna read about engine code.
Thanks for reply !
Im using a spring arm and I attached a static mesh to it for weapon sway but it does not seem to be working for muliplayer can someone tell me on to how I get it working on there?
a few days ago i searched for an alternative to the steam ping and i couldnt find anything, since its not anything critical i just let it be for the moment, you are basicly just trying to get the steam ID so it must be somewhere in the code (i assume) its just a matter of finding it.
Can I do a multiplayer game with blueprint?
Also, is it not good to make the user as host if game 3 vs 3
Yes. But you should not.
The second question is lacking critical context of whether or not this is competitive or not.
it is competitive
Then you should not make a player the host regardless of game size. Even if it's a solo player.
Thanks so much
Is it possible to have a non-replicated character in a multiplayer game that ticks only on the client? i.e. have npcs that only the client sees. I'm trying to set it up but the character movement component and gravity never activates when running on a client connected to a dedicated server, even if everything in the npc character is not replicated. Seems like the server locks any character unless it's replicated.
Seems like the CharacterMovementComponent locks the character if there's a dedicated server.
I would look into replicated character which is "net relevant" only for owner
If I change two properties in a replicated struct on the server in the same frame, can the client receive those two changes at different times?
basically can the client ever be in a state where he has a wrong value for one field but the right one for the other field, if they're set at the same time on the server
tldr: no, they should replicate as a single bunch
neat thanks
Possession of characters can only occur on the server. If the actor only exists on the client, then the client will not be able to possess it, nor can the client have an AI controller possess it.
They aren't characters really, they are for tutorial purposes and I wanted to eliminate any potential for server corrections by making them client side authoritative. A correction in the middle of a tutorial will make complicated game mechanics even more confusing.
Which is why I ended up creating an Actor BP that doesn't have the CMC. Considered just using video screens to give tutorial info but that really breaks the immersion.
i was using onpostlogin in gamemode to assign playerstate player numbers and do some other stuff but it doesnt work reliably because it is called way earlier than the initialization of the playerstate. If I have the playerstate let the gamestate know that it is initialized then potentially have the serverside gamestate relay that to the gamemode why shouldnt i rather just move all the logic in the gamemode into gamestate to avoid the extra work? I probably have misconceptions about how i am supposed to use the gamemode. What kind of stuff do people usually do inside the gamemode class? Because i cant find a good use for it other than maybe storing information such as how long each round should last etc
The GameMode is the "ruleset" for the current game.
Things like, timelimit, scorelimit, team makeup etc etc
Are usually governed by the GameMode.
The GameState is the current state of the game.
The Current Time
The Current Score
The Current Team makeup
The GameMode describes the boundaries of a match.
The GameState is the current state within those boundaries
i see. So gamemode mostly has variables that hold information that is like the rule set?
Or for example gamestate might ask gamemode: there is one player alive remaining, should we declare him the winner now etc. That kind of stuff?
Sure
Another example might be that a rule is "teams must always be balanced", therefore as Players login, the GameMode decides what Team they belong to.
Since its executing that rule of ensuring balanced teams
The line can get blurred with more complex use cases.
But this is generally a good way to think of the difference between the 2 classes for new users.
ok thanks
Is it just me or character movement started to jitter all of a sudden? I swear it didn't just 2 days before, now it does. I don't understand whether its something wrong with my net or Spacewars server.
Hi guys, a question, I have a function that spawns an actor on the server side (it's a run on server event). The thing is that it spawns an actor depending on the number of players on the server, for example if there are 2 clients it spawns 3 actors (2 from the clients and 1 from the server), what can I do so that it only spawns one?
Hey guys, is there any guide about making a prediction system or just predicting a variable? I haven't seen any guide or general information anywhere. So it is just trial and error?
The only guidance i got are those 6 lines from GameplayPrediction.h
Spaceship is a pawn and drop pod is a pawn, do other people have issues with attachment of pawns in vehicles?
It also only happens on clients.
Slightly confused about what exactly your asking here? Share your code and maybe restate the question.
Prediction is simply the Client making a change that it expects the Server to make the same change. If the Server rejects the change, the Client receives a correction (the Client miss predicted).
It can't be that simple..?
At a surface level thats all prediction is.
The Client running a change that its assuming the Server will run as well.
The reason you Predict, is to give immediate feedback to the Player.
That does not mean you want to then go and try and predict every action.
You want to predict as little as you can get away with.
To give the Player the illusion of responsiveness.
While maintaining Server Authority
(Thats the correction/miss prediction reconciliation part)
Hi, i'm just getting started on multiplayer and i'm trying to have a variable replicate to the clients on my pawn. I have this variable on my pawn, it is set to replicate on RepNotify, and when i update the variable i can see that it triggers the function, however it seems to be triggering on the server instead of the client. I've checked this by checking if the instance has authority inside the OnRep function and it does:
I'm running in editor, with only one player in client mode. I'm at a loss right now.
RepNotifies in Blueprint are called on all network contexts.
In this case, its calling it for the Dedicated Server and the Client
(Since you have 1 Client, its creating a Dedicated Server in the background)
(Clients are always connected to some kind of Server)
It doesn't seem to ever get called without authority though, for example here my debug object is the pawn on the Client, and the path below never gets triggered:
if i switch to the server as the debug object i get to the breakpoint in the top, but the bottom one is never triggered
What are you trying to Replicate?
You maybe trying to Replicate something that doesnt support Replication
Thanks, ill go and try predict my boolean now
You may want to consider learning C++, you will have a much easier time with things like Prediction in C++ as you have much greater control over how things a replicated.
Ah that might be it, it's a reference to an object of a class i created, but yes i did not att the Replicates to the macro in class cpp here
Bruh i have been sitting in this server/channel forever of course i got c++
So it is not the same as if i enable it here in the editor?
UObjects are not replicated by default if they are dynamically generated.
If you are runtime generating "GridData" as DataAssets, they wont replicate out of the box.
ok, so if i'm understanding correctly i would need to add ReplicatedUsing=OnRep_CurrentCell to my CellDataAsset, then implement that function on my cpp file
or can it be an empty function then overriden in the blueprint editor?
No, you are not understanding what I am saying.
Lets start from scratch.
What are you trying to do exactly?
I have a grid actor which has a 2darray of these cell objects which cover my entire level, and each of one has a value.
I'm initializing the grid with some values and updating them in the server, and i want to replicate the value of the cell a player is on whenever they move from one cell to the next.
This initialization process happens on BeginPlay for the actor i've placed in my level
Ok well you probably want to replicate the Cell ID instead.
And let the Client do a Lookup with that ID
For the actual Cell Data
Ok, yes that would work, but wouldn't that mean that the client needs to have also a copy of all the values in the grid if i want to do this lookup locally?
Well I would have thought that the Client would have already loaded Cells locally.
No right now the grid is only initialized on the server, the clients have no data related to it. I could initialize the grid on the clients as well, but because it uses random values to generate it the values won't match between clients and the server
So what I'm trying to do is initialize once on the server, then replicate to the clients. My thought process though was that i didn't need to replicate the whole grid, but only the cell the player is on at a time
Generally speaking, most systems like this will take a Seed value, which then dictates the deterministic generation of the grid data.
That way, the Seed can be replicated and Server and Clients can generate the same data.
If you only need the "current" cell data, then just create a struct that contains the limited information you need about that Cell Data and replicate that.
I see. that raises another question because the values on the grid's cell can change depending on the actions of the players or the Ai. so if the values are constantly changing I need to keep that syncronized, and it's not changes that could happen deterministically
? Not sure what the question is?
Sorry i sent before i was done writing
Oh you edited the message
Yes, sorry
I think i might be going too far into the deep end without understanding the basics, i'll read more on replication and maybe do some tutorials unrelated to my case first
Well if the cells data changes, just send that change down to the client again?
Ok, i'll give that a try, i'll start with generating the grid from a seed and then move with trying to replicate the value once it changes.
I appreciate the guidance!
👍
It works! Thank you so much for the help. to test i initialized my grid with 0s on both client and server, and then added a value on the server to the cell at the player’s position.
I created a struct that contains the id and the value, and replicated that.
I could kiss you right now 😗
Tomorrow i'll untangle my spaghetti blueprints but for now i'm off to bed. Thanks again!
I kind of need some predictive actor spawning (not projectiles). You care to share how you reconciled the local actor with the server one?
- you spawn actor client side
- save it to a list somewhere (e.g. static array or some subsystem or whatever)
- This list is for local client spawned actors only.
- in beginplay you check if you are a Role_SimulatedProxy (server replicated actor)
- if you are, you can compare against client spawned actors, either via some ID, or whatever mechanism you need on how to match up the actors, lots of choices on how to do this. e.g. UnrealTournament compares location to match. In my instance it doesn't really matter, I assume its mostly in same order.
- Then update appropriate values on either client or server actor. You can hide/destroy 1 of them and modify the values of the other one. In case of UT example they delete/hide client, but in my case I hide/delete the server replicated one
It will be cool one day, Star Citizen is a tech demo more than a game 😆
More meme than game
Hello, can someone help me with the proper command to servertravel to another level as absolute?
I try adding ?absolute to the end after the level name but it's not working, as indicated by strange things happening like the widgets not appearing and characters falling from the earth
servertravel MapName?listen
if ur using the server travel bp node just do
MapName?listen
it didn't work unfortunately.
eventually I want to get to: servertravel + absolute + specifying game mode.
meanwhile I'm in the second step.
I tried disabling seamless travel from the game modes options, and I will go through the trials now
can you take a screenshot your blueprint setup for the travel?
I'm using the execute console command because I don't know how to specify the game mode with the Advanced Sessions node:
wouldnt the game mode just be whatever the levels gamemode is?
I want to change it, similar to how we can change it with the regular travel.
I just want to know why it's not being absolute first 😅
That would mean duplicating huge amounts of built lighting data (unless you can tell the duplicated levels to use existing data which I don’t think you can). I figured it out, the command was simple: you just add ?Game=(path and proper game mode BP name). The problem was wrong specified asset name format. Correct one is: GameMode_BP.GameMode_B...
this should help
also you can use gamemode aliases to make the ?Game parameter less complicated
yess that is a good plan to get into eventually
"eventually"? it's just a project setting
so you can write ?Game=DM instead of ?Game=/Game/GameMode/Blueprint/BP_Gamemode_DM.BP_Gamemode_DM_C
I mean eventually because the solution doesn't hinge on this semantic change
usually write helper that builds url from level path and game mode path (and map<string,string> of custom params)
can someone help me figure out why my door replication isnt working properly? when the server opens the door it opens correctly and replicates to the clients, when a client opens a door, it doesnt open. heres my door blueprint with comments i put from debugging
Well, I guess it's more about "seamless travel" experience rather than huge battles. Single PC performance is still a bottleneck. For example EA Battlefield series has same goal (huge player amount) yet still supports 64x64 or 128x128 (less likely). Maybe if in a perfect world where every Player has powerful PC and broad connection and Devs would't reduce costs on servers (poor tickrate, not high end machines, or even multiple game-server instance on a single PC) then we would reach bigger Player counts 
tribes 1 could do 64 player servers "decently" back in the 56k days
Firstly, is interact called by Server?
called by the server to multicast
to interact is called on all?
if so, add a Switch Has Authority on the door's interact event, so only the server can set this
Second, you can just have one timeline rather than two, and simply Play/Reverse based on Open/Close
Then your server can basically Multicast what the door should do (open/close and the direction to do that to). Dont rep notify that because you are replicating 2 values, there's no guarantee one will be replicated before the other
so instead use a multicast and set the variables, the variables can still replicate with a rep condition Initial Only, for taking care of the door state for late joiners
heres a screen shot of it, ill try what you said too
probably good for the client to pass what to interact with to the server and then multicast it
id start by checking whether your Interact event is called at all
you mean like this right?
right
eh, sad
imagine we gonna go to mars and our server not getting 1000 people
just this alone fixed the door thank you so much
ive been trying to fix this for days
should i pass the player ref through the server as well?
for the switch has autority its supposed to be like this right?
right
you also said i should move all the direction and stuff to the multicast?
ideally the multicast can pass that data so its passed at the same frame and calls the right function
ok did that
also i dont know what you mean by use a rep condition initial
for the rep notify
That is for late joining but can get quite complex, Id say make sure this works as of now
it mostly works theres just a small issue where if the door is opened and then closed from one side of the door the clsoing anim flips, but the other side it works fine, and on the server it looks normal
yeah thats why multicasting instead of doing this on rep is better, it could be the value not being set before the anim plays
this is the only variable i rep notified, the other one was just replicated
Question for yall, I'm going over some ideas for my game and one that I really like is multiplayer, I'm indie so can't really afford large servers. Do you need servers for combat multiplayer games that are primarily 1v1, or at most 2v2?
well you can do listen servers, but that will inherently have host advantage if you're doing something reasonably competitive
fixed this, it was just because i had to use my direction bool for the closing anim too, just a small mistake
So if you want a competitve experience with no inherent advantages, the only solution would be servers?
Yeah, peer to peer means the host is the server, so he technically has authority over everything and can hack into the game
Makes sense, so this would be good for coop experiences, but not for anything competitive
thanks!
nvm this was only a temp fix its still bugged 😬
is getting charged for a static ip address by my interent provider normaL?
That's not what peer to peer means, as an FYI.
UE doesn't support peer to peer out of the box
I guess im more referring to the Create Session/Join Session functionality
It is an often misunderstood thing
Where the host is the server
Right, I do see it often being referred to as P2P though
Yes. People often say the wrong thing because they don't know any better.
People think it just means "one person connects to another person"
can someone give me their expericne w this lmao
Can't really say. Depends on region and all that. In my area, business accounts get static ip address by default.
makes sense. i was baffled they said it was 5 bucks extra a month for one, when i thought it was just seomthing you could setup on any home internet
being charged for a static IP on a consumer ISP is relatively normal, if they even give you the option at all
ok good to know lol
iim just getting into to setting up servers and not sure if i'd even want my computer/ home to be the static ip address used, but i also don't know the long term play for setting something up that i can handle personally
hey can i set in construiption script of controller my team variable? for every controller?
Hey, I am so confused, in my replay using the built in replay system my pitch inputs are not registered, only yaw? The character shows all the inputs, plays the animations for them in any replication scenario, just not when viewed in replay. I am so lost as to why this may be. Only idea I have is that my aim offset is not replicated in my linked anim graph. That shouldn't matter though as it still displays correctly for all the other users.
Edit: My AimOffset Y indeed stays at 0, curious
Hey, guys. I'm wandering what's the best practice to call a delegate within server rpc from a client.
As I understand it correctly, to make it work, I need to bound every single player character in the game to the delegate so it's kinda complicated to manage since players can login and logout during the match.
Is there any better solution to this?
What are you using for the Pitch?
Add controller pitch input
I'm wandering what's the best practice to call a delegate within server rpc from a client.
What are you trying to accomplish?
You might want to try "GetBaseAimRotation" instead.
Thank you, I will give that a try
I have a spawner actor (in game mode) which spawning items in the world and my characters use a delegate to spawn items in the world through it (I did it to avoid storing all information about the spawning actors within my character class). Everything works fine until I try to spawn an actor from a client, my delegate just doesn't work, because it's bound only with player controlled character.
now it's getting hilarious, best I take a video, just used GetBaseAimRotation
So I'm thinking how I can make it pretty
BaseAimRotation uses a replicated pitch value for non-autonomous proxy fwiw
I mean, Spawning is a Server thing, you shouldn't really let Clients spawn Items, unless it's a byproduct of some interaction that the Server doesn't know about (Key Press for example).
And given you are on the Server then, you can just get the GameMode and call the method on it?
interesting, cuz now it snaps in half and goes crazy, works in the replay like that too
Never really heard of someone using some convoluted Delegate System for this.
only for the other players tho, not the user controlling the character
Maybe you expect different Pitch values?
Yeah the user controlling the Character uses Control Pitch
Shouldnt really be different though
it is a massive difference, let me show you lmao
What do I do then if I need to initiate spawning from a client? If delegate system is bad, maybe using interface on my spawner will be better?
What does the Interface do here?
You are just slapping random stuff onto your spawner :D
What are you spawning anyway?
Pickable items 🙂
Like, dropping them from an Inventory or enemies that die?
When I drop those from the inventory of my characters
Then just handle that in your InventoryComponent
Or whatever has your Inventory
ServerRPC -> SpawnDroppedActor
So then my inventorycomponent will have to store all the items in the game? Isn't it bad performance-wise?
Why would it need to store all the items in the game? Your Inventory can't really drop an item it doesn't have, or?
hahaha
My items are uobjects and pickables are aactors
WELL
So my inventory now only operates with uobjects
Most peeps usually make Items a combination of replicated UObjects + a UDataAsset with its read only data.
And then use the AssetManager to handle the DataAssets fwiw
If you drop an item you can tell the Server what Slot the Item got dropped from and it can spawn the actor with the data
There is no need for your Inventory to know more than that specific Item that is being dropped
- whatever other items are in the inventory of course
Yes, so my inventory then will need information about pickables, I was trying to avoid it, because it seemed better for performance, isn't it?
THIS PLUGIN reads on game start the contrllers and there team variable
but how can i set team variable before game start?
A "Pickupable" is usually just a container with the data that is already in the inventory, right?
So what's so bad about having a reference to one single class that you fill with the UObject
You are overcomplicating stuff for some unknown gain of performance that you don't even know you need