#multiplayer

1 messages ยท Page 709 of 1

mystic zinc
#

Anyone able to hop in a call that understands multiplayer inventory systems well? Im working on a few prototypes to plan out my development pipeline and want another opinion on the best aproaches/practices. System needs to eventually handle upwards of 100 players interacting with a shop, plus handle world item drops and loot. Want to minimize server load as much as possible.

regal mica
#

is this what you meant? I couldnt get it to work, the montage still plays on the server only. It doesnt even show one the clients like this

unkempt tiger
#

Must a controller possess a pawn in order to move about the world and have the server correctly stream data based on relevance?

#

Or can a pawn-less controller still work somehow?

dark edge
ashen stone
peak sentinel
#

How much ping is equal to 100 netpktlag?

regal solar
#

What kind of game architecture **World Of Warcraft ** have? It actually can runs ~5000 players in one game server.

plucky prawn
regal solar
plucky prawn
#

my advise is, get your game to work with 50 or 100 players, then worry about supporting more

quasi tide
#

I'm in the camp that if you have to ask that kind of question - you're not ready to make that kind of game.

#

Start with an easier networked game.

polar lotus
#

I've been working on a multiplayer shooter for a while, and there are a lot of things that Lyra has that I want in my project

#

would it make more sense to just work on top of the lyra project or just port over the things that I want

plucky prawn
twin juniper
#

Hello, im trying to make a saving/loading system where infomation will be saved to a database. Similar to something like Rust or Ark. Can anyone point me to documentation on it? All i can find is how to make singleplayer saving systems which is not helpful at all

latent heart
#

I guess your database is a centralised server. Use the http stuff in unreal to communicate with it.

#

Everything else is very specific to your requirements.

regal mica
#

Thanks for helping!

river zephyr
#

how make multiplayer work in LYRA please somebody helpppp!

chrome bay
#

It works already?

#

Lyra is a multiplayer sample

river zephyr
#

but i cant see any other players

#

can you help @chrome bay ?

chrome bay
#

Probably not. Just press play in editor with more than one player

#

While in an actual gameplay level

river zephyr
#

so you have no idea

#

thanks anyways

vague fractal
#

Any idea how i could avoid that ? ๐Ÿ˜…

L"ValidateArraySize: Replicated arrays must be smaller than 65535 elements in size. ArraySize = (372006) Property = (/Script/ProjectMulti.ProceduralLandscape_Generator:Triangles)."
latent heart
#

Chunk your arrays into smaller pieces

#

Or procedurally generate your landscape on the client without sending over the triangles.

vague fractal
#

Thought about generating on client, just wasn't sure if that's a good idea

latent heart
#

As long as it's deterministic and you use the same base data, it should be fine?1

vague fractal
#

Wont do much damage to try it

chrome bay
# river zephyr so you have no idea

Well you haven't really asked anything specific. All you have to do is open a gameplay level, set the number of players to more than one, and press play.

river zephyr
#

i wanna play with player online through the internet with my friends

chrome bay
#

Then you need to package it up, distribute it to them, run the game and connect via IP (if Lyra supports that, I don't know if it does).

#

If it doesn't, you'll need to use an online subsystem. The easiest one is Steam. There are a tonne of guides out there to get a game connecting via Steam but there's a lot more setup involved.

river zephyr
#

but epic says that lyra is already using the epic games subsystem

river zephyr
#

great

#

but how can i play with friends online or should i try creating the dedicated server and hosting it with gamelift

grand kestrel
#

Ah nevermind, if you're at that place it wont benefit you to use that

#

I only read your previous message and not the ones prior

woeful ferry
#

If you want the landscape to be able to be edited in runtime

vague fractal
pallid mesa
#

@grand kestrel not sure to what degree you can do that ;(

pallid mesa
#

private msg?

grand kestrel
#

If you want

pulsar lotus
#

Greetings, could you tell me how to get the first PlayerController from the network?

Without the network I did this, GetWorld()->GetFirstPlayerController(), now it returns NULL to me

chrome bay
#

Only the server has access to all controllers. Clients only have their own.

#

GetFirstPlayerController will return the first logged-in player on the Server (the local player if it's a listen server), or the local player on a client.

rotund sail
#

Hi, does anyone have a good insight into replication graphs? I'm building one based on the Shooter Game (sadly, Lyra doesn't have a rep graph to use as an example), which seems to be very similar to the Fortnite one that they showed on one of their streams https://youtu.be/CDnNAAzgltw?t=2556

They mention that you shouldn't have things like weapons in the rep graph, but instead have them as dependant actors of Character. That makes complete sense. What I don't understand is, why in InitGlobalActorClassSettings do they add:
AddInfo( AShooterWeapon::StaticClass(), EClassRepNodeMapping::NotRouted); // Handled via DependantActor replication (Pawn)
when that configuration only applies to that specific class, but not any of its subclasses.

My weapon actors kept showing up in the rep graph until I figured out that the above line has nothing to do with it, and instead the Shooter Game has bNetUseOwnerRelevancy=1 in the AShooterWeapon, which is then picked up by the code:

{
    return CDO->GetIsReplicated() && (!(CDO->bAlwaysRelevant || CDO->bOnlyRelevantToOwner || CDO->bNetUseOwnerRelevancy));
};```
in the replication graph. Once I've set bNetUseOwnerRelevancy in my main weapon class, everything started working. I'm just not sure whether it's safe to get rid of the AddInfo(AShooterWeapon... line or not, because as far as I can tell, it's completely pointless

Working on a multiplayer game? Are there many players in-game together? On this livestream, our networking team will demonstrate 4.20's new Replication Graph Plugin and the server optimizations that were implemented for Fortnite Battle Royale.

NEWS

Unreal Engine Drives Monster Puppet for The Mill and Monster.com
https://www.unrealengine.com/...

โ–ถ Play video
chrome bay
#

There are different ways of doing it. The downside of DependantActor is that the children are only considered for replication when the parent is.

#

Relevancy is something different

#

It's set to NotRouted explicitly to make sure that it doesn't end up being added to a graph node accidentally, and replicating anyway.

#

Are you calling SetReplicates in the constructor? If so that will break things too

rotund sail
#

But there are no weapons that are of type AShooterWeapon - all weapons are some subclass of it. And for those, the NotRouted is never applied, because it's added to a map with a key of AShooterWeapon class, but the map is always queried with a key of the actual implementing class

chrome bay
#

Should just set bReplicates = true

#

The child classes of AShooterWeapon will share the parent classes' replication policy

#

The policy system in ShooterGame looks for a parent class policy when an actor instance added to the graph

grand kestrel
#

People who used replication graphs said they regret it but it's too ingrained in their game to remove it ๐Ÿ˜„

chrome bay
#

I do mine differently tbh, I have a special policy for dependant actors

grand kestrel
#

That scared me off

chrome bay
#

RepGraph is powerful but it only makes sense to use it if you either have a large number of replicated actors or large number of players

#

For most games, it's pointless and has no benefit

#

E.g you're making an RTS or BR game, makes total sense to use it. If it's a 10-player arena shooter or 2 player co-op game, there's no point

#

Also the actor dependency stuff will silently break if the parent actor is not routed when the child actor is. That's a fun "gotcha"

#

You can workaround it though

rotund sail
#

If bReplicates is true, then

{
    return CDO->GetIsReplicated() && (!(CDO->bAlwaysRelevant || CDO->bOnlyRelevantToOwner || CDO->bNetUseOwnerRelevancy));
};```
will always be true (unless it's also always relevant, only relevant to owner, or has netUseOwnerRelevancy
#

Which then triggers

{
    AddInfo(Class, EClassRepNodeMapping::Spatialize_Dynamic);
}```
#

Oh, hold on, I think I see what you've meant, there's a continue with extra ifs above it

chrome bay
#

ShouldSpatialize is only used for the GridNode AFAIK

rotund sail
#

Yeah, that's what I'm trying to figure out - I don't want the weapon actors in the spatial grid

chrome bay
#

I've not got a base version of ShooterGame installed but "NotRouted" should prevent it being added to any node

#

But it depends on your implementation of rep graph ofc

rotund sail
#

Yeah, the only issue was with subclasses, but I think it's probably

if (AActor* SuperCDO = Cast<AActor>(SuperClass->GetDefaultObject()))
{
    if (    SuperCDO->GetIsReplicated() == ActorCDO->GetIsReplicated() 
        &&    SuperCDO->bAlwaysRelevant == ActorCDO->bAlwaysRelevant
        &&    SuperCDO->bOnlyRelevantToOwner == ActorCDO->bOnlyRelevantToOwner
        &&    SuperCDO->bNetUseOwnerRelevancy == ActorCDO->bNetUseOwnerRelevancy
        )
    {
        continue;
    }```
chrome bay
#

Yeah you don't need to worry about that

#

The PolicyMap only contains the base classes until it detects a change between children and parents, then it stores the policy for that class

#

The other problem with it is that it only picks up loaded UClasses at initialization time

#

So it's best not to set any of those properties in BP's

rotund sail
#

Yup, hence the above code - it was not triggering, which probably means that one of these four is set differently in the subclass for some reason

#

Oh, I see

chrome bay
#

From what I remember, InitGlobalActorClassSettings() looks at all loaded UClasses and based on their settings creates the policy for them (unless explicitly added first)

#

Then RouteAddNetworkActorToNodes() looks for a policy for that class, and routes it to the nodes according to that policy

#

NotRouted should just not add it to any nodes AFAIK

#

Then if you want to replicate a non-routed actor via a dependency, the game-code has to notify repgraph to add/remove the dependency, will will then mean it replicates with the parent.

#

I've approached it slightly different, I have custom policies called "DependantOnOwner" which automatically adds/removes the owner dependencies

rotund sail
#

Yup, that part I have already up and working - the only issue I was getting was that the actors were still being added to the spatial grid. Setting the bNetUseOwnerRelevancy=1 worked like a charm, but now I'm looking into what you've said to implement it correctly

chrome bay
#

yeah that's odd, maybe RouteAddNetworkActorToNodes() is still adding it to the grid node

#

Mine just looks like this:

{
    const EHT_ClassReplicationPolicy RepPolicy = GetClassReplicationPolicy(ActorInfo.Class);
    switch (RepPolicy)
    {
        case EHT_ClassReplicationPolicy::CRP_NotRouted:
            break;````
#

With the spatialized policies below:

            GridNode->AddActor_Static(ActorInfo, GlobalInfo);
            break;
        case EHT_ClassReplicationPolicy::CRP_SpatializeDynamic:
            GridNode->AddActor_Dynamic(ActorInfo, GlobalInfo);
            break;
        case EHT_ClassReplicationPolicy::CRP_SpatializeDormant:
            GridNode->AddActor_Dormancy(ActorInfo, GlobalInfo);
            break;
        default:
            break;```
rotund sail
#

That looks more or less the same as the Shooter Game's, just slightly different names

chrome bay
#

yeah

#

the main thing is it shouldn't be being added to any nodes if the returned policy is "NotRouted", so I'd start there

#

But tbh UseOwnerRelevancy is probably fine too

rotund sail
#

Yeah, and I think it's

        if (AActor* SuperCDO = Cast<AActor>(SuperClass->GetDefaultObject()))
        {
            if (    SuperCDO->GetIsReplicated() == ActorCDO->GetIsReplicated() 
                &&    SuperCDO->bAlwaysRelevant == ActorCDO->bAlwaysRelevant
                &&    SuperCDO->bOnlyRelevantToOwner == ActorCDO->bOnlyRelevantToOwner
                &&    SuperCDO->bNetUseOwnerRelevancy == ActorCDO->bNetUseOwnerRelevancy
                )
            {
                continue;
            }```
that should ensure that the subclasses are not added to the policy - the continue will ensure that the code that *does* add them doesn't trigger. So it's probably an issue with the subclasses having different one of the settings from the parent class in that huge if
#

Basically a "if the child's behavior is the same as parent's, don't add its own policy". It somewhat lacks transparency, because the purpose of this is to keep the graph lean, but they are also piggybacking the concept of setting explicit rules for a class and it propagating to all its subclasses

chrome bay
#

yeah that's essentially it

rotund sail
#

Heh, yup, I'm just an idiot. My main c++ class didn't set bReplicates - the main blueprint child has it set, which then propagated to all weapon implementations

polar lotus
rotund sail
#

Adding it to the class made it work. Thanks for the help ๐Ÿ˜„

polar lotus
pallid mesa
#

I'm saving that conversation you guys just had about the rep graph there isn't much information out there

#

defo using it to learn

rotund sail
#

Sadly, there isn't. Even sadder that Lyra doesn't have one. The youtube link I've posted is pretty good, but it's also a little bit like drinking from a firehose

chrome bay
#

yeah once you get your head around SG's implementation it's fairly straightforward but there are the occasional gotchas

rotund sail
#

Yup!

chrome bay
#

But I do stress it's totally pointless unless you're dealing with networking at some kind of scale

rotund sail
#

And apart from the dependant actors, it pretty much works out of the box

chrome bay
#

yeah

pallid mesa
#

itsn't the rep graph something you require to add in early phases on the project

chrome bay
#

you don't have to tbh

pallid mesa
#

rather than in late phases?

chrome bay
#

But if you have actors that have very specifically relevancy settings, again it's not worth it

#

The point of rep graph is to reduce the checks, assuming you can batch lots of actors together

rotund sail
#

Yeah, it doesn't matter too much when you add it. It might actually be better to add it later on when you know what specific needs which of your actors has - otherwise, when you create a new type of actor that isn't covered by the definitions you have already put in, you will have to remember to add it to rep graph

chrome bay
#

you can still do it ofc but it's just more hoops to jump through

#

Yeah

pallid mesa
#

yeah that's essentially what I am asking, what if in late phases of the development you realise that it could have been convenient... can you just patch it in?

chrome bay
#

Totally

pallid mesa
#

ah oki!

#

thank you

chrome bay
#

it's not like making a singleplayer game then adding multiplayer afterwards if that's what you mean ๐Ÿ˜„

pallid mesa
#

nono of course not ๐Ÿคฃ

rotund sail
#

Yup - and if you don't bother with the dependant actors, patching it in is actually a breeze. Just copy it from Shooter Game and add your custom actors and how they should behave to InitGlobalActorClassSettings

peak sentinel
#

I'm trying to apply damage impulse to characters after they get hit from a bullet, but if player shoots a character with a frequently firing weapon it looks so wacky due to latency. I'm wondering if anyone has a clever idea for that?

pallid mesa
#

so specific relevancy rules should all be implemented in isnetrelevantfor? the repgraph enabled better policies and control than just the traditional isnetrelevantfor right?

peak sentinel
chrome bay
#

so if you had special rules, you'd have to implement them in your nodes

pallid mesa
#

ah!! oki so it'd be a matter to migrate my relevancy logic to these nodes

#

that sounds "fun" haha

chrome bay
#

yeah. But you can also leave the old logic there and just hotswap between using repgraph or the normal driver

#

So it's quite easy to switch over without breaking anything too

pallid mesa
#

hey, is that documented somewhere?

chrome bay
#

Just change the driver class in your config file then relaunch

#

Easy as that to turn it on and off

pallid mesa
#

wow that's pretty convenient until you get the thing to work 100%

#

that's great, thank you

chrome bay
#

ShooterGame is a pretty solid starting point though tbh

#

To get an idea of what it's trying to do

pallid mesa
#

yes im mostly interested in the gridding features shipping with the rep-graph

rotund sail
#

Also, one thing I've noticed in the BasicReplicationGraph is:

    GridNode->CellSize = 10000.f;
    GridNode->SpatialBias = FVector2D(-WORLD_MAX, -WORLD_MAX);```
which I think could potentially be dangerous with large world coordinates? If I understand it correctly, the grid is basically an array of arrays, with indeces being coordinates divided by cell size. With old world sizes, the grid cell [0][0] would be for coordinates -20km,-20km, and when you spawned an actor on coordinates 0,0, that would be grid cell [200][200]

But with large world coordinates, grid cell [0][0] would be for coordinates -87960930km,-87960930km, which means that actor spawned at the 0,0 coordinates would suddenly make the grid allocate a crapton of memory to get a grid cell[879609300][879609300]
pallid mesa
#

I wanted to see how much I could customize it

chrome bay
#

Yeah I'm trying to remember what the purpose of that is.. we've actually edited it for our game so that it moves the bias point based on the layout of the map you're playing on

#

Need to dig into the specialization node a bit more

rotund sail
#

I mean, you could also place an actor at the lowest X and Y coordinate of your map and not set the bias at all - letting it default to 0, and once it does the first pass, it will adjust bias based on the actor with lowest coords

chrome bay
#

yeah that would also work

#

I think that is basically the point of it, to be the point at which the cells start to "spread out" from

#

But I do wonder if there's a max cell count to avoid it going beserk

#

But then LWC and multiplayer doesn't seem overly well thought-out so far..

rotund sail
#

But considering that the BasicReplicationGraph is being sold as an quick and easy way to have spatiazation, it might be dangerous for whoever starts using it ๐Ÿ˜„

#

And yeah, that's what the bias is - I've spent a lot of time digging through the guts of the system to figure out wtf it means, because there's zero documentation ๐Ÿ˜„

#

I doubt that realistically you would run into issues with how much memory the grid eats if it only spans the actual playable area. The problem is that the BasicReplicationGraph implementation makes it span the entire universe ๐Ÿ˜„

#

I mean, even if your game had the entire solar system to scale, that's still 1/20 of the size of that grid

unborn nimbus
#

Are RPCs automatically virtual?

chrome bay
#

If you don't declare the _Implementation etc. body yourself then yes

trail hill
#

I'm currently switching from Dedicated servers to a listen server

#

Does the "host" have both a client and a listen server instance

#

Or is the "Host" just a listen server

#

So if I host a game do I have one game instance with "NM_ListenServer" and one with "NM_Client" Or is it one instance of "NM_ListenServer" only?

vague fractal
#

The client is the server

regal mica
#

I havent done anything special except enabling "block all" on the player pawn and projectile collision sphere

ripe moth
#

was 2 hours 45 minutes for a full build of 5.0.1 last night 4>Total execution time: 10250.95 seconds on an i7 7700k @ 5ghz and 32gb ram...

livid sluice
#

What's the best method to switch maps in multiplayer, when I use open level. the players don't join the same instance for some reason.

livid sluice
#

Thanks

somber estuary
#

Hi Folks,
Trying to get some work done on a steam multiplayer game, but when creating a lobby and transitioning to a lobby map using the listen command in UE5, all I'm getting is a black screen with touch controls.
If I take out the listen command the map loads with the widget as expected.
The issue I have here is that AFAIK I need to use the listen command in order for the lobby the player creates, to show up in the lobby finder.
Has anyone else experienced this issue at all or know how to fix it?
Using UE5 with Steam subsystem

nocturne iron
#
// Server_MakeMode, called from server
LogTemp: Warning: AChessPlayerController::Server_MakeMove_Implementation(1), HasAuthority: true
LogTemp: Warning: AChessPlayerController::Multicast_MakeMove_Implementation(1), HasAuthority: true // Log from server
LogTemp: Warning: AChessPlayerController::Multicast_MakeMove_Implementation(1), HasAuthority: false // Log from client

// Server_MakeMove, called from client
LogTemp: Warning: AChessPlayerController::Server_MakeMove_Implementation(0), HasAuthority: true
LogTemp: Warning: AChessPlayerController::Multicast_MakeMove_Implementation(0), HasAuthority: true
// Why no log from client?
#

This is all happening on the player controller.

#

But that should not really matter since it's called though a ServerRPC.

#

Wait, this might not be a Networking problem... I just realized that player controllers only exist on local client.

knotty mason
#

hey everybody, how can i replicate Actor::AddImpulse --- for some reason simply putting it into NetMulticast, Server, Reliable, WithValidation function does not allow client to add impulse by calling that wrapper serfer-function, only server can add impulse to actors

knotty mason
regal mica
obsidian gyro
#

Is there a reason for my server increasing a float faster than my client?

#

this is what is running(on the client)

#

the float showing in the first screenshot is Max Walk Speed

rapid bronze
#

That's a recipe for disaster

#

Let the server tell the value to the client

#

There's a run on owning client for a reason

mellow stag
#

I'm trying to setup Proximity Voice Chat, the voice chat works but it's global and not proximity, what could I be doing wrong?

obsidian gyro
#

this is with run on owning client

rapid bronze
#

You gotta pass the value to the client from server through the function

obsidian gyro
rapid bronze
#

Cause it will set on owning client too with the same exact value if that's what you want, while leaving the auth of the value to the server

obsidian gyro
#

Im not sure if that is what im looking for, my problem is that each player has a dynamic movement value that determines the walk speed, but the clients speed changes at a different rate than the server thinks it is, which causes it to desync and rubber band

obsidian gyro
#

the 'server' is just another player

#

I apologize for my lack of expertise

rapid bronze
#

You need to do it through RPCs to keep in proper sync

You can't just randomly connect in different places and expect the same result

#

If you want the server to set a value and let the client know locally too but not the other players about your local change

Server -> Set Value -> Owning Client (Set Value ref) -> Set Value (With server Set Value)

obsidian gyro
#

so I send the initial values from the client to the server, do the math on the server for every player, then send the final float back?

rapid bronze
#

That would mean it's client authoritative to a degree

#

Which is not something you want

#

Unless some degree of prediction where the server corrects

#

And validates

obsidian gyro
#

so the server does all the math, all the time?

rapid bronze
#

Do you trust clients to do the math for the sever?

obsidian gyro
#

no

rapid bronze
#

Then there's your answer

obsidian gyro
#

kk

#

but im just confused on how to make the server run it for every player

rapid bronze
#

Idk your current setup and what you exactly are trying to do

obsidian gyro
#

each player has script to adjust the walk speed depending on the buttons they are pressing, and the time they are in the air, this walk speed is what is what the problem is.

#

I now know that I need to have the server find each players walk speed

#

Could I use a for each loop for all the players and calculate it there?

rapid bronze
#

Just ask yourself what changes the walk speed and you should have a method in the character to change the speed

#

For example if it's a button in the world, the button can get who pressed it and call the set speed function on it

obsidian gyro
#

I think I get it now

rapid bronze
#

Then each instance can handle their own calculations and states?

obsidian gyro
#

yes

rapid bronze
#

There we go

obsidian gyro
#

thanks, you explain it very well

obsidian gyro
rapid bronze
#

Yes

rapid bronze
#

Only time you would want the client to send something to the server is for inputs

#

Ofc not always but yeah, generelly

obsidian gyro
#

so far, it works

#

all except for one thing

#

when it comes to deaccelerating it gets really laggy

#

Since accelerating works, i think the problem comes from somewhere else

rapid bronze
#

Is that another function / event?

obsidian gyro
#

no

#

All in the same event

rapid bronze
#

Then probs something you doing when deacc

obsidian gyro
#

I fixed it

#

I just missclicked something

#

wait nvm

#

So would I ahve this event use Run On Server or Run On Owning Client?

#

I would assume run on server

rapid bronze
#

RoS then Client if you wanna sync the value to the client (self)

obsidian gyro
#

so, Both?

rapid bronze
#

Yes, but use the returning value of the server to set the client

#

Pass it through the function

#

And Set the same variable again

obsidian gyro
#

So when I set the variable, I set it with run on owning client, but all the math is handled by the server?

#

like this?

dark edge
#

@obsidian gyroWhat exactly are you trying to do? This sounds super fucky.

obsidian gyro
#

Change the players walk speed dynamically,

#

its not sketchy, its just I dont know how to do it

dark edge
#

K so to do that perfectly smoothly you'll have to do it in C++. What's that got to do with acceleration though, are you trying to do a max acceleration by just slowly changing the max walk speed?

obsidian gyro
#

yes

dark edge
#

The CMC already has acceleration parameters.

#

Something like this might work in singleplayer but in multiplayer you're barking up the wrong tree.

obsidian gyro
#

alright

obsidian gyro
#

it works flawlessly

#

thanks to u

#

โค๏ธ

rapid bronze
#

Nice!

vague fractal
#

Is it somehow possible to let the client only fully join after he got all the data from the server ?
Like in my case the server is spawning 8k trees 8k stones and similar.
Currently the client will join and see how tree after tree pops up for him

chrome bay
#

They have to join before they can receive anything

bitter oriole
#

Don't replicate that

chrome bay
#

Just show a loading screen

#

But yeah also, 8K replicated actors? GLHF

vague fractal
bitter oriole
#

If you're literally spawning thousands of things, replicate the seed and spawn it locally

chrome bay
vague fractal
chrome bay
#

Doesn't matter

#

You can still spawn them procedurally, they just have to be stably named

#

You absolutely cannot replicate that many actors and expect it to work well, or scale even

bitter oriole
#

Rule of thumb if you have more than a hundred or so replicating actors.... you have issues

chrome bay
#

Sorry for tag but @winged badger has some insight on this btw

winged badger
#

even if you spawn them separately, you don't want to have those trees replicated, 8k actors is a lot

vague fractal
#

Isn't that kinda covered by their relevancy ?

winged badger
#

but, if the server and clients were to spawn 8k trees using the same algorithm, and same seed, while at the same time using FActorSpawnParamaters to inject the deterministic name for each of those trees at the time of spawning them

#

you can override the IsFullNameSupportedForNetworking on your tree Actors

#

and that gives you trees which are NetAddressable

#

if you also spawn them with bNetStartupActor and bNetLoad on client = true

#

they will be treated as if they were loaded from the level - they will have a static NetGUID

#

which is a massive plus, as non relavant Actors are despawned, and you really do not want 200 trees respawning because they became relevant just because you took a step to the left

vague fractal
winged badger
#

everything procedural needs to run off the same seed, and it needs to be deterministic

chrome bay
#

Also assuming whether a tree is alive/dead or not is it's only replicated property, it makes much more sense not to replicate them all individually, and replicate their state in a single global actor. You can just sequentially pack the state into bitmasks. We do something similar for our resource system like this:

TArray<uint64> PickedMasks;
UFUNCTION() void OnRep_PickedMasks(const TArray<uint64>& PreviousValue);```
Since all the resources are generated procedurally from a seed, they all get a deterministic ID.
winged badger
#

server then just needs to replicate the seed and maybe couple extra level generation parameters

#

i took Jambax's concept a step further, so my single global actor is packed with fastarrays

#

if a non replicated actor gets damaged, it updates its data on that network managers fastarray responsible for replicating destruction/damage

#

and then it gets propagated to clients

#

without the actor itself having to be replicated

chrome bay
#

Yeah makes much more sense to do it that way, also you don't have trees popping in/out all the time ๐Ÿ˜„

winged badger
#

only minor downside to the approach is that you also need a separate fastarray to habdle what ULevels ReplicatedStaticActorDestructionInfo would do

#

to replicate what actors have been fully DestroyActor()ed for late joiners

winged badger
#

and updating a fastarrayitem works better then the push model too

#

it is also not too much work - took me 2 days to get this fully working from scratch

vague fractal
#

That's for sure enough text to make me busy studying it for a while.
So thanks for all the in-depth information :D

winged badger
#

the idea for splitting fastarrays is that each would correspond to replicating what one interface covers

#

i have one that is customized for my interaction interface, other one for destructible interface

#

got one for tags, one for buffs

#

and FFastArrayItem structs basically have a UPROPERTY() TWeakObjectPtr<AActor> for the Actor they are replicating properties for

#

timestamp and payload

pallid mesa
#

so this manager spawns the trees in client and server using the same seed and registers them in a tarray, if a player gets to interact with the tree, player sends an event to the manager, right?

winged badger
#

no

#

the plugin spawns an entire level from seed and a couple of tags

#

all Actors spawned this way share the same base, which contains logic to interact with NetworkManagers and PostSpawnedFromPrefab

#

after it spawns each Actor it calls the PostSpawned function

#

at this point those Actors find their closest NetworkManager and register with it, usually turning off their replication in the process

#

very few exceptions where they don't turn replication off in case actor needs to send RPCs

#

even when they are still replicated, i still send updated via NetworkManagers, as they are more reliable and responsive

pallid mesa
#

by closest net manager you mean by distance? so i assume you can do relevancy with these?

winged badger
#

by distance yes

#

can have 6000 or so Actors replicating in this way on larger levels

#

so they will typically have more then 1 NM

pallid mesa
#

right right the only thing I don't get is who is the responsible to spawn the trees in the client, which component, the plugin aswell? different code path or there is an initial replication implied?

winged badger
#

in RS2

#

client sends RPC to confirm the generation data

#

when it receives a RPC back

#

it runs a deterministic algorithm which determines which prefabs must spawn - ones supporting a selected primary mission for example

#

that results in a list of prefabs that have to spawn in deterministic order

#

then that is stashed in an ActorComponent on a MissionSetupActor (persists through seamless travel)

#

component being part of the prefab plugin here, so it can read it

#

then the prefabricator takes over

#

and starts spawning

pallid mesa
#

aham interesting, when you say client in the initial steps you mean the PC?

winged badger
#

PostNetInit in PC i think

pallid mesa
#

so client joins, server goes like: hey, here's your seed, use it.
client -> ok!! take it prefrabricator do your stuff!
prefab -> sure! :D

winged badger
#

note that nobody can call BeginPlay before all clients finished procedural generation

#

and no playerpawn spawns for someone who is still spawning

#

we ran into some weird engine replication bug

#

first version didn't have RPCs there, it was all passed by the MissionSetupActor in the lobby

#

still does, but very rarely, it doesn't trigger replication callbacks

#

as we know exactly what assets we need in the lobby, we also preload them

pallid mesa
#

interesting, and then interactions and whatnot server authorative, as always, and you simply update your arrays, and they'll replicate so you can update the client version of the tree without the need of it being replicated

winged badger
#

yes

#

PostReplicatedChange just calls a function on the Actor that the struct has a weak pointer to

pallid mesa
#

and automagically you use the name to detect the actor that needs to change

#

bravo!

winged badger
#

name, no, pointer is to that actor

#

name is just there for initial NetGUID assignment

#

so we can replicate pointers, instead of Names

pallid mesa
#

ah perfect!!

#

so yeah once the NetGUID is setup we can go through the pointer route

#

okay good good, nice

#

and just out of curiosity, do you follow any specific technique to generate these deterministic names?

#

or just the order of spawning works?

winged badger
#

order is deterministic, so yes

#

they have a prefix

#

and an ActorTag, if they are inside a prefab

#

IsFullNameSupportedForNetworking returns true if they have that tag

#

so the Actor can be used elsewhere, with vanilla replication if need be

#

as all of those Actors would still replicate if one were to delete all NetworkManagers from the level

#

its just performance would be... not great

indigo nacelle
#

Anyone know how to mirror a transform / rotation across a plane?

#

This code doesn't seem to do it

indigo nacelle
#

This code seemed to work good enough

winged badger
#

you have a function that does that out of the box

#

but its basically a Vector - 2* Vector DOT PlaneNormal

#

in your case, both vectors going outwards from plane, you would need to multiply it by -1 as well

pulsar maple
#

I've got a CharacterMovementComponent question. I have a custom movement mode whose implementation of PhysCustom is copied straight from PhysFlying. However, if I play a networked montage (via an AbilityTask), I get a bunch of network corrections when it's in my custom mode, but no issues in any of the built-in modes.
I've made sure that the movement mode change is being replicated. Is there some other thing I'm missing in order to make this movement mode work? I know I've gotten this working before but I'm a bit rusty.

heady geyser
#

I'm getting the following error when loading the editor:
LogAssetManager: Display: Ignoring PrimaryAssetType Building - Conflicts with BP_BuildingType_C - Asset: DA_House
DA_House is a data asset that derives from BP_BuildingType which derives from PrimaryDataAsset - does anyone know what this error message means?

for the server the asset still appears to load correctly and can be referenced in the world, but for the client it always appears as null until I open it, change some field and save it again, at which point it starts working

willow prism
#

Hello, I have a problem with a bot that follows a path that is defined by an array of actor points. I receive this message, but only on the client, on the server it does not show this problem
LogScript: Warning: Script Msg: Divide by zero: Divide_VectorFloat
It also happens only with the bots that spawn because the bots that are from the beginning of the level do not give this problem

#

outside of the message, the bot completes the entire journey without problems.

still path
#

Anyone ever run into replicated actors spawning at different sizes? (my projectiles like to spawn at like 10 times their normal size for clients)

willow prism
ember dagger
#

Set your player count before you start seamless travel, inside game instance. Then in your game mode you can do event on post login and add the controllers to an array and just check the length of the array and make sure it equals the player count in the game instance. Then do whatever start functionality you would like after that

ember dagger
still path
blazing spruce
#

Hi, im creating a loading screen widget stored in the Game Instance from the Pre Lobby's Player Controller when a GameStarted bool is set to true which is stored in the Game State, GameStarted is set to true from the host's start button, players then seamlessly travel over to the map and new GM/PC ect.. are created, when I then try to remove the loading screen from parent from the new player controller it only seems to remove from the client and not the server, any ideas on how I can get this to replicate properly?

magic helm
#

Hey quick multiplayer question... are you able to do multiple conditions for DOREPLIFETIME_WITH_PARAMS? Wanted to do initial + simulated only...
Thought I've seen it before but can't remember...

solar stirrup
#

Sec

#

Nevermind, not what you want to do thonk

#

Replication conditions aren't a bitmask, you cannot mix and match them

magic helm
#

Dang...

#

Yeah that would be nice if it was...

solar stirrup
#

What exactly are you trying to do?

magic helm
#

Literally just only replicate a value to the simulated proxy as the initial bunch, thought I could get away with it by using the replication conditions

#

Out of the two I would probably pick initial, then just add an if check for simulated proxy.. oh well

solar stirrup
#

So like, only replicate the initial value to simulated actors?

magic helm
#

Yup, obviously the server will have the original but the server isn't really going to make use of it

solar stirrup
#

I'd just go with COND_Simulated and an OnRep with the previous value

magic helm
#

Well there is no previous value its when I'm spawning an actor

#

Thus the initial part...

pallid mesa
#

COND_Simulated and dormant once you've replicated your stuff ๐Ÿ˜ด

solar stirrup
#
// COND_SimulatedOnly
UPROPERTY(ReplicatedUsing = "OnRep_MyValue")
int32 MyValue;

bool bReceivedInitialValue = false;

UFUNCTION()
void OnRep_MyValue(int32 PreviousValue);

void AMyActor::OnRep_MyValue(int32 PreviousValue)
{
  if (bReceivedInitialValue)
  {
    MyValue = PreviousValue;
    return;
  }

  bReceivedInitialValue = true;
  // do stuff
}
solar stirrup
magic helm
#

Thanks @pallid mesa and @solar stirrup ๐Ÿ˜„

solar stirrup
#

o7

pallid mesa
#

o7

solar stirrup
#

hehe

pallid mesa
#

๐Ÿ˜‚ no way we went both for the salute

solar stirrup
#

great minds think alike smug

light iron
#

Any idea why a Montage for HitReact would play on server, be seen by the client getting hit, but not play locally on the attacking player?

fathom aspen
light iron
winged badger
stoic dagger
#

Hi guys, I am having an issue with some server client architecture. I am currently trying to replicate blueprints that change the scale of existing actors in my game. For whatever reason I still collide with the actors as if their size has been changed on the client, yet I cannot see that any rescaling has happened. On the server everything works fine. Thoughts?

pulsar maple
regal solar
#

**multiplayscape **vs eeldev, which one is the best?

austere charm
#

hi

#

how tomodding fortnite

nocturne iron
#

Hi, how are replicated actors normally handled in world space, I want to place an actor in the world that both players can interact with, but I am unable to call RPCs when it has no owner.

woeful ferry
shell leaf
#

I'm trying to change my project from ue4.27 to 5.0 but keep getting errors (new errors every time I try to re-compile.
Every #include "Net/UnrealNetwork.h" I have changed to #include "Online/CoreOnline.h" which made the majority of errors disappear.
Any have any idea how to fix?

compact talon
#

Making a multiplayer game and I am confused on the difference between levels and maps.

From what I understand the playercontroller is made upon hosting or joining a session. The playercontroller then persists through different levels and maps. So it is a good place to store the UI and variables that need to persist such as player username or player skin (player can change their appearance).

What I don't understand though is apparently changing levels or maps breaks multiplayer and you need to rehost or rejoin.

Isn't there a way to transfer players from the lobby level/map into the actual game level/map without breaking multiplayer?

#

I am making a party game that has a bunch of minigames (similar to crab game)

#

however you cannot join mid-game, only at the lobby so I dont need to worry about handling players joining mid game

shell leaf
#

@compact talon The game instance should be used when you want to carry variables between levels. Each player has their own game instance which is created when they load the game and doesn't get destroyed until the game is closed. The player controller shouldnt really be used for this

#

Look into seamless travel ๐Ÿ™‚

compact talon
#

Oh I see, does the game instance persist through servers too so its perfect for UI and settings like skins?

shell leaf
#

what do you mean by persists through servers?

#

Do you mean does it persist upon changing levels? Or do you mean does the server has access to the game instances?

compact talon
#

I'm sorry I am new and I am unfamiliar with how UE works. I don't know what the different "objects" are like player controller, maps and levels.

My understanding is when you join a server or host a server a lot of stuff "reset" and you get a new player controller. Would I get a new game instance or would the game instance change when joining a server?

shell leaf
#

ahh no worries, I'm pretty new too. Basically when you travel to a new level (if you join someones game for example) you will be assigned a new player controller. This means anything that was set to your previous player controller (the controller in the main menu for example) will be destroyed. However the game instance is persistent no matter what. In my game for example, players can choose which character they wish to play in the lobby, and this information is stored in each player's game instance. When the host starts the match and all players travel to the play area, the player character they selected is grabbed from each players game instance and is set in their new player controller

#

So basically, the game instance persists no matter what

#

No player can access any other players game instance apart from the server

#

Like I said, I'm pretty new too so im not 100%, but i'm pretty sure. It's worked for me so far

compact talon
#

ah that is very helpful. Game instance sounds perfect for me then. I also have a couple questions about maps/levels.

I am making a party game with a bunch of minigames, and these minigames have multiple maps to choose from.

These are chosen at random when the host clicks "start game" from the lobby area.

For these minigames and the maps on them I was going to make each minigame its own level, and make each map its own map.

However this seems to be the wrong way to do it, and whenever you join a new level it disconnects you from the server and puts you on your own "local" level.

Do you know anything about that?

shell leaf
#

from my understanding maps and levels are the same thing. If I was to make a feature like this. I would create multiple different maps (or levels) each with their own game mode. When the host presses 'start game' I would select a map from random and travel to this new map with all clients

compact talon
#

Interesting, I noticed the gamemode objects but didn't fully understand it. My brain sees gamemode and assumes stuff like "deathmatch" or "team deathmatch" etc. So perhaps I could store the actual games in those and load the map with the gamemode I want for it? As some maps will allow more than 1 gamemode (for example the beach map can have hide and seek and tag)

shell leaf
#

Thats correct, the gamemode is stuff like deathmatch and capture the flag etc. I'm not 100%, but I'm sure you could load a level and then change the game mode

#

which would allow different game modes for the same map

compact talon
#

Thats interesting. Perhaps I can load it the other way where I load the gamemode and within the gamemode it chooses a random map to open. Unless you cannot open gamemode first and it has to be map/level

shell leaf
#

I dont think you can open the gamemode first

#

If you wanted capture the flag on map A and deathmatch on Map A. I would create copies of the map and assign level the "capture the flag" game mode and the other "deathmatch" game mode

#

this can be found in world settings

#

on each map

compact talon
#

I see, I wanted to avoid making copies because that means if I want to change the terrain for Map A it wouldnt automatically change for the other gamemode

shell leaf
#

A gamemode has nothing to do with the actual map

compact talon
#

Yes, but you said create copies of the map

shell leaf
#

Yes you can create copies, but assign each copy a different gamemode

compact talon
#

so MapA made for deathmatch and MapA made for CTF, if I changed the CTF map I would have to manually change the deathmatch version

#

Unless I made BeachMap and made the gamemode variants a child so they inherited the changes? If thats possible

shell leaf
#

Ye that sounds like it would work too

compact talon
#

alright, thanks for helping me out. I will lookup seamless travel for the multiplayer section. Might want to repost cus all this has covered your question xd.

Thanks again

shell leaf
#

No worries, if you need anything else feel free to drop me a dm ๐Ÿ™‚

blazing spruce
# winged badger or you manage to splatter two instances of the widget up client side and are rem...

@fathom aspen interesting.. so ive tried a few different ways of creating the widget and tried different RPCs to get it to work but this is how im creating it on the Pre Lobby Player Controller, then to remove it I've got it on the begin play of the new player controller after a 7.5 second delay (for textures to load) it calls to the Game Instance and calls a remove loading screen event, ive tried making these run on client/server is different ways but keeps just removing from client not the server

#

Should i be creating the widgets in a different way?

winged badger
winged badger
#

there is a PreClientTravel function in the PC that gets called in order to clean up whatever needs to be gone from previous level, and also get up loading screens

#

you will need c++ i think, but just a few lines to make use of it

#
// in .h
virtual void PreClientTravel(const FString& PendingURL, ETravelType TravelType, bool bIsSeamlessTravel) override;

UFUNCTION(BlueprintImplementableEvent, Meta = (DisplayName = "PreClientTravel")
void K2_PreClientTravel(const FString& PendingURL, ETravelType TravelType, bool bIsSeamlessTravel);

// in.cpp
void AWhateverYourBasePCClassiIsCalled::PreClientTravel(const FString& PendingURL, ETravelType TravelType, bool bIsSeamlessTravel)
{
  Super::PreClientTravel(PendingURL, TravelType, bIsSeamlessTravel);
  K2_PreClientTravel(PendingURL, TravelType, bIsSeamlessTravel);
}```
#

that would hook up a blueprint event that gets called in the PlayerController prior to clients starting any travel

#

epic didn't take this into account so might need this on K2 signature instead

#

void K2_PreClientTravel(const FString& PendingURL, TEnumAsByte<ETravelType> TravelType, bool bIsSeamlessTravel); in order for blueprints to be able to process that enum parameter

#

(ETravelType is not exposed to blueprints)

#

and Tick-Delays is trully terrible, never do that ๐Ÿ˜„

arctic hazel
#

Are you able to handle a Multiplayer inventory with a map for item name > item id, or do have to make a construct table for multiplayer?

#

asking ahead of time so don't code map entire way thru to regret it

latent heart
#

Do maps even replicate yet?

arctic hazel
#

the maps itself cant be replicated

#

but thinking if can replicate the fetch of the DT

arctic hazel
#

yeah dont think thats gonna work, got replicated for interact, and destroy actor but cant add it to inventory over maps lol

#

so ig gotta change the map to a structure

peak sentinel
#

(also bad)

dark edge
#

So what exactly is the problem with replicating maps? Like what would be so hard about it?

fathom aspen
dark edge
bitter oriole
#

They're just a bit more complicated and if you're replicating a map you're probably replicating something a bit too large

compact talon
#

Can I create multiplayer with sessions using BP or should I be using C++? Most of the posts I find online explain how the BP sessions are very limited in what they can do compared to C++

dark edge
compact talon
#

I see, there are tons of guides on it. Do you know a good one in particular? I don't mind pure C++ implementations

dark edge
compact talon
#

tyvm

silk shore
#

I'm trying to make my own character movement component to get root motion animations synced correctly. I've a float "ForwardSpeed" and "SideSpeed" added to the character component and made two functions for each (e.g. SetForwardSpeed and Server_SetForwardSpeed) and then I'm calling SetForwardSpeed from the client which updates ForwardSpeed and calls Server_SetForwardSpeed. Server_SetForwardSpeed currently just sets ForwardSpeed to the new speed. This seems to work fine from client -> server and I can at least see the position and rotation replicated to the other client however it seems like it's not replicating my two floats to the clients. Am I at least on the right track and just need to multicast the floats to the other clients or am I missing something fundamentally here?

arctic hazel
#

Well i got my inventory working now and drinking system, So i'm gucci passed that entire "map" struggle, Next up is to learn how to make shopkeeper ugh

dark edge
dusky yoke
#

Hey guys, do you know how to store a live/global variable from every session, i.e a player from every session in the game? Would use this to track contribution of a material to unlock a new area ๐Ÿ™‚

plucky prawn
#

hey bros im still a bit confused about sending actors over RPC. if i have void Foo(AActor* myActor) (say if im accessing a storage chest in my game which i do not own), does that actor have to be as Replicates/bReplicates = true? if it doesnt have any fields marked as replicated does it still work?

fair lantern
#

quick question, i'm really new to replication n stuff n unreal engine in general

#

i'm updating a rotator variable in character blueprints and then feeding into the anim graph to drive an animation but the client can only see the servers new animation but the server cant see the clients new one

#

im confused :/

plucky prawn
scarlet hinge
#

any reason that a replicated player state variable would take more than a second to update?

hollow eagle
plucky prawn
scarlet hinge
#

i feel like stuff like death messages should be replicated asap

#

but for some reason value changes for say death count takes about a second to replicate to a client

#

whereas its instant to the server

fair lantern
#

oh wait

#

I think im thinking of this wrong

scarlet hinge
#

some clients can see what the server is doing if u run the server as client

fair lantern
#

oh so you are saying that is normal?

#

sorry im new

#

in that case then the only problem I have left is that the other clients arent receiving the updated animation

#

I calculate the variable in the character blueprints like this

fair lantern
#

oh wait

#

I think control rotation is sending 0

dark edge
dusky yoke
plucky prawn
fair lantern
#

This works fine, however, when I simulate latency in unreal I notice that the client has to send its request to the server before actually seeing it on screen which makes it feel very unresponsive. I tried to have a client only rpc hooked up to the false branch which seemed to work for the client but all other multicasted clients started spazzing out. sorry i'm a bit new I dont understand?

compact talon
#

Struggling to find a multiplayer sessions tutorial that doesn't use Steam sessions. So I just wanted to clarify, you can only use the Steam sessions feature if your game is on Steam right?

fair lantern
#

you need the steam subsystem plugin installed

#

you also need to make sure you are using the generic playtesting steam ID that steam provides

compact talon
#

so I don't need to official release my game onto the steam store to use it?

#

as I don't plan on releasing it to steam store publicly, or at all for that matter

fair lantern
#

no you dont

#

steam provides a playtesting "dummy" game ID u can use

#

its publiuc

compact talon
#

I assume this dummy game ID has limitations because it seems absurd they allow people to use their services for multiplayer even if the game isn't on Steam.

Like can I host multiple servers with a server browser? Sorry if these questions are common sense

fair lantern
#

you can do whatever you like just like a normal game on steam

compact talon
#

Damn, I was pretty oblivious to this. Thanks a bunch for the help.

fair lantern
#

xoxoxoxoxo

#

ur turn to help me ๐Ÿ˜›

compact talon
#

I haven't even got multiplayer working so I wouldn't know how ๐Ÿ˜†

Might want to repost your question so people see it because my question covered it ๐Ÿ™‚

fair lantern
#

:C

light iron
#

Just note, some people have a hard time finding their steam session on the free 480 ID because of so many using it. It's like a public swimming pool. Keep your mouth closed when you go in.

fading birch
#

add a custom session setting to your game

#

makes it a ton easier

compact talon
fading birch
#

There's no real difference there, Sessions are sessions.

compact talon
#

I see, I will just follow this steam guide then and maybe it will make more sense as it comes to it

fading birch
#

What i mean is that the Online Subsystem is agnostic

compact talon
#

Do I need a plugin for hosting and joining sessions if I just want the game host to be the server, as opposed to connecting to a dedicated server?

#

I am following a steam guide and I got so far and now its talking about implementing the steam sub-system which I won't be using

compact talon
#

I know that I need to add the platform I will use in the DefaultEngine but I cannot find a list of the options.

[OnlineSubsystem]
DefaultPlatformService=<Default Platform Identifier>

For example how NULL is supposed to be used for LAN testing, or I could put steam/epic to use their subsystem

oak oracle
#

hey guys i have been reading Epic Shooter game and faced a lot of validatie functions like this :
bool AShooterCharacter::ServerSetTargeting_Validate(bool bNewTargeting)
{
return true;
}

what is the point of it ? Your validation will always be true

fallen heart
#

For a ranged projectile that needs to be thrown from point a to b. What's the best way to get a smooth projectile? The way I have it now is that I have the actor set to replicate and a server rpc spawns it for server and client. I also have replicate movement check. Slight issue with this is that the projectile seems a bit teleporting/laggy and it's not a smooth projectile. Not the biggest deal but I'm planning to have a lot of similar attacks like this one and don't want them to be laggy at all if possible. I was thinking maybe a multicast rpc to spawn a seperate rock for server/client? I think that would be smoother, but not sure what downsides that could come with. Anyone have any ideas/recommendations?

rapid bronze
oak oracle
#

Hi , whats is this syntax means :
uint32 bWantsToFire : 1;

is this equal to ?
uint32 bWantsToFire = 1;

fathom aspen
#

What it means, is that bWantsToFire is an unsigned integer of size one bit only. So it can be either 0 or 1.

#

So simply it's like a "compressed" bool that is not 1 byte, but 1 bit.

oak oracle
fading birch
compact talon
#

I don't know, I just assumed there would be a default subsystem or something that allowed p2p games. For example you can just "open" a level with "listen" as a property and people can join however I want to use sessions instead.

scarlet hinge
#

p2p is easier to do actually

#

just use steam plugin to setup p2p through steam

#

pretty convenient

fading birch
#

p2p vs dedicated server isn't really relevant here

#

Speaking of sessions at least

scarlet hinge
#

yeah if u want some global server + game server its not so easy

fading birch
#

The online subsystem is essentially an accessor service to a backend. A commonly used backend is Steam.

#

There's also Epic Online Services (EOS)

compact talon
#

I see, I have got it setup using Steam but I don't know if it uses Steam servers or I have it setup wrong because its very laggy even for the "host"

fading birch
#

You can make your own solution, but it's far easier to just use one of those to get the job done and save your self time and lots of money

#

There's no such thing as a "Steam Server"

#

It's literally being routed from your PC -> Steam -> Players

#

and very loosely through Steam

compact talon
#

I see, so its still players hosting games. Its just steam directs that hosting "procedure"

fading birch
#

Correct

#

That's what Steam Networking does essentially

compact talon
#

That makes sense. My understanding was wrong originally. I will just stick to using Steam then

#

thanks for the help

fading birch
#

๐Ÿ‘

#

There's a good guide in the pins of #online-subsystems of setting up sessions and some good best practices for working with online subsystems from Cedric.

scarlet hinge
#

side question, is there a priority order for replicated data?

compact talon
#

I will definitely give them a check. Also is there a guide anywhere for properly setting up multiplayer "features"? For example my characters ragdoll from certain attacks but the ragdolls are not the same on each others screens and some attacks are exclusively client side when they should be seen by everyone.

scarlet hinge
#

u cant make ragdoll physics server side

#

u would need everyone to have optic fiber connections

fading birch
#

Not necessarily

scarlet hinge
#

u can just tell it to run the physics with same settings

#

but there is usually some differences

fading birch
#

You also can't really do that

#

UE's physics aren't deterministic

scarlet hinge
#

thats what i mean

#

u tell it same settings and how its similar

#

in terms of forces applied

fading birch
#

So there will be some differences, but you can keep things in roughly the same spots by force correcting the root bone location of the thing you're moving

#

similar to how the CMC will force correct players that move too fast

scarlet hinge
#

one guy does the splits the other doesnt

#

both went same direction tho

fading birch
#

Yeah, you can't replicate that

#

That ultimately doesn't effect gameplay

compact talon
#

Hrm, yeah ragdolling is a pretty big part of my game so I suppose I will try to find some kind of guide for that.

As for more generic things like having my characters attacks same on all players screens. Its such a common goal I assume there are some good videos out there for it?

scarlet hinge
#

its just a matter of multicasting the right event

fading birch
#

That's pretty basic replication stuff

compact talon
fading birch
#

There's a few resources in the pins you should check out

scarlet hinge
#

u have to replicate the variables that determine logic of attacks

fading birch
#

How do ragdolls effect gameplay?

scarlet hinge
#

then multicast the functions

fading birch
#

You don't necessarily need to multicast, but it depends on what you're aiming for

compact talon
#

It's basically a form of party game and the characters main attack is a kick that ragdolls other players upwards. Then you could push these ragdolls off the edge or into attacks to kill the other players

fading birch
#

Personally I would just use GAS for this kind of thing

compact talon
#

I was also going to have a lot of random traps that could ragdoll players

scarlet hinge
#

thats fine

compact talon
#

I have heard GAS mentioned a lot but I only plan on having 1 ability, maybe 2 if I count the basic form of "attack". Is it worth setting up GAS for such limited usage?

fading birch
#

Yeah

scarlet hinge
#

oh if its ragdolls that hit things that would be hard

fading birch
#

GAS isn't just limited to abilities

#

you can do health through it, etc

compact talon
#

ah thats interesting. I was going to add a health system so I will check that out

fading birch
#

and regarding your ragdolling, it's far better for performance to just have a sphere collision around your ragdolled players to knock things over.

#

It's not 100% impossible to do what you want, but it'll require some advanced replication

#

GAS may be overkill for what you're trying to do though

#

Is your project BP only?

compact talon
#

I liked the root bone idea you mentioned where the root bone moves around so the players have the ragdolls in similar "areas", even if the poses are different

fading birch
#

Well, you would need to extend that to the hands and feet bones as well

compact talon
#

Currently yes, however I know a bit of C++ and want to learn it so I have nothing against using it

fading birch
#

Ah, then I would avoid using GAS

#

It requires some pretty decent C++ knowledge

compact talon
#

as long as the whole body is somewhere around x100 y100 z100 for example it will work just fine

fading birch
#

Well, for example, if you want hands hitting something to cause a reaction on all clients, then you'll need to replicate the position of the hands

#

if it's just general then, you can just put a collision capsule around the ragdolled players and call it good

compact talon
#

yeah I like the collision capsule idea

#

one last question, should I be making a separate character for online games?

#

I have a singleplayer mode and multiplayer mode, and if I need to cast to the server to perform actions then wouldn't I need a non-multiplayer character for singleplayer as it wont have a server to cast to

prisma snow
#

singleplayer also has a server, which is the local computer*. Afaik, if your multiplayer is setup correctly, singleplayer works out of the box.

compact talon
#

oh neat, thanks

fading birch
#

In Single player games, you essentially are the server. The same thing happens in P2P games.

fading birch
#

Think they meant RPC

real ridge
#

guys have someone here experience with EOS ? epic online services ? and maybe some pdf about it or other source ?

fading birch
left heath
#

I'm wanting to replicate advanced movement for the client of a listen server, and found a video on it explaining a great way to get it done, but there are a lot of steps missing, and the video creator is unresponsive. Dose anyone know of any great resources explaining this specific topic?

jovial dawn
#

Hello guys, I have something that I don't understand, if I start my game in the editor number of player 3 and for the net mode I chose "Play as listen server" I can see both client on my map no problem, If I compile dedicated server, the Client #1 I could not see the Client #2 on the map .... but see Client #1 if I play the Client #2 .

#

everything is replicated

#

the first client don't work as suppost to... in the editor windows "server side" I see every clients

placid flame
#

How can I set the visibility of a component to true for all my teammates?
Like the nickname to indicate who is part of your team?

I already have the team system and I can get the team with a variable. I tried getting all the actors and comparing that variable to set the visibility just for owner but sometimes is not working

crystal crag
#

I've been reviewing the Lyra game project... am I blind? I don't see any replication code in there at all

#

I don't see a replication graph anywhere

fathom aspen
#

Replication isn't just made using a replication graph

fathom aspen
crystal crag
#

Oh ok, so I'm not going crazy then. It's just not there.

#

I've never used a replication graph. I've only ever used the traditional method of replication, but I didn't see that in there either and I figured it was because they would've used the replication graph

fathom aspen
#

I haven't got to look into the networking code, but that should be a thing for sure

crystal crag
#

Wait... they say that it is setup with EOS... so why wouldn't it have replication?

#

EOS would only be integrated if it supported multiplayer. I mean technically they could bolt EOS on there and not write a single line of replication code... but that would be weird

iron crest
#

hey, Ive been stuck on this problem for a while now, Ive tried alot of things and nothing has seemed to help, to start, im trying to make a multiplayer game, the problem I have is when I get to a certain point in the combo, I want the hit actor to play an anim montage which has himf ly backwards, im timing this with an anim notify, I noticed though that everytime I get to the certain part of the combo, my character is the one getting pushed back and not the actual enemy/other player, here are some pictures of my graph and a video of the problem

graceful flame
#

Target is set to self, shouldn't it be the other character?

iron crest
graceful flame
#

Okay so are you at any point using Apply damage?

iron crest
#

yea I am, should I send a pic of that graph?

graceful flame
#

It's the same sort of line of thinking, the target can be the same base class but you have to specify the instance of the character.

iron crest
#

ok hold on

graceful flame
#

So however you managed to figure out which character to apply damage to use the same sort of approach to implement your target for the specific character you want to be knocked down, otherwise it happens on self by default.

iron crest
#

the problem is, it is drawing the hi actor as a actor object refrence and the anim montage is saying it needs a character refrence

graceful flame
#

You might be overthinking things a bit, you've already managed to make it so character A can hit character B and have them run different animations right? So it's the same sort of thing where you just need to set character B as the target.

#

Your knockdown server function can have an actor input, then use that as the target.

#

or it should be a character instead of actor

#

Then its just a matter of going to where you call the knockdown event and pass in the character being hit into it.

iron crest
graceful flame
#

If you have some sort of overlap event going on, you can get the actor from there and cast it as a generic character before sending it to the knockdown server event.

iron crest
graceful flame
#

Drag from the blue pin of the foreach, (you may want to do some kind of check, perhaps a tag?) then cast as character and feed that into your new knockdown input which then feeds into the anim montage.

iron crest
iron crest
#

Hmm, I tried to do as said and it still failed, just this time it does no damage and the animation doesnt play

graceful flame
#

cast to character (its a default thing)

iron crest
#

oh mb lol

graceful flame
#

But don't feed that into the apply damage that part was correct before. Feed the new overlap detected character into the knockdown server event (after you make a new input for it)

iron crest
#

ok

slim cobalt
#

does anyone know how to package a game so i can send it to my friends and they can play it

graceful flame
cosmic epoch
#

I have a projectile that needs to (more or less reliably) play some FX On Destroyed for everyone. Is there a better formula/solution to ensuring those FX also play when the projectile collides/is destroyed instantly upon spawning (e.g. player shooting into a wall right in front of him)?

#

Since Event Destroyed never fires on the clients if the projectile is destroyed on the server in the same frame that it spawned

#

If somebody has a suggestion, please ping me or reply to me, otherwise I will most likely miss the post

marble gazelle
cosmic epoch
#

Simulating it is kinda out of the question since it's a highly complex projectile that can bounce off of the environment or even home in on a target etc

marble gazelle
#

It won't work, as you should never rely on server frames for this. Packages can get lost etc.

thin stratus
#

Last time I had fast bouncing projectiles that could destroy the frame they were created I ended up faking it locally with line traces

cosmic epoch
#

Well it's just for the sake of FX, so I would be willing to loose a tiny bit of reliability.

marble gazelle
#

then you can do a client side prediction

cosmic epoch
#

That might be pretty performance intensive though, with the projectile potentially being homing and not traveling in straight lines at all (it can also home erratically)

thin stratus
#

Then spawn a fake one locally

marble gazelle
#

well if its costly, it's costly on the server as well, which might not be good at all xD

cosmic epoch
#

Predicting would be costly

marble gazelle
#

and without local simulation it will be more costly due to a lot of RPCs I guess to update the position

thin stratus
#

Why

cosmic epoch
#

Since doing additional line traces on tick sounds like a performance sink

marble gazelle
#

prediction = exact same code the server runs to move the projectile

inland slate
#

get location where FX you want to happned, send to all near by client and play that fx locally

cosmic epoch
#

I'm already playing the fx locally, and their location basically just needs to be where the projectile was as it got destroyed, so I'm doing it on event destroyed currently, which doesn't need any extra rpcs

#

It's just a pity that unreal has no flag to guarantee actor replication before destruction

marble gazelle
#

ehm

#

actor destruction is also sent to the client

#

so in fact it's somewhat a rpc

cosmic epoch
#

An inevitable rpc

inland slate
#

then add delay

cosmic epoch
#

Which I'm abusing to get more out of it

marble gazelle
#

I mean, you can also just send an unreliable RPC, if you fear the overhead

cosmic epoch
cosmic epoch
marble gazelle
#

if you are on cpp side, you can wait until the actor channels for all players were opened for the projectile, before destroying it

cosmic epoch
#

Interesting

marble gazelle
#

it doesn't matter how fast they move

#

it's just one RPC per projectile, not per frame

cosmic epoch
#

Yeah bad wording, they're just many

marble gazelle
#

then I actually really would go for client side prediction, as there will be a lot of replication to be done for the movment I think.

cosmic epoch
#

Like up to 10 or 15 projectiles at the same time, and all of them are relevant

marble gazelle
#

10 to 15? that's not that much tbh

cosmic epoch
#

Well currently I simply interpolate the movement using the built in interpolation of the projectile movement component

#

Not sure how costly that is

#

Afaik it simply sends velocity and location on net update

#

The rest is interpolated locally

inland slate
#

as far as i know event destroy only calls for controller or controlled pawn from server.
and two frame time delay may be won't work if ping is very high, some client won't get update that fast. i really would suggest add simple 1 sec delay and try.

cosmic epoch
#

But I could go for like a 200ms delay

#

The kind of game I'm making would be no fun at more than 200ms anyway, since it needs very fast reactions

inland slate
#

just hide projectile mesh and send location to client. so client only see that projectile collided.

marble gazelle
#

any type of delay is odd, why don't you just send a RPC or do a client side prediction "If wall, VFX" this is more accurate than any dely

cosmic epoch
marble gazelle
cosmic epoch
marble gazelle
#

Will you have pearcing missiles?

cosmic epoch
marble gazelle
cosmic epoch
#

I'm using GAS for gameplay relevant stuff, but one off gameplay cues from gameplay effects don't play reliably on simulated proxies in GAS, and GAS effects don't replicate to them either usually, so neither are helpful for this on destroyed effect

#

Basically with GAS, only the server and the hit actor will be notified of the damage, but not the other Clients

marble gazelle
#

well, you got my input, the rest is up to you^^

cosmic epoch
#

The main issue with prediction for me is that I have many fast moving projectiles and characters, which makes it prone to misprediction

#

Thx guys, I'll think this all through again, maybe I can incorporate some of those suggestions for my use case

marble gazelle
#

just to be clear, I don't necessarily mean full client side prediction.
If you do a simple ray cast on shoot to predict, if you actually will fire a bullet, or if you hit a wall could already be enough as a first approach.

cosmic epoch
#

I wonder, the netcode in unreal by default always sends a replication request on the next frame after a replicated actor spawned? Or how exactly is that initial rpc timed?

cosmic epoch
#

An arena game basically

marble gazelle
#

hm if everyone needs to see all hits, you maybe should just collect all hits in the GameState, and if the list of hits is not empty, just send it with one RPC to all peers

#

(send the RPC in the Update of the Gamestate)

cosmic epoch
marble gazelle
cosmic epoch
#

Thx, I'll explore that approach too then, can probably be simplified with gameplay cues and sending a tag ID instead of several fx ids

marble gazelle
#

Yep

cosmic epoch
#

Would also get rid of having to make a database

marble gazelle
#

\o/

cosmic epoch
#

Thx again everyone, have a good one

livid sluice
#

Hey guys I have a very confusing Issue. I have a function that works correctly only if you "Play as Client" in the editor. If you do Play Standalone, it does not work as intended which is fair. However when I packaged the project the function works as if the project is running Standalone. Is there something I'm missing? Can I configure it to run as client every time?

marble gazelle
#

Well you need to package it as client only, so without server code.

But what are you actually doing? Could you give an example?

regal solar
#

An error occurred (FleetCapacityExceededException) when calling the CreateGameSession operation (reached max retries: 2): No available process.

livid sluice
#

I can show more but its very simple, It basically checks authority and if client it runs the same function on the server to change a Player State Enum, which is Rep Notified which updates the anim graph to display the combat stance.

#

If I select. Play as Client. It works fine and plays exactly as I want it to.

#

When I do standalone. the code breaks and the player does not enter the combat stance.

#

The game is made for multiplayer so it wont obviously work on standalone.

#

But the problem comes when I package the game. The game works as if the it's running stand alone and the player does not enter its combat stance.

marble gazelle
#

I don't see where you check for authority^^ But anyway, you need to send an RPC to the server if you want to request a combat state change.

Your game runs in bundle as standalone as you didn't package it as client only You need to create a build target for Client, if you only use a dedicated server. If you clients also can be listen server you need the default game IIRC.

How ever, it's likely that you messed smth around with your auth checks^^

livid sluice
#

Server Toggle

#

Rep notify

livid sluice
marble gazelle
#

actually I'm not sure if that's possible with a BP only project with a bundled engine, as the bundled engine doesn't support creating a dedicated server, so I think it also doesn't support client only bundles

livid sluice
#

I have the unreal engine source. I have built dedicated servers but I was not aware of their being a client build.

marble gazelle
#

ah ok, well as for the server target, you need to create a client target.cs file

livid sluice
#

If you have any documentation or video regarding this. It would be appreciated.

marble gazelle
#

and then you should be able to select this target for packaging

#

No I don't, but basically its just like the server target, a list of modules we need to build

livid sluice
#

okay thanks. At least I know where to look now. Appreciate it.

verbal shoal
#

hi!

what the best solution to change player data - ask game mode functionality to do this through player controller, then change through player state functions. or better directly run RPC from player state (because it's already owned by controller) and change all it here.

I think state only for reflecting data for clients as a game state is.
And stores server changing logic here isn't correct.

But very confusing RPC's here. Maybe they could serve only for asking the game mode, not changing directly. And we should to not store asking logic in the controller, but in the player state.

how do you think, guys?

#

also @thin stratus writes (huge Thanks for compendium) that "In Multiplayer, the PlayerState is meant to hold information about the State of the connected Player."

only hold, not to manipulate.

but RPC's breaks encapsulation, no?

livid sluice
#

Along with the name?

#

Sorry for bothering you again, But I could not find any resource online for this.

marble gazelle
#

well, file needs to be renamed to ProjectNameClient.Target.cs,
the Type needs to change to TargetType.Client, and you can remove the SupportedPlatforms thing

livid sluice
#

Awesome, thank you so much.

unkempt tiger
#

Is it just me, or does overall network performance in a standalone game running from the editor with a separate server process, and network emulation, vary from session to session?

#

Some sessions the net performance is terrible (packet loss, frequency of updates is really low, etc), and sometimes everything just works as intended?

fading birch
#

That's a you thing

scarlet hinge
#

is there a typical approach for making an FPS multiplayer in the sense that its first person for the player but others see the a different model in 3rd?

#

idk if there is maybe a visibility setting somewhere for that, or if I just have to do it in the event begin

marble gazelle
#

one solution is setting visibility flags with Owner No see or smth like this.
second to simple setup the actor different if not controlled locally

scarlet hinge
#

cant seem to find a field that can do the owner no see

#

for a skeletal mesh

marble gazelle
#

then this is on actor level, k^^ then you might need to set it up different ๐Ÿ˜‰

scarlet hinge
#

ill just try in the begin play

#

wait i found it

#

there is an owner no see flag in the LOD

#

rendering tab

#

was looking for a drop down for visibility as ive seen in widgets

fallow shadow
#

Can you run multiple dedicated servers on one machine?

#

*By default

sinful tree
#

Sure

fading birch
#

Yes, it's actually quite common

#

Generally speaking, it's cheaper to have a beefy server that can run 10-20 instances of a dedicated server, than it is to have 1 server per game server instance.

#

There's pros and cons

lost inlet
#

you can even run the same exe multiple times as long as you have multitenancy in mind for configuration and such

fading birch
#

Yup, usually I just setup X number of scripts that pass different parameters to the command line when launching the server, specifying the port, session name, etc

unkempt tiger
#

If I want to move the player's camera to an overview point where they can see the entire level when they die, will net relevance update correctly if I use a camera modifier? Or should I be moving the player controller itself, somehow?

crimson valve
#

How do I pass a SurfaceType enum value through a C++ RDP function?

#

these are giving me errors regardless of how I do it. If I don't use TEnumAsByte, it says...

error LNK2019: unresolved external symbol "__declspec(dllimport) class UEnum * __cdecl Z_Construct_UEnum_PhysicsCore_EPhysicalSurface(void)" (__imp_?Z_Construct_UEnum_PhysicsCore_EPhysicalSurface@@YAPEAVUEnum@@XZ) referenced in function "void __cdecl `dynamic initializer for 'public: static struct UE4CodeGen_Private::FBytePropertyParams const Z_Construct_UFunction_AVRCoopPlayerCharacter_CL_MulticastTriggerFootstep_Statics::NewProp_SurfaceType'
#

but if I add TEnumAsByte, it doesn't actually use it in the generated function

#

I guess maybe this is because the EPhysicalSurface enum isn't actually a strongly typed one

lost inlet
#

is this just because you didn't add PhysicsCore to Build.cs

crimson valve
#

Yep. That's it. ๐Ÿ˜…

#

Thanks! ๐Ÿ™‚

quasi tide
#

Typically speaking - when you see "unresolved external symbol", generally means you forgot an include or to add something to Build.cs

crimson valve
#

Yeah I was being dense. I was thinking I didn't have the RDP format right (since that also triggers unresolved external symbols) and just didn't consider it being an actual linker issue.

lost inlet
#

RDP?

#

you mean RPC right?

quasi tide
#

Maybe RDP is "Remotely Defined Procedure"

lost inlet
#

is that a common term for it? I've only seen them referred to as RPCs and the concept is commonly called RPCs even outside of Unreal

quasi tide
#

Oh - I'm just guessing here. I've always seen and heard and known it as RPC

crimson valve
#

RPC yes

#

sorry ๐Ÿ™‚

#

I got two of the letters right ๐Ÿ˜‚

fading birch
#

I was thinking of Remote Desktop tbh

solar stirrup
#

RDP Drop in replacement for UDP when

crimson valve
#

There is actually RUDP

#

reliable UDP. Basically what all games do ๐Ÿ˜›

solar stirrup
#

I was just joking about using the remote desktop protocol instead of udp

crimson valve
#

Haha yeah, I think rpc + udp = rdp in my head ๐Ÿ™‚

#

Remote desktop only in vr work environments ๐Ÿคฃ

grizzled stirrup
#

If you spawn a replicated actor on the server and attach it to a replicated character right after spawning, will it reliably attach on the client also?

grizzled stirrup
#

It seems to work fine, just sanity checking

plush otter
#

Hello, a question about server performance and bandwidth concern.

My players can use some inventory item to spawn a big explosion area in my multiplayer game. Each area has around 100 projectiles looping from sky to the ground.

I have set the projectiles to only replicate locations from server when they hit something and are put back in the sky, and they have a short NetCullDistance of 50m.
If players spawn lots of these areas, is it gonna be a performance issue for the server (calculating hundreds of projectiles moving and overlapping the ground)?

#

I'm thinking about only spawning some projectiles around players if they are inside the area, while distant projectiles are only local visual. This can drastically decrease wasted number of projectile actors on the server, but requires some work.

summer tide
#

Are these errors safe to keep if everything works or should be resolved? LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor

ocean vessel
#

Hi, what's the proper way to limit character's speed in certain direction so it couldn't be hacked over the network?

Example: I want moving backwards to be slower than moving forward

What I consider:

  1. setting the axis scale of backwards buttons in the project settings - probably not a good idea, there probably are hacky ways to call input events with higher values
  2. doing algorithms like if(axisvalue<0)maxspeed=100else maxspeed=200
    Probably not a good idea if I want to only clamp the forward/backwards factor, also seems whacky to replicate thos behavior
#
  1. root motion locomotion- looks cool on paper, especially for soulslike games, but I heard it's hard to implement networked root motion outside anim montages(in blendspace in anim blueprint)

I mean, I did that for testing purposes, but on higher ping, the results are weird- character gets teleported 100ms backwards and then 100ms forwards, (so the result of movement is good, but with all the weird small useless snaps it's irritating, like movement component doesn't predict the movement well)

grizzled stirrup
fathom aspen
summer tide
ocean vessel
fathom aspen
summer tide
fathom aspen
#

It's an issue already. It's clearly saying that the function won't be processed.

#

You have to set the PlayerController or PlayerCharacter or any other client owned actor you see suitable to own that actor.

#

You can do that using a SetOwner function

silk pilot
#

Assertion failed: PIEInstanceID != INDEX_NONE [File:D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\LazyObjectPtr.cpp]
anyone getting this with UE5? Trying to run 2 clients. Loading into their own worldspaces

vague fractal
#

What exactly does the term NetAddressable mean ?
Kinda having a hard time to google it ๐Ÿ˜…

proud gust
#

Hello ๐Ÿ™‚

I am looking for a Tutorial.
I want to learn how to connect to a dedicated server over the internet from all over the world and be able to play on it as a Client.

I find it really confusing to learn this, i only find Tutorials for local connection's, some use Online subsystem's, some not , i dont know do i need that? What is best practice? I would prefer to make my game without Steam.

If anyone has a good Tutorial or something(must not be free, i am willing to pay for it, if its good ^^) please send a link or so ๐Ÿ™‚

Thank you ๐Ÿ™‚

sinful tree
# vague fractal What exactly does the term `NetAddressable` mean ? Kinda having a hard time to g...

I'll give you what I understand is the case, though I may be wrong... It has to do with memory pointers and replicated actors. When you are referencing an actor on a client, you're using a memory pointer, so that reference is actually pointing to a memory address on your computer where the engine then knows to look for the data for that particular actor. When dealing with replicated actors, that memory pointer would not be the same on both computers - your server may have stored that actor at one memory address, but your client would have it stored at another, so you can't just pass the memory address across the network and hope the other side understands where to look. That's where NetAddressable comes in - instead of trying to point to the actual memory location of the actor, there is a "key" that is established that each side sets to understand which particular piece of memory they would need to access for that particular actor. So when you pass through a reference to a replicated actor in an RPC for example, you're not passing the actual memory pointer, you're passing through the key that lets the other system know which particular actor you're trying to reference across the network.

twin juniper
#

How am I supposed to test hosted multiplayer mode? I am getting extreme frame drop on the window I am not focusing, it seems to be more on client side but happens on the listen server too, and the issue is mainly 'render view family' but I don't see why average draw calls would vary so much between server/client?

vague fractal
vague fractal
marble gazelle
winged badger
#

and understanding it is also a key to understanding how to optimize your network

umbral dragon
#

Am I being super dumb or is there a large bug with multiplayer PIE on UE5 right now? If I play with ListenServer and 1 player and do a print statement in BeginPlayer for any actor. It will run twice once for server and once for client.

winged badger
vague fractal
umbral dragon
#

But ListenServer 1 player there is only one machine? Or...

sinful tree
#

If you have a listen server, and an additional player, that's 2 players.

twin juniper
umbral dragon
#

Shouldn't ListenServer host be the only player

#

or do I not know anything ๐Ÿ˜…

umbral dragon
#

So settings are like this. Shouldn't this just give me one machine?

bitter oriole
#

Should, yeah.

vague fractal
umbral dragon
#

If I add this to the level blueprint with one player I will get a print statement on the server and the client (unmodified engine)

sinful tree
umbral dragon
#

Yeah that is what I expected

#

I was hoping it was a well known bug ๐Ÿ˜‚

vague fractal
#

I've just read about Adaptive Network Update Frequency which is by default off.
With this description here

With Adaptive Network Update Frequency, we can save CPU cycles that would normally be wasted in redundant attempts to replicate an actor when nothing is really changing. When this feature is enabled, the system will dynamically adapt the update frequencies of individual Actors based on whether or not their updates are meaningful. In this context, a "meaningful" update is any update which initializes the Actor, adds or removes a subobject (i.e. an owned Component), or changes the value of a replicated field on the Actor or any of its subobjects.

I don't really see why it isn't the case by default :thinkie:

void jacinth
#

AFAIK This does not change when an actor actually sends an update, it changes when an actor is even available to check if an update should be sent

#

Meaning, if you had a few "failed" update checks in the sense that nothing changed, it will start to skip that actor for longer and longer periods of time

#

For some scenarios that may be undesirable. If an actor needs to replicate changes/update quickly after an event and it is currently slowed down via the adaptive frequency it could take (depending on config) a relatively long time to "wake up" and send that update

grizzled stirrup
#

Is it common to pass a FVector_NetQuantize DamageLocation and a FVector_NetQuantizeNormal ImpactNormal with a damage struct that is replicated to clients in order to more easily position and place FX? (assuming the location and rotation of said FX must match on client and server)

thin stratus
#

If you can't predict this on the client

#

Then sure, send it along. Just be aware that those are compressed, so if you use the normal FVector on the Server, it might be slightly different location. You usually use the NetQuantize version on the Server then too.
CMC does something similar where it sends the compressed data to the Server, and makes sure to also use that compressed data to move on clientside, to not get out of sync

grizzled stirrup
#

Thanks, great to know! Trying to not be wasteful but there are plenty of occasions where location info can't be derived and would be very useful on the client so I think it's worth putting into my damage struct

pulsar lotus
#

Hello, please advise how to run and test a dedicated server correctly

My current flow looks like this:

  1. I marked Launch Separate Server in Multiplayer Options
  2. I select two players
  3. I click the play button.

But it does not work correctly

I want to make a menu where the player chooses a character and then connect to the server via OpenLevelByName with IP:Port in level name, but in the console of the server only writes that the player is connected, but in the game nothing happens

shy radish
#

Hey fellas hope you all doing well!
It's my first time using Unreal's Networking system, and I am trying to create a multiplayer version of the Unreal's Twin Stick Shooter template.

So far... I managed to replicate the shooting but can't seem to figure out how to replicate the movement. It's using the APawn class so its not as easy as ACharacter.
From server side everything looks good and updates on client if i move the server, then I try controlling the client and nothing happens.
Any of you guys got any suggestions what i could try?

dark edge
livid mist
#

hey, how can I get this to properly replicate? The characters can shoot a projectile, but I need it to inherit their speed and add it to the projectile's since the players are able to move really fast. The server is getting the new speed, but not the client.

shy radish
dark edge
#

It already automagically handles movement for you just fine. No need to reinvent the wheel.

shy radish
#

fair enough

dark edge
livid mist
#

I'm spawning replicated projectiles

#

Both of them see it, but the construction script which takes the player's velocity and adds it to the projectile isn't replicating to clients

dark edge
livid mist
#

Ok ๐Ÿ™‚

dark edge
#

Also, the additional velocity should be a vector

livid mist
#

ok, I'll change that too. I was getting vector length from my velocity

dark edge
#

Unless you only want velocity inheritance in the travel direction

livid mist
#

Ahh

dark edge
#

Just pass over the spawners velocity on spawn and on begin play, set velocity = velocity + inheritedvelocity

livid mist
#

ok ty. Also, how do I add that into initial speed, since it's a float?

#

Not sure how to do it besides getting vector length

dark edge
#

I'm not 100% sure when speed is actually used but It's at least used on begin play to calculate velocity.

#

So it's just a helper property for startup

#

so you can say BulletX.Speed = 10000 instead of BulletX.InitialVelocity = 10000,0,0

livid mist
#

๐Ÿ‘Œ

#

This worked as I intended it to work, but i set it up before I started working on multiplayer is all

dark edge
#

It probably didn't work on strafe tho

#

depends on if you want that to be a thing or not

livid mist
#

Well no, the fireball was set up for multiplayer, but not the speed inheritance

#

I'll test it out

dark edge
#

Yeah just BeginPlay -> ProjectileVelocity = ProjectileVelocity + InheritedVelocity should do it.

livid mist
#

I got my thing working from the other day btw, turning adds yaw to the character and I just made my turn animations add a more extreme angle, so it has the feel i wanted. No rolling necessary ๐Ÿ‘Œ Thanks for your help on that

#

Hrmmm. The clients are seeing the new speed, but the fireball is still hitting me in the face while I'm flying.

#

That's why I had it on construction script at first, cus it wasn't working on event begin play. I think the new speed isn't being added before the fireball is already shot

dark edge
#

IDK much about the guts of the projectile movement component, I made my own.

livid mist
#

Instead of adding projectile initial speed?

blazing spruce
#

Hi, im having an issue with players spawning, all clients spawn just fine but the server player spawns at 0, 0, 0 world position with no character, any idea why this might happen? This is my SpawnPlayers event which is kept on the Game Mode and is called from the Game State when the pre game timer has finished, am i doing something wrong here?

granite jolt
#
LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor BP_FlyingPlayer_C_0. Function SetHasMovementInput( SERVER ) will not be processed.
LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor BP_FlyingPlayer_C_0. Function SetLookAtLocation( SERVER ) will not be processed.
LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor BP_FlyingPlayer_C_2. Function SetHasMovementInput( SERVER ) will not be processed.```
Getting my log spammed with this error.  any ideas?
bitter oriole
granite jolt
#

hmm this is a plugin doing it so it's going to be interesting to debug then. it's supposed to be multiplayer compliant too

#

another strange thing is there are 3 of the pawns, but only two are spawned on the dedicated server

grizzled stirrup
#

Interesting, it seems marking a property with UPROPERTY(NotReplicated) in a struct will actually set any values sent from the client to the server to 0.0f too! I had though it would only do that from server to client but I guess it makes sense to ignore it on the way up too and save bandwidth

granite jolt
#

Ok more information. The error only occurs when a second instance of the pawn is spawned. So perhaps it's something conflicting with multiple instances trying to own the same reference?

bitter oriole
#

The pawn is probably spawned on a client

granite jolt
#

im running it on a dedicated server. OnPostLogin I spawn the actors and possess them with the login controller. I've tested it by not using RunUnderOneProcess also

shell sorrel
#

Any general advice on what to use to build a backend that orchestrates and spawns UE4 processes for each multiplayers "game instances" ? (#linux)

granite jolt
#

@shell sorrel generally that is done via your cloud provider. AWS and Azure have functionality for it. However if you were custom hosting, you could always just keep a database of connections and according to requirement use a script to run a new server from a command line. Python would be able to run an executable from a symbolic link/shortcut with the right parameters.

shell sorrel
#

@granite jolt I will probably start with custom hosting (scaling issues are only exists if you succeed ๐Ÿฅฒ ).

#

I'm looking for examples: for instance, are you able to communicate with the spawned processes or fetch "end of process data" (or do you have to create an API for that).

granite jolt
#

@shell sorrel Unreal can use socket servers to communicate info. So I guess that would be the ideal way to have interoperability without some intermediary like json or xml

bold dune
#

I need to replicate audio stream data (uint8). If I send it with a client RPC, it's fine. With a multicast it's throttled and a lot is lost. The actor's update frequency is pretty high (~ 40 if I remember) so how can this throttling be helped?

woeful wagon
#

Hi im trying to get the instigator/Owner of the projectile but when the projectile is looking for the instigator it comes out as none is there a part I am missing to get the owner of the projectile so the server knows who killed who the death counter works, i just cant seem to find the killer!

#

for a bit of added info its getting death and kills and adding it to the same player

teal crest
#

Does anyone know how regions work when searching for sessions on steam? Do the regions have to be identical? Or is it more generally NA, EU, etc.

still path
#

Knowledge check - is the reason you shouldnt use child actors when making a multiplayer game because the actors that are spawned arent recognized as the same on server and client? Thus causing reference errors?

dark edge
dark edge
still path
dark edge
still path
somber glade
#

Is it possible to have 2 different player controller classes in a level? Like when a player joins can I assign a class to them based on some passed information?

woeful wagon
fathom aspen
#

Probably what you're looking for

somber glade
#

I wasn't sure if it was something that was even possible.

fathom aspen
#

Man this is Unreal Engine

#

What are you trying to do?

#

And if I understand you correct, the player does travel to a new level after he inserts the password?

#

Yeah I get your worries. For that I would do it in an other more elegant and safe way, I think

#

I would save that password in the PlayerState, and override CopyProperties to save it for level change

#

In the new level you could wait for OnRep_PlayerState and check for that password

#

Or in HandleSeamlessTravelPlayer probably

#

Well yes, it makes sure your properties persist level changes

#

I'm not sure, but it might get called for reconnecting players as well

#

Well then you have Beacons

#

But again if you're too worried your player state is null, then wait for an OnRep_PlayerState call

#

And not on BeginPlay

#

AController::OnRep_PlayerState

#

Yeah I guess so

ember sinew
#

In C++, if I set a Replicated variable using plain old myReplicatedVariable = newValue from a non-owning client, does that automatically cause the variable to be replicated? Or is that bad practice, and I should always set it with some UFUNCTION(Server) SetMyReplicatedVariable(newValue)?

fathom aspen
#

Setting a replicated variable on client won't make any effect on that variable at least not for others. Setting replicated variables should happens always on server. Now it's up to you how you wanna get to the server(depends on the situation), but calling an RPC is an option yes.

ember sinew
#

Gotcha, I wasn't sure if there was magic that detected the value being changed and handled it automatically. I'm thinking I'll call the server-side Set() and set the local value at the same time for snappiness sake.

fathom aspen
#

I like this one:

ember sinew
fathom aspen
#

But that really depends on your situation. This shouldn't be your go to workflow

fathom aspen
#

That's why setting values on the client is really discouraged

ember sinew
#

Yeah... the more I think about it, the more I realize that the "update the value immediately" is really only needed for the UI, so really it should be the UI's responsibility to 1) immediately update the value displayed so it feels snappy, and 2) update the displayed value again when replication happens.

#

Thanks for talking me out of that ๐Ÿ˜…

#

might be time to take a break for the night ๐Ÿ™‚

fathom aspen
dreamy terrace
#

Hey people. we're in the early stages of a multiplayer VR prototype (industrial application not a game) where the intention is to have 2 players in VR with mocap suits (XSENS) each. Each player needs their own body presence and the other players body. I was hoping that livelink would be able to broadcast both suits animations to each client rather than be replicating them across from one or the other.... Looking into it I've seen Livelink rebroadcasting mentioned in some particular livelink plugins but cant find more concrete info on it. I've then also heard elsewhere that livelink doesnt work for multiplayer. Anyone have any experience on this?

thin stratus
#

LiveLink was also for Runtime purposes? I don't use it, but always thought it was mainly for allowing quicker iteration time during development, specifically for previewing MotionCapture. Didn't know you could use it runtime in packaged applications.

#

However, that said, I would usually treat those Plugins and External Devices (let's just assume the Motion Capture Suit is an External Input Device for the sake of simplicity) as Local only.

#

Means whatever they do is only known to the Local Client and any data that needs to be known to everyone has to be sent to the Server for replication first.

#

@dreamy terrace However, again, that said, I have not dealt with this specific problem.

dreamy terrace
#

it's a proof of concept project so corners can be cut

marble gazelle
#

Can't you, for the proof of concept, link the library for the Mocap suit (I assume smth like that exists?) Grab the information for head, hands etc and link this data relative to the character and use IK to move the hands etc to the requested positions, and also replicate this information?

At least this would be ma naรฏve approach, never worked with mocap so just some random thoughts^^

woeful wagon
#

Hi im trying to get the instigator/Owner of the projectile but when the projectile is looking for the instigator it comes out as none is there a part I am missing to get the owner of the projectile so the server knows who killed who the death counter works, i just cant seem to find the killer!

twin juniper
#

Is there a way to get these working on the client from the lyra project?

shy radish
#

Hey fellas, im new to unreals networking system (or networking in general). I am trying to make a multiplayer version of the Twin Stick Shooter game but im struggling to wrap my head around how to properly replicate functions or variables in that matter. I had shooting working completely fine working on both client and server, but when I added Movement and had that working my shooting function stopped working.

Header

    UPROPERTY(Replicated)
        float FireForwardValue;

    UPROPERTY(Replicated)
        float FireRightValue;

    void FireForward(float Value);
    void FireRight(float Value);
    void Fire();
    void FireTimerExpired();

    UFUNCTION(Server, Reliable, WithValidation)
        void ServerFire();
#

cpp

void ASpaceGameCharacter::Fire()
{
    if (!HasAuthority())
    {
        ServerFire();
        return;
    }

    const FVector FireDirection = FVector(FireForwardValue, FireRightValue, 0.f);

    if (bCanFire == true)
    {
        if (FireDirection.SizeSquared() > 0.0f)
        {
            const FRotator FireRotation = FireDirection.Rotation();
            const FVector SpawnLocation = GetActorLocation() + FireRotation.RotateVector(GunOffset);

            UWorld* const World = GetWorld();
            
            if (World != nullptr)
            {
                // Spawn the projectile
                World->SpawnActor<ASpaceGameProjectile>(SpawnLocation, FireRotation);
            }

            bCanFire = false;
            World->GetTimerManager().SetTimer(TimerHandle_ShotTimerExpired, this, &ASpaceGameCharacter::FireTimerExpired, FireRate);

            if (FireSound != nullptr)
            {
                UGameplayStatics::PlaySoundAtLocation(this, FireSound, GetActorLocation());
            }

            bCanFire = false;
        }
    }
}

void ASpaceGameCharacter::FireTimerExpired()
{
    bCanFire = true;
}

void ASpaceGameCharacter::ServerFire_Implementation()
{
    Fire();
}

bool ASpaceGameCharacter::ServerFire_Validate()
{
    return true;
}

void ASpaceGameCharacter::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);

    DOREPLIFETIME(ASpaceGameCharacter, FireForwardValue);
    DOREPLIFETIME(ASpaceGameCharacter, FireRightValue);
}
marble gazelle
shy radish
#

sorry

void ASpaceGameCharacter::FireForward(float Value)
{
    FireForwardValue = Value;
}

void ASpaceGameCharacter::FireRight(float Value)
{
    FireRightValue = Value;
}

void ASpaceGameCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
    Super::SetupPlayerInputComponent(PlayerInputComponent);

    PlayerInputComponent->BindAxis("MoveForward", this, &ASpaceGameCharacter::MoveForward);
    PlayerInputComponent->BindAxis("MoveRight", this, &ASpaceGameCharacter::MoveRight);
    
    PlayerInputComponent->BindAxis("FireForward", this, &ASpaceGameCharacter::FireForward);
    PlayerInputComponent->BindAxis("FireRight", this, &ASpaceGameCharacter::FireRight);
}

Through Input I set the directions and replicate them

marble gazelle
#

well you don't replicate them, as property replication goes from Server to client, never the other way around. you need Server RPCs for this

shy radish
#

aha i see

#

any documentations or videos you can send me for me to study on this?

marble gazelle
#

google?
And well, what do you want to study. You need an RPC as you already use for fire

shy radish
#

but you say for the variables yea?

#

the forward and right fire need an rpc call?

#
    UPROPERTY(Replicated)
        float FireForwardValue;

    UPROPERTY(Replicated)
        float FireRightValue;

But isnt this it?

marble gazelle
#

No

#

this is UPROEPRTY replication, not an RPC and replication goes from the Server to the Client, so if you change smth on client side, it will not effect the server. you need to call an RPC, so a function, for this

#

just check the pinned messages here, there are a lot of network guides

shy radish
#

I see thanks for the help