#multiplayer
1 messages Β· Page 496 of 1
just because I am lazy. I just want to sincronize the cooldown between server and client, and instead of make a function that triggers in both side, I just want the client get the info from the variable each time the cooldown changes
so instead of do this, if it is cheap, I would just replicate the float instead of doing the other logic
I will think about timelines,makes sense
is 4 byte per message I guess, so 20 * 4 per second if I change 20 times per second
thanks!
has anyone been able to develop a tcp client system that works with ue4 yet?
@meager spade one very important detail
the CPU cost of server replication is directly proportional to how many objects are replicated
not how many replicated properties they have
1 god-actor with 100 replicated variables is a lot more efficient than 1 actor with 10 components of 10 vars each
yeah that i understand, think i also heard it spoke about in the Replication Graph talks
but it makes sense
how do I enable client side input on a possessed pawn?
it should automatically be enabled, input is on the local player
I'm not sure what you mean, client side is the same as local?
yeah well the way Im doing it doesnt work but I have little understanding of multiplayer so far
I create players
with this BP
following a tut
I hate to ask a question in the wrong channel - i'm unsure if its Engine-Source related or Multiplayer - but i'll drop it here too....
Not sure if this is the right channel - but i thought it was relevant - i'm building a project that includes the LOBBY module - but when i include its module - i get the following error when trying to open my project... Not finding anything relevant on google searches and i'm a bit stumped - i dont see any other dependancies to the Lobby module.... Source build 4.23
"Missing import: UE4Editor-Lobby.dll"
you need to add a dependency for all external modules you're using in your.build.cs
i understand that - and specifically i already did add "lobby" in the build.cs
Add exceptions in your antivirus and firewall.
no antivirus on this computer (dont knock lol) but firewall - what would i be looking at adding?
port or program?
Well if you don't have antivirus then forget it since your firewall won't really do anything like this.
hell i'll just disable it real quick - see if thats even the issue
I was considering if it was a folder permission or folder intercepting problem.
Hmm
launch error is: https://i.imgur.com/3p4tGr9.png
But logs show :
LogWindows: Missing import: UE4Editor-Lobby.dll
LogWindows: Looked in......```
it looks in several different places - doesnt find it.
i've searched manually - UE4Editor-Lobby.dll doesnt exist anywhere in my project or engine source....
i dont have to implement it as a module somehow do i in the Project.cpp ?
How did you add it ?
i already showed it above - but here goes again https://i.imgur.com/dQN584F.png
public or private - neither work to clear this issue - but both compile fine in VS
that should search engine and plugins folders
so you didn't actually use the Lobby module, just added it as a dependency in the .build.cs
?
oh its heavily used
I think he didn't add the actual dependency yet.
and where is it physically on disk?
several classes that inherit from Lobby module classes
Adding strings to your PublicDependencyModuleNames won't actually do much unless you've imported or included the Lobby Module.
C:\UE4Source\UnrealEngine-4.23\Engine
that is typically done in .uproject file
oh well
Yes.
VS doesn't give a crap about that one
that maybe an issue there - lemme try that
VS generally doesn't really do much interaction with UE..
It's the other way around if there's any.
its just that 99% of the people add a plugin in .uproject, then forget the build.cs dependency for compiling the project
Yes, haha, It's normally not the other way around xD
(99% that end up with errors)
I just added it here: THis is correct right? https://i.imgur.com/H9SwotU.png
if its included as "Lobby" in PublicDependencies
should be "Name" : "Lobby" iirc
unless you have a module that depends on Lobby module
oh i see- sorry
in which case you should visit the .uproject of the module that needs the Lobby, instead of the main one
ok i've definitely done this wrong - is the Type or LoadingPhase different for this? It asked if i wanted to rebuild "Lobby" I selected yes and "Could not be compiled. Try rebuilding from source manually" I am/have lol
How can I get the current session result from blueprint
@winged badger @simple pollen - completely wrong outlook on my part.... i was looking at it too literally. The correction was to add Plugin to the .uproject file "OnlineFramework"
Thanks again for chiming in to help! β€
@polar lotus - do youhave Advanced Sessions plugin?
yes
theres a node (been a few years since i used this plugin) in there to pull ... but when you Search/Join session - you NEED TO STORE IT
whatever you join is what you are CURRENT IN
there is no GetCurrentSession in that pugin (that i remember)
FYI store it in your GameInstance - so its not re-instantiated @ map travels
I need to call this from the session creator too
its easy from the client because of the session found
CreateSession - has a return session struct does it not?
nope
are you C++ friendly?
ok stand by one sec
I understand it but I cant write a script on my own
I wrote a node that encodes a base64 string but thats it
btw thanks
if we cant find the answer....
i hate to shun you off liek that though - give me a min ute to do some digging
otherwise - apparently Shootergame does it when they CREATE SESSION
but i'm almost certian they do it in 100% code
Im using steam
yeah shootergame is all c++
if your not code friendly - this wont help much....
if (OnlineSub)
{
IOnlineSessionPtr SessionInt = OnlineSub->GetSessionInterface();
if (SessionInt.IsValid())
{
FNamedOnlineSession* Session = SessionInt.IsValid() ? SessionInt->GetNamedSession(GameSessionName) : NULL;
if (Session && Session->SessionInfo.IsValid())
{
return Session->SessionInfo->GetSessionId().ToString();
}
}
}
anywhere you want its a getter - but for this particular instance it returns an FString
thats fine
you can take ou tthe FString - because its getting a full on struct FNameOnlineSession
where Should I put this
one sec - lemme see if this struct is BlueprintType
otherwise we'll have to convert it
one second please...
ok
it looks as though both the FNamedOnlineSession (which is a FOnlineSession) are both not blueprint type - so youre going to have to make ur own BlueprintType struct - and move over hte information.... i know for a fact that you cant include FUniqueNetId as a blueprint type... so convert that to a string.... same with the other information....
There has to be an example of the conversions in AdvancedSessions plugin for the JoinSession (it returns a BlueprintType struct) - see what that struct is and how its populating its information - as it has to pull from one of these types of structs above
i dont have the plugin on my system - so i'm not of much help there.
but look specifically at the funciton (IN CODE) for JoinSession or SearchSession - they both output that struct
ok let me dig
dude. thanks
my pleasure
thanks so much for your help
im only 14 and Im trying to make a multiplayer game
Im using unreal to learn c++
you are lightyears beyond my 14 year old son lol
i wish he had your ambition
i've tried to include him into my projects... he shows not even the slightest bit of interest
Not everyone has to become a gamedev
hehehe i dont try to force it on him
I was kinda an engineer in general for most of my life
I do electronics projects in my spare time
i was jus ttrying to find his strengths as a child
I build my own PC
My 9 year old daugher likes blueprints, I'd let them play with that.
undestood - sorry
lets head to lounge
@worthy wasp which source file did you want me to look at
Can I integrate that code in to a BP Function Library?
and make it a node
that would be a life saver
I just need a reference of the current session
That function only gives you the SessionID as a string.
What do you need that ref for?
Hey guys, I've been struggling on an issue for a few days now and I was hoping you could help me out. I'm noticing On Rep functions for variables don't fire the first time in my code. I have an ammo box, player walks over it and it goes away (visibility/collision changed), and a timer brings it back. This works great if the client is in the relevancy (net cull) distance, but if it's outside of it and comes in, it does not run the OnRep function. If the client is there when it's set to invisible, and goes outside relevance zone, and comes back later it works
So you want your current host to join a new game, becoming a client and taking their own clients with them? @polar lotus
no
I want a host to make a game, tell their real life friends to play with them and tell them the key so they can join it
It should be enough to share your own steam ID then
No need to expose anything like this.
I want it to be displayed on the host's screen
Right, also what about just normal invites?
Invites?
Well, Steam has Friendlists that allow inviting your friends.
If you use steam it's pretty weird you want to join via the steamID
you have to get an AppID for that
You have to anyway
no you dont
You can't distribute on Steam otherwise
That's not really how that works though. You are sharing the AppID with thousands of devs then
Also even then you can perform invites
This is literally what everyone uses during development
ServerLists will often not show anything
And it's limited in features.
You can of course do whatever you want, but it's pretty weird to use Steam with only the dev ID
Either way, for the ID you want you don't need to query the Session iirc
It's enough to expose it via UniqueNetId of the PlayerState
Its just a little game Im doing in my free time to play with friends
Means you could make your own APlayerState C++ class.
That's pretty much needed when doing online stuff.
You can't get that ID String without
its working fine without it
You want that ID, so you gotta use some C++
You can expose it relatively easy by making a custom APlayerState class
And writing a simple FString GetUniqueIdAsString() const; function
That then returns the UniqueId as String
Wont I have to add a bunch of other stuff
You cant make a PlayerState with JUST that can you?
hm?
If I were to create a playerState class instead of using the default one, Wouldnt I have to write a bunch of other code
You can't have an empty PlayerState class can you?
Not really
Sure you can
It inherits the stuff from the APlayerState class
That's what all your BP classes do too
So you're saying I can create a new C++ playerstate that only gets the sessionId?
Yes
Why can't I make it in to a blueprint node
That will become a BP node eventually
Not the PlayerState, but the function you will make
It will just be a BP node that you can use from your PlayerState
Ok, So how would I do that?
I made a PlayerState class
in c++
Can I use just 1
For lobby and game
i just use
if (OnlineSub)
{
IOnlineSessionPtr SessionInt = OnlineSub->GetSessionInterface();
if (SessionInt.IsValid())
{
FNamedOnlineSession* Session = SessionInt.IsValid() ? SessionInt->GetNamedSession(GameSessionName) : NULL;
if (Session && Session->SessionInfo.IsValid())
{
return Session->SessionInfo->GetSessionId().ToString();
}
}
}```
That's not what you need
then what?
You just need to return UniqueNetIdRepl.ToString(); or similar, don't know the exact line out of my head
and that Returns the sessionID/SteamID of host?
If you are using Steam OnlineSubsystem, yes
Well also for the clients of course, but you'll only display it in the HostGame screen anyway I guess
No you don't. This is interfaced by UE4.
ok
You have to add the declaration to the header file and the implementation of the function to the cpp file (the one open in your screen)
/** @return Unique Net ID of the Player (e.g. SteamID) as FString. */
UFUNCTION(BlueprintPure, Category = "Online")
FString GetUniqueNetID() const;
FString AVWFPlayerState::GetUniqueNetID() const
{
if(UniqueId.GetUniqueNetId.IsValid())
return UniqueId.GetUniqueNetId()->ToString();
return FString("");
}
Something like this. Top thing is Declaration, bottom is implementation.
Haven't tested this though.
Might be that you need to include "Online.h" at least
:P I have it included so it does exist
Yeah, 1 sec.
ok
Alright, lemme have a look
@polar lotus In your build.cs, you should have something saying PublicDependencyModuleNames.AddRange
There should technically already be something in that list
Add "OnlineSubsystem" (with "") to it
That should allow you to include Online.h
I gotta head to bed now (1am here)
But the include works now?
Try putting it into both Public and PrivateDependency Β―_(γ)_/Β―
I have so much included into our project, it's hard to find where one was allowing this
This should def compile, just tried it
Ah fudge
Change this
if(UniqueId.GetUniqueNetId.IsValid())
to if(UniqueId.GetUniqueNetId().IsValid())
ummm.... if its a compiler error... its not the .build.cs include
should have typed it and then copied it instead of doing it out of my head
those explode when linker starts
Yeah wasn't sure if the IsValid fail was refering to the struct being unknown
missing () ends up with "use & to create pointer to member" error
I simply forgot the () when I typed the code here :P As said, didn't test it
can't remember the start of the text
Well it does compile fine in our playerState
And we only have the Online.h included into that
So it can't be much
XZ is already rather far, just help him with the last steps
I have to get into bed
gn
I need some help Unreal community!
Please check this out and offer me any assistance you can.
We are working on a Networked game hat involves two teams : one FPS and one RTS. When each player dies they spawn a pickup that the other team can collect.
When the FPS collectible spawns it does fine but when the RTS Collectible does, UE4 crashes. βΉοΈ
Any suggestions what may be going wrong?
Iβm the arms not the face. lol thx tho
was just about to ask that
The materials (color) designating the pickup type
and whats the entire callstack?
crash might very well have nothing to do with the SetSide
what are you thinking it may be then?
k
also i am not sure if SetMaterial handles a passed in null, if Red is not valid
its also dereferencing myMesh
it might be called on a nullptr, the SetSide()
or the crash might be unrelated to the pickup at all
We figured it out thx. Another issue tho: during player using sprint: Press key= multiply movement rate to 1.5x = the framrate drips significantly. Research found this subject from 2015 saying that the player position is calculated on the server side and client side and may not be in sync?
- maybe we could set the Server to calculate position and force it to be the same speed somehow if thatβs the problem?
you should set it both client and server side
and a difference in speed is likely to cause jitter, but not FPS drop
yeah its more of a jitter - any idea how to alieviate that?
ZloToday at 2:25 AM
you should set it both client and server side
ok thx
its only 5:35 pm here - thx for being a late nighter - ill be working on Unreal until at least that time here in Los Angeles. π
i have a magazine that i set simulate on so it drops
but it seems to lag on clients
any idea why?
because you spawn it on server and it appears on client only when the actor replicates?
don't spawn the actor for the magazine drop if you're going to destroy it right after, a particle effect can do the trick just fine
also, server authority for a prop is not required
which means there is no reason to set the Lifetime server side
which means, even if you are going to go the spawn the Actor way, you should make it not replicated and spawn it locally on each machine
but then other players wont see it drop right? @winged badger
"and spawn it locally on each machine"
If a blueprint does not replicate is it still able to use RPCs and Rep notify?
No.
hehe thanks\
anybody have a good guide to make a simple multiplayer that a dumbass like me could understand?
simple multiplayer what?
There are too many bullshit things you gotta setup with game mode, game state ect..
hey guys, anyone here using UWorks on 4.23 yet?
and yes, no good "instant classic gamemodes" button :p
@velvet parcel what is so bullshit about it?
multiplayer still has a steep learning curve, I wouldn't recommend touching it until you've made a single player game or two first
how can they make a "gamemode" for EVERY type of game out there?
yeah rhetorical
yeah, speaking of which, any good recent examples for game modes? ShooterGame is only clean reference I know of
what kinda game you making?
counter-strikeish defusal style game mode
i mean UT4 has some examples
but yeah they are kinda intertwined into the game
as GameMode's are normally specific to your game
@meager spade Mainly because the largest hurdle to overcome is the fact that not all things like gamestate, playerstate, player controller, game mode. game instance, HUD will exist at the very start when you login.
So you have to make a system that checks for all of these things before moving forward which is often unreliable.
It should be a core function of the editor to have something in place as a part of begin play for all blueprints.
Making sure all of that crap exists is kind of an unsaid hardship of getting into multiplayer dev. You end up getting bugs that simply make things seem like they are broken
Not only that but those things are not always created in the same order either...
This is pretty bullshit
π
Why the hell would anyone ever want to run game logic before the playerstate exists for example. The engine should automatically force everything to pause until all of the core things exist by default
Is a PlayerController server, client, or shared?
I run RPCs for server and client on the player controller
so both?
pretty sure on that
So I should be using "has authority"
PlayerController exists on the Server and the Client that owns the PlayerController.
Other Clients DO NOT have eachothers PlayerControllers, only their own.
Clients can make use of the PlayerState to share information about eachother.
I feel more inclined to share a lot of data on the player pawn for stuff like health ect. That allows me to share data among clients too. Right?
Or is that a bad way to do it?
I'm getting a strange and seemingly random lag problem with my game. Every once in a while, a player will start appearing to lag from the perspective of another player. They'll start floating around and be nowhere near where they actually are. So player A will appear to be lagging to player B. The weird part is that neither player A or player B appear to be lagging to anybody else. On top of that, nobody else lags from player B's perspective. It'll just randomly sometimes happen for one player. For context, this is unreal 4.18
I can't consistently reproduce it either, it just sporadically will happen
any ideas would be much appreciated
no change in possession
and the distances can be pretty far
sometimes theyll just float in one position
off the ground even
can you even semi-reliably reproduce it?
nope lol
are the pawns always relevant?
yes
well
the setting isnt turned on
but it does that even if im standing next to their "ghost"
relevancy breaking is the most likely scenario, although
ill turn that just in case then
they shouldn't even be visible then
what do you mean?
non relevant Actors that aren't loaded from the package don't exist on clients
is it a specific player, is one of the two always a listen server host?
nope a random plaer
its on a dedicated server
and itll happen randoml even when i could see them fine previously
you don't have an inappropriate GetPlayerController[0] that can get the wires crossed?
that one is dangerous with dedis
its fine when called client side, but if called server side, havoc
i use it a decent amount
because as far as dedicated server cares
oh yeah i dont use [0] on the dedi ofc
GetPlayerController[0] is the first player that logged in
did you change the default relevancy settings?
does it ever happen when the other player is within ~15k UU?
yes
we just had a play test with about 10 people and I saw it happen like twice in an hour
for a few minutes
there is an engine fail that can cause you seeing yourself walking in random direction and not responding to controls
the player doesnt appear to lag to himself
but iirc it requires changes in possession to happen
in any case, the root of the problem is PC not setting Owner on the Pawn
but that wouldn't break other players, as that pointer would be null on other clients, as they don't have other PCs
right
and the only possession change that happens is the initial possession when a player spawns
and its assigned a new pawn
CMC?
i mean it's being used, yes
i'm also using gameplay abilities, but i think this issue started happening before i implemented it
what are the network conditions?
does it happen only in real test over the internet?
ping is about 20ms being hosted on a debian server on digital ocean
had the same issue on AWS tho
and yes it's only happened on a test over the internet
but I haven't really tested it on a localhost server
and i'm sure the simulated dedicated server wouldn't really show it, and i haven't tested it much with two players in there anyway
does it autofix itself after a few seconds, and can other players still see the "lagged out" player fine?
other players see him just fine
and it fixes itself after like a minute or so
or 30 seconds idk
and the player that sees the other player as lagged out is also visible just fine to everyone else and can see everyone else just fine?
yes
any teleporting involved?
which is what's especialyl strange
yes
like sometimes the "lagged out" player will float in a spot and then teleport somewhere else
i mean as part of normal gameplay mechanics
oh
prior to it breaking
there aren't really teleports but there are fast movements
but it seems to also happen on characters that dont have fast movements
how many players?
~10
that is basically how all players look like when a listen server host disconnects, before it tosses them to main menu
just running in whatever straight line the last received update had them moving in
well they dont just run in a straight line
but packet loss in server auth environment does not explain this
yeah, but they update 10 times a second or so
so it would make sense that the "lagged out" character is getting marked is not relevent
but not sure why
and all other packets are being received just fine
cause I can literally be standing right next to the "lagged out" character on my screen and that character shows as being somewhere else for everybody else
so its not a temporary fail of network connection
yeah for sure
its like all packets are being dropped except one now and then for a specific character for like a minute
and relevancy uses server positions to calculate distance based relevancy
right
only thing I can think of is turning on always relevent and see if it happens again
its hard to test though
its not possible that the player was broken while it was still outside 15k UU, then somehow made its way closer?
reading the log lognet veryverbose logs could in theory reveal the cause
but those are so large its downright impossible
hmm the map is about 15k across at the extremes
unless you can reliable repro in contained environment
but its still unlikely that they were that far apart
the pawns NetCullDistanceSquared is 225M?
yup
do you see it responding to any of the controls when its broken?
what do you mean?
is the player you see broken basically an automaton
the "lagged out" player doesn't appear to be lagged out to himself or anybody else
or does it just move wrong and seem to respond to input otherwise
as you see it, not as he sees it
it just very sporadic movement
and if i attack it, it does nothing
but this is expected because the server sees the player in a different location
if it keeps happening with always relevant
you can wire a control that will find all player pawns locally
then print the capsule and skeletal mesh locations for those that have a large difference between their locations
that would at least tell if you have the broken player in the wrong position locally, or just its mesh
@raw quarry have you looked into net bandwidth saturation yet
hmm I haven't
is there a way to do that in unreal?
or should i just use a packet sniffer
Search this channel for "saturated" you should find a couple messages from me recently. Especially if your game is running at a high frame rate it's worth checking into
will do thanks
TLDR is that unreal only gives you like 56K modem bandwidth by default and the CMC sends out a packet per frame, so at high fps it exceeds default allowances and it stops sending packets
I'm theorizing now and might be wrong but what you're describing might happen if players A and B are running at 200 fps and and players C, D etc are running slower. Because players A and B have both a high upload and high download to hit the ceiling before other clients
hmm but it would probably happen more consistently then
it still wouldn't selectively break a single player from a perspective of just one player
everyone else sees them fine
so server did get the right data from those clients
If I'm player B and my upload rate is huge because I'm running at 1000 FPS, I might ignore packets from the server to avoid blowing my bandwidth cap (?)
upload and download don't run against the same cap
and why would it only ignore packets from one character
unless that characters packets are just always sent last i guess
server won't send more then the cap allowed per client
and if it doesn't send an update for one of the characters
it will have higher priority on next evaluation
Yeah maybe it's a dead end 
Hi guys I am new to multiplayer. I had some issues with movement but eventually I got it working via replicating a variable and calling an event on tick. This was of course laggy as I sent movement input information to the server which then sent it back to the client, but it worked, I know the correct way is to use character movement component but I wanted to learn both ways. I am simulating 2 player split screen.
Problem is I am trying to do the same with rotation. 1) what is the correct procedure to rotate in multiplayer, analagous to using 'add movement input' to go back and forward? THis is not an issue though as I can google this. I am just puzzled by 2) as I have this BP
I am trying to understand how replication works. Rotation is fine on server. On client , if I try and rotate locally it works perfectly but is invisible on server. If I use 'multicast' in my 'right' event it also works on client, though is laggy and is invisible on server. If I use 'replicate to server' then it doesn't work at all. Why? I want to be able to rotate my client and it be visible from server this way just to help me understand, I am sure this will be laggy and not the correct way to do things so I will learn this after, but I am puzzled why this is not working properly
I tried setting the 'replicates' flag on all components of my 'Wasp' pawn including the mesh
yuck
dont replicate everything
dont call a reliable RPC on a function that updates every tick
I'm aware this is the wrong way to do things, I just want to know why it doesn't work at all
From what I read, I'm pretty sure you're not actually sending anything to the server from the client. (Multicasts called from a client only gets called locally).
And just because you mark components as replicated, does not mean all properties on those components will replicate to the client.
And replication only happens down from the server to the client/s.
hey everyone, does anyone have good ressources on how to make a good hit validation system?
i want a projectile to spawn on the client and the server for responsive ness and want the client to have hit authority up to a defined ping, but still want the server to validate the hit
if client and server spawn the projectile and register the hit, how would i go about making the server check if he hit as well and if the hit is the same as the clients
smoke and mirrors @shy nymph
have the client spawn a "dummy" projectile locally
and server spawn the real projectile (can be hidden with a revelancy check so owning client doesnt see the server projectile) and just have the server projectile do the actual damage
Hey guys, I've been struggling on an issue for a few days now and I was hoping you could help me out. I'm noticing On Rep functions for variables don't fire the first time in my code, has anyone experienced this?
Should only fire if the old and new values have changed.
These are my blueprints for testing it right now on an Ammo box
player walks over it and it goes away (visibility/collision changed), and a timer brings it back. This works great if the client is in the relevancy (net cull) distance, but if it's outside of it and comes in, it does not run the OnRep function. If the client is there when it's set to invisible, and goes outside relevance zone, and comes back later it works (re-appears once they hit the relevancy zone)
@worthy perch yep, and my bool is set to enable by default, but then when a player walks over it, is set to false - so the value does change but it won't update the client if outside of the relevancy zone and comes back in later
Weird part is I used the example for the chest in the content examples from Epic as reference too (tried without using replicate to server as well)
how should you network cooldown for a ability
you cant make the variables accessible from the client cause even a simple program like cheat engine is able to speedhack
Put the cooldown on the server and replicate it?
Hello iΒ΄m new here and i want to learn programming with unreal engine 4. Can someone help me ?
@mystic ember So much content out there, I'd say first of all you should find a common language such as Java, C#, C++, preferably a language that is object oriented, read a book and study some tutorials, maybe even spend your first week with this. Then afterwards when you have some of the basics, you can go on to YouTube video tutorials, look at UE4 Guides and study each and everyone of the basic UE4 templates they offer you as well as the starter tutorials. Learn how to study yourself, be curious and keep searching, eventually start referencing the UE4 Documentation. Once you've done this for a few months you'll be able to really go in-depth with creating games. I know this is so generic, but really, it's really one of the better ways.
@simple pollen Thank you for the advisment, but i learned HTML and i made a internship in at software ag. I dont want to specify that, i just want to say that i didnt found a tutorial that is good enough. I wanted to learn from a advanced user/programmer of UE4.
I can only tell you, even if you found a mentor, the mentor would not be able to tell you what you should create, get started and eventually just throw any and all questions you have somewhere in the related sections here.
@simple pollen Tutorials are specific in one directions, but i want to learn slowley in every direction
That's a way too broad and not a very reasonable action to take.
Tutorials only teach you their viewpoint.
To learn slowly in every direction can be interpreted as simply learning about everything in phases, therefore reading documentation, reading guides, watching tutorials, experimenting yourself and implementing what you have seen, read and heard, is what can cause you to learn.
@simple pollen Thank you for youre adverment, my problem is i dont know the basics from UE4. I couldnt find a tutorial or a website, that is explaining good the basics.
You can't learn everything in one go, UE4 has no specific limit to what you can do or what you should do.
Read the documentation.
They also have excellent tutorials to get you started when you open UE4.
@simple pollen I searched someone who could teach me the basics and a little bit more so then i could go in the directions. I know that it is impossible to learn everything, but the tutorials ect cant teach you that what you want its like doing what the computer says, you cant ask him questions
Well, my best advice is still just to jump into a small project that you believe would be easy to create, start from there, then any questions that come up google them or ask in here. Obviously google first because whilst it can be hard to find actual content, UE4 is very saturated knowledgewise.
And the same thing you seek is apparent for any knowledge in the world.
- This channel is dedicated to #multiplayer and not to general UE4 help.
- If you need a tutor, check #looking-for-work or make a post in #looking-for-talent .
- There is tons of documentation on UE4 docs, Wiki and YouTube (and a lot of other blogs and posts).
Please check #more-resources and #old-rules once more to be sure to post into the right channels.
@thin stratus IΒ΄m sorry that i have ask for help in this chanel, but i wanted to search for peoples that are good at programming multiplayergames
Right, but yet you asked for general help and guidance, nothing directly related to multiplayer. :P
Move it to #ue4-general for this.
Sorry that i didnt said it right. It will not happen again
how to optimize big world in multiplayer, world composition not working with dedicated server
how big is big?
how to optimize AI in Open World, I made the spawn AI system, while the player enters a certain zone, this is so far my best option
@winged badger 6x6 km
island
in addition to the main island there are 5 more islands 3 by 3 km
50 players, Static bots, killer bots, save zone, inventory items, all about 10k
but bots appear only when the player enters the zone, inventory items do not replicate the position - they are static
Many bushes from which you can pick berries
Now I have 60 FPS, at high. Given that everything is almost motionless.
The biggest problem is the bots.
the biggest problem is CMC i'd wager
ΡΡ ΡΡΡΡΠΊΠΈΠΉ ΠΠ»ΠΎ?
nope, and even if i did speak russian i wouldn't do it here
there are middlewares like SpatialOS
that let you distribute the load between multiple dedicated servers
and still use unreal's networking
they are not free though
Maybe it's better to take a very powerful server?
One very powerful server ?
not sure it works that way
evaluating actors for replication is done on a single thread
I don't think one server would be able to handle resources of that amount.
Indeed.
if you have to evaluate 10k or so actors - expect it to take over 20ms
replication graphs and/or dormancy can cut that down though
But everything is fine, because replication is for certain clients with a distance of 150 m
but 100 CharacterMovementComponents running around
Beyond this distance, replication stops for the client
that is about as much as a server can take
For the client but your server still handles all the actors.
and it has to evaluate all of them that aren't in inactive repgraph buckets or dormant
- to all, replication occurs only when something changes in the object
for each of your 50 clients separately
I tested my world 6 by 6 km. And received a stable ping of 20ms. with about 30 players
The problem is that I would like to make some other system for AI. But I have no idea how to do this.
while they were tested there were about 100
possibly less, since they appeared only if the player entered the bot area
I can not do that when a player's life is at zero it destroys it just works at the server not at the customer's
Hello everyone, if I am using Level Streaming with the Streaming Method set to Blueprint, multiple clients run through PIE will no longer correctly auto connect / spawn their pawn to my dedicated server - only client 1 works correctly
Anyone know why that would be?
The level set to Blueprint load has no logic in its level blueprint, and is just some random environment objects
and it works just fine with AlwaysLoaded?
will no longer correctly auto connect / spawn their pawn to my dedicated server
you'll need to elaborate a little
I figured it out, was a stupid error on my part, all of the various levels I tried switching to blueprint had spawn points on them, so I was effectively turning off spawn points from existing immediately.
My default pawn was set to not spawn if it fails to adjust location, since they were all spawning on top with collision, subsequent pawns failed to be created
Changing the spawn collision handling method on my base pawn to Try To Adjust Location, But Always Spawn has fixed my issue
Sorry for the waste of time! π
you should really have PlayerStarts on PersistentLevel
Hey guys
Anybody have solid recommendations, or is there a general consensus on which database software is best/easiest to use for indies developing a game with login server functionality?
Persistence including coordinates/mapdata and statistics etc.
Is MySQL through HTTPS -> UE4 the best way to go here?
Anyone know how to get this replicate well?
looks smooth on server, client is a bit clitchy
quick question: from a custom PlayerState, why do these two nodes return something different? Is it because from GetPlayercontroller -> PlayerState, since it's replicated and hasn't been replicated down yet, or...?
PlayerArray is an array of all PlayerStates, it is not an ordered array.
PlayerIndex0's PlayerState can be in an arbitrary location of the PlayerArray.
Also yes you will have to contend with Replication as well
@fossil spoke thanks
Hello guys quick question,
If I use the cmd "open IPADRESS:PORT" and the travel fails, my game default map is loaded. How can I choose to stay on my actual map instead of going to game default map ?
If I run a server RPC on the server what does it do exactly? Is it basically like running a non replicated RPC?
i think it will drop the call
as far as i can see server will run multicast and run on owning client only
same with client, if they are told to call anything apart from run on server it will drop the call
@velvet parcel
Server RPC on Server just runs like a normal function call would
Designating function replication across the network
look at the two tables on this page
@supple musk Thanks that is kind of what I was thinking it would do.
But I wasnt sure
Hi , my client doesn't have good tranform... is it because i don't set transform replicates in tick from the server ?
do you have replicate movement ticked? @compact osprey
Can somebody explain RPC replication to me? I watched all of the Blueprint Multiplayer videos and a lot of tutorials on youtube, but I still don't understand it.
you can tick that in the actor class defaults
My golf ball BP is a pawn
alright
is there any other logic that might leave them out of sync?
like freezing positions but not doing that server side on accident
do you run that on the server
but Client move a little bit and get teleported at his spawn transform
@steep jay Check out the networking compendium that cedric exi wrote, he has it pinned to this channel
set physics linear velocity ?
so you move the client but it warps back to where it was?
yes
Wow, 100 pages, thanks for the resource!
sounds like you're not changing the velocity through the server
@steep jay Almost everyone who learns networking starts there, it's the best resource
so the client corrects its position to match
@compact osprey @light obsidian What happens is this, if you have 50ms latency:
- Client moves, tells server to move
- 50ms later server moves
- Server replicates result 50ms later, which is 50ms in the past, and snaps the client to where the server was
...Repeat
That's why client-side prediction exists, so they make the same moves, locally, and the client is only corrected if there's ever a mismatch, which should never occur without interaction between two different remotely controlled entities
@grand kestrel thank you
Currently UE4 only has built-in client-side prediction for characters via CharacterMovementComponent and ACharacter
for the first problem I need to change latency ?
Nope
You will either need to write client-side prediction or find a way to use CMC to do what you're attempting
Due to UE4 physics being non-deterministic you will be hard pressed to write prediction for physics
Because errors to the 7th digit of precision in a transform can result in wildly different deflection vectors during collisions, which is why we still don't have properly predicted vehicles
Both options are quite far out of the reach of a beginner developer, unfortunately
Epic has started making a modular/expandable prediction plugin, but its a fair way off, and wont be too beginner friendly itself I think - however they will likely use it themselves to make all their templated player actors predicted (such as rolling ball)
The alternative is to have client-authoritative movement
So long as its not a competitive game, you can get away with it
So the client simply tells the server "I'm here" and the server tells everyone else the same
@compact osprey For starters, process all movement locally only, then afterward, send the resulting transform to the server in an unreliable RPC, and have it 'set world transform' from the RPC, then simply check 'replicates movement' and hopefully that will get you started
Oh, actually just send location and rotation unless you need scale
It might also be worth rounding the location vector to 1 digit
Just so you're sending less data
You can compress the rotation into bytes too if you like
Some would argue this is premature optimization though π€·
That makes it easy then π
Hei, i need a bit of your thoughts on a system that i'am pioneering for our game, now a bit of description about it, is a fast paced third person shooter in an arena style game. The new mechanic we are trying to introduce is: there are some actors in the game where the players can interact with them, they can translate/rotate mostly on one axis back and forth (this happens on the server on some sort of timer and is replicated to the clients), we have a pretty solid custom replication component that handles interpolation/extrapolation on them using all kinds of compression tricks to reduce the network load. However, too many of them and is a bit too heavy for our component to handle leading to jaggering movement/teleportation all that, but our lead designer needs them. Any thoughts on how could we optimize that? (I know the answer is kind a broad, but anything might lead us to a better way of dealing things) I am just looking for new perspectives.
That is way too vague, you should be using the net/etc profiling tools and finding out whats really going on
what are you replicating for that component, and how many of them are on the level @fiery geyser ?
Hey, I have a quick question:
Is there anything that makes RepNotify NOT be replicated in all instances?
I'm having this situation in which in one map, all instances receive notification and in another map, only server and local actors receive it
replication condition is set to None
BP?
uhum,
it will trigger whenever the RepNotify variable is set
even when set locally
as for not receiving RepNotifies
it should right? I never seen that issue before
being out of NetRelevancy (range) you won't get a replicated variable, and so no RepNotify
hmmmm gonna investigate that, thanks!
i asked if it was BP because c++ behaves differently
there only clients get OnReps called
hmm
and they don't get called except as a replication callback
good to know also
damn, even with Always Relevant set it still happens. Don't know how to replicate the problem in isolated environment
ok
I'm having this issue in one actor only. It's spawned by the pawn (on server, to a replicated variable).
I want to set this actor mesh on runtime, and for that I need to get info saved on the local Game instance (where the player selected options are stored)
So, on this actor I get its owner and do this:
so, the actor's Server instance will receive Pawn Assets and wil apply to the variable, which should be replicated on all instances
and it does, on another map that I tried
where does that run from? BeginPlay?
yes
sets
im testing with 2 clients and dedicated server:
Server actor: notifies
Client1 actor (ORIGINAL): notifies
Client1 actor (replic) : NOPE
Client2 actor (ORIGINAL) : notifies
Client2 actor (replic): NOPE
do those prints happen before BeginPlay?
on clients
I also experimented with some huge delays to be sure everything was already spawned
the weird thing is that (besides this working in another map) I'm doing this same process in the pawn, to set its meshes, and in it all notifies are triggered
when does it print NOPE?
it doesn't print
hahah sorry should have expressed diferently
only those with 'notifies' trigger the OnRep_ function
OH
sorry, tried with a bigger delay and it worked... its still weird
how many replicated Actors?
its 2 clients, each one having its 'own' actor and a replication of this actor in the other client
total on map?
i suspect that if you crank up its NetPriority to 4, and remove the Delays it will work just fine
oh you mean all actors?
hmm
gonna try
net priority was set to 3., now on 4 it worked once without delay
I use to thought that repNotifies would make sure to notify even yet to be spawned actors
I already had problems with multicast for this reason (trying to execute something before spawn) and the proposed solution was to use repnotify
NetPriority can fail if a packet with that actor is lost
doesn't happen all that often
but its not a foolproof solve
its weird cause i'm now messing with a lot of actors now, and I'm testing all on my machine
i figured, NetPriority change only makes a difference when you start hitting bandwidth caps during initial load
hmm, thank you very much for your help man =)!
one thing, is that the best way to know if an actor is "locally controlled" (i know this is specific for pawns)
does c++ function work for you?
I'm working with BP in this case, but sure, better to know
bool USolsticeObjectLibrary::IsLocallyControlled(AActor* ActorToQuery)
{
if (!ensure(ActorToQuery))
{
return false;
}
AActor* TopOwner = NULL;
for (TopOwner = ActorToQuery; TopOwner->GetOwner(); TopOwner = TopOwner->GetOwner()) { }
APlayerController* controller = Cast<APlayerController>(TopOwner);
return controller && controller->IsLocalPlayerController();
}
Awesome ! Thanks again π
Everything works but the client mesh yaw does not rotate. Anyone know why?
How do actor visuals work in a multiplayer environment when you do something like say change the color of something, and a player joins after that color has been changed? Let's say we have a cube that is black when the game starts. At some point a player pushes a button that turns it red. Normally that red color would be set on each client with a rep notify. If we only change it with a rep notify, would a player joining after that happens see it as red or the original black? Should we also run separate code for the server to change the color on its end? I'm just trying to make sure I have a grip on how rep notify works. As far as I understand it right now, when the server sets something with a rep notify, and you run code in that rep notify, that code doesn't run on the server right?
as far as i understand it (also still learning), repnotify is called only on already connect clients. if you need to share state like a changed color it should be a replicated variable
@somber glade
Thanks!
also keep in mind that server is a bit ambiguous
there is a dedicated server and a listen server
listen server is both, the server and a client
so client code will also run on that kind of server
this might be of interest to your question
https://docs.unrealengine.com/en-US/Resources/ContentExamples/Networking/index.html#relevancy
@somber glade
Overview of the samples provided in the Network Features Content Example map.
@wraith wasp Thank you, I'll check that out.
I am trying to rep notify team name so everyone including late joiners can see the players updated skins depending on team but for some reason... the later joiners cant see the right player skin... any idea why?
SetPlayerTeam is run on server and at the end it calls a server rpc. I'm not sure this will work. server RPCs should only be called on clients. i think a fix might be to not replicate this event at all since you already receive the change on clients via repnotify
@gray scroll
with "this event" i meant "SetTeam"
@wraith wasp so don't replicate SetTeam?
that's my guess
it should set the replicated var on the server and also update and trigger replication on clients
I will try it... but don't think it would be the reason
Anyone know of a good workaround to the fact that you can't replicate maps?
As in map variables
In blueprints
is there a way to increase how much data can be transferred over the network when using a multicast or rep notify?
There is
Though it's a bit more subtle than that
IIRC it's a bandwidth limit, not a size limit
there are several limits
it will refuse to serialize arrays over a few KB, there is a max size on multi-part bunches, and there are multiple bandwidth limits
I thought usually the bandwidth one kicks in quite quickly
Pretty sure it's kbps
ideally you could just remove the limit
but the protocol behaves very dumb then
it'll happily send barrages of packets at 30% loss if you queue too much

Hello guys. I'm trying to optimise the movement replication of a ship in my game. Currently all movement is set serverside, the server then sends the transform using an multicast. This is done with a 0.1 second delay and a doonce. This works well, but sometimes on slower internet connection if one multicast is skipped it is very noticeable. Making the delay smaller will be too much I think and flood the bandwith. So I was thinking of instead of using a multicast, setting the transform to replicated and just let the server update it on tick. Question is, how optimised is this? I've read that UE then decides itself how often the transform variables is updated. But I'd like to hear some specifics on how optimised exactly it is compared to a multicast?
the ship is a boat on bobbing water, so the transform will in fact be different every single tick
making me think that the server will push new transform data every single tick. And everything inside of my head tells me this will be bad π
but somehow people say i should be optimised
hence my confusion
but.... what if I set the variable on server and still use the doonce and 0.1 second delay?
would that be more reliable than the multicast which is not set to reliable
@void nest Check the pinned items for a video called "Overwatch Gameplay Architecture and Netcode" It gives a good overview of some of the sorts of techniques that will probably help you
This should absolutely be done with a replicated variable
And yes, replication optimizes itself
is there any documentation about this?
even if the variables is different every tick?
^^
You need to update movement every tick on remote clients, but you won't get replication update every tick
So you'll need interpolation
yes i already have a very complicated smoothing system π
it's just that when the replication gets skipped (using the multicast) the ship smoothly interpolates to the next updated location, but even when smoothed it still looks like a strange inconsistency in the speed
i want the ships to move extremely smooth and as close to the server original transform as possible
all the while keeping it somewhat optimised
Inconsistencies in speed might be an interpolation issue
You're not using linear right ?
the ships are boats that players walk on in first person, so any small hickup is very noticeable
Is the movement deterministic? Could the client make a reasonable prediction on where the ship should end up by running the same movement code as the server?
(by which I mean the same bobbing calculations)
no not really, beause the ships are buoyancy calculated, all of the buoyancy calculations happen serverside, as the clients can not calculate their own buoyancy locally and then end up with the ship being on different rotation on different clients
all clients must get 100% accurate transform that is equal on each client
This isn't going to happen really
the current system works perfectly, except for the hickups on slow internets
but I'll try with the replicated variable and see what that gives
You'll always have to allow some leeway between players
I don't mean that you would detach the client calculation from the server - the server position would still be authoritative - but buoyancy doesn't seem like a completely unrealistic thing for the client to have a go at calculating for a tick or two until the next update comes in
this is the interpolation I'm using currently
what do you mean with linear?
do you mean interp to constant?
if yes, no I do not use that
i use the rinterp nodes which by my knowledge have a smooth in and out, no?
and vinterp*
don't mind the interpolation speeds, those are for different wave settings
@earnest igloo Yeah that is definitely a possibility
a clientside calculation that gets corrected with the server's replication anytime it can, if the server fails to replicate, the client's own calculation get's used as a placeholder / backup
could work
Yeah I think that could probably be good. Wave motion sounds like it should have a good degree of determinism to allow it
but that would only fix the buoyancy though, the problem is less the buoyancy and more the actual y/x location
Ah ok
which is harder for the client to predict, as that would mean clients would have control over the direction and speed
Does the boat look "skatey" when you skip an update?
it looks like the ship is slowing down / standing still for a fraction and then it catches up to the new update
Ah you run out of interp buffer? You just keep the one sample around right?
yeah basically
the interpolation on the YX happens quite fast, as I can't slow that down too much or there is an offset between the server's location and the client's location, which causes collision issues as collisions are also calculated serverside
basically the ship than stops from a collision while on the client it still apears a distance away from said collision
You could do the same prediction thing... on the client presume that the server will probably agree with you on the effect of your control inputs and movement calcs, and put your ship in the "right" place on the client without consulting the server. You would only notice a correction if the server gets back to you and disagrees, which is unlikely if the ship is mostly on its own
yeah true, also what I was thinking
Again the server remains authoritative but the client can guess in the mean time
would be a bit of work to implement, but if the issue still persist after the changes I just made, I will look into something like that
thanks a lot for the help!
Yeah it would be - depends how important it is to you have have this seem responsive
it's actually really important, as the ships are the main mechanic in the game. Hence why i want the experience on them as smooth as possible
Also, if you have time I'd highly recommend having a watch of this https://www.youtube.com/watch?v=W3aieHjyNvw It's not UE4 but there are some great explanations of techniques in there
In this 2017 GDC session, Blizzard's Timothy Ford explains how Overwatch uses the Entity Component System (ECS) architecture to create a rich variety of laye...
I've seen that video pass by a while ago, watched a small part. Will definitely watch it in full soon!
There's a big chunk of stuff on ECS which is probably less relevant. Around 22 minutes in there's a good section on what they did with netcode though
@void nest Hey just thinking about your blueprint screenshot. It looks like you don't do any extrapolation, correct? So if Current is the same as Target then the velocity of the ship will drop to zero. I figure ships turn kinda slowly, so you might find that a simple linear extrapolation does a world of good. Do you replicate velocity? If you do, you'd just calculate a predicted target (so replicated target + velocity * time) if you reached your replicated Target before the next update from the server came in
Yeah that happens when the server fails to replicate the rotation or the replication is delayed by ping. The client will already have reached the previously replicated rotation making it so that the client has to wait until the next replication comes through upon which he sudenly interpolates to the next rotation, which suddenly gets sped up as the target rotation is much bigger than usual.
Currently there is no clientside prediction what so ever. But with a bit of work I can add it.
Thanks again for you input π
You're very welcome π
@pallid mesa "had to do PR for 4.23 due to a net culling issue with posessions and late joiners XD"
I think I'm having the exact same issue. Can you tell me which PR it is?
Hello everyone. I have a question regarding fast TArray replication. It's explicitly said that inside functions like PreReplicatedRemove(), that the indices are only valid inside those functions.
I dig a big into the replication code and I think it's only valid here because deletion of items is performed later and is made using the swap and remove idiom.
So the question is : Is there a way to get the indices of modified items as they would be after the deserialization ?
Hi , Does anyone can explain me how can I fix this client transform Problem with my ball ?
@compact osprey If ReplicateMovement is checked, the position of you actor will already by replicated. I think you don't really need this code.
to move my ball i use set physics linear velocity and if i don't use this code balls are like that
If i call set Position On server just after Set physic linear velocity , the problem is " fixed" but I want to do it with the best way
@compact osprey Make sure your staticMeshComponent is set to replicate. I just tested it. Calling SetPhysicsLinearVelocity on server worked for me.
@slow bronze
Is ReplicateComponent checked ?
Oops i thought it was on the screen ... Yes it is
I Check to my side
Both of you are using Physics and Multiplayer, right?
yes
@compact osprey @slow bronze
Yeah, both if you have to be aware of this not being something you usually replicate.
Simulated Physics + Multiplayer (specially in UE4) is a nightmare and basically not doable.
You can get a semi-working solution where you let the Server simulate physics and replicate the location adn rotation to the client.
That only works for actors that the client doesn't control though
What you see in the last video Melvin posted is one of the issues you need to actively code a solution for
And with physics that's not really a thing
You'd need to save the local moves and replay them when updates from the server come in
Currently you can see that he's not doing that and the server, caused by ping, overrides the client location
So you constantly get kicked back
Correct, that works until you actively add ping to it
If only the server simultes it, the player shooting the ball will always be delayed, cause the whole thing has to travel to the server and back first
So not responsive at all
Simulating it on the client first needs you to save the move and replay it when the server sends the update a few ms later.
The CMC from the Character does all of that
Epic is working on a more generic prediction system but atm only the CMC really has a solution for this
And that does not include simulated physics either way
CMC calculates the physcis via normal vector math and moves the actor by hand
(CMC being the CharacterMovementComponent)
If you can live with lags or with the shot delay, then you can go for a server authoritive solution
The other solution to this would be not letting the server simulated the physics at all
Then you would be client authoritive, client simulates the physics, tells server the location and server tells it to everyone else
That still misses interpolation though (in case ping is high or packages are droped)
And client authoritive obviously allows cheating, which for some is a problem too
ok, in my case , what i made is it fine ? I'm currently working with your pdf to understand all things
You are simulating it on the server as far as I can see
yes
That would cause set backs if you let the server replicate the movement back to the local client
Or the shot delay if not
Test it by enabling package delay in the editor
That should have some console commands for that
I'm aware of that. I just made this little demo quickly to show Melvin a simple setup ^^.
Right, I didn't get that out of the short convo I saw
Thought you are both struggling with similar issues
Either way, it's not something one can easily solve.
Either you live with the drawbacks from simulating physics and understand that a client authoritive solution might be the best (and allows cheating).
Or you go the extra step of making a custom C++ movementComponent that takes care of doing all the "physics" via vector math and calculating the location and rotation yourself
So, I should test my code with Package delay enabled to see how it"s work right ?
That would show you if you have any problems related to higher pings
As PIE testing might be a more or less 0ping experience
which is pretty unlikely to ever be a thing :D
for the moment no problems related with 500 pings ... π€
Net pktlag = 500 and NetPktLess= 50
Not 100% sure how you are doing it atm. It must have a draw back somewhere. :D
when i use thoses command Net pktlag = 500 and NetPktLess= 50 ?
yes haha
So that's the solution where the server simulates and the client just waits for the update
The higher the ping, the greater the delay
- you have no interpolation, so if there are package drops, you will see the ball jump
Obviously different per game
But that's the general case
Ok , i note this in my mind
Are there any special considerations, (besides transforming vectors/positions in my RPCs) when changing clients' world origin locations? I'm currently seeing some weirdness with Landscape LODs and some missed inputs in the movement component right around when the rebasing kicks in
Stuff like sprint sticking to on/off or jumps not triggering even though they go through the right flow in the character code
work day's over, so sorry If I dont reply for a bit, but any kind of help is greatly appreciated
@thin stratus Do you know if there's any drawback to expecting AI to have player states?
Coz the equipment plugin I'm making uses the player state for the container and as owner, thinking about making it support pawn for the sake of AI
None that I have seen, other than an extra actor per AI
Hmm
I built it with the possibility in mind from the start so shouldn't be too hard, guess I'll try adding it once I've more or less finished the plugin, so long as there's no major hiccups then it'll just be a bonus that they don't need player states
does anyone have much experience with the replication graph? I'm wondering if it heavily relies on actors for relevancy/priorization or if it would be able to manage this for individual components within a huge actor
Hey guys, If I have a game that supports dedicated AND listen servers, what kind of replication would I do for a gun firing in a character blueprint since my gun is part of the character
Yo is ControlRotation replicated?
So Character is what spawns the bullets or does the raycasts?
It'll depend on your lag compensation technique but just doing the trace and damage on server should get you going
just do it on the authority and you should be good
You'll need to translate the fire input into an RPC to server
In to an RPC?
@tropic snow You simulating lag or no?
Right now I have a character and child classes with different skelmesh and my character casts to itself as the hit actor
@polar lotus This is the bare minimum. You'll want to do some stuff client side so you don't gotta wait for a round trip before you see your character fire on your own screen.
I replicated the variables but made it so the server runs it with an Auth
Right now when I click it does nothing with that stuff
The only way for everyone to see it is to make it run on server and then multicast
Well yeah, you need to replicate the results at a minimum.
@tropic snow Why aren't you just using pawn control rotation?
@polar lotus You're just boincing to the server and back. The server is never firing.
That should work
ok
I shouldn't be?
If you set your stuff up right you shouldn't have to change anything when playing single player, listen server, or dedicated
@tropic snow Everything with the arms/aim should be derived locally from the control rotation. It looks like you're replicating the rotation from server to owning client somehow which will be really really bad
I see. I started off as third person thats why
i just moved the camera
to the face now to start working on fps
just make sure your aim offset is being driven by the control rotation or some other locally calculated rotation.
it will have tps mesh and fps mesh
I'm guessing its perfectly smooth on the host?
yes
Yeah you're using a replicated variable somewhere
Where's the math that calculates your aim offset?
well all my variables are replicated just running through the server
yaw and the pitch
They should be locally calculated based on control rotation. The control rotation should be replicated
This is it