#multiplayer

1 messages Β· Page 559 of 1

jolly siren
#

Very interesting, that is creative πŸ™‚

winged badger
#

if everyone is using a desktop, 33k Actor level is spawned and ready for play in ~12 seconds

#

fully networked

jolly siren
#

You are sure I'm guaranteed to have GS within the actor's BeginPlay? Even for join in progress?

floral crow
#

we do everything locally, spawn all Actors on a level from a seed, then lie to the engine to get them to behave like they were loaded from package
@winged badger How does the "lie to the engine" part work? Where can I start investigating?

winged badger
#

unless you are using GameModeBase

#

yes, @jolly siren

#

just check AGameState::OnRep_MatchState

jolly siren
#

okay awesome, thank you

winged badger
#

@floral crow having IsNameStableForNetworking and IsFullNameStableForNetworking returning true on instances of those Actors

#

setting their bNetLoadOnClient and BNetStartupActor to true during deferred spawn

#

and ofc spawning them with exact same names on server & clients

#

via FActorSpawnParameters::Name

floral crow
#

Interesting. What are the main benefits of this trick? I see "client never has a nullptr when searching for the object", but what else

winged badger
#

procedural generation

#

we have... prefab assets which is usually a building, city square, etc... which can hold other prefab assets

#

so we use Actor tags on the prefabs for marking instances that should behave like they are loaded from package

floral crow
#

Yeah, but you can do the same without faking that they were loaded from package

winged badger
#

we also mark anything inside prefabs as EditorOnly inside the Editor, so you can work on level and it doesn't get cooked then destroyed

#

yes i can

#

but then relevancy works differently

floral crow
#

What are the benefits that a Loaded from package Actor yield instead of just relying on normal replication

winged badger
#

NetStartupActors don't get destroyed when they are not relevant

#

those with dynamic NetGUID do

#

they are also all NetAddressable without having to be replicated

#

something we leverage heavily, replicating 2200 Actors through 16 Actor Channels via FFastArraySerializers

#

so none of our interactables, pickups, etc... are actually set to replicate via their own ActorChannel

#

which drops the considered actors number from 2600 to 400, makes server perform far better

#

we also pre-load all the assets for selected level asynchronously in the lobby

floral crow
#

which drops the considered actors number from 2600 to 400, makes server perform far better
Does that yield similar benefits to grouping actors on a replication graph node?

winged badger
#

replication graph doesn't do as much, its basically improved relevancy mechanism

#

it results in server having to evaluate less actors per data channel

#

but doesn't reduce the number of replicated actors

#

replication graph is generic though, while our network managers are tailored to fit our interactable actors

jolly siren
#

It looks like it is actually AGameStateBase::OnRep_ReplicatedHasBegunPlay that calls BeginPlay on actors clientside

#

ah and AGameState::HandleMatchIsWaitingToStart()

#

Regardless it looks like GS is indeed guaranteed

gritty pelican
#

Hello, i want to replicate vector. is there a better way to replicate the vector?

#

can I compress the vector?

dark edge
#

Just replicate the vector. What's the problem?

gritty pelican
#

I need to do this on tick

#

replication every frame will waste a lot of resources

dark edge
#

Does it change every frame?

gritty pelican
#

yes

#

it's custom movement

dark edge
#

You can set the replication net frequency.

gritty pelican
#

FVector_NetQuantize10 will round to 2 numbers?

floral crow
#

We divided the world in a cm by cm Grid, and just send a Grid index (int32) as position. Though this is because our game allows for having those discrete steps in movement instead of the ""continuity"" of floats

#

This incurs in perf overhead for both client and server so bear that in mind, but we're replicating over 500 permanently moving things so cutting down network bandwith is top priority

grim lintel
#

Hi all. To properly "network" a physics movement system, would it be enough to properly replicate a Pawns Location & Rotation or would I have to make sure that the Thrusters I'm using are replicated as well? And if someone is willing to answer some multiplayer questions directly please hit me up with a PM.

gritty pelican
#
if (HasAuthority)
{
        FVector XShipLocationLocal = GetActorLocation();
    FVector_NetQuantize10 XShipLocationLocal;
    XShipLocation = XShipLocationLocal; //XShipLocation - Replicated property
}``` it is right?
grim lintel
#

And has anyone any practical experience with hosting dedicated servers and what the costs for that could be? Which services are you using and why? I read that about 90% of multiplayer games are using AWS / Gamelift.

dark edge
#

@grim lintel start by looking at the already existing physics replication system.

#

@grim lintel there are a lot of tunable parameters there, it's not very well documented, but it works pretty good. It's basically the state synchronization approach, where the simulation runs on both ends, and is periodically corrected from the server to the client

grim lintel
#

@dark edge Which one do you specifically mean? Would you recommend that for a racing game in general? I've followed a tutorial once where they built the same system.

#

@dark edge And many thanks for your answers by the way

dark edge
#

@grim lintel I haven't messed with it a ton, but I would guess that it would work decently for a racing game, with the probable exception of client to client collisions.

#

That is, if everyone's local simulation is predicting ahead of the server. if there's no prediction, collisions work just fine

#

The problem with client to client collision is that both clients see themselves in the future relative to the authoritative server position. You were under the same problem at the race finish line. If you have prediction, two cars can each see themselves win.

grim lintel
#

Yeah makes sense and on the same time would be a problem since player to player collision would somewhat be a necessity (also in terms of your mentioned problem with the finish line)

#

@dark edge And sorry to bother you again, but where can I find the specific physics replication system you mentioned?

dark edge
#

In project setting search for physic replication settings. Yes, it has that typo, or at least it did

#

those are the settings that control how things are handled when you have replicate physics to autonomous proxies checked

grim lintel
#

@dark edge Alright thanks man

calm monolith
#

how would i make it so that a player could pickup another player like dead by daylight

halcyon abyss
#

Hey guys! I'm trying to figure out how to do different gampad input mapping per splitscreen player...

#

is there something built-in for that?

misty stump
#

One thing i don't understand is how input is consumed on the server. Whenever I call GetLastMovementInputVector or GetPendingInputVector on the server it returns zero. How does the server validate moves if this is the case? I know it has the value somewhere to replicate the move but how can I access it?

fossil spoke
#

@grim lintel AWS GameLift can be expensive, but their entire ecosystem is at your disposal. There are cheaper alternatives, like Playfab for example.

#

Gamelift is relatively straight forward to understand and implement.

#

AWS Documentation though leaves a lot of "gotchas" lying in wait. But nothing that cant be overcome.

hazy siren
#

I'd be astonished if anything like 90% are using gamelift specifically

#

as opposed to using AWS generally

#

although if you're going to build your own gamelift style services there's cheaper cloud hosts than AWS too, you pay for the ecosystem

winged shell
#

AWS is too expensive.

unreal raptor
#

anyone got boost asio io_service working?

fallen pawn
#

anyone know why my gamename is "Unreal Test!" when using a dedicated server? on steam

lost inlet
#

because you didn't set UE4_PROJECT_STEAMGAMEDESC in your Target.cs

fallen pawn
#

@lost inlet thank u!

limber musk
#

Hey everyone, just looking for some advice on voice chat. I was looking into Vivox but that seems a bit overkill for my needs. I'm working on a 2 player Co-Op game which uses steam sessions. Just need the two players to be able to talk to each other in-game as there are public lobbies for those that want that. What is the best way to go about that?

C++ or blueprints is fine, just looking for something that's simple and reliable

fossil spoke
#

@limber musk Steam parties support VOIP.

#

Vivox maybe overkill but it is a very robust solution.

#

And relatively easy to setup.

#

It manages everything, its extremely easy to use from a technical perspective.

tacit pecan
#

Hey how do i setup a web browser multiplayer session? I dont want the players tk have a lobby i want them to automatically be assigned a session and enter it

limber musk
#

I'll check it out @fossil spoke Thanks! I think I looked into it a while ago but didn't get very far as it seemed to be having some issues

#

And yeah vivox seems good but I was a bit put off by them saying you need a server to assign tokens

#

didn't really want to host one just to do that when the actual game is all handled by steam / p2p

fossil spoke
#

I dont think thats a requirement. Its a security measure.

#

You can issue tokens automatically by the game

limber musk
#

yeah true, I'll have a look into it more. Might just be the best option

#

that might be fine for my game

near bison
#

Can I replicate only part of an actor?

bitter oriole
#

Define part

near bison
#

I have an actor with VehicleMovement component. It has 2 skeletal meshes, one that fits the vehicle, and one person on top of the vehicle. The vehicle is going to be invisible. Do I need to replicate the vehicle to see the movement of the dude on top?

bitter oriole
#

The vehicle needs to be replicated for the movement to work in multiplayer

#

Dunno if VehicleMovement even supports MP tbh

near bison
#

It does, I've tested

#

The thing is, there's a really nice vehicle plugin on the Marketplace but it explicitly states:
Network Replicated: Replication, Client side prediction and server reconciliation have not been implemented yet.

bitter oriole
#

In other words, it doesn't work in multiplayer

near bison
#

How much groundwork would be required to convert something like this into multiplayer?
I mean no matter what the plugin is using, shouldn't it be a matter of just replicating the actor location/rotation?

bitter oriole
#

So the non-character movement discussion is a bit of a recurring one in UE4, but here's a short version : movement replication is extremely intricate and difficult, and UE4 only does it for Character right now

#

There are different possible approaches, though UE4 complicates things by not having a deterministic physics engine

#

There are two options basically : client-authoritative (keep your physics vehicle and RPC the transform & velocities to the server to be replicated to other clients), and server-authoritative (client RPC inputs to server and simulates, server simulates, client reconciles server sim with his local one using rollback/replay)

#

Fortnite does #1 with massive cheat detection since it's fundamentally unsafe

#

Character class does #2

#

There's a pretty nice Udemy tutorial that teaches #2 in C++

near bison
#

What kind of replication are you talking about though? I don't want anything replicated beyond possibly location/rotation. Think: MarioKart (arcade-style) Instead of full-blown replication of everything that happens with the vehicle

bitter oriole
#

I'm talking about a vehicle moving

near bison
#

Got you

#

ArcadeVS is a code plugin with content. The main Vehicle System is just one C++ class that inherits UE Pawn’s class, it’s self contained
All he's doing is inheriting from Pawn and going from there

bitter oriole
#

What I described was for a simpler case than this

near bison
#

But my question is why would figuring out replication on something like this be difficult? All he's doing is inheriting from Pawn and nothing more

bitter oriole
#

Well, movement is hard

#

You want no interruption of movement - actually no interruption of velocity

#

You also want different clients to see the vehicle close to where it is on others

#

And you have to do this with a physics simulation that behaves differently on each clients, network packets that fail to send for multiple frames at a time, lost packets, cheaters

#

It is very hard to replicate something as simple as a balloon that has no collision or turning and just moves around with the wind

#

So of course a physics-based car is not easy at all, especially if it was not built with multiplayer in mind

#

Current state is that it works on the server, the remote clients but not the owning client

#

Which is approach #2 that I described :

client RPC inputs to server and simulates, server simulates, client reconciles server sim with his local one using rollback/replay

#

The reconcilation here is the hardest part

#

So maybe wait for the author to complete MP support and don't plan on it in the meantime πŸ™‚

near bison
#

Yeah I read that

#

Just did

red sand
#
AMasterPlayerState* NewPlayerState = CastChecked<AMasterPlayerState>(NewPlayer->PlayerState);
    if (NewPlayerState)
    {
        const int32 TeamNum = ChooseTeam(NewPlayerState);
        NewPlayerState->SetTeamNum(TeamNum);
        UE_LOG(LogTemp, Error, TEXT("TEAM NUMBER %d Assigned!"), NewPlayerState->GetTeamNum());
    }
    
    Super::PostLogin(NewPlayer);

I am trying to assign the teams when player spawns
it assigns the team on post login but after the player is in map it reset's all to 0

#

How can I fix it?

winged badger
#

It doesnt reset

#

Your PC instantiates its PS in PostInitializeComponents

#

Also i dont see you assigned yours

#

But basically, you want to di stuff when PS is spawned, override PostInitializaComponents on the PC

red sand
#

NewPlayerState->SetTeam(TeamNum);

winged badger
#

And where is ir assigned to playervontroller?

red sand
#

Player State

#

but this code is in Game Mode

#

on Post Login

winged badger
#

Unless its assigned to the PC

#

That player state you made has lifespan of your postlogin function

#

As i said, override PostInitializeComponents on the PlayerController, NOT PostLogin for that

red sand
#

ahhh ok
So I shouldn't do this in GameMode?

winged badger
#

No, you should do it after engine creates a PS for that PC

#

After Super call

red sand
#

gotcha

#

lemme try

#

So basically I just need to create override function of PostInitializeComponents
and call super::PostInitializeComponents()
in it right?

buoyant wedge
#

Hello guys. i have problem with the respawn of the BLU TEAM. In the RED TEAM at the begin the find player work and all player can spawn with different position, when i try to do the same on the blu team, only the fisrt work. I think is a player start/find start problem because if i move the first player spawned on the blu team, a another player can spawn.

winged badger
#

GameMode caches first Start it finds in StartSpot variable in the PC

#

there is a gamemode function ShouldStartAtStartSpot, or soemthing like that

#

that will by default return true

buoyant wedge
#

is find player start?

winged badger
#

and basically make you reuse the cached StartSpot every time

#

its not exposed to BP

buoyant wedge
#

oh

#

so is a bad idea make a multiplayer game only with BP

winged badger
#

so its pretty much, cached (first) start location, c++, or teleport after respawn

#

i would never do any networking in BP

red sand
#

Zlo, I tried but I still can't figure out how to fix the issue of team not setting up

buoyant wedge
winged badger
#

its so much tidier in c++, and BP only has about 10% of networking tools available

#

yeah, only GM won't call that function

#

for respawns

#

because of this one

buoyant wedge
#

why in the red team all is correct and work?

winged badger
#
    /** Return true if FindPlayerStart should use the StartSpot stored on Player instead of calling ChoosePlayerStart */
    virtual bool ShouldSpawnAtStartSpot(AController* Player);
#

which is, imo one of the most unneccessary engine functions of all times

#

my guess is because it finds red teams PlayerStarts when it runs first time, probably before you assigned teams

#

and caches those in the PCs

gusty raptor
#

just a common question, how would i archive something like a global chat for steam sessions? would that basically mean everyone is in the same session?

waxen socket
#

Good morning. I've learned that RepNotify is for state and Multicast is mostly for instantaneous cosmetics.

If one has a door open, and that door plays a creak sound effect, should I use an OnRep function for setting the door to remain open but a multicast event for playing the animation of the door opening and the creak sound?

Or if I'm using RepNotify, should I just piggyback off that call? But then in that case I need to put in conditional statements so that the creak doesn't play when a new player logs in right?

Any advice would be appreciated. Cheers.

winged badger
#

you don't be able to distinguish new player logged in

#

piggybacking from OnRep usually includes Timestamp and synced network clock

waxen socket
#

Is piggybacking preferable to calling an OnRep and a Multicast simultaneously?

winged badger
#

its less work to do OnRep + Multicast

#

and blueprint doesn't really have an elegant way to handle timestamps

buoyant wedge
#

@winged badger I have try to change the position of the blu team and now it's work. I have leave one player start for team and now all my 4 player can spawn.

waxen socket
#

Thanks, Zlo.

lean river
#

hey. im not sure it is multiplayer related issue, but..
we running dedicated (game) server on a physical dedicated server and sometimes the dedicated server process not using cpu anymore.. (and even no networking usage)
process still reply and answering so the process itself not frozen, no crash... console just simply stop working and not using cpu at all, no new line in the log..
server os: win
we using steam subsystem / networking.
anyone noticed this weird behaviour or saw something similar?

near bison
#

Are there any guides/documentation on replication on VehicleMovementComponent?

prisma vortex
#

I'm not sure if I'll make sense when I ask this so sorry in advance πŸ˜‚ but is there a way to use the code from this video https://www.youtube.com/watch?v=09yWANtKmC8&t=653s and make it so people can name their servers, similar to wolf quest? If so are there any easy how to's on it?

Creating a networked multiplayer game isn't easy, but Unreal Engine's gameplay framework is designed to set you up for success. On this episode of Inside Unreal, Technical Writer Michael Prinke will cover fundamentals such as the server-client model, various features of replic...

β–Ά Play video
floral crow
#

Hi, I want to spawn separate Server/Client processes so I can attach a debugger to the server one. Any ideas on how to do this?

#

What I've done so far:

Open 3 visual studio instances. Select DebugGame Server on one of them, and then I tried setting Development Client to the others but it's complaining about some COOKED stuff missing

#

I'm confused about what I need to cook for Development Client configuration to work, because I've done nothing special for Server and it is working out of the box so...

bitter oriole
#

What you need is cooked content

#

Alternatively, just use Development Editor with -game parameter

floral crow
#

But how can I make them talk to each other

#

Where do I specify the same 127.0.0.1 address or something

bitter oriole
#

The clients would connect to the server

#

"open localhost" in console, or use sessions

gusty raptor
#

Hi, so i was trying to google around for something like a global chat (like everyone that plays the game is within the chat). Cant find anything about it.. anyone has a idea?

gritty pelican
#

can i check authority in component?
for example
if (GetOwner()->HasAuthority())

slim matrix
#

is it possible to get floating pawn movement to replicate

bitter oriole
#

It's possible

#

Just need to write the netcode for it

slim matrix
#

would i need the source version and were is it located

bitter oriole
#

You would need a few weeks of serious multiplayer work implementing prediction/rollback/replay

#

Source probably not required

#

It's not like the floating movement is a lot of code to simply copy if you have to

slim matrix
#

Would I basically use a lot of the same code from CMC net code

bitter oriole
#

If you feel like cherry picking about 15,000 lines of C++ while checking if you need them

#

I've done basically what you're doing and writing it from scratch was about 2,000 lines instead

#

You'll need to get a deep understanding of the mechanisms, so might as well write it

frozen brook
#

Pls is it possible to setup a team death match game mode using only BP?

slim matrix
#

Now will this break if the game engine is updated

#

Or will the code stay there

#

Because I plan on moving to UE5 when it comes out

bitter oriole
#

There is no need for any engine change

#

The code may or may not need upgrade for UE5, no one knwos about UE5

dark edge
#

@slim matrix You're basically just gonna be making your own floating movement. Nothing will break because it's your code, not engine code.

#

@frozen brook yes

floral crow
#

Alternatively, just use Development Editor with -game parameter
@bitter oriole I went with this and it worked. Thanks!

floral crow
#

I've realized that when doing a Seamless travel to my InGame map, BeginPlay is called on my LobbyControllers before the AGameModeBase::SwpaPlayerControllers(LobbyController, InGameController) gets called

#

This is causing my Lobby controllers to never be destroyed. How can I prevent this initial call to BeginPlay from happening? Using GameMode and GameState derivated classes (not GameModeBase/GameStateBase)

unkempt tiger
buoyant wedge
#

@winged badger I'm new on programmer and don't know the c++. I'm just make a prototype for learning ue4 and replication.
I have try to set 1 only start player for team and set the position in the sky and all player can spawn and fall into to the map. I think is a problem with the player start and the collision but I don't understud where is the problem. If a first player move, a another player can spawn. It's not only the problem of one team. In a another map red team and blu team are stuck, but if I set the player on the sky all work. I'm just learn what happened.

tiny arch
#

I've been trying to use UE4's multiplayer system using blueprints, and have been experiencing an issue with client player controllers coming up with 'none' as their possessed pawn, even though the possession works completely fine on the server side. I've been struggling with this for hours and Google has yielded useless results, so any help would be immensely appreciated

dark edge
#

@tiny arch When do they come up with none?

tiny arch
#

Pretty much as soon as the game runs.

dark edge
#

And does it ever fail if you get possessed pawn later? I don't think the possessed pawn is guaranteed to be replicated at begin play

#

There's some other event that is guaranteed to run last, dont remember what it's called

tiny arch
#

I've been fiddling around, and I think you are right on that being the issue

#

I was using the On Possess event on the controller to trigger the reference casts because I figured that wouldn't run until the pawn was replicated and possessed on the client's side, but it doesn't seem to work that way exactly

#

I switched to using BeginPlay and threw a 0.5 second delay on there before the references are set, and it seems to work now

#

The engine still throws out a ton of "attempted to access None" errors though

#

@dark edge thank you for your help btw

feral root
#

Anyone know what these errors are?

winged badger
#

@tiny arch ideally, you'd use the override of OnRep_Pawn or SetPawn functions in c++

#

the reference to your Pawn is set when the controller Possesses it on Server, and unless you did some custom spawn logic for controllers/pawns, the reference to the Pawn is set and replicated by the time controller calls BeginPlay on clients

#

that does not mean the Pawn itself replicated by that time

tiny arch
#

oh huh, that's good to know, thanks @winged badger

#

I do have some custom spawn logic, but it's nothing too fancy

#

It's just a simple system for giving different players the pawn they chose, and spawning them at the right PlayerStart object

winged badger
#

all replicated variables that are set on server on the TIck the Actor is spawned in are replicated in the same bunch as the instnructions to spawn the Actor

#

and the replicated variables are set, and OnReps called before BeginPlay

#

that is guaranteed, can't break due to poor network conditions

#

however if those variables are references to replicated Object that wasn't loaded from Package, there is no guarantee that Object replicated by that time

tiny arch
#

would the best way to avoid that just be to include a delay on things?

#

or is there some way I can use events to trigger things in the right order?

winged badger
#

so your client instance of replicated Actor got a valid NetGUID, but it can't be resolved yet

#

there is, but its difficult with BP alone

#

c++ has a ton of functions that are not exposed in BP

tiny arch
#

yea I really need to work on learning C++ for Unreal :(

winged badger
#

well, even a small code trips can yield significant results

tiny arch
#

I know a bit of C++, but using it with UE4 seems like such an extra layer of stuff to learn that I've been putting it off, to be honest

winged badger
#

say you insert a c++ base for your PC

#

add

#
UFUNCTION(BlueprintImplementableEvent, Meta = (DisplayName = "OnRep_Pawn"))
void K2_PawnReceived(APawn* NewPawn);

virtual void OnRep_Pawn() override
{
  Super::OnRep_Pawn();
  K2_PawnReceived();
}
#

added that to it, with implementation for the override in .cpp, not .h

#

your BP controller would get an event called (in blueprint) OnRep_Pawn that would get called as soon as the replicated Pawn variable changes, or its NetGUID is resolved

tiny arch
#

hm ok

winged badger
#

you don't need to be c++ expert to get some benefits

tiny arch
#

this is slightly going over my head (which is probably part of why I'm struggling with multiplayer so much), but I definitely what to utilize that, thank you!

soft shell
#

If a variable is marked as replicated and expose on spawn, when the server spawns that actor should the clients receive the replicated value?

kindred widget
#

I'd assume that the server would create the actor with the non default variable and then when it's first replicated to clients and they're told to spawn it, it would have the same non default variable. At the very least the next netupdate should have it.

pliant belfry
#

hey guys, what's the best way to replicate player aim in a top-down game? seems like calling a server rpc every frame from the autonomous proxy generates just too much traffic. is there a way to throttle my ServerSetAimLocation() rpc, or maybe there's another way to replicate aim position from owner to server?

soft shell
#

@kindred widget - I'm spawning a pawn with a replicated structure (exposed on spawn) but it's sticking to the default values (and I've verified the server is setting this correctly in the Spawn Actor, and I've tried to set them after the actor is spawned using a normal 'set' operation) but they aren't sticking.. I've checked all the idiot stuff (i.e. I'm not overwriting it, etc.)

kindred widget
#

@pliant belfry Do you mean for stuff such as showing other players which direction a player is facing, or something more like current mouse aiming position?

pliant belfry
#

I have a bunch of stuff tied to 'aim location' - things like aim offset, head and weapon IK rotation etc

#

so I need a more or less precise vector3

kindred widget
#

@soft shell So if you set it to expose on spawn and set that when you spawn it(And spawn it on the server), the value is different on the server than it is on the client?

soft shell
#

@kindred widget Yeah, the struct is just two bools (default = true), and on the server they are both set to false and that is passed into the Spawn Actor (verified).. then on the client the spawn actor is testing the bools from the replicated structure and they both appear true

kindred widget
#

Odd. What happens if you set them to true and then after a small amount change them to false? Does the client's update then?

soft shell
#

Tried that, stuck a 1 second delay in.. and redid the "set" on the server to the replicated variable and it's still the same.. it's weird

#

The actor is a pawn.. but I mean it's worked (i.e. replicated) perfectly everything else it's needed too

#

Just decided to add in some settings to control it's appearance when spawning on server

soft shell
#

@kindred widget - hmm.. The structure comes from C++ and the variables are marked as NotReplicated.. probably the issue πŸ€”

meager spade
#

NotReplicated props in a struct, won't be replicated, so that would be the issue

soft shell
#

Yeah; stupid copy and paste issue - working now

gusty raptor
#

So ive got a basic actor with a skeletal mesh that moves, enabled both replicate and replicatemovement

#

Just setting its location on the server, however on the client its very jaggy

#

anyone knows why?

bitter oriole
#

@gusty raptor That's perfectly normal, replicated data can't have a nice reliable 60fps update rate, instead some packets are lost, packets arrive in groups, don't arrive for fractions of seconds, etc

#

"Replicate movement" doesn't work for movement, ironically, it's only viable for replicating a spawn location

#

If the movement is predetermined (vehicle on track etc) you'd just have the server tell the client when to do the animation and let the client handle the movement entirely

#

If the movement is, like, player input or AI, then you need a better interpolation method that accounts for velocity, measures the average update rate and interpolates cleanly between net packets

waxen socket
#

Good morning. If in a shared-view four-player game where everything is relevant to every player all the time I want to play a shake, sound, and particle effect in the event of a player character dying, is there any reason I would use RepNotify for that?

This seems like a use case for a multicast event to me but any advice would be much appreciated.

dark edge
#

@waxen socket You would use a multicast for that. You would use rep notify for state updates, like whether or not a door is open, or the state of a flag or whatever

bitter oriole
#

Though arguably, the state of being dead will be sent to the player no matter what, so there is no need for an additional event

#

Multicasts are useful when there is no replicated state associated, or when the state changes somewhat quicker than replication updates but the event absolutely needs to be sent

dark edge
#

Yeah, this specific setup would be kind of an in between.

uncut schooner
#

Hello I have been having a huge problem with multiplayer replication for 1 specific thing for a long time

dark edge
#

It also depends on if late join is a thing. if someone joins the game while somebody is dead, do you want to play the event

#

@uncut schooner well spill it.

uncut schooner
#

Basically when I make a replicated projectile and set its visible part to be at the 3rd persons muzzle so the others can see it

dark edge
#

@bitter oriole I prefer to leverage rep notify as much as possible

uncut schooner
#

It only works properly for the server

#

the clients muzzle position seems static for some reason

#

Ill get a video

dark edge
#

@uncut schooner is the animation working correctly on both sides?

uncut schooner
#

Yes the animation is

#

that is the weird part lol

dark edge
#

Show us where you tell the projectile where to spawn

uncut schooner
#

Okay

#

It will take a minute sorry, pc is slow and I gotta delete the mistakes I made to try to fix it

waxen socket
#

Thanks, Adriel, and Stranger. I'm always wondering if I should split my calls into separate OnReps and Multicasts or just combine them. But I figure one of the advantages of splitting it is that the effects won't play when a new player joins, right?

uncut schooner
#

Its also very laggy, I am such a noob at networking

#

I watched many tutorials still cant figure it out

dark edge
#

@Thomas H.B#536 can't see anything in that video, just post a screenshot of the area where you determine where to spawn the projectile

frozen brook
#

Hello guys, pls my engine keep crashing when trying to join or create session

peak star
#

I was going to release my game today, but I found that the crossplay between Android version from google play store and PC version from Steam store over LAN is not working again. Does this have anything to do with store version numbers?

winged badger
#

if it is version numbers, it wouldn't work over the internet either

peak star
#

Well my game never supported internet play

#

Just LAN

#

So I have no idea

winged badger
#

ah, then it might be

peak star
#

I remember upgrading it to 4.24.3 because 4.21(?) was breaking crossplay on LAN when I did shipping build but not when I did development build

#

When I upgraded it magically started working

#

But then when I put out shipping builds it acted like it was dev build

#

Then I fixed that somehow by trying to build again and now it doesn't work with LAN crossplay.

#

So anyway what I'm doing now is I upped the Google Play store version one more number higher, rebuilt and about to push it to google play store, but I don't know how to tell the Steam store version to match that.

winged badger
#

i don't think thats the number its looking at

#

but the one unreal generates

peak star
#

In the project settings?

winged badger
#

unless you manually gave it version number in defaultengine

peak star
#

oh let me check defaultengine.ini --- in project folder?

winged badger
#

config folder

peak star
#

ok

#

Do you know what the variable(?) is called?

winged badger
#

no, its one bit of information i never had to use personally

#

so i just remembered enough to find it if i ever need it later

peak star
#

I don't find anything that isn't already in project settings there, in my project's config folder's defaultengine.ini

waxen socket
#

Good afternoon. Should I expect a lot of difficulty replicating the **physics **movement of fifty or fewer static meshes?

bitter oriole
#

It's borderline impossible really

#

Not until Epic's new internal physics engine is production ready

#

And only if it holds up as we hope it will

waxen socket
#

Really? Cause I've read if it's just static meshes, it's not that difficult. Is that not the case?

bitter oriole
#

You're talking about physics

#

UE4, like a few other engines, uses PhysX which is not deterministic

#

So the only way you can sync physics is by having the server run physics and all clients run with no physics, reproducing the server movement after a few frames

#

So it's not going to be interactive

waxen socket
#

I see. By not interactive, you mean the latency will be too bad to use the objects for any gameplay purposes.

bitter oriole
#

Yes

waxen socket
#

Dang. I just want some boxes to float across the screen and bump into eachother. πŸ˜…

bitter oriole
#

The other option is to integrate another physics engine into your game, ignore the UE4 physics, and synchronize the state (transform/velocities) of each physics object

waxen socket
#

Well, it looks like Chaos will have "PhysX parity" by 4.26 so maybe that will be my savior.

#

My game won't be finished for another year or two so maybe I can just wait for Chaos.

bitter oriole
#

My advice would be to not assume Chaos will solve this

waxen socket
#

Oh, I see.

bitter oriole
#

Epic does want Chaos to be multiplayer capable, but right now the bar is very low, and what you need is not trivial

#

So even if Chaos is way better, it's not 100% certain it will work well

waxen socket
#

Hm. Okay then. I'll look into other physics engines. I'm surprised I saw so much forum talk about replicating static meshes with a couple check boxes. I guess they must have not needed it to be accurate.

bitter oriole
#

You can definitely have a static mesh that teleports to its last know location every few frames with a couple of check boxes

#

You won't like it though

waxen socket
#

πŸ˜†

#

That's what I've accomplished so far, yes.

bitter oriole
#

Basically I've heard that Fortnite vehicles run entirely on the owning client, so the player has perfectly smooth physics, and then the server replicates that result, with massive anticheat checks on top

#

It's clearly not ideal, but doing better is a tall order

waxen socket
#

That's a good insight.

#

I need more or less exact locations as it's a space shooter so players have to see these boxes in the same spot as they float by.

bitter oriole
#

Well, you might get away with something for that case

#

Run physics on server, keep them off on client, and replicate the transforms & velocity with a nice cubic interp

#

Assuming the boxes are big enough, the slowness might work in a space context

waxen socket
#

The boxes are about a twelfth the height of the screen.

bitter oriole
#

Welp

waxen socket
#

As is the player.

#

About that scale and pace.

chrome bay
#

If it's a space shooter, I wouldn't even use physics

#

Do kinematic movement in a style similar to character movement

waxen socket
#

But I like the way the boxes collide.

bitter oriole
#

We're back to the "custom physics engine" option, and well, you can write a simple one yourself tbh

#

Other than that, Chaos I guess

chrome bay
#

If we're talking about "open space" as in deep space, how often are collisions going to matter realistically

#

Collisions between players are always going to be screwy whether it be physics or kinematic

waxen socket
#

Thanks for chiming in, Jambax, I always appreciate your input. I'm afraid I don't know what you mean by "kinematic movement".

#

I don't need collision between players.

chrome bay
#

Essentially instead of checking "simulate physics" and applying forces

waxen socket
#

Just between the boxes themselves.

chrome bay
#

Just calculate the changes in position/rotation yourself. Run that in your own loop that you can control

#

That's essentially how character movement works

waxen socket
#

Thanks for the advice, Stranger.

chrome bay
#

multiplayer just makes everything 10x more difficult

waxen socket
#

I'm learning that, yeah.

#

πŸ˜…

#

Okay, I'll look into kinematics. Time to brush off my math, I guess.

#

Jambax, earlier I was asking about RepNotify again. When an event has a cosmetic component, and a stateful component, do you split the execution into an OnRep function and a multicast event or do you do everything in the OnRep event?

It seems to me that when a player dies, I would run an OnRep function to set his status to Dead but I would play the death sound, screen shake, and particle effects in a multicast, no?

chrome bay
#

I'd just do it in the onrep

waxen socket
#

Really... okay. I'm surprised because then what if someone reconnects or joins late, wouldn't the OnRep go ahead and play the screen shake and everything again as they synced to the server?

chrome bay
#

They would but you can protect against that easily by checking the creation time of the actor

#

if (GetWorld()->TimeSince(CreationTime) <= 0.f) { return; }

#

Or you can check how recently the player logged in etc.

waxen socket
#

And that's what you do in your work? You check that stuff all the time? You like it that way because it means your game never misses a beat because a multicast failed to replicate?

chrome bay
#

Well it just means we don't have to waste bandwidth when the info is already there

#

We do this for all our muzzle flashes for example (wrote a post about it)

waxen socket
#

Yes, you shared that with me.

chrome bay
#

And in a 100-player shooter that's happening quite a lot

#

If you only have a handful of players it might not be a problem RE bandwidth/performance, but maybe you might run into an obscure issue where a player is playing a "death" effect but the "bIsDead" value hasn't replicated yet or something

#

Might be okay in that case, but in others you might need the full state to be up to date

waxen socket
#

Yeah, mine's four-player.

chrome bay
#

yeah rgr, so for four-player I wouldn't be remotely worried about bandwidth issues

#

So it's whatever is easier really, and whatever is less prone to error

waxen socket
#

Oh... now I'm really surprised.

#

I never thought you'd let me get away with multicasting.

chrome bay
#

haha well, I generally avoid them. In this case to me if you're already replicating a var, the multicast is wasteful

#

There is that issue where coming back into relevancy/late join can cause the FX to go off, but that simple check avoids that

waxen socket
#

Yeah, that's why I'm hesitating. I'm weighing the pros and cons of either multicasting, or putting a bunch of checks everywhere to account for reconnecting and late joining.

chrome bay
#

The whole OnRep concept is pretty powerful, you can do a lot with it

waxen socket
#

Googling...

chrome bay
#

OnRep == rep notify

waxen socket
#

Oh, you just mean the OnRep function.

chrome bay
#

yeah

waxen socket
#

Yeah, I agree. I've been pretty impressed by it. Since you advised me on it, I've been replacing all my multicast events with OnReps.

#

I just wanna be like you.

chrome bay
#

πŸ˜„

#

prepare to lose hair

waxen socket
#

Yep. It hasn't been easy. But I'm stubborn.

#

Thanks for the advice. I'm going to look into implementing CreationTime checks and the like.

#

Something does irk me about making two calls for one effect so I think I'll like it better that way.

chrome bay
#

It's worked really well for me doing it this way so far for sure

waxen socket
#

Cheers, Jambax. Have a great day.

eternal kite
#

I have doubt that it is possible to make a feature like , In a multiplayer game one person should be able to tag along with another person (Example :- A tour guide shows the places to the tourist) Not like the tourist should the following the tour guide, the tour guide must a have a control to make other player to come along with him. I saw this kind of features in some game like we walk with a NPC which tells us the game's story after that ends we gain the control again and we procced the game. Is it possible to make like this in unreal engine?

#

I am building this feature for a game where i show the places of a house or something like that to other person.

stoic dirge
#

Hi, I hope you can help me because this has been stumbling block for me along time now and it's demotivating me from starting to learn to make games.

What I want to use is a dedicated server for my games so I could host the server as a standalone solution.

I have read on how to build a dedicated server, that I can google quite easily. What I am struggling with is how do I use blueprints or code to create server-side logic. What I also would like is instructions or examples of what it looks like if I use a dedicated server how the client code would look like and how the server code would look like if I have a shoot functionality for instance or melee abilities for instance.

teal path
#

@eternal kite im no expert, but i feel like thats possible, in that you could have one pawn (character) that the guide owns and controls (along with their camera) and then another camera attached to the pawn, that the tourist owns.. seems totally doable.. you'd just have the tourist "posses" the second camera i think.. or even more so, if you only had a single camera (only see what guide really shows) that would probably be even easier.. but.. you'd probably want two cameras and then give the guide the ability to point the tourist camera at something when needed

eternal kite
#

I am actually completely new to unreal and i dont know rhe technical terms if you have seen any documention or tutorial abt this can you please share it @teal path

teal path
#

@eternal kite if you're totally new, i'd say start by reading that Network Copendium i just posted, it gives a good rundown of multiplayer

#

also on the Learning site (https://learn.unrealengine.com/home/dashboard), there is a "twin stick shooter with blueprint" that coves a good chunk of what you'd need in a generic sense... and it would mostly boil down to attaching two camera's and "posses" calls

eternal kite
#

Ok thanks

teal path
#

im only like a month or two ahead of you guys, so i've already fumbled through most of this lol

stoic dirge
#

@teal path I feel always I am missing something. The UE4 docs talks about multiplayer etc. But for some reason I get the feeling that docs only applies to listen servers and not client server model? Am I wrong for thing this? or does all that apply to dedicated servers also? If it does I assume when building a dedicated server the compiler would take out the bits of the server code and compile that for your server?

Thanks for the Network_Compendium. This looks super promising.

teal path
#

what i will say is... you might stumble across the "multiplayer shootout" which is in the UE4 docs, and on the UE4 youtube tutorials a "blueprint multiplayer" series... ignore both of those.. at least until you read the other two things i've posted

#

they are old and misleading

eternal kite
#

@teal path where is this network compendium actually?

teal path
#

that is by far the best reference i've found yet

#

also the main difference between "listen server" and "dedicated server" is where it runs

#

other than that, especially from a blueprint standpoint, its sorta all the same stuff (where it runs settings for events/methods and replication)

#

the page 9 of that Compendium is SUPER helpful

stoic dirge
#

other than that, especially from a blueprint standpoint, its sorta all the same stuff (where it runs settings for events/methods and replication)
@teal path This answer right here answers all my questions. THANK YOU VERY MUCH. To be honest I have been wanting to do game development on and of for 2 and half years now and I couldn't get a clear answer for.

teal path
#

yeah getting over that first hump is a bit tough

#

sadly it changes so quickly and a lot of the tutorials take shortcuts... so its hard

unkempt tiger
#

Is there anything that prevents me from: inside a MyCustomStruct::NetSerialize(), get a reference of some actor component in MyCustomStruct, and call said ActorComponentReference->MyCustomNetSerialize(Ar, Map, bOutSucess), so that I can basically acquire network polymorphism that's directly handled through the ActorComponentReference (which for all MyCustomStruct cares, just gets a bunch of bits to serialize), and thus avoid having to define middleman structs (to be contained in MyCustomStruct) which I then have to allocate, initialize, etc manually?

teal path
#

that Compendium is what really cleared a lot of it up for me

stoic dirge
#

@teal path LOLZ yes. First of many. I only found the Discord Community server now. So yes, thank you very much.

teal path
#

question, with the Game State -> All Players, what is the proper way to know if/which player state is current/owning player? just get the Player Controller -> Player State, and == it?

charred crane
#

Solved
Hey folks, hoping someone can explain why this issue is happening. I have a section of code that executes on the server and sends a client RPC that instructs the client to create a widget(I've unlinked the code on the other end of the client RPC, just the act of it firing breaks the future code). The code that's executing on the server character works fine, but on the client it causes some future code in the sequence to break. If I unlink the client RPC, it works again. Any ideas?

Turns out the answer had to do with how quickly I was attempting to do the step? I just set a 0.2 delay between the previous work I was doing and that section...and it's fixed.

open quail
#

Anyone knows if you can unlock steam player achievements throught the game server?

#

can't find any documentation

cedar finch
#

I'm setting the rotation of my AI's mesh to the rotation of the ground below them. It works good but it's "snappy" meaning it does it so fast that bumpy landscape's make the AI look jittery because he's setting his rotation so fast. So I tried using an R-Interp node and it looked great but it isn't updating the rotation for clients correctly unless I set the interp speed to something really high which basically defeats the purpose of the R-Interp node because it's looks "snappy" again. Anyone have ideas on what I should do?

red glade
#

@open quail there's two types of achievements, one is unprotected and the game client can achieve it, and the other is protected meaning only a dedicated game server that's on the app's official dedicated server list will be able to achieve onto the user.

#

If your not using protected achievements, and no one really does because it's more or less useless imo, than just run everything client side. Or if you want a server side event for something, then tell the client to then add the achievement to themselves

peak star
#

I am under the impression that CharacterMovement is the only thing included with Unreal Engine that has network smoothing and prediction built in. But sometimes I see people talk about other movement components and how they used them to get smooth networked movement. Can they do that?

peak star
#

@winged badger Is it the ProjectVersion you were talking about?

distant talon
#

You can always write your own movement component with replication and all the fancy stuff, there's some on the marketplace too i believe. that might be what you see

vestal harbor
#

Hey guys, I have an actor that has a physics simulated enabled mesh, ( its just a wheel ), with replicated enabled and replicated movement; the rotational movement of the actor isn't replicated? any ideas about what I'm missing?

bitter oriole
#

Replicate movement + simulate physics isn't going to work

wary wyvern
#

Guys, what If I want to trust client with some Actors (pawn, for example), do I have to replicate variables to server using RPC events, or there is some way to use variable replication to send values to a server?

bitter oriole
#

Replication is server to clients only

wary wyvern
#

So the only way is sending RPC?

bitter oriole
#

Yes

cloud oriole
#

Hello! I'm kinda new here
I'm trying to spawn players at playerstart objects, but despite the gamemode and default pawn being set in the world settings, only flying spectator thingies spawn for each player

#

each playerstart auto-possesses a Player (Player 0, 1, 2, etc)

#

if anyone has an answer or advice, please ping me πŸ™‚

#

I might be onto something
restarting the player through Event Handle Starting New Player in my gamemode BP works on the playercontroller I plug in!

#

I could just do it cheap and restart each player controller, but is there any better way to do this?

cloud oriole
#

I'm now trying to make a skeletal mesh only visible on the player pawn it's controlled by, but I can't seem to figure it out

kindred widget
#

@cloud oriole Use the boolean on the SkeletalMeshComponent. There's two. OwnerNoSee, and OnlyOwnerSee.

cloud oriole
#

Thanks!

open quail
#

@red glade Thanks, yeah that was one idea I had but didn't really know how used it was.

red glade
#

@open quail basically anything you want run on the server to be in control of in terms of the event happening, just get the server to tell the client to do it.

wary wyvern
#

Guys, is it possible to replicate a UObject just to one certain client, not all?

#

I replicate it using ReplicateSubobjects(), but is it possible to select a client, which I want to replicate the object to?

peak star
#

@wary wyvern you mean without using an RPC? I don't know.

#

I think it is possible in C++

floral crow
#

If you somehow manage to make it non relevant to the rest of the clients then you'll get that behavior

#

A way that comes to mind is make it be owned by that particular client and then replicate to owner only

#

I'm getting that error on a new test project I created to learn more about Seamless Travel. I used the TopDown template when creating the project

[2020.08.08-21.31.56:134][  0]LogLinker: Warning: Unable to load package (E:/developer/UnrealEngine/Engine/Content/Animation/DefaultAnimCurveCompressionSettings.uasset). Package contains EditorOnly data which is not supported by the current build.
Assertion failed: !GEventDrivenLoaderEnabled || LoadPhase > ELoadPhase::WaitingForHeader [File:E:/developer/UnrealEngine/Engine/Source/Runtime/CoreUObject/Private/Serialization/AsyncLoading.cpp] [Line: 7284]
#

I created a MyGameServer.Target.cs with the following contents:

// Fill out your copyright notice in the Description page of Project Settings.

using UnrealBuildTool;
using System.Collections.Generic;

[SupportedPlatforms(UnrealPlatformClass.Server)]
public class MyGameServerTarget : TargetRules
{
    public MyGameServerTarget(TargetInfo Target) : base(Target)
    {
        Type = TargetType.Server;

        ExtraModuleNames.AddRange( new string[] { "MyGame" } );
    }
}
#

And tried running the game through DebugGame Server

#

How can I sort this out?

wary wyvern
#

@peak star The only way I see, is to replicate them from PlayerController, which only replicates to certain player. But I wanted to know if it is possible to replicate it from another Actor, which replicates to all the players. But I think I will replicate UObject from Player controller. Looks like it suits for my idea better anyway.

floral crow
#

Where can I find all the command line arguments available when launching through Visual Studio?

dark edge
#

@vestal harbor check replicate physics to autonomous proxies. Also dig into the replication settings in project settings. Your mileage will vary tremendously and prediction is not built in.

shy kelp
#

should spawning of AI/enemies be in the gamemode or gamestate

distant talon
#

When overriding GetNetPriority where does the function actually run? Server, client, both? Trying to figure out how to give the Owner's connection extra priority for a specific actor. Does that work?

vestal harbor
#

@dark edge thanks for the tips, I think I got it working by changing the root component to the mesh component. πŸ‘

gusty raptor
#

Hi, so might be a simple question, but why is the render text of the server not set on the clients:

rough ember
#

you need to port forward port 3306

#

and use FText#abRender(10.0);

#

or alternatively FText#acRender(10.0)

meager spade
#

whoah

#

why are you doing all that?

#

@gusty raptor

#

what is this on?

gusty raptor
#

The code is within my player pawn, just trying to set a render text above the camera

meager spade
#

right but why the server and client rpc?

#

what is Get player Name? what does it return?

gusty raptor
#

it return the player name from subsystem

meager spade
#

what subsystem?

gusty raptor
#

takes a controller

#

steam

meager spade
#

but it should be pulling the name from PlayerState

gusty raptor
#

right, okay

meager spade
#

here

#

just try that

#

in c++ i would have used OnRep_PlayerState but you don't have that in BP

gusty raptor
#

hhm,so the timer.. is that cause the client is not loaded yet?

meager spade
#

the playerstate will be null

#

till its replicated

#

its a bit of a hacky solution but it should work

#

this is on dedicated server

gusty raptor
#

right, okay thanks for that

meager spade
#

PlayerName should equal SteamName

thin stratus
#

A one-off timer of 0.1 is pretty much destined to break though

#

So make sure you loop like Kaos posted

#

Lots of peeps delay stuff like it once and then wonder why it breaks with higher ping

soft shell
#

If you set a RepNotify variable to the same value on the server (i.e. no change, but you issue the "set" node) - does it get replicated (i.e. remote RepNotify run)?

kindred widget
#

I could be mistaken, but I'm pretty sure that the set node won't affect anything. There is a netupdate that you more or less register actors with that gets called. If the actor has reached it's update duration time it checks if any of the values of changed on the server's version of the object, if it's the same, I don't think it'll call the notify even if it got set ten times between those netupdates as long as it's the same value when that function checks.

#

You could always set something's NetUpdateFrequency to like 0.5 so it'll only update every two seconds. Make a little print onrep. Make two keys, one that changes the variable to something different and something that changes it to multiple other values and then back to what it originally was. If it prints after the one that sets it back to the original at the end, there's that answer.

whole osprey
#

Anyone able to help out with something? Everytime I spawn a projectile on the server after a play montage the spawn location differs from client to server. Added a screenshot of BP to show how I am spawning.

kindred widget
#

@whole osprey What are you printing?

whole osprey
#

The world location of the actor as soon as it spawns

kindred widget
#

What happens if you give it zero velocity? Does the X still change by that much?

soft shell
#

@kindred widget - I was just hoping that it internally saw the variable as "not changed" and avoided the network traffic, but I'll test tbh

kindred widget
#

It very well may. I know that changing a value multiple times in a single function doesn't cause it to send multiple changes. But I'm not exactly sure of the extent of how it checks to send or not.

#

In one of my projects I have my netupdate frequency of containers at like 0.01. So they more or less almost never update to clients, and I just call a ForceNetUpdate with an RPC to update the client. Works rather well in that specific case.

hoary lark
#

The general intent of replicated variables is purely to ensure everybody keeps up to date with a fairly recent value of a variable, not to broadcast an event per se, so by intent it shouldn't broadcast a non-change, I think Auth will be right

waxen socket
#

Good afternoon. Does anyone reading know of a way to have new joiners not spawn a new player controller? I'd like them to possess one of the four existing player controllers I've spawned myself using CreatePlayer. Cheers.

winged badger
#

override HandleSStartingNewPlayer in GameMode, do not call Parent

#

and handle it manually

#

or put null for default Pawn in GM and hope for the best

waxen socket
#

Ah, that sounds like the ticket. Thanks, Zlo.

grizzled stirrup
#

If a game is set to be not joinable after the game starts and a player disconnects, is it impossible for him to rejoin even using AGameModeBase::FindInactivePlayer ?
And is FindInactivePlayer only really intended for games where a player might leave and rejoin a lobby that is joinable for the duration of the match in order to get the same PlayerState properties?

subtle patio
#

Sorry to be 'that guy' but has anybody had any luck connecting a multiplayer game with Hamachi?
I've tried forwarding port 7777 and giving a 2nd client my external IP (Which works on the same machine but I have a feeling the outbound connection is getting to the router and bouncing straight back (like a local host connection would)).

Whenever somebody on a different network tries to connect, using hamachi or the external ip, no joy at all in setting up a multiplayer session.

tranquil thunder
#

Does it matter if I call a "Run on Server" event via the server? It would clean up code quite a bit πŸ™‚ And both options work in this specific case

kindred widget
#

@tranquil thunder It doesn't matter. I do the same thing with some stuff in a listenserver setup. Normal controls make a Run on Server RPC, the server player does the same thing since on a listenserver they're a player as well. It seems to work well. I haven't noticed any problems. I generally just tend to follow the RPC chart. This page is a good reference, about halfway down. https://docs.unrealengine.com/en-US/Gameplay/Networking/Actors/RPCs/index.html

Designating function replication across the network

halcyon abyss
#

Hey guys

#

Since Listen servers with steam don't show ping.... I wanted to at least show country code...

#

Does anyone know if this is retrievable from steam users?

tranquil thunder
#

@kindred widget Thanks!! πŸ˜„

harsh lintel
#

does any feature of epic online services help with making a server or is having a dedicated server still needed

meager spade
#

and ofc you will need to host your own dedicated servers

#

they wouldn't do that for free

harsh lintel
#

Wrong wording

#

Do the services have a way of making/building a dedicated server, or do build my own with VS as I've been doing

meager spade
#

same as you always do it

harsh lintel
#

alright thanks

subtle patio
#

would being in another country cause connection problems via hamachi?

#

afaik testing via steam uses region locked servers/ports right?

#

but hamachi should be direct on a vpn surely?

#

Alternatively to hamachi, how do international teams usually test their multiplayer projects?

#

given the steam limitation

gritty pelican
#

i have problem with RPC function

void Server_PassLocationAndRotation(FVector_NetQuantize NewXShipLocation, FRotator NewXShipRotation);
void Server_PassLocationAndRotation_Implementation(FVector_NetQuantize NewXShipLocation, FRotator NewXShipRotation);```

.cpp
```void ACPP_XShipPawn::Server_PassLocationAndRotation(FVector_NetQuantize NewXShipLocation, FRotator NewXShipRotation)
{
}
winged badger
#

Steam doesnt have to filter by region

gritty pelican
#

oh sorry

#

I forgot _Implementation

subtle patio
#

@winged badger Alright - I'll loop back to checking steam out, thanks for the nudge in the right direction πŸ‘

#

Cause hamachi is a pain in the ass

winged badger
#

We use steam lobbies for connection

#

Those can be configured to filter or not

#

Fairly sure servers can as well

subtle patio
#

that's interesting, I've also read here that I might be able to switch my steam downloads region and trick it into letting the connection through - Some testing needs to be done

gritty pelican
#

can i check listen server like this?

{
    if (IsLocallyControlled())
    {
        }
}
#

for pawn

winged badger
#

Yes

potent cradle
#

I'm having a pretty bad glitching experience with my AI characters while running a dedicated server (PIE). When I press simulate or play offline, there is no such issue, so it seems to be a networking issue. Maybe a net correction issue?

What could be causing this behaviour with AI controlled characters?

sand iris
#

can the properties of structs be replicated?

kindred widget
#

@sand iris I remember reading somewhere that individual UStruct properties can be replicated instead of the entire UStruct. I do know that it's possible with TArrays per index but that they're not sorted in correct order, but not fully sure about just UStructs.

grave notch
#

Hi. Can someone explain how properly make movement for multiplayer, so it sync for all players? I'm trying to make simple sync for Top-Down example. I read 'Unreal Engine 4' Network Compendium, and it says that often you move characters locally (but also send everything to server?):
"Note: To prevent a feeling of β€œlag” for the local Client, Coders often, in addition, let this Player directly control
their Character locally, although the Server still might override the Character's Location when the Client starts
cheating! This means, that the Client will (almost) never 'talk' to other Clients directly."

So when i tried to make local movements (basically just run Top-Down example on with server+client and another client. For server+client everything work perfectly, i can move my character and other clients can see his movements pretty smooth (also animations and rotations). But when i click on another clients (that not server+client), it just doesn't work. Then i made server RPC function that move character, and change in playercontroller to use that function, (it just run same function but inside RPC function, so it called from server). After that on server+client everything still perfect and on other clients you can finally move character, but it looks terrible, it's not actually moving but just getting sync from server but position (no rotation, animations, etc), but on server+client his movements looks good (because it run only on server?). When i try to tell client to also move locally it doesn't work, or when i try to do it from RPC Client (inside RPC server), still doesn't work.

I probably misunderstand something completely and can't figure out how it should be.

#

I use C++

kindred widget
#

@grave notch I could be mistaken, but I believe in a case like yours that what they generally mean is that you should call the move function on the client at the same time as the RPC. The client will technically move before the server does since there will be a lag between the server and client. You set your server's movement corrections just enough that your server won't always overwrite the fact that the client isn't quite where the server is, but that if the client moved too far, then it would be corrected. It gives the illusion that there is no lag to the client since their character seems to move instantly instead of 80 to 250 milliseconds later depending on RTT latency.

grave notch
#

@kindred widget Well that's how i imagine it should be, but i tried to do it, i called SimpleMoveToLocation function just before RPC (that basically just calls the same function), and it doesn't do anything on client. As i understand now, the problem is the function, because if i just use SetActorLocation, it seems that it works, but not SimpleMoveToLocation function. Is it somehow related to authority (so client can't run it even on owning actor?), because that function use Navigation System?

lunar root
#

What are you guys doing to debug your MP game?

I'm wondering since I don't want to go through the main menu all the time just to test my game and stuff but due to ServerTravel it seems like I have to

However I recently saw a video riot showcasing some tech of Valorant and they had a bunch of debug tools like custom console commands and also they didn't have to go through the menu and matchmaking and Stuff.

How do you realize something like that because right now it really feels like pain in the ass πŸ˜‚

mellow geode
meager spade
#

you sure its that?

#

cause that should not crash unless your actor is null.

mellow geode
#

the trace is right there =/

meager spade
#

no that trace does not point to that

#

well it does, but it doesn't say why

#

and you are assuming its GetLocalRole() that is crashing

mellow geode
#

well true its the underlying script that is called

meager spade
#

that would crash if your actor was nullptr, but it shouldn't be cause BeginPlay should only be called on a valid actor

#

go install the engine symbols

mellow geode
#

Yeah, i figured this was safe from BeginPlay()

meager spade
#

and crash it again

mellow geode
#

this used to be just Role before the update

meager spade
#

correct, Role == GetLocalRole() now

#

it just returns Role

#

see

#

only way that would crash, is if the actor was null

#

would need to see more code

mellow geode
#

Well the crash seems to bubble from the MulticastScriptDelegate::Add so i thought there might be some loading clash

meager spade
#

and proper callstack

#

as you don't have engine symbols

mellow geode
#

gonna boot up the debugger

meager spade
#

half the callstack is missing

#

grab the symbols

#

also

#

dw its not a 23gb download

misty stump
#

Could someone explain to me why GetLastInputVector() returns null on the server? I'm trying to use it in a Physfunction.

meager spade
#

dedicated server?

#

GetLastInputVector is local only

misty stump
#

how do you get input on the server then do I need to create a new function to send it

#

?

meager spade
#

yes

#

you would need to send it from client to server

misty stump
#

What do you think is the best way to replicate it for use in a physfunction?

meager spade
#

i would probably send it through the CMC or the actors ReplicatedMovement property

#

but both require C++

misty stump
#

I'm familiar with setting a variable to replicate through GetLifeTime.... and also OnRep which I use on my Character. The CMC is a bit of a beast though. I'm not exactly sure where I'd put it.

mellow geode
#

ScriptDelegates.h:324 is calling CompactInvokationList which looks like a cleanup step

#

I cant understand why GetLocalRole would call that though

misty stump
#

Normally data is sent from the server not to it

#

Could you briefly explain the implementation of both options?

mellow geode
#

hmmm looks to be caused by the previous call using AddDynamic but line always matches the next statement, odd.

meager spade
#

@mellow geode you get it sorted?

mellow geode
#

Well commenting out my HealthComp->OnHealthChanged.AddDynamic(this, &ASCharacter::OnHealthChanged); stopped it from blowing up, but i havent figured out why. I havent wrapped my head around the macro enough to fix that yet though

meager spade
#

HealthComp was probably nullptr

#

@mellow geode

mellow geode
#

yep, wrapping around if blocks it

meager spade
#

where is healthcomp created

#

and set?

mellow geode
#

constructor

meager spade
#

show me

mellow geode
meager spade
#

and show me the line in the header file for it

mellow geode
meager spade
#

and show me the OnHealthChanged function

mellow geode
#

probably one of those cached bp desync things?

meager spade
#

in header file

mellow geode
#
    UFUNCTION()
    void OnHealthChanged(USHealthComponent* HealthComponent, float Health, float HealthDelta, const class UDamageType* DamageType, class AController* InstigatedBy, AActor* DamageCauser);

meager spade
#

ok so everything looks good

#

you didnt compile using the compile button in the editor?

mellow geode
#

many times heh

meager spade
#

yeah hot reload can cause corrupt blueprints

mellow geode
#

tried even running it from IDE

#

editor reload

meager spade
#

you should never use the compile button

#

in the editor

mellow geode
#

hah so it seems

meager spade
#

try creating a new blueprint

#

for your player

#

and uncomment that line

#

and see if it crashes

mellow geode
#

yeah didnt wanna copy over the stuff i had built in BPs

winged badger
#

GC crash wouldn't be consistent that soon, and he seems to be UPROPing them

mellow geode
#

it seems like working in both BP & c++ has a lot of desync issues

meager spade
#

the only think is a corrupt BP

#

thing*

winged badger
#

ofc when delegates crash

meager spade
#

cause everything else is good

winged badger
#

the line reported is usually one below the actuall crash

mellow geode
#

interesting

meager spade
#

yeah i said to him it wasn't GetLocalRole() that was crashing

#

it was something else before that

winged badger
#

so crash is binding a delegate in health component?

#

didn't read everything above

mellow geode
#

yep, when the health comp is null

meager spade
#

have you verified its null?

winged badger
#

on client or server?

mellow geode
#

well, just that wrapping in an if caused it not to break

meager spade
#

can you put a check(HealthComponent);

#

ah so its null then

#

its on beginplay and the component is created in constructor

#

sounds to me like a corrupt bp honestly

#

or something

winged badger
#

or something overwriting the health component pointer

#

shrugs plenty of time for that to happen

#

data breakpoint time

meager spade
#

yeah but i have seen this before in #cpp where people have hot reloaded

mellow geode
meager spade
#

and they get weird crashes

mellow geode
#

dont think its an accidental overwrite

winged badger
#

well, did you hot reload?

mellow geode
#

nah, done a fresh run

winged badger
#

if not put a breakpoint after health component is instantiated in constructor

mellow geode
#

but maybe doing hot reload causes a lasting break?

meager spade
#

actually, rename the component to HealthComponent (change HealthComp)

#

compile with editor closed

#

and see if it fixes it

winged badger
#

then put a data breakpoint to the health component pointer

#

and it will trigger a breakpoint, with the callstack, when it becomes null

mellow geode
#

trying the rename now

#

i like that idea, force it to reinitialize

winged badger
#

re-serialize

meager spade
#

i honestly think during deserialization of the BP, its setting it to nullptr

winged badger
#

not re-initialize

mellow geode
#

both πŸ˜›

meager spade
#

thing with BP's is, it keeps info

#

if you delete a property, and put it back, it would remember it

#

that can lead to so many issues

winged badger
#

if you made it Editable, then changed it in BP, then removed Edit specifier

#

it would still be ninja changing your defaults

mellow geode
#

yep the rename worked

#

thanks @meager spade

meager spade
#

what have you learnt? πŸ˜„

mellow geode
#

bps r dum

meager spade
#

don't use the compile button in editor πŸ˜„

mellow geode
#

compiles r dum

#

πŸ™‚

meager spade
#

close editor, compile, reload

winged badger
#

enable live coding, while you're at it

#

it also disables hot reaload

#

and its reliable as long as you don't change any header files or constructors

#

even from editor

mellow geode
#

lol

#

i will be doing that though

winged badger
#

also, disable auto compile new c++ classes

#

thats one of the more fail settings on by default

meager spade
#

livecoding disables that automatically

#

so just enabling it disables it

winged badger
#

i still don't get that forcing of hot reload by epic

#

nobody ever shit on it as much as epic programmers when they made it to here

meager spade
#

@mellow geode you doing that tom looman course?

arctic mesa
#

can anyone help me with replication?

mellow geode
#

@meager spade yep, lot of history with networked games in other languages / engines, using this to get a handle on the api surface

meager spade
#

yeah i speak to Tom quite a lot

#

that course is good from what i heard

mellow geode
#

yeah shows a lot of the different sync mechanisms

meager spade
#

@arctic mesa don't ask to ask, just ask

mellow geode
#

although i dont really agree with how he structures the server/client flow for some stuff

meager spade
#

what you mean?

mellow geode
#

its intro tho so makes sense its very ad hoc

meager spade
#

show me an example

arctic mesa
#

@arctic mesa don't ask to ask, just ask
@meager spade what do you mean?

mellow geode
#

like how often your evaluating GetLocalRole versus having more distinct pipes of execution on one side or the other

meager spade
#

you asked if someone can help you, but you never asked a question

mellow geode
#

im still working through it so take this with a grain of salt

arctic mesa
#

oh

#

right

meager spade
#

yeah but that is common practice

#

you will use GetLocalRole and GetNetMode quite a lot

mellow geode
#

oh yeah absolutely

meager spade
#

and IsLocallyControlled

mellow geode
#

you need to

#

but how often the same function is called on server/client which then branches some number of times, versus having the branch happen much earlier in the event

meager spade
#

well that depends on the flow tbh

mellow geode
#

ye exactly

#

its personal preference / what you feel is more maintainable & scalable

winged badger
#

there are techniques that allow you to write more logic that works no matter if server or client

mellow geode
#

yep

winged badger
#

like deferred spawns

#

without them, if you need to change any replicated variables on the server as its spawned

mellow geode
#

im used to a lot more client side prediction stuff an less RPCs

winged badger
#

you can't have same BeginPlay logic on server and client

meager spade
#

also gets worse when you need to deal with Relevancy

winged badger
#

as client will have updated values and server won't

meager spade
#

as clients will destroy non-relevant actors

#

and recreate them when they are relevant

#

which runs BeginPlay again

mellow geode
#

yeah, there is a lot more magic happening behind the scenes in ues networking than im used to

winged badger
#

unless you blatantly lie to engine

#

πŸ˜„

meager spade
#

so if you have say a Monster that plays Spawn Animation on Begin Play

#

a client becoming relevant to it, would see the spawn animation

#

πŸ˜„

mellow geode
#

ah the classic wow stealth bug

meager spade
#

even tho its already spawned and alive

arctic mesa
#

so i'm using a package called "Character Skills", i decided to integrate all 11 skills into my project and they aren't replicated, right now i am trying to replicate running/dashing

winged badger
#

never assume anyone is familiar with a third party package

mellow geode
#

the stealth sound that alerts people a rogue just passed by you was accidental, its only supposed to play when the buff is first applied

#

but network syncing made it so when you see him, the buff was just applied

winged badger
#

we had monsters, as you run into relevancy range, get up to play their death animation

meager spade
#

did

#

not anymore πŸ˜„

winged badger
#

i said had

meager spade
#

yeah

#

that was a fun one

mellow geode
#

ah ye daoc i think is still like that, as you run into an area of corpses and their bodies flop along the horizon

meager spade
#

i still remember the time, a player would see a monster vaulting

#

no where near a vault

mellow geode
#

what game yall talkin about?

winged badger
#

Red Solstice 2

mellow geode
#

ah cool

arctic mesa
#

if any of you need to take a look at the running/dashing code so maybe you can help me, just ask me

meager spade
#

i still remember when we had issues of invisible monsters

#

due to the camera πŸ˜„

winged badger
#

@arctic mesa the trick is to keep the max walk speed synced at all times between server and client

meager spade
#

then done some hacks to the camera manager to fix it πŸ˜„

#

@arctic mesa dashing is better when you use a RootMotion Source

winged badger
#

to do that with owning player, it has to change its speed as it sends the RPC, and you need to skip replication back to it

meager spade
#

as it keeps everything synched and predicted

arctic mesa
#

the thing is i don't know the first thing about networking

winged badger
#

then go to pinned messages here on this channel

#

find the network compendium

#

and read it a few times

meager spade
#

but converting Single Player stuff to Multiplayer is going to be a world of hurt

mellow geode
#

just check replicated right? πŸ™‚

meager spade
#

if only it was that simple

winged badger
#

we do most of our networking heavily customized

mellow geode
#

i jest cause that's how it was always advertised when i was doing unity networking

meager spade
#

urgh unity and networking

mellow geode
#

not their networking //shudder//

winged badger
#

spawn a 33k actor level procedurally and have it networked and ready for play in ~12 seconds (unless someone is using a laptop, then it takes longer)

mellow geode
#

native c# impl

meager spade
#

yeah 12 seconds(ish) on a high end pc, about 1min on a older pc/laptop. Least you have time to read the stuff on the loading screen πŸ˜„

arctic mesa
#

i managed to make a replicated actor where if the server presses q, it changes the actor's model to stairs, if the client presses q, the actor's model changes to ramps, changes reflected throughout all machines

winged badger
#

read the compendium @arctic mesa

arctic mesa
#

i was a fool to think i could re-use the code for a simple actor in such a thing like dashing/running

arctic mesa
#

i am reading it right now

winged badger
#

nods

#

unlikely to have a networking conversation you can follow until you digest at least a part of that

cedar finch
#

I have a question. I'm redoing my projectile weapons such as rocket launchers etc. My issue is when It comes to radial damage. I do NOT want to apply damage to my teammates, but I DO want to apply damage to myself. Just like most COOP games. What is an optimized way to get all the players? I ask because people will be shooting these weapons a lot. I know I can get all players from the Gamemode but then that would be called every time I shoot. I don't want to ever use "get all actors of class" especially when shooting a lot. Ideas?

#

Somehow I have to get all the player characters and then just remove myself from the array and connect the array to the actors to ignore pin. I just need to know the best way to get all the players

meager spade
#

when the projectile overlaps

#

run a filter

#

if (OverlappedActor == Instigator || OverlappedActor->Team != Instigator->Team)

#

just that simple?

#

i did it as c++ but the same is true for BP

cedar finch
#

But that only works for the projectile impact though correct? I did so you can't direct impact teammates. But what if say I shoot a teammate and the projectile explodes, I want the radial damage to hurt me, but not the teammate.

#

I'm applying impact damage, then radial damage

meager spade
#

well that event will be called on each player

#

right?

#

this one?

cedar finch
#

Ahhh I see where you're going.

winged badger
#

Instigator has all the information you need

meager spade
#

instigator is a controller tho

#

but as this runs on server

#

its fine

winged badger
#

thats awkward

meager spade
#

its server only

cedar finch
#

lol I forgot about that. I was so tunnel vision on the projectile

winged badger
#

DamageCauser is instigator then?

#

gg epic on confusing naming

meager spade
#

no

#

DamageCauser can be a weapon

#

or a grenade

winged badger
#

and weird function, literally the entire engine uses Pawn as Instigator

meager spade
#

so should not be trusted

winged badger
#

except that

meager spade
#

something like that could possibly work

cedar finch
#

Yea that should work. Thank you guys. πŸ™‚

meager spade
#

this is why you don't use the built in engine damage stuff

#

and roll your own πŸ˜„

cedar finch
#

So I was using a Sphere overlap actors node because I hate the built in radial damage lol. But it has no instigator so I was left high and dry. That's why I was asking how to get all players easily lol

#

Well I guess I could do the same check you did above though to see if the overlapped actors were friendlies. That would work. Ok so I have two options. πŸ™‚

fossil spoke
#

Does anyone know how the ReplicationGraph in the ShooterGame project gets initialized? There doesnt seem to be any mention of it in the Configs...
Is it not enabled by default?

lavish cypress
#

@fossil spoke in DefaultEngine.ini under [/Script/OnlineSubsystemUtils.IpNetDriver] - ReplicationDriverClassName="/Script/Module.ClassName"

#

I think you can also set that in other Driver config sections as well

#

e.g [/Script/OnlineSubsystemSteam.SteamNetDriver]

fossil spoke
#

I know thats how to enable it, im asking specifically how ShooterGame does it, it appears that its not enabled by default, unless im mistaken.

lavish cypress
#

try Net.RepGraph.PrintAll and check output

tidal venture
#

I'm trying to figure out if I need to use the Gameplay ability system in my game, why it's more robust than doing it with regular replication?

bitter oriole
#

Well, are you doing a game with multiple "ability" type actions like in a MOBA ?

#

If yes, then you might find it useful because it has a generic framework for replicating abilities

tidal venture
#

I am making a sword game, I'll have a few ability (2 per classes) but nothing really intense like a MOBA

#

I'm wondering if the gameplay ability system would benefit by example a sword swing and such

bitter oriole
#

No, a sword swing is not something I think would benefit from GAS

tidal venture
#

okay thank you!

#

I'm really bothered about this, I've been using unreal for 6 years and I never tried that ability system

bitter oriole
#

You can do it with GAS, it kind of fits the purpose

#

But using a huge, fast-moving plugin for a small use case is likely not a great idea

tidal venture
#

I see

#

At the moment I send the swing input to the server which then perform everything and it replicate it to the client. I was aware that if the client has 50ms ping, that mean he won't get his action to start until the next 50ms. To ensure that you don't feel like you are touching someone on your client that is not here I was preferring this option. I realize now that a client with something like 150-200 is really suffering from the lag and I'm not sure if I should launch the event on the client directly when it happen

#

I'm afraid that if I launch the swing action on the client and you touch someone on your screen, the server won't actually have the same result and that could be more frustrating then the 150ms

#

what are your thought about this?

#

@bitter oriole Just in case you are not looking, tell me if you prefer me not pinging you πŸ™‚

bitter oriole
#

What you should usually do is have the client animation run immediately always, but have a separate hit effect that runs when the server confirms the hit

tidal venture
#

that mean it's inevitably going to make you feel like you should have touch someone but the server say no

#

(of course, the server should always be the one authoritative toward damage and hit effect)

bitter oriole
#

It's not inevitable really

tidal venture
#

I'm living a little dilemma, cause the enemy can also launch a blocking action which could result with this:
User A swing sword, touch user B
User B launch blocking and then User A receive the blocking event

#

(that where it get more complicated)

bitter oriole
#

It doesn't really because it's an age old issue that has mitigations

#

The usual example is called peek shooting

#

What happens if you shoot someone that hust hid behind a wall corner ?

#

Shooter successfully shot (from his POV), target successfully hid (from his POV), but both cannot be right

tidal venture
#

I know quite well this example, I don't think it apply as well with bladed weapon with swing/blocking, but it's really close of course

bitter oriole
#

It's exactly the same thing, you have to pick a side here and use that side for server-side reconstruction

#

You can also do middle-ground and pick the server POV

#

Though that will likely be bad for everyone

#

The hard part is rewinding time on the server

tidal venture
#

I was thinking of this at the moment

#

but I guess that the best thing I can do to ensure better result for both blocker and attacker

bitter oriole
#

Basically when a melee action arrives at the server, it's attackerLatency old; and the location of the target from the attacker POV is 2 * attackerLatency (== attackerPing) old

#

From the target POV, it's even older (2 * attackerLatency + targetLatency)

#

So if you apply the "shooter is right" rule in your game, the target is judged ~1.5x the average ping late

#

There are two ways to have no discrepancy at all, but both have issues

tidal venture
#

Why my scenario is a bit different it's because we have two shooter, one that is blocking and another that is attacking. But I really consider doing some reconstruction like you suggest considering both POV

bitter oriole
#

First way is to have wind-ups on all actions, so that there is a 200ms un-cancellable animation

#

You tell the server when it starts and so the server knows 200ms early that youre blocking, and so other clients can known too when the blocking player will actually be blocking

#

In this case, you can actually have both blocker and shooter be right, which is unfeasible normally

tidal venture
#

I was doing a technique like this with a custom C++ server for an old project (based on 100ms) I can do this using blueprint you think?

#

I was not even thinking of this, but it might be just the way!

#

(specifically cause my attack and block have a pullback animation, which could give me more then the time I need to get this 100-200ms delay)

bitter oriole
#

Yeah if it fits the game it's perfect

#

In shooters it's not really possible

tidal venture
#

(it's nothing like bullet that need to be instant)

#

exactly

#

So I would go with something like this:
Client A trigger Swing at 0
Server receive Swing 50ms later
Server wait 150ms before launching the pullback then start the pullback with 200ms advance so the state should be very very similar if I'm not wrong

#

(forgot to mention client B ahah)

#

Server sent directly input to client B
Client B take 50ms before it receive it, so he launch the animation 100ms in advance (by interpolating of course)

#

The real deal here it's to know exactly how much time it take before the data travel from client A to server then from server to Client B

bitter oriole
#

Don't forget client A is basing its action on the state of client B that was visible at the time, which is much older

#

Since that state, from client B originally, is latencyB + latencyA old

#

When the hit arrives on the server, it's latencyB + pingA old

tidal venture
#

Yeah, that seem fine and it's part of the "game" when we talk about multiplayer, thing just can't be perfect until we get all super internet speed, so I'm fine with this

#

what is your best recommendation to know the latency in between the Input of the user swing and the server receiving the call

bitter oriole
#

ping/2

tidal venture
#

in the past I was using something like UTC now

#

and it was really not accurate (from 10ms up to 40ms margin error)

#

I like better the idea of using the ping, it might sound funny, but I have to find the way of doing it now πŸ™‚

bitter oriole
#

Basically how your shield (blue) and shooting (red) can work

#

Circle is when blocking actually starts, green is the latency of A, etc

tidal venture
#

It remind me of gabriel gambetta

#

I should be able to apply that concept

bitter oriole
#

Of course in this case, the windup time is way too small

#

Notice than B can still be killed while shielded

#

(from his POV)

tidal venture
#

yes, it's inevitable, the goal is to make this almost impossible under 100ms ping or so

bitter oriole
#

πŸ‘

tidal venture
#

I already feel a bit more confident about what I'll put in place πŸ™‚

#

thank you again!

#

I was wondering for a generic ping command, but it seem like they only have one regarding their session system, so I'll have to get it directly from my AWS services

#

or maybe I'm not aware of a generic function to get ping in between client and server

bitter oriole
#

playerstate->ExactPing

tidal venture
#

I literally found it at that time

#

I'm trying this in a build tomorrow for sure!

#

it's seem to be divided by 4, so I guess it's safe to assume that I can just multiply it by 2 so I get the value you were suggesting to me?

#

probably not

#

I guess I confuse myself for no reason, just getting half of it is probably the most accurate thing to do

bitter oriole
#

ExactPing * 2 would be the latency, ExactPing * 4 the real ping

tidal venture
#

excellent, thank you for all your answer and explanation, time for me to run to bed! Have a good day or night πŸ˜„

potent cradle
#

Regarding my "net correction" issue on AI yesterday. I made some test cases.

52 concurrent AI characters - Game doesn't even start, the whole world stays frozen
37 concurrent AI characters - Glitching like in the gif
15 concurrent AI characters - Seems smooth, I can't see the glitching.

Am I running into Unreal's networking limits or something to that effect? It almost feels like it's trying to optimise the network traffic because it's getting overwhelmed.

oak hill
#

How can I spawn a replicated component only on the server and the owning client?

#

Because if i spawn in game a replicated component it's added to all clients and I don't need it on everyone

chrome bay
#

You can't do that with components

#

They're all or nothing

#

The internal properties of the component can have conditions though, same as regular properties.

#

@potent cradle hard to say, something else might be clogging it up. Use the Network Profiler to see what's being sent and how often.

oak hill
#

Guess I can simply destroy them on the other clients? Anyway, on 4.21 I was able to do that... i was only spawning the component on the server and the owning client, but NOT replicated

#

In 4.25 trying to to this gives me a net guid error

chrome bay
#

You'll probably get errors because it'll be trying to replicate properties from the server either way.

#

And then it won't find a matching object to apply them to

#

You can spawn a non-replicated component, but obviously it can't have any networking support then.

oak hill
#

it kicks me out from the server when I try to interact with the component

chrome bay
#

Yeah, because the ID's won't match

oak hill
#

You can spawn a non-replicated component, but obviously it can't have any networking support then.
@chrome bay but it was working in 4.21, I've used for months XD

chrome bay
#

It shouldn't have been

oak hill
#

I was able to call the server

chrome bay
#

You can't spawn an object locally, and then use it with the network. It's not stably named nor matched up.

oak hill
#

So I guess it was a sort of bug?

chrome bay
#

If you want to spawn something at runtime that is network-relevant, it has to be replicated from the Server.

#

Or, already exist in the serialized level / class-default object.

potent cradle
#

I'll give that a go Jambax, thanks πŸ™‚

chrome bay
#

Yeah, or a fluke maybe

lunar root
#

What are you guys doing to debug your MP game?

I'm wondering since I don't want to go through the main menu all the time just to test my game and stuff but due to ServerTravel it seems like I have to

However I recently saw a video riot showcasing some tech of Valorant and they had a bunch of debug tools like custom console commands and also they didn't have to go through the menu and matchmaking and Stuff.

How do you realize something like that because right now it really feels like pain in the ass πŸ˜‚
@lunar root

chrome bay
#

@lunar root that's impossible to answer because it's game-specific

#

If you need custom tools or debugging, you have to make it yourself.

oak hill
#

Yes, I know that, in fact I found it strange that it worked in 4.21... though I find it should be possible to have components only on server and the owning client

chrome bay
#

The only conditional object replication you can have is actors only replicating to their owner

#

Nothing else is supported

#

And that's only supported at the actor level too

oak hill
#

I see... try to change my code to spawn only from authority, thanks Jambax

lunar root
#

The thing most curios about is how to test my MP game without going through menu and stuff

chrome bay
#

It's entirely up to your game

lunar root
#

Just using 2 clients in PIE

chrome bay
#

If the game is setup correctly, most of the time you should just be able to set it up for 2 clients, and hit "play"

#

Sessions etc. doesn't work in the editor - that kind of thing you have to test in standalone

lunar root
#

But somehow I have to skip the menu and character selection when doing this, since ServerTravel isn't working in PIE I won't get out of the menu

#

So it would be nice to just have a default character which is selected as soon I launch PIE with 2 clients and do t have to go through the entire menu/selection process

gritty pelican
#

hello, which is best for replication? FVector_NetQuantize or FRotator?

chrome bay
#

That's just something you'll need to setup yourself, it's totally specific to your game

#

@gritty pelican They both serve different purposes

gritty pelican
#

But during replication, which will replicate faster?

chrome bay
#

FVector_NetQuantize is smaller, but it won't replicate faster.

#

FRotator has quantization methods also. See FRepMovement

#

You just need to wrap it in another struct with a custom NetSerialize() function.

gritty pelican
#

okay, thanks

#

FVector_NetQuantizeNormal is better than FVector_NetQuantize?

chrome bay
#

different purpose, so not neccesarily

#

The size of the NetQuantized vectors changes depending on the values

gritty pelican
#

FVector_NetQuantizeNormal = (1.000)
FVector_NetQuantize = (1. 000 000)
it's true?

summer nova
#

@potent cradle are those full characters?

#

if they are.. holy shit RIP

potent cradle
#

Yes

summer nova
#

characters have insane replication overhead, you might want to use simpler actors instead

potent cradle
#

I was working on the assumption that I would be able to have 50-100 at the same time?

summer nova
#

that will put a server to its knees

#

specially if they also have replicated components

#

plus the cpu overhead of 5 cmcs is huge

potent cradle
#

Well, fuck πŸ˜›

#

Many games have like 100 players though right? I wasn't expecting more than that, even 100 from what I heard was tricky, but...not even 50?

bitter oriole
#

100 animated characters is possible but it requires a lot of extremely careful work