#multiplayer

1 messages ยท Page 645 of 1

grim rain
#

hey guys whenever i play with more than 1 client i get a lot of lag like 30fps in the editor. Anyone know what might be causing this issue?

#

But with just one client or standalone works perfectly fine

empty axle
bitter oriole
#

Not sure what you mean

spiral halo
bitter oriole
#

Depends if you just want to completely ignore the entire Unreal multiplayer, or make Unreal use this for replication

#

From the looks of it, it's option A

#

So you'd need to make this into an UE plugin to expose all features and then use that interface

bitter oriole
#

Second option is way beyond everyone's knowledge here

#

Spend 5 years remaking the engine basically

spiral halo
#

Oh alright, thank you

blazing socket
#

Basically, weapon swapping doesn't seem to be possible on the client, only the server. However I can use the weapon spawned from BeginPlay on the client. I'm only running spawnactor and destroy from the Authority, so not sure why its not working.

upbeat gazelle
#

i found answer to my question:
float NetCullDistanceSquared Square of the max distance from the client's viewpoint that this actor is relevant and will be replicated.

dark edge
autumn maple
#

but in UE4.26.2, "Multiplayer Options" are different from the tutorial, it's like this...how should i set?

twin juniper
#

Hello everyone.I am spawning a non-replicated actor across all clients using a function that runs on server and then calls a multicast.It is spawning perfectly.But when i am destroying it using same Calls on server->mulitcast then it is getting destroyed on server but not on clients.I am making a battle royale game where there is hundreds of loot which player dont even touch.SO i thought it is waste to replicate them.PLz help me.Thank you

sinful tree
twin juniper
#

Yes.

sinful tree
#

You want that set as a replicated actor and nix the multicast.

twin juniper
#

But the non-replicated actors that are placed in map are getting detroyed but not the one spawned by player

#

I am dropping some of them from my inventory

gleaming vector
#

so, the multicast wont work

sinful tree
#

I believe that's because the server doesn't necessarily have reference to the ones spawned on the client and the ones the clients have are not referencing the same thing on the server. They would only have the reference to the one that they have.

gleaming vector
#

since the object isn't replicated, the server has no knowledge of it

#

so if you replicate a reference to that object, the clients will get nullptr

#

and you'll see a warning in the output log about the object not existing

#

the reason being a non-replicated actor doesn't create a package map entry

#

so there is no way for the server to send a valid net id

twin juniper
#

Initially when i press on widget i am sending that actor object reference to server from then i am sending that object reference to clients via multicast.Weird thing is that reference is valid on server but it is null on all remaining clients??

gleaming vector
#

it just doesn't exist and it will never exist (you made it not replicate)

twin juniper
#

So what can i do now??

gleaming vector
#

is this a listen server?

twin juniper
#

no dedicated server

dark edge
#

@twin juniper just use replicated actors and don't try to fight the engine

gleaming vector
#

yeah, just use a replicated actor here

dark edge
#

If it's good enough for Fortnite it's good enough for you

gleaming vector
#

set the net update rate to be relatively low

#

like 10

#

(it defaults to 100)

#

and if it becomes an issue, use replication graph

#

basically every actor in fortnite is replicated

#

I doubt you are doing more than fortnite

#

they do a lot of shit lol

twin juniper
#

Haha.Trying to beat epiccc.

gleaming vector
#

so like

#

what was slow about having them be replicated? did you test that?

twin juniper
#

Thanks @gleaming vector @dark edge @sinful tree i will take your advice.

twin juniper
gleaming vector
#

ok, that was a rhetorical question anyway... don't optimize unless you know what you are optimizing ๐Ÿ™‚

twin juniper
#

okay bro

gleaming vector
#

there are better ways to optimize networked actors than trying to fake it

twin juniper
#

any references bro for advanced networking??

dark edge
#

Assuming you've already read the networking compendium read up on replication graph

twin juniper
#

okay thanks

round star
#

Trying to destroy actor for everyone..what am I doing wrong

empty axle
#

@round star if the actor is replicated you should just destroy it on the server and that's all

thin stratus
#

If it's not replicated, then you also can't perform Multicasts in it.

#

And if it's replicated but not owned by the Player, then the ServerRPC also fails.

#

So generally speaking you are doing multiple things wrong :<

weary saffron
#

Hey guys! I use Advanced Sessions Plugin.
https://forums.unrealengine.com/t/advanced-sessions-plugin/30020
And I want to check if the match has started.
Players must not enter the game when the game has already started.
Any ideas?
https://answers.unrealengine.com/questions/905823/how-to-check-if-the-match-has-started-before-joini.html

And I don't know how to get the current session to modify the tag or settings.

sinful tree
wintry lark
#

Hello everyone. I realize that Handle match started iterates through all the PCs and restarts the player(Spawns them) but when a player joins in mid game, what spawns them? I'm trying to make it so it changes the spectator mode instead.

#

What function in Gamemode spawns the player upon joining the game?

weary saffron
#

@sinful tree Yes I know that. But how do I set the settings for the current session for the filter?

viscid bronze
#

i asked around yesterday about ue4 multiplayer, apparently you only need 2 games made in the base game engine with ports open to connect over the internet into the same lobby
What does having open ports mean?
and
How would the connection work? Would you need an IP address, or is it possible to have a server list of all currently open servers?

thin stratus
#

What does having open ports mean?
Person who is hosting needs to open Port 7777 (by default) in their Router.

How would the connection work?
Would you need an IP address, or is it possible to have a server list of all currently open servers?
That comes down to what #online-subsystems you are using.
NULL, the default one, only allows direct IP connections (so you need the IP of the person who hosts, and that person has to open their ports), and LAN Sessions.

A Session is just information about the Game that is hosted and has to be created for the Game to be findable. But again, with NULL, only via Lan.

If you want the Server List, you need to use an #online-subsystems with a Master Server (or code your own). One example is Steam. Steam has a free test ID that one can use, but in the end you need to pay the fee for getting your own and then give them % of your earnings.

#

@viscid bronze

viscid bronze
viscid bronze
thin stratus
#

For an actually released game, having to use an IP to connect to another player is not reeeeaaallly up to date anymore

#

Static vs Dynamic IP just means that you will have a new IP next time your Router Resets or your Provider forces you. I think that's once per day?
So you need to re-handout the IP every time.

#

Static IPs wouldn't change, but at least in Germany you can't get one without being a Company.

#

Or at least without a Business Contract

#

But every users would need that, so you better look into something like Steam

kind ember
#

Does anyone know how Team Fortress 2 did their Arrow projectile prediction?

viscid bronze
viscid bronze
thin stratus
#

Yes

viscid bronze
thin stratus
#

Yeah, then just stick with the known limitations

viscid bronze
# thin stratus Yes

ok
but it wont affect the connecting or the connection once he types the correct ip in right

thin stratus
#

No, the IP reset usually happens over night and depends on your provider and probably also country. You actively have no internet during that time anyway

viscid bronze
thin stratus
#

What's the most straight forward way to keep the velocity in sync on ProjectileMoveComps?
Feels like just setting it to RepMovement and setting Velocity on Server won't work.
Client probably tries to move with 0 Velocity and then gets only the movement updates.

#

Multicasting the Velocity on firing feels bad for anything joining in later or getting into range.
OnRep would need to be kept updated all the time.
Almost feels like the Velocity should be replicated by default.

#
LogProjectileMovement: Verbose: Projectile BP_Gadget_Grenade_Frag_C_0: (Role: 3, Iteration 1, step 0.011, [0.000 / 0.011] cur/total) sim (Pos X=8073.389 Y=647.758 Z=-5583.217, Vel X=2219.959 Y=106.909 Z=-3393.692)
LogProjectileMovement: Verbose: Projectile BP_Gadget_Grenade_Frag_C_0: (Role: 1, Iteration 1, step 0.011, [0.000 / 0.011] cur/total) sim (Pos X=8073.010 Y=648.000 Z=-5623.699, Vel X=0.973 Y=0.047 Z=-3909.737)
#

Seems I'm right about the velocity not matching. Only the falling part (-z) works cause it simulates that anyway.

#

ShooterGame to the rescue

/** update velocity on client */
virtual void PostNetReceiveVelocity(const FVector& NewVelocity) override;
#

Thanks James, for pointing to the ShooterGame in a thread from 2016 :P

dark edge
thin stratus
#

The function comes from AActor

dark edge
#

Velocity in Actor has to be explicitly written to right? Like if you're rolling your own movement comp will the actor derive velocity or does your component have to write to it?

thin stratus
#

As far as I can tell, it inherits the velocity

#

ShooterGame doesn't do anything but implementing that function and setting the move comp velocity with it

dark edge
#

So if I got it right in Shooter game the server PMC simulates, actor position and velocity replicate out, and client-side PMC uses that replicated velocity?

thin stratus
#

Yop

ancient badge
#

Hello, can anyone tell me why a "print String" connected with Boolean "HostReady" after "BooleanEqual" is always False but after Event "HostReady" is true?

It is still False after "BooleanEqual" after triggering the "hostReady" Event

thin stratus
#

What Actor is that code in?

#

@ancient badge

ancient badge
#

PlayerState

thin stratus
#

Okay, that looks overly complicated

#

What are you trying to achieve?

ancient badge
#

Trying to build a "waiting for Players" thing

#

When someone starts to host a Game, the level loads, and the "HostReady" is set to True
When a player joins and the level is loaded it sets "JoinReady" to True

thin stratus
#

Okay, one problem you have here is that you check both booleans in the same PlayerState

#

While they are most likely in 2 different ones

#

Server and Client

#

So the Check itself should probably live somewhere central

#

best would be your GameState

#

And the other thing is: You don't need a Looping Timer

#

You have 2 events that call when the boolean changes

#

Just check once on each call

#

Or rather tell your GameState to check

#

GameState has an Array of Players (PlayerArray) with PlayerStates

#

So yo ucan loop over the states and do your test

ancient badge
#

Well i wanted to try this GameState out and noticed i totally forgot to change it to my costum made one.
How do i open the Standard GameState?

dark edge
#

@ancient badge just make a subclass of it. That's the usual approach

#

@ancient badge also, think State Driven. The state is the composite ready state of all the players.

When a players ready state changes, run bIsGameReadyToStart and check if everyone's ready.

ancient badge
#

you mean make a gamestate myself

dark edge
#

There's nuances with timers and stuff but basically it's the State pattern

ancient badge
#

im only using blueprints

#

if im not using GameStateBase my level isn't loading rioght

dark edge
#

This is all possible in bp

dark edge
modern cipher
#

Hey,
what is the best approach to create a crafting queue? should i start the timers ( to wait for example x seconds for something to be crafted ) on the server or client-side?
and how to avoid spamming rpcs to start/stop crafting

ancient badge
#

I have a costum PlayerState and GameState, i just didnt set the GameState in my Level that i'm working on

dark edge
#

@modern cipher I would handle crafting in a component which interacts with your inventory component. Crafting orders can be structs (make this item, it needs these items and takes x seconds)

#

So queueing up a craft just adds a struct to the queue

#

And at each craft beginning and execution it checks that materials are available.

modern cipher
#

yeah i have the structure setup already i was thinking about the timers
do i have to check for a timestamp or something before adding the items to inventory?

#

some players might cheat if i make timers client side

dark edge
#

Id go server side for sure. Only actually run the craft on the server. Just send a client RPC to update the UI (server just started crafting this item and it'll take x seconds)

#

Can reuse same struct as when you add to q

#

Or just repnotify CurrentCraftingRecipe

modern cipher
#

yup i have repnotifies i just send rpc to start / stop crafting a specific item

ancient badge
#

ok, i got a fix for the GameState Problem

#

@thin stratus Do i need to fill the PlayerArray or does this happen automaticcly when a player joins?

thin stratus
#

Happens automatically

ancient badge
#

ok, my client was to fast. But a 1 sec delay in it and now my Player Array has the correct length.

dark edge
ancient badge
#

Thank you @thin stratus Thats a lot easier.
But now i have the same problem i had with "GameMode" and "Event OnPostLogin" try.
When i call an RPC from my PlayerState, it only get called on the "Liste Server" Player not on the connected one.

thin stratus
#

Sorry?

#

If you perform a ServerRPC on the PlayerState, from your Client, you will be on the Server side of that Client's PlayerState

#

If not, then you are doing something else :D

ancient badge
#

Ok

#

I'm looking inside the Game State if 2 Players are ready, when PlayerArray has 2 i cast to my PlayerState to get a reference to my Costume Event that i set to "Run on Server"
What comes after the Event is only executed on the ListenServer

#

Probably doing some really stupid shit here XD

dark edge
#

@ancient badge That sounds all fucky. It should be done like this.

Input(checkbox or whatever) -> Client to server RPC in PlayerController or maybe PlayerState (not sure if you can RPC thru PlayerState) -> set bIsReady on PlayerState -> run CheckIfAllReady on GameState

ancient badge
#

The Ready Check is working fine

dark edge
#

If that 2nd screenshot is your ready check it looks all fucky lol

#

Do players set if they're ready or are you just trying to fire up when there's 2 players connected?

ancient badge
#

The ready Check is only the PlayerArray -> Lenght -> Branch the rest is for calling what should happening in the first screenshot

#

when 2 players connected

dark edge
#

I'm fairly certain there's an auto start based on number of players in game mode but anyway, just check number of players on server after one joins and fire it up. No need to get any PlayerControllers etc

golden nest
#

Hi, does someone know if is there any way to posses a pawn client side?

#

My problem is i have a pawn that does not replicate, and spawn on begin play server and client side, after that i want my client player to posses the client pawn and the server player to posses the server pawn

ancient badge
#

How am i supposed to fire that event if my GameState doesn't know where that event is?

thin stratus
#

So, BeginPlay doesn't call on Persisting Actors, right? At least it doesn't on mine.
What other options do I have to re-setup the Actor?
This is a TeamInfo Actor, that has some Objectives it should spawn on BeginPlay.
I could persist those too, but then I would still need an event to reset the objectives after the travel.
So either way I would need some alternative to BeginPlay for persisted actors :<

dark edge
#

Surely GameMode knows when a travel has happened and can fire a dispatcher

thin stratus
#

Guess so

#

But not sure about the timing

#

If the GameMode calls that too early, it's also shite

#

The GameMode is going to be changed after all

#

So I would need to know when to actually listen to the new gamemode

#

So same problem(?)

dark edge
#

What's the last thing to load up on travel?

#

Maybe the GameMode can get all actors with interface I_HackyRestart on StartMatch or BeginGame or whatever it's called nowadays. Maybe even on BeginPlay

thin stratus
#

Trying this now

void UPSTeamObjectiveManager::GetSeamlessTravelActorList(bool ToTransition, TArray<AActor*>& ActorList)
{
    for (APSObjective* objective : Objectives)
    {
        if (!IsValid(objective))
            continue;

        if (objective->ShouldResetProgressOnTravel())
        {
            objective->ResetProgress();
        }

        ActorList.Add(objective);
    }
}
#

So resetting them before traveling and not after...

dark edge
thin stratus
#

Sorry?

#

GameModes have supported Maps. And the GameMode defines the TeamClass, which has the ObjectiveManager, which has the Objectives.

dark edge
#

@thin stratus I mean does the ObjectiveManager have to examine the map for placement etc?

thin stratus
#

Nope

short arrow
#

why can't I replicate a map?

chrome bay
#

The only container that supports rep is an Array

short arrow
#

I have map in gamestate, shouldn't that automatically be replicated to clients?

short arrow
#

Period? I see, Is there an alternative method?

dark edge
#

You mean map like the container right? Not map as in level.

short arrow
#

yes, container

dark edge
#

Yeah you'll have to figure out another approach. What are you trying to do?

chrome bay
#

You can't replicate TMaps, period - unless you go the route of custom serialization in a USTRUCT

short arrow
#

UI stuff, When a player selects a team, it sets their number and a reference to themselves in a map

chrome bay
#

Just use a TArray, it'll replicate faster than a map could anyway

#

And provide a lookup function

short arrow
#

I'll look into that, never used it before

short arrow
severe widget
#

Jam is saying, instead of

TMap<FName, FYourStruct>

you do

TArray<FYourStruct>

and just do

struct FYourStruct
{
    FName Key;
    ...
severe widget
blazing socket
# dark edge What's the logic chain between your clientside input and the serverside weapon s...

Hey, sorry for the delay. I'm not exactly sure if this answers your question, but here is what happens:

  1. Client presses "SwapWeapon" button:PlayerInputComponent->BindAction("SwapWeapon", IE_Pressed, this, &ASCharacter::SwapWeapon);
  2. SwapWeapon() is called by the client, sets CurrentWeaponSlot and calls SpawnWeapon()
  3. SpawnWeapon() checks if it has authority, then destroys the old CurrentWeapon and spawns a new CurrentWeapon.
  4. CurrentWeapon and CurrentWeaponSlot is replicated to the client.

Since the class SWeapon is replicated, I would expect that the newly spawned actor should appear on the client. However, idk why the client can't swap weapons.

dark edge
blazing socket
#

I don't have that.
Should I basically do this: UFUNCTION(Server, Reliable, WithValidation) void ServerSwapWeapon();?

dark edge
#

Ya. Idk if the c++ syntax is right but that's the idea

blazing socket
#

Okay gotcha

#

I wonder why BeginPlay is able to spawn the weapon from the client, but the client's input cannot do it

#

Is that because BeginPlay is called serverside per actor?

dark edge
#

It won't be locally predicted but that's the first and simplest way. Just Input -> RPC -> DoStuff()

#

BeginPlay is called both sides

blazing socket
#

Okay thanks I will look into it!

dark edge
#

If you're gating by Authority it only proceeds serverside

blazing socket
#

Ok so update... Now I actually am able to swap weapons (and use them) on the client ๐Ÿ™‚ And I can see the server do it as well. Now I have a small problem where the previous actor is not being destroyed (so the new weapon would spawn inside of the old one). I'm not quite sure why because I'm calling Destroy on CurrentWeapon..

dark edge
#

Calling destroy on server?

round star
#

I am so lost. I am trying to destroy an actor. it destroys for the server never for the client. I spawn the actor from the server at a target point and simply call the server to destroy the actor when its interacted with

#

The client still has the actor remaining. All the components within the actor are set to replicate

#

the event wont run on the client

#

Server spawns these actors at target points. This function inside gets called when the item is picked up. All the components are set to replicate in the actor and the actor is set to replicate

#

I..dont..get it

dark edge
#

@round star that's a weird way to architect things. The old item destroys itself after adding the new item? And all this is in the item BP?

round star
#

the item gets added to an inventory then I destroy it from the world

dark edge
#

Oh ok so basically adding a struct and destroying the actor

#

What's spawning these items actors?

round star
#

gamemode on begin play spawns actors at target points

dark edge
#

@round star for a test, on begin play for the pickup, delay a few seconds then switch has authority and destroy self.

#

Does it destroy client-side?

round star
#

ya no bueno. I am absolutely baffled by this. It's so basic and routine

dark edge
#

@round star you 100% sure your client is connecting?

true stream
#

any good tutorials on MP?

#

there is one on Udemy, but not sure it covers server setup and the like

#

I want/need something from start to finish

round star
# dark edge <@725503585080705065> you 100% sure your client is connecting?

Thanks for trying to help. I still haven't figured out what the problem is. I am using UE5 ..so uhhh that may be the issue XD. Im not making a fully working game more messing around. I think it is just bugged/broken because I and switched the spawning to multicast in game mode ( just to see what happens)..and when switching it back to the way it was the actors are broken they won't even show up on client and (sometimes on server)

#

The code is very basic too. Even just using an actor with a mesh to test it also does not work ๐Ÿ™‚

#

I cant ever recall having a problem like this

dark edge
tardy glacier
#

How does UE4 handle Level Blueprints across clients? Do they replicate??

stone dust
#

Can anyone tell me a good tutorials of unreal networking with cpp ?

blazing socket
# dark edge Calling destroy on server?

Destroy is being called by the client on the server, yes.

    {
        ServerSwapWeapon();
    }```

And then in SwapWeapon() I'm calling:
```        if (CurrentWeapon)
        {
            CurrentWeapon->Destroy();
        }```
stone dust
#

oh nvm I read the pins

blazing socket
#

So I logged whats happening and on the client, when I call SwapWeapon, I get this output:

LogTemp: Destroyed weapon on Server```
So I'm not really sure why the actor is not being destroyed.

This is the code being used: ```UE_LOG(LogTemp, Log, TEXT("Destroyed weapon on %s"), HasAuthority() ? TEXT("Server") : TEXT("Client") );```
twin juniper
#

Is there a way to make console commands ghost/walk commands work in listen server?

blazing socket
#

Oh my god. I finally figured it out, hallelujah. Turns out the BeginPlay call to SpawnWeapon was screwing me over; It looks like it was being called client-side for both players, and then for some reason the server wasn't able to delete the weapons.

spark stag
#

i have a component attached to each character for their inventory. when a player controller temporarily possesses a different pawn, like a vehicle, i want them to continue interacting with their character's inventory component -- but because the character doesn't have an owner after it is unpossessed, all server RPCs targeting it will fail

#

is there some way to unpossess a pawn, but keep ownership of it? or am i taking the wrong approach?

#

should i just forward inputs from the character to the vehicle instead of changing possession?

gleaming vector
#

does anyone have any experience creating custom data channels on the netdriver?

fossil spoke
#

@jade oar Might be able to help you.

gleaming vector
#

basically, I'm networking some entities in an ecs, and I have given up trying to get this working with a replication proxy actor

#

so, I'm thinking, open a data channel for every connection

#

and start sending data

#

my question is, if I open a channel on the server and start sending data over it, will the net driver or net connection notice that and create the appropriate object on the client?

#

it looks like it might

#

i just have to make sure the channel is defined in this ChannelDefinitionMap

half jewel
#

his gif and not deleted but mine when his get clapped and it get deleted ?????

round star
half jewel
#

so u think he dont get clapped? hes wrong sometimes he not god...

gleaming vector
#

blast, i can't just spawn channels

#

is there a plugin out there that creates a custom net channel?

#

or, hmm, maybe i make the channel through net connections

winged badger
#

@gleaming vector why not just use an actor?

#

to replicate the lot of them

gleaming vector
#

uhm, because i have a set of messages i want to send

#

and the only way i can think of doing it with messages is with RPCs

#

and that's a mess

dull lance
#

hey guys something that I forgot and that my fish brain can't seem to remember is how to I manually control when a AGameMode begins the match (StartMatch())?

gleaming vector
#

also, I have some very dynamic data i want to replicate

#

i basically want to shape the packet myself

winged badger
#

thats fine, im talking about using a single actor as a network manager for all your objects

gleaming vector
#

i tried that, the problem is, as I said, how dynamic the data is

winged badger
#

fastarrayserializer + fastarrayitem with TWeakObjectPtr + TArray<uint8> Data

#

as long as you can make the objects net addressable

gleaming vector
#

oh, im not using uobjects

#

I've got an ecs (powered by flecs) that i'm trying to replicate the entities in it

#

i've got some real mad science shit going on here

winged badger
#

ID + TArray<uint8> then

gleaming vector
#

yeah, that was what i was thinking originally, but you have to infer message stuff

winged badger
#

as long as you can find the corresponding entity on client

#

and it can pack/unpack its own data

gleaming vector
#

like, what happens if component 3 doesn't update that frame? I'd want to remove component 3 from the list

#

but, not infer that component 3 was deleted

#

i realized I just needed a straight up packet thing

winged badger
#

its capable of individual per item callbacks on client

gleaming vector
#

and how better to shape packets then a data channel

#

i am aware

winged badger
#

so whats stopping you from doing updates on post replicated change?

gleaming vector
#

also, why use a FFastArraySerializer's delta serialization when i'm literally going to be sending a specific set of data per update packet

#

like, I want to send a packet "For entity 10, update component 2 with { DATA }"

#

and so on

#

and then two other packets, "Create entity N with components { X {DATA}, Y {DATA}, ... }"

#

and "Delete entity N"

#

this protocol ends up looking a hell of a lot like just packets, and a FFastArraySerializer is not the solution there

dull lance
#

probably a network manager actor that is in charge of sending and receiving strings/arrays of information

gleaming vector
#

that was my initial thought

dull lance
#

then your receiving end sorts what to do with that info

gleaming vector
#

the array serializer

#

it was untenable

#

lots of inferring from the 3 events what was going on

#

and not an explicitly designed protocol which is what I wanted

winged badger
#

fair, fastarray will eventually break if the system is extended, even if you make it work originally

gleaming vector
#

right

#

if I added "For Entity E: Add Component N {Data}" and "For Entity E: Remove Component N", how does that look there

#

like I said, I've got some mad science shit going on here

#

and I think it's working

dull lance
#

based on your info, it seems to be a 3.5-layer process. What's wrong with sending

  1. ID : FString as byte array
  2. Main Command : Fstring as byte array
  3. Data : byte array
    3.5-4) Data parser ID, so the receiving end knows what type of data it is
gleaming vector
#

I havent gotten to the protocol yet, I'm still trying to open a custom data channel

#

well, right now i'm dealing with a crash in flecs

#

which i think is due to a 0 size struct i was using a handle

#

that was exactly what it was

#

my kingdom for a delegate that fires when the net driver is created

viscid bronze
#

This is enough to connect via IP over the internet?

bitter oriole
#

Except "open" lacks an IP address as a parameter here

kind ember
viscid bronze
viscid bronze
bitter oriole
#

Listen != P2P

#

You open ports in your Internet access point's settings

#

This will need to be done by every hosting user

#

Or you could use Steam and not bother

kind ember
bitter oriole
#

(It's not P2P, it's a listen server)

viscid bronze
viscid bronze
bitter oriole
#

Yes, that's a listen server, not P2P

viscid bronze
kind ember
viscid bronze
kind ember
#

Yup

viscid bronze
#

wait what is p2p defined as

bitter oriole
#

Player to player

viscid bronze
bitter oriole
#

Listen server has one player have full authority (and ability to cheat and kick players) on the entire game

#

P2P has players talk directly to each other

#

So they're more indepenent

viscid bronze
# kind ember Yup

got it thanks
i know the thing is free, is it complicated to setup

thin stratus
kind ember
bitter oriole
#

It's more that you depend on a service like Steam, EGS, GOG, console platforms, etc

viscid bronze
viscid bronze
viscid bronze
bitter oriole
#

Opening ports in your router's interface it is then

thin stratus
#

Also didn't i already answer this yesterday for you?

#

By now you could have googled how to open ports

viscid bronze
bitter oriole
#

Sure it will but

you depend on a service like Steam, EGS, GOG, console platforms, etc

viscid bronze
viscid bronze
thin stratus
#

Rent is the wrong word but yes

bitter oriole
#

Less "rent", more "get them to carry your title on their store"

#

To be fair Steam mostly works with the test app id

thin stratus
viscid bronze
viscid bronze
bitter oriole
#

Did you see Cedric's message above ?

viscid bronze
#

ok got it ill move channels

worldly hollow
#

The Blueprints:

sinful tree
#

Character -> Execute On Server Event -> Run "Rotate Cube" on Cube target -> Cube can proceed as is.

worldly hollow
spark stag
#

seems like you want to decouple the pawn from any non-movement related state, otherwise you entangle the ownership domain with the concept of possession

#

so i guess i need to put the inventory on a separate actor

sinful tree
#

That should work.

#

Sure it does.
Output:

#

Default value set to 1.

kindred widget
#

@twin juniperYou're using Set twice.

sinful tree
#

Good eye Authaer XD

sinful tree
#

As you're on a character blueprint it won't work how you want. Each copy of the blueprint has their own set of variables. So if you and I were in a game, I would have a third person character and you would have a third person character. When I press the 1 button, the server is setting my character's variable to 5, and only on the server. When you press the 2 button after I've pressed 1, then the server would be reading your variable which is whatever you had your variable set to as default.

Even if you were to set the variable to replicate, all that would mean is that when either of us press the 1 key, the value would replicate to the client's copy of the third person character.

If you want all third person characters to have that value set, then you'd have to get all copies of the third person character, loop through them, and set their value, but again, this would still mean each character has their own copy of the value so the value could potentially be different from one character to another unless you always change it on all characters.

If you want just a variable that is not specific to any single player or character, then you should probably create and set it within the game state and have your characters read the value from the game state instead.

spark stag
#

something that always puzzled me about replication: what's the right approach to handle server authoritative variables that i want to "predict" on the owning client, for example, shuffling items around an inventory. i don't want to wait for an OnRep or something from the server before the item visually moves, because that feels laggy, but if there is an unexpected collision or something (for example because the server decided to add an item to the inventory at the same time a client is moving something there), i want the server to correct it

spark stag
# spark stag something that always puzzled me about replication: what's the right approach to...

i guess that scenario is actually somewhat complex.. if the client is able to make several inventory moves before getting an update from the server, it will potentially have to roll back some or all of them depending on what it eventually hears from the server. so immediately i need to do something tricky like keeping some counters in sync between client and server and maybe a queue of client moves for rollback

kindred widget
#

Having written a couple of inventory systems. I strongly urge you not to do client side prediction for that kind of a system. It's not something easily correctable without a full value refresh, and it can easily spiral out of control. People are willing to have slower inventories based on latency if they just work correctly.

bitter oriole
#

(As an example, Destiny 2, a heavily inventory based AAA MMO, noticeably does not do any prediction on any inventory action no matter how trivial)

sinful tree
#

Game State is the place to store variables that aren't necessarily specific to a single player. Like team scores.

Player State is the best place to store any values that are specific to a player that need to be accessed by others. For example, a player's specific kill/death count. You wouldn't want to store this on a character as then that value is tied to that character and if that character stops existing (lets say they were killed and the actor was destroyed) then the score goes away with them. You wouldn't want to store this necessarily in game state either as you'd then have to keep track of each player somehow within the game state, which player states are already doing. You wouldn't do this on the player controller either, as each player has their own player controller, but they are not accessible to other clients.

spark stag
#

thanks all, it just didn't occur to me that it was actually that complicated, i thought i was just missing something. point taken ๐Ÿ™‚

sinful tree
#

I know someone made an inventory using the GAS which probably was built with the intention of having client-side predicted inventory... Paid plugin ๐Ÿ˜›

#

(Not cheap either @_@)

bitter oriole
#

I mean, sure, it's always cool to have prediction

#

People usually don't worry about that

kindred widget
#

It's doable. But it's not network friendly. You would need several edge case checks in place and even then order of operations in networking with unpredictable traffic is hard to work around. But as a solid point, people will 100% care if it messes up once a week a lot more than if it's slightly laggy. Laggy is a known issue with networking. Bad values just make your whole game look bad.

dark edge
#

@twin juniper you can somewhat think of the game mode as the game controller analogous to how a player controller works for a player.

spark stag
#

is there a way to piggyback client/connection-specific data when replicating a server value to clients? for example, i have a struct that contains an inventory snapshot (shared across all clients) and a sequence number (different for each client). i want them to update atomically on the clients, because the sequence number is related to the particular snapshot, but i don't want to duplicate the snapshot for every client. is replication the wrong tool for this kind of thing? maybe i just want client rpc?

spark stag
chrome bay
#

Client RPC or replicating an Owner-Only value to something owned by the client.

round star
#

I have a question I feel is pretty basic for any veterans here. I have an object that I attach to the player using attach actor to actor. When I do this the client who attached it to themselves now owns it. However what happens to ownership once it becomes detached?

#

How can i set the ownership back to the server

#

I get different behaviours if I am testing a server with clients window...versus all client windows

#

I guess the real test is packaged, hosting, joining and playing lol

#

When it comes to editor stuff though, how should I do these tests?

#

With the server/client windows I get my desired behaviour

#

but I am not sure if this is right..as in tutorials they show only client windows..but the behaviour then is incorrect

neat prism
#

Hey guys, got a hopefully simple question to walk through.

I am trying to build an RTS (fun and original, I know). I am trying to accomplish the ability for the player controller to spawn buildings / units in my early prototyping using the keyboard, this is pretty doable. On spawning of actors, just pass an integer variable that I call team to the newly created actor so that the actor's team variable matches the player controller. Cool. The problem I have is assigning the player controller a team. I think I have it solved, but when testing it my server and client show differnet team values on print (like shown below)

My question is, since the server knows what team each player controller has, does this mean for sure now that I will be able to pass the correct team values to my pawns? I am testing this on a listening server and getting confused by the client printout

In my picture, I activate my hotkey to test my Player ID and team number after assignment in both the client and the server and get these results

dim barn
neat prism
#

excuse my ignorance, I'm still trying to climb the learning curve for UE/C++

#

UProperty(Replicated)?

dim barn
dim barn
neat prism
#

thanks for your feedback, this has been helpful.

#

Just so I am understanding this correctly, when my playercontroller controlled on the client Window issues the command to spawn something, the server will know player controller with team X is spawning a building, the server should then handle everything, right? I actually don't know how to differentiate between telling the server to spawn something or the client, I just set the spawn code up in my customer PlayerController Class/Blueprint

dim barn
# neat prism Just so I am understanding this correctly, when my playercontroller controlled o...

Correct. The client should only tell the server "I want to spawn this kind of building right here". Then on server you double check if client really can spawn that kind of building, like does he have enough resources, is the technology unlocked etc. And if the request is valid - you spawn it.

There are multiple ways to check if something is running on server or not. One way you could do it is to check IsNetMode(NM_ListenServer). Or NM_DedicatedServer. Depending what you use.

neat prism
#

and "on the server" in this case would just be sets of parameters contained in the game state / player state / or a custom data structure? Awesome, I think I get it now. Or, at least I understand it better

#

(for resource check)

dim barn
neat prism
#

Thanks for taking the time to explain it to me, I now feel much more confident.

spark stag
#

can clients access replicated objects that are not relevant to them? in other words, can i use network relevancy as a permissions tool?

#

i guess i was thinking that if a client could magically learn the network name of an actor that's not relevant to them, it could start calling server rpcs on that actor and do something that they aren't supposed to do. but server rpcs are only callable by an object owner anyways..

chrome bay
#

No it's not possible

#

If a runtime-spawned actor isn't relevant, then as far as the client is concerned it doesn't even exist

#

Even if they theoretically called a server RPC on an actor they don't "own", the server would ignore it

round star
#

When i detach an actor how do I set its ownership to the servers again.

#

Or rather..how can I just have the server retain full ownership always so I dont even have to worry about it lol

spark stag
#

afaik there is no such thing as "server ownership" -- actors are either owned by another actor, or they are unowned

#

to make an actor unowned again, just SetOwner(nullptr)

round star
#

Roger that

#

When I attach an actor to a player. calling a server function to detach it doesn't work, instead it works on client side function..so idk..but I am also a total n00b with nertwork

#

"nertwork"

spark stag
#

maybe you can clarify exactly your setup? do you actually care about ownership or are you just struggling to replicate actor attach and detach to all clients?

gleaming vector
#

player state, and you'd make sure that the server sets the value

#

take a look at ShooterGame

#

they implement scoring

round star
# spark stag maybe you can clarify exactly your setup? do you actually care about ownership o...

Well the server and clients can pick up the actor and it shows up for everyone else and they can drop it and others can pick it up. An issue I am having is I want to be sure no one can 'steal' this actor from someone else when its attached to them. This works perfectly fine, HOWEVER...if the client had any previous actor attached, if I try to 'steal' someones equipped actor it attaches any previous actor the client had. I am setting their pickup to be empty after dropping it and I have a 'pickedup' bool as well it checks and the print string shows it doesnt get passed it. So idk

#

I know that was a mouth full lol

spark stag
#

doesn't sound like anything is wrong with your approach, definitely sounds like a bug in your code to drop items

wary jay
#

How would I make a multiplayer vr game?

kindred widget
#

@wary jay The same way that you make a multiplayer normal game. There's not really anything special about VR. It's just a different control scheme. Much like the difference between designing for console vs PC.

wary jay
#

Coolio yy

#

Ty

dark edge
#

Just think about it this way. Put info about a player in player state. Put info about the game in game state. So if it's a basketball game, each player stats would live in player state, but the team scores and timers and other data about the game would live in game state.

#

Or if you're making battlefield, and individual players kills, deaths, and score live in player state, while the time left in the round and other data can live in game state

round star
#

Hm. Should I be setting owner in the character for the actors picked up or in the actors themselves....

north violet
#

Has anyone developed in a small team of 5 people ? How did you solve the version control setup?

bitter oriole
#

What's the problem with version control ? Just use any, usually Perforce

round star
#

This is SO strange. I cant resolve this issue of the player reattaching a dropped weapon when theyre not even anywhere NEAR it. The only way the function ever gets called is by going through a line trace. Yet the function is somehow getting called anyway and I cant make a lick of sesne out of it

#

It even shows the branch for false (no hit) firing my print string..and then the function after true FIRING..

#

im pulling my hair!

north violet
bitter oriole
#

You'd rent some VPS box and run the Perforce server on it

#

Same goes for the game server really

fading birch
#

I've used Digital Ocean to host a perforce server in the past

#

it's like $5 a month

#

and free license is plenty for a small team. You have 5 accounts and 20 workspaces

#

as for hosting servers, you can host on your own local machine, or just boot up a cheap EC2 instance on AWS for w/e OS you're running and shut it down when you're done.

dark edge
#

I host perforce and game test server on same Digitalocean box

#

As a bonus, don't have to do server builds, can just launch a headless Linux dedi in a few seconds

pale vapor
#

Is there a way to set what options are passed to AGameModeBase::InitGame when running PIE?

gleaming vector
#

crazy custom data channel networking coming together

#

I've just got a timing issue right now where sometimes it tries to register the channel definition before the netdriver is created

fading birch
#

Entity Component System?

spark stag
gleaming vector
fading birch
#

nice!

gleaming vector
#

flecs, specifically, but the tech im building will work for any

fading birch
#

Unity DOTS wishes it was actual ECS

gleaming vector
#

I'm trying to open a network channel directly on the net driver to define a simple protocol for the server ecs world to communicate with client ones

fading birch
#

that's pretty cool

gleaming vector
#

but i've got a timing issue where sometimes clients begin play before the netdriver is created

fading birch
#

a coworker is going ham with getting ECS working in UE4 for just single player stuff

#

his results so far are astounding

gleaming vector
#

yeah

#

I'm doing it for bullets in a shooter

#

we've got some bonkers numbers

#

for how many projectiles can live at a time

#

tens of thousands

fading birch
#

we haven't found a limit yet

#

that you would reasonably hit

gleaming vector
#

the limits we've found are it interacting with UE

#

putting together data in a form that UE can read it has been most of the work

fading birch
#

he basically threw out UObjects entirely

gleaming vector
#

we're looking at doing mostly the same

#

just push data directly to niagara

#

create a single particle system, update a float3 buffer in it

fading birch
#

ah he's working with raw actors

#

and just managing them

#

it's pretty stellar

gleaming vector
#

write to that buffer every frame from the ecs, it's insane performance

fading birch
#

he had over 5k actors on screen doing boid movements and had ~680 fps

gleaming vector
#

like, totally bonkers shit

#

anyway, I'm writing a way for the server to send data to clients regarding the ECS, and I tried to do it with a proxy actor but it wasn't working too well

#

so I figured, just send packets directly, but opening a socket to do so is not ideal

#

network channels, on the other hand, have a packet-like interface (FOutBunch/FInBunch) that I can implement a simple network protocol

fading birch
#

it's been awhile since i've messed with sockets directly in UE

#

i'm a bit foggy on the details

#

that approach could work though

gleaming vector
#

well, I'm not bothering with sockets directly

#

this is part of the net driver

fading birch
#

iirc UE serializes all of it's packets before sending them. They send them in byte chunks, and keep the size small.

#

it's been a bit since i've looked that deep in the engine though

gleaming vector
#

yep

#

I'm putting this right above that logic

#

so it adds my """packets""" into that logic

#

the same way it works for actors, control, and voip

#

i just can't figure out when to catch the moment the NetDriver is created

fading birch
#

Do you not want to modify source?

gleaming vector
#

no, this is a plugin

fading birch
#

Ah. Well shit.

#

I'll poke around the engine and see if I can find anything that'll help

gleaming vector
#

like, what i should do is add this to the config

#

but i dont know if i can patch engine configs from a plugin (you probably can)

fading birch
#

@gleaming vector i'm fairly certain you can. I know you can specify which netdriver should be used, so there's probably more config options you can utilize

#

Took a look through the engine. UPendingNetGame is loaded prior to the world as a server is opening a new level. it broadcasts the FNetDelegates::OnPendingNetGameConnectionCreated delegate.

#
/**
     * Delegate fired when a pending net game has created a UNetConnection to the server but hasn't sent the initial join message yet.
     *
     * @param PendingNetGame pointer to the PendingNetGame that is initializing its connection to a server.
     */
    DECLARE_MULTICAST_DELEGATE_OneParam(FOnPendingNetGameConnectionCreated, UPendingNetGame* /*PendingNetGame*/);
    static FOnPendingNetGameConnectionCreated OnPendingNetGameConnectionCreated;```
gleaming vector
#

ooh

#

that might be a place to get ahold of the net driver

fading birch
#

that's right as it's being created

gleaming vector
#

that lets me handle the client case

#

i was hoping there was one for the server case, but this works

fading birch
#

that's actually ran on the server

gleaming vector
#

what i really want to do is add to the ChannelDefinitions config in NetDriver

#

but I can't seem to get this ini to load

fading birch
#
    /**
    * Commandline override for the net driver.
    *
    * Format: (NOTE: Use quotes whenever the ',' character is used)
    *    Override the main/game net driver (most common usage):
    *        -NetDriverOverrides=DriverClassName
    *
    *    Override a specific/named net driver:
    *        -NetDriverOverrides="DefName,DriverClassName"
    *
    *    Override a specific driver, including fallback driver:
    *        -NetDriverOverrides="DefName,DriverClassName,DriverClassNameFallback"
    *
    *    Override multiple net drivers:
    *        -NetDriverOverrides="DriverClassName;DefName2,DriverClassName2"
    *
    *
    * Example:
    *    Use WebSocket for the main game net driver:
    *        -NetDriverOverrides=/Script/WebSocketNetworking.WebSocketNetDriver
    *
    *    Use WebSocket for the main game net driver, and the party beacon net driver
    *        -NetDriverOverrides="/Script/WebSocketNetworking.WebSocketNetDriver;BeaconNetDriver,/Script/WebSocketNetworking.WebSocketNetDriver"
    */```
#

those are the overrides

#

you can specify in the config

gleaming vector
#

right, i dont want to override the net driver

#

i want to add a channel config to it

#

made a DefaultECSProjectiles.ini and added this to it [/Script/Engine.NetDriver] +ChannelDefinitions=(ChannelName=EcsChannel, ClassName=/Script/ECSProjectiles.ECSNetworkingChannel, StaticChannelIndex=-1, bTickOnCreate=true, bServerOpen=true, bClientOpen=false, bInitialServer=true, bInitialClient=false)

#

but no luck

hollow eagle
#

I believe it needs to be in DefaultEngine.ini

fading birch
#

^

hollow eagle
#

UNetDriver specifically calls out that config

fading birch
#

I had just found that actually xD

hollow eagle
#

If you're planning on distributing this plugin just add it to the readme that you need to add that line to DefaultEngine.ini. Or write a setup utility for the editor that sets the config up and saves it.

gleaming vector
#

blast

#

ok, back to just patching it then

gleaming vector
#

it's workign!

#

I have successfully created my own data channel, all clients get it, and the server can send messages over it

#

this could have been way easier

#

but it's working

nova wasp
#

Niiiice

fading birch
#

sweet

round star
#

When a player drops an item and presses the key that does a line trace for something to pickup..it runs the function to attach an item. The previous item the player had that is no where near the player..despite the print string CLEARLY showing that there is no hit and cant get by the branch still calls this function and attaches it and I am baffled beyond

sinful tree
round star
#

if it does and I attach the actor I store it in a variable. When I drop it I clear the variable

kind ember
gleaming vector
#

im getting movement syncing working now

#

i haven't done actual projectile mechanics yet

#

that'll come after I figure out replication

kind ember
#

Cool

gleaming vector
#

the goal is bullets

#

im making a shooter

dusk tinsel
#

how would i make my own player database?

kind ember
kind ember
gleaming vector
#

now that I have a transport layer, i plan on writing a sync component and system

#

and just sending all the data to all the players

fading birch
kind ember
#

So client lerp position to server position with prediction offset?

gleaming vector
#

yeah basically

#

nothing special

kind ember
#

Yea that's I am doing for arrow projectile, tho I wonder how Team Fortress 2 does it, does anyone know?

gleaming vector
#

they hitscan

#

projectile travel time is just an effect

kind ember
fading birch
#

I understand what playfab does

kind ember
gleaming vector
#

yep

#

for bullets

#

im pretty sure that they spawn entities for non-bullet projectiles

kind ember
#

Ok

kind ember
fading birch
#

I've already done so. I enjoy that kind of work

kind ember
#

Nice, with AWS?

fading birch
#

Nope

#

Spring boot java program with MySQL database for persistence. I handle all the calls via a REST Api so if my source ever gets exposed the player data storage methods are still safe.

#

Playfab is great for quick testing and basic integration during development though. Their pricing isn't too bad assuming you're making a profit.

kind ember
#

Thats awesome! Nice job!
Lot of work tho

fading birch
#

learning it the first time was

#

I actually learned how to do it thanks to my final project in college

#

we needed to build a database to store stuff for the app we made as part of our capstone

#

one of my group mates had found out about Spring Boot and I adapted it to work with UE4

#

that was a learning curve for sure lol

#

I should write a guide on it probably

hollow eagle
#

Player data storage is a pretty simple CRUD app. Auth can be interesting but that's true of pretty much any web service... playfab's APIs for that are nice but most of its value lies elsewhere.

fading birch
#

i had integrated it with AWS Cognito

#

and then eventually integrated AWS Cognito with EOS as an open id provider

#

originally I was using JWT tokens, but that got a bit messy with longer play sessions

dusk tinsel
fading birch
#

playfab or a custom solution is your best bet then

dusk tinsel
#

alr thanks

kind ember
#

Dope!

eternal canyon
#

Lol

mortal anvil
#

guys is there a good tutorial for how to make online multiplayer game with dedicated server that build with anti-cheat system?

hollow eagle
#

Aside from the general concept of building something server-authoritative, no. Creating or integrating an anti-cheat is not something you will find a tutorial for.

sinful tree
#

One of those counters for countering -> don't tell people how you're protecting your game, otherwise they may figure out a weakness by what you've told them you've done.

mortal anvil
#

@hollow eagle @sinful tree so can u guys tell me best tutorial that talking about multiplayer - with dedicated server with practice not just academic informations

hollow eagle
#

There is no difference to writing listen vs dedicated servers aside from not assuming there's a local player (you shouldn't do this anyway) and dedicated servers generally have some more code stripped out for performance reasons.

#

Follow any multiplayer tutorial to get started. And if you're new to unreal's networking and replication, read the network compendium in the pinned messages in this channel.

mortal anvil
#

@hollow eagle @sinful tree thank u so much

twin juniper
#

Still haven't figured this out, it's related to AActor::IsNetRelevantFor and the delay it takes for actors to stop being relevant

chrome bay
#

The server won't close the channel straight away but even if it does it's not high-priority traffic and will still take an arbitrary length of time to reach the client. It's generally a bad idea to have the relevancy timeout low because objects that are flittering between being relevant/non relevant due to range can cause massive spikes in bandwidth as they spawn and despawn repeatedly

#

Calling ForceNetUpdate also resets the network frame for that actor, so if anything it will take longer to close the connection by calling that.

twin juniper
#

If my Actor has SetReplicates(true);, client can't write on the actor Location/Rotation ? Or i need to enable SetReplicateMovement too

runic brook
#

Hi, guys what's best way to create server for mmo, what would you recommend?

chrome bay
#

@twin juniper Client can write/set anything they like, but typically they shouldn't change anything which is replicated.

#

If movement is not replicated, clients can move the actor wherever they like.

twin juniper
dim barn
#

In other words if you have properties set to replicate on an actor, but bReplicates = false on that actor. The networking system won't even check that actor at all, won't even consider it. And nothing will get replicated.

twin juniper
twin juniper
chrome bay
#

Essentially since not all actors can move, movement replication is toggled separately. It avoids replicating properties that aren't needed.

twin juniper
dim barn
twin juniper
#

Is there a way to use console command ghost in a networked game in development build? Seems to be disabled

twin juniper
chrome bay
#

Even if you send data to a client, there's no guarantee they are actually using that data.

#

Servers should make no assumptions about data coming from the client, it should validate anything the client tries to do to change the state of the game.

twin juniper
#

Well for my case I was asking for my pickup actor, if the pickup actor location is replicated and the client is trying to write on it the server pickup instance will correct it with its location ?

chrome bay
#

If a client moves an actor, they only move it locally. They would have to send an RPC to the server if they want the server to move it.

twin juniper
#

Ikr

#

That wasnโ€™t my question tho

chrome bay
#

The client cannot change the servers' state of the game by doing stuff locally

twin juniper
chrome bay
#

Replicating a variable only means that the server will send that variable to a client when it changes, that's all it means.

#

A client can do whatever they want with that variable locally

twin juniper
#

But the server will correct it

chrome bay
#

No it won't

twin juniper
#

Or it only correct if the client is trying to change the server variable

chrome bay
#

The actors' transform is just a replicated property. When the variable is received by the client, the client applies that change to their local instance.

#

But the client doesn't have to do that

twin juniper
#

But when the server is applying ยซย correctionย ยป then

chrome bay
#

the server doesn't apply corrections

#

All the server does is send data to a client

#

It's up to the client what they do with that data

twin juniper
#

Yes but

#

Imagine bBool is true on server and false on client, server will not apply correction ?

chrome bay
#

No

twin juniper
#

I saw somewhere that yes

chrome bay
#

If you change that value locally on the client, the server doesn't know about it

#

The server will only send a value if it thinks the client has a different value - and the only way it can know that is by tracking the state that the client most-recently acknowledged.

twin juniper
chrome bay
#

I don't know how else to explain it

twin juniper
#

Ok ok

chrome bay
#

The server keeps a "changelist" for each client. When a replicated value is changed, it sends it out to clients only if the new value is different from the last one. It will only ever send that property if it changes on the Server. It has no idea if the client manipulated that value locally.

#

Clients essentially have a "copy" of the game running on their machine. If they make changes, that only affects their local copy. If they want the server to change, they have to explicitly tell it to do that.

twin juniper
#

And so thatโ€™s where anti cheat come I guess

#

To protect client manipulation

#

But Iโ€™m pretty sure last time I tried to modify my health variable with cheat engine, it got corrected with the server value but anyway ๐Ÿ‘

fast arrow
#

Hello, I'm working on multiplayer game and I've got a question : is there any best practices for replication handling? I know about OnRep call back, but how do I handle moments when I try to get reference, that is not yet replicated from other object?

#

I'm using waiting macroc rn but not sure whether it is good idea

violet sentinel
#

@foggy rain things related to game overall usually in game state, things related to specific player in player state.
updates always on server-side and replicated to clients later
how update called (from game mode or from RPC) is varies

foggy rain
twin juniper
#

If they are replicated no

foggy rain
twin juniper
#

Well since Gamemode is only on Server what do you want to update on Client ??

twin juniper
foggy rain
foggy rain
twin juniper
#

Then yeah if you manage that in Gamemode you should do an rpc to the player state

#

And replicate it only if needed.

foggy rain
twin juniper
#

You still need an RPC (if not set from Gamemode)

#

You should give it a try

#

You will have a answer to your question faster ๐Ÿ˜„

foggy rain
#

Thanks! Will try

meager spade
#

anyone ever seen PacketHander isn't fully initialized and also didn't fully consume a packet! This will cause the connection to try to send a packet before the initial packet sequence has been established. ? We are on 4.25

#

this gets constant spammed

violet sentinel
fast arrow
#

1>D:/Projects/UnrealGItLab/TBSGitLab/AdvancedTurnBasedTileTool/Source/AdvancedTurnBasedTileTool/WorldStuff/TBGameStateBase.h(30) : LogCompile: Error: Replication notification function OnRep_TurnManger not found

just why?

lusty sky
fast arrow
#

i got it))

#

not

#

there is no UFUNCTION

#

it is not serialized)

#

seems i need some rest)

eternal canyon
#

@spice night anims donโ€™t auto replicate so u have to multicast them

spice night
#

i did right

#

o nvm

#

i get the same thing with this

round star
#

When a player joins mid game. Is the event post login what I should use? Or how do I notify the server there is a new player and assign its controller and spawn the player at my locations

meager girder
#

Can you not use a replicated UObject class from a different module? The object replicates when the class is in my main game module, but not in my other module. It's really weird.

crystal crag
#

I'm trying to get familiar with how to use the IOnlineIdentityInterface... I can login successfully on the client, but how does the server query the user's account information? A lot of the methods want to take in the player's local user index... not quite sure how to get that on the dedicated server

crystal crag
#

I'm trying to get a user's auth attribute if that helps any

sinful tree
meager girder
#

@sinful tree yeah, I know. I have implemented the things needed to make them replicate. It works in my main module, but not in my other module.

#

I have my projects module (ie ProjectG module) and my other module (StatSystem). When I have the class defined in my main module it works, but it doesn't in my other module.

terse prawn
#

If a client uses 'get all actors of class' and the in class is the player state, will the clients get valid references to all the player states?

sinful tree
terse prawn
vital karma
#

if i were to run the third person demo in multiplayer would it work?

muted perch
#

Any good video tutorials for replication? I know about the networking compendium, but I feel like I need a video tutorial to better understand this topic.

#

I also know the ue4 learning live stream for replication, but I felt that it didn't go in to enough depth

gleaming vector
#

Is there a callback anywhere for when a net connection is accepted?

twin juniper
#

hello everyone.I am trying to implement player count in my game.So every time a new player joins it will call onPostLogin on GAMEMODE and we will add player controller to an array.then We will do a for loop on that array and call a custom event on that controller which then calls a custom event that RUNS ON OWNING CLIENT.I am getting player count but the references i assigned at begin play on my controller are getting null even though event tick is saying it is valid.Am i doing something wrong.??

#

Here is my gamemode implem calling player controller custom event

#

Player controller event

#

I am creating statsUI if we are remote player.It is displaying on screen as well.But this variable is getting invalid in above custom event

hollow eagle
#

You're potentially doing multiple things wrong here.
First, why are you maintaining an array of player controllers yourself? The engine already does that for you. Second, you can already access the number of players on any client by looking at the list of player states. Maintaining a count per-client manually with events is going to be incredibly error-prone.

fading birch
# gleaming vector Is there a callback anywhere for when a net connection is accepted?
    /**
     * Delegate fired when encryption has been setup and acknowledged by the host.  The client should setup their connection to continue future communication via encryption
     *
     * Binding to this delegate overrides UGameInstance's handling of encryption (@see ReceivedNetworkEncryptionAck)
     *
     * @param Delegate delegate that MUST be fired after retrieving the encryption key in order to complete the connection handshake
     */
    DECLARE_DELEGATE_OneParam(FReceivedNetworkEncryptionAck, const FOnEncryptionKeyResponse& /*Delegate*/);
    static FReceivedNetworkEncryptionAck OnReceivedNetworkEncryptionAck;;```
#

that might work

gleaming vector
#

seems that ActorChannels are just lazy init'd

#

so i might just do that

hollow eagle
gleaming vector
#

whenever my ECS goes to replicate, if there is a new connection since last it replicated open the channel, send the hello packet, and then queue up a bunch of ecs state data

hollow eagle
#

well there you go

#

I don't usually do networking stuff in BP so I couldn't remember ๐Ÿ™‚

fading birch
#

I checked in the engine

hollow eagle
#

there, the list of players - already accessible on all clients without any extra work.

fading birch
#

since I was looking for that delegate for Roy lol

#

As for maintaining an array of PlayerControllers in the game mode. That's quite useful sometimes. It gives you a nice cheap accessor to the controller after they login. You'll just need to be careful incase your player changes controllers in the middle of the game, which isn't common.

hollow eagle
#

Ehh, not really. The engine already maintains a separate list of player controllers.

fading birch
#

where?

hollow eagle
#

In UWorld

fading birch
#

i'm not seeing it in gamemode

#

oh

hollow eagle
#

you can't access it directly

fading birch
#

ofc not xD

hollow eagle
#

but it is exposed via a few functions

#

Specifically, you can use a player controller iterator

#

which does not iterate the full actor list

fading birch
#

FConstControllerIterator yeah

#

I forgot about that

gleaming vector
#

yeah, the controller iterator

#

loops through active player controllers, which is a far smaller list

hollow eagle
#

*player controller iterator
there's both a controller and player controller iterator

fading birch
#

yup

#

probably to separate out AI

#

since it splits from AController

#

there isn't a way in BP to use that unfortunately

#

but sending the size of the players array from the gamestate is a much better option

hollow eagle
#

You can use GetPlayerController which uses it, but it's a bit inefficient

fading birch
#

if you're just trying to get the number of players in the game

gleaming vector
#

anyway, my transport layer for replicating an ecs to clients is working

fading birch
#

sweet

gleaming vector
#

now to do the higher level change tracking, network entity ids, and sending data to clients

round star
#

Hm. When my character is running when I join the server it jitters (as if it doesnt have permission from server to change its speed)..however I have it setup so it does, and it works perfectly fine when doing the server/client windows in editor.. ........so now I am confused as hell

fading birch
#

GetNumPlayerControllers exists in UWorld as well, no BP equivalent though

fading birch
hollow eagle
#

Yeah some of those functions should probably be exposed... I guess you can just use the number of player states to index into GetPlayerController

#

still inefficient though since it creates a new iterator every time...

fading birch
#

yeah

#

@twin juniperAssuming your BP was created from GameMode and not GameModeBase, you have direct access to NumPlayers which returns the number of human players in your level.

#

You'll need to loop through your player states and send a client only event on them, which could then be sent to the player state's controllers.

hollow eagle
#

no, please don't do that either

fading birch
#

he's limited to BP only

hollow eagle
#

every client already has access to the full player state array

#

in blueprint

#

just grab the number off of that

fading birch
#

I don't think that's replicated?

hollow eagle
#

it is

#

the variable itself isn't, but the list is maintained on all clients

fading birch
#

oh

#

ok

#

then def go that route

severe tendon
#

Anyone know anything about running events from Host to all clients from within a Widget Component?
We currently have the host only spawning a widget on their hand in VR and when they hit buttons it calls to the Gamemode to then move the client and the host. In a solo session it works but the moment a client joins it stops working.

fading birch
#

Widgets should only exist on the owning client. If you want to call a Multicast RPC, which is what it sounds like, you'll need to call that on the widget's controller.

severe tendon
#

Yeah, so what I do is run it on the hosts end to the gamemode and then multicast RPC it to all the clients

#

I've tested it in a non-VR project by just spawning a widget on the host and then on click calling to the server and doing a print string in a multicast function and that worked

#

It just stops when its a Widget Component in world space

sterile scarab
#

I've got a couple questions.

  1. How do I choose the port number for the dedicated server I'd like to connect to.
  2. can I test connections from the editor client to an external dedicated server?
severe tendon
#

I know by default its 7777 but I don't know if you can change it.
You should be able to connect but there will more than likely be issues. You can run Standalone via editor to connect to dedicated servers

sterile scarab
#

Running a server on a different port was pretty straight forward, it's finding how to manually edit that for the client I can't find any info on, sadly.

#

standalone makes sense.

fading birch
#

You can use sessions to connect to different servers. As far as connecting to a different port on a machine hosting multiple servers you may just be able to use open ip:port

sterile scarab
#

Yeah derp that does seem to work. I was trying within the editor and wasn't seeing the results I wanted so assumed it didn't work. Tested in a built client and it in fact does. Thanks ๐Ÿ™‚

fading birch
#

np ๐Ÿ˜„

sinful tree
#

You can use Game State if it's something that's not specific to any single player.

twin juniper
#

@hollow eagle and everyone for solving my question.But can i add my own variables to game state and player state??.

hollow eagle
#

yes

#

make a subclass of either, set the classes in the gamemode defaults. Same way you would to use a custom player controller.

#

you don't need to add any variables just to get the number of players though - again, just get the player states array from the game state. The number of player states in there is = to the number of players

twin juniper
#

yeah thanks.

wet dock
#

Is there any way a particular player (client-side) can tell the server to update a particular actor's NetUpdateFrequency during runtime? The catch is that I want it to only affect one player, not all players. Is this possible?

twin juniper
# hollow eagle yes

I created a game state and i added a variable.I then set is as a default game state in world settings.But when i set my game state EVENT BEGINPLAY is not getting executed??.What is the problem??

#

event tick and remaining all are getting executed by EVENT BEGIN PLAY is not getting executed across the game

thin stratus
#

Is your gamemode set to delayed start or stuff like that?

empty axle
twin juniper
thin stratus
#

Did you mix up the base classes for gamemode and gamestate?

#

They either both need to be Base or the non base one

twin juniper
#

Default game state is GameStateBase.Sorry for that.I created subclass of GAMESTATE

thin stratus
#

Yeah then your GameMode also needs to be GAMEMODE and not GAMEMODEBASE

#

So check that

#

Your log should actually tell you that

twin juniper
#

Now i created a GAMESTATEBASE subclass now everything is working fine.

#

What is the diff b/w them??.Which one should i prefer??

#

@thin stratus It's now working.Thanks

thin stratus
#

Base one is simpler for more general singleplayer projects or non matchbased multiplayer. Everything more complex would use the none base version.

#

(is usually always use the non base one to not limit myself)

wet dock
severe tendon
# sinful tree Game Mode doesn't exist on clients.

Yeah, I handle that the same way as the teleport
Tl;Dr - On Join add player to array of players, when server runs event do a foreach loop over all of them and then do a server call to all of them and tell them to do RPC thing

#

We got the systems working across a network on overlaps but not on the widget component itself ๐Ÿ˜

summer spade
#

Where can I learn about gamemode
I want to create gamemode for a multiplayer shooter

fading birch
#

reading source code is a good place to start

summer spade
#

Ok

thin stratus
#

Was there anything special required for an AnimMontage to properly play on a ListenServer?
Break pointing shows that both Players (Server & Client) want to play the correct Montage and the montage length is also correct, but the ListenServer just doesn't play it.

#

Both go through the same code paths

#

That is Server killing the Client.

Client killing the Server works for whatever reason.

#

Only thing that would be different here are the NetRoles based on who kills who, but why does that affect AnimMontages :<

fading birch
#

Anims should only be played on clients right?

#

even on a listen server

#

it would just execute weirdly in that specific case

thin stratus
#

Why would an Animation not play on a ListenServer :D

#

Also it plays just fine if they are the ones that get killed

fading birch
#

my guess is something to do with the host is ROLE_Authority so it screws something up

thin stratus
#

Yeah someone is weird. Even with 4 Players, if the Server gets killed, it plays the Montage.
If the Server kills a Client, it doesn't. All Clients always play all Montages.
Mรคh.

#

Obviously no warnings or errors in the log either

#

Guess I have to step through the code a bit

fading birch
#

this is why I don't like listen servers

#

shit that should work just doesn't

sinful tree
#

They don't like to listen.

fast arrow
#

Hello, I'm working on multiplayer game and I've got a question : is there any best practices for replication handling? I know about OnRep call back, but how do I handle moments when I try to get reference, that is not yet replicated from other object?
I'm using waiting macroc in bp rn but not sure whether it is good idea. For example, i want to get a game state at the client, but it is not replicated so how do i handle it?

fading birch
#

the game state is replicated

#

are you working in code at all?

#

most of the functionality you'll want to use for networking is in code only

thin stratus
#

Generally speaking, if you need to be notified when a reference is available, you would set a RepNotify variable

#

Ah wait macro is not a good idea

fast arrow
#

i know that it is replucated, but u know, it takes time on the client to get it so it can be null at the moment of request.

fast arrow
thin stratus
#

Yeah, a combination of Delegate and RepNotify

#

If it's invalid on Request, bind to the delegate

#

And broadcast it in the RepNotify

fast arrow
#

so for example for this request i need to hold a delegate somewhere?

#

not sure that i can ovveride some repnotify in bp

thin stratus
#

GameState is a bit annoying

chrome bay
# wet dock Is there any way a particular player (client-side) can tell the server to update...

Not possible no, certainly not per-connection. As for Replication Graph, the base implementation locks those values in initially. My advice would be to set NetUpdateFrequency to the lowest value you possibly can, then use ForceNetUpdate when changing properties. You can consider network dormancy too, but you have to be cautious as that can cause more overhead if not used appropriately (e.g, frequently entering/leaving dormant state)

thin stratus
#

I made that work via some C++

fast arrow
#

can u show you solution for this problem with GameState if it possible, please?

thin stratus
#

I made a UWorldSubsystem child, added a GameState pointer to it, as well as a delegate, setter and getter.
BeginPlay of my GameState, I get the custom WorldSubsystem and set the GameState with this. That triggers the Delegate.

wet dock
thin stratus
#

And in BPs I can then use the Subsystem to get the gamestate or bind to the delegate

#

(in c++ too of course)

chrome bay
#

@wet dock just keep in mind though the update frequency most of the time is only going to affect server CPU time, unless you're changing properties at a high rate too.

fast arrow
#

Thank you, that cleared my mind a bit about all this replication stuff)

wet dock
thin stratus
#

I still don't get why my ListenServer refuses to play the Montage on a Client's Character.

#

They both seem to enter the PlayMontage code just fine. LogAnimMontage also seems to print properly. What the..

#

Reload montage plays just fine

#

It starts working if I call DetachFromControllerPendingDestroy on death, but that f*cks with all sorts of other code that expects the pawn to be valid while dying.

fast arrow
#

Do interfaces replicate?

chrome bay
#

they do not

#

Well in the sense that they aren't freestanding anyway

fast arrow
#

no( why? that hurts

chrome bay
#

Interfaces can't have UPROPERTY()'s at least

#

So there's not really anything to replicate

#

What do you mean exactly by whether interfaces replicate?

fast arrow
#

I mean can i get obj that implements interface on the client?

chrome bay
#

Oh, yeah totally

#

That information is already available to the client, doesn't matter if it's replicated or not

fast arrow
#

i mean can i get an object from the field, like this ? Coz the array is empty no matter what

chrome bay
#

Oh I see, no that won't work.

#

Interface pointers can't replicate, but just replicating an array of actors would do it

fast arrow
#

i hate my life) Seems i need to rework it again)

chrome bay
#

Then you just recheck the interface implementation on the other end

#

To be honest, the engine could do a better job here of not letting you mark stuff as replicated unless it's actually supported.

#

Still baffles me they haven't done something about that. Marking variables as replicated in widgets for example... wtf why.

fast arrow
#

XD

fast arrow
chrome bay
#

Shouldn't need to, that defeats the purpose of the interface then

#

Just have an array of actors, and cast/call the interface functions on each end of the network

fast arrow
#

yeah right) Thank you)

#

Btw is it better to just cast to interface or check it via " Does implements interface"? im just not sure why this function exists when there is a cast to. Mb there is some trick behind this function?

chrome bay
#

In blueprint at least I don't think it matters which you use but I'm not entirely sure

#

In C++ you can only Cast if the interface was implemented in the native class

#

Since it doesn't know about BP implementations

fast arrow
#

Got it, Thanks)

thin stratus
#

Anyone tackled a ledge detection/climbing system lately?
Wondering if there are any straight forward ideas on how to implement that smoothly, probably with the CMC in mind.

#

"Simple" run up wall and grab ledge for starters

winged badger
#

Glass was doing something with ledge detection couple of years back

#

even posted a tutorial for that

#

or, rather, the entire project

thin stratus
#

@chilly mason Is that true and does that still exist?

#

Might be the CoverSystem

winged badger
#

that was the one

#

its been a while, so not 100% its accurate info

thin stratus
#

Yeah looks more like general covering, not climbing

winged badger
#

think he still needed to detect ledges

thin stratus
#

Probably traces, which is fine. Mostly interested in how to tie that into the CMC.

#

It's a bit sad. You really have to go away from UE4 to find something else than a BP Tutorial.

#

Overgrowth seems to use a sphere and cyclinder collision, which would be a capsule for UE4. Looks cool

#

The other thing I'm worried about is Root Motion. I'm not using that and I often feel like if you aren't using Root Motion, you will have a hard time with stuff like this. Specially the "push up" logic.

#

And Root Motion + Multiplayer is another story afaik

winged badger
#

GameplayTasks can handle root motion

#

we are using them for trickier movements, like jetpacks

thin stratus
#

Sounds pretty involved if that isn't setup at all though?

winged badger
#

i don't know too much about them, Kaos implemented that system and we were too swamped for code reviews

#

but it looked fairly simpel to implement

#

as in, the next day the GameplayTasks with RootMotion were working

thin stratus
#

Wasn't your project using GAS?

winged badger
#

no

#

but we do borrow a little here and there

glad fiber
#

Hey Guys, so I'm working on a multiplayer project, currently trying to do an inventory system. I had it working before, but for some reason I'm not sure what I changed and it just stopped working. That said I feel like I'm not doing it the correct way.

#

Starting in the inventory WBP

#

Which goes to the Player Controller as a owning client event, to then call a server event also on the player controller

#

Server event on the player controller

#

Which then goes to the GameMode

#

What would the correct way of doing this be?

split siren
#

Random question, why is Net Cull Distance always squared? What is the benefit of that?

empty axle
split siren
manic terrace
#

I have made a game with the OSS and the SteamSDK. I want to just play with friends online. Can I use the default ID that the Steam Example project uses (Spacewar) or is it illegal or something?

viscid bronze
#

how do i remove all the widgets of one player's screen only?
remove all widgets seems to only keep removing the server player's widgets, no matter which player is calling it

sinful tree
# glad fiber

You probably don't want to do it this way. You're opening up an avenue for cheating as you're letting the client tell the server what "item" it is they want to give directly. For example, if I was keen on packet or memory manipulation, I could inject what the item is and the quantity of them before it reaches the server, giving away items that may not even exist at all in my inventory.

At most, the only things that the player should be able to tell the server about the item to transfer is a reference to the container it is in (in case you have multiple inventories of some kind), an inventory slot # the item is in, and a possible quantity, and after you're on the server side, the server should verify the contents/quantity and perform the transfer based on what the server has in memory for your inventory.

It's also very difficult to tell where you may be encountering an issue with your system as there's too much behind custom nodes in your CE_REQUEST_GiveItem event, but you haven't defined the "Destination PID" on the CE_PC_SERVER_GiveItem event path but you are trying to use it within CE_REQUEST_GiveItem, so that could potentially be why it's not working currently. Otherwise, based on your intentions, it looks like it would work.

sinful tree
manic terrace
sinful tree
viscid bronze
#

but now with this whenever any player calls it it will only remove the server's ui

#

ok after i changed the spawning from not replicated to run on owning client it seems to remove both the player and the server's ui

neat prism
#

Hey nerds, I am trying to send a command from the client to the server through the game state. The idea is the client should be able to designate a movement position with their mouse, and then the blackboard should capture that position as a FVector. My code works for the server player, but client players are not able to execute. All characters on the map are controlled by an AI controller. here is my code

I capture "selected actors (characters)" in my PlayerController ; do I have to replicate these to the server so that I can pass them properly to the GameState? In my game state class I have a function that gets the AI controller from the selected actor. Getting AI controller from passed selected Actor yields nothing if it is owned by the client, I believe? but the Gamestate is supposed to be on the server, so I am getting lost on what to do next. I am able to get all functionality to operate from the server per usual, but not this not now

Player Controller .h:

UFUNCTION(Server, Reliable,WithValidation)
virtual void MoveReleased();

Player Controller .cpp (SelectedActor is created in a different method)

//Get click location as MoveLocation variable
/*Loop over selected actors*/
gamest->SetManualMovementBPKey(SelectedActors[i], MoveLocation);
/*End of Loop over selected actors*/

So right now SelectedActor[i] is not replicated, only client side. So,...

In my GameState,
header

void SetManualMovementBPKey(ACharClass* Selection, FVector location);

and gamestate .cpp

void ARTS_GameStateBase::SetManualMovementBPKey(AFTS_Droid* Selection, FVector location)
{
AAI_ControllerClass* aic=Cast<AAI_ControllerClass>(UAIBlueprintHelperLibrary::GetAIController(Selection));
aic->SetBlackBoardKeyObjectValue(location);
}

and finally in my AI controller class:
header

void SetBlackBoardKeyObjectValue(FVector location);

.cpp

void AFPS_AI_Controller::SetBlackBoardKeyObjectValue(FVector location)
{
    GetBlackboardComponent()->SetValue<UBlackboardKeyType_Vector>("ManualMoveLocation", location);
}

When I run this on my server window, the blackboard value is set properly! success! but when I use the client windows to try this, the blackboard key remains null for the selected character. Any advice?

spark stag
#

server RPCs can only be called by clients who own the object they are invoked on

#

check the logs, you should see warnings about it

sinful tree
neat prism
#

That's the _validate() suffix'd method, right?

sinful tree
#

From what I know of it, yeah. XD I've never used it myself yet.

spark stag
#

if _validate() fails, it will kick the client, so only use that if you are really sure the client is doing something wrong when it fails

neat prism
#

In my code above are there any minor tweaks I can make to it that will make it work, or am I just missing some giant sweeping concept here? I have to go slave away for my corporate overlords soon so I'll try to review responses and get back to work in the afternoon

dark edge
split siren
gloomy tiger
#

Hey, I'm using CharacterMovementComponent and I trust my clients for replicating their movement. Any clues on how to setup CMC to support client-authorative replication?

sinful tree
gloomy tiger
#

Thanks, @sinful tree

#

I'll check that out.

round star
#

anyway to bypass the 'advancedsessions is not compatible' error when packaging causing a cook to fail? I use it in UE5 and it works perfectly fine when testing. Does all the things is normally does without a problem. So obviously it works.

#

nevermind fixed it

#

I just had to change the engine version in .uplugin lol

dark edge
#

@gloomy tiger What's your use case? That sounds like a weird way to do things.

gloomy tiger
#

@dark edge Thanks for asking. Well, we are pursuing ways to decrease multiplayer lag.

#

And it's a hard guess that trusting clients when it comes to movement might improve it a little.

thin stratus
#

It might save you from some corrections, but that might be it

#

It still sends the data to the Server

#

And it still replicates it to the simulated clients

gloomy tiger
#

Yep, I mean - we are trying to tune all the things we can.

#

Our biggest bottleneck is when it comes to zombies. We have a hard-limit of 50. When 50 zombies are spawned, it's a big nightmare.

#

They follow players which are replicating their position very often, and as such, I suspect that when a player changes its position, our zombies are also updating their position/rotation and replicating back.

#

That's a big, big, big nightmare.

#

By the way - do you guys have any suggestions here?

#

(Zombies are using CMC)

round star
#

whats that command that shows the debug collision of teh character when trying to sprint on the server

#

...lol

round star
#

How much would be considered a 'lot' of outgoing bandwidth >.>

#

Weird. In my packaged build the physics of objects and sprinting of characters stutters

#

but in editor it works totally fine

#

with multiple clients

grizzled stirrup
#

Is GameState around on the server when GameMode calls InitGame?

#

Trying to avoid having duplicate properties stored on the GM from the Options string that are then used later to set GameState properties

#

Just would like to set them directly on InitGame

dark edge
#

I'm guessing no

thin stratus
#

And having the duplicated is not really a problem and more or less how Epic does it too

grizzled stirrup
#

Ok good to know thanks!

glad fiber
# sinful tree You probably don't want to do it this way. You're opening up an avenue for chea...

Yeah ok, thanks for the response. I think I do want to change it up a bit to have less stuff coming from the client like you mentioned. The destination id is just because I'm sort of half way through trying to fix it. The issue I was having is that when passing through a reference to the clients Player Controller, I wasn't able to get variables from that player controller on the server, it just wouldn't return anything.

grizzled stirrup
#

Will keep duplicate params. Is it common to use the GS version as the main one for queries though? Just so you aren't referencing different properties that are the saame thing which could make tracking down bugs harder?

thin stratus
thin stratus
grizzled stirrup
#

Good rule of thumb, thanks!

#

In this case it's used for both

thin stratus
#

Then GS is fine

#

It really shouldn't matter

#

wouldn't overthink it

#

Do what feels best

grizzled stirrup
#

I could also just cache the options string in InitGame and later on extract the relevant vars and directly set them in the GS I suppose

#

That way no duplicate params and no guessing if GS is up

thin stratus
#

ListenServer is a player that hosts and acts as the Server

#

If that player leaves/quits the whole server dies

thin stratus
#

But sure, you can do that too if you want

#

The OptionsString should already be cached

grizzled stirrup
#

Oh does InitGameState pass through the options string?

#

Will check it out

thin stratus
#

No but you should have the options string

#

It exists in BPs, so there should be a variable that is literally called OptionsString

grizzled stirrup
#

Haha yup there is!

#

In AGameModeBase

#

Thank you

#

No need to extract EVERYTHING in InitGame anymore, just server stuff

#

Can just get all the options at a slightly later point

#

Many thanks for the help

thin stratus
#

Well a Multicast in a playercontroller doesn't make sense

#

It only exists on server and owning clients

#

So servers will only call this once

boreal geyser
#

Hello. What is an ideal way of getting movement acceleration in an online game? I tried using AddForce/Launch Character to Move a character but when I set replication to true, the clients just jitter while the server is able to move. The clients can also see the server move as expected. I am using blueprints

dark edge
#

@boreal geyser adjust the acceleration settings in the character movement component

limber gyro
#

hey peeps, trying to replicate an animation

#

heres what i have done

#

i have a float which is my reloadTimer, this is a replicated float

#

i then fetch this float in the anim BP and if it is greater than 0 i set a bool to true (isReloading)

#

and then my animBP state changed acording to that