#multiplayer
1 messages ยท Page 383 of 1
@thin stratus have you ever seen party based P2P hosting? like 2 parties constisting of 4 players, party replicates with the party leader, who then shares the information with another party leader
who then shares it with the party members
@slim holly talking about something like Typical MMO raid structure?
afaik mmo is still one auth because of the loot
Im thinking data transfer between 2 listen sessions
@slim holly No. Parties that join each other have one single host. The sub leaders are just kept in a list to maintain the sub parties.
@slim holly You need one authorative host ideally in these situations. If you wanted to somehow link two sepperate Listen Servers you would have to write a custom abstraction layer that communicated between the two. Far more work than just hosting a single game session and having two groups as simple abstractions within the code.
@ember needle I also got the nickname of my players but I did so using the subsystem, just in case you need it:
ULocalPlayer* DefaultLocalPlayer = GetWorld()->GetFirstLocalPlayerFromController(); const FUniqueNetId& UserID = DefaultLocalPlayer->GetCachedUniqueNetId().ToSharedRef().Get(); const IOnlineSubsystem* OnlineSub = IOnlineSubsystem::Get(); if (OnlineSub != nullptr) { const IOnlineIdentityPtr IdentityInterface = OnlineSub->GetIdentityInterface(); if (IdentityInterface.IsValid()) { const FString& PlayerName = IdentityInterface->GetPlayerNickname(UserID); . . .
I wonder what nickname would the gamestate have if you are in OnlineSubsystemNull
Hey guys, does anyone know why i am getting this error: While compiling E:\Program Files\Epic Games\UE4 Projects\FortniteProjectSource\Intermediate\Build\BuildRules\FortniteProjectSourceModuleRules.dll: ERROR: e:\Program Files\Epic Games\UE4 Projects\FortniteProjectSource\Source\FortniteProjectServer.Target.cs(8,12) : error CS1729: 'UnrealBuildTool.TargetRules' does not contain a constructor that takes 0 arguments
i am trying to make a dedicated server
this is the code https://gyazo.com/00263aa567de1de1176a8a4ea8ab183c
is that the public class bit?
its c# equivalent of : Super(Target)
i mean, where do i put it, i dont really know any c++\
public FortniteProjectSourceServerTarget(TargetInfo Target) : Base(Target)
i can't recall if its base or Base
but only 2 options
ok ๐ thanks, i'll try it
oh yeah, it's asking for lowercase
got it :), when i cloned the project, because things don't get renamed i have to use old naming
thanks @winged badger
when i am building the Development Server, do i have to build the whole SLN or just the proj? because the source engine takes forever to build for me
I need some advice. I'm trying to replicate grabbing objects and to ensure smooth grabs I'm turning off replication of the objects position when the object is grabbed and turning it back on when the object is released. This works great in that the grabbed object is replicated accurately but there seems to be a hiccup every now and then where because replication is turned off, there is a risk of the item be desynced. Is there a better way to do this?
objects here are actors?
you can try and do only bReplicatesMovement = false; instead of bReplicates = false;
yea that is what I am doing
to be clear I do all this on/off ComponentToRelease->GetAttachmentRootActor()->SetReplicates(true); ComponentToRelease->GetAttachmentRootActor()->bReplicateMovement = true; ComponentToRelease->GetAttachmentRootActor()->SetReplicateMovement(true); ComponentToRelease->GetAttachmentRootActor()->ForceNetRelevant(); ComponentToRelease->GetAttachmentRootActor()->ForceNetUpdate();
so on grab its the inverse of release which is what you see
I thought this would be safe enough but like I said under certain circumstances they desync
they attached to anything while grabbed?
nope
do you know exact conditions when desync happens and how does it manifest?
I guess I need a confirmation from client that clien has the object
server should never require a confirmation from client about an action it peformed
attaching the GrabbableActor to the Grabber might do the trick for you, depending on your game/setup
its Transform would become dependant on the Transform of whatever Actor did the grabbing
until released
Client grabs, server knows client grabs, turns off replication for the object, then client thats it, then on release server knows client releases and then turns rep on for object and client releases
Hey guys! I got my dedicated server working, although in steam it only shows up on the LAN category as far as i can tell.. There are no errors in the server console. Does anyone know what's going on?
i've port forwarded port 25017 and 7777, allowed the ports through the firewall
hmm.. if i have steam closed when i start the server, it allows me to connect to it using open console command
@twin sorrel You need to check the internet tab from another machine. If you check it from the same machine you run the server on, you may or may not see it, because your router may or may not hair-pin the signal. This isn't predictable and avoidable. If you can't see it from another machine, there's probably some config parameter wrong with it.
- Steam's range of query ports is not limited to 27017. It's more like 26950-27050. You need to be certain 27017 is the one your server is using.
@fleet sluice what's odd is if i start the server without steam open, it shows up in my ingame server browser and other people can join using "open [ip]:7777"
but when i have steam open when launching the server, it doesn't show up in my ingame browser and neither me or my friend can connect using console either
@winged badger Issues seems to be, Actor Movement Replication is not 100% accurate, and the more lag the more of a difference between the Actors actual position and clients perceived position. So Client can issue command to server I want to grab, server gets command eventually, executes its netmulti cast which tells the server to Grab ( I assume that is more or less instant) client eventually gets grab but now object might not be there any more from the delays in both the commands issued and Actors Replicated position so client's cast to grab fails and I'm left with the server having the client grab it but the client not seeing it as grabbed because it isn't actually grabbed client side.
Only reason for turning of rep is so the client can handle the object nice and smoothly
Trying to only replicate the action of grabbing is tricky
Replicate movement is entirely useless the moment latency is introduced, they should either remake it with prediction and interpolation or remove it
Currently it does no more than deceive new devs into believing it exists
@grand kestrel hmmm, yea I'm researching how to grab fast moving object in multiplayer
I'm not sure interpolation would help? Maybe improve? I thought they did that for character movement component
Of course you need interpolation for corrections otherwise it teleports
Do I have to just replicate some floats manually and interpolat myself?
I wasn't actually responding to your case, I meant in generla
You're thinking of something different too, interpolation for client corrections isn't that simple, and there is no prediction to begin with so
Yea in this case there is no prediction to benefit from
It's just physics moving an object
Hmm, tricky
I could try a wider cast maybe like a sphere cast
Gives more room to grab an object
Rather than a line trace
sending a ServerGrab in which case server attaches the GrabbedActor to the PlayerCharacter should work tho
as the attachement replicates
AttachedParent of whatever the variable is called
Never use attach
Physics handle grab component is what I use
I use net multicast reliable to do the grab
at about the same time you turn the replication off?
and it has the replicated Object's NetID (reference) as an argument?
Not using any net IDs. The turning off/on happens in the grab/release netmulticasts respectively @winged badger
SpawnActor is crashing in multiplayer for some reason. Tried calling it from the GM and the GS thinking that maybe the replication of the actor calling SpawnActor is relevant, but that didn't work.
Tried adding a delay, but the problem is somehow with the SpawnActor node itself for some reason.
You sure its not an issue with the Actor your spawning?
hey, do u know any addons to make android game multiplayer but with dedicted server?
Hi, would anyone know the proper way to restart / reset a level for example is team 1 won the game how would i make it so the server restarted the level
Just default all stuff and move people to where they need to be
true
i also found to execute a console command "RestartLevel" lol
lmao nvm turns out there's a function in the game mode called "restart game" im an indiot
am still struggling with this same problem
I have a player set up like this
Mesh is not replicated
There's a multicast that will ragdoll it for every player (since replication doesn't matter for dead players)
by disabling movement, then simulating physics on the mesh
I'm aware this detaches the mesh but my bug isn't related to that
on servers with any lag (including the default "Start Dedicated Server" in the editor) the camera will offset from the mesh in the direction the player was moving when ragdolled and stay there
there's no way to move it back so it focusses on the area n away from the mesh like it's on a second arm
spring arm offset is 0 0 0, camera offset is 0 0 0 in all cases
why is it offsetting
turning off Ignore Client Movement Error Checks and Correction immediately before detach doesn't change the behavior
neither does using a seperate camera for ragdolling
some deep part of ue4 is causing the problem and i can't find which
I've done a lot of trial and error to debug the spawn actor code and regardless of what Actor I'm spawning (even if it's just a plain AActor), the SpawnActor command will crash the editor. The only way to get around it, I've found, is to select "Do not spawn" on Collision... which is really weird because even when I try to force spawn at an arbitrary point in open space it still crashes the game.
It only ever happens in a multiplayer context, though, which is why it's so puzzling.
Could you show a stack trace of the crash?
Sure -- the call stack in VisualStudio says that it has something to do with a Replication error. I figured that maybe since I'm calling SpawnActor from the GM that somehow that created a problem in multiplayer, but even if I try to do it from the GS instead it doesn't change the symptoms.
I'll screenshot the call stack in a moment here
@brittle sinew Here you go:
I've isolated the problem to the SpawnActor blueprint node itself, which is crazy to me. My intuition said that somehow spawning in a for loop was going too fast for the server to replicate properly, but when I tried just only spawning 1 actor in total it still would crash. So I'm almost out of ideas right now.
Hmm...what version of the engine are you on?
4.16
So based on that, it looks like the crash only happens in the PIE? And so if I take my project and push it up to 4.18 then I won't have to worry about it anymore?
I hope that that won't cause any big problems. My project is getting pretty far along (even though it's almost all a huge amount of gameplay programming)
I can't tell you for sure. ยฏ_(ใ)_/ยฏ
It looks like the exact problem you're running into, however
I appreciate the help though -- that link was helpful!
I would make sure to have your project under some sort of source control before you even think about upgrading your engine, however
Things can go wrong, but that doesn't mean you have to bork everything :p
I've got it setup using the default Git beta plugin there so I do at least have a repo that has been going all throughout the project at least
๐
And since it's all programming I don't have any massive binary files
need some help been trying to print a string variable from a player / player state (idk which one to use to print) and im trying to make the server print the variable when i overlap a trigger box and i can not figure it out? Anyone got any idea?
seems like the problem i was having was caused by DisableMovement
which leaves the camera at its predicted offset without ever moving it back
guess I can't use that
Hello Everyone, I can't seem to understand how to persist my playerstates when I servertravel seamlessly... Besides the setting in the GameMode, what else do I need to set?
I am using the Event Copy Properties and Event Override With
@grand kestrel - pinged the team. Will let you know when that IP is unblocked.
@ember needle When you say "the setting in the game mode", do you mean just checking whether to use server travel?
If that's all you did, then you should know that there's another thing you gotta do: define the playerstates as transferable. Cedric_eXi's PDF thing in the pinned messages for this channel explains it specifically if you need to see how to do it
If you're referring to the Event Copy Properties and Event Override With that's what I did
It looks like that it's the game mode you come FROM that defines the seamless travel... DUH. I was setting the destination one.
thank you @versed socket for the help
I'm having difficulty in spawning an actor from a list of PlayerStates from the GameMode:
https://gyazo.com/99bbb77759444c164ff8195df41960e0
When I do so, actors are spawned but I get no control of them whatsoever, I spawn with no possibility of doing anything
what am I missing?
try spawndefault controller
set the controller, then spawn default controller, spawn default controller, spawns the controller and posseses it
Hey, is there someone who could help me out with a problem about replication?
possibly
I have a controller base that derives from APlayerController and should replicate the current interactable item (an item, that is being set by the character controller if there is an object in front of the player).
The CurrentInteractable member is being set on the server, but it doesn't replicate to the client instance of the APlayerController
even though the the replicated flag is set and GetLifetimeReplicatedProps is setup correctly
@meager spade yeah I tried that to no avail unfortunately
Hello,
I'm working on a multiplayer RTS game with a third-person perspective and I achieved movement replication with AI Move To. Basically, a Player Controller owns a character, but an AI Controller is the one actually controlling/possessing it.
The problem with this approach is a laggy movementation feedback for our clients. I've read that one solution to work around this would be to reproduce the movementation on the client and only leave the server to correct if needed. The issue here is that I can't reproduce movement on the client-side because an AI only exists on the server.
Not sure how to proceed on this. Ideas? ๐ค
Could someone help me pls ๐ I get this error after the client tries to join a Session. I never changed the name of the map and didnt move the map. ( I use Blueprints)
Quick Question: I'm working on an inventory system & I want the players inventory data to be stored on the server, Do I set to replicable & then when calling it use: server has auth?
is there build in way to either get client->server ping
or o get approximate time withing miliseconds accuracy from server and client (for timestamps)
Did someone tested over here how the net update frequency affects the net performance as in what extend?
its going to vary as to how much is occurring that requires work, but effectively reducing it will help reduce the diff checks on data it is constantly doing
it can be pretty dramatic improvements, you should try tuning to be as low as possible for what works with your game.
(it also isn't a silver bullet, so some actors clearly need higher rates than others)
Why is this running on the dedicated server? Can someone help me?
The GameMode only exists on the server.
There isn't a separate "owning client" on which to call it, so it just executes locally
But this is a RPC event, shouldn't it run on the client?
The Client that gets passed via teh NewPlayer
But the RPC itself is on the GameMode
Why not call the RPC on the PlayerController?
Ah right. I thought that image was two somehow
hum, I think I understood. Gonna take a better look at RPC events. Tyvm!
That and what classes exist where
Cause any form of replication in the game mode doesn't make sense
^ what @thin stratus said. No sense
any replication of game mode info usually is forwarded to the game state which IS a replicated actor that is on players
Thanks guys, got it working. Do any of you have an article of a better workflow when using dedicated servers?
Right now whenever I change something I have to:
- package my game
- build using "development server" target on VS
- copy the generated myGameServer.exe to the packaged game's binaries folder
- run the server; run the client
Well you only need to rebuild the server if you actively change the server code
Is it possible to pass UClass as a parameter in RPC function ?
Should be, yes
but it's null always
Well at least I passed around character classes before
It's quiet complex class which nested objects
But I think one shot replication will be much more efficient anyway
Have a question... can u play on project with your friend ?
@glacial hamlet right yeah, there is a min and a max for those but I observed that in dc server testing in editor the net updates are more frequent than in listen servers. I also observed that 3 clients on listen server makes the experience smoother with default values than 2 clients, and for me this makes any sense.
ah right, and thats because it'll try to auto throttle up and down with a windowing technique not unlike TCP/IP backoff mechanisms
it tries to auto-scale a bit
i think when you've got a listen server it knows that the load on that machine will be much higher for the given host (because they're playing also)
Yes I'm fighting against this thing because I'm working on a generic interpolation for pawns based on what cmc does
But I don't know how bad would be to force that value to not go under certain thresold
ahh
my gut feeling is there is some bit hiding somewhere that will help you ensure it stays at a minimum, where that is -- I am unsure
So every net update I decay the translation offset of the root scene component to look as smooth as posible
But with low values it doesnt look quiet good, because the pawn gets the vector and quat info every time the actor gets an update
So it jumps around a bit trying to adjust its position
This isnt as extreme with a higher net update value... :/
Hmm when i connect to dedicated server my world is black
The black level is called Entry (Client -1)
I have code that spawns actors on the server and adds it to a ReplicatedUsing= TArray, when it replicates with the ReplicatedUsing the array elements are null, however when you spawn an actor on a server it should spawn on clients -- and this is the same code I was just using, only I moved it out of ACharacter into a UActorComponent
so it worked while it was in ACharacter?
and you didn't forget to move the GetLifeTimeReplicatedProps as well?
No
those actors are replicated?
Yes
as is the UActorComponent itself?
along with the variable you might had added to store it?
And they are spawning properly
Yes
TArray<ARSItem*> DeferredPickups;```
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME_CONDITION(URSEquipmentHandler, DeferredPickups, COND_OwnerOnly);
}```
{
bReplicates = true;
}```
{
Super::BeginPlay();
if (GetOwner()->Role == ROLE_Authority)
{
ProvideItems();
}
}
i am not 100% that ReplicatedUsing implies Replicated
at least, i never tried using one without the other
Could there be a race condition between depending on a replicated bool to perform an action and the action itself being an RPC?
I'm thinking there could be, if the RPC gets there before or after the change of the bool.
No guarantee in the order?
ReplicatedUsing does indeed imply Replicated, adding it is redundant
none as in no guarantee of the order
ok then I see another potential problem with my code
I have my IsGrabbing replicated. So Client tells server to grab, server sends out a net multicast, server says I grabbed setting IsGrabbing to true then its off to the races. If client gets IsGrabbing first then it won't even be able to grab when it gets its RPC from the server to grab, since I perform that check
sending a bool and a RPC is not recommended
you can just send a bool and do ReplicatedUsing
ReplicatedUsing?
a function that is called after the new value has been received from server and set
Does anyone know if there is a way to prevent a client from being disconnected from the world / unloading the level when a host leaves, or if thats even possible? So essentially they stay in the level, in their same game state, but all other clients and host get disconnected.
oh yea ok I know what that is
UPROPERTY specifier ReplicatedUsing = <function name, convention is OnRep_VariableName>
hmm
so instead of doing a net multi cast
your saying to just have the server perform the action and then use RepUsing?
since the bool will change and call the function for everyone else?
imo NetMulticast should only be used to notify the client that it should present something to the user
but shouldn't carry any game affecting functonality
(Play a sound, play animation, show some widget)
well the order of operations would be the reverse. I don't want the bool changing then an action. Perhaps this bool doesn't even need to be replicated?
Maybe it just needs to be local
You can make entire AAA games without ever using NetMulticast
Thanks to UE4's efficient replication system
Vaei, your OnRep does fire, it just doesn't have the data?
The OnRep fires, the TArray has the same amount of elements, they're just null
It's filled from SpawnActor
Which worked when it was done from ACharacter
Sec
ok I think I'll do a comparison. If the server updates the bool saying player has grabbed, I'll cross check that with a local grab and if it doesn't match attempt to perform a grab and if the grab fails force the object to be grabbed, thereby insuring the grab is synced
URSEquipmentHandler::URSEquipmentHandler()
{
bReplicates = true;
}
void URSEquipmentHandler::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(URSEquipmentHandler, Slots);
DOREPLIFETIME_CONDITION(URSEquipmentHandler, DeferredPickups, COND_OwnerOnly);
}
void URSEquipmentHandler::BeginPlay()
{
Super::BeginPlay();
if (GetOwner()->Role == ROLE_Authority)
{
ProvideItems();
}
}
ARSItem* URSEquipmentHandler::ProvideItem(TSubclassOf<ARSItem> ItemClass)
{
if (ItemClass)
{
FActorSpawnParameters Params = FActorSpawnParameters();
Params.bNoFail = true;
Params.Owner = GetOwner();
ARSItem* SpawnedItem = GetWorld()->SpawnActor<ARSItem>(ItemClass, GetOwner()->GetActorTransform(), Params);
return SpawnedItem;
}
return nullptr;
}
void URSEquipmentHandler::ProvideItems()
{
for (TSubclassOf<ARSItem> ItemClass : StartingGear)
{
if (ARSItem* ProvidedItem = ProvideItem(ItemClass))
{
DeferredPickups.Add(ProvidedItem);
}
}
}
void URSEquipmentHandler::OnRep_DeferredPickups()
{
ARSCharacter* MaybeCharacter = (GetOwner()) ? Cast<ARSCharacter>(GetOwner()) : nullptr;
if (DeferredPickups.Num() > 0)
{
for (ARSItem* Item : DeferredPickups)
{
if (MaybeCharacter)
{
MaybeCharacter->GetCharacterEquipment()->ServerPickupItem(Item, true);
}
}
DeferredPickups.Empty();
}
}
I guess that leaves one concern, will the replicated bool be reliable?
Or is that not even really a concern?
Doesn't matter, it's null by then
and NetMulticast has some drawbacks
with default NetRelevancy settings any client outside of 15000 UU, as well as any client connected after the multicast was fired
will be completely oblivious that NetMulticast happened
ok currently attempting a rewrite without net multicast
with replicated variable and ReplicatedUsing they will end up with correct information/state anyways
The only real advantage of NetMulticast is it's instant
And replication tick isn't exactly slow, unless you set it to be
hmm what kind of delay can I expect from the bool ?
You'll never notice it
half a ping + 0,05 seconds tops
Unless have low net frequency
Would this work well with latencies as high as 150?
if you didn't touch the NetFrequency settings
It works at any latency
Is that a project setting?
Vaei, if you breakpoint inside your OnRep
Already did, the array is null filled
But of course I broke prior to rep to make sure it wasn't being null filled, and it's not
It's filled correctly
I think I can find a better way to handle this
By handling all pickup logic from OnRep_Owner()
That way server spawns it, sets the owner, by the time it spawns and propogates to the client it definitely can't be null
it might be the order of things
Worked from ACharacter though which is why its weird
if you were to spawn your actors
then after all are spawned, append that array to DeferrredPickups
this way if client didn't get the replicated newly spawned actor yet
it doesn't exist on client yet, and when you add it to DeferredPickups, the reference is not valid on client yet
and if this is the case, it working before was "lucky" but was infact a timebomb
you will also trigger the DeferredPickups replication far fewer times if you just assign the entire finished array to it then add items 1 by 1
Anyway
Moving it to OnRep_Owner() seems to be the way
That way when an owner is set it'll tell the owner to pick it up
Instead of the other way around
but you do have a race between AARSItem actors replicating and a TArray<AARSItem*> replicating
Yeah indeed
what do server and client do with those actors?
Is VR CO-OP Possible? using MSI Backpacks?
Depends on what you mean by coop here
AT remote location with each VR headset having its own setup, sure
I was thinking this right
Using Opti track to capture two MSI Backpacks
ANd sending that data to UE4 then having it display in VR
if that makes sense
Do you guys know how to make the server less strict on replicating movement of a pawn (Not using CMC) to the owning client? Trying to figure out how to make the client's movement feel better.
Or should I not enable movement replication on the pawn and write my own functions for that?
So does the update of a replicated variable not happen if the variable gets set to the same value, in this case a bool at false told to be set to false again.
Hi all, would anyone know how to have the server spawn in an actor and have the player who requested the spawn possess the actor?
@tiny scaffold Download and check out the shootergame, great learning resource
alright, where can i find it
Epic Launcher
ahh
Under the Learn tab
scroll down a bit
probably other multiplayer resources there as well relevant to that
Thanks @neon mango
now that i have this to learn lol if only i knew how to use advanced steam sessions on a dedicated server ๐ญ
Yea IDK about that yet
spent like 2 days trying to get it to work but nope
The shooter game uses steam to invite players and such maybe your answer will be in there?
Not sure what advanced sessions means?
advanced sesisons is a plugin
this might work so
Advanced Sessions Plugin
Message to users 09/08/2017
I'd like to note that the original intent of this plugin was to shore up blueprint support for sessions
I'm having a pickle with the fact I need to trigger an OnRep for a bool value that stays the same
I must be approaching this wrong
if the bool doesnt change i dont think onrep will be call xD
@DarkMatriac yea its why I'm trying out reping a float instead
Does OnRep notify the server as well?
or only clients?
@neon mango It notifies the server and client when the client modifies that variable I think if I remember well
Ugh i still cant figure it out would anyone know how to possess and actor that has been spawned by the server on the gamestate, im trying to make it so the player doesn't spawn in right away but allow them to select a team then spawn an actor (their player / character) at a location and then have the client possess it. Ive gotten it to spawn but cant possess it.
@wide iris @neon mango @gloomy tiger Repnotify calls in BP on server and clients when the variable gets modified by the server. In cpp you have to call the Onrep function manually for the server, as it only calls for clients there.
Also replication always only works from server to Clients. So the client setting the variable doesn't do anything
@thin stratus you wouldnt happen to know how to possess an actor that was spawned by the server? like from a gm on event onpostlogin works but nothing else
ok ill try that
@thin stratus i tried this and the custom event from the game mode and i am using a widget to cast to the game mode and trigger the event
on the sever
Correct
If you now get a reference to the GameMode on the Client. What would that mean?
Plus the fact that the GameMode, only existing on the Server, is not replicated
The reference is null
The client can't get it. It can't call events on it
Especially no RPCs
You have to call the RPC on your player owned actors. E.g. Playercontroller
ah ok so would i create an event on the playercontroller which would run on server? creating the pawn then possessing it?
Yes, or simply getting the gamemode and telling it to respawn the player. As soon as you are on the server, the gamemode is available
ServerRPC in the PlayerController - > get GameMode - > respawn player (passing the playercontroller who calls the event along!)
In addition, you can't use get PlayerController 0, cause that refers to the servers controller as long as your on the server side. You always need a reference to the controller of the player that wants The Respawn
ah ok ill try from the player controller
Cheers
Thanks, still learning the networking part of unreal
It worked thanks sorry for being such a noob, is there any documentation about it i currently have 1 pdf to read through but any others help
Yes if only someone had written a compendium
Unless thats the pdf ๐
Well, look at pinned messages either way
Haha i just realised the name woops yeah im reading the one cedric made but i havent gotten through it yet
The issues you are facing should be resolved with the compendium
No idea what else exist, as I already grabbed things from everywhere to create it
Just avoid Epic's lobby tutorial
Will do
I do the same and have issues
the issue is that i save the playersโ role in their respective states while in a slotting level, but when the game starts (seamless travel) the GameMode and PlayerControllersโ BeginPlay events are run before the PlayerState variables are copied over (with the Event CopyProperties)
so when i spawn players in the GameMode according to the role specified in their state, errors occur because the role is still None since the copying over of PlayerState variables hasnโt happened yet.
hence i have to do something silly such as loop-checking in the GameMode that all PlayerStates have the role variable not equal to None before spawning.
does someone have a better solution?
would be appreciated...
try overriding AGameModeBase::ReadyToStartMatch()
when it returns true, that's when BeginPlay gets called on everything
Hi, anybody can tell me whether the input event will trigger on both server and client๏ผ I use "add input movement" to cause my server pawn move, and the movement will be replicated to clients. But when I use this node to move my client, only my self will see the movement, server and other clients won't see it. And I don't know why it's happening. So any help or explanation will be appreciated. Thanks.
Consuming InputVector fires a Server RPC in the MovementComponent
which moves your character on the server, then it replicates to clients
so it works out of the box for movement
any other input action you define is fired on client only, and needs to be RPCed to server for it to take
Hey guys! i set a replicated variable on the server and it is a different value on the client... am i confused about replication? or is something wrong?
is the object that the variable is a member of also replicating?
Ahh
Genius ๐
thanks @winged badger
it was an actor variable in which the actor that the variable of wasn't replicated
i didn't think that mattered
but thanks
@winged badger thank you, I will try when I got home.
@winged badger does input axis event fire on both server and client๏ผ
@ember needle @winged badger OnSwapPlayerControllers
In GameMode
Gives you old and new one
good to know ๐
How can that solve the fact that when BeginPlay is called on the GameMode the PlayerState are not copied yet?
last time i tried it, it wasn't called
That you can move the data between your PlayerControllers and don't need the PlayerState for this?
its one of most bizzare mistakes you can make, forgetting Super::GetLifetimeReplicatedProps(OutReplicatedProps); in GameState
then the MatchState won't replicate, and BeginPlay won't be called on clients at all
then I'll enter other issues, such as the fact that right now all the mechanism relies entirely on the PlayerArray in GameState
(which contains states)
Sometimes it just feels that we'd be better off in moving everything to GameInstance and forget about all of the race conditions of what gets called when
It's actually quite easy if you make sure that things like ids and states are saved in controller and state
that's what I am doing, and my problem is the one I said unfortunately
my SlodID is stored on PlayerState because the good news is that PlayerArray on the GameState seems to be correctly updated before anything else gets called (and I hope this is the case also for non-LAN connections)
and because in this way all players already know who is in what role (since PlayerState is replicated on all clients)
So: when the game starts, the GameMode gets loaded, it tries to spawn players, but their states have not yet been copied over from the previous states.
I don't think I'm doing anything weird here, and I've followed all compendium / tutorials / recommendations I have found on each role of the various BP...
anyone here know how to make a client server for lan with out using steam
i cant use steam for this project
i do have a server running but i cant seem to be able to find the server in a server browser im not sure on how to set it up
Hi!
Dedicated Server session using OnlineSubsystemSteam not findable. Can anyone explain me why this may happend?
I used ShooterGame editor runned as -server and logs looks like good, but client can't find it, while the client hosted as listen is findable nicely...
online subsystems aren't loaded in editor
hi just a question i dont know if this belongs here but i feel like it might, im using a mysql plugin for my game would the database location (somewhere in the world) matter for people?
do not directly connect to a mysql (or any other database) directly through your game client
whats the best way, and why? (just wondering) @lost inlet
because people can find out the credentials from reverse engineering your game and then do what they like to the database
use a HTTP endpoint for stuff like that
well you need to state your use case
what do u mean sorry
what are you using a database for
storing player data like their level and currency, only reason i want to use a database was because i wanted to be able to edit another player variables if i needed to for say moderation purposes or something like that
unless there's a way to do that with the save game
so is this a multiplayer game?
yes
then use HTTP and create a REST API for your game client and/or server to interface with
any persistence should be handled by the game server rather than clients
Alright ill have to try learn all of that
hello
is the use of Open Level a standard
or should i switch over and start using sessions?
Alrighty everyone, I've run into an issue regarding actor rotation replication, and its driving me up the wall.
I'm currently working on an update to my marketplace asset "Advanced Locomotion System" (you can check it out here - https://www.unrealengine.com/marketplace/advanced-locomotion-system-v1), and my finalstep is to get it working with networking. So far, I've got everything working, but I've hit a wall trying to replicate rotation.
In this new version, I'm manualy managing character rotation within the CharacterBP. I know that the Movement Component has some built in rotation settings, however the options are very limited, and dont offer much flexibility. Doing it manually enables me to have full control over how the character is rotating at any given time, and also allows me to interpolate rotaiton to keep everything nice and smooth. Ive created a function that sets a TargetRotation variable, and then interpolates the actor rotation to the target using a custom interp speed. I can call this function on the tick whenever I need, and everything works beautifully (for singleplayer).
Now for multiplayer, my goal is to calculate and set rotation locally, and then send the new rotation to the server so it gets replicated to the other clients. This is where I'm getting an issue. In my rotation function, I added a call to an RPC event that sets the rotation on the server, so whenever I call my rotation function, it also sends the rotation to the server (I also make sure I only call this locally, so it isnt getting called by other clients or anything). However, whenever I do this, rotation on the local client becomes jittery, and interpolates at half the speed. From the other clients perspective, rotation appears normal. My best guess is that it has to do with the "GetActorRotation" function that gets fed into the current pin on the Interp node. I'm assuming it gets the actor rotation from the server instead of locally, and since they are briefly out of sync, problems occur. I've also tried messing with every replication setting I could find both in the Character class and the Movement Component, but nothing seems to solve it.
Any insight into why this is happening?
Also, heres a link to a similar question asked 3 years ago on the answerhub. It was never fully answered. - https://answers.unrealengine.com/questions/308421/getting-different-result-using-set-actor-rotation.html?sort=oldest
And finally heres a link to a vid showing off this issue (from the question on the answerhub) - https://www.youtube.com/watch?v=n15P6ATh8Ms&lc=z23wuhbhmlerhrdf1acdp43apxv3ilct02u5ngboe3hw03c010c.1522735980964677
jittering becomes because you're doing the rotation math on server
if you want to have it client authorative, you just send the same value you used for the rotation to server
Thats what I do. I'm not (shouldnt be) doing any rotation math on the server
I calculate and interp rotation locally, and then send that value to the server using an event.
(see the second and third image)
debug that
you shouldn't be doing role checks inside functions anyway
unless it's important for the function content
Even if I take it out, and do it before I call the function, its the same result.
Ive done extensive tests.
and extensive test results tell you that one of them is not setting a proper rotation if it's jittering
so, usually it's a role check gone wrong
also now that I've seen the video, what is the data driving the rotation variable
it's clearly going faster on server
Right, thats my issue. Interpolation is slower on the local client. (The video isnt mine)
I think it has to do with the "GetActorRotation" function
oh yea, engine default function bugged
Hi all, I've been having some trouble connecting to my LAN game from a client on the same network. When searching for sessions, it comes up with the correct details (IP, Hostname, Map, Mode etc), however, upon UEngine::Browse it has the current map name on the prospective client as the URL's map, despite having the correct details for the rest of the URL. It appears that when you step up in the call stack that the engine uses the LastURL as a base for the new URL. Why is this the case and how can I prevent this from happening and ensure the target server's map is the map variable of the URL?
yes that was sarcasm
reason I asked for the data that drives the rotation is that you used dedicated server, which does not load all the data
so it could very well be a rotation value of something that doesn't exist
then it could be "bugged"
Well the video isnt mine, but I use variables on the local clients.
Such as velocity rotation, looking rotation, etc. I also dont call my rotation function (which handles interpolation) on the server.
If I quickly put together a test project, made from the third person template, would you be willing to check it out?
@slim holly If you are interested to test this for yourself, heres a simple project (20mb) - https://drive.google.com/file/d/13gkp3rgesQi--CPzNDmA65bWMG8YBGQs/view?usp=sharing
Hi all, relating to my problem above, it appears that the travel URL only provides an IP address and Port, no map (even though I can see it in the session info). I'm creating this travel url the same way Shootergame does, so I'll take a further look into this
If i want my characters to open a door with a key when closes to the door, should I get the input inside the controller and check if there is a door nearby? Or should I use the node Enable Input when a character get close to the door? which one would be a better approach?
you can't send a RPC to server from a door actor
as its not owned by your PlayerController
so I should get the input inside the controller?
and tell the server which door I want to open?
What is more efficient guys. Send a quite complex class via RPC to client or set a replication of that class (COND_InitialOnly) ?
Hey all, what should a typical TravelURL for a LAN game look like? Mine is just coming up as an IP address with a Port and no other info resulting in the default map being loaded
Well, dependso n the subsystem you are using
Steam is probably returning the p2p address
While oculus returns an oculus id
Subsystem NULL in this case I think
Well that would probably show the ip as travelURL
The actual map to join is returned when the server greets you iirc
Are you sure that you actively join the server?
Maybe you time out
It says that I am successfully joining session
but during server travel, it uses the LastURL as a base, combined with the travel to URL and results in the IP address of the host, but with the default map (as the map is not within the TravelURL string due to only the IP address and Port being returned during the GetConnectStringFromSessionInfo function in OnlineSessionInterfaceNull.cpp
As you can see, it only returns the ConnectInfo (which is used as the Travel URL) as the IP Address
Stepping up a couple of functions into the GameInstance (based on Shooter Game) we can see the following
It doesn't enter the if statement as it's successful, and it then passes the URL (only a local IP and port) into the client travel function
Then if you let it run and dispatch call backs, it gets to the Engine tick where it is aware the client needs to travel, and therefore uses the Travel URL above, but as the URL is only an IP address and port it does the following
So this is from the constructor of FURL, where it sets the map in the new FURL object, as the if statement is true, it sets the map to be the default map
On a dedicated servers log file anyone know why the -ABSLOG run argument would not add a ".log" extention?
Show us your code for hosting and searching
here is searching
and here is hosting
also here is the tutorial i followed https://www.youtube.com/watch?v=NW4QHiK6YbQ&t=2413s
Hi guys, this is my last multiplayer tutorial :) Add "set game input only". For mouse function. Sorry for bad graphics and pixels. // Project download: https...
@merry haven Did you set up your DefaultEngine.ini? Have you tried checking the "use lan" in find sessions? If you are using a virtual box on your machine, disable the virtual network adapter in your windows network settings, its known to cause issues
Also check your firewall
Hey guys, just curious. Is a source build of the engine still required for a dedicated server build or can we now do this from the install build?
Probably a super noob question but I have almost no experience with UE4 multiplayer
i have a strange but hopefully simple problem; i have a replicated actor being created on the server and given an owner in the spawn params (the owner is the player character, also replicated obviously). In the beginplay for this created actor the owner is null on the client. any way i can get it to not be null?
Owner variable also needs to be replicated
where exactly can i set that variable to be replicated?
this is just the inbuilt owner variable in spawnparams
@wicked spade in 4.18 at least, I have noticed my owners aren't not getting set when I spawn an item always.
I have been having to set them post spawn.
interesting, i can confirm the owner is being set on the host
it looks like the owner variable isnt replicated at all, even after the beginplay, which is strange because i havent run into this problem with other actors
I just had a quick question in unreal is cross platform supported?
@undone zenith yes
@versed socket so I could make it xbox and lets say Nintendo switch?
I believe so, yeah
Hey guys, anybody know why my Create Session node is failing?
it always triggers the error dialogue
@fluid moon have you set up your defaultengine.ini?
i wonder if theres a general calculation for server population vs landmass size
assuming you walk everywhere and population is unlimited
is 1000 players for 16x16km too much for example
that like 1.6 players per square meter
actually is 1 player per 16 square meters
it seems very crowded
i prefer to call it forced socialisation
but yeah thats a bit much
maybe 1 player per 100m
yeah, that's 160 players
I didn't know about the virtual box thing I'll check it out thanks @wicked spade
is ServerTravel meant to work in PIE?
it always brings my client back to main menu instead of the new map
iirc game instance has travel error event
set it to print to see if something goes wrong
SeamlessTravel isn't working at all for me... all clients get kicked to main menu
I've probably done something wrong
im afraid the only answer is to step through the code to see whats going on
Hi all, if anyone can help me out with my answerhub question on my multiplayer issue from yesterday, please go and take a look ๐ https://answers.unrealengine.com/questions/775923/connecting-to-server-causes-loading-of-default-map.html
Update on the above question (also posted on the question itself). When debugging yesterday, Machine A was hosting and Machine B was finding the session but with port 0.
However, I have just hosted on Machine B (right clicking uproject and clicking launch game) and then joined from Editor on the same machine and this time the IP address came through with the default UE4 port (7777). This resulted in the client joining correctly.
How can I ensure the host always hosts on the correct port?
I hope you are not trying the connection stuff from two PCs with PIE
PIE shouldn't be used at all for connections between two PCs
Always launch a standalone
Machine A (Host) is running standalone, Machine B (Client) is running VR Preview
Standalone doesn't seem to support VR anymore
So I guess my real question here now is why is my Machine A hosting on Port 0 according the the client?
@lost inlet are you sure? I got worked OnlineSubsystem Null and Steam on editor. But Steam worked only if game launched with -game or-server option
I really don't get how LevelStreaming is supposed to properly work in Multiplayer
@lost inlet I launched dedicated server from my project that using steam and created online session. All logs says the session successfully started. But client can't find this session (search started and finished with 0 results). Besides, I tried do that with ShooterGame and got similar problem. Why I can't find this session? Ini files setted to work with steam. And subsystem works (I can use different online interfaces, such as Friends, but looks like dedicated server session not registered in steam, this is strange, I see the packets sent to steam).
that sounds familar, i think there's an issue with how steam heartbeats are setup
unfortunately the steam oss shipped with ue4 is trash and you basically have to make your own fork of it
Well generally everyone has problems getting a Dedicated Server to run with Steam
make sure you have steam_appid.txt in the right place too
By default, these steps SHOULD work (but I guess they don't):
- Setup Steam in general, including Ini file
- Create your own DedicatedServer via Source
- Let the Server create a Session in "AGameSession::RegisterServer", making sure 'bPresence' is false
- When distributing the Server, making sure to add the steam_appid.txt and also the steam binaries (from engine folder) to the Binaries folder
However I think Steam also requires you to setup DedicatedServers in the partner page? Not 100% sure here
Been a while since I touched that
Can I use this steps with appid 480 for testing project?
Other info is: Epic didn't save the IP stuff in the Session info, so only the p2p stuff from Steam is saved
480 works well
Technically yes? It's just giving you tons of results of other games
we disabled the p2p stuff in our game
Which will get filtered
Other things are settings in the Engine which can't be changed with changing source
Such as the gamename
Idk what of this is actually required and what not .Everyone says something else
there's also a biggie that you need to implement yourself
authentication
that's why you see so many answerhub questions about "0 players"
/** @TODO ONLINE Server values needed to advertise with Steam (NOTE: Steam expects UTF8) */
#define STEAMPRODUCTNAME "unrealdk"
#define STEAMGAMEDIR "unrealtest"
#define STEAMGAMEDESC "Unreal Test!"
That stuff in OnlineSessionAsyncServerSteam.cpp
I found this pull request https://github.com/EpicGames/UnrealEngine/pull/2135 you say implement yourself authenitication do you mean that?
But it's very old pull request and still Waiting for review
That thing is so old, it breaks stuff
And is also not that great
It does good and bad things iirc
Last time I pulled it it kinda caused crashes
But you see the defines above
Pretty sure they need to be properly changed?
OnlineSessionAsyncServerSteam.cpp must be modified on server and client both?
At least I did last time I checked
i implemented it myself
but that PR shows vaguely what you have to do
though that PR makes more changes than are necessary
hey guys
I need help
something very small
I want to make a client owner of an actor
...but...
I don't know how to
i need the client to be able to throw RPCs on this actor
i'm using the node
Are you spawning the Actor?
Set Owner
Or is it in the level
In level
SetOwner only works if called on the Server
So what ever you do there needs to happen on the Server already
...mmh so just a sec...
Obviously only one owner per actor is allowed
Why a Multicast
for other aesthetic reasons
Well okay and your Multicast calls properly on the server?
that come after the logic
well multicast runs on all machines right?
il print a string now
it is running fine
i get both the server player controllers in the print string
but RPCs aren't working yet
know what
I probably know what is going on
....this is a controlled pawn... that probably causes the problem
nope its not that
can it have something to do with the fact that the actor i'm considering is a character actor?
Hm no sure. Never tried to set owner on a Character
I'm checking on both server and client
Usually that happens when possessing
and ownership works perfectly
We're running into an issue where if someone disconnects and reconnects, sometimes all the vfx that were spawned while they were disconnected all spawn at the same time when they log in. My idea would be to get the timestamp when the vfx is spawned and check the duration between then and when the client receives it and if the difference is too large, don't do anything.
Is there a better way to do this?
@unborn nimbus This wouldn't have anything to do with reliable vs unreliable?
So here's something weird: A player joins a server, a PC gets created, but there is no player attached to that PC. Dafuq?
no, i meant a player controller has no player attached
Pierce helped me, turnes out if your default pawn is None in the game mode, you get screwed, even if you do possess a pawn on login.
Sorry?
I never had issues with simply spawning a pawn on PostLogin and possessing it
So what do you mean with "screwed" here ? ๐ค
Create player has an extra bool that spawns a default Pawn. If you uncheck that, it doesn't do anything, at least I haven't managed to get it to work. So I left the bool flipped, and simply set the default pawn to NONE. This solved my problem.
However, when I run on a dedi, using OnPostLogin I possess a pawn with the newly created PC. However, that PC doesn't have a player attached. Printing a GetOwner on PC returns null as well. I've since changed the default pawn to the spectator, and it works fine.
@thin stratus
Also note that I'm not spawning a pawn, I already have it in the scene.
Blah, false alarm, its still broken.
Did I miss something? I mean this should possess a pawn :/
@west rapids i would try SpawnDefaultController
that would just add more controllers
Does the Loop even fire?
oh yeah, the entire event executes to the end
and no errors or anything
i just dont understand how a player controller have no owner
LogNet: Warning: UIpNetDriver::ProcessRemoteFunction: No owning connection for actor
ive googled this error but there's only one person who hit this before
and solutions are sketchy
things like replicating every variable and such
also his case was the fact that he was replicating the PC
You guys know how to specify a condition for replication in OnRep functions? I'm writing custom movement code and I need to get my struct to replicate from server to all instances of the pawn on various machines except the owning client, except during exceptional cases (they're too far apart, or the server is disallowing the client from moving, etc.)
I swear to god I heard something about getting an old value of your replicated property as an argument in an OnRep function.
AFAIK the values OnRep are updated first, so I can' see how you'd get an old value from that since it fires after being changed.
as for the other bit, try is owner or is locally controlled and then branch
I'm working with C++, and I recall seeing people mentioning how you can obtain an old value from the function. However, I tried looking and couldn't find documentation on that.
Seems like it'd be a very useful thing for networking though
@west rapids Is it possible to abort replication from the OnRep function somehow?
I don't think so, not from bp anyway.
i mean i told you that ur variables get updated and then OnRep is called
I don't think that function is designed for that, you can still probably modify it in C++
Well I'm wondering specifically about C++
If u want old values u can just store a cache on rep
How so?
@west rapids CreatePlayer is for local Players
Not for NetworkPlayers
It's splitscreen related
i dont use create player
yeah i did it for the local bit
Ah well
Anyway, as an info on that: The boolean is wrongly named
It#s for creating PlayerControllers
If you uncheck that, it won't spawn a controller for the player
omg ๐
at least last time I digged int othe source
well, thanks for the info
though i still have no clue why my controllers dont have an owner
u supposed to get a PC when u join a server, i get a PC, but it haas no owner
i have no clue why this is happening
oh right because "creating player" is a splitscreen term
remote controllers don't have local owners, there's the issue
i dont get what ur saying
when a pc is created its owned by the connection
so that u can rpc to the server
i cant even create a widget
locally
is this listen server?
dedi, listen works fine but just for server
basically it works fine for server
but i create a widget in the HUD class
so server should havev nothing to do with it
alright apparently passing the variable matching the type of the replicated property is gonna automatically set it to be the old value
thanks for the help everyone
well widget is local only anyway
I'm actually concerned how you got player into session without controller and without crashing the editor ๐ค
@twin juniper neat trick, ill remember that. Thanks for the update.
i did, the player has a controller
i got 2 controller,s session gives me 4, 2 clients 2 server
so its not like they are missing
so it's just not assigned to anything
but the thing is, you can't join session without being assigned one
assigned to a pawn?
so, if the postlogin controller is valid, then the ownership is removed somewhere down the line
what's the pawns default controller settings like?
but none of them worked out
there's auto-possess and stuff in the class settings
can't remember, what were the options for that
well, either way, fiddle with those
I gotta hit the bed
early wakeup
as long as the default settings are fine, you don't need the valid check for controller
player possess will override it
Um, do you guys know what the standard way to limit tickrate is? I don't really want to make my, well, everything tick more than 32 times a second.
Should I be just going around and limiting tickrate manually on everything?
asking here because my concerns are mainly with the multiplayer implications of the tick rate
i think it was in a cfg somewhere
sec
here
[/Script/OnlineSubsystemUtils.IpNetDriver]
NetServerMaxTickRate=30
InitialConnectTimeout=600.0
in DefaultEngine.ini
line 126
Oh! Thanks!
bear in mind this is not the DefaultEngine.ini in the project
Wait, where is it then?
BaseEngine.ini is what u want, my bad
its in ur engine configs
be aware that this will apply to all projects
its 30 by default
aye
awesome, thanks
Hey guys
@twin sorrel Show the other error code in that log
Don't worry, i fixed it ๐ thanks
i had the wrong setting checked when building the server
i had like debug game server instead of development server
Who here is really good with the understanding of multiplayer and can explain it to someone who understands everything else about ue?
Iโll ask a more precise question for an example, say I have an equipment array setup and a slot setup to display the mesh, does the mesh show to other players if replicate is toggled on, and not show if toggled off?
Via my player character controlled by my player controller
Lol
Iโm a multiplayer noob
Does anyone know how i can restart the game on a dedicated server?
Restart?
Hey all,
I was wondering whatโs the basic workflow when using ue4 and Wwise to ensure that sounds play for each client when in a multiplayer environment vs just for a single player. Typically we would grab the reference and have it play to all clients. I will be working on a multiplayer game soon and I wonโt to make sure we are on the right path. I posted in audio but no response.
wwise not sure, but usually you would play the 2D sound on the locally controlled client and spawn a 3D sound for the rest of the clients
Hey guys, I need a huge help
without going through the whole explanation regarding why I want this (I'm working on a VR game and exceptions to how the system was thought are a constant), I really need to make an AIController that replicates like a player controller... In order to have AI controllers on clients that allow for client-side prediction in their motion (I want to use AI controllers as dummies that receive input from the Player Controller to basically have "Vehicles" that work without having to possess them with the player controller
AI Controller doens't replicate, but the movement component of pawns they are controlling does
and it is usually responsible for movement prediction
I know that is why I wanted it to replicate... The fact is that prediction happens only for the locally controlled pawn
I needed to have this extended to other controllers
in the client
it's a mess... i know
well, the AAIController is an actor
so as long as you set bNetLoadOnClient and bReplicates to true in your inherited class
it should replicate
you'll want to be really careful to run the AI logic on server only tho
unfortunately it doesn't
Yeah of course think of the Ai Controller
as an extension of the player controller
which simply fills the gap on the Vehicle character
so i can exploit the CharacterMovementComponent for rotation and prediction
I won't run logic besides passing movement functions from the client
so you basically want to turn AIMoveTo into something CMC can digest?
nono
I don't care about AIfunctionality
I just need to possess the vehicle with a dummycontroller
that receives input from the player controller... In a way that possession remains on the character but the vehicle responds to the player's input
it could be a whole new controller
but I noticed that add inpout vector on client works only if the pawn is possessed
you can send the accumulated InputVector directly into the vehicles movement component
add sure
but you can add it on your PC
and Consume it in vehicles CMC
i think
But like i said, add input vector wouldn't work when called from client
So yeah in the end all i probably need is a replicated ai controller to achieve this
you can't add the input vector from the client, but you can do it from server version of your PC
and even if the AI Controller was replicated, you'd still need to own it to be able to send a server RPC thru it
- movement input for the CMC needs to be done on owning client
- Yes, that wouldn\t be a problem, but I would still need a dummycontroller on the client so that CMC starts working when input is given in the client
Question, if you have a door open and then a client joins how do you update that on his pc as well without anyone interacting with the door?
RepNotify variables, you can execute a function whenever they are replicated
which includes joining, getting closer to it, becomming relevant...
I sort of knew that RepNotify is what i need to use as someone told me about it before but I wasn't 100% sure, thanks
Is there a C++ tutorial on how to implement steam?
@hidden thorn there is a udemy course on steam and ue4
but apart from that i dont know
Is recoil something I can let happen client side only?
Or I should have that happen server side as well?
recoil cheat is pretty common
@meager spade Have you got a link to it cause I can't find it.
@neon mango You're going to have a hard time creating recoil that can't be hacked anyway
doable with superbullets
Recoil has two implications : it moves the reticle away from the target, forcing additional delay between shots ; and it adds some difficulty to aiming by having unpredictable behaviour
You can have hard enforcements of these, but at the end of the day any cheat can always provide the fastest possible correction that your game allows and still give an edge
yea the correction speed is something you can't prevent
Aimbotting & wallhacking are the two classic examples of client side cheats that are impossible to entirely prevent
Well, that and lagswitching
Competitive games resort to additional client strategies like cheat detection & banning, obfuscation, etc
I mean, pubg went +1 on the client side cheats and managed to enable client side skeletal transformations
- they overwrote the relevancy settings that enabled map-wide wallhacking
wallhack can be disabled at 95% times, but it's a lot of work to do the line of sight tests
And then it depends a lot on gameplay
Oldschool shoot-through-paper-walls gameplay ala CS 1.6, COD4 makes any wallhack a huge advantage
well if you have custom char movement with custom network prediction, you should be able to tell when a possible sight line is available
thus enabling replication at right time and rendering wallhack useless
but as you said, that's where the missing 5% comes in to give the advantage if you can shoot through walls
I mean a simple example would be a "wall" that has holes in it - some kind of fence or broken construction
You'd need to do raytracing to accurately conclude on visibility ๐
capsule edges
So you have to make that kind of object transparent to replication switching, and voila, wallhacking in a not-so-rare case
Hell, foliage can be a super effective option to hide yourself, and there's no way you can toggle replication based on foliage
Like I said it depends a lot on the game, but if your game has plenty of hard walls, it might work well enough to deter that cheat approach
true, it wouldn't work on foliage
or, maybe
if it would replicate only when the hiding player moves
once replication stops, it replaces it with static gameobject
Question, if I integrated steam correctly (I am getting the steam overlay) I host a server but when I start a second instance I can't connect.
Did I do something wrong or I need 2 PCs to test it?
2 steam accounts, so yes 2 PCs
oh ok
not sure how does it work with virtual machines
I guess it should be fine in such case if you have 2 different network interfaces
and connections
I just moved my project on a laptop, only issue I have to use my phone to transfer it as I left my ext-hdd, I've been here for a long time ๐ฆ
What exactly is the difference between Advanced Sessions and the ones provided by the engine.
@heady merlin May be able to doa summary
but, you can easily just read it on the thread
and look at all the nodes
Hey guys, when doing network profiling, what's the most important thing to consider that's killing performance? ๐ค
@bitter oriole So your saying do want I want with recoil since cheat prevention on this subject entails a lot more then just validating values server side?
@gloomy tiger if you find a good network profiling tutorial please share
ha! will do @neon mango
@neon mango Basically recoil can't be enforced in a way that's not cheatable, imho
You can possibly measure the angle between 2 shots, divide by time, and have a max speed based on recoil
To detect and kick the player
But at the end of the day the player can cheat with a possible value that's still higher than most players
ok
@bitter oriole counter strike does the recoil thing
they do it by being lying bastards
your local recoil is not the same recoil as the server
counter strike recoil has a pattern + a random offset
the random offset is fully random and different from client to server, but the pattern is the same
they did that becouse there were aimbotters that read the rng seed from the memory, and just counteracted it
UI widget is showing up for everyone when it should only show for the client that its called on. How do I make it so this only functions on the client its called on?
well, if you spawn widgets from the server by multicasting, itll spawn for everyone
tho im not sure if that would even work, since im unaware if widgets inherit from HUD class.
Whats really weird is that this function does not touch any RPC
For instance, when a player presses a key, this function is used
And this function will run on everyone
And I have no idea why, must be something to do with HUD classes
the event u have here runs on owning cleint, but technically every client owns his own hud
afaik Server has no HUD, so u cant execute from it onto cleint for hud
dont quote me on that though
its best to deal with widgets clientside only
and update values serverside
but then since server has no HUD class, you cant get authority to set things, so you gotta run it through playerstate or gameistate/nstance
Surely though if this function is called from a player controller, it will only run for that player??
every player has a player controller, so it will run for every player, but it wont by synced.
i mean P1 will run his function, but then P2 will run his function, which is the same one, etc etc
what exactly are you trying to make?
Just tried to check through it with breakpoints, still cant figure out why its running on both
Okay so when a player walks into a trigger volume, a 'tip bar' comes up on screen that tells the player information about this trigger volume. Simple as that
because if its on the PC, its like you having a beer and me having a beer, I open my beer, but the behavior is the same as when u open urs.
i see, and where's ur logic for spawning the tip bar?
It's literally just that
Since I was using it multiple times I wanted to make a function
OnBeginOverlap (for the trigger volume) -> if OtherActor is a Pawn and a LocallyControlledPawn -> Get the OtherActors HUD and display a widget
no RPCs required
^
To be honest I'm struggling to think of a case where ROC RPC would be needed.
maybe utility functions or smthing, but then most of those could be on a RepNotify
bought an item from a shop
sure you can figure out that your money decreased, that your inventory has a new item now
but its far easier to send a Client RPC so the client knows to pop up a widget "Purchase Successful"
well if u replicated the inventory array ๐ though thats not very smart, it would still work
but it's a good example, thanks, never had to think bout shops.
you want to draw a line of particles from your character to your target when user presses a button
and you do not have navmesh enabled on clients for it to calculate the path itself
aye i was thinking that firing particles would be more common use for roc
you send a server request to calc a path, which sends a Client RPC back with PathPoint vectors
which draws them
but then theres one thing about that I don't get
if you have a Smoke Screen, then it has to fire on all clients, but then if I remember someone saying that particles dont play well with relevancy, so if you get far enough it may not fire when you get into relevant range
though that was in 4.8 i think so if it was a problem its probably gone by now
But yeah great examples, never occured to me ๐
if relevancy is your problem you can just spawn an empty actor with particle emitter attached
and destroy it when its done smoking
i had a funny one, when monster dies it would get its bIsDead set to true, which replicated
though Evil is cool too i spose
so if you were to run from outside the NetRelevancy range into a pile of dead monsters
bIsDead would replicate, it would trigger its OnRep function, which plays the monster dying animation
theyd resurect ? ๐
so all the monsters would get up so you can watch them die ๐
ive seen that in older games
even SP ones
CS 1.3 had that
but that is ancient history lol
@winged badger Do you have any idea why this would lock my entire BP?
https://gyazo.com/b8dcc08d313971f2114a946342b7c971
what does the function do?
just adds movement input to pawn
and define "lock"
my player controller loses ownership ๐
i get no owning connection for PC actor
took me 2 days to figure out what was causing it
Wait, really?
you can't multicast from controllers
is this very dumb
If you don't do that, it doesn't complain?
i mean you can, but it tends to knock clients offline
well i wanted the movement to be seen by all players