#multiplayer

1 messages Β· Page 658 of 1

past totem
#

then it will execute on the client

#

yes

#

and these r stuff u can easily test

dull lance
#

Even if you could, pretty sure you'd be breaking Steam's EULA

#

you might as well just use subsystem null and do your own connection system (or use EOS)

rich ridge
#

Hi,
I m about to implement point sharing logic for my game.
Its like kill points will be shared among all same team players if they are in specific radius.

My approach is to spawn a sphere on server with my radius and get all same team players and share points by applying GE.

I just wanted to know if there is any other famous technique for this kind of problem statement.

kindred widget
#

@rich ridge Spheres are a lot more expensive than a simple distance check.

rich ridge
kindred widget
#

Depends on the size I suppose. Though I can't see any sphere trace being quicker than a distance check if you already have references to the team.

rich ridge
#

i think distance check is very efficient, I need to get PS array and check their distances.

kindred widget
#

Writing my first NetSerialize. It seems to be working correctly. I'm just looking for a confirmation that I'm understanding this correctly. I've basically written the following as a test, if I were to compress three integers down to four bytes, since the first integer would need two bytes of data.

bool FMyStruct::NetSerialize(FArchive& Ar, UPackageMap* Map, bool& bOutSuccess)
{
  uint16 CompressedFirstInteger = 0;
  uint8 CompressedSecondInteger = 0;
  uint8 CompressedThirdInteger = 0;

  if (Ar.IsSaving())
  {
    CompressedFirstInteger = StructFirstInteger;
    CompressedSecondInteger = StructSecondInteger;
    CompressedThirdInteger = StructThridInteger;
  }

  Ar << CompressedFirstInteger;
  Ar << CompressedSecondInteger;
  Ar << CompressedThirdInteger;

  if (Ar.IsLoading)
  {
    StructFirstInteger = CompressedFirstInteger;
    StructSecondInteger = CompressedSecondInteger;
    StructThirdInteger = CompressedThirdInteger;
  }
}
ember vine
#

is there documentation somewhere regarding optimising variables in terms of networking? like the cost between FVector and the NetQuantize variants etc. and even the primitive types

green delta
#

I havent touched multiplayer in over a year. Need a refresher with classes and framework.

Widgets are non replicated and only owning players can see theirs.
If i want to update the widget i have to pass by the player controller.
If i want to update another player's widget, i have to first announce it to the server then the server has to tell the client to update via their player controllers and then their widgets follow.
How can i track which player controller is not mine?

eternal canyon
eternal canyon
#

for the last one

green delta
#

There are no pawns.

#

This is a classic interface scenario.

#

And that makes no sense either how can you refer to someone else's widgets without passing by their player controllers? You cannot see their widgets.

coarse flame
#

would in theory there be able to make a seperate game in UE acting as a "dedicated server" and run it with a UI to controll it, which will allow full BP programability for it? aswell as then making connections happen through the client version of it?

silent valley
coarse flame
#

But make it a seperate UE4 project yes?

silent valley
#

No it must be the same project, must load the same level for example.

coarse flame
#

Aaah, damn, cuz im struggling to find anywhere when researching ue4 dedicated server saving player stats etc

#

any good links?

silent valley
#

I use built in savegame system to store player data on server 🀷

coarse flame
#

Okey, and how does that work?

#

is it made in BP or C++`?

silent valley
#

Nothing special really, savegame file is named via the steamid, serializes player inventory etc to savegame. Written in c++

coarse flame
#

Aaah alright ok

rose raft
#

I'm trying to understand how this part of the CharacterMovementComponent works:

The system for buffering saved moves already ensures that movement information lost in transit will be resubmitted and evaluated. This provides a similar safety net to a reliable function, but without the risk of overflowing the reliable RPC buffer, and with added provisions to make sure movement data that is too old gets discarded.

UCharacterMovementComponent::ReplicateMoveToServer appears to find the oldest (unacknowledged) important move and send it alongside NewMove whenever NewMove can no longer be delayed (here: CallServerMove(NewMove, OldMove.Get());).

Then, in UCharacterMovementComponent::CallServerMove, the old move is sent to the server using ServerMoveOld.

My question is: what happens when there are several old moves which need to be sent? What looks to be happening is that a single old move is sent right before the next new move.

I want to understand what happens when multiple consecutive moves are unacknowledged and if it is possible for there to be a chain of moves like this:

Move 1 (acked) \β†’ Move 2 (not acked) \β†’ Move 3 (not acked) \β†’ Move 4 (acked)

pallid canyon
#

Anyone know why this calculation would work for local client but not network clients?

#

the weird things is the top two gets return a good vector for both local and network clietns, but the second get + top vector returns a near origin vector, way away from my character

twilit flint
#

how can I get access to PC form game mode ?

#

from*

kindred widget
#

Which player controller?

twilit flint
#

all

#

in loop and do somthing at end of game

kindred widget
#

GameState has an array of all of the player's Playerstates.

twilit flint
#

yes, and I dont know how to get access to PC form PS 😦

#

in BP

kindred widget
#

Ah, yeah I suppose it doesn't have a pointer to the Controller.

#

You could probably just have an array in your GameMode, and have all of your PlayerControllers register themselves at spawn or beginplay. Since it's only needed at the end of the game.

pallid canyon
gilded nest
#

How can I get player controller in a world blueprint for multiplayer. Trying to set view blendspace to a different camera, and it keeps giving errors.

twilit flint
#

@gilded nest for fast effect I did that

gilded nest
#

is that in the player controller

#

or world blueprint

twilit flint
#

it's in game mode

gilded nest
#

does it matter if the event is run on client or just not replicated

gilded nest
# twilit flint it's in game mode

still doesnt work. I created an event in the game mode to do it, and then in the level, i use a interface ref, then call the event, and set the viewport through there. Still gives errors

thorny locust
#

any tutorials for this?

#

how do i connect 2 remote devices through network using unreal engine? any tutorials for this? all the tutorials i found are running on the same computer

gilded nest
fluid summit
#

Hi! how would you go on to implement a timer like this on a dedicated server?

#

the timer should be so that if you log out, when you come back, the timer shows the correct time remaining

dire cradle
#

Store the timer start and end times in the server, then calculate the remaining time in the clientside before displaying it

fluid summit
#

Hi! one question on diablo 3 multiplayer arquitecture.

i think they are using a listen server when ever you make a new game.
But at the same time, they are saving into the database, how do they prevent the client side cheating like mad?.

#

i'm trying to avoid as much as posible using a dedicated server and i'm trying to see if a listen server would work

summer tide
#

Can you enable component replication via c++?

queen pine
#

So I'm working on replicating a physics tool. This is a simple poke feature for adding impulses using a line trace.
I'm trying to figure out how I need to replicate the client side. For larger sequences like this do I still need to send in ever single component such as the camera, object slot, and other variables all through the rpc? Or is there a much easier solution?
I was attempting to just tell the server to do it I believe my reference is wrong im using.

#

This is the way I got working, just by sending in ever variable and object reference needed to do the action.
I can't help feeling that there is another way. A way that doesn't require so many variables to be passed over the rpc.
I'm mostly wondering for future sake for more actions and systems.

queen pine
#

final solution

#

Now i just gotta replicate a bunch of more stuff.

#

😩

#

I'm sure I'll forget how to do it at least 10 more times, but i guess that's part of the puzzle.

thin stratus
#

That should use the replicated pitch etc.

#

Generally speaking, you won't have a nice time with replicated physics

#

Either they de-sync cause Physics aren't deterministic

#

Or if you keep them in sync, then the Client will almost always get jitter and corrections

#

And if you keep the poking on the server side and only replicate the location, it is always a bit laggy for the client that starts the poking (delay for RPC to the Server and then location back to client)

queen pine
thin stratus
#

If it's not gameplay relevant you could make it client authoritive

#

In case that's possible for your situation

weary saffron
#

Hey guys! I have a problem.
Why is the event dispatcher not replicating?
This only works on the server.

thin stratus
#

Event Dispatchers don't replicate

#

The only thing you are replicating is the variable there, not sure that even makes sense

#

You need to call an RPC or use an OnRep and let that trigger the Delegate/Dispatcher

summer tide
#

Anybody knows how ReplicatedUsing needs to be implemented in C++?

#

For example I need to set speed of my AI

primal isle
#

anyone knows of some post or video on how to replicate turn based grid movement?

thin stratus
#

But it's basically:


UPROPERTY(ReplicatedUsing = "OnRep_Speed")
float Speed;

UFUNCTION()
float OnRep_Speed();
#

And then adding Speed to the GetLifetimeReplicatedProps stuff

#

Optionally you can do float OnRep_Speed(float OldValue), which BPs actually can't do.
Don't need that often but the option exists.

summer tide
real nimbus
#

hi guys , my question is, what's the best way to add team voice chat?

silent valley
hazy silo
#

hey guys πŸ™‚ I have a Gameplay Ability System Question:
does anybody know if or how I can use rep notifies in an ability if I replicate it?
I tried this setup, but any rep notify will only be called on the server

#

I would like to receive the notify on all clients

thin stratus
#

I think you should also state what you are doing with that Notify

#

Because I haven't needed a single RepNotify in any Ability throughout the two years on The Ascent

#

So chances are high that you are trying to do something that can be achieved differently

hazy silo
thin stratus
#

PlayMontage should already be replicated afaik

#

And if not, you can put the OnRep into your Character or wherever your weapon pointer lives

#

@hazy silo

hazy silo
#

ideally, abilities shouldn't even know about the character code, right?

coarse flame
#

Anyone got any links as to where i can learn to code on the dedicated server?

#

and read up on that?

thin stratus
#

You need them to communicate in one way or another

thin stratus
#

Coding Multiplayer for Listen and DedicatedServer is, in its first instance, exactly the same

#

The only big difference is that ListenServers are also clients and have visuals, while DedicatedServers don't.

coarse flame
#

or c++?

thin stratus
#

What exactly are you on about please?

#

Because DedicatedServer is just a headless version of the game that allows Client connections

#

What you are writing sounds like some database stuff

coarse flame
#

Yea, but i was hoping to avoid using that and be able to create a save using the dedicated server to fetch variables stored in the save from the server side and display it to the player shrug

#

But might aswell get into VaRest and use that

thin stratus
#

Why don't you ask about that then haha

#

Your question was "Learn to code on the dedi server"

coarse flame
#

well perhaps i was looking for other options

#

yes as in is that a possibility at all

thin stratus
#

It's always better to actually explain what you wish to know about

#

So you want to save player data persistently

#

If all you need is the data bound to that Server, then a SaveGame is enough

#

If you need the Data available from everywhere on multiple DedicatedServers, then you need some centralized database

coarse flame
#

okey so if im getting this correctly, SaveGame - 1 Dedicated Server? and centralized meaning VaRest plugin usage and php to sql db of sorts to generalise stats over a network?

thin stratus
#

I guess you could save SaveGames centralized too

#

But I doubt that scales well

#

And yeah, usually you build this with some Rest API

#

That talks to some webservice

#

And that webservice talks to your Database

#

At least as far as I know

#

And with that comes the usual problem of hosting that sh*t somewhere, as well as making sure it's safe from stuff like DDoS, and worse

coarse flame
#

So basicly, i can build my project's website, to have the login etc, and store the diffrent stats of a player there, and use that as REST API, i'll dod that hten

hazy silo
thin stratus
hazy silo
thin stratus
#

GetComponentByClass actually uses FindComponenetByClass, which iterates over all components of that actor

#

I rather use an interface

#

Usually all my systems have an interface to communicate between each other without knowing the actor behind it

hazy silo
#

okay 😊 thank you very much for your help, @thin stratus πŸ‘

silent valley
#

Does anyone know if there's an event/delegate I can hook into which is called after world is loaded, but before replication starts? And allows me to delay replication until some async task is finished.

tight glen
#

I am trying to set a mesh in a player state when a player selects their character at a select screen. It works for single player but when I do it with multiplayer listen server) the server sees all characters as the same character that they selected while the client(s) see all characters as the character that they choose. I realized that I was using something that was not replicated so i swapped to a custom player state that I made. The issue that i am seeing is that when i update the character mesh inside of the new player state that the character mesh is still empty when the level loads. Does the play state get cleared when a level is loaded? Is there a better way of setting a variable and having it stay the same from a main menu through a level loading?

thin stratus
#

PlayerState always clears, hard and SeamlessTravel

#

But SeamlessTravel allows you to move the data from old to new PlayerState

#

Via CopyProperties function in the PlayerState

#

SeamlessTravel only works for ServerTravels, so when a Client is already connected to a Server and the Server changes map

#

Connecting to a Server or Leaving a Server (disconnecting) will always be a HardTravel

#

@tight glen

#

Means a Variable set in the MainMenu will not survive the connection process

#

So you'd need to either let teh Server ask the Client via RPC and what class it should spawn

#

Or utilize some C++ to pass some FString along when connecting

tight glen
#

Oh man thanks so much been struggling with this all yesterday

tight glen
thin stratus
#

Yeah that's one way

tight glen
#

okay, maybe thats what i will try. Havent seen any good examples of the other methods you referred to and at least this way will let me make some progress

fluid summit
#

Hi! has anyone integrated firebase to your unreal project? i'm currently trying to implement it for auth and database, but i'm having trouble with the initial project setup integration (i'm okey with api calls using VArest, but i can't integrate the firebase project to my UE4)

hollow oar
#

Question - Is it possible run a dedicated server on an android device? i don't see a setting for packaging up a dedicated server on android XD.. its not that big a deal, but i kinda would like it

floral crow
#

Is there a built-in way of preserving player controllers across SeamlessTravel when the controller class is the same across both levels? In contrast to detroying the controller in Level A and creating a new one in Level B

violet sentinel
#

also things get copied via SeamlessTravelTo/From

hollow oar
#

as long as it is limited properly it wouldn't be impossible, but i don't want to write my own code to make the android client if its not already an available option

violet sentinel
hollow oar
#

^^ that might be more of the problem

#

i might be forced to make it a listen server sort of garbo

violet sentinel
#

online phone games usually host dedicated servers on VDS which requires investment

hollow oar
#

dont know what that is

#

virtual dedicated server... ill have to look it up

kind ember
hollow oar
#

Hey Aaron, thanks. That wasn't quite the idea I had in mind, which would entail essentially a mesh network of phones hosting small server "rooms" that clients could connect to directly

#

its ok, i don't need to worry about that idea right now or for years lol

#

I've got plenty on my plate at the moment, but I wasn't sure if it was just "oh yeah, add this line to bla bla bla and it can generate a android server. Its normally a bad idea so they don't make it readily visible"

#

^^ i understand

#

i get the difference lol

#

dedicated would run even if the client wasn't running

#

but yes, some ideas I have could be accomplished with a listening server

fluid summit
#

i don't think it's unusual at all. Art of conquest and clash work on dedicated servers (i think) and they are extremelly popular.

hollow oar
#

^^ yes but i am sure those are dedicated servers running on linux/windows, not the phone itself. the Android systems connect as clients

fluid summit
#

oh yeah, for sure. i don't think anyone is running a dedicated server on the phone, the security risks would be outrageous.

hollow oar
#

Risk of clients taking user data from the phone? or you just mean the security of the Game itself?

#

or just the "risk" or a port being open at all?

peak sentinel
#

Calling UActorComponent's Activate(bReset) function on server is enough or should we call it on local client too?

fickle nacelle
#

Hello there...i try following CRETE channel in Youtube regarding UE5 Multiplayer setup...but im stuck at error

E1696 : cannot open source file "OnlineSubsystem.h"

need help on it :(. or can i get any other solution to connect multiplayer? thanks in advance πŸ˜„

nova wasp
fickle nacelle
#

hmm okay i'll try have a look on it. i hope im using UE4 tutorial is fine with UE5...hehe

nova wasp
#

most of it should be similar

#

I'm unfamiliar with online subsystem stuff though

fickle nacelle
#

nice πŸ‘ πŸ˜„

#

hehe same with me. i just started yesterday learning how to Multiplayer. I can find lots of solution for UE4...for example using advanced session, download the code in github etc. But for UE5 Early Access, i can find the code/advance sessions. Perhaps , it isnt come out yet...ahaha

#

i cant find*

copper path
#

Man, I am struggling to get my attached actor's relative transform to update on clients. I have a flashlight attached to a gun (skeletal mesh). Everything in the docs says attached actors are replicated as long as their parent components/actors are replicated. But that just doesn't seem to be true in my case. The server looks perect but the clients don't seem to get the correct position of the flashlight once the attachment occurs on the server. What might I be doing wrong?

boreal wadi
#

Don’t see a channel for game features and modular gameplay plug-in so I’ll ask this in a couple of channels

Now I was checking out the Ancient Game code and I was thinking of how adding game features like GAS abilities would work. Do you only give the abilities that the player sets he wants to use? (Use the game instance to save a β€œloadout” then load that data into your functions to add game features) or do you add all the abilities that would be possible so the player can have references to them to recognize the ability if he doesn’t have it equipped but it is used against him? Would that open a big window for cheating

thin stratus
#

Bottom right

#

View Options

kindred widget
#

If the client cannot look it up themselves, it needs to be replicated. I'm fairly sure that ViewTarget stuff is all local and non networked.

thin stratus
#

Hm, I guess a ViewTarget can only exist on the Client that uses it

#

As long as you don't need that Camera for spectator stuff or so

#

Well the PlayerController has some boolean to manage the active camera target

#

Make sure it doesn't override that later on

#

Also I can not advice setting the ViewTarget to something else than the Pawn

#

You are asking for trouble with features like "OwnerOnlySee"

#

because that is based on ViewTarget

#

If you want to offset the view by some CameraActor, use the PlayerCameraManager and override its function that returns an updated POV.

#

There you can grab the ViewTarget, being your Pawn, and then grab the Camera from it and return the location and rotation of that

#

Then your ViewTarget remains correct

#

Character

#

Pawn is the parent of Character

#

The thing you are controlling

#

That is possessed

#

Well yeah, Actor is above all of those

#

Yep

#

And the Character should be the ViewTarget

#

At least while you are controlling the Character

#

I just explained you how

#

Yes

bitter swift
#

How do I set a Bool to True in runtine on an actor, so that when another player joins later, the bool will also be true to him.

I have an actor here that is set to replicated and the boolean variable is also set to replicated. I make sure to set it to true on server.

But when my client joins, the bool is false.

thin stratus
#

Hmmm

#

Theoretically you are doing it right

#

Is that an Actor that is placed into the level?

bitter swift
thin stratus
#

Any chance that the Blueprint itself has the boolean set to true, and the instance in the level has it set to false?

#

Because there is a bug where it compares the boolean state to the Archetype (which is the BP Class) and that is true, so it doesn't cause the replication.

bitter swift
#

The bool is set to false on the default class and the placed actor

thin stratus
#

Hmpf

#

Welp, then not sure

bitter swift
#

Me neither. I don't understand why it's not working :/

#

This comes out as false when the client joins later on.

#

when using Switch Has Authority, it's the same outcome.

bright kraken
bitter swift
#

I made it work by giving it a small delay. Apparently the client doesn't have replicated variables set accurately immediately. But adding a tiny delay, gives them the correct value.

bright kraken
thin stratus
#

Delays are not a good solution though

bitter oriole
#

That'll likely not work

#

Not when you have a tiny bit of latency

bitter swift
#

is there a good way to do a delay?
what if I have a long load time and my tiny delay doesn't come through?

bitter oriole
#

Delays are never the solution to anything

bitter swift
#

I guess I could have the loaded in palyer call for it?

bitter oriole
#

When it comes to multiplayer you have to accept that you will never have accurate and predictable timings for anything

#

You need to either be able to change that boolean dynamically, or you need to build a system to ensure you did indeed get the correct value

#

For example you can turn that bool into an enum : uninitialized, false, true

#

Default to uninitialized, if you have false or true it's certain to be a replicated value

#

And then you'd wait for a repnotify, or on tick, for that value to be set, and at that point you can process it

#

Personally I also keep the loading screen up until I know the player has a valid state from the server

#

Multiplayer is 5x more work, case in point

bitter swift
queen pine
#

So I'm working on a random name tag system and struggling to get rep notify to work correctly
Currently things replicate correctly with the correct name, but not updated when needed.
before the names are set using the server RPC I have to give a really big delay of 3-5 seconds, otherwise players spawning in after another player wont get updated. (Any players who see one spawn will see their name.
When hooking up a key event to call the sequence again this always replicates correctly, however at any moment if the player becomes not relevant their names are gone when becoming relevant again.
I figure its definitely an issue with the rep notify, but Someone with more experience with replication could probably see what I don't.

#

I just realized my cast is failing in the rep notify

chrome bay
#

A) Use an FString not FText for the replicated property
B) You don't need a multicast, the property is replicated - just set it on the server.

queen pine
#

thanks, will give it a try.

queen pine
# chrome bay A) Use an FString not FText for the replicated property B) You don't need a mult...

Changing it to server only prevented clients from seeing names and calling the sequence again while relevant didn't update names.
After going back to multi cast and looking at the Rep Notify function I'm not sure what is happening to make the cast fail only part of the time.
BTW, my nametag widget is just using a binding to its own non replicated variable. Since I'm setting that variable with the rpc in the player that shouldn't be the issue.

chrome bay
#

Multicasting to set a replicated property makes no sense, the property is already replicated - it will already be sent to clients.

#

The cast could easily be failing because of a race condition.

#

What happens if the property replicates, but the widget doesn't exist yet, for e.g.

kindred widget
#

If you're just using a binding in the Widget. It'd likely be easier to just pass the character into the widget, and get it's replicated value to display instead.

kindred widget
#

Well. The notify would be better, along with a set on Beginplay. Event Driven. But if you're using a binding, there's not really a point to the Notify.

chrome bay
#

Tick the widget would be better than a binding and would get around the race condition

#

Otherwise, setting it both from a rep notify and also checking when the widget is first created would help.

queen pine
#

are you talking about setting the widget text on tick rather than a binding?

chrome bay
#

yeah

#

The widget tick, that is

compact adder
#

do i need to activate servertravel for the level i created?

this is not working for some reason

thin stratus
#

If at all SeamlessTravel and that is not supported in the editor

compact adder
#

Im using standalone @thin stratus

#

it just keeps loading forever

#

cant even get a log saying why its not working

thin stratus
#

And you are using ServerTravel to move between levels as the Server, right?

compact adder
#

yes

#

It works on a different level

compact adder
thin stratus
#

Maybe the paths are wrong?

#

I usually just write the level name with the /Game/ part

compact adder
#

It cant be

#

the level thats working

#

is on the same folder

compact adder
thin stratus
#

GameMode set on the maps correctly?

queen pine
#

So Im just not giving it the correct widget until the rep is called, then creating one.

compact adder
alpine root
#

Is there a way to check if a pawn is controlled by the listen server, in blueprints?

queen pine
#

So if its a client?

alpine root
#

Say from the listen server, can I check if a specific pawn is currently controlled by the server?

bitter oriole
#

Yes, just check whether it's locally controlled

#

From remote clients it's harder

queen pine
alpine root
#

Locally controlled will return true on autonomous proxies too though

bitter oriole
#

Every single actor on the server will return true to HasAuthority

bitter oriole
#

I did say it depends on where you're checking

#

Remote clients will likely require a "is server" bool replicated from the server's IsLocallyControlled

fluid summit
#

Hi! how would you go about setting up this feature of swapping between city mode and explore mode?

https://www.youtube.com/watch?v=v4klOqxePHA (15:55 - 16:05)

keeping in mind that on the explore mode, the pawns are replicated and you can see other's people pawn walking around in the map.

So far i'm thinking on use one persistant level for the City and when going into explore mode, use a streamed level for the map exploration (or maybe the other way around).

#artofConquest #mobilegame #gameplay #moba #strategicGame

β–Ά Play video
fickle nacelle
#

Hi...i manage to connect between 2 pc, using advanced session plugins. The problem is, one pc Host is fine...the character loaded good and can move. But the 2nd PC join the host, it doesnt have a Character....just fly mode. Why is that? Thank you

mossy kindle
#

Hey guys, a dumb question here.
How do i replicate this thing? It does work for the client (i.e the client can see the player moving its head up and down, but if the server moves its head up and down, there is no output in the client screen.)
I am using modify transform bone instead of an aim offset

austere ridge
#

Can we use OnlineSubsytemSteam with default IpNetDriver?

austere ridge
harsh lintel
#

OnRep functions are not called in standalone right?

foggy idol
#

Should be called in bp though

foggy idol
harsh lintel
#

My OnRep is a BlueprintImplementableEvent and it isn't being called on standalone

foggy idol
dull lance
#

quick question: How does the server & clients handle other characters' camera components when they are in a replicating character?

I usually do my camera components local only but I got my hands on a project that has them as a default character component

left marsh
#

Any idea why an overlap event might be generated on the server but not the client?

#

I am walking my player character into a volume but only the server generates the overlap event

proud arch
#

Hi Guys!!! I hope you are getting a great day.

Maybe someone have had this issue with a dedicated server in Linux??

When the player chooses the server enter but is kick out immediately.

the Client is for Windows and Server for Linux (running in a gcp vm instance). both built with the same engile, I've deleted intermediate saved and derivateddatacache but the problem is persistent, with a windos server works fine the problem is linux build.

NOTE: the mismatch only happens with characters, we are using GAS for a lot of things

[2021.08.18-04.28.56:227][576]LogNet: NetworkFailure: NetChecksumMismatch, Error: 'GetObjectFromNetGUID: Network checksum mismatch. FullNetGUIDPath: [19]/Game/Characters/Klowns/KlownKlasses/Brawler/BP_BrawlerKlown.[17]Default__BP_BrawlerKlown_C, 2259927734, 2943822821'
unborn trellis
#

is it possible to private message someone here on how to implement spawn protection?

#

my question on the other chat got ignored

proud arch
unborn trellis
#

i've been following a tutorial on making a fps multiplayer game but there's no tutorial showing how to do spawn protection

vague fractal
#

What does "spawn protection" even mean here ?
As in CoD where you can't instantly get killed after you spawn ?

unborn trellis
#

yes

#

that's exactly what spawn protection is

vague fractal
#

I guess it shouldn't take more than 1 boolean "bCanBeDamaged", a check if it's true or not in your TakeDamage method and a timer which will reset it after the set time is passed

unborn trellis
#

problem is i know like the "method" of how it works, it's implementing it is my problem

#

can i send screenshots here on how the respawning works?

vague fractal
#

Screenshots are like always bad.
You could just send the important part here or just the whole file since discord supports it now pretty good
Totally forgot about BP's xD

unborn trellis
#

this is the events for damaging players. I have an == enum where if you're on the same team as someone, then no damage is applied. I want to do that but in a delay after spawning

vague fractal
#

The first thing i'd check is the boolean if it can be damaged or not

unborn trellis
#

i'm lost

vague fractal
#

You need a way in your AnyDamage method to know if the character is still under spawn protection.
The way you could do that is with a simple boolean

unborn trellis
#

i thought i had to implement the protection as the player spawns..no?

vague fractal
#

So it's really nothing more than

if(bHasSpawnProtection)
{
  //Do nothing
}
else
{
  //The rest of your current code
}
vague fractal
#

Doing this check in your AnyDamage method is another step

unborn trellis
#

okay

#

so i create a boolean variable

vague fractal
#

Yes, should be replicated, i think

#

(Note, i'm also not a multiplayer expert xD)

unborn trellis
#

okay i created the boolean variable

#

replicated

vague fractal
unborn trellis
#

im assuming like this? If IsSpawnProtected is true, do nothing, else do rest of the method?

vague fractal
#

Yeah

unborn trellis
#

okay cool cool, that's some progress

vague fractal
#

Also, just since it's easier you should set the default value of IsSpawnProtected to true

unborn trellis
#

i think that's what the bp does, the false bit is ... false lol

vague fractal
#

Normally it should be false by default, so better check that

unborn trellis
#

im looking at all the other booleans and it's similar in how the screenshot i sent is. since im getting the variable

vague fractal
#

It is false by default tho

unborn trellis
#

oh shoot ur right

#

i forgot to compile πŸ€¦β€β™‚οΈ

vague fractal
#

So now in your begin play you need to create a timer which will set it to false again after the passed time

#

It should also have an authority check i think

unborn trellis
#

Apologies for the ugly nodes but like this?

vague fractal
#

Ye

unborn trellis
#

do i have IsSpawnProtected set to false or true?

vague fractal
#

Should be true by default and you set it to false after the delay

unborn trellis
#

okie dokie

#

oh mad

#

@vague fractal you're awesome man!

#

thank you so much!

vague fractal
#

No problem.
Note that i have currently no idea if you really need the authority guard here nor if the boolean has to be replicated xD

unborn trellis
#

haha, yeah everything seems to be working

#

to think it was that simple yet i struggled so much πŸ˜‚

vague fractal
#

Can relate xD

unborn trellis
#

i can't thank you enough tho

#

now my game has some balance πŸ˜‚

vague fractal
#

Dw, happy if i can give some help back after getting much help from the server :P

unborn trellis
#

thanks man πŸ‘

kind ember
#

Is there a discord channel for Vivox questions?

blazing socket
#

How can I replicate a variable on the PlayerCameraManager? I did the standard UPROPERTY replicated flag, but the client is not receiving the updated variable from the server

#

bReplicates = true as well, so not sure why

dull lance
#

Does PlayerCameraManager [systematically] replicate at all though?

#

it gets created on either APlayerController::PostInitializeComponents() and APlayerController::PostSeamlessTravel()

it says // servers and owning clients get cameras , but it spawns the managers locally.

#

and if you take a look inside APlayerCameraManager, it doesn't look like the actor was set up to be replicated

#

so I don't think you can

#

the pointer inside Player Controller doesn't replicate either ```cpp

/** Camera manager associated with this Player Controller. */
UPROPERTY(BlueprintReadOnly, Category=PlayerController)
APlayerCameraManager* PlayerCameraManager;```
#

@blazing socket

spark owl
#

is there anyway I can create a multiplayer session using advanced sessions without having each user needing to portforward?

#

i'm trying to setup a pary system. I use AWS for actual game sessions but want to see if I can have parties on steam servers with advanced sessions. but the issue is that for anyone to host a party, they would need to port forward

dull lance
#

^ idk if you can without it. if you're using SteamSockets you don't need to port forward though

#

however, idk if Advanced sessions can actually use SteamSockets functionality

spark owl
#

hmm ok how would I use these steamsockets?

#

are they used for dedicated or listen servers or both?

dull lance
#

It's not pretty. Your easiest way out is to purchase a marketplace plugin that supports it

#

they can be used for both

spark owl
#

yeah i probably would just buy a plugin

#

I saw steamcore

#

seems like it might be what i need

dull lance
#

using that plugin for a personal project myself; it's enough for that project's needs shrug

spark owl
#

and that can use the steamsockets?

dull lance
#

yes; it still requires a decent amount of setup, but significantly less than if you're implementing it yourself

spark owl
#

yeah i bet

dull lance
#

then again, that's less of a pita than implementing port forwarding

spark owl
#

with this steam core, is it able to setup dedicated servers on command? I'm using AWS for my servers, but they cost a lot since I'm doing many different regions

#

wondering if maybe I should switch to steam servers

dull lance
#

Steam doesn't actually house game servers. There's a decent amount of reading that you have to do for both Steam side, UE4's impl side, and SteamCore's (if you go that way) side

spark owl
#

ok forsure ty for the info. I will look into the plugin.

#

do you have any experience with the party/beacon system for steamcore? @dull lance

dull lance
#

My project just uses Lobbies for the intermediate process. For my purposes, it's enough.

I haven't really used Beacons just yet.

spark owl
#

ok thanks a bunch for the info I think you've put me onto the right track for getting what I need done πŸ™‚

blazing socket
dull lance
#

Usually you replicate this info either in the Player controller or the Pawn [maaaaybe even player state], depending on needs

short fable
#

Hey there. I Hope everyone is having a great week!

How ever I've gotten a bit stuck. I'm a newbie with UE and especially the networking side. I'm trying to replicate the players looking rotation animation(aka. have the third-person character that the rest of the players can see, look where the gun is pointing). This works in single player by modifying a spine bone in the Anim Graph.

How ever when i try to replicate this it just applies the same rotation that the local client is using on the rest of the players. There is probably something that I'm doing wrong and just me being a big dum dum so i thought i'd ask the UE wizards on here for some help.

Have a good one! πŸ™‚

eternal canyon
mossy kindle
compact adder
#

does anyone know why its returning false

lost inlet
#

it's not available in the editor

compact adder
compact adder
#

i want to check if steam online subsystem is working

#

with the has online subsystem node

lost inlet
#

Steam is disabled in the editor, use the standalone game instead or package a build

compact adder
#

im using standalone

#

still returning false

lost inlet
#

Not launching the editor with the -game command line switch? What engine version are you on

compact adder
#

5

#

Its giving me a error for some reason

modern cipher
#

Which method is usually used in multiplayer games for modular characters & replicating equipment?
Set Master Pose Component, Copy Pose from Mesh, or Skeletal Mesh Merge?

cunning condor
#

Anyone know why epic is doing this? Channels is an array of NULL values not nullptrs, this check always fails.

rapid bronze
#

Stick to nullptr when possible

cunning condor
#

so why is this check failing? Channels[ChIndex] is 1, which is NULL value

#

ChIndex is 1*

#

and Channels contains 32k empty slots

mossy kindle
#

Guys anyone know why this cast might be failing?

cunning condor
#

that have a null value

mossy kindle
#

If i use Get display name it outputs BP_PlayerCharacter1 instead

rapid bronze
#

NULL = 0

cunning condor
#

yes and nullptr is prvalue of type nullptr_t so either epic fucked up and is attempting to compare 0 with prvalue of type nullptr_t or I'm losing my mind

rapid bronze
#

Does it actually fail?

Seems like it's indeed checking if the channel is empty aka NULL / nullptr from what you described

empty axle
cunning condor
#

yes its crashing both my client and server

#
[2021.08.24-16.35.32:948][237]LogOutputDevice: Warning: 

Script Stack (0 frames):

[2021.08.24-16.35.32:950][237]LogWindows: Windows GetLastError: The operation completed successfully. (0)
[2021.08.24-16.35.34:119][237]LogWindows: Error: === Critical error: ===
[2021.08.24-16.35.34:124][237]LogWindows: Error: 
[2021.08.24-16.35.34:147][237]LogWindows: Error: Assertion failed: Channels[ChIndex] == nullptr [File:E:/workspace/Unreal Engine/Engine/Source/Runtime/Engine/Private/NetConnection.cpp] [Line: 3272] 
[2021.08.24-16.35.34:151][237]LogWindows: Error: 
[2021.08.24-16.35.34:155][237]LogWindows: Error: 
[2021.08.24-16.35.34:158][237]LogWindows: Error: 
[2021.08.24-16.35.34:186][237]LogWindows: Error: [Callstack] 0x00007ff621eee9fa RustRacersServer.exe!UNetConnection::CreateChannelByName() [E:\workspace\Unreal Engine\Engine\Source\Runtime\Engine\Private\NetConnection.cpp:3272]
[2021.08.24-16.35.34:217][237]LogWindows: Error: [Callstack] 0x00007ff621f43ad9 RustRacersServer.exe!UNetDriver::AddClientConnection() [E:\workspace\Unreal Engine\Engine\Source\Runtime\Engine\Private\NetDriver.cpp:5272]
#

and attaching the debugger shows me that Channels contains 32k items of value NULL

#

the index its attempting to access is 1

#

which is valid

#

but the value is NULL, which should be fine right, its checking that there's nothing in this channel already

#

so the check should pass

#

but instead its asserting and crashing

empty axle
#

it shouldn't pass if there is NULL or nullptr inside. It's literally doing what the comment above the code is saying

cunning condor
#
    // Make sure channel is valid.
    check(Channels.IsValidIndex(ChIndex));
    check(Channels[ChIndex] == nullptr);

    // Create channel.
    UChannel* Channel = Driver->GetOrCreateChannelByName(ChName);
    check(Channel);
    Channel->Init( this, ChIndex, CreateFlags );
    Channels[ChIndex] = Channel;
    OpenChannels.Add(Channel);
empty axle
#

oh wait a second

cunning condor
#

it's the other way around

empty axle
#

I see

cunning condor
#

It's checking so that the channel isnt already occupied by something

#

but the sanity check is failing

#

because NULL != nullptr

empty axle
cunning condor
#

not according to the debugger im attaching

rapid bronze
#

Iirc nullptr doesn't really point to 0 as NULL does

So it's probably trying to compare NULL 0 with something else

Only one way to find out really

cunning condor
#

putting a breakpoint on it shows me that Channels is an array of NULL so yeah either there's a #define NULL 0 somewhere

#

or I'm losing my mind

#

this is on a dedicated server in UE5 built from source

#

but the weird thing is that it happens on the client too

rapid bronze
#

You can try changing nullptr to NULL and see what happens

empty axle
#

nullptr == NULL
NULL is defined as 0 and is promoted to pointer type in that comparison and then equals to nullptr

empty axle
cunning condor
#

I dont wanna recompile the engine for that change x)

rapid bronze
#

Yeah, still doesn't hurt trying to get it out of the way :p

cunning condor
#

takes like 3 days with debug symbols and all targets

rapid bronze
#

Yikes, 3 days? 😬

lusty sky
#

this is getting cplusplusy xD

cunning condor
#

it's driving me nuts

twin juniper
#

Hey guys, I'm testing out a few things by modifying the UniqueId on my PreLogin() by doing this

#
{
    const FString& Value = UGameplayStatics::ParseOption(Options, "Something");
    Super::PreLogin(Options, Address, FUniqueNetIdString(Value), ErrorMessage);
}```
#

I get "use of undeclared identifier 'FUniqueNetIdString'". I thought I could fix it by including OnlineSubsystemTypes.h, but it's also giving me errors to find the file.
Does anyone know what is the mistake here? I appreciate any help.

chrome bay
#

Out of interest why change that at all?

#

You can see that PreLogin takes an FUniqueNetIdRepl anyway, which is not the same type as FUniqueNetIdString so it's not going to work

#

Unless there's a lot of implicit conversion going on there

twin juniper
#

Yeah I would like to convert it

#

But I guess I will think another way

chrome bay
#

You shouldn't really be changing it at all, makes no sense to mess with that really

twin juniper
#

I see

#

Thanks Jambax

cunning condor
#

so I guess nobody is working on cross-platform multiplayer games with dedicated servers in UE5 yet because I'm quite clueless what we could be doing that would cause this

chrome bay
#

It's UE5, literally anything could happen

#

Probably not wise to be building something that complex in an unfinished toolset

#

Might have better luck in #ue5-general - most of us are still working in UE4 AFAIK.

cunning condor
#

yes and no v_ we have no release date set yet and in 4.26 chaos vehicles are beyond broken, all the 4.26 vehicle crashes are fixed in 5

#

and regressing further back to use physx vehicles isn't an option since we've built an extensive framework on top of chaos vehicles already v_

rapid bronze
#

The exact same code is in UE 4.26 and 4.27

cunning condor
#

migrated to 5 the moment it was on github and so far we haven't had a single problem we couldn't fix, this is the first real blocker we've ran into in 5

modern cipher
#

you shouldn't be using a preview version in the first place ...

cunning condor
#

by the time the game is done 5 will be out of EA

modern cipher
#

that could be done in a stable release 4.XX

#

same

cunning condor
#

not really because in the stable 4.XX versions chaos vehicles are bugged to shit :p

#

chaos physics is mega jank in 4

chrome bay
#

Chaos in general is bugged to hell. Not even worth using in 5 atm.

cunning condor
#

it's a lot more stable in 5 and manually merging those fixes is waste of resources πŸ˜›

chrome bay
#

Just worth remembering you're building on top of totally unproven tech atm, I wouldn't expect a huge amount of assistance with core engine issues in this channel if it's UE5.

rapid bronze
#

Thought UE5 had Chaos on by default, huh

chrome bay
#

Bound to be massive stability problems for the forseeable future. 4.0 wasn't particularly stable - the rocket beta considerably less so

cunning condor
#

it does and physx is getting deprecated in 5

chrome bay
#

It does, but that doesn't mean it isn't rubbish.

#

Has a long way to go before it can touch PhysX

rapid bronze
#

Oh πŸ˜„

cunning condor
#

someone gotta take one for the team and suffer through all the jank so the next batch of people gets into it, it'll be a lot less painful πŸ˜„

rapid bronze
#

Is the Water any different in UE5 vs UE4? Just quick question

cunning condor
#

Haven't touched the water system since 4.26 and back then it was so janky I decided to not bother with it for a while πŸ˜„

rapid bronze
#

Yeah, that's why, really breaks when you dare to move it away from Z 0

#

Was just wondering

cunning condor
#

I wonder if this is related to that check failing

Error: Channel name is defined multiple times: Control
Error: Channel static index is already in use: Control 0

Not sure how multiple net channel definitions are sneaking through though because BaseEngine.ini is clearing the array before assigning the values

velvet stratus
#

I have a question concerning Hit-Events in server-based multiplayer: If a player collides with (hits) another player, do both clients fire hit-events for both players? Meaning if they call a server-side function in the hit-event, does it get called twice on the server for each player?

bitter swift
#

When I test my level, is there a way to make the clients join later? Like a 10 sec delay. I'm testing some Rep Notify stuff

rich locust
#

then join in later on via command line

#

open "LocalIP:17777"

bitter swift
bitter swift
chrome bay
#

And remember only the owning client can call Server RPC's

velvet stratus
#

so if two players collide and i call a server function on hit, it will only get called once by each client for their respective players?

thin stratus
#

The point is that you don't really call RPCs for this stuff

#

It happens one everyone. You just have to filter

#

When two Player Characters collide, it will call the Hit event on literally everyone involved + server

#

So you can filter the Hit call by Authority/Server

velvet stratus
#

ah, i completely forgot about authority, thanks

thin stratus
#

If you want it to call locally

#

Only for the specific client

#

Then you can check if the Character is LocallyControlled

#

And only then execute your code

#

But it all doesn't need any RPCs, cause on every PC, these two run into each other

#

Even a third player will see them bash heads

#

And the simulated versions will call the hit

velvet stratus
#

that's a good point. i have to reevaluate what it is exactly i'm trying to do. thank you all a lot πŸ™‚

cunning condor
#

Aight so I figured out the damn crash, just incase anyone else ever runs into ```
Assertion failed: Channels[ChIndex] == nullptr [File:E:/workspace/Unreal Engine/Engine/Source/Runtime/Engine/Private/NetConnection.cpp] [Line: 3272]

There was a duplicated DefaultEngine.ini that contained several definitions of the netchannels, these were overlapping and the engine crashes as a result. Solution was to delete the Saved folder and get rid of all the cached bullshit.
twin juniper
#

im struggling a bit with replication graph - is there a function i can overload to add a distance check between the PC's pawn and the actor up for replication for example? i can see theres a net cull check but this is done in between the larger serverreplicate function, which overloading doesnt really seem to work because of all the private members it refers back to/cross dependant variables... am i approaching this the wrong way or is there something obvious im missing? the alternative i guess would be overloading how gridcell get actor works or maybe something else? its got to the point that im thinking about just editing the inbuilt plugin directly out of frustration! any help/thoughts would be really appreciated thanks

chrome bay
#

@twin juniper Not entirely sure what you're asking, what's the end-goal?

twin juniper
#

@chrome bay end goal is to not replicate the actor to a player if the actor is not within range or hasnt got vision of the player's pawn

#

(i was just going to use netcull but it doesnt make sense as thats about the actor itself replicating, whereas this is querying a vision range in respect of a pawn)

chrome bay
#

Replication Graph doesn't really support things like that.

#

You don't selectively cull actors, instead you determine what is relevant to a given connection by putting it into various nodes.

#

If you want an actor to only be relevant when the player is looking at it, you probably need to put it into a custom per-connection LOS node, and not route it to any other nodes.

#

Unless you have an enormous number of replicated actors, repgraph isn't worth it - just use the regular replication system and you can control relevancy per-actor / with more granularity.

thin stratus
#

I wonder if all that node stuff could be nicely visualized in the editor somehow

twin juniper
#

@chrome bay thanks i was trying NOT to do that because i was worried adding/removing to nodes was bad performance wise (but i guess this is basically what grid spatialization does)

chrome bay
#

You only add nodes at startup time or when a new connection is created, you generally don't add/remove them at runtime

twin juniper
#

(i meant adding/removing actors to a node)

#

(although i think grid just queries to create the list iirc?)

plucky prairie
chrome bay
#

@plucky prairie How do you mean reference the UObject?

#

It's just like any other object

plucky prairie
#

sorry for replication i mean

chrome bay
#

The third snippet shows how to keep a reference to the objects themselves, if you wanted to

#

E.g:

    UMyAwesomeObject* MyObject;
    
    UPROPERTY(Replicated, BlueprintReadWrite, Category = "My Object")
    TArray<UMyAwesomeObject*> ArrayOfMyObject;```
#

Treat them like components, it's near enough the same thing

plucky prairie
#

this is where i get stuck then unless i misunderstood - I can add a Uproperty in there but its class is BP_UMyawesomeObject (for example) which isnt in c++

#

so i dont quite get how i can get it to replicate

#

tried TSubobject stuff too but no luck

chrome bay
#

Yeah you can't do that, you can't use BP classes in C++

#

You would have to spawn the object via NewObject<>, and pass in a Blueprint Class

#

But the C++ pointer will be to whatever the C++ base class is

#

E.g, look at the bottom snippet:
UInventorySlot* NewSlot = NewObject<UInventorySlot>(lOwner, SlotClass);

#

UInventorySlot in this case is one of those replicated UObjects

plucky prairie
#

ah ok so it would give me an object of 'slotClass'

#

and not UInvnetorySlot

#

correct?

waxen breach
#

Is there ANY way to be able to get my game up and running on a multiplayer server without paying too much, that doesn't need accounts?

#

Probably too much to ask, but i want the device to be the account, and not using any external accounts, like a mobile game

bitter oriole
#

If you're on PC on console you'd just use listen servers

chrome bay
#

@plucky prairie yeah

bitter oriole
#

of course you'd then not have any UE4 replication at all but hey

waxen breach
#

Well, i have been trying to use the free version of EOS, and using advanced sessions and such

#

but i want a player to just be able to host a lobby and have another player join, without accounts

bitter oriole
#

Those are for sessions, they are unrelated to hosting

waxen breach
#

that's the thing though, i dunno how to do the hosting, i keep thinking i have EOS set up and then i run the game and i can't create the session

bitter oriole
#

EOS and Steam are unrelated entirely

#

Those do matchmaking

#

The hosting method is completely disconnected from that

#

"matchmaking without accounts" and "free game hosting" are two very different topics

waxen breach
#

Oh, hm, so, if i wanted to host sessions with no accounts, i should use dedicated servers is what you're saying? I apologize for my incompetence i'm very new to this

bitter oriole
#

I just said that sessions and dedicated servers are fundamentally different topics

#

They are unrelated

#

You have a "sessions" technology and a "multiplayer gameplay" technology

#

There is no relation at all between both

#

EOS & Steam do absolutely no server hosting for gameplay

#

The general tech stack for dedicated servers on PC is "buy a lot of Amazon servers and run your UE4 dedis" + "have the dedi create a Steam session that players can find"

#

But if you do listen servers the Steam part can be exactly the same

#

So pick your gameplay architecture first - dedi vs listen vs not an UE4 server

#

And then pick your sessions architecture - Steam vs EOS vs GOG vs PSN vs your own tech vs IP addresses

#

(And if you do your own sessions tech, that can credibly run on a free Web server for the foreseeable future - that's not even VPS territory for most indies)

rose raft
#

Does anyone know of any code examples of pawns with physics being replicated? It would help out a ton

lapis zinc
#

is it possible to start a game with out player start and just use the character bp

twin juniper
# chrome bay Same with actors, you add them to the node once, and remove them when they are d...

thanks for your thoughts - i put together a system similar to 2dgrid (by splitting the world up into sections) + LOS checking on a custom engine because range checking against all actors was too expensive - ill try and spend more time on repgraph because i think its better than the alternative unless you think its a completely wasted endeavour and simply not really possible with the way its set up

kindred widget
#

@rose raft For like ragdolls?

rose raft
#

Like rigidbodies, for example a box collider rolling down a ramp

#

Or another example could be a simplified vehicle which uses only a collider

#

I've gotten this to work quite well, the problem for me now is optimizing it as I'm sending moves from autonomous proxies every tick via reliable rpcs, as well as the issue with physics being simulated at different timesteps

#

So I was curious to possibly see how others have tackled this

kindred widget
#

I feel like the only way to do that semi reliably is to more or less replicate a struct of location/rotation/angular velocity/linear velocity. If you replicate that a few times a second and let client's locally simulate the rest, it might be gentle enough on the network and still relatively reliable. At least that's how I've personally managed to get decent physics simulating components to go well enough. For skeletal meshes it'd be pretty much the same except that you'd need to replicate those values for some main bones in the mesh.

rose raft
#

Thanks, I'll definitely give that a try

rose raft
#

Would it be possible to manually resimulate physics?

If the client sends a move --(100ms passes)--> Server simulates it and sends the client its state --(another 100ms passes)--> Client recieves the server state and makes a correction

Then for it to not rubberband, I need to resimulate the 200ms of moves that the server did not know about, or otherwise the position will be sent back 200ms

The problem is that since I'm resimulating a bunch of moves that occured since the correction in one frame, a lot of physics simulation is lost because it is separate from my movement logic
The solution I need is when I simulate an individual move, I need to also simulate physics on the pawn for the delta time of that move

I can clarify if what I'm saying doesn't make sense

kindred widget
#

That was one reason I did what I did when I was testing. It didn't matter if your server sends the correct data and you let it be authority. Server is the real state. So when it sends data, client should sync up as best it can. You can smooth some of that out with interpolation math if you want, but the frames in between updates are nothing but visual candy for the client. Which is the reason I was sending all four of those states. They keep client best in sync with the server even if client is only getting an update every 300 ms.

grizzled flicker
#

Anyone have any alternatives to the server browser? I’d really like to have a queue system where you just hit find game and it auto searches based on any available server

rose raft
# kindred widget That was one reason I did what I did when I was testing. It didn't matter if you...

Right, makes sense. I think the problem is that I'm trying to predict the server so that the client is responsive. When the server state makes it back to the client what I'm trying to do is make it sync up as closely as possible. However because I am simulating ahead of the server on the autonomous proxy, what happens is when the server state reaches the autonomous proxy, I apply the server state (location/rotation/linear velocity/angular velocity) and then re-apply all movement that happened since the server state (so that the client, which is predicting ahead of the server, does not roll back, say 200ms from my last example). The problem is that I re-apply that movement, but I don't know how to apply physics for the duration of those re-simulated movements.

#

Sorry for the long explanation

#

To give an example, imagine a player moving a box collider forwards off of a cliff. When the player is falling, the client receives an update of the server state. However, that server state is outdated because of packet lag. So, what happens is the client rolls back to that server state, but then has to reapply the moving forward and falling that has happened since the "time" of the server state. The problem is that although I am resimulating the player continuing to move forward, I am not re-simulating it falling (and anything else physics related that happened), and what happens is the client has a major rubberband upwards.

gusty slate
#

Hello πŸ™‚
So if a widget holds a reference of an actor, and the actor is replicated, is it possible to call a server RPC from the widget? I'm trying but it isn't getting called from clients

gusty slate
#

Alrighty, I'll hook the RPC from the player controller

#

Thanks

slim matrix
#

how do i replicate velocity of my characters mesh cuz right now when the player mesh rag dolls on the client will have velocity like if im moving forward and die the charters body gets launched forward but for other players it just drops straight down

gilded nest
#

How do I set the view target with blend in multiplayer with a camera that is in a level?

sage isle
#

So I want to work on a project where players can join a server and play together but I am a bit lost on where to start. Can I build a multiplayer game and then add things like server browsing later or do I need to do that first? I understand how to replicate and things like that but I am struggling to understand how to setup actual servers for multiplayer

slim matrix
#

why wont my charater mesh components velocity work in multiplayer like even if i set the velocity of the component from the server to all clients it still has zero velocity

fading birch
sage isle
#

yeah I was kind of looking into dedicated servers but thanks for the info, I have been seeing stuff about online subsystems but I am very new to multiplayer

fading birch
#

It looks a lot more complicated than it is

winged crypt
slim matrix
#

why dose the rag doll have no velocity for other players like even

fading birch
#

iirc Ragdolling isn't replicated. So the server would stop updating the other player's velocity as you stop ragdolling disables movement input

#

each client see's their own version of ragdolling

#

you can get around it a bit

#

by checking their velocity prior to the ragdoll and then applying an impulse to the character as they ragdoll

#

to fake the funk so to speak

arctic turret
#

So, does anyone know where is the code that decide when a property is to be replicated? I am trying to replicate an UObject but somehow unable to do so, it works when reassigning the property but not when changing it

peak sentinel
#

A workaround for ragdoll replication is tearing off the movement component and replicating a bones world location from server to clients

#

Bad, ugly, probably broken sometimes but gonna work for simple actions

slim matrix
#

what are some methods i could use to make the clients movement to other players as smooth as possible

whole iron
# slim matrix what are some methods i could use to make the clients movement to other players ...

I don't know if this is the right answer, someone please correct me if I'm wrong [I have spent the past 6 days just watching UE4 tutorials, guides, etc]
I believe you need to create a separate function (one that mimics how they normally move) that only runs server side and replicates to all clients. For example if you wanted to set the walk speed of your actor (for sprinting) you would make a function called "start sprinting", make it server side, and set it to replicate to all clients. Then after it calls that function, you would put the exact same code on that side too. That way both the client and the server are in sync (since this way the server and the client wont be fighting about the actors current position, and overwriting each other).

Again probably wrong, and probably not the answer you were looking for, but I can try lmao.

#

Anyhow on to my question

#

I plan to make a FPS multiplayer game (at least a prototype right now). So my general understanding are that there are client side listen servers (peer to peer essentially) and dedicated servers (ones that typically don't have someone playing on them and instead have all the clients connect to that one.)

**If I wanted to implement a party and lobby queue system, how could I achieve this?**My initial idea was to have each client start a listen server (as the main menu) and integrate (in the future) steam to have them connect to the party leaders listen server, who in turn could queue for a match sending all clients connected to the listen server to a dedicated one (don't know how I would make a search system for a dedicated server but I'll figure it out)

But then I realized: what happens after the dedicated server finishes the match and sends everyone back to their servers. I'm assuming I could log which people are in a party together (and subsequently who is the host of the party) so they could all connect back to the listen server, but then I realized, what if the players disconnect before the host does? On most games it would send them back to the lobby (as you would expect) but what server would the connect to? The listen server is (presumably) gone. So if the dedicated server were to send lets say party member B back to the lobby, which they do not own, then how could the connect to a lobby that doesn't exist? I get the idea that I could have the host disconnect, setup the listen server, and have the party members reconnect to it, but that doesn't seem like a good idea.

I guess what I'm trying to ask is if its possible to have a listen server be up in the background while the client joins a dedicated server. That way people could reconnect to the lobby they were already apart of, and it wouldn't have to reload them into it.

Also I have 6 days of ~~"experience"~~contact with UE4. Sorry for the essay.

thin stratus
thin stratus
thin stratus
# whole iron I plan to make a FPS multiplayer game (at least a prototype right now). So my ge...

You are kinda correct here. You wouldn't do the Party Lobby with a ListenServer though. There is something called Beacons which offer a light weight connection. Users don't need to activaly travel to the beacon hosts map and yet the system still offers replication similar to normal connections. That is usually enough to share data about the players as well as telling players where to connect to.

#

The problem of the Party host being "gone" after a match persists.

#

Usually when using online subsystems like steam, the session ids are bound to the player ids. So you could save the beacon session you were connected to and try reconnecting after a match.

#

The host on the other hand would open up the party session again as soon as they can

#

Clients basically need to have some simple timeout logic

whole iron
#

Could I potentially have the clients say "waiting for host" and then once the host reboots up the beacon they would reconnect

thin stratus
#

Yeah

whole iron
#

wait

thin stratus
#

In a perfect world you could have both sessions up at once

#

But steam only allows one at a time

whole iron
#

so is beacon peer to peer? or is it peer to peer to peer to peer.
Is it a place where I could store data, (like whos in the lobby etc) and send it to each client, to interpret, and then put up on their own lobby

#

Because if I could do that then it wouldn't be an issue

thin stratus
#

It's also authority based like other connections

#

So one host and many clients

whole iron
#

I could just give the owner a boolean value (if able to queue), have it so when someone joins a party its set to false (but the owner still keeps it) and have the clients render each person being next to them (even though they arent actually there)

thin stratus
#

There is also the option of handling all of this with some outside third party system. But no idea if there is one and what it takes to get that running

#

Beacons also require c++

whole iron
#

meaning if they left the dedicated server to go back to the menu, they would have the inability to queue, but would still have the data cached from their party members

whole iron
thin stratus
#

Anything more complex in ue4s multiplayer needs c++

whole iron
#

I know a little python so this is gonna be exactly as hard as if I didn't.

Do you have any resources I could use? (On beacons) (not on CPP lmao)

#

or any resources you would suggest rather

thin stratus
#

That's also the channel to further discuss stuff like that

whole iron
thin stratus
#

C++

#

Again multiplayer is very c++ heavy

#

You could say roughly 10% or so are available to Blueprints. if at all

whole iron
#

I am very happy right now that I can use both C++ and blueprints in the same project

#

because otherwise this would be a nightmare. Thanks for the lead! I'm going to probably poke my head around here more cause this was really helpful.

thin stratus
#

My honest opinion and suggestion to everyone who wants to make a (multiplayer) game and become a programmer with ue4 is to make it their priority to learn c++.

#

Blueprints are cool and can do a lot but in the end you'll be much happier if you can utilize cpp

whole iron
#

If I'm being honest I spent 9 hours learning python for a simple at home project for myself. I also spent a lot of time on pseudo code based programming over the past like 4 years lmao (hence my appreciation for python being easy to understand)

I also have a few friends who I'm trying to drag around on my ridiculous jump into an unknown engine and a notoriously complicated language (from my perspective) so when I said, "well yeah its possible to use blueprints for like majority of it" they literally rejoiced lmao.

That being said I'm the only one learning UE4 sooo hahajonathan.

but yeah thanks for the answers.

My question now is should I worry about networking after I make the game or before I make the game? (My friends are working on models in blender rn as I'm typing this) So should I make the game to some capacity, and then spend a week or two trying to make it multiplayer? Or should I start with it being multiplayer and then make the game afterwards. (seeing as UE4 makes it easy to load gamemodes and maps, I could just use the built in multiplayer (fake multiplayer) ) to test replication etc.

#

Is it something I could tediously go back through the code of, turn on replication, move functions and debug until it works properly on multiplayer?

#

Because I would (personally) rather make something first before spending the time to learn C++ and then networking entirely, although my initial thought was to make it multiplayer from the start so it would be easier to make. (Also I found someone who ported beacons to BP, but its 15$ and I feel like I should just learn it myself instead lmao)

Anyhow just ignore me im gonna go to sleep sorry for the essays lmao

compact adder
#

Does anyone know why steam isnt retrieving friends list on a packaged game but on a standalone its working?

thin stratus
elfin sail
#

i have struct in player state with n number of properties. what is best way to check which property is updated ?

#

i mean struct is replicated how can check on rep which property is updated ?

bitter oriole
#

Add a parameter to the rep event of the struct type

#

That'll be the previous state

fossil spoke
#

void OnRep_MyStruct(FMyStructType OldMyStruct);

lusty sky
fossil spoke
#

OldMyStruct will be the old value of the struct.

#

You can then check which properties of the struct changed. As Stranger said.

elfin sail
#

i have almost 25 properties , and its looking good at all to check 25 on rep events

modern cipher
#

Which solution is the best for making replicated equipment?
like what most of online games use ? skeletal meshes and set master pose ? or there's better ways?

elfin sail
#

and comparing the values kind of same

bitter oriole
#

What's wrong with comparing the 25 values ?

#

Make it not a struct if that's a bother

elfin sail
#

i dont make struct then still i have to make 25 On_rep event

#

which i can do with single event of struct

bitter oriole
#

I question the fact that you need a rep event for every single replicated data here

#

Personally I hardly ever use rep events

#

Sure you need those for every single property ?

elfin sail
#

yes its player properties like shirt socks shoes etc

lusty sky
#

Well you dont have options here, either you move the ones you need out of the struct
or compare all the values and extract the changed onces

bitter oriole
#

Not sure why that needs to trigger code everytime it changes but hey

#

Just test the previous value

elfin sail
#

because i have to change the assets of local player when its trigger

bitter oriole
#

If you actually have different code to run for each single independent property I have no idea why either solution (25 events / 25 ifs) is a problem

elfin sail
#

because its same code

#

same int8 chencged i have to write 25 times same thing

#

with diff name

#

i want somthing genric

bitter oriole
#

Use a function

#

Hell, use a lambda

#

Hell, use a macro

elfin sail
#

macro is same

bitter oriole
#

Do a macro that does if struct.PARAM != oldstruct.PARAM then MESHNAME->setstaticmesh(struct.PARAM)

#

Then you have 25 lines

elfin sail
#

it wont change anything

#

wait

lusty sky
#

Why do you even need the old value if you are going to set the new one on rep anyways?

#

i dont get it

bitter oriole
#

There are like 5 ways to solve this

elfin sail
#

i dont need old

lusty sky
#

you said u need to check if changed you cant do that without old value

elfin sail
#

what is i create a struct with type and value

#

and create one on_rep

#

pass type and value

#

it that make sense ?

lusty sky
#

it will be called when one or more props change in the struct

#

you gonna set what you need onrep anyways?

bitter oriole
#

Let's say you have a single struct with 25 properties that are all associated to a mesh, and a single rep event for each. You can write a template that takes two inputs (old and new) of a random type (the property) and a mesh, and does "if new != old then setstaticmesh(new)" - and override the template through specialization, for each supported property type (static mesh, skeletal mesh, etc)

compact adder
#

is there any way to know why on post login is being called twice??

bitter oriole
#

Then your rep event is exactly 25 lines long - it's 25 template calls

#

updatePropertyIfChanged(old.shoes, new.shoes, shoesMesh);

#

Easy as pie

lusty sky
compact adder
#

I dont tho @lusty sky

lusty sky
#

did you check the scene? even a manually placed player can be possesed if you set it

#

not only spawned from game mode

compact adder
#

no players

lusty sky
#

lol

elfin sail
bitter oriole
# elfin sail yes i want somthing like this

// do one for each type you need
auto updatePropertyIfChanged = [](const UStaticMesh* Old, const UStaticMesh* New, UStaticMeshComponent* Mesh)
{
  if (Old != New) Mesh->SetStaticMesh(New);
};

updatePropertyIfChanged(OldState.Head, ReplicatedState.Head, HeadMesh);
updatePropertyIfChanged(OldState.Shoes, ReplicatedState.Shoes, ShoesMesh);
// etc```
#

Give or take minor syntax etc

#

Could be a template or whatever

elfin sail
#

its mean i i have to check each value ?

#

struct property { T type ; T Value}
onrep_property(proprty p);

#

is that make sense ?

bitter oriole
#

I don't know what to add I literally just gave you the entire code

elfin sail
#

but i dont want to compare values

bitter oriole
#

Then write 25 rep events

elfin sail
#

this is also dont want to do πŸ˜„

bitter oriole
#

It's going to be one of those

elfin sail
#

hmm okay thank you so much

eternal mantle
#

Last night I decided to learn Unreal Engine (I'm using Unreal Engine 5) and I'm trying to make a movement system work for all players

#

some stuff works

#

but specifically my method of dash only works on the first player

#

this is the blueprint for the dashing

#

When I set the Net Mode to Play as listen server, the client that runs in the viewport works fine but the one that's created as it's own window doesn't

thin stratus
#

The Client in the Viewport is the Server

#

What you are doing there doesn't work because you are only doing it locally

#

Also, this is the worst thing you can start with when learning UE4

#

Multiplayer is already hard, but Movement in Multiplayer is even worse and theoretically requires proper C++ knowledge

#

I would strongly advice you to not learn this as the first thing. It will burn you out instantly

#

@eternal mantle

#

But in case you still want to do that to yourself, check the Compendium that is pinned to learn about RPCs and Replicated Variables

eternal mantle
thin stratus
# eternal mantle Ah well, my programming knowledge is limited to python and html/css

Then stick to Singleplayer, honestly. Learn the Engines framework ( the classes, what they do, what you should use them for etc. ) first. Learn a bit about how to references objects properly ,because that will give you a headache one day or another (there is a stream pinned to #blueprint ).
I would even suggest learning C++ at some point, recreating your Blueprint stuff to gain an understanding of how C++ with UE4 works. best would even be if you learn the C++ fundamentals first, without UE4.
And then you can start doing Multiplayer.

eternal mantle
#

If it helps, I've made basic games in Unity and Source Engine as well.

#

All I was wondering is how networking works with blueprints

thin stratus
#

I think the only thing that helps is a wider understnding of things

#

Like, Unity and UE4 are different enough that it might harm trying to apply Unity logic to UE4

#

But yeah, if you just wish to learn networking, check the compendium

compact adder
#

What is the best way to test multiplayeer games on steam? With a friend? and do i have to package and send to him everytime i update something to send to him?

bitter oriole
#

"best" is hard to define but you can simply push a new build on Steam, ask him to restart Steam so that the update goes through, and try together

#

After packaging, yeah

#

If you don't package you have to share the entire project through source control, which would involve installing Unreal and compiling the game on his machine

chrome bay
#

Also highly recommend having more than one machine at home, make it much easier to debug and catch issues.

#

Also doesn't depend on someone else πŸ˜„

bitter oriole
#

That too

chrome bay
#

Not always practical ofc.. but uber useful

compact adder
#

Virtual machine doesnt work?

chrome bay
#

Not tried it myself

compact adder
#

So currently i have a Node to handle accepting invites that looks like this it only works with steam invites

#

i want to make a accept button on a hud

#

to accept the and join a session too

#

For example like this

#

What could i do to make that happen

granite nest
#

When i run my dedicated server and connect with a client, i get this, followed by a crash on the client. The problem is probably "no game present to join for session", but how do i host a "game" for the session?

chrome bay
#

Looks like the server isn't actually hosting a session, hard to really tell anything though tbh

#

The crash could be anything, you'll have to debug that.

#

If they join then immediately crash, the crash is likely in your gamecode. Be worth fixing those other warnings too.

granite nest
#

ait

compact adder
#

Is there anyway i can get the session im in?

chrome bay
#

You can get session info yeah, from the OSS

#

The Session Interface should have a means to get information about a given session.

compact adder
#

u know about any documentation / tutorials about it?

chrome bay
#
            if (Subsystem)
            {
                const IOnlineSessionPtr Sessions = Subsystem->GetSessionInterface();
                if (Sessions.IsValid())
                {
                    const FNamedOnlineSession* Session = Sessions->GetNamedSession(GameSessionName);
                    if (Session)
                    {
                        FString ServerName;
                        if (Session->SessionSettings.Get(SETTING_DCID, ServerName))
                        {```
#

Usually quicker to just go digging yourself, tbh

compact adder
#

Im doing it on blueprints

#

i dont have much knowledge on c++

chrome bay
#

About 95% of multiplayer is not available to BP

#

So it's unlikely, I would say. Don't really know though.

#

If you really want to get into MP, I'd strongly suggest getting at least some primitive C++ skills. Will be essential at one point or another

compact adder
#

Yea i guess i will have to do that

chrome bay
#

Maybe the advanced sessions plugin exposes some stuff, but I'm not sure. It's pretty popular IIRC

compact adder
#

Im using it

#

is this what exposes to blueprint? and can i just put the session variable there for it to expose?

chrome bay
#

Well you have to update all the callsites too

bright kraken
#

Hi, I have a question regarding passing Actor reference over RPC, what actually gets passed over the network?

How I am imagining it atm is : all actors have a network ID of sorts, the network ID gets passed over the network, and the other end do some sort of actor lookup using the network ID.

bitter oriole
#

That's exactly it

bright kraken
#

So it is not that bad to pass Actor over network?

bitter oriole
#

No it's not bad at all, if you need to do it you need to do it

bright kraken
#

Ahhh, great, thanks!

compact adder
#

Been looking for 2 hours about it but does someone know how to implement in game invites?

#

i cant get my own session result

bitter oriole
#

Which platform ?

compact adder
#

Steam

#

using advancedsessions

#

and SteamAdvancedSessions

bitter oriole
#

So what did you do yet ?

compact adder
#

Tried getting my own session by various ways

#

tried exposing Session on Create Session Advanced

#

but im not good at c++

bitter oriole
#

Did you try the "send session invite to friend" node ?

compact adder
#

Yeah but thats thru steam

#

i wanted to do a in-game invite

bitter oriole
#

What's that ?

compact adder
#

For example this appears

#

It would be perfect if there was a CreatedSession return on this node

#

But i dont know if its possible to do it by c++

bitter oriole
#

As far as I know this isn't possible with Steam

compact adder
#

Is it possible somewhere else?

#

with something else idk

#

I really needed it

bitter oriole
#

As far as I know with Steam you'll get the request through the Steam overlay, accept or decline there, and that will fire a callback

#

Not familiar with other online platforms

thin stratus
#

I know that I had that shit working ages ago for steam

#

3 years ago or so I had in game invite UI

compact adder
#

but it had something to do with SteamSDK

thin stratus
#

100% sure because I know I had a crash when creating a widget from the callback cause of game thread shit

bitter oriole
#

You can try implementing it yourself with Steamworks to check if the GameRichPresenceJoinRequested_t callback fires before you acceot

thin stratus
#

Maybe they changed that part of the API

#

You 100% need cpp for it. Don't think advanced session stuff has it implemented

#

I used the actual SDK for it, correct

#

With like STEAM_CALLBACK macro or so

#

Been too long

compact adder
#

Yeah that just seems too complicated on steam, with EOS is it possible?

bitter oriole
#

Check the EOS plugin I guess

#

Assuming you're going to change your online platform over a remote detail

compact adder
#

Yea nah not worth it but damn it would be good to not depend on steam on that

bitter oriole
#

Depending on EOS instead isn't exactly better

#

Arguably it's much worse since your users will need an EOS account while playing on Steam

thin stratus
#

I think it was this

#

And then you do something like this STEAM_CALLBACK(USomeClass, OnPartyInviteReceived, LobbyInvite_t);

#

GameLobbyJoinRequest_t is for when you accept the invite I guess

#

At least that's how it reads

compact adder
#

C++ only right?

thin stratus
#

Yeah

compact adder
#

Yea im horrible at it

thin stratus
#

Yeah that's not good when you want to make Multiplayer games

#

Blueprints only have a fraction of stuff exposed for multiplayer games

compact adder
#

Yea i think ill start a tutorial a lot of problems lately have came from not knowing c++

#

is there any steamsdk tutorials for ue4?

bitter oriole
#

I don't think there's a simple game equivalent

thin stratus
#

Afaik the Subsystem uses Steam Lobbies anyway?

#

I never had issues using those types of invites

#

To invite into games that is

north prairie
#

Hey fellas,

iΒ΄m currently trying to understand how to implement Multiplayer Gameplay for my game. Im aware that there are different ways to achieve multipalyer for a game. I decided to go with the Dedicated Server Approach (headless Server), which clients can join.

IΒ΄ve set up everything i needed, 1. Build the engine from source, 2. added new build target for Dedicated Server Build. 3. IΒ΄m able to run my packaged Server and connect to it, via Standalone Client (Game) by typing in the IP of that local server running on my machine. IM using also Advanced Session Plugin and would like to use Steam Sessions Plugin in the future. But I would like to get some things straight first.

here are my questions:

"How does one impl. dedicated Servers logic properly?"

  1. A Ded Server is hosted on a machine, and creates itΒ΄s own Session (Game Instance). Is this correct?

  2. If 1. is correct and the server makes his own session, do or can i create a Session with the advanced session plugin on my server, to let clients join by session, other than by IP adress (open leve: IP)?

  3. Whats the difference really, between Dedicated Server Hosted Games (Session) and Listen Server Hosted Games (Session)? Despite their big difference, that the Listen server Client acts as auhtoritative client (Server)...

  4. For making a Server Browser for dedicated Servers, I probably need to provide some custom Logic, to retrieve my hosted dedicated Servers right? Since, iΒ΄m not able to simply make: Find Session, and get my hosted Dedicated Servers as array back, right?

  5. Why do i get session results wiht Listen Servers Hosted Games, LAN or Internet, and not with Dedicated Server Hosted Games (also having a game session running, but probably not Advanced Session used?)?

IΒ΄ve searched for answers to this topic online and in the forum of Epic Games, but there are several threads that seem to ask the same questions. I Would like to clarify this for once and for all.

thy in advance πŸ™‚

red salmon
#

is there an event on prelogin node? (idk if this should be posted on this chat or in the blueprint chat)

bright kraken
#

Hi, I am trying to sync Inventory UI and the items in Inventory.

The flow is :
On Item added/removed to/from Inventory
Inventory's ItemList RepNotify is triggered

On ItemList RepNotify is called
Fire event to notify Inventory UI to update

however, since I can't pass any data along, the UI can't tell what Item has been added/removed from the Inventory.

So, I thought maybe I should try invoking a Multicast RPC whenever I add/remove Item from Inventory , that way I can pass data along to tell the Inventory UI what Item has been added/removed, but then I discovered another problem. When the RPC is fired and the Inventory UI received the data, the data passed along is not yet replicated on Client's end.

Is there a better approach to do this?

PS: ItemList is a TArray which contains items that have been added to the Inventory.

floral crow
#

How can I guarantee that the first replication bunch a client receives about a newly created Actor contains modifications I did during its creation?

#

For example, anything I do in BeginPlay isn't part of the first replication bunch, so the client could access incorrect data (because it doesn't contain the custom setup steps that were done in the server)

#

Which lifetime methods are safe to use with this goal in mind?

#

And how does that combo with deferred spawning?

floral crow
#

Already answered, anything modified in all of these methods but BeginPlay are guaranteed to reach the client on the first bunch

fluid summit
chrome bay
#

RPC is a bad idea

#

Any events should be driven from OnReps only

#

RPC's for Events, Properties for State

#

Follow that rule and wave goodbye to 50% of your MP bugs

bright kraken
chrome bay
#

BP or C++?

bright kraken
#

C++

chrome bay
#

You can pass the "Previous" version of a property into an OnRep, then compare it with the current, and fire off events for added and removed items

#

But to be honest, I would just rebuild the whole inventory UI on any change

bright kraken
chrome bay
#

You don't even necessarily have to destroy them

#

Just shuffle existing items around or reassign them etc.

#

You can't pass data to an On-Rep as such, but there is an automatic feature that isn't as widely known

#
    TArray<FHTG_TeamData_Dropzone> TeamData;

    UPROPERTY(BlueprintAssignable, Category = "Events")
    FOnWaveDataChanged OnWaveDataChanged;

    UFUNCTION() void OnRep_TeamData(const TArray<FHTG_TeamData_Dropzone>& PreviousData);```
#

When that OnRep is called, the "PreviousData" property will be the state of that property before the OnRep was called and the property updated

#

So you can compare current vs previous version in the OnRep, if you wanted to

#

I don't bother though.. in this specific case:

{
    OnWaveDataChanged.Broadcast();
}```
#

My UI just subscribes to that event and updates whatever it needs

#

It's a bit easier that way, the UI doesn't have to handle any intermediate states and it cuts down on delegate calls, especially dynamic ones which could be slow

#

And with good management of the UI you can avoid creating/destroying widgets each time

#

Just shuffling things around and reassigning etc.

bright kraken
#

HMMM.. okay, I shall try reusing the existing widgets, adding in missing ones and destroying extra ones and see how it goes.

#

Thanks for the help and your blog on the UObject replication! It's a big help!

light monolith
whole iron
#

SP?

empty axle
compact adder
#

someone has any idea what could this be? 😦

rich ridge
#

I want to spawn an actor only on server, it should not spawn on clients? How do I do it?

sharp kestrel
#

Off the top of my head, Gamemode is server only. Could spawn it via that and then have the actor have itself as replicated? That should mean only one is created.

rich ridge
#

GameMode is irrelevant here, if you have authority and have World context you can spawn actor from any where on server and it will spawn on all clients

#

I want to spawn server level game helper actors.

#

no clients

sharp kestrel
#

Okay so object should only spawn for server and not be replicated, is that what you're attempting?

rich ridge
#

not replecating, the actor should not spawn on client side at all

sharp kestrel
#

Could you not just set the actor itself to not replicate? When you spawn it on server then it shouldn't appear for others?

fading birch
#

correct

rich ridge
#

ohh man, how could I skip that.

fading birch
#

don't make it an actor?

#

just use an UObject

sharp kestrel
#

That's why I suggested GameMode. It is server-only, any object spawned from that with replication would appear for all clients because of said replication.

rich ridge
fading birch
#

why does it need to be in the world?

sharp kestrel
#

It might help if you tell us what this object is.

fading birch
#

^

#

and your end goal

rich ridge
#

It is a kind of player manager, which sorts the player based on distance and other stats, and it gets these info from the map.

fading birch
#

A UObject is perfect for that

#

just create a reference to it in your gamemode as a singleton

#

and boom, full access

sharp kestrel
#

Okay I'm kinda curious what mechanic would need to know player distances from its physical location but also not need to be known to clients.

fading birch
#

spawning system I would guess

rich ridge
#

for my AIs

kindred widget
#

I tend to prefer my managers being components on other major actors like GameState or GameMode. Easy access via GetGameMode/State->GetComponent, and they have access to tick if required. And are also easily replicated if necessary.

fading birch
#

You can give UObjects access to tick fairly easily

#

by hooking into the world actor tick

#

The only reason i'm saying use a UObject is that an actor has a lot of stuff you don't need if you don't need replication

rich ridge
#

but with actors its very easy to communicate with world

kindred widget
#

You can override GetWorld in UObjects and use it's outer to get world.

sharp kestrel
#

Yes? So you would have a non-replicated actor in the world spawned via the gamemode. It will only exist on server but be in the map. At least to my knowledge.

#

Unless I'm mistaken on that? You can spawn physical things via gamemode right?

fading birch
#

yes you can

kindred widget
#

You can spawn anything via anything. The spawner has no bearing. The only thing that'll matter is which machine it's on, what class it is and if it's replicated.

fading birch
#

what do you need to communicate with the world for?

#

Just pass w/e you need to the manager

#

or override GetWorld() to get it, and then you'll have access to more things.

sharp kestrel
#

Apparently they need a physical location in the world to measure distances to players? Or something.

fading birch
#

What are you trying to do. Please explain in detail

sharp kestrel
#

Anyways on a completely unrelated note before I forget why I came here.
I'm wanting to use a datatable to store all information about weapons. Plan is to use a generic weapon class and populate instances with different data to make it into different weapons rather than have different weapon classes. I'd rather the datatable stay on the server, but figure that players will need to be able to access it. What would be best place to put this, the GameState?

rich ridge
fading birch
#

player's list?

#

more detail please

rich ridge
#

the players playing, MOBA 5vs5

fading birch
#

you already have access to that

#

from the game state's player's array

sharp kestrel
rich ridge
rich ridge
#

why not use OSS, instead of coupling DB with your dedicated server.

sharp kestrel
#

OSS?

rich ridge
#

Online Sub System

sharp kestrel
#

Because I'm not sure how I would use the subsystem for this purpose. And the weapons would be unique to the map in question.

rich ridge
#

4.27 has this plugin

sharp kestrel
#

I'm not using 4.27.

rich ridge
#

why do you think if clients have weapon DB, it will cause issues?

sharp kestrel
#

Cheating.

#

Or at the very least desync.

#

If its server-side then we know all players are using the same data.

rich ridge
#

let client have db in encrypted form (server has encryption key) and server validate and decrypt the client request, if request seems to be not legitimate then discard the request. Thats the true purpose of server validate not host data.

#

if you host db at server, you first replicate data to each client everytime, it will increase you server bandwidth cost.

modern cipher
#

what do you mean man... only the server should be able to access a database

rich ridge
#

this is not the db in size of TBs

#

it will max have 300 rows

#

data tables it is a form of db

modern cipher
#

what's the point of using it if client can access it?

peak sentinel
#

I just realised ProjectileMovementComponent is not using state synch to update UpdatedComponent's velocity. What do you guys do to keep transform synchronized between client and server?

rich ridge
modern cipher
# peak sentinel I just realised ProjectileMovementComponent is not using state synch to update `...
    CollisionComp = CreateDefaultSubobject<USphereComponent>(TEXT("SphereComp"));
    CollisionComp->BodyInstance.SetCollisionProfileName("Projectile");
    CollisionComp->OnComponentHit.AddDynamic(this, &AProjectileClass::OnHit);

    ProjectileMovement = CreateDefaultSubobject<UProjectileMovementComponent>(TEXT("ProjectileComp"));
    ProjectileMovement->UpdatedComponent = CollisionComp;

the collision comp should be root for the rest of scene comps

grizzled stirrup
#

Does xbox and switch offer the same kind of p2p session system that steam does out of the box? As in calling generic session interface code is all that is needed to find games and host sessions without the need for dedicated servers?

peak sentinel
#

I realised PMC just updates velocity locally on everyone

lusty sky
#

what you mean locally on everyone?

modern cipher
#

isn't the actor replicating movement tho?

rich ridge
#

that stuff is 6 years old, and may not be valid anymore. @peak sentinel

peak sentinel
#

Thanks

peak sentinel
rich ridge
#

keep an eye on Network Prediction though

vague fractal
#

For a DataTable, what would be a example case where only the server should know about it ?

lusty sky
#

something the client don't need to know

#

XD

rich ridge
#

in 4.27 The GameFeature Editor UI is not implemented, but code is there

vague fractal
#

My problem is more like to understand what kind of data should only be on the server rather than being there for both πŸ˜…

lusty sky
#

So they made it specifically for UE5 ? it exists since 4.20 or lower

rich ridge
#

ohh my bad, there isn't any rules as such

rich ridge