#multiplayer

1 messages · Page 120 of 1

thin stratus
#

Cause the game was rather fastpaced

crystal crag
#

oh ok

real ridge
#

thank u all for kind words I will take a rest and start again with clear mind , the thing why I am so deppressed it that it's 1 year now since I started and I have done ton of work and I again started struggling at thing I thought I already solved long time ago so instead solving collectibles functions and combat system between planes I need solve replication again ☠️☠️☠️🥲

#

and I am also aware one day I will have to refactor controls system too...

crystal crag
#

Yeah I get that. Keep in mind if you touched something a lon gtime ago and then come back to it, you can easily forget little things you learned while you were working on whatever that feature was back then

#

I tried last night making the character follow the player that picked them up by using Apply Root Motion To ACtor Force every 0.1s. That did not work out well lol.

#

It's so bad

thin stratus
#

Yeah that won't look good

#

You really just want to attach

crystal crag
#

I didn't have high hopes. Originally I thought I wouldn't use attachment. I had even coded it to use attachment, but then deleted it before even the first play through test because I thought "that won't work, the CMC will be fighting the position too much"

#

I'm honestly surprised attachment works, because I thought each frame the CMC checks the players position vs where it thinks the player should be and then corrects it. If the player is not adding input, but the position is moving, I would have thought it would have tried to force the character back to where you picked them up.

#

(in a server/client scenario)

#

I'm going to try it now though

#

Hm... well attach to actor doesn't seem to be doing anything at all for some reason

#

I can see that I have two valid character actors

#

is it because I have to set movement mode to something other than walk first?

real ridge
#

@thin stratus isnt character because of CMC very expensive for network thought

thin stratus
#

I think so yeah, if you keep movement allowed it might override stuff

crystal crag
#

makes sense

thin stratus
#

Fortnite runs with 100 of them. They optimized a lot and use ReplicationGraph, but 32-64 CMCs or so are usually not a problem if the rest of the game is properly optimized

crystal crag
#

lol ok, setting the movement mode to none definitely made something happen. The character just disappeared from view. So I am making progress. Probably need to make them actually attach to a socket or something.

#

probably made collision mess up hard core because the character went at my feet

#

lol

#

Well, I definitely got them attached.

#

Need to adjust collision I am guessing

grave lynx
#

Hey. I have a lobby timer stored on the game state. To update UI Values for each clients, I create a delegate on the GS, broadcast it on the GS, bind it in the UserWidget. Working for server, but function is not called on client, missed something on multiplayer compendium?

whole solar
#

Or OnRep function for property

grave lynx
#

oh

#

gotcha

zenith wyvern
#

Trying to store ref to pawn in playercontroller on beginplay, but it's only happening on client. What's the right way to do this?

#

In another project I would spawn players in RPCs and store ref which worked, but starting from third person tutorial, wondering how I can store ref quickly

#

Or, am I supposed to just make a helper function to 'get my casted pawn' and call that each time i need a ref instead

fathom aspen
#

There is no guarantee pawn will be controlled at beginplay

#

Do it elsewhere

#

OnControllerChanged I guess it's called nowadays

crystal crag
#

I'm not sure what I am doing wrong. If I attach the enemy player character to mine without the target being in ragdoll, the best I can do, regardless of which socket I pick, the character picked up gets stuck inside my character and shoots them both into the sky

#

if I turn on ragdoll, then the attachment method still returns true, but they stay on the ground and do not move

#

I've tried playing with collision settings

#

making it to where everything but world static and world dynamic is ignored; still those two things happen while physics is enabled on the target.

#

I can see in the scene explorer that it shows a character attached to mine... not sure why the movement isn't updating then

#

(during ragdoll)

whole solar
#

On clients OnRep_Pawn

unique forge
#

Um yeah

#

Can someone help me with the sprinting and crouching system?

#

alr got some animations

crystal crag
#

Sprinting and crouching systems?

#

UE already has crouch built in for the Third Person Template

#

Running is probably best done in the CMC

crystal crag
#

Ok, so I figured out the problem where the character was not getting attached to the right spot - I was forgetting to attach to the mesh and instead was attaching to the character actor.

#

But the problem still stands where I can't seem to attach a character rag dolling - are these settings nort right?

#

I can see the rag doll actor attached to me, but it isn't following me around. I've seen others say that they have set the movement mode to none to do what I am trying to do, but I am not sure if that is supposed to work while rag doll is active.

unique forge
crystal crag
#

It doesn't matter

#

Same mechanics

#

If I remember right, the CMC already has it built in

#

That's why you can see capsule half height crouched or somethingh

short arrow
#

Why is it that actors that aren't being replicated every frame destroyed on clients? It was surprising to see that being out of the relevancy range is not the only thing that will destroy networked actors on clients

manic trail
#

I'm trying so hard to use EOS in my game, and no matter the tutorial i cant seem to get it working, it gutting and i need help if anyone is able to provide

twin juniper
#

Yes, CMC has crouch built in, however for first person it just teleport the camera resulting in a poor implementation, so custom implementation is always preferred so the camera is animated instead.

thin stratus
#

No need to change the CMCs crouch

sharp vigil
#

Is https://docs.unrealengine.com/5.3/en-US/multiplayer-programming-quick-start-for-unreal-engine/ flawed? (I mean I doubt it. I just think I'm missing something)

I tried applying this logic to a health component. The health component is set as a subobject on its owning actor and isReplicated is true for it. Otherwise I just borrowed the code from this guide and applied it to the component itself.

I can't seem to get the message from OnHealthUpdate to pop up on my client when it takes damage because the set method only updates health on the server. Not sure if the logic is flawed or I'm missing something?

Create a simple multiplayer game in C++.

whole solar
# manic trail I'm trying so hard to use EOS in my game, and no matter the tutorial i cant seem...

Unreal Engine 5 Epic Online Services - Set Up EOS for Your Multiplayer Game

Set up Epic Online Services for your multiplayer game!

Epic Online Services Dev Portal:
https://dev.epicgames.com

EOS Documentation:
https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/Online/EOS/

Multiplayer Plugin:
https://github.com/DruidMech/Multipla...

▶ Play video
manic trail
#

im using blueprints

hoary spear
#

Can you even get it working in pure bp?

#

Doubt it

manic trail
#

Seems to in lots of tutorials

#

can you combine c+ and blueprints?

hoary spear
#

Ofcourse^^

manic trail
#

ohh

hoary spear
#

Its the optimal path 🥳

twin juniper
#

in a first person perspective

thin stratus
#

The update functions usually provide you with a ViewTarget, being the Character. At that point you can return a Transform for the Camera based on IsCrouched etc

spare plank
#

Hi All! I'm trying to test lyra with keyboard and gamepad in "dual mode" <keyboard has focus at 1st window for 1st player, pad - 2th window with opponent > but somehow "route gamepad" option from editor menu doesn't want to work, any advice or tip? Does anyone has similar issue ?

shrewd ginkgo
#

is it bad way to replicate event :/

manic trail
sharp plover
#

Is it not possible to have a unreliable multi rep? Tried to have an event that is multi and unreliable but it never triggers for other clients, instead if I set it to reliable then it finally triggers

fathom aspen
#

If it's within a dormant actor, you need to ForceNetUpdate as well

crystal crag
#

I'm still working through this whole "ragdoll characters when attached don't follow the parent" problem. Is what I want not possible out of the box? It can't be a replication issue, because I'm simply playing in a single process in PIE with no dedicated server option

#

I can attach player characters that are up and moving

#

once ragdoll hits, the scene explorer shows that I attached the character, but that character stays on the floor and doesn't move.

brazen anvil
crystal crag
#

No, but it sounds like a shell for SkyNet, meaning we are about to be taken over by machines.

crystal crag
#

So it has to be something to do with ragdoll. I can see that the capsule never attaches, even though the scene panel shows that the actor gets attached and the attach to actor returns true underneath my character in both scenarios (non-rag doll and ragdoll targets) - the non-ragdoll target does properly attach; the ragdoll one doesn't.

#

Both scenarios show the target attached in the Outliner though...

#

Setting the custom movement mode to flying instead of none makes the capsule attach, but the mesh doesn't move.

#

This is starting to feel like it belongs as a custom movement mode, not using attachment at all.

buoyant wedge
#

Hello. I have problem with the head bone in my FPS. I have try to set hide bone by name only on client but not work on server. I have also try to use 2 skeletal mesh 1 for the client and 1 that run on server but I don't like the fact I need to call in c++ two similar anim istance to get the right result. So, anyone have a better idea? Why I have that problem with the head and I always replicate?

crystal crag
#

Or maybe I should look into physics handles? That doesn't look like it is replicated by default though

timber nacelle
#

I have Seamless travel working in standalone application, but I am experiencing crashes in getting the seamless travel to work in editor.

What are the bare minimum requirements to make net.AllowPIESeamlessTravel true work? I am seeing multiple crashes in the below functions consistently, but it's not really clear as the crash keeps on changing places.

It is mostly Read Access Violation/nullptr exceptions.

Please let me know if any other information is required for resolving the above issue

thin stratus
timber nacelle
#

Following up on my previous question about seamless travel, I read from the online resources that all the UserWidgets would be carried to the next level, but I am not seeing any user widgets being carried to the destination map, is this the new expected behavior or I have done something different which might be causing it? I am currently using UE 5.2.1

wheat niche
#

Hey i have a question where should i implement my multiplayer rpc that changes the ready status from my player? Currently i implemented this inside PlayerState

latent heart
#

Makes no real difference.

#

Player state is a more fitting place, really.

wheat niche
latent heart
#

As it's a state of the player itself and not of hte character they control.

wheat niche
thin stratus
timber nacelle
thin stratus
#

The rest is probably a correct assumption

latent heart
#

Widgets are owned by the GI I think.

#

Or some are.

thin stratus
#

Not sure what happens if you don't add the owner pin

#

Maybe it falls back to GI yeah

latent heart
#

I seem to remember there being an option, world, pc or gi. Any other parent throws an error.

#

But I don't recall if using world/pc then fetches the gi.

timber nacelle
#

This seems to be the requirement for an owner, so I won't be surprised if UE tries to fallback to either of those when one is not available

thin stratus
#

But they work without supplying one

#

That's what I meant

sharp plover
#

Wouldnt want all the updates to be reliable to clog up the network

fathom aspen
#

The actor has continuous updates happening
If by this you mean that you are constantly sending replicated properties, then yeah that might be a problem for unreliables since unreliables take the same path of replication as replicated properties, and the latter might have higher prio than the former, but I'm not 100% on this... needs debugging
I also hope that your net update frequency is not set to anything less than 1

sharp plover
#

Everything works if it's set to reliable (Event from client to server works unreliable, but not multicasts from the server)

fathom aspen
#

Yeah it should be pretty straightforward since you passed the previously mentioned criterias... nothing wrong from what I can tell

sharp plover
#

Could be an engine bug? I'm currently using 5.2

fathom aspen
#

I don't think so if you're using the defaul replication system and not Iris

sharp plover
#

Default yeah

#

Also scratching my head why it doesn't work, thought of creating a new project and making the same example from there to see if it's still present

fathom aspen
#

Would be a pain in the arse if the project is at a mature stage

#

Wouldn't be a big deal if you're just starting out

#

But in any case if I had cpp access I would have debugged this down futher and found out what unreal shenanigan is causing this

sharp plover
#

Yeah unfortunately I won't be able to migrate the project over if it works in the new example project, too many things to move over. I'll see what I can do, thank you for the hellp

wheat niche
#
class BACKROOMS_API ALobbyPlayerState : public APlayerState
{
    GENERATED_BODY()
public:
    ALobbyPlayerState();

    UPROPERTY(Replicated, BlueprintReadOnly, Category="LobbyPlayerState")
    bool IsReady;
    
    UFUNCTION(NetMulticast, Reliable, WithValidation)
    void ServerUpdateReadyStatus(bool NewStatus);

    UFUNCTION(Server, Reliable, WithValidation)
    void ClientUpdateReadyStatus(bool NewStatus);

    UFUNCTION(BlueprintCallable, Category="LobbyPlayerState")
    void UpdateReadyStatus(bool NewStatus);
    
    virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty> & OutLifetimeProps) const override;
};

ALobbyPlayerState::ALobbyPlayerState()
{
    bReplicates = true;
    IsReady = false;
}

void ALobbyPlayerState::ServerUpdateReadyStatus_Implementation(bool NewStatus)
{
    IsReady = NewStatus;
}

bool ALobbyPlayerState::ServerUpdateReadyStatus_Validate(bool NewStatus)
{
    return true;
}


void ALobbyPlayerState::ClientUpdateReadyStatus_Implementation(bool NewStatus)
{
    IsReady = NewStatus;
    ServerUpdateReadyStatus(NewStatus);
}

bool ALobbyPlayerState::ClientUpdateReadyStatus_Validate(bool NewStatus)
{
    return true;
}

void ALobbyPlayerState::UpdateReadyStatus(bool NewStatus)
{
    if(HasAuthority())
    {
        ServerUpdateReadyStatus(NewStatus);
    } else
    {
        ClientUpdateReadyStatus(NewStatus);
    }
}

void ALobbyPlayerState::GetLifetimeReplicatedProps(TArray< FLifetimeProperty > & OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);
    DOREPLIFETIME(ALobbyPlayerState, IsReady);
}```

hey i have the problem that if the client calls UpdateReadyStatus that nothing happens
fossil spoke
#

@wheat niche Why are you using a Multicast RPC to update a Replicated Property?

#

IsReady will be set on Clients when ClientUpdateReadyStatus is called and replicated, you dont need to also call ServerUpdateReadyStatus as well.

wheat niche
#

Because I want to change the value on the client and the server should see the updated value

#

Basically I have a player list with the ready status

#

And if a player pressed a button the status changes

wheat niche
fossil spoke
#

Just stop ServerUpdateReadyStatus from being an RPC

#

Remove NetMulticast

#

And remove its call from ClientUpdateReadyStatus

wheat niche
#

So I just need the UpdateReadyStatus function and inside there I change the bool?

manic trail
#

Why is multiplayer so hard to set up for blueprints

#

eos doesnt play ball

#

all i want is peer to peer via epic games or even port forwarded ip address

fossil spoke
#

@manic trail EOS doesnt make UE P2P in terms of its Server-Client architecture.

#

EOS uses P2P for its network traffic negotiation.

#

UE is still Server authoritative

manic trail
#

Can you make p2p without eos?

fossil spoke
#

You wont make UE P2P at all.

#

Its just not how its designed

#

There is no "Host Migration" in UE

#

It is not P2P in any sense

#

And never will be

wheat niche
# fossil spoke Sure If you want to do that

yea it didnt work as i said i have a player list and right nerxt to the player names is the ready status lets say a client tries to change the sttaus the status next to the player name should update for all players

fossil spoke
#

I understand what your trying to do, but if a Widget isnt changing, thats likely not an issue with your network code, more an issue with how you are trying to change the Widget

wheat niche
fossil spoke
#

"the status next to the player name should update for all players"

fossil spoke
# short arrow Bump

Can you explain your question a little more? Im not sure exactly what you are asking?

#

Actors are never replicated every frame, they are replicated according to their NetFrequency.

#

Which is unlikely to ever be every frame.

short arrow
#

I think it's the replicationgraph equivalent to net update frequency?

#

Maybe I should gather more accurate information and ask again with more details. I only understand half of what I'm talking about

fossil spoke
#

If an Actor isnt contained in any relevant bucket of the rep graph to a particular connection its not considered relevant and will be removed on the client until a time that it becomes relevant to them again

#

RepGraph is just a different way to handle relevancy.

short arrow
#

Is there a way to turn that off?

fossil spoke
#

What do you mean?

#

You can make Actor always relevent

#

There is a flag for that

#

The PlayerState is a good example

#

They are Always Relevant for obvious reasons

short arrow
#

I mean I want some actors to not be destroyed on clients when they are not relevant

#

Or would that be why dormancy exists?

#

Dormancy seems to work much different for the replication graoh

fossil spoke
#

Dormancy is a separate thing

#

Dormancy is essentially deciding if the Actor should replicate at all

#

Regardless of its relevancy

#

Its a server side optimization

short arrow
#

Right that doesn't doesn't to work for replication graph. I have thousands of actors that I need to avoid being checked for replication

fossil spoke
#

So set them dormant?

short arrow
#

But using spatialize_dormancy is destroying them on clients unless it's a listen server 🤔

fossil spoke
#

The Host is the Server

#

So they will always have all Actors

#

Regardless of the situation

short arrow
#

I mean if I do a dedicated server, those soatialize_dormancy actors are destroyed.

fossil spoke
#

Yes because non relevant actors are removed on clients

#

Thats literally its purpose

#

Why do you need to keep them around?

#

On the Client?

#

What are they doing?

short arrow
#

The issue here is even the ones that should be relevant aren't. Like they are within the cull distance

#

Maybe it's possible my replicationgraph settings for the grid is just not good

fossil spoke
#

So the NetCullDistance on the Actor itself has nothing to do with RepGraph.

#

Your RepGraph settings and more specifically the bucket settings will determine which Actors are relevant

#

So if your grid is smaller than you think

#

Its likely culling those Actors when you dont want them culled.

#

You also didnt answer my questions above.

short arrow
#

Ah, so I am using a pool method for about 5k+ plant fiber

#

And they're all being checked for replication when they aren't even active

fossil spoke
#

"plant fiber" means nothing to me?

short arrow
#

In this case, there are 5k plant fibers that likely aren't relevant to anyone, but a few that are relevant to some. After reading what you said I realize that I wasn't making any sense

#

I dont want actors relevant that shouldn't be relevant. The problem is the opposite

#

There are some actors that aren't relevant that should be

#

It probably is just an issue with the buckets and the grids

fossil spoke
#

Sounds like it.

#

Also, no idea why you would ever want 5k replicating Actors

#

Sounds more like a system you want to create a persistent manager for.

#

Instead of the individual Actors all replicating, they would be associated with a single "manager" actor which handles the replication and rpcs for them.

#

RepGraph doesnt just magically solve "I want to have thousands of replicated Actors" issue.

#

It still has its limitations.

#

RepGraph is more of a Server Side CPU optimization

#

Its reducing the number of Actors it needs to consider for replication.

#

Thus reducing CPU overhead.

#

As soon as you start to get into the hundreds of Replicated Actors, you are looking at a problem that needs a novel solution.

twin juniper
short arrow
#

We initially thought replication graph meant that we could have 50,000 actors replicating without an issue. We sort of done have a choice either because we use a building system similar to rust

fossil spoke
#

50k replicating actors all at once???

#

Jesus

short arrow
#

Well sort of. The idea is to make some rules to stop them from actually replicating using the replication graph haha

#

The problem is when I do stop them from replicatingm.. they get destroyed

fossil spoke
#

Thats the point.

#

The Actor Channel is destroyed to that Client for that Actor

short arrow
#

Fortnite boasts over 50k replicating actors, unless they're sort of lying and those actors aren't independent actors

fossil spoke
#

They probably arent lying, but dude. Fortnite has a billion dollar AAA company making it.

#

You need to be realistic here.

short arrow
#

I mean yeah 😂 but I imagined that's what the replication graph was for. I'm sure we'll be able to figure something out. Even if it's not actually 50k

#

Maybe I will have to be realistic and not go for individual actors

fossil spoke
#

RepGraph is one part of many parts that make it possible

#

As i said earlier, it isnt a magic solution

#

Its one part of the solution.

short arrow
#

So what would be the alternative? A manager with a struct containing buildpart information, and have the client build that information on their own?

fossil spoke
#

What on earth do you mean by "buildpart information". When asking questions, its really helpful to either explain in very specific detail what you are asking, or abstract details of your game out of your question so it can be answered generically.

#

I have no idea what you mean by that

#

A manager like I explained earlier would be a good place to start

#

Especially for Actors which are all essentially the same

#

If your map needed 2000 doors that open and close

#

No point making those all 2000 individual replicated doors

#

Just make one "door manager" which understands and keeps track of the state of all doors

#

Yes its more messing about, but its more efficient.

short arrow
#

But that could leave to a massive struct array which is what I'm sort of worried about, does unreal deal with this in an efficient way?

fossil spoke
#

What do you mean a massive struct?

#

Yes, UE has a solution for that

#

Look into FastArrays

#

Fast Array Serialization

short arrow
#

Let's continue using the doors as an example, players will be able to create their own anytime they like. If the manager is keeping track of all those doors in an array. It'd get pretty good.

#

I see

#

I will look into that then, thanks for the advice. I appreciate it a lot

fossil spoke
#

You also dont need to have just 1 manager

#

You could create a manager for every 1000 doors

#

For example

#

That would load balance

#

You could even move doors between managers that have different update rates

#

If a manager has only doors in it which have never been touched, that manager itself could go Dormant

#

So if there were 2 door managers

#

each with 1000 doors

#

And one of the managers contains all door states which have never changed

#

It can go dormant

#

There goes 50% of the replicated state

#

Not needing to be checked

#

This is very similar to how RepGraph works

#

Or at least, can work.

short arrow
#

Oh I seeee

fossil spoke
#

Also, its been foreshadowed that RepGraph will become obsolete in UE5

short arrow
#

This a great idea

fossil spoke
#

With the Iris networking model

#

So if you are on UE5 you may want to consider looking into that

short arrow
#

I heard about that aswell but who knows when unreal engine will follow through with what they say. They tend to take their time

fossil spoke
#

But honestly, your issue isnt that you are using RepGraph

#

Its more your misunderstanding of RepGraphs usage

short arrow
#

Yeah that makes sense, I'm only on day 4 with the system and it's quite complicated

fossil spoke
#

If you have hundreds of the same types of Actors that need to replicate, create a manager for them instead.

#

Using Fast Arrays to hold and update their state data.

#

The Manager would also deal with RPCs for those Actors to if necessary.

short arrow
#

And so these managers would need to be always relevant right?

fossil spoke
#

Yes

short arrow
#

So essentially these doors would never be culled then right? Only through gpu?

#

I guess no more delays and looped code

fossil spoke
#

Well the doors would not even be replication enabled

short arrow
#

Sounds worth it though

fossil spoke
#

Only through gpu? rendering culls is nothing the same as network culls.

#

A Rendering Cull only removes the geometry, it does not affect the Actor in any other way.

short arrow
#

Right, it wouldn't be a hit to clients performance because they'd still be rendered out

#

So I'd just need to be careful how I program these doors

fossil spoke
#

The doors are only a visual representation and interaction interface for the state data on the Manager.

#

The tricky part, is associating an individual door, with its correct data on the manager.

#

Which isnt really tricky, you just need to have an appropriate ID system

#
{
    FGuid DoorID;
    bool bDoorOpen;
}
#

This is likely all you need for the door managers struct

#

An ID to associate to a Door Actor

#

and then its actual state

short arrow
#

Are FGUID's not a lot to replicate?

#

Wouldn't it be better to just use an int

fossil spoke
#

They are, but im just using it as an easy example

chrome bay
#

Just use a ptr tbh

short arrow
#

But I completely understand the fundamentals hrre

chrome bay
#

Or, assign ID's to doors deterministically, replicate a packed array of bitmasks

short arrow
#

Here*. I spent a lot of time with UNetDriver. I just thought ReplicationGraph would be a much safer process

#

I guess I was wrong

chrome bay
#

Did that for something non-door related but, works well.

fossil spoke
#

There is certainly more efficient means to manage this

#

I was only being obtuse for clarity

#

on the fundamentals

short arrow
#

Ah I see, yeah I think I could get away with using Pointers for my game

#

I really appreciate all the insight

#

Hard to find this kind of information and ideas

fossil spoke
#

You would only use a Ptr if the door is statically placed in the level.

#

If you have Players creating doors

short arrow
#

Oh right

fossil spoke
#

Then you need a system where you can deterministically create the IDs

#

Like Jambax mentioned

short arrow
#

Right right got it. You guys are 🔥

#

Can't thank you enough for taking the time

fossil spoke
#

You have a lot to work through and research.

#

Good luck.

fathom aspen
#

You literally find such clients, and send them the said RPC

fossil spoke
#

You would route it through their PlayerControllers.

undone notch
#

for VPS Server which one would be good AWS Vps or OVH or Azure VPS < I want a vps for my shooting game

#

as chep rate

#

🥲

#

any suggestion

sick flint
#

Hi, I've programmed my character controller to pick up an actor and carry it on his back. He does this by attaching the actor to a socket on his back.

Unfortunately the socketed actor stops replicating its position across the server, only magically voiping over to its correct position when detached.

How do I make a socketed object continue replicating its position? Or do I need to replicate the fact that it's been attached?

whole solar
sick flint
#

So how do I let every client know that the object is now socketed, so it follows the parent objects motion?

whole solar
#

Or I may be wrong, then an RPC can be sent to notify clients.

thin stratus
twin juniper
#

Thanks definitely will try it !

sick flint
whole solar
sick flint
#

yep

whole solar
# sick flint yep

I tested it in my project and it works fine. Maybe you have a mistake somewhere.

#

AttachActor() was executed only on the server, but on clients the actor moved with the character.

sick flint
#

Crap, I guess I'll try it again in a fresh project to see if there's something else breaking it along the way. Very strange, I initially was using a physics constraint to drag the object around and that replicated fine, I just swapped that out for an AttachActorToComponent node.

whole solar
candid shuttle
#

Is this the right chat for animation replication?

candid shuttle
#

ah ok

#

nice

thin stratus
#

And we never heard of them again

wheat niche
#

Hey i have a question after reading some articles and watching videos i only got examples on how to replicate variables from the server to the client but i want to have a ariable that the server and the client can modify is there a way?

thin stratus
wheat niche
thin stratus
#

You mean so that it replicates to everyone?

thin stratus
#

You would need to use a Client Owned Actor (such as PlayerController, Possessed Pawn/Character, PlayerState or a properly setup Actor that has any of those as Owner) to perform a Server RPC and then change the value on the Server side.

wheat niche
# thin stratus You would need to use a Client Owned Actor (such as PlayerController, Possessed ...
#include "Net/UnrealNetwork.h"

ALobbyPlayerState::ALobbyPlayerState()
{
    bReplicates = true;
    IsReady = false;
}

void ALobbyPlayerState::ServerUpdateReadyStatus_Implementation(bool NewStatus)
{
    GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, TEXT("Called ServerUpdateReadyStatus_Implementation"));
    IsReady = NewStatus;
}

bool ALobbyPlayerState::ServerUpdateReadyStatus_Validate(bool NewStatus)
{
    return true;
}


void ALobbyPlayerState::ClientUpdateReadyStatus_Implementation(bool NewStatus)
{
    GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, TEXT("Called ClientUpdateReadyStatus_Implementation"));
    IsReady = NewStatus;
    ServerUpdateReadyStatus_Implementation(NewStatus);
}

bool ALobbyPlayerState::ClientUpdateReadyStatus_Validate(bool NewStatus)
{
    return true;
}

void ALobbyPlayerState::UpdateReadyStatus(bool NewStatus)
{
    if(HasAuthority())
    {
        ServerUpdateReadyStatus(NewStatus);
    } else
    {
        GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, TEXT("No authority"));
        ClientUpdateReadyStatus_Implementation(NewStatus);
    }
}

void ALobbyPlayerState::GetLifetimeReplicatedProps(TArray< FLifetimeProperty > & OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);
    DOREPLIFETIME(ALobbyPlayerState, IsReady);
}

Like this?

thin stratus
#

The Client RPC seems redundant

#

Since the Variable is already marked to replicate

#

That can just be a normal function

#

That sets the variable locally like you already do

#

And then ServerRPCs for the change to be applied by the server

#

So yeah it's okay just the client RPC isn't needed

#

And in theory the server doesn't need to call the RPC either

wheat niche
#

okay the problem is that ServerUpdateReadyStatus_Implementation gets called from the client but nothing happens (value does not change)

UPROPERTY(Replicated, BlueprintReadOnly, Category="LobbyPlayerState")
bool IsReady;

UFUNCTION(NetMulticast, Reliable, WithValidation)
void ServerUpdateReadyStatus(bool NewStatus);

UFUNCTION(BlueprintCallable, Category="LobbyPlayerState")
void UpdateReadyStatus(bool NewStatus);

thin stratus
#

Multicast is also not needed

#

I'm at my phone so can't easily type code.

#

But the idea is:

  1. SetReadyStatus(NewReadyStatus) sets ReadyStatus and if Client also calls the ServerRPC
  2. ServerRPC sets ReadyStatus
  3. ReadyStatus being replicated

Optionally ReadyStatus can he RepNotify (ReplicatedUsing) to notify clients about the change. Would need to manually call the OnRep function on server though if you need that to call for them too (e g. Listen server)

wheat niche
# thin stratus But the idea is: 1. SetReadyStatus(NewReadyStatus) sets ReadyStatus and if Clie...

As you can see i have two players in my list left is the server and right the client the first player in the list is the server and the second the client if i try to change the ready status it tries to change the tsatus from the server as you can see i printed the name from the player and in the server and client i have the same name why is that i started the game standalone netmode listen server and i tried netmode standalone

thin stratus
#

No clue. That part of your code is fine

#

But I just told you the setup

#

Adjust it first

wheat niche
thin stratus
#

Eh yes

wheat niche
candid shuttle
sick flint
candid shuttle
#

So I have some problems with animation replication, the advanced locomotion plugin to be exact, and I made everything work for multiplayer for my needs. Now in ALS there are two things that somehow work for my clients' client side and the server's all-seeing side of things but everyone should see them.

#

So my first problem is the aimoffset, which i got to work vertically but somehow not horizontallly

#

It is handled through the control rotation variable passed to the animBP and then mixed with other variables to output the aimopffset rotation

#

Or the base aim rotation but they lead to the same result

#

For the animation transitions I use these gates:

#

With states like this:

faint eagle
#

what is the typical good average size of both incoming/outgoing packet for 4 players coop game for listen server? i mean are there any golden standards budget saying that "if your coop game host sends more than 6k bits a packet it's going to throttle" and such?

rotund sapphire
#

@faint eagle 6k bits should fit into udp's MTU limit which is a good number for online gameplay indeed. For local network you can ofc stretch the bounds here quite a bit because the low latency / high bandwidth available. The inis provide ways to setup these limits many ways. I think throttling is a false statement in that context.. You may sometimes get throttled / trimmed on the internet for a short moment (by a random intermediate provider in the link between you and target), but it really is not your problem to be fair, that's just how internet works.

faint eagle
# rotund sapphire <@291987650234023946> 6k bits should fit into udp's MTU limit which is a good nu...

hm, ok, and what about 8k-10k packet size? I remember reading something about MTU half a year ago but I've already forgot what are the current limits (if there are any) for unreal and how can it be configured (and should it be at all). I also remember there are these Rates and Speeds to configure in DefaultEngine.ini, but again, I can't remember what's the rule of thumb to set the correct values

rotund sapphire
#

MTU limit is more like the limitation of the internet, and it's often 1500 bytes. These limits may vary depending on the network, but it's always best to stay on the safe side :) Again, local net is relatively unbound.

#

An unreal 10k packet may be split into 6-7 udp packets, depending on your network card's settings.

faint eagle
#

well currently I'm much more concerned about global net

rotund sapphire
#

Afaik 1500 MTU (about 12kbits) should work in most countries/provider - for a single packet that is, but the less is always the better. :)

#

I just checked all my network interfaces are currently set to 1500 by default (on win10).

rotund sapphire
# candid shuttle nvm got it myself

ALS have community made cpp based variants on github which claim to be having advanced networking and all that. The marketplace als is just outdated, and it may fail quickly in many cases.

whole pine
#

if i have a multicast event that adds chat results into a scrollbox any time a client sends a message, how do i make it so only pawns overlapping a trigger volume see messages sent by pawns overlapping that same trigger volume

rotund sapphire
#

@whole pine AActor::IsNetRelevantFor is virtual you can override and try implement your custom filter logic there. But i think there are other ways around this too, even a purely blueprint solution can work if you manually specify each owning client and send the data via events only where it belongs to. Altho the former are considered clean, yet the easy (and dirty) solution is just not displaying the message on the receiving end when the client do not qualify. I wouldnt recommend this last one but it seems another way to solve this i guess.

candid shuttle
#

But got it to work for me perfectly

#

Thank you anyways though

rotund sapphire
#

Aye but networking is very limited in bp and many things can only be done in cpp, so you need to catch up sooner or later. FYI you can always extend your blueprint only project to contain cpp which would allow you to go deeper in the replication-rabbithole (when needed ofc).

rotund onyx
#

what is the correct way to inform the client that they need to update their UI?
I can't for the life of me figure this out. Right now I have the server calling a "Run on Owning Client" event in the PC, which then calls an Event Dispatcher. This does not work for some reason and I have no clue why not...

shrewd ginkgo
#

I made multiplayer door, if server open door everything ok but if client cant

candid shuttle
ivory bear
#

Can you replication pitch (camera or other) with an animation blueprint? I put a cube on the screen, 2 players and other player can see all the server rotations (pitch, roll), but server can other player rotate, no pitch. I know when I have an animation blueprint, and replicate a pitch var and use it in the animation, it works.

real ridge
#

Guys how it is possible I get different looks and output when I test multiplayer in Editor by adding more clients and different when I deploy dedicated server and join there?

zenith wyvern
#

Why would this 'run on owning client' run on the server and not the client 'sometimes'

zenith wyvern
#

Nevermind. My fucking dead NPC was picking up his own loot

#

I r rere

short arrow
#

Anyone know where I can find an example of Fast TArray Replication usage? I just spent about 5 hours figuring out FFastArraySerializer structs only to find out that it doesn't support replicated variables 🤦 So I guess I'm missing something...

fossil spoke
#

There is a clear example of its usage in the NetSerialization header

#

If you are using UE5

#

Its in FastArraySerializer.h

short arrow
#

FExampleArray is the struct from the example you mentioned

fossil spoke
#

Why would you use that?

#

You realize its called that because its only an example

#

Not actual usable code

#

Because its not even compiled

#

It is wrapped in #if 0

short arrow
#

Right, I copied the entire thing and put it in my header

fossil spoke
#

🤦

short arrow
#

the variable can't be replicated

#

you are good at making me feel stupid 😂

fossil spoke
#

Follow the steps in the example with your own type.

#

Dont copy paste the entire thing

#

FastArrays are used all over the engine, they work, they do replicate (they are literally built for it).

#

If you want a "simple" working example

#

Look at the GameplayPrediction.h where the Prediction Keys are handled

#

Right at the bottom

#

FReplicatedPredictionKeyItem

#

FReplicatedPredictionKeyMap

#
    UPROPERTY(Replicated)
    FReplicatedPredictionKeyMap ReplicatedPredictionKeyMap;
#

Is in the AbilitySystemComponent.h

short arrow
#

Alright got it, really appreciate it!

mortal mica
#

qq, I think I did this before but i can't remember how, I have an actor i'm spawning on the server, and it has an expose on spawn parameter, that I pass to it. But obviously the replicated copy of the actor doesn't receive that property that is set on the server, how should I handle this ?

#

(im using this property inside OnConstruction, to do some stuff)

#

should I just use a repnotify and move that logic from onconstruction to the rep ?

fathom aspen
#

No, it's not, the engine was not designed to support that... as simple as that. Usually people in here want that for rollback, and it's unnecssary as you could use a non-destructive synced network clock

#

Yeah it's new twitter rules I guess, you have to login

#

devtricks goes over synced network clocks fyi

hollow eagle
#

rollback is what cs and valorant use.

fathom aspen
#

Assuming we are talking about a dynamic actor

hollow eagle
#

CMC also has limited rollback, but that's for resolving mispredictions on the client rather than lag compensation on the server.

fossil spoke
#

Rollback is overkill unless you are trying to make the next big Esport FPS

#

IMO

hollow eagle
#

then that's all the more reason to not do anything related to rollback aside from what you get out of the box with CMC

fossil spoke
#

Then forget about rollback

hollow eagle
#

that has nothing to do with rollback

#

it's easier to implement without rollback

fossil spoke
#

Rollback isnt an "afterthought"

#

You either know you want/need it from the get go, or you just dont do it at all.

fathom aspen
#

See why I love my current job, I don't have to care about rollback

fossil spoke
#

Not to an afterthought PVP mode

hollow eagle
#

The point of rollback is not making things feel smooth or responsive - you can do that much more easily by simply having (limited) trust in the client.
The point of rollback is letting clients predict inputs while still being entirely server-authoritative.

fathom aspen
fossil spoke
hollow eagle
#

And that is incorrect, in terms of server rollback.

#

In terms of client rollback CMC already does so.

#

The point of the server performing rollback is verifying that what a client said actually happened.
The point of client rollback is resimulating on top of confirmed movements from the server to reconcile inputs that haven't been confirmed by the server yet, which CMC does out of the box.

fathom aspen
#

Would be insane if CMC didn't do that

#

I would personally move to unity

hollow eagle
#

Unless you have purely client authoritative movement it'd be impossible to make a usable networked movement system without it.

mortal mica
fathom aspen
#

I'm not really keen on their replication, but I would imagine not

hollow eagle
#

That's really not necessary in anything except a 1-on-1 fighting game

fathom aspen
hollow eagle
#

It will actively make things feel worse everywhere else

hollow eagle
#

Actually, I think we're both misinterpreting what you think you just said. Fighting games do not delay inputs, they delay corrections from the server.

#

Which is what just about every game involving any kind of rollback does.

#

You cannot apply server state immediately, you interp to it over a short period of time.

#

Applying server state with no interp would cause jitteryness at best and choppyness/teleporting at worst.

#

Ignore the stuff about tickrates, it's not relevant.

#

That is specific to fighting games.

#

And is only possible because you're not using a camera that is completely tethered to your character.

#

Because you can outright feel that kind of latency in a first person game.

mortal mica
#

any type of correction/jerkiness on a camera is way more noticeable

hollow eagle
#

It's also completely unnecessary in anything except fighting games where frame accuracy is valued.

#

Still would feel bad.

bitter swift
#

I am trying to compile with SteamAPI_Init() but I get an error. Probably something I'm not #including. I can see on the internet many people have the problem but no solution. I made sure steamworks is intergrated into my project. Is there something I forgot to add in the module? Please let me know.

hollow eagle
#

And no one cares if your client needs to move 0.1 units to the left in anything but a fighting game where pixel-perfect hitboxes matter.

#

It's beyond unnecessary to care about in pretty much any other genre.

mortal mica
#

do people still play fighting games? 😛

#

i need to buy the new mk1 to try it out...

hollow eagle
#

Yes?

#

It's not a good concept.

#

It's required for fighting games to feel right. It's not a good thing to have.

#

Introducing purposeful latency is a bad thing. You do it if absolutely necessary, not because it's "neat".

mortal mica
fathom aspen
#

Well you have to internally replicate it if you're missing that

mortal mica
#

you mean have 2 properties ?

fathom aspen
#

Nah, I mean to mark it to replicate

mortal mica
#

ah yeah i did

#
UPROPERTY(BlueprintReadWrite, meta = (ExposeOnSpawn = "true"), SaveGame, ReplicatedUsing = OnRep_ConstructableData)
UConstructableRecipeData* ConstructableData;
fathom aspen
#

It should replicate just fine then

mortal mica
#

but the rep is not called

#

mmm

fathom aspen
#

I mean I'm not sure what that UObject is, but if it's a regular UObject then you need to replicate it the old way via ReplicateSubobjects or the new way

mortal mica
#

it's a UPrimaryAsset

#

well, a ptr to one

#

I'm replicating them in other places just fine

daring arch
#

Hi!

I'm trying to make it so that the server is always in spectator mode. I dont want the server to have a pawn.

So, I'm trying to override the gamemode's Handle Starting New Player function.

But I don't know what it does by default. Is there any place where I can view its default implementation?

mortal mica
#

so im assuming that part works

fathom aspen
#

But yeah they should be net referencable out of the box

daring arch
#

nope! not using source. i am trying to make a poor man's headless build, for quick testing.

fathom aspen
#

I don't mean building from source if that's what you're thinking of. Literally an IDE that has your project solution open

daring arch
#

Oh, yeah! Yeah, i've got Rider open

#

however, everytime I try looking at HandleStartingNewPlayer from GameModeBase.cpp, i'm just sent to GameModeBase.gen.cpp's implementation

#

which....isn't very helpful:

#
void AGameModeBase::HandleStartingNewPlayer(APlayerController* NewPlayer)
    {
        GameModeBase_eventHandleStartingNewPlayer_Parms Parms;
        Parms.NewPlayer=NewPlayer;
        ProcessEvent(FindFunctionChecked(NAME_AGameModeBase_HandleStartingNewPlayer),&Parms);
    }
fathom aspen
#

That's the reason since sadly Rider can't handle jumping to BlueprintNativeEvent functions

#

You need to look for the function suffixed with _Implementation in the .cpp

#

To be honest I think this should be an easy fix, but it's just that they didn't get bothered to do

hollow eagle
#

It normally works fine.

#

I believe rider has an issue specifically when the _Implementation isn't declared in the header.

fathom aspen
#

Ah makes sense. I can't recall how RPCs behaved in this regard

#

But yeah they work on a good day

daring arch
#

Yeah, looking for the Impl one works great! I can now replicate that

#

thank you so much for the help!

mortal mica
#

if a property is marked as RepNotify from C++, and set from BPs... should the BP node say "Set" or "Set w/Notify" ?

small grail
# mortal mica

I didn't remember you need to change the option. But it was in 4. Not sure about 5

mortal mica
#

what do you mean change the option ?

#

I didn't check that box, im just pointing out that the property IS tagged repnotify

small grail
#

Like you need to make it "Set w/Notify"

mortal mica
#

but the BP node doesn't seem to show that it's w/nofity

small grail
#

Just "set" it simiply

mortal mica
#

oh it's just set

small grail
#

It should call back in the code

mortal mica
#

but BPs show w/Notify if you do that on a repnotify property

small grail
mortal mica
#

with BP variables you also use set... but the node just shows a different title

#

it doesn't seem to do that with C++ vars

#

im just wondering if im missing something or it has always been like that

#

i dont recall 🙂

small grail
mortal mica
#

thing is my C++ notify is not called 😐

#

so im trying to figure out what's wrong

small grail
mortal mica
#

i have both server and client

#

i put a breakpoint and a print to screen in the notify, it's not called

small grail
#

Did you change the value? If not, it won't call either.

mortal mica
#

oh wait

#

i forgot to add Test to my GetLifetimeReplicatedProps

#

😄

small grail
#

Yeah, this is often get missed while adding a new variable. And it won't give you an compilation error

mortal mica
#

yeah silly me, i was just doing a quick comparison between bp and c++ forgot that

#

heh

#

also it's quite misleading how that GetLifetimeReplicatedProps doesnt need a header declaration...

tired current
#

Hey so i am making a local multiplayer game, I have this weird thing where its seemingly random if gamepads are detected and working in the engine. Sometimes I get 2 to work, sometimes only 1 ever works, sometimes neither work. I just keep trying random things like restarting the editor or re-plugging in the gamepads. one time I added a print string to the blueprint and both gamepads starting working? super confused if anyone knows a good way to go about debugging this please let me know.

pseudo wagon
#

Hi, Does anyone has issue when teleport character and CharacterMovementComponent does some net correction, that cause player lag.

rustic ridge
#

Hello everyone, I recently started learning networking and replication in UE, why doesn't this code work? (I call TryGrapple from Ability which is on the server and client) the idea was that I take the client version of AttachPoint and assign the client version to the server version of AttachPoint

#

So when Grapple phys function starts, server uses its own verision(which i sync with client before)

thin stratus
#

Cause by default it's not

#

The RPCs go through the Character

rustic ridge
#

I don’t quite understand how this affects, without this flag there will be no CMC on the server

#

Or what?

rustic ridge
grave lynx
#

I EnableInput of a actor. To execute server RPC, I need to change the owner right? My character or his controller need to be the owner?

queen escarp
#

can someone clarify why this is not working :/

#

when im chaning the input mode to UI only that works but it never goes back

#

that dosent work

hoary spear
#

Is it possible in any scenario for a server rpc event not to be.. .well.. on the server? Feels a little redundant to check if it is the server ..

small grail
#

I guess some reason if because of listen server? Like you actually has both roles as server and client.

hoary spear
#

right but in that case the client is the server, so it's just always on the server and never called as an RPC ?

small grail
thin stratus
#

The stuff you are doing there is also mildly wrong

#

You wouldn't send additional rpcs

#

You'd send a flag that the player is pressing the grapple key via the already existing ServerMove rpc similar to jumping and crouching

#

And then perform the grapple logic on both sides via e.g. PeformMovement or similar.

winged vault
#

How do I replicate a UNiagaraComponent It's showing on my server but not on my client

sly cape
#

Hey Cedric, I somehow got to your blog and from it to this suggested video:
https://youtu.be/RtQRMcupJs0?feature=shared

Support the channel through donations. Crypto accepted!
PayPal: https://paypal.me/reidschannel?locale.x=en_US
Patreon: https://www.patreon.com/reidschannel
Bitcoin: 1JFwWHr4X6uAeoZadukzqKjzFBj3Qjy7Sk
Ethereum: 0x2B2Bc108F1Cc0fF899959dEF3226637787d8C3dE
Dogecoin: DNQ33YnhpWoTBokBNVkZP5ub8KTLkpyjpv

Join our community discord!
Discord: https://dis...

▶ Play video
#

I wondered if you could explain why using the compressed flags instead of making the RPC got rid of the stuttering because it isn't explained in the video

#

IIUC in both methods there's client prediction, which should cause stuttering in high latency

#

And in both methods there's high latency so why 🤔

sly cape
thin stratus
blissful talon
#

Hello, I need to do a server RPC using Game State Component, however it doesn't allow me to as LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor MyGameState_0. Function MyRPCFunction will not be processed.. Does anyone know what the error actually mean? I've tried to add an on rep property, and it's being replicated to the clients

latent heart
#

It means that either 1) the game state component is spawned client side and the server doesn't know anything about it or 2) it is from the server, but not owned by the client.

#

Generally, you need to send server rpcs from the player controller, player state or player pawn/character owned by the client or any components therein.

blissful talon
latent heart
#

The game state isn't owned by the player.

#

You can't send rpcs via the game state or any of its components.

#

(to the server)

blissful talon
#

So I have to go some other way? 😔

latent heart
#

👍

blissful talon
#

All right, thank you

kindred widget
#

Or Pawn. Whichever makes sense.

blissful talon
#

Yeah, seems like a solution. However what I need is to notify the client about one property only on component spawn. Is it possible to do an onrep that will be fired only on initialization?

#

Previously I wanted to make a server RPC to ask for it, and server would make a client RPC with the value

blissful talon
dire dragon
#

the random value is different on client and server

blissful talon
#

Though it depends when the bunch containing server value will arrive

blissful talon
#

Let only the server write the value you want the client to know

dire dragon
blissful talon
#

The SelectedBurgerName (which I assume is the property that should store the random value) is marked as set w/Notify, hence the client will receive the value server has randomized

dire dragon
blissful talon
#

When it's set to notify the value?

dire dragon
blissful talon
#

I get it, so you have to find out why it's none client-side, hence I'm asking what's the notify set to? When is the value notified to the client?

dire dragon
#

like what's in the function OnRep ?

blissful talon
#

Which one is selected?

dire dragon
blissful talon
#

Uh, how is it going to work when it's set to none? 🤔

dire dragon
#

what should it be set to?

blissful talon
#

It depends on your needs, however I assume it's something you want to be always replicated

dire dragon
#

yea

blissful talon
#

I've tested, and it seems to mean "always replicate"

dire dragon
#

there's no always replicate

#

ohh

#

i know what you mean

#

but why does it say 'None' in the client while something else on the server?

#

even with rep notify

blissful talon
#

Is the rep notify even called client-side?

dire dragon
#

i added print

#

and it only prints the server one

blissful talon
#

What is the property residing in?

#

I mean, is it a component, character, controller?

dire dragon
#

it's an actor in a world

blissful talon
#

Is it replicated?

dire dragon
#

it doesn't replicate to client, but it's set to rep notify

blissful talon
#

If actor is not replicated, it's not going to replicate its properties to others

dire dragon
blissful talon
#

👍

sly cape
#

RPC queue on server? Something in the client code?

thin stratus
#

Because the CMC is setup that way 😅

#

Movement goes through the ServerMove call

#

Not sure what else to tell you.

#

That's how it's meant to be used

sly cape
#

Ok thanks

whole pine
#

how do i detect if i click a nav modifier volume

crystal crag
#

I have discovered the problem with my pickup character / ragdoll logic. I wasn't aware that the mesh actually detached from the capsule component when ragdolled. That would explain the headache that I have been having with this. I am guessing a studio then would just pay an animator to make it look like the character was picking up the mesh via animation and then the capsule would get attached. Then they would simulate a ragdoll appearance through the anim BP as the carrier moves around, similar to processing leans.

manic trail
#

Is it necessary to use the EOS Subsystem to connect to someone's Port Forwarded IP address, or is there a way to only use the join ip command

#

Trying to get a peer to peer multiplayer set up, and can only do it locally or with hamachi (5 player max)

candid shuttle
#

is there a channel for testing packaged games?

latent heart
#

No

#

I don't believe there's anywhere on the server for getting together testers. Maybe the WIP forum might do? But traffic may be low.

silent shard
#

I'm wondering the best practice for projectiles in MP. I have an ability that spawns a projectile, that will live at most 2 seconds.

When testing the game, the connected clients, often don't visually see the projectile, as it seems like it spawns and moves too quickly that it doesn't sync to the client, so they just see the impact effect, but not the projectile itself.

If I spawn the projectile on all clients, then it shows double projectiles occasionally, as the server still is spawning the "real" one.

What is the proper way to do this, so the projectile itself will render for all clients properly? I have been searching and not finding anything, just tons of tutorials on projectiles themselves, but nothing for this specific issue

latent heart
#

If you get double projectiles, simply don't replicate the projectiles.

#

They're effectively just a visual effect for clients.

#

You could send an unreliable multicast RPC for quick firing projectiles?

#

If you send the fire time as well as the start position and projectile type, you can even fast forward it to account for lag.

#

Or maybe simply the time and the player that fired it and work it out locally.

dark edge
silent shard
#

I wasn't using them just a visual effect, they were handling collision information, but I could swap that out so they are just the VFX portion and have them not replicated.

@dark edge I am still pretty new at the multiplayer aspect of unreal, for the server validation, would I just simply take a line trace at the time the projectile fired, and then match that with what the server said it should have hit, and if they match apply damage/impact events etc?

dark edge
#

If your max flight time is like 2 seconds, anything relying on a replicated actor is going to be in a weird state for like one quarter of its lifetime at least.

#

Unless you want to wait ping milliseconds to fire your gun, which I'm guessing you don't

#

There's various ways to do it, but I prefer to just have fairly deterministic projectiles that are not replicated, but their initial conditions are.

silent shard
#

Yeah that makes sense, thank you. And yeah I don't want to wait before the projectile actually fires.
I honestly wouldn't care if this happened for other players, but it happens for your player, where if you fire at something close to you, you never see the projectile, just the impact. But I think changing to not be replicated, spawn unreliable for each client, and then do that server check to apply the actual hit makes sense. Thanks!

latent heart
#

The stuff I was mentioning was more for visual effects of other clients.

silent shard
#

Yeah, I mean it also impacts other clients, but that is less annoying to me (though still want to fix it). And I think doing that unreliable multicast you suggested will fix that issue

#

Would it be appropriate to use a gameplay cue for the projectile effect itself?

#

I currently only use it for the impact

thin stratus
#

Subsystem NULL supports that just fine

latent heart
#

Or just no subsystem and use the console.

thin stratus
#

Wenn NULL is Fallback anyway or not?

#

Can't remember. None can also work I guess

thin stratus
#

The Mover plugin (aka Character Mover 2.0) effort has the goal of massively improving the existing character movement functionality in UE. This is going to be a very large endeavor that has numerous touchpoints in the codebase, ranging from physics to animation to networking.

#

The main goals of this effort are to:

Support all actor types, not only characters

Allow gameplay programmers to focus on movement, less on the complexities of networking.

Improve extensibility and customization through modularity, while empowering non-engineers to craft their own movement.

Expand gameplay possibilities by discarding rigid requirements and improving interactions with physics-simulated objects.

Support a generalized rollback networking model that other systems can also use.

#

Probably might interest a lot of you

latent heart
#

How many millions of lines of code will this be?

thin stratus
#

As long as it's an improvement I frankly don't mind

#

This will probably also entail the NPP

latent heart
#

And it has good documentation and examples!

thin stratus
#

Yeah I actually took the time to mark this whole thing critical

#

Not sure that does much

#

But heyyy

latent heart
#

Maybe it motivates the devs working on it! 🙂

#

I'm interested in how they're going to make the networking work without much dev interaction.

gritty warren
#

Anybody have experience with Custom NetworkMoveData in the CMC?

I am trying to connect GAS with the CMC by incorporating a "MoveSpeed" variable into the network data but I am having some trouble

#

I have a float, I've followed the steps listed in the UE docs in regards to subclassing NetworkMoveData and NetworkMoveDataContainer. I have serialized the data correctly and done all the other steps. The part I'm struggling with is where do I actually call "GetMaxWalkSpeed" (like where do I connect my MoveSpeed float to the actual value) and what should I do with SetMoveFor and PrepMoveFor functions?

red stirrup
#

is there anyone that managed to have active ragdoll working in multiplayer?
is such a thing even possible to implement reliably in unreal?

graceful flame
unborn nimbus
#

Do arrays replicate the whole thing when an index changes or are they smart about the data that is replicated?

#

they're smart aren't they?

gritty warren
kindred widget
gritty warren
#

I have some unresolved symbol errors, but can't figure out what the deal is. Its related to multiplayer code, and I'm pretty sure it has somethign to do with serialization so I'm putting it here. Can someone try and take a stab at it? I don't know how to go about problem-solving in a situation like this:

unresolved external symbol "__declspec(dllimport) bool __cdecl UE::Net::WriteQuantizedVector(int,struct UE::Math::TVector<double> const &,class FArchive &)" (__imp_?WriteQuantizedVector@Net@UE@@YA_NHAEBU?$TVector@N@Math@2@AEAVFArchive@@@Z) referenced in function "bool __cdecl SerializePackedVector<10,24>(struct UE::Math::TVector<double> &,class FArchive &)" (??$SerializePackedVector@$09$0BI@@@YA_NAEAU?$TVector@N@Math@UE@@AEAVFArchive@@@Z)

Note that its in the "SerializePackedVector" section, I'm not sure what is wrong

stray forge
gritty warren
shy gust
#

hey all , what is the correct way to check if a controller is the local playing player? im trying to run some logic specifically for the local player, and logic for connected clients .

fossil spoke
#

@shy gust Do you mean you want to separate logic for the Host from Clients?

#

IsLocallyControlled will let you run code for just the local player

#

Whether its a Client or Host

shy gust
fossil spoke
#

Is this a Split Screen scenario?

#

Your question is confusing, thats exactly what IsLocallyControlled does

#

"Is this Pawn controlled by a Player Controller which is owned by the literal machine controlling it"

#

Thats what its saying.

#

This would be false for remote Clients

#

True for the local Player

#

If its Split Screen then thats a whole different can of worms.

shy gust
#

okay thanks , i just wanted to make sure , as its firing true for both players on the server and on the client , the client is false and the hosting player is true

#

but that tells me the issue is probably somewhere else. and not in the Islocallycontrolled

small grail
shy gust
#

im doing Listen Server

lusty kelp
#

okay okay okay

small grail
lusty kelp
#

u got to umm call replicated for them yes?

#

the full call u made

#

if u want i can show u a quick way to do it

shy gust
lusty kelp
#

no no no u need all u need is add custom nodes

small grail
shy gust
#

i couldve sworn there was a 1 node answer to this , I must be getting my engines mixed up, eitherway much appreciated guys.

fossil spoke
#

@shy gust IsLocallyControlled

#

This is what its for.

#

Listen Server + 1 Client

lusty kelp
#

do what you guys said but do add custom nodes for run on server to client and back

#

it'll work

small grail
fossil spoke
#

@lusty kelp Stop providing unconstructive comments thanks.

lusty kelp
#

do once

fossil spoke
lusty kelp
#

i did

#

i am just telling you that do what the mod said

#

but do add custom nodes to replicate

shy gust
#

no worries I appreciate it smoke

fossil spoke
#

@shy gust BeginPlay could be to early, the RemoteRole may not have updated.

#

Giving you a false positive

#

Add a delay

#

See what happens

shy gust
fossil spoke
#

Im not saying to use a delay to solve it

#

Only to test it

#

Adding delays like that should never be a solution lol

small grail
# fossil spoke Not sure what you mean?

Like the host triggered twice because it has server and client1 from the screenshots (it is right because of listen server). It might have some problem that this logic just wanted to be triggered once?

#

nvm, my mistake. You tried 1 host + 1 client.

#

Listen server always confusing me honestly

shy gust
lusty kelp
#

wow, we need to talk

#

big time my mod man

#

trying to help

#

and u time me out

#

forget this

shy gust
#

you should trying collecting all your thoughts into one message my guy, I appeciate the effort tho

lusty kelp
#

i made my own

#

ty

fossil spoke
#

@lusty kelp Stop derailing the conversation.

#

You are not being constructive, hence the timeout.

small grail
shy gust
fossil spoke
#

Oh sorry, I didnt see the Auth in the top left

small grail
fossil spoke
#

My bad

#

This looks right

shy gust
#

right . my wording for the flag is probably bad tho,
on the client there , when he joins . it triggers the client connect , which really means "non local" and the host is triggering the "local connect"

fossil spoke
#

For the Client on the Right

#

IsLocallyControlled will be false for the Hosts Pawn

shy gust
#

right , but it isnt for some reason. thats what really confuses me

fossil spoke
#

What do you mean?

#

The print strings shows that it is

#

The message that says "CLIENT CONNECTED" on the Client, will be the Hosts Pawn.

#

Because its not locally controlled for that Client

small grail
#

Yeah, the word itself is confusing. It should be remote connected I think

#

Player controller will always be local for the current controlling side (client, or host in listen server)

fossil spoke
#

The wording is confusing yes

shy gust
#

when the host boots up its correct, but when the client does , see he connects as a client to his own instance , and the hosting player is tagged as remote , by the "islocally controlled"

small grail
fossil spoke
#

☝️

shy gust
small grail
#

You will have clearer idea if you spawn 3 windows, 1 host and 2 clients.

#

To take a look

#

You would have 1 local connected and 2 remote connected for each

shy gust
#

thats a pretty good point , ill give that a try

shy gust
#

So i think i fixed it ,the delay currently does make it work, im aware thats not the best practice tho. i was doing some trouble shooting and only had the sphere render for the local player and that proved to be much more accurate then depending on the timing of the print string. really strange

small grail
#

So I think the reason is the pawn spawned doesn't mean it is possessed.

#

You may try not calling it BeginPlay but onpossesed

shy gust
#

ahh that makes sense , i always forget about the time it takes for things to process, so many hours of troubleshooting;;; thanks a million guys , really appreciated.

lusty kelp
#

okay so my question is this, why am the other person thru steam getting a Frender error?

#

across the ocean per unit to my home

faint eagle
#

Is there an overhead of calling server RPC from server? I mean I know is server calls server RPC it's just going to execute it locally but should I bother refactoring RPC method content into separate method and call it directly?

fossil spoke
#

Its not worth it.

faint eagle
#

k, thanks

shy gust
#

alternatively i could just exten the loading screen a bit and wait for all players to load in, and assume everything should be properly bound by 3-5 seconds. but I imagine thats pretty bad practice.

small grail
fossil spoke
#

@shy gust You will usually want some sort of UI Interface for when Players load into the level.

shy gust
small grail
#

Like set a variable in Pawn such as Possesed and make it rep_notify. Then the client should get the call back.

shy gust
#

ah that seemed to do the trick! thanks a ton, I have alot to study with networking, I appreciate the help again.

small grail
#

Hope it works.

fossil spoke
#

@shy gust IIRC there is an Event called something like Restart that is called on Pawns after they are recreated for the PlayerController

#

Cant remember its Blueprint exposed name

#

Its called on the Client

shy gust
#

ah gotcha , ill see what i can find

fossil spoke
#

Its actually the ideal alternative to BeginPlay for Pawns

#

For intialization

#

As its called after all of the nuanced replicated ownership and roles are sorted out.

shy gust
#

think I found it , "Receive Restarted" sounds like what your refering too , ill give it a try

fossil spoke
#

Sounds like it

small grail
#

Yeah, checked the code. It is right.

#

Weird name though

shy gust
#

that seemed to get rid of all the inconsistency, works like a charm now, the other method was still leaving some room for error but that seemed to do it , man the amount of times ive spent a day troubleshooting and researching around to be told about a weird nifty node here in this server lol. thanks once again.

frozen moat
#

can anyone help me with this? i followed this tutorial but i cannot seem to "host" sessions or join them. but the map starts when i click on "host"

sharp vigil
#

When I play as a listen server should it be counting as a client as well when replicating things?

dark edge
#

Listen server has a local player if that's what you're asking

sharp vigil
#

Yeah that's what I meant, thanks

dark edge
#

Yeah, listen server is server + client basically

sharp vigil
#
void UHealthComponent::OnHealthUpdate()
{
    AActor* owner = GetOwner();

    //Client-specific functionality
    if (owner->GetLocalRole() == ROLE_AutonomousProxy)
    {
        FString healthMessage = FString::Printf(TEXT("CLIENT: You now have %f health remaining."), CurrentHealth);
        GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Blue, healthMessage);

        if (CurrentHealth <= 0)
        {
            GetOwner()->Destroy();
            FString deathMessage = FString::Printf(TEXT("You have been killed."));
            GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, deathMessage);
        }
    }

    //Server-specific functionality
    if (owner->GetLocalRole() == ROLE_Authority)
    {
        FString healthMessage = FString::Printf(
            TEXT("SERVER: %s now has %f health remaining."), *GetFName().ToString(), CurrentHealth);
        GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Blue, healthMessage);
        if (CurrentHealth <= 0)
        {
            GetOwner()->Destroy();
        }
    }

    //Functions that occur on all machines. 
    /*  
        Any special functionality that should occur as a result of damage or death should be placed here. 
    */
}

I have this on health update. When my client takes damage it prints out both the server message and the client message.

But if I'm playing as the listen server it's only printing the server message on the listen server + the client

#

Feel like I'm doing something wrong but I'm scratching my head a little bit..

thin stratus
sharp vigil
#

ah excellent

thin stratus
#

It's a bit hard to put into words

#

A traditional DedicatedServer and Clients would strictly split this of course.

#

A ListenServer is a weird mixture. In almost all Code-Paths it counts as Server/Authority

#

Yet it's a Player that still needs to get the Events that you do for Clients

dark edge
#

Run on owning client would work tho right?

thin stratus
#

E.g. show UI, Effects, play Sounds etc.

thin stratus
sharp vigil
#

So if I wanted to code for a game that could either use listen-server or dedicated then I would need to account for all this

thin stratus
#

There is no second instance on a "Client" for the Listen Server's Actors

dark edge
#

If you do it right, it should work just fine for both. You just have to very carefully consider your conditional stuff.

thin stratus
#

So the Client or Server RPCs if called by the Server on the Server's Actors are just events

thin stratus
#

E.g. OnRep calls only for Clients in C++

dark edge
#

Yes but they would both still fire, correct? What are the actual conditions for run on owning client, locally controlled?

thin stratus
#

If you do something in there that affects the Player, like adding a Widget, then you'd need to also do that for the Server

#

By either doing that by hand or callign OnRep by hand when setting the Variable

dark edge
#

Or owner = local player

thin stratus
#

And at that point you'd need to know if Listen or Dedicated

#

Cause e.g. a WIdget isn't needed for the Dedicated one

#

So you do have to somewhat code your stuff with that in mind

thin stratus
#

LocallyControlled is a Pawn concept

#

The condition is more "somewhere in the chain of owners has to be the PlayerController", which is ultimately a UNetConnection

#

LocallyControlled just asks the Controller for IsLocalController

#

Which in return just spits out a bool based on the Local and the RemoteRole

#

So not really related to Ownership

#

It just goes hand in hand for PlayerController etc.

#

@sharp vigil Here is an example where the difference would theoretically matter. This is one of many things. The exact usecases are based on your game. Also this is pseudo code that probably doesn't actually run.

// Header File
UPROPERTY(ReplicatedUsing=OnRep_MatchState)
EMatchState MatchState;

UFUNCTION()
void OnRep_MatchState();
// CPP File
void ASomeActor::SetMatchState(EMatchState NewMatchState)
{
  MatchState = NewMatchState;

  if (GetNetMode() == ENetMode::ListenServer)
  {
    OnRep_MatchState();
  }
}

void ASomeActor::OnRep_MatchState()
{
  if (MatchState == EMatchState::PostGame)
  {
    ShowPostGameUI();
  }
}

Can also place the NetMode check or similar into the OnRep in case there is code that the Server has to execute in addition to the Player related stuff.
But that could then just be placed into the SetMatchState function or similar.

sharp vigil
#

Ahhh I see

#

So you're saying I can use netmode to have more control when I'd need to account for whether my client is the listen server

thin stratus
#

In BPs that's yet another story, cause OnRep works differently there. It's a PropertyChanged notifier more than anything and will also call for the Server, due to the variable changing. (as well as for Clients if they locally predict the change..)

thin stratus
dark edge
#

Yeah it's really annoying that they did it that way.

thin stratus
#

Yeha I mean there is a sh*t ton of different ways but yes

#

Can also just use the Kismet functions

#
const bool bIsDedicated = UKismetSystemLibrary::IsDedicatedServer(this);
const bool bIsListen = UKismetSystemLibrary::IsServer(this) && !bIsDedicated;
#

(this being an Actor or a UObject with a valid GetWorld)

sharp vigil
#

I gotcha. Thanks for all the info. Super helpful. Really appreciate it

frozen moat
#

can anyone explain to me what's the top most output exec pin for?

small grail
# frozen moat

It's like you executed this node. If you want some callback, it is a good timing for binding.

#

Or you can do some print string or whatever.

frozen moat
#

so the result might be either success or fail?

dark edge
small grail
#

It doesn't relate to the result

queen escarp
#

hey guys question

#

im trying to show player name/portrait but it only works on the 2nd client 1 sec ill show

dark edge
#

Show your code

queen escarp
#

as you can se the "main window(listen server)" is not getting the 2nd clients info but the client window is getting the first ones info

#

so the way ive set it up

on the main menu im setting the "portrait texture" & Name and saving it to the GameInstance

#

then im just updating the UI based on a cast to player and getting the info from Gameinstance

dark edge
#

Show your code

#

The only way the server can know about anything from the client is through a run in server event. Do you ever pass the name through one?

crisp root
#

Thank you, this really helped! 🙏

queen escarp
#

hmm well the vriables are replicated but u might be right im not running it thru the server

#

-.-'

#

mb

#

one sec ill se if i can fix it

#

@dark edgey so that fixed it obviously i was just being dumb 😛

frozen moat
#

yooo.. i finally got multiplayer working

queen escarp
#

Another issue, im "destroying" an actor in game GameMode

#

but it only being destroyed for the "listenServer" not the clients :/?

queen escarp
#

anyone:/?

thin stratus
#

Is it a replicated Actor? Otherwise it won't do anything

queen escarp
#

yeah it is

queen escarp
#

oh wait i solved it

#

nice

cosmic yoke
#

hello, i have an array (that replicates with a repnotify) of a struct which has a few variables. i've tried seeing if changing the values of one of the struct instances in the array would trigger the repnotify, but apparently it doesn't. so what is the best way to enforce a replication when a value inside the instances are changed? using the push model?

queen mortar
#

Hey. I have a problem that I cant find a solution for. I have a function to spawn player. I want to do some kind of among ug logic. Lets say when there is less than 5 players connected, I want to spawn 1 impostor (character blueprint) and 4 normal players (another character blueprint). I tried it like shown in the image, but when for example 2 players connect, each one of them is "impostor" and then it spawns 2 "normals". Does anyone have any suggestions?

unique forge
#

hi

#

im having problem with the multiplayer menu

#

where it says host or refresh list

#

everytime when i press host, im still stuck in the menu. I want to make like this when i press it that the widget menu will be dissappear

tropic snow
#

I just finished making a dedicated server. What are best practices that I can use to have the host change levels, player slots, password and other server settings when launching the dedicated server .exe?

twin juniper
#

In a previous engine I worked with, there as a variable type called "PlayerFlags" that created a bitflag for each player in the game, and would handle things like player IDs changing. Is there anything in unreal that is equivalent to this, or is this player ID changing not something I need to account for? I assume worst case scenario I just need a map of these flags per player controller, but I'm not sure if there is a better way to handle this.

hoary spear
queen mortar
#

Tried it like this aswell, same thing

gritty vortex
#

Hello, newbie here. I'm using the UI Widget from the Car Game Template.
On the server no problems whatsoever, but on the clients, the value seems to be uncertain of the speed, it vary a lot.
For reference those are the vanilla functions i'm referring. The function is declared in the UI Widget and is called in the VehiclePlayerController. The smooth gif is the server and the jittery one is client.

I'm feeling my lack of results researching for the matter might indicate that i'm missing a pretty obvious notion could you maybe point it to me ? Thanks a lot

gritty warren
# thin stratus You still stuck on this?

Yeah, though the problem has evolved a bit.

After debugging, I'm finding that I am successfully passing floats and such, but the actual replicated float isn't being set anywhere.

I thought it would get set in the "SetMoveFor" function within the SavedMove struct, but it doesn't seem like it is ever called (I tried placing a break point here and it never came up). This is the only place where i actually try to set my float value

#

My goal is to connect a GAS MoveSpeed attribute into my CMC. I am trying to accomplish this by just passing along the MoveSpeed as part of the networked data, that way it should sync with locally applied GEs and such (my MoveSpeed is changed via some effect, and my CMC should grab that MoveSpeed float, pass it along, and use it in CalcVelocity). So I think its all working, except for where to actually set the float...

#

In the debugger it shows the float value being passed around as zero, so

thin stratus
#

@gritty warren not sure I follow

#

The SavedMove does not pass anything to the Server

gritty warren
#

Ah, sorry, that was a disjointed explanation. To clarify, I'm following this: https://docs.google.com/document/d/1UO6Ww6Lfpti3YElVdo9uioTUtQJQ9CoSLvd9kF8hvJo/edit

#

The process for sending info is very extensive, but its something like:

SavedMove -> NetworkMoveData -> Server stuff

thin stratus
#

Sure

gritty warren
#

The NetworkMoveData obtains whatever values from the SavedMove and sends it along

thin stratus
#

Correct

gritty warren
#

So I have done this in the past with flags, and it worked great! I can add in flags for like sprinting and stuff and it worked very well

thin stratus
#

The flags are working without custom Data though

#

But yeah

gritty warren
#

But I am having trouble figuring out this float business.

The float I'm trying to send is my own version of "MaxWalkSpeed"

thin stratus
#

I don't have the Engine at hand but I'm sure I recently talked about this here already

gritty warren
#

It's a GAS based Attribute for movespeed, because I'm doing a GAS game. This is against the convention - GAS does not typically play well with the CMC because they have separate replication / prediction systems. To solve this, I'm just going to package up the MoveSpeed attribute and send it along too

thin stratus
#

You need to override the method that "unpacks" the NetworkMoveData on the Server

#

and set the value tehre

gritty warren
#

I have done that also!

#

The problem is that the value I am sending is Zero

thin stratus
#

Is the value already 0 when you fill the NetworkMoveData?

#

Aka already in the SavedMove?

gritty warren
#

I do not know why it is zero. I am not sure where I should be setting it every frame.

With flags, I only ever changed them in SavedMove

#

Yes!

gritty warren
#

if i recall correctly

thin stratus
#

I can't recall the function names atm

gritty warren
#

np np

thin stratus
#

There is one in the saved moves

#

that takes CMC data and sets it

gritty warren
#

yeah, i think that is SetMoveFor

thin stratus
#

It's the one that also calls something with initial position or so

gritty warren
#

Yes! That's the one

thin stratus
#

Yeah, then there you'd need to get the CMC value

gritty warren
#

Okay, so if that is where I should be setting the float, I just got to figure out why it isn't being set there

#

I am trying to set it by calling "GetMaxSpeed()"

#

which I have overwritten

#

to obtain the appropriate attribute value

thin stratus
#

Well, did you override it so Server and Client do two different things?

gritty warren
#

and that all works locally, but for some reason the net stuff doesn't

thin stratus
#

I assume your Client should get the Attribute

#

And your Server should use the Variable itself

gritty warren
#

just one thing, and then in the CalcVelocity i do two different things depending on autonomous proxy or local authority

thin stratus
#

I would have just done that in the GetMaxSpeed function

#

Client returns Attribute value, Server uses the CMC Variable you added

gritty warren
#

but the CMC variable would also need to be tied to the attribute value? 🤔

#

hmm

thin stratus
#

Why

#

Only the Server needs that you are setting that with the data you send to the Server

gritty warren
#

well, if my attribute gets changed based on some gameplay effect (like a slow), i want that to be sent over in the appropriate time

thin stratus
#

Yeah?

#
  • CMC gets a MyCustomWalkSpeed variable
  • GetMaxSpeed override with GetAttribute for Client and MyCustomWalkSpeed for Server
  • Client fills NetworkData with GetMaxSpeed
  • Server sets MyCustomWalkSpeed with NetworkData
gritty warren
#

ohhhh

thin stratus
#

I also don't see the need for the SavedMove to have the MaxSpeed, unless I misremember and the NetworkData has no direct access to the CMC

gritty warren
#

Interesting

thin stratus
#

Although...

#

Hmm

gritty warren
#

NetworkData doesn't transmit anythign but acceleration and direction i think

#

NetworkMoveData :: Serialize has acceleration, location, control rotation

#

and like a time stamp

thin stratus
#

You'd need it in the SavedMove if you want reconcialiation to have the correct speed

#

Which means PrefMoveFor would need to set something for the Client too

#

Hm

#

Okay so

#

Letm e see

gritty warren
#

My prep move for just sets the attribute value, which in hindsight is very bad

#

I like your approach

#

I didnt even have a custom walkspeed variable in my CMC, which is super silly in hindsight

thin stratus
#
  • CMC with CustomMaxSpeed
  • GetMaxSpeed returning CustomMaxSpeed
  • SavedMove SetFor using GetMaxSpeed
  • SavedMove PrepFor setting CustomMaxSpeed
  • Client setting NetworkMoveData MaxSpeed from SavedMove (I assume)
  • Server setting CustomMaxSpeed from NetworkMoveData
#

You are then lacking a point where the Client initially sets CustomMaxSpeed with the AttributeValue

#

I don't remember the name

#

But there is a function that is something called with Before or Pre Movement Update or something like that

gritty warren
#

Oh interesting

#

Okay I'll take a look

#

And we wouldn't just skip the middle ground of having a CustomMaxSpeed by directly adjusting what GetMaxSpeed() returns?

gritty warren
#

because if it just returns custom max speed, but we are trying to set custom max speed elsewhere every time get max speed is called

#

couldn't we just skip the local value or?

#

(this was my initial thought)

thin stratus
#

I mean you could just set the MaxSpeed variable that already exists

#

MaxWalkSpeed or whatever it is called

#

But the rest stays the same

#

Just that CustomMaxSpeed becomes MaxWalkSpeed

#

Or what do you mean?

thin stratus
gritty warren