#multiplayer
1 messages · Page 343 of 1
the second they all stop moving, projectiles and character movement start working again
i think you can do a stat net
will show you how much is being transferred
i think you can also profile networking and see where exactly it's coming from
netstat looks pretty good really. probably wouldn't have looked good before doing the optimization above though. Showed me that I need to optimize my 750 doors opening and closing next for sure
that said, I don't think its bandwidth preventing other componants from replicating during the movement... I think its something to do with the C++ crap from the ShooterGame Template not liking what I'm doing in BP. Just a theory though
net profiler I mean, I used that standalone profiler
Has anyone ever worked out destructibles in multiplayer please?
I'm trying to implement simple wall/cover destruction mechanic but as UE4 physics is non-deterministic, outcomes are wildly different for host and client
I don't care for chunks or physics, I'm not looking for large scale destruction
Only thing I need 100% replicated are bullet holes/chipped chunks in/of walls
I have something set up that's pretty simple, but it's just 2 states -> destroyed or not destroyed
How please?
It might not be quite what you want, but it's a replicated actor with a DM component. The DM component doesn't actually have damage enabled, but when the actor takes any damage on the server it multicasts a destroy event with the vector that hit it, then that's used on all the clients to break the DM
I use it for glass railings
But won't work for chipping away at a wall or something
ok, so I should scale down destruction to just bullet holes if I got it right
Yeah, you might be able to do something similar if you did hit detection on the server and replicated an event for every bullet hit but don't know if that's too much traffic or anything
I have no idea too, I'm still just toying with that idea but eventually I'll have to implement in at least some state as it's FPS in urban environments
if you want to make world destruction, do not use destructible meshes
What should I use then?
there's a multiplayer destructable thing on the marketplace for pretty cheap that you could check out https://www.unrealengine.com/marketplace/dent-destructible-environment
I already did and it's unusable as it still uses built-in physics system
Any idea why when I call a function to open a door on the server, it seems that it only opens on clients? (movement glitches through where the door was originally). They only appear open on the clients because their movement is replicated, so I don't understand how they wouldn't be open on the server.
pretty much as simple as a door can get (script just runs on server, called from C++)
@severe stirrup You would need to show us the code that calls that
{
TArray<AActor*> FoundDoors;
UGameplayStatics::GetAllActorsOfClass(GetWorld(), ADoorBase::StaticClass(), FoundDoors);
for (int i = 0; i < FoundDoors.Num(); i++)
{
ADoorBase *door = Cast<ADoorBase>(FoundDoors[i]);
if (door && door->Tier == TierNumber)
door->Open();
}
}```
called from HandleMatchHasStarted in ShooterGame
So you call this only on the Server and you hope it properly replicates due to Replication of the Door and the Components?
Yeah
visually it appears to replicate properly
but when i run through the door there's a big glitch (I can stand either side of where the door was, but I get teleported through it/can't stand in the middle)
so I'm assuming somehow the collision hasn't changed on the server
Dedicated Server I assume?
yeah
Hm okay.
Would you mind printing the Relative Location on Tick (DeltaSeconds into Time so it doesn't spam)
And see if the Server prints the correct stuff?
good idea, will add that now
yeah, positions are the same/change on both
client and server
hmm just noticed a warning
PIE: Warning: Mobility of /Game/FPSPrototype/Maps/UEDPIE_2_Arena1.Arena1:PersistentLevel.BP_Door_11 : Door_1 has to be 'Movable' if you'd like to move. ```
Then it's a different problem
Door_1 is the frame though.. I'm not trying to move it
yeh, the whole blueprint is above
Also, next thing to check would be if you actually collide with something
You could set the collision of the doors off
And see if you still get that issue
If yes, it's not the doors
Maybe the frame has a box collision?
yeh good point, try now
Auto Created on import
it works as expected with collision off on the doors (no glitch)
Including frame?
I mean, there is like 2-3 things that can happen.
Doors didn't move properly: Busted
Frame has collision and blocks you: Still open
Doors have collision which don't move with the doors: Still open
yeah, it still occurs with the frame collision off
so it must be the 3rd possibility you mentioned
Collision is set on the Mesh itself, or?
the shape is set up in the mesh, yeah
collision on the mesh component
I set the frame to movable which gets rid of the warning
Can you maybe implement the hit and overlap event in your character
but doesn't help the issue
and print the component you are hitting/overlapping?
yeah ok, will try
Just trying to find the cause
not sure if they'll fire on the server?
print Actor --- Component on hit for the player gives this
so it's hitting on the client
so maybe i'm thinking about it backwards.. the server is teleporting me through it because there's nothing there and my client is trying to hold me back
using Show Collision it looks right though
is there a guide on how to BP-code SP game in a way that would allow adding MP later down the road in a least painful manner ?
Quite honestly, the best way is just building it for MP from the start
If you set up the "backend" in a way that's built for MP, you should be able to pretty easily set up a "frontend" flow that uses that code with only one player
I use those terms loosely—it's not like a literal backend/frontend like web development, but it's about setting up the core systems in a way that can be used however you want
Is using an interface to handle damage like this acceptable vs the standard anydamage call (assuming the interface call is being called on server from the weapon that is causing damage)?
Sure, you might have to tack a little bit of extra code on to specifically set up the game for SP/MP, but that should really only be a precursor to the core gameplay systems that are agnostic to the setting they're in @sly kernel
At least that's my two cents on it :p
@inner iris well, I don't see how you would consider it 'unacceptable', but the main draw of the default damage handling system is that it's built-in to actors
If you're fine with using a separate interface since you need additional parameters, sure, I don't see why not
Great, thanks a lot 😃 Yeah I can see the convenience of the standard one, but if I wanted to extend it further and also not worry about things like damage type, it seems the interface is the way to go.
Instead of a "can be damaged" check, I can use a "does implement interface" check, and just make sure any actors I want to be damaged have one
Also is the event AnyDamage essentially an interface?
@brittle sinew well, was told that if I make SP without keeping MP in mind, it would be impossible to add MP later. And I am talking about technical point of view, not gameplay design.
I would agree with the first statement, generally.
@inner iris I mean, it kinda functions like one, but it's essentially just a pure virtual function that subclasses of actor override to implement their own handling
thus I am asking how do I make sure MP can be added later ?
I was reading eXi's compendium last night and while I understand more or less client-server design, MP programming and networking is something that goes over my head
Like I said: building your systems for MP really is the best way. A majority of your systems shouldn't care whether there's 10 people or just one
Most MP code should be able to work in SP just fine, but it doesn't work the other way around.
So I'd rather make SP game with (with gameplay designed with coop in mind) and if successful, hire a programmer who knows what to do with networking to add coop
Adding multiplayer support after the fact isn't just some "drop-in" type of thing...I imagine you'd be looking at a full system rebuild for some things
I am using plugin/template that is already made for MP. But I need to add weapon system, inventory, projectiles, doors, AI, etc. and I just wonder how to make those to work in MP (I already made some systems that are SP-only for my previous project)
Well, I think that the whole premise of making things work in a multiplayer environment might be out of the scope of a little text discussion, haha, but the gist of it is always keeping in mind the gap between the server and the client
You won't be able to just 'use' some logic that doesn't take that into account in SP, but using MP-designed logic should, for the most part, work completely fine in SP
I see
@thin stratus that's a standalone reproduction that does the same thing (with just cubes)
definitely something to do with replication.. if I call 'Open' everywhere, it works
how do you comepensate for packet loss lag etc to make it fair in multiplayer? like when i press crouch then simulate lag on one screen the crouch is instant on the other its delayed by the packet .
maybe you can't replicate movement of components?
seems like a bug that the visual mesh updates on the client but the collision doesn't
since it's 1 component
Relative position should be replicate though
Maybe the move function does it wrong
You could try to use a simple timeline
And just set the relative location directly
@worn nymph You process the stuff on the Server
If Client B lags and sees Client A crouching too late, then well
@worn nymph I also wonder about this a lot but I think in general you just have to wait for whoever dropped the packet to catch up. Then any damage that has to be done needs to look at what the server saw but if you are doing client side hit detection with dropped packets I'm not sure how it would work out.
You get 2 results
Client B hit the head on his end, cause Client A wasn't crouching yet.
Client A and Server say "You missed" because they have Client A Crouching already
It's up to you what you want to do with that
If you allow Client B to fight that, you could open it up for cheaters
I usually say: If packets are lost once in a while, it happens. If the player has a constant high ping, it's kinda his fault
So trust the server
If a player drops a packet containing shot info, as long as it's reliable, will UE4 know that it was dropped and resend on the next update?
And unreliable uses UDP?
I tried set relative location too, same effect
Blindly guessing ,yes
I didn't look into the code
But I know for sure that a Reliable Tick RPC blocks most ofyour traffic
I'll just run the function on both ends and stop trying to replicate movement on them.. just seems odd that I have to
to a degree that it doesn't spawn replicated actors anyore
@severe stirrup As said, try to set the Relative location via TimeLine
If that laso doesn't work, then yeah, do an OnRep function
For games like PUBG with large player counts etc, I wonder if they increased the 10KB cap that's on my default by a large amount
There was one custom game mode that had about 80 player characters running on screen at once and it was super smooth- no hitches visible
Was surprised as I thought it'd be going well over the allowed limit or showing some signs of bandwidth being exceeded
Those players didn't have weapons though so I imagine if they all were able to fire, it'd be a mess
maybe someone here knows: https://answers.unrealengine.com/questions/706917/unable-to-start-steam-dedicated-server.html
@thin stratus using a timeline didn't help.. replacing the door component with a 'child actor component' (static mesh actor) did though
so I guess if you try and replicate movement on a component, the collision gets left behind
thanks for the help
So, I have a problem.
When I start my game normally, then open it, people can connect.
They can see everything I'm doing, but for me hosting, I can't see any changes besides their pawn just sitting there.
are you using characters?
Well, it's VR pawns.
if not then yea...it won't be doing anything
you have to replicate movements
and hmds
and controllers
no
server always replicates down actors and components set to move replicate
clients never replicate up unless you manually do it
also server down isnt going to be fluid enough for tracked objectsd
So what should I do?
that's not the case in the asset i uploaded above mordertral
the door visually moves on the client through replication, but the collision doesn't
yeah, it's moving on the server
@umbral basin you need to replicate tracked device location and rotations from client to server, who passes it back to all other clients then
then you are moving it on the server side
Okay.
@umbral basin and for movement, you need to either move the pawn on the server and accept the lag, or move on client and send to the server to duplicate the move
Hm, okay.
if you aren't doing anything complicated you won't need lag compensation
I'll try to look at how to do that.
Do anyone have any exp with Amazon Gamelift Dedicated servers
is there anywhere specific i should put Widget commands? Player State, Player Controller, or Player Character ?
in steam Multiplayer
@thin stratus i just scrolled down, i know it's been a while since you said that. But Battlefield 1 solution is kinda dope. It might be open to cheaters if they wouldn't do server side verification for second scenario (based on positions and rotations on shoot methinks) https://youtu.be/YWJGowdcwOU?t=230
What I expected to be a straight forward and simple netcode analysis turned out to be a lot more interesting and (at one point) puzzling. Maybe their even is...
ok so testing player movment under a simulated lag of 200ms when the player stops moving it teleports/slides them back a tiny bit is there any way to combat this ?
@worn nymph would also like to know the answer here- also sometimes during movement there are slight corrections which can be perceived as "lag" or choppiness by the user.
its only happeing on the client whose moving the other guy seeing the remote proxy doesnt see the correction
UFUNCTION(Client, Reliable)
void ClientSetCooldownHandle(FGAEffectHandle InCooldownHandle);
Though Fortnite has these issues too so it might just be down to the way things are in the movement component
if you tick that box it fixes it because it disables the correction si it must be to do with the mvoemnt component
So it's completely smooth but then the server and other clients have different positions of that player?
There are also tolerance values you can set
How far it should be for a snap to happen or a correction
I wonder if setting them higher than usual would help since it'd be more smooth for the client
i dont want to turn the correction off completely otherwise cheating
but just make it less snappy
Nothing is worse than that horrible feeling of choppiness
i think its these but not sure
Yeah those are the ones I was thinking of
Will have a play with them later too and see how it is
I'd almost prefer sudden instant chops than lots of small jittery smooth ones
But again neither way is fully ideal
In Fortnite it's more noticeable on the jump than movement- seems to jitter quite a bit when jumping
Mine mainly on sprint or jump. If you simulate 200ms ping with variance and a small % of packet loss and drop there are a bunch of noticeable hitches every now and then
Would love to be able to get it extremely smooth with harsh corrections when necessary
I guess that's how some other games have speedhackers- they don't have the server constantly checking positions and movement
But they feel great as a client
hey guys, sorry for the super basic question
but i have a gameinstance drawing a debug line, and i cant see it in the viewport
i was under the assumption that any function called on a server would apply to the clients
its nothing complex at all -
DrawDebugLine(otherAVC_PC->GetWorld(), currPC_Loc, otherPC_Loc, FColor::Green, false, 1, -1, 5);
AVC_PC is a player controller
am i missing something?
game instance is loaded ?
yea 😃 i've got it printing out both currPC and otherPC vectors
it just inst drawing the debug line
can debug lines only be drawn clientside or something?
yeah I just actually put up a mention yesterday about how the simulated client smoothing has some bounce back
its because it predicts velocity out past the last update
so when it receives the last replicated move with a zero velocity, it is already out past that and the smoothing lerps backwards
the server doesn't predict velocity since it has all of the movement inputs already so it always lerps forward into the final pose with its smoothing
Nope, each client has their own instance
(that persists inbetween levels; replication wouldn't really make sense for the GameInstance)
ill get there eventually
i feel like this is one of those areas where i'll just...get it
something'll click
@brittle sinew so what about Worlds? Im trying to draw debug lines, but the only ones i can see are on the authority
No, the world itself isn't replicated
Things that are replicated to all clients are things like the GameState, PlayerState, and any other custom replicated actor you spawn
so what would happen if i were to call GetWorld() on a replicated actor, a PlayerController for instnace
instance
would it only return the authority's World?
Keep in mind the PlayerController is only replicated to the owning client, not all clients
@wary willow Solved why steam overlay doesnt appear in shipping build , steam_appid should be on Name/binaries/win64
But if you make a call on a replicated actor, it gets wherever that function is executed's context @short island
So, if you call a multicast function on an actor and get the world within it, you get each local client's world
If you try to pass the world that you get on the server as a parameter into that RPC, that won't work, as the world isn't replicated
right, ok
one more question - if player controllers dont know about each other, does that mean i cant replicates a TArray of <APlayerController*>?
would they then be nullptr?
sorry for all the questions, just trying to get my head around these concepts
anyone here with experience starting a steam dedicated server? i was having problems with the server starting up before because the GameData was too long. i got that resolved, but my buddy still can't see my game. https://pastebin.com/KmFU885A that's what my log looks like currently
@short island sorry, went afk for a bit, but yes, replicating a PlayerController reference isn't really a thing that's possible in the framework
The local PlayerController would probably be valid, but the rest of them would be null
Though that's fairly undefined behavior, so that's just a guess 😄
yea it makes sense
it's probably best to replicate properties on the characters, not the controller. controller should only be known by the server, and the local player
character is typically replicated to all clients. i think it is possible to replicate the controller if you make it always relevant, but that's probably a really bad idea
so let me get this straight
i cant pass around PC's, thats fine
what would be the best way to call a function on another PlayerController?
client to client, basically
i understand its got to be some kind of client -> Server -> client setup
yup
im just unsure what class i'd do the serverside stuff on
what class has access to every PC?
so if i have a gameinstance running on the listen server
and a player controller running on a client
if i cast to said gameinstance, i can run my server functionality there?
pretty sure game instance only exists on the authority/server
i could be wrong on that one tho
No, each client has a GameInstance, but they're not replicated
ah, regardless...game state is what you would want in that instance. local client could send message to game state back to server, and then it could send messages to the controllers
On the client they have no real connection to the server at all—the GameInstance is really just made to be something unique to each client
ok cool, so if i put stuff in my GameState, i can use that for all my PC to PC stuff, right?
again, so sorry for the noob questions guys
you can just use a playercontroller. but it can't be peer to peer
yea of course, i meant use it more as a bridge
PC -> Call function on GameState that effects other PCs
GameState -> Do something to some OTHER PC
i believe so
right, i'll report back in 15 mins 😂
it's "always relevant" which if i understand correctly, means it's always replicated on all clients
incase you're curious, this is for a dev test
im an unreal dev, but have no mp experience, do mostly corporate confention games and the like
there's a studio that like my stuff, and know i have no MP experience
multiplayer is a whole 'nother beast heh
lol 😄
nice guys
they also offered me the job, though :S i think they're just trying to get me to learn MP on the double
@worn nymph ah yeah I see the sliding, so it's like the client predicting a bit too far. Did tweaking the values help at all?
@worn nymph
If you guys could offer Zak M footage
It would be so handy
Since Hevedy seems a lil bit burn after trying that much xD
Hevedy didn't know what he was talking about
he thought there wasn't smoothing at all, and there is, it is just a faster lerp than simulating clients
Smoothing of cmc on listen server was introduced on 4.12
Dedi seems fine but still those hickup corrections we are speaking about are kinda...
I told him about 4.12 feature, but speaking with Tom Looman he said the problem was persisting and even bigger on spectator mode
the smoothing is very basic both on server and simulated client side
After 4.12 btw
i am somewhat concerned about the smoothing behaving differently between server and client as well
that is actually a big nono for a lot of games
the servers smoothing lags the character model behind by a lot, which is why it is set to a much smaller time frame
but that end of velocity hitch on client side from velocity prediction is just as bad, they lerp back a step when stopping
Do you have a project big enough to provide Zak M footage
you don't need a big project
Or just being able to elaborate?
I gave hevedy duplication steps in that thread
the animation graph by default covers up the lerp a lot
if you turn that off and make the capsule not hidden you can easily see how the lerp behaves
actual hitching is a different thing all together
Considered a bug?
Didnt get into it that much just observed the problem in the distance
Im just trying to get this reported to epic
yeah, but which is your problem? The bounce back? Or warping during movement?
Well the problem i have is mainly the ruberbanding on the animations and the bounce produced by the corrections even in low ping
On higher situations like 150 ms ping i would understand a reasonable jitter...
Again i'm not very into this so i just say what i see visually
where are you seeing the jitter? Hevedy's complaint was root mesh smoothing
Well, movement and animations
For example a reloading, on local client i can see the animation perfectly on tps
But on remote i see it frameskipped
Or jitered
you are seeing skipping frames during a reload animation?
i've never see nthat
that wouldn't even make sense
Animations like turns in place where there is capsule movement and faked mesh root
Causes that kinda rubber aswell
Check UT turn in place implementation w/o root motion
Check aswell tom looman survival project, i think you can appreciate It aswell
i'm not going to download his entire project, i've read over the UT source and it didn't seem to really do anything special there
is tom using the default mesh?
Tbh for me movement is more important then animations
Yes he is
The first person arms are not really relevant
i say this
because the third person template sets up the character incorrectly
so does the FPS if i remember
so if its based off of that, there would be issues
or maybe just the fps template does it wrong
No, actually its based on shootergame and used the default mesh for the tps mesh
But yes if we could just... Report this appropiatedly
Would be cool =\
i'd have to see it first, haven't seen a standing rotation issue yet
I could show it to you personally
aight
But even though movement is more relevant, nor rotation
But tomorrow or whenever you'll have a lil time ill show you some footage
because I was going to say, the video that Hevedy used to prove the survival template had server smoothing issues was taken before server smoothing was added.
haven't seen a current problem yet
nor in public released ue4 games
but i may have just not ran into it yet
Well tom looman said It persisted on 4.17 ~
I asked him for footage
He never replied
But i trust him
its likely there
But yeah...
Hi guys, is anyone aware of a telnet (text server connection) client made in unreal? I have a telnet game server running and am hoping to make a graphical UI to go with it. Resources on making graphics with unreal are obviously easy to find but connecting to an existing server and just receiving text from it isn't as obvious. Something as simple as a chat room client done in unreal might work
It depends on how you want to make the chat, if you want a match chat related, you wont need any external elements aside your playerstates sending information to each other
If you want a persistent chat you might need to create a php/node/golang/whatev lil application and get it connected with unreal.
If you want the easiest then go for VaRest since its a plugin which integrates the needed features on BP
I didnt see this video but a quick google search lead me into it, take a look
@echo lodge
thanks man 😄
Np :)
Are animations meant to run on the server?
Sometimes
This is a profile from the server, trying to debug some network issues
I assume these are bad values lol
I never knew these animbp functions run on the server
The server doesnt really need to be playing aiming montages
Nor does it need to apply yaw / pitch values
🤔
Heys, wondering if any of you can put an insight to something. With world composition and multiplayer, I know that when running the dedicated server, all the levels are loaded up on the server, which is fine and tiles streamed in on the client will have valid collisions for the player character. But I'm wondering what the uses of or whether or not it's working the bUseClientSideLevelStreamingVolumes flag is, as I want to attempt a similar thing but having a listen server rather than a dedicated server. Enabling this and running the listen server I get the usual world compoisition+listen server issue which is that the server isn't loading up the tile where the client is, thus the client falling through the world. On the dedicated server this boolean doesn't do anything whether if it's on or off. Hmm...is it even linked to world composition at all and it's just level streaming volumes in general? I've search every where for anything about it but I've not being able to get much. This is the last step before I delve into the code and look at the general level streaming volumes.
Iam using set view target with blend
for other player can spectate teammates
but I have 2 issues
- Camera jitering, if I increase net update it became better, but still pretty bad
- I cant change FOV
Hey Guys, I have been working on a multiplayer game and have set up a skeletal mesh with Animation blueprint that changes animations based on player speed. It is a walk run animation blend. However when I play the game in multiplayer the mesh doesn't show any animation. What could be the problem. Can anyone help?
Your speed is not replicated @dense tree
What value are you using in the blueprint for speed?
@raven holly tried replication of all variables. No change in output. Still mesh playing no animation. Here are some screenshots if it helps.
"screenshots" XD
so how would I go about setting up a dedicated server for my game and adding a server browser so that people can join?
so, I was told that there is a networking issue with anims that have root motion
is it true ?
Hi guys, I'm reading that ue4 has to send data to a third party server as uint8*. I'm a newb to this stuff, is it possible for that to look like plain text or is there a place that shows me what the actual text of the message looks like?
@echo lodge it's just a byte, so it could be ascii, etc
@GamingBacon97#8934 you need to make a form of master server. So dedicated servers report to it its up and clients ask it for server list
This is kind of outside the engine work, I use varest in engine to report to a web URL which updates a MySQL and another URL that clients get the list and generates widgets in game to click to join
Another 4.17 issue... please vote https://answers.unrealengine.com/questions/707502/garbage-collection-causing-server-hitches.html
Another one linux related.. https://answers.unrealengine.com/questions/707506/urgent-default-movement-component-causing-major-de.html
@dense tree Main issue here is that you replicate the Variables in your AnimBlueprint.
That thing isn't even replicated.
Replicate them in your Character.
@GamingBacon97#8934 I usually don't like telling people to google, but you can find a full guide on it easily.
To compensate the google stuff: You need to download the Source of the Engine from GitHub.
Compile it, then you get the Dedicated Server option in Visual Studio.
You package your game and put the compiled DediServer executable into the Binaries folder of your packaged project.
There are a few steps in between, but yeah, that's the google part and easier to read up on instead of me repeating it.
For ServerList you'll have to either code your own MasterServer, or use a Subsystem that has one (e.g. Steam).
Aaaand I can't tag again
@hasty adder I use a simple WebAPI that has "GET" and "POST" implemented.
POST for the Server, GET for the list.
MongoDB in the backend
@raven holly Wääh, I hope that's not appearing in my project
have you upgraded to 4.17 yet @thin stratus ?
Yeah, but no new build yet
Still working on the milestone points
Is that only on packaged servers?
Would be interesting to test, im trying to build a reprodction project atm
Yes
Packaged servers
I will try to tell you, but the build won't be up until next week I guess
ahh ok
If it does exist, then your server will likely crash when a player jumps on stuff
Only fix is to use windows servers
Ah it's only on Linux?
Yes
Hm then I can't help ):
The GC issue is both though
oh rip
Is it happening in a totally empty project?
I'm doing repro projects now
Okay, I would assume it might happen if you have a lot of actors spawned and destroyed
If yes, maybe pooling helps
But the nagain you said it didn't appear pre 4.17
@thin stratus I do have about 1000 actors respawning every 10 minutes or so
But i disabled that, and it still happens
exactly
Also, I thought GC is down to 30sec
default is 60
Hm, okay, thought they changed that
im my project settings anyway
But okay, yeah try to see if an empty project does it
If not, then you got a lot of work to do haha
<
Still.. didnt happen in 4.16
I wonder if there's a way to dump whats inside the garbage collection array
Maybe it's a plugin im using
Maybe it's a function with a large temp variable
but i changed it to every 1 second, and it still hitches
@raven holly @thin stratus replicating in the character solved the problem! Thanks a lot!
great
Doing some movement logic like only allowing sprinting when moving forwards, not sideways, which brings up this question in my head. Is the character moving essentially sending the server multiple RPC's per second to also update the input in the same way there? In that case is it reasonable to check on the client if side velocity is greater than 0, send out a server RPC to stop sprinting? Then there's also the case of the sprint being stopped from sideways movement but the player is still holding down the sprint key, so it has to resume when the side movement is 0 again, which would be further RPCs being sent fairly rapidly if constantly moving side to side while holding down sprint key.
It all works right now but seems like a possible excessive amount of RPCs being sent, as the input events seem to run on tick (or is this where net update rate comes into play?) bottom line is I feel I should be handling it better
Prob hafta dig into source character movment to see how it rpc the info. Far as I can tell it's just direction and speed it wouldn't nec know which direction is forward relative to its mesh. Unless the rotation is being replicated.
@hasty adder from the movement input float I can get that info ( 1 = forward, -1 =backward on forward axis) (1= right, -1 = left on side axis), so the client can easily see what the value of his current input is which is enough for me, the main question is if it's normal to rpc to cancel / resume sprinting whenever the side value != 0
Depending on how your sprinting I would just be replicating a bool change to then on server see if it's available and do and stop. Like shift run on server check can sprint then do sprint type work. Since the velocity will already be on server you can likely do the logic without other replication needs
Sorry if I'm not following right hah, on phone at work 😉
That's what I had, however then when holding down sprint while doing side movement, the bool is set to false, but when side movement stops, you don't resume sprinting and have to press shift a second time
Most games have it flow nicely so if shift is down and you can sprint, it'll always resume sprinting
I probably have to redo the server side input code, possibly could have 2 bools- "sprint is held down" and "is sprinting"
Only "is sprinting" gets reset when side movement is active, but then a check can run after it goes back to 0 to see if sprint is held down
Not sure if that makes sense but I'll give it a shot 😄
Oh I see what you mean.
So the false state is stopping the sprint and you must retrigger it by pressing again
When desired you want it to slow down then resume Sprite when it's true again
Sprite lol sprint
I want it so that any time the player is holding sprint, it'll resume sprinting when possible without having to press shift multiple times
So the side movement temporarily stops sprint but if the player is still holding the sprint button down after finishing side movement, it'll resume
What I have works right now but I'm having trouble understanding how often the input axis logic ticks
How is your speed changed? I am able to do something like a box trigger that changes a bool for inbox on a character and have this onRep change if true max walk speed and false change WalkSpeed to base speed
As it would mean I'm sending a lot of RPCs per second if it runs through the logic frequently
The speed is just changed by setting the sprint logic to false
So it reverts back to normal walking speed
When moving sideways
But then I have to recall the sprint speed logic again if the button is still held down after
Which seems to require a constant check
And that doesn't seem very efficient
Something on how the change is happening is causing that. Sounds to me anyway.
And I'd be studying how it takes you out of sprint for the answer what condition is changed that it can't find its way back while holding the key like a one time check on the shift key to say it's possible vs not
Agreed, however I'm finding it hard to see where a one time check is possible, as it seems all input events tick, so there'd be a constant check
I could probably make sure no RPCs get called unless there's a definite change though for sure
Right now it's basically constantly checking if the side movement is active, if so , it runs a constant sprint stop RPC
Gotta just turn that into a repnotify bool I think so it only triggers once
Thanks for the help 😃
O/
Anyone an idea? After a seamless travel the game is stuck in WaitingToStart? Tried turning off my ReadyToStartMatch with and witout delayed start, I made sure I call all parent functions, both gamemodes have seamlesstravel to true.
Oh nice gg engine
engine is drunk
told me there were compile errors in the log a bit higher
but in-engine there weren;t
not even after pressing compile a few dozen times
so I reboot and there are the errors
Not sure if anyone is interested, but the same guys who did the popular UE4 C++ course on Udemy are in the process of making a new course specifically on C++ multiplayer in UE4. They have forums for suggestions which are quite empty overall which affects their enthusiasm to go more in depth than necessary (especially exploring integrating services like Gamelift.) Worth making a comment or two on what you'd like to see or add to the existing Gamelift thread if you are interested in that, as they said they'd only go further than Steam integration if they saw an interest: https://community.gamedev.tv/t/hosting-multiplayer-game-on-server/42368
Seems like a pretty good opportunity to get a pretty good MP course if we show that there's definitely demand- their general C++ course is quite good.
Don't want the Unity users to convince them to half ass this one and do a fully fledged Unity MP course instead!
Gamelift should definitely be something way late
You don't need to overwhelm anyone with useless info if it's not needed in their games
Absolutely
I mean to basically start slow, they usually divide their courses into multiple small projectgs
So Gamelift would be the absolute last step
You said to use Gamelift as the main topic
A big bonus if anything
Nah, I mean to go through everything and then finally use Gamelift as a service to host for the final game example- it'd still need to use steam for all the actual social stuff, no?
Yeah absolutely
Babysteps
Small things, one step at a time
I just mainly wanted to drive home that most tutorials go over setting up a single dedicated server instance then are like "ok great job cya"
Well, it's not like Dedicated Servers are an overlycomplicated subject
On paper Gamelift seems like a great service that'd scale nicely, but I'm just a noob that would like to see that in the course is all 😃
Not every game would need such a service for sure
You do realize the costs of Gamelift right?
I think people think it's super cheap or free
If they left it at steam, it'd be P2P? There'd always have to be a server provider right?
P2P?
Sure but the thing with Gamelift is you wouldn't have to spin up 50 servers
You'd spin up as many as needed dynamically
Have you never built a Steam Online Game before?
Nope just been connecting directly to servers
I don't think we're on the same page 😉
Like I said, I'm a noob
But steam doesn't provide servers, correct?
Just handles friends, invites and finding sessions
?
Right but you can use steam and your own means of server browser etc. and your own master server/matchmaking server. Game lift might be an all in one solution but you can still work with other services to spin up and scale. The cost likely is more in the long run as it's an all in one solution like gamesparks
Got it, thanks for explaining 😃
The main reason I even made the reply was because they said they were planning on using Photon for the servers, and from all services that I'd been looking at, Gamelift definitely seemed the most appealing. They also said Amazon are eager to work with them on that, so why not! If the steam setup is fully explained and integrated, may as well go a step further for anyone who is interested in it!
I'd imagine it may take a lot more work/specific knowledge to get your own custom solution working, whereas Gamelift is marketed as doing a lot of the difficult work behind the scenes which I think fits in with a lot of UE4's strengths- you don't need to be a graphics programmer to use all of the rendering tools etc.
Anyway regardless of what anyone wants specifically, it seems like a great opportunity to get any suggestions in to them as it's not often there is a very comprehensive UE4 course made, and even more so regarding multiplayer!
Coolness 😃
Hey guys for calling some value like GetAxisValue() how do I call that locally only without having other instances of the clients attempting to call it (since its really only worth calling locally).
Right now for example, the client side instance of the servers player will attempt to call that and cause a crash.
Is this as simple as wrapping it in a Role == Role_Authority?
I fear that won't really solve the problem for clients player instances of other clients?
guys quick question. I am pretty noob, but I was wondering do optimized vfx cause any lag during networked play? Its all rendered on the client, but do crazy particles ever cause issues with online play?
if it's just rendered on the client then it shouldn't have any latency issues.
ok sweet thanks
I'm not an expert however ! But it'd be really weird if non-replicated particle effects impact bandwidth in any form. It just shouldn't.
Hi, some one know why Linux Dedicated Server build as Single Binary ?
does anyone know why this is getting called 4 times? if i only have 2 instances of this character: https://gyazo.com/7e0d6eeaf4fd1639385b40dc0d35d235
One Executable file ~700mb, it is ok?
@twin sorrel 2 instances on server and two on client?
oh
if i set the positions of a ccharacters camera and set active etc on a server event.. will it be replicated to the client?
@inner iris although the course was good they take the mick. The original kickstarter that we all backed included multiplayer to begin with and was the only reason I pledged so much money I already know pretty much everything they covered c++ wise in the course so was only interested in the multiplayer aspect which they deliberately used as a big selling point of the course . Then after we reached all funding goals they changed it to be as a stretch goal target which meant we had to pledge more money to get it which we then all funded to well over 100k+ . Then halfway through the course they realised they bit off more that they could chew and backtracked and said oh now we will make a separate course for the multiplayer and it will be free to all pledgers of this course . Then rather than making the course they decided to make the backers wait 3 years while they made a separate unity course on making an RPG . And now they are saying we have to PAY again for the new course which we already paid for. Not to mention half the stretch goals we funded they never did including VR. Same with the RPG course they left it buggy and not complete didn't give us all the goals .
AWS... Per second charge...what... Save me some mint please
How do I stop the editor from auto-connecting to the dedicated server, I want it to go through a login process
I can't see any familiar options in the advanced settings to disable auto connect
AWS even with per second charge, probabaly still more expensive than Azure
and Azure offers lots of nice frameworks to work with
How the hell do I disable the dedicated server autoconnect feature with PIE, I went all through Advanced play options, can't see nothin
@radiant crag it's in maps and modes expand some of the advanced option arrows and there is a tickbox
Yeah think so I'm not at pc
Hmm, don't see it, do you remember what it is called I can just search for it
Screen shot the settings window
The Play one or everything
Hmm thought it was there what about just project settings ?
Like all settings?
Editor Preferences > Play > Multiplayer Options, disable Auto Connect To Server
@radiant crag you find it?
@worn nymph wow I had no idea they did that- I got the course much later after the kickstarter. Sounds really cheap to me... all the more reason to poke them with as much potential content as you can think of so they won't just do the bare minimum and stop there (but going by what you said, they probably will anyway)
@inner iris yeah . The thing is the course is actually very good and well worth the money and I recommend it to everyone the bit that annoys me though is the original course was already funded if they had stopped there no issues it's the fact they added stretch goals took more money and then didn't do as promised hopefully they won't make this mistake again on this next course and I wouldn't have pledged as much as I did if I knew it was only really going to be a beginner intro to unreal c++
I got it for €10 and can definitely agree that it is worth it, but it's really shady that they added extra stretch goals and didn't even fulfil them. definitely hope they don't try to do the same thing here and do a super basic overview on replication + RPCs and try to finish it up there and go do another Unity course.
They said their effort is basically proportional to how much "pull" they get from people
I've been burned by them twice so I've lost confidence they will actually deliver on what I expect so I'm not going to invest any more money in supporting them . I will just wait until the whole course is out and then make a decision if I think it's worth it then
Good call! Sam said that custom movement and client side hit detection / server validation are both two topics from his design doc, so we will see if they are actually implemented, could be pretty interesting if it's going beyond the basics!
can you make multiplayer with paper2d?
Hello guys, im in need of help!!! When i try to Add UI to viewport, only the server client adds it properly. Im calling this from the HUD class, so everyclient is calling this function.
is there an easier way to make a dedicated server other than chaning files and lots of rebuilds? shouldn't there be a built in feature for this?
As far as I've done it involves having a server target ensuring both dev editor and server compile with source and then you can just use front end
@Babybelly#5572 yes
I jsut followed this tutorial here https://wiki.unrealengine.com/Dedicated_Server_Guide_(Windows_%26_Linux)for setting up a dedicated sever, and everything works fine
excep tmoving is extremly slow
I must go, howveer if you can help please @mention me
if someone can help me network a function that is not working for me, please DM me
@tacit hazel Which template did you use for your game?
So I'm confused about the use of DeltaSeconds via networking. If I have a method that uses DeltaSeconds from the client when the client executes a move but the server is going to execute that action on their end then the deltaseconds is going to be different between client and server. Does that matter or am I overthinking this?
You shouldnt be to concerned with DeltaTime in relation to networking. The DeltaTime is the time it took for the previous frame to be drawn on that machine. So every client and indeed every instance of the game will have different DeltaTimes based on alot of different factors. Its relation to networking is minimal. I dont think you should worry yourself to much.
only concern is if deltaseconds is used to have a fluid movement then when the server actually does the moving of the client then the servers deltaseconds won't match the c lients and the movemen will feel off
I'm about to test some code out but this is a concern of mine.
I've implemented a new movement mechanic that needs deltaseconds
and It works great locally just trying to figure out how to get it replicated correctly
Also for USTRUCT Replication can I just do USTRUCT() or is it USTRUCT(Replicated) ?
you don't replicate movement
you let server simulate it
and then there are two ways out
server is fully authorative and if client simulation deviate to much , server will override it
you can do it by interpolation or by just straight up teleporting actor to server position
or you can make client authorative, where server just accepts client position and then send it to other players
Its best to make the server authoritative, authoritative client will allow all kinds of cheats
I found this to be very helpful
How does thw MP work in this scenario: I have a logic that allows pawn to grab ledges. When grabbed movement mode and enum variable is changed. Now I host a dedi server and some player is hanging on ledge when new player joins. I recall that variables arent replicated immediadely.. so how does the new player sees scenario? Will the pawn behave correctly or what?
because the default behavior would be that character walks, so he would fall down.
initial replication should hold the ledge grab enum value
I have a quick question about performance: I created a moving platform ( very simple ) and I have it replicating movement etc. Server it looks super smooth in its movement but the client windows seem to be very choppy. Is this something that can be avoided? It would be very bad for a multiplayer game experience to have this seemingly large frame loss.
http://tinyurl.com/yd4u8rch for reference
obviously it's updated on server at the pace of framerate
but clients don't get that location update that often
is there a way to make them get it more often or have clients have more predictive locations so its smoother?
@wide valley you can simulate on client instead replicate movement
like Custom event Called start movement with multicast
trick is tho, how do you sync it
Maybe when it changes direction ( in teh back and forth movement ) those messages come from the server
but the movement is just happening otherwise?
assuming the end points are static, I would go as far as setting a waving lerp value for the movement
then replicate the float
and add interpolation on server side
then you could use non-reliable replication to keep it synced
that makes sense
just make sure it's bound to deltatime, you dont want framerate difference to mess up the location
Thanks I will run some tests with this, I appreciate the insight ( sorry for the noobie quesiton ) only been at this a few weeks
Can somebody explain this also.. I have a Tick. In Tick we are checking trace that tells us, if we are running the climbing function. Should I create the Multicasting just in case in scenarios like this or will it just overload server for nothing? I mean, i know the server has it's version of game and it will change the replicated variables without the sepeare command from clients to run that specific thing through server. So should I remove the server command in this case?
What I tested, everything works normally if the climb function is run after delay without anything else, but i'm not sure if it will cause problems when clients are joining with drop-in system
you have a tick calling a multicast?
probably not a good idea sorry to say, better off replicating a variable something like "bIsClimbing" then use a OnRepNotify
or just check that boolean on tick on both server and client, something like that
Development @radiant crag
so I just followed a tutorial for building a dedicated server, adn everything works fine but
this function if (Value != 0.0f) { AddMovementInput(GetActorForwardVector(), Value); } works fine until I connect to the dedicated sever, then movement becomes extremly slow
I serisouly cannot explain it, as soon as I type: open 127.0.0.1 the character spawns and moves extremly slowly
can anyone help? or point me into some way I could find out whats casuing this?
have you verified your speed on the server?
what do you mean "verified my speed"?
If I'm writing code to change how a character moves, is it enough for the server to control that or do I have to do something else as well? I'm thinking if the server executes the command to move a person a certain way that would sync up with all the clients since the position is replicated. But I'm not sure.
If the server changes an replicated variable then all clients will recieve that change.
so client calls a method AirMove() and inside that I call AirMoveServer() which calls AirMove() in there but server side, then AirMove needs the input direction the Client pressed which I've attempted to replicate by Replicating an FVector and which the client sets when they call AirMove first. But debugging server side, the FVector doesn't seem to be getting synced up
@fossil spoke So what happens if the client changes the variable and I have DOREPLIFETIME set on the variablel?
It was my understanding it would update for the server if the client changes it. This not the case?
This thread seems to be the topic I'm looking for https://forums.unrealengine.com/development-discussion/c-gameplay-programming/54352-how-can-i-replicate-a-variable-from-client-to-server
"Variables are only ever replicated from Server to Client, " well there's my answer
gotta use replicated function
Variables are never replicated from Client to Server
You need to send an RPC from the Client to the Server with the values you require.
Yea so I have a method client side call SetMovemetnDir
I guess that needs a server version
that takes in the values I care about, in this case an FVector
and I guess I have to pass the Actor as well
to know who to set it too
@fossil spoke Made progress, works client side now but doesn't feel quite right and seems to induce lag at times.
Going to pass in the deltatime from the local client to the server as well so when the calc is done it hopefully will do it in terms that feels right to the client
As for the lag that may be because I'm calling the method onTick, so not sure what I can do there.
Hmm managed to get Outgoign reliable buffer overflow
Guess I'm sending out more than what can be reliably sent
@neon mango Tick + Reliable RPC, is a nogo
Lol noooo
Never reliable on tick
If you need to have a gameplay mechanic updated very frequently and it is indeed very relevant i would do it client side and do "corrections/verifications" on the server at a times lerping from the last position, ie: hard targetting system on MP
So I've nearly solved how to replicate this Air Control buisness across the network. What i've done is on key press and release of A,S,D,W I send overr the axis values to the server so that the server can calculate the air control of the client. This seems to work but not 100% all the time. Do I need to implement some Client Side Prediction on top of Unreal's native CSP for the users position?
I don't suppose anybody has a nice way to send arbitrary binary data via an RPC do they?
UE4 doesn't support polymorphism for RPC's (or much else)
So I want to convert my 'struct' to binary, then just cast it on the other side.
Each class can then have a void* CastToType() function which returns the data properly
I was trying the exact same thing for hit detection in a personal project of mine but had 0 luck myself
clientside*
bugger. okay.. out of interest how were you sending the data?
I'm looking at FArchive
I was just using a regular ustruct I think
Couldn't cast it back on the client end, would always lose data (I think sometimes the data would even come out incorrectly)
If you do figure something out, lemme know! Haha
lame... okay I'll keep experimenting
all I can think of right now is havign a struct that contains everything i'll ever need, then overriding netserialize
but not sure if that'll work too well
mesh out of sync on late join is on the fixlist of 4.18
I've experienced that in 4.17
Mesh be like 3 feed behind its actual location haha
Feet
seems like its actually fixed in the preview
the mesh walked out of the capsule so it got really funky
Alright guys, I'm assuming Unreal natively does Client Side Prediction?
And other position interpolations to make player movement feel smooth?
The CharacterMovementComponent does smoothing, but AFAIK, it doesn't do prediction
The GameplayAbilities system does have some sort of prediction, but that's a very specialized-use-case system
So in theory, if the position and rotation of a player feels great from Unreals native optimizations, then anything I do to manipulate player movement server side should work as good assuming I provide proper client inputs to the server?
I'm not sure I'd be able to definitively say it will be as good; there are a lot of variables in play, but yes, I imagine it will still take advantage of that smoothing
Keep in mind the smoothing is on the CharacterMovementComponent specifically—not UE4 as a whole
(there may also be other things with smoothing built in, not super sure)
hmm just replicated 8k bullets with hardly any lag, last version it started to go all funky on 3k
So I was messing around and made a simple Golf game and was wondering if its extremely hard to make it multiplayer? I've read over and watched several tutorials on replication but I don't think I'm doing something right. I have my golf ball set to a Pawn and I set 4 player starts but when I play player 2 is sometimes in the ground and neither of them see each other move. So basically i'm just wondering if anyone can explain playerstarts and multiplayer?
How can I save the value of a variable in a dedicated server and keep it persistent until the server is destroyed
@cedar finch I"m assuming the actors are set to replicate movement?
@timid pendant Use the GameInstance class.
CMC does do prediction
Only for movement, of course
Also, if those 8K bullets are actors - forget about it in a real-world connection.
Anybody know how actor pointers are serialized?
Self-explanatory screenshot to show what i need to do...
it was a real world connection
they just dont do verry much atm 😛
Okay so, what are your prefered ways of testing steam stuff?
I do have a second PC, but really not looking forward to freaking port the game over to that pc after each change
Isn't there a dev mode in which I'm allowed to start two games with one account?
Or have 2 accounts on one pc
(without VM)
theorically if my website has a ssl certificate, and im sending a post via ue4, its automatically safe?
not sure if i have to configure smth else
Actor pointers are not serialized
the is underlaying net id, which is represented by GUId
when you send actor trough RPC, that actor must be mark as replicated
and what is send under the good is that GUID
@brittle sinew Character movement does Simulated Client prediction, only minimal though, it just projects with last known velocity.
my simple move to location results with following velocity values...
local client :0,0,0,17,0,34,19,56,38
remote client: 0,10,20,30,40,52,63,76,87
dedicated server: 0,10,20,30,40,52,63,76,87
notice how the local client is jerky... this jerkines screws up my idle/walk/run animation
anyone knows what could be the problem here?
@eternal anchor yeah that's what I need, so I can restore the pointer on the other end manually
I just want to serialize the GUID then get the actor again on the other end. Basically trying to hack my way around polymorphism
@thin stratus I think you'll be stuck using vm if you don't want to copy to another machine. 😦
Testing peer to peer?
How can I get the ip and port from a dedicated server? Is it possible in blueprints or c++
IP from a Dedicated Server is usually not the easiest thing
The Server itself doesn't know it's outside IP
It would need to ask a Service via HTTP Request to query its own IP.
Vejay you need this info for what mate?
I know how to get the port but getting the Internet address there are workarounds if your using on the receiving side of data if your aim is to get its ip for listing servers on a makeshit master
void APBGameSession_Base::RegisterServer()
{
Super::RegisterServer();
UE_LOG(LogTemp, Warning, TEXT("GAMESESSION - RegisterServer - START"));
FHttpModule* Http = &FHttpModule::Get();
FString URL = "https://api.ipify.org?format=json";
TSharedRef<IHttpRequest> Request = Http->CreateRequest();
Request->SetURL(URL);
Request->SetHeader(TEXT("User-Agent"), TEXT("X-UnrealEngine-Agent"));
Request->SetHeader(TEXT("Content-Type"), TEXT("application/json"));
Request->SetHeader(TEXT("Accepts"), TEXT("application/json"));
Request->SetVerb("GET");
Request->OnProcessRequestComplete().BindUObject(this, &APBGameSession_Base::OnGetPublicIP);
Request->ProcessRequest();
UE_LOG(LogTemp, Warning, TEXT("GAMESESSION - RegisterServer - END"));
}
😃
void APBGameSession_Base::OnGetPublicIP(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful)
{
if (bWasSuccessful)
{
if (Response.IsValid())
{
int32 ResponseCode = Response->GetResponseCode();
UE_LOG(LogTemp, Warning, TEXT("StatusCode %d | Content %s"), ResponseCode, *Response->GetContentAsString());
if (ResponseCode < 300 && ResponseCode >= 200)
{
FString ResponseString = Response->GetContentAsString();
FString RemoteAddress;
ResponseString.Split(":", nullptr, &RemoteAddress);
RemoteAddress = RemoteAddress.RightChop(1).LeftChop(2);
}
}
}
}
Clever bounce it back
Im just trying to find a way to register my dedicated servers with their own ip and port to distinguish them from each other . I have the master server setup already.
I posted you above
How to do it
The Dedicated Server can't find out its own IP without something like that
I only knows his private ip
OKay thanks but if I have a couple of dedicated servers how would each be able to retrieve their own ip from the master so they distinguish themself
Meaning? Usually server reports itself and only need worry about itself
This is a Gamemode I use as the parent to my gamemode for as far as making an exposed bp function to get port from null oss
@timid pendant Every DediServer that performs this request gets the Public IP of the Router he sits on.
If you have multiple Servers on the same Public IP, they are using different ports.
For our game we had 2 AmazonServers, EU and NA.
They had 2 different public ips
And 10 servers running on them
Port 7777 to 7786
Or so
Master receives heartbeats it doesn't request them
Yup, Server tells master server "HI I'M HERE!"
You would do that in the GetPublicIP Response
I removed that part from the code above
So you need to know the MasterServer IP upfront
That's the only one that is kinda hardcoded
Think non reliable rpc event to update a timer from gamestate to all players is ok to run every second? 😃
So I'm having a hard time figuring out how to smooth my custom air control. I've been reading online on methods to make the clients movement feel more smooth with latency but what is setting me back is this idea that Unreal must already be doing that for the player movement/position/rotation and thus why would I have to try to smooth it myself? Normal movement is already really smooth, so I figure anything that changes the movement would also have to be really smooth, no?
And anything I do come up with to smooth my AirControl would just come down to players position or velcoity which again Unreal is already handling.
And yet my Aircontrol suffers from 100ms ping client side. So clearly I need to do something...
How about people who join mid timer?
Didn't know you had join-in-progress
Well usually when doing simulated timers, I sent the UTC now time
So they can start the timer with the ping difference
I guess you could replicate a struct with UTC now time and a boolean or so, and start the timer in repnotify
That would also call for in progress joiners @hasty adder
Hmmmm
Hey when you create a component dynamically
if i just create it in the server in a Server RPC
its not even calling beginplay
on that component
am i doing this wrong?
lol
KoS | poet - Today at 12:09 AM
Started a Project in third person mode, Then added Height maps for terrain during this i Added 2 player controllers and multiplayer launch but i decided to resize the height map and deleted the old player controller spawns and added new ones. When i hit play the character still spawns at old location and not at new location
https://gyazo.com/e2b28c43aac7b182dc63298100e7fbd9
Last image is useless
And use network spawn points
Otherwise actually write out the spawning logic if you haven't already.
When attempting to lerp velocity from current calculted velocity on client to actual calculated velocity from server would it be wiser to adjust the position as well ?
I would suggest avoiding direct adjustments to position
To prevent weirdness and jumpyness
In our game, instead we reset velocity to known velocity and then add an extra correcting impulse that pushes the object closer towards the true position
I would prefer that as well @cloud ledge its just that a lot of the networking smoothing advice seems to deal with adjusting the position directly.
So what I was trying to do was lerp from the current calculated velocity client side to the actual replicated calculated velocity server side
But that causes a slowing down effect of the velocity
That is an interesting way to "correct" the velocity
Ultimately (but it's not the kinda approach we use yet), it'd be velocity = velocity_from_networked_packed + correction_velocity + f(acceleration_from_networked_packet)
To compensate for both presence of presumed-constant acceleration and difference in position
@cloud ledge but this pushing that you are doing is it push the server more towards the clients true position or push the client more towrads the servers true position?
Push client more towards servers true position
In our case, it's presumed that the server or the data source (authority which may not be the server) has the true value
and the correction value is calculated as just the difference between the servers velocity and clients velocity?
well that wouldn't make sense I guess because then it would just be like setting the value = to the servers velocity
The simplest correction is computed as "factor*(server_pos - current_client_pos)"
The correction factor is computed based on difference in position (this represents an extra impulse or extra acceleration that attempts to bring the object back into its true position)
The velocity is set to velocity from server plus extra bit of velocity to try and correct the position errors subtly
@cloud ledge is factor here some arbitrary value that feels good?
Yes
ah alright
so it sounds like you are trying to add to the client velocity from what I read but I think it makes more sense to subtract it back to servers?
Oh I guess that is what you mean by push clilents to server, that would have to mean subtract it back
Push positions as seen by client towards positions as known definitely by server
The velocity of objects on client are reset to velocity known to server, but this velocity is also modified to provide correction in position without resetting position
This is for objects not directly controlled by player (not players movement capsule)
But for player similar stuff works too
Anyone know how to set up a follow spectator In MP? I tried using View Target but it movement was very jerky as the player being spectated turned left and right the camera would skip steps and snap into place.
Does anyone know if there are any plans for Epic to resolve this issue in a less hacky way? https://answers.unrealengine.com/questions/34074/does-ue4-have-client-side-prediction-built-in.html
TL;DR replication for MoveTo
Hello my dedicated server crashes from this code
[2017.09.23-14.07.51:641][ 0]LogWindows:Error: FPSTemplateServer.exe!AGameModeBase::InitGame() [c:\unrealengine-4.15\engine\source\runtime\engine\private\gamemodebase.cpp:70]
[2017.09.23-14.07.51:642][ 0]LogWindows:Error: FPSTemplateServer.exe!AGameMode::InitGame() [c:\unrealengine-4.15\engine\source\runtime\engine\private\gamemode.cpp:72]
[2017.09.23-14.07.51:642][ 0]LogWindows:Error: FPSTemplateServer.exe!UWorld::InitializeActorsForPlay() [c:\unrealengine-4.15\engine\source\runtime\engine\private\world.cpp:3347]
[2017.09.23-14.07.51:643][ 0]LogWindows:Error: FPSTemplateServer.exe!UEngine::LoadMap() [c:\unrealengine-4.15\engine\source\runtime\engine\private\unrealengine.cpp:10192]
[2017.09.23-14.07.51:643][ 0]LogWindows:Error: FPSTemplateServer.exe!UEngine::Browse() [c:\unrealengine-4.15\engine\source\runtime\engine\private\unrealengine.cpp:9495]
[2017.09.23-14.07.51:644][ 0]LogWindows:Error: FPSTemplateServer.exe!UGameInstance::StartGameInstance() [c:\unrealengine-4.15\engine\source\runtime\engine\private\gameinstance.cpp:416]
[2017.09.23-14.07.51:644][ 0]LogWindows:Error: FPSTemplateServer.exe!FEngineLoop::Init() [c:\unrealengine-4.15\engine\source\runtime\launch\private\launchengineloop.cpp:2538]
[2017.09.23-14.07.51:645][ 0]LogWindows:Error: FPSTemplateServer.exe!GuardedMain() [c:\unrealengine-4.15\engine\source\runtime\launch\private\launch.cpp:155]
[2017.09.23-14.07.51:645][ 0]LogWindows:Error: FPSTemplateServer.exe!GuardedMainWrapper() [c:\unrealengine-4.15\engine\source\runtime\launch\private\windows\launchwindows.cpp:134]
[2017.09.23-14.07.51:646][ 0]LogWindows:Error: FPSTemplateServer.exe!WinMain() [c:\unrealengine-4.15\engine\source\runtime\launch\private\windows\launchwindows.cpp:210]
I believe its errors in my gamesession class and header
We need the top line of that crash log
[2017.09.23-14.07.51:637][ 0]LogWindows:Warning: CreateProc failed (2) ../../../Engine/Binaries/Win64/CrashReportClient.exe "C:/PROJECTFURYGAME/Workspace/ProjectFury/Saved/StagedBuilds/WindowsServer/ProjectFury/Saved/Logs/UE4CC-Windows-AE1D83CE485FB78DD30B3596894EB8B9_0000" -Unattended -nullrhi -AppName=UE4-ProjectFury -CrashGUID=UE4CC-Windows-AE1D83CE485FB78DD30B3596894EB8B9_0000 -DebugSymbols=......\Engine\Intermediate\Symbols
[2017.09.23-14.07.51:639][ 0]LogWindows:Error: === Critical error: ===
[2017.09.23-14.07.51:639][ 0]LogWindows:Error:
[2017.09.23-14.07.51:639][ 0]LogWindows:Error: Fatal error!
[2017.09.23-14.07.51:640][ 0]LogWindows:Error:
[2017.09.23-14.07.51:640][ 0]LogWindows:Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000000
[2017.09.23-14.07.51:641][ 0]LogWindows:Error:
Here is the top
The problem is with this code in my basegamemode.cpp file TSubclassOf<AGameSession> AFPSGameMode::GetGameSessionClass() const
{
return TSubclassOf<AGameSession>();
}
In the basegamemode.h file the code is virtual TSubclassOf<AGameSession> GetGameSessionClass() const override;
I did this so that my gamesession can be overridden to properly be set as the gamesessionclass and work on the dedicated server
AFAIK the default constructor of TSubclassOf doesn't set the internal UClass*—does return TSubclassOf<AGameSession>(AGameSession::StaticClass()); work?
I know it's a little verbose, but I think that might fix the issue
@timid pendant
And actually, you might even just be able to do return AGameSession::StaticClass();, as it should implicitly call the correct constructor
Didn't think of that initially
The dedicated server works now but nothing from gamesession appears nor does it return the gamesession
Okay, so I'm a little confused as to what this code is attempting to do then
Are you trying to use your own custom game session?
If so, even as you had it originally, that wouldn't use your custom one
Yeah im trying to use my custom game session. I thought overriding it would work
Okay, so go return MyCustomGameSessionClass::StaticClass(), or get the UClass* from a property you set in-editor
I put this code in my gamemode.cpp so that it knows which gamesession to use and this didnt work so i tried override GameSessionClass = AGameSession::StaticClass();
okay
Sure, but if you're just using AGameSession that's the default one
I thought that was what you were going for with your initial code sample
Ohh my custom gamesession set that as the public class to be called from anywhere. I guess i should change it to something else
yo, Iam using set view target with blend for player spectating and on tick
first node for aim offset
second for replicate camera for spectator
and in spectator mode game stuttering
any ideas?
that create/find/join session system only works locally?
is it more developing then u want a lot players?
to have them logistically at the same time
usually not
but you should try to avoid such things like get all actors of player class etc
My character movement component seems to be snapping the character back by a very small amount after moving under specific conditions. It only seems to happen when playing in editor as a client with the run dedicated server box checked in fullscreen / immersive mode + 200 ms simulated latency. When played in a smaller window, the snapping doesn't appear to happen. This isn't the smoothed server correction as I played with the settings for a long while but the snap was identical and always an instant or series of harsh but very small instant movements. It's so small that it barely updates the position of the pawn mesh (only a few cm), but is noticeable enough to the camera movement to make the game feel less smooth as it happens every time you stop moving. I guess the main question I have is- are quirks like this to be expected in PIE sessions? (assuming the answer there is yes and I'm not triggering something by having it in fullscreen mode). Will test on the server ASAP.
hello I've been doing the unreal 4 mutliplayer tutorial released by unreal 4. They set up a find a server functionality that randomly matches you with an avaliable server if one is avaliable. However I want a server list that instead displays a list of avaliable servers. Is there a tutorial for this?
Before we jump into the Find a Match screen layout, we fix an issue with the Options Menu so that our settings persist when the game is closed and re-loaded....
@obsidian kelp You need some sort of online subsystem such as steam or you can use the null subsystem and code your own master server system to register and list servers
uh yeah I've figured out that part but I'm just talking about the front end display in a widget blueprint
Do animations replicate the same as everything else?
@glad sedge I don't think so. I think you need to replicate the variables to the client that the animation blueprint uses and have the client set them in the AnimBP
Welcome to network code
Yeah. I'm getting some really odd crashes too. Like the log saying that I have a property that isn't replicating because it's not a child of some class.
But none of that code has changed at all for weeks.
Obviously it's related to some animation stuff in some way but still, it's just weird.
So, if I try to set an animation variable (to run an animation on all clients) using netmulticast, it crashes .
I get this error specifically - Attempt to replicate property 'CastleKeepersCharacter.PlayerText' in C++ but class 'AbilityAction' is not a child of 'CastleKeepersCharacter'
I can only assume it's because i'm accessing varibles that should be replicated on the client, or something like that. I dunno.
Diving into some source I found this comment. // If this is a client-recorded replay, use the mesh location and rotation, since these will always // be smoothed - unlike the actor position and rotation.
Does that mean Unreal smooths out network jitter by just smoothing out the mesh and letting the server just update the actor position and rotation as is?
Not sure if this is in right spot but i keep haveing this saving issue https://gyazo.com/73481ac73e7e1b63f7f36f06f53167ec
Also it seems to only happen on auto saves i can goto the issue and right click and save np
Have you accidently opend the editor twice?
@abstract aspen have perforce or source control at all ?
Could also be a permissions thing too
Navigate to the asset itself and make sure it isnt ReadOnly
Usually source control or having the editor opened twice is the culprit
Both box's are unchecked in properties
yeah I have to checkout everything before I can save in Perforce.
is this the issue? https://gyazo.com/eacf289d36af4292213975e82d36e359
it has options for 2015 and 2017
And this is loading and saving options https://gyazo.com/c2f6bea0a849c06f674dba47ac3b8754
Yeah dunno
How different is UE4's player movement prediction and replication from UE3 ?
Think its more or less the same?
line 3127 from here https://github.com/npruehs/hostile-worlds/blob/master/src/Hostile Worlds/Development/Src/Engine/Classes/PlayerController.uc details how it worked for UE3 but digging around in UE4 I don't see any of that logic.
Oh I think I found how UE4 does it inside the CharacteRMovementcomponent line 1151
Am I undersatnding the CharacterMovementComponent source, there seems to be alot of functionality like methods one can call to incorperate their network smoothing logic with any new movement logic you may come up with? Or am I not interpreting their source correctly? They have methods like OnMovementUpdate and ClientUpdatePositionAfterServerUpdate
I'm wondering if I can hitch a ride on these methods and just call them correctly when I execute custom code that moves the player
whenever I connect to a dedicated sever in a packaged game my character moves extremly slow, can anyone help?
@tacit hazel you’ve been testing in editor with “run dedicated server” checked, and have no slowdowns there? (Just checking to make sure you are definitely running as a client and not as the server)
yes
And listen server behaves the same way as connecting to the dedicated server, or as expected?
from what I can tell yes
I followed this guide
and I move normal speed, until I do "open 127.0.0.1"
then everything seams to work fine, but my movement is extremly slow
that is the NET STAT I get
It sounds to me like you aren’t setting something on the client as you are with the server- btw are you connecting to localhost or an actual server IP?
localhost
when I connect two clients together, with one of them being the host everything works fine, and when they are by themselves everything works fine, but once I join the dedicated sevrer problems arise
So the client connecting has no problems?
he moves slow
Hmm that’s strange- any issues I’ve had like that were just due to the server and client not having the same values set
I do not understand either
I have been stuck on this issue for a week
and no values for movement are ever changed
no values are ever changed for speed, but Stat FPS shows 62fps, and ping as 16ms
so I beleive it has to be some sort of net problem, but I don't know that for sure
can using the online steam subsystem be disabled for LAN play?
i can confirm that the value never changes for movement speed, so I believe it must be a net saturation issue, can somoene please help me? I have no idea waht information you might need, but I can get whatever it is
Is there a blog or video that explains approach 4 from this link a bit better? https://docs.unrealengine.com/latest/INT/Gameplay/Networking/CharacterMovementComponent/index.html#movementspeedhackprotection_networkedgames_
Detailed explanation of Character Movement Component
I need clarity on it
AHA
I have a breakthrough on the issue, but not the solution
the function to move the player does NOT get called nrealy as often as it does when testing things
because I print the value everytime it is used I get between 30-40 a second during testing, but only 5-10 a second using the dedicated sevrer
here is the setup for the function to be called, on W pressed the PlayerController on the client calls Walk (Server) which calls a NetMultiCast function on the insatnce of the plaeyr itself whihc is sever owned, which is this: ```void APlayerControlledCharacter::Walk_Implementation(float Value) {
if (Value != 0.0f)
{
if(GEngine)
GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Cyan, FString::SanitizeFloat(Value));
AddMovementInput(GetActorForwardVector(), Value);
}
}```
I think I am hitting some sort of network bottlneck over the dedicated sevrer, because this function does not get called NEARLY as often on the deidacted sevrer as it does during test runs via the editor
Why aren't you just using the default UCharacterMovementComponent movement replication?
Or are you just calling it a character when it's not really a character?
(ACharacter)
And, also, #cpp doesn't exist so you can ask for help in #multiplayer.
sorry, I'm just realy depserate I've been trying to figure this out for like a week now
im using a custom class that inherits from ACharacter
Okay, so that just reinforces the original question
I didn't know about it
UCharacterMovementComponent takes care of all replication for you—smoothing, client-side proxy, etc.
You don't need to mess around with RPCs or anything
how doi you use it?
You should just be able to call AddMovementInput on the client version of your character
(as long as you have the ownership correctly set up on your pawn, which if it's spawned by the GameMode, you do)
alright, well it seams its working, let me package the project and try again
and again Im sorry for postin in programming I was just really looking for asnwers
It's no big deal, just try to refrain from it in the future
I'll be honest with you, I've seen your messages over the past few days, but there was just so little information to go off of that I didn't feel like I would be able to make any useful contributions in the time I had
It's good you eventually debugged it a little bit and saw at least the direct symptom of the issue, but doing that earlier on will get you a lot more help
Since you said you were using a character, I assumed you were using the built-in character's movement handling, and thought that the issue might be quite devious
Does the server have its own player state instance when running in dedicated server mode? (Getting always an extra player state even when no pawns are in the level or spawned)
Getting this value from the Player Array in Gamestate
The PlayerState is spawned by the controller, irrespective of pawns
It's still returning one in simulate mode, is my controller still coming through there?
When I'm in the level on my own it returns 2
Hm, I would assume so
I couldn't tell you why there's 2, unless there's a pawn being possessed by AI or two controllers
I do have AI player states on
But there are no AI pawns or controllers being spawned as far as I can tell
No worries, I can filter out that extra result by changing the default team var, but just interesting to see where it's coming from
It seems a PlayerState exists in the world along with a Gamestate/Gamemode
On play
whats the proper way to play a sound so others can hear it
i want my characters booster sound to play for others when he uses it
Mmm delight of multicast
@floral bison don't forget to take good notice of multicast (if server) and save yourself some headaches later
so @brittle sinew, how do I call AddMovementInput on the client version, if I have a playercontroller?
...GetPawn() gets your pawn, which you can call it on?
hmm, thats what I am doing but it seems not to be wroking, let me try something else ones ec
yah, that doesnt move me at all @brittle sinew
@GamingBacon97#8934 , take a look to the Third person template
You don't use the player controller to set movement input on the pawn. Use SetupPlayerInputComponent in the character
And call AddMovementInput on the Character Movement Component.
Is this fundementally wrong? I'm only seeing an update on my PC after 2 or 3 clicks
Hi All, whats the best way to go about getting all of my client actors to react to changes to a replicated variable on the servers GameState blueprint?
@zinc loom probably an event of some description.
repnotify if im not mistaken?
so rep notify, ignore server if dedi, and then get all actors and do a foreach loop to run the casts / events ?
if the repnotify doesn't call on all clients, you could make an event dispatcher and use the repnotify to fire that event
do I make that on the actor or in gamestate?
excuse me if im wrong though. i need more mp practice
im really bad with ED's - I thought they were to just remap a call to a different event
like polymorphism in c++
I just see it as an Event that can be subscribed to as a listener really. (bind in this case).
@MiGint#7559 Event Dispatcher