#multiplayer

1 messages · Page 218 of 1

karmic panther
#

Problem:
If client is overlapping, it works fine.
But if server character is overlapping, it replicates to everyone.

  • The function itself works properly, but it doesnt when its called from another blueprint.

Help: I want to make sure that it only shows to whoever it is overlapping ONLY. ( I tried messing with owner only but it only shows to the client only )
Please tag me! Thank you!

tulip oyster
#

I have a question, for MMORPG games, what is the best way to create a Dungeon Instance?

thin stratus
#

Probably a freshly spun up DedicatedServer for just that group tbh.

tulip oyster
#

Dedicate new port ? for instance id right ?

thin stratus
#

How that works internally is up to you. Pretty sure this needs a backend that can react to a request for a new Server when the players enter the Dungeon Portal or whatever.
And then the Loading Screen hides the time the Server needs to fully init.

  1. Player wants to enter Dungeon
  2. Current Server tells Backend that Player wants to enter Dungeon
  3. Backend grabs an idling Dungeon Server, tells it what Dungeon to load (a Map for example) and what Player/s want to join
  4. Backend tells Current Server which Dungeon Server it activated
  5. Current Server tells Player information about Dungeon Server
  6. Player connects to Dungeon Server
  7. Dungeon Server ensures the Player that is connecting is the expected one

Somewhere in between 3. and 4. is probably some wait time for the Dungeon Server to tell the Backend that it's ready.

#

The "Current Server" as a middle-man could also be some other Backend Server/Service the Player is connected to via some Socket additionally.

#

All up to you, nothing really Unreal Engine related.

tulip oyster
#

Thank you. That's a great idea.

queen escarp
#

hey im in game mode, and im getting all connected players but i cant access each game instance from gamemode?

lost inlet
#

?

#

there'll be one game instance, on the server or elsewhere

queen escarp
#

but each client has their own game instnace right

lost inlet
#

yes

#

but it's not replicated

thin stratus
#

Yeah but the GameInstance is nothing that is available to other players. Every player, including the server only ever has access to their own

queen escarp
#

ah gotcha

thin stratus
#

In most cases it's also not meant for Gameplay logic

#

At least if it involves references to actors and such

queen escarp
#

yeah yeah, could send info from game instance to game state / player state to replicate it i suppose

vestal shale
#

There are two main online backend plugins - Online Subsystem and Online Services.

My question is which one to use and when ?

lost inlet
#

online services is "OSSv2"

#

and afaik only EOS is supported so far

twin juniper
#

guys anyone free now i need some help in replication

pastel silo
#

Yo i struggle to have an UI show only on client side (owning) , it's always show on serv ( the host ) , this is the code where it is called :

#

And this is the code in the blueprint controller :

twin juniper
#

oh wait nvm

pastel silo
#

The first object of interact is replicated

twin juniper
#

your code is correct

#

@pastel silo

#

wait

#

wrong image

#

make it as an input to the client function and try it

lost inlet
#

GetPlayerController(0) in a multiplayer context is almost always wrong

#

acceptable clientside

pastel silo
lost inlet
#

did you miss that part?

twin juniper
#

oops, yes lol

#

@lost inlet do you know proper replication?

#

sorry

lost inlet
lost inlet
twin juniper
#

can you help me out here?

lost inlet
#

well you didn't show any of the BP logic

twin juniper
#

ok wait lemme send

#

health is a replicated variable

lost inlet
#

and what calls SwordBoxTrace

twin juniper
lost inlet
#

yeah this doesn't make much sense

#

and what calls ServerPlayerAttack

pastel silo
twin juniper
#

this calls server player attack

lost inlet
#

Multicasts get called on the server and all clients

#

So the server runs the SwordBoxTrace logic and deducts damage

#

then the client runs it and ends up calling S Damage which deducts it a second time

twin juniper
#

yes

#

also it is kinda weird

#

if you can come vc i can screenshare

lost inlet
#

Nah I'm good

twin juniper
#

you can be muted

#

because there is an important thing involved in this

#

you can be muted tho

twin juniper
#

yeah lol

#

he went offline

queen escarp
#

hey question, how do u guys test your mp games with others/friends..

i build the game winrar pack it then upoad on a free website link and send to friends.. the process is quite tedious is there a better way ?

quasi tide
#

I just upload to steam

queen escarp
#

wdym ? jag build the project and upload on a steam server or something ?

#

you already paid for a slot then i assume ='

quasi tide
#

Yeah. It is only $100

lost inlet
#

That's even how we did internal playtests at my old studio

#

It was just the path of least resistance without building something custom

quasi tide
#

The more embarrasing thing is that this isn't automated. I'm still a neanderthal and package, copy/paste to my folder that has my uploads, open up the steam tools, then upload manually 😅

lost inlet
#

It's way easy just to have that all happening on a CI server

#

I even did the Steamcmd stuff as a UAT job, including the VDF generation

queen escarp
lost inlet
#

So you can use it in BuildGraph

lost inlet
#

Though once you release something it's usually free after that

verbal ice
#

They refund the $100 once you make $1000

quasi tide
#

If*

verbal ice
#

Fair

quasi tide
#

Statistically - you won't make even that much.

verbal ice
#

Depends on your game I guess

lost inlet
#

A lot of solo and small indies still think that releasing on Steam is enough

quasi tide
lost inlet
#

At least Horde is actually easy to deploy now

verbal ice
#

I tend to use TeamCity

#

Is Horde better?

lost inlet
#

I wouldn't say better but it's Epic's internal tool so it's pretty well integrated

quasi tide
#

I haven't bothered with Horde. Haven't even bothered to look at it to be honest

lost inlet
#

BuildGraphs is what it uses to define your build process

#

And with UBA and integration into UGS, I can see a lot of studios considering replacing Jenkins and TeamCity with it

verbal ice
#

Good point

brazen anvil
#

I am familiar with what client prediction is and I am also familiar that the server should be the one that changes things. I am having a hard time wrapping my head around what things need to be client predicted. Does anyone know of a good reference to read up on around this area?

quasi tide
#

Game dependent

#

You decide what should be predicted

#

Do w/e makes the game feel good

#

There is your reference 😅

twin juniper
#

Is it normal that when a function is set to unreliable and you have 100 ping++, you never get what happen in that function? (I,m spawning a particle effect and it nevers spawns with 100ping++...)

glossy kettle
#

🤔

vague spruce
#

hey guys, do i need to do something specific for the server to open up ports? i'm debugging the server configuration (with cooked content, noeditor) and there are no open ports

twin juniper
# glossy kettle 🤔

I don't know how to explain it but whenever a player has 135 ping or more, the stuff marked as Unreliable never triggers, is that normal?

jade scroll
#

my game will be complete rdy in few months . but again to the question ... i code all in listen server... will it work on steam? everyone say another thing...
will it work? or i need cpp or wahtever. or idk

worthy oak
#

It’s a little odd with dedicated servers

jade scroll
#

it will work easily without change anything?

#

some people tell me when server leave the game is over?

#

is it false?

worthy oak
#

If you implemented stuff correctly and link into the online sub system steam yeah

worthy oak
jade scroll
#

so when server leave in lsiten server it will work?

worthy oak
#

Unless you implement a host promotion

twin juniper
#

when the servers leaves (which the server is a client), everyone else will also leave

worthy oak
#

Mhm

jade scroll
#

so it will not work? o.O

worthy oak
#

It will work

#

That’s how listen servers operate by default

jade scroll
#

listen server 1 client is the server

worthy oak
#

It be the same if you shut off your dedicated server

twin juniper
worthy oak
#

Right I’m just saying he’s not being clear

#

Listen servers will work

jade scroll
#

you seee? that swhy ia skigna gain everyone say another

worthy oak
#

The host leaving and the session dying is how it works

twin juniper
#

ye, what does he mean by "work"

jade scroll
#

everyone thay another thing ^^

worthy oak
#

it does work

jade scroll
#

i mean i have listne server game rdy... i want it upload on steam it will work?

worthy oak
#

yes

#

The host leaving is another thing entirely

#

That’s how sessions work

jade scroll
#

when the hsot leave it will work or not? xD

twin juniper
worthy oak
#

When the host leaves the session drops

#

That’s how it works

twin juniper
#

when the host leave, the session close, everything "works" tho

jade scroll
#

i have 3 vs 3 game... one client is teh server i code lsiten server game

worthy oak
#

Yes multiplayer will work on steam

jade scroll
#

when they sattr 3vs3 and the client which is server leave? then what?

worthy oak
#

The session closes

jade scroll
#

so it will not work? xD

worthy oak
#

that’s how it works

twin juniper
#

he's a bot

jade scroll
#

if counters trike srver leave and the session is over?

#

counters trike 1 leave and game is over or what?

worthy oak
#

Most games if the host leaves the session is over

twin juniper
jade scroll
#

no one i think ^^

worthy oak
#

If it’s a dedicated server then no game would continue

jade scroll
#

cant i make lsiten server and if client(server) leave the game go one?

#

is this posilbe ot make it? with lsiten server?

twin juniper
#

no

worthy oak
#

You could look into promoting a new host I guess

#

But that’s not out of the box as far as I know

jade scroll
#

is there no way?

worthy oak
#

Always a way with code

#

Usually 🤣

twin juniper
worthy oak
#

An FPS I played do that but I think it still restarted the session if I remember

jade scroll
#

so my game is full coded in lsiten server? i can make without change any code dedicated server?

twin juniper
#

since I wouldn't think there's time to promote a new one when the host leaves

worthy oak
deep shore
#

There is a plug-in for host migration in the marketplace. I have never used it though

jade scroll
#

how mich cost a dedicated server ... which paler can paly around the world?

jade scroll
#

how much about 10k euros?

worthy oak
#

it’s game dependent

jade scroll
#

per month or hwat?

twin juniper
jade scroll
#

a dedicated server for million palyer around the world? how much i need to pay?

#

1k or 100k

worthy oak
#

A server won’t either

jade scroll
#

?

worthy oak
#

you would be load balancing at that point

#

and again that is going to be highly dependent on how much power your game needs

#

What services you need

#

And how many servers you need

twin juniper
# worthy oak Not sure what you mean sorry

like in my code, I'm using if(GetNetMode() == NM_ListenServer) { /*Do Something...*/}, that code couldn't run for dedicated servers so there's stuff that maybe should be changed for your game to work as expected

worthy oak
#

I can’t speak to that too much though I haven’t messed with that a ton

twin juniper
deep shore
worthy oak
#

yeah and that sounds better than “hard coding” it

twin juniper
#

I'm in C++ and I'm not finding the IsServer thing...

lament flax
#

Works in some cases

twin juniper
lament flax
#

Or compare the net mode with a int

haughty ingot
twin juniper
lament flax
#

Thats not hardcoding

twin juniper
#

By hardcoding, I think they meant using the enum NM_...

lament flax
#

Thats fine to

worthy oak
#

if your referring to my comment I was specifically talking about what you posted

#

Like only checking if it’s a listen server

#

As opposed to the above suggested better ways

twin juniper
#

ok got it, that's amazing since that means my game could also use Dedicated server with little to no effort!

bleak jolt
#

👋 Hi all, I'm working on an online game with a dedicated server, and trying to implement a shared fog of war so players can run around the world together and as they do it will clear fog of war. I have the rendering side figured out but I am having a hard time with how to structure, store and replicate all of that data. Right now I'm storing an array of about 10000 bools that represent quadrants in a 100x100 grid. When a player loads in, the server is sending them 17kb and as the array updates on the server I'm seeing 0.5-1 kb per replication. I am looking for ways to either optimize this, or alternative approaches. Any advice or resources would be appreciated!

bleak jolt
dark edge
#

Anywhere from $10k/mo to $100k/mo I'd guess

#

It all depends on the game design and how heavy a server is

worthy oak
#

Plus staffing costs for someone to run the backend haha

twin juniper
sinful tree
# bleak jolt 👋 Hi all, I'm working on an online game with a dedicated server, and trying to ...

One simple solution would be to replicate only the initial known cleared fog of war space and then afterwards just have the clients clear it locally (ie. without replication) based on the known positions of the other players. It wouldn't be 100% synchronized across the network but I don't think it would fully matter if the updates are done frequent enough - the only issue I can see is that if a client is lagging, they may not receive position updates timely and then there could be spots left in the fog after a position correction.

worthy oak
bleak jolt
worthy oak
sinful tree
#

Just create an agentic LLM and it can handle everything else for you 🙃

twin juniper
#

there would less people if we would be deploying via AWS ... but for physical server, that's true

worthy oak
twin juniper
worthy oak
#

because it’s still setting up and managing an environment

#

That’s a skillset and a full time job

twin juniper
#

more like security stuff?

worthy oak
#

When something is that scale it isn’t push the game server and yay your done

worthy oak
#

Scaling, load balancing

verbal ice
#

You'd be better off using something like Gamelift at that point

twin juniper
#

load balancing is done automatically within AWS

worthy oak
#

No it isn’t lol

twin juniper
#

Google does it for you tho

worthy oak
#

Yes gamelift is what would come to mind for me too with this kinda thing

worthy oak
verbal ice
#

Especially for indies, you're never going to be able to make your own load balancing system or handle your own dedicated servers, outside of a handful if they're long term

#

If you need to spin up instances for players, GameLift or whatever alternative you find is miles better

twin juniper
worthy oak
#

Well that isn’t automatic

#

and yes it isn’t overly hard in AWS you set which servers should load balance to simplify it

#

But to automate that and auto scale that takes more work

verbal ice
#

GameLift is nice, but as with all AWS services, you have the con of making a single mistake and having your bill skyrocket

#

Although IIRC you can set limits

worthy oak
#

YEP lol 🤣🤣🤣

verbal ice
#

Don't remember, not my field even though a few workplaces had me do some devops for some reason

worthy oak
#

Yeah there is billing thresholds but you can get pretty pricey quick lol

verbal ice
#

Not a scam no

#

Just gotta be careful

worthy oak
#

No your using it your paying for it

#

Hence my earlier comment

twin juniper
#

we talking about few hundred or few thousands?

worthy oak
#

You would hire a professional to set it up

verbal ice
#

Depends on your mistake

#

Yea

sinful tree
# verbal ice GameLift is nice, but as with all AWS services, you have the con of making a sin...

I got charged $4 once while I was messing about within AWS because there was a few dozen uncleared "Alerts" (a log message letting you know there was a problem) that was left for a month. Literally charged for some messages that didn't notify me in any other way that there was a problem (no email, no sms message, no big warning thing when logging into the AWS console, etc.) I can only imagine it being much worse on a much larger production environment without someone ensuring things are being checked and set up correctly.

dark parcel
#

Does Microsoft/azure have alternative to aws server?

worthy oak
dark parcel
#

A service to deploy our servers

#

For gaming specifically

worthy oak
#

Oh like gamelift?

#

Not to my knowledge

dark parcel
#

I have no idea, is game lift Microsoft?

worthy oak
#

Though the same kind of idea can be done

#

No gamelift is Amazon

dark parcel
#

I know aws have one and I was going to use it. Got nice features and all but they probably gonna cost more

worthy oak
#

You will certainly pay for it yes

#

I’m sure you can do the same thing in azure

dark parcel
#

For sure, but looking at cheaper alternative atm

worthy oak
#

But I don’t think it’s quite as “automagical”

#

Well not sure what your needs are but if your looking at stuff like scaling budget isn’t necessarily what your looking for anymore?

#

I will say with gamelift it does depend on load obviously

#

So kinda does depend what your max spending is

#

But at that point you might just have 3 servers and implement a Que

#

Pricing for reference keep in mind gamelift auto scales, so if you have times of the day or night where players aren’t on you can shut servers off so you don’t pay for them

jade scroll
#

guy i dont see my niagara at viewport -.-

#

i cant figure out why

#

for some reason it dont show the preview anymore -.-

keen hound
#

Weird question

#

How should I have a line trace come from the player camera

#

I tried it once, but the trace came from another client

verbal ice
#

Show code @keen hound

keen hound
potent token
#

hi im using this plugin too,
but why only server is showing not client

void AFateImGui::Tick(float DeltaSeconds)
{
Super::Tick(DeltaSeconds);

const ImGui::FScopedContext ScopedContext;
if (ScopedContext)
{
    ImGui::Begin("Actor Pool");
    ImGui::Text("Test");
    ImGui::End();

    ShowActorPool();
}

}

modest crater
keen hound
#

what would be the most simple way to detect if all players are dead

fossil spoke
keen hound
fossil spoke
#

Call events on them 🤷

keen hound
#

fair enough, I should probably be smarter with this kind of stuff

cloud crown
#
{
    FVector Updated = HitResult.Location + CharacterOwner->GetActorUpVector() * DefaultCapsuleHalfHeight;
    CharacterOwner->GetMesh()->SetRelativeLocation(CharacterOwner->GetActorUpVector() * DefaultCapsuleHalfHeight * (-1));
    CharacterOwner->SetActorLocation(Updated);
    CharacterOwner->GetCapsuleComponent()->SetCapsuleHalfHeight(DefaultCapsuleHalfHeight, true);

}```
this function is called on server using multicast and 
every thing works except the set relative offset
dark parcel
cloud crown
#

ok i fixed it

#
    {
        FVector Updated = HitResult.Location + CharacterOwner->GetActorUpVector() * ProneHeight;
        CharacterOwner->CacheInitialMeshOffset(CharacterOwner->GetActorUpVector() * ProneHeight * (-1), DefaultCharacter->GetMesh()->GetRelativeRotation());
        CharacterOwner->GetMesh()->SetRelativeLocation(CharacterOwner->GetActorUpVector() * ProneHeight * (-1));
        CharacterOwner->SetActorLocation(Updated);
        CharacterOwner->GetCapsuleComponent()->SetCapsuleHalfHeight(ProneHeight, true);
    }```
#

that should be done for replication relative offsets

potent token
#

but for the client is use different window than the NetImGui server
is it possible to put it inside tab inside NetImGui ?

rich dune
#

Hey, I'm running into an issue. If a Player disconnects, the pawn he controls gets destroyed. Can I cantrol this?
We have vehicles players can possess and so if the player is driving a vehicle, the vehicle get's destroyed and the Character is still there.

I tried on PostLogout to write some logic but this is obviously to late.
I can attach logic to the menu system and this works. But I can't attache this logic to ALT +F4

knotty bane
#

Is there someone that can recommend a good voip system for ingame voice chat, having so much trouble making it myself

pale hazel
#

Can someone explain to me how I can assign certain UI elements to certain players?
So I have a UI with four slots for players to join, where they then can select their character.
I'm having trouble setting it up so that the UI of a specific slot only responds to a single player.

violet sentinel
#

why involve ui? ui is local thing. keep ui and data separate.
let ui display data that is somewhere replicated (like game state member)
then you can easily relate players and player data within game state then query and display it in ui

uncut citrus
lost inlet
uncut citrus
lost inlet
#

well is it UE4? I would suggest adding a system to schedule reloading the map when the server is empty or something like that

uncut citrus
#

It is Ue4 unfortunately

oak flicker
#

I have no Idea whats wrong, in debugmode for the client, the server spawnunit just sucks it up. it just stops there.

#

I want to spawn a character with the left mouse button.

uncut citrus
oak flicker
#

thats where its coming from.

#

it works fine on the server but on client side it gets stuck at spawn unit event.

quasi solar
#

Hi! I have a question. I'm making a multiplayer game, and when I launch the game in the editor, the clients can sprint normally. But when I run it as a standalone game, there are huge stutters. I'm using RepNotify, though. Any ideas?

tardy fossil
uncut citrus
#

And remove all the other items and have the spawn even directly linked to the server node, and see. If it spawn correctly then its an issue with one of your other nodes.

uncut citrus
quasi solar
#

I call server events to update my RepNotify variable :/

uncut citrus
#

Put a print on the nodes extrending from the Server node, see if they print when running in stand alone.

#

But also is there any reason you want it to work on both stand alone and client

quasi solar
#

In fact, I usually test multiplayer with the selected viewport and 2 players (server and client). From what I understand, the standalone game is closer to real conditions, and when I test with this mode, the client lags during sprinting, but not in editor mode

oak flicker
#

got it to work, thanks lol

dark parcel
# quasi solar I call server events to update my RepNotify variable :/

This is not how you would implement networked sprinting with CMC.
Even without the stutter, your character will start sprinting after RTT. So if they have 100 ms, it will take 200 ms before their character start sprinting.
No sane player will find it acceptable, especially not with movement.

#

you should try to test your game with some lag

#

Emulate lag with NetEmulation.PktLag or something along those line

#

https://www.youtube.com/watch?v=urkLwpnAjO0&list=PLXJlkahwiwPmeABEhjwIALvxRSZkzoQpk&ab_channel=delgoodie

If you want a video on how to implement sprinting in multiplayer with CMC. Don't bother looking at blueprint tutorials, they are all scams and did not test the game with any lag.

https://discord.gg/uQjhcJSsRG
In this video I am introducing a series I will be making which explores the character movement component and how you can extend it in depth.

0:00 Intro
1:00 What is the CMC?
2:00 Do you need a custom CMC?
5:35 What does the CMC provide?
7:10 Outro

▶ Play video
quasi solar
#

Thank you very much, I will try to look into all of this! 🙂

river shore
#

Hello!
So I faced this error, when I assign a new value to my FText Variable the rep notify doesn´t trigger e.g. no replication;

//The variable
    UPROPERTY(ReplicatedUsing=OnRep_UpdateInputBar)
    FText InputText;
//The Event
        UFUNCTION()
     void OnRep_UpdateInputBar();

Its Replication settings:

    FDoRepLifetimeParams RepParamsNotifyAlways;
    RepParamsNotifyAlways.bIsPushBased = true;
    RepParamsNotifyAlways.RepNotifyCondition = REPNOTIFY_Always;
    RepParamsNotifyAlways.Condition = COND_None;
    DOREPLIFETIME_WITH_PARAMS_FAST(ThisClass, InputText, RepParamsNotifyAlways)

The Event it is getting set:

void ATerminal::OnUpdateInputBar_Implementation(const FText& NewText)
{
    if(HasAuthority())
    {
        InputText = NewText;
        UE_LOG(LogTemp, Warning, TEXT("RepNotify called: %s"), *InputText.ToString());
        MARK_PROPERTY_DIRTY_FROM_NAME(ThisClass, InputText, this);
    }
}
//as well as the rep notify event
void ATerminal::OnRep_UpdateInputBar()
{
    UpdateInputBar(InputText);
}

my question would be does anyone know if I need to take care of when replicating Texts because I can´t find a reason in any documention etc.. The event is being exc by the server ofc btw.

lost inlet
#

there are no special steps from replicating FTexts

#

and if you're using a listen server at any point here, you'll need to manually call the OnRep

river shore
#

but why only in this case the because with other variables that I replicate (same file just bool values etc.) the rep notify works fine?

lost inlet
#

not sure without seeing the entire thing

#

and is an FText the best method of replicating it anyway?

river shore
#

not really but thats what I get out of the Widgetcomponent I think its called editable box ot sth

river shore
hollow frigate
#

Im so confuse... I've been trying to fix my swimming system and I can't get it working on client, despite the client / server having the same logic setup, the client when entering the water always switch instantly from swimming to movement mode : Falling, any one would know why ?

keen hound
#

what would i use here for player controller? both players are looking at the mouse

#

pretend its a multicast

#

(i forgot to set it to that before taking this screenie)

cold cipher
#

is there a way to make an actor only visible to certain players?

#

or invisible only for yourself?|

lost inlet
#

well yeah, you can toggle visibility on the client however you want

cold cipher
lost inlet
#

unless you're talking about local multiplayer/splitscreen, with online multiplayer you can manipulate clientside actors however you want

cold cipher
#

no, I mean actual method/way and nodes used for it

hollow frigate
# cold cipher no, I mean actual method/way and nodes used for it

One way is to set all character invisible and when in range that you could see them, have an overlap event check actor gameplaytag if it match a tag that should be visible to the player have server valid the tag if true run logic on client to make target actor visible (not multicast)

cold cipher
#

okay thx
although I don't understand, will give it a try

lost inlet
#

SetVisibility

#

you can call it clientside

twin juniper
hollow frigate
#

add a Sphere collision on your character to define the range, on that sphere collision get the On begin overlap, you can revert visibiliy on end overlap when they are too far.

made a quick bp logic so you can figure out around that I guess

#

you should probably have an array of actor called something like "ActorInRange" to store all the actor the are in range so you can manage the end overlap better on who needs to have visibility updated or not

cold cipher
lost inlet
#

so why not make them only relevant to the player that needs to see them?

#

or why even use actors for them at all

#

I thought this was going to be some TF2 Spy type deal at first

cold cipher
#

was following this tutorial so used actors for damage numbers
https://www.youtube.com/watch?v=5UEi7yruUtI
when I use only relevant to owner, the server player's damage number worked fine, but the server player can also see other's damage numbers

(invisible ability is something I might add to my game later on)

lost inlet
#

I would do it as an RPC on the player that needs to see the damage number, and that can just add the widget or the actor clientside, then you're not relying on actor replication at all

#

oh dear god no

#

even the UI part is done terribly

#

and this dude has a Patreon

twin juniper
# lost inlet

what's the right way? Since I've always find it easier to just create a binding like he does

lost inlet
#

bindings are terrible for performance

#

SetText exists and it's static

cold cipher
#

I'd say it's set text on the actor spawn

lost inlet
#

in fact the guy who worked on UMG in the early days regrets even adding them. absolutely perf killers because they run every frame

#

when in event construct. you can do a SetText once

#

visibility bindings can run multiple times per frame too

cold cipher
#

I guess it's useful when prototyping

lost inlet
#

they didn't even improve productivity in this case

formal solar
#

So Im working on a multiplayer game but I want to make a single player tutorial and need to rework a lot of stuff for it

#

First thing is, what will the player ID (from player state) be in single player? Will player state even exist?

#

THe tutorial is accessible before players connect to steam session

lost inlet
#

The player state will exist but there's only 1

#

Because there's 1 player

kindred widget
#

You don't need to rework much of anything. Open a level to a singleplayer map.

lost inlet
#

Yeah, I've never had an issue with that personally

#

This way round is easy

#

The other way round is pain

formal solar
#

yeah lucky i dont need to do that

lost inlet
#

The tutorial on a previous project was a specific map that used a specific gamemode

kindred widget
#

Basically a singleplayer map runs like a Listenserver. It functions as both server and a client. It has everything a listenserver would have, except the ability to let clients connect.

formal solar
#

player id will just be 0 i assume?

lost inlet
#

what part of the game hinges on the player id property on the player state

#

I don't think i've ever used it

#

but most likely yes

#

that or 1

formal solar
#

possession of units, they all have an id tag

#

based on alleigance

#

default is 0

#

lol apparently the default player id is 256

#

at least in 5.0.3

hollow frigate
#

Big question!

I've try several approach,

First thing I confirmed that my client was properly own by the controller.

I set Movement Mode through the server then the client to swimming and bWaterPhysic to true

On the server it work perfectly, on the client it revert instantly to falling movement (Movement Mode 4)

I've also tried the following without success;
Movement Mode prediction on the client
Override Falling physic on Character
Override On Movement Mode change event to verify what the server is set at

The logic that set the Movement Mode is at the same time that bWaterPhysic is set, within OnRep_Swimming. The bWaterPhysic works perfectly, on both server and client so that's why with the log I can tell the logic is fine to set the movement mode, it just makes no sense that it won't stay on client and I have no idea why ??

clear zephyr
#

Im Having this issue and dont understand why its doing this. if i do it stand alone single player works fine. if i do it multiplayer the server works and the client one messes up. does anyone know what might cause this. it trys to move and bounces back right away. Im pretty stumped and just started messing with multiplayer. any help would be appriciated

graceful flame
# clear zephyr

That looks like server is issuing corrections because of location differences. You can verify if that's happening by using net DebugDraw.1 and then checking the output log for warnings.

agile meadow
#

im trying to make some basic replicated functionality, and am having trouble getting started.
i made some dynamic multicast delegates in my GameModeBase class that i want to call to update PlayerState variables and trigger some local functions, but im having trouble figuring out how to do that. ive seen some stuff using GetLifetimeReplicatedProps, but im not really sure thats what i need and in classic unreal engine style, im having trouble finding information about it.
ive also seen some stuff about RPCs, but im also not sure how to make or use those.

i tried casting to the GameModeBase, but all my attempts at casting have failed, because i dont think i can access it directly like that from player states.

ive just seen something about NetMulticast so ill look into that, but ill put out feelers here anyway if anyone has good advice

lost inlet
#

multicast delegates aren't NetMulticast

#

in addition the game mode doesn't replicate

agile meadow
#

ah well i removed that post, because ai is dumb anyway so why mention it

keen hound
visual cedar
#

hey all, quick question. I am probably missing something completely. Please help if you can 🙂

I am making a sliding mechanic, I have a listen server setup, I set velocity, after some calculation, on the server using the character movement in a custom event. When it is the listen servers character it works normally, when it is a clients character it lurches forward for a moment then works, espically when I worsen the network conditions.

here is a pic of what's running on the server. I also changed it to add impulse but ran into the same issue.

agile meadow
#

maybe i should be using game instance instead of gamemodebase.

#

GameState then?

dark edge
#

When x happens, you want y to happen

spring venture
#

Hi, I'm trying to make nametags for a listen server and I'm putting my logic in OnRep_PlayerState to set my Widget's Text to the Playername. However, it doesn't seem to be working as only one or two clients are able to see the updated player name instead of all and the server entirely doens't see it

agile meadow
#

i wanna trigger a delegate i define on my GameModeBase, or some other server object to broadcast to PlayerStates/PlayerControllers or other player specific objects that subscribe to that delegate.

#

more specifically, im trying to make a chat system so that when one player submits a message, players that have a Chat UI widget ive created will refresh their chat with relevant messages and have the message added to their playerstate logs, that i believe also keeps track of uniqueIDs so i know what player is what.

#

i also want to log all chat messages

#

i thought the best way to do that would be to have the server keep track of all messages, player states would keep track of messages a certain player should see, and that way i can log all messages and also log team chats and such

clear zephyr
hollow frigate
#

Who here has work with multiplayer and swimming without a Physic Volume ?

agile meadow
#

also i get errors like this. idk what the unicast socket thing is, and all my casts crash.

#

oh i forgot to change my gamestate to this new class

#

the unicast socket thing is happening on compliation tho

#

pretty much the same type of errors i got before when using GameModeBase

#

i just cant seem to be able to trigger the delegate

sinful tree
# visual cedar hey all, quick question. I am probably missing something completely. Please help...

If you're utilizing the character movement component, you can't manipulate character movement like this. You'd have to manipulate the character movement component in C++ to include your new desired move so that it can be client predicted so the change in velocity doesn't create corrections which is what causes your character to lurch forward.

The listen server character will work correctly as they are the authority and they don't have to replicate anything to anyone about their own character so any changes to their own character's velocity are instantaneous. All the clients will always have some latency and the server will inevitably alter the speed first so then when it receives movement input from the client it thinks the client should be in a certain spot but the client isn't, so then on the client, their character will be corrected to where the server thinks they should be based on the speed the server thinks is correct.

dark edge
#

Probably a component on GameState and component on PlayerState is how I'd do it, just thinking out loud here

agile meadow
#

right now im just trying something super simple and low level. the log is just a TArray<FText>, one on the GameModeBase (now trying GameStateBase), and one on the PlayerState. the delegate is initialized on the GameModeBase, and im trying to trigger it from within my UUserWidget through the attached PlayerState

dark edge
#

Does Team Blue recieve Team Red chats and just not show them, or do they literally not cross the wire to their computers

agile meadow
#

i have though about that, i have some thoughts on how to separate them, and i have an enum parameter for my delegate for choosing what type of chat is going in, but right now im just trying to get it to work at all

#

i can figure out the specifics later

#

right now im assuming all messages are global

dark edge
#

Yeah I'd start with global

#

ok so you need something on PlayerState or PlayerController to be able to send a message

#

since clients can't server RPC through GameState

agile meadow
#

im doing this in my UserWidget

#

it should broadcast the delegate when it's button is clicked

#

every player that has this widget should also get called with the OnPlayerChatSubmit delegate

dark edge
#

Client types and sends -> their PlayerState sends over the wire as a run on server RPC -> serverside PlayerState sends it to GameState -> GameState updates the log (repnotify)

OnRep_ChatLog -> Trigger delegate

Delegate -> UI Updates

dark edge
#

Don't think you need delegates in your UI here

agile meadow
#

well, i heard about delegates before i heard about RPCs, so ive been trying to figure out how those can work. im not rly sure how RPCs work even after reading the docs on it

dark edge
#

They're totally orthogonal concepts really

#

delegates are for pub/sub stuff

#

"Hey whoever cares, I just died"

#

"Whoever cares, the chat log just changed"

#

The only delegate you'd want in your system is for being triggered when chat log changes, so whoever cares (the open chat window, a notification system) can respond

#

that way chat system doesn't care about UI

agile meadow
#

hmm ok. ill try to figure out how to do this

dark edge
#

If you're comfy in BP do it there first then translate

#

I'd do it as a component btw

visual cedar
dark edge
#

2 components, one on PlayerState or PlayerController (for the sending), and one on GameState (for the rest of the chat system)

agile meadow
#

alright ill give that a shot. thanks for your help if it turns out well!

#

and even if it doesnt turn out well i guess

fair halo
#

I'm noticing in the default Third Person Starter that, when set to 2 player Standalone, the Listen Server is seeing all ABP run cycles play back at half the rate of the client.

Has anyone else seen this / know a fix? I'm able to repro it by making a new project and changing nothing other than setting it to a 2 player listen server. 🤔

agile meadow
#

welp turns out i have no idea what im doing in bp. i think im more comfortable in C++. i can figure this out!!

keen hound
twin juniper
#

Get controller 0 on the server is wrong in this case

lost inlet
#

also casting the game state in the player state in PostInitializeComponents is probably not going to work... most of the time

#

at least BeginPlay on the client guarantees the game state is valid

verbal ice
#

But yeah on this scenario, not good

lost inlet
#

even then, it's probably running the rotate logic on simulated

#

but who can tell from a single screenshot

agile meadow
#

so gamestate is null

#

so i have to cast it on the server version somehow

#

i can probably do that in the server RPC

dark edge
agile meadow
#

yeah was big dumb dumb

dark edge
#

only client hits that race condition

#

Yeah I'm not 100% sure the surefire way around those types of problems

agile meadow
#

moving it to my server RPC let it start up

lost inlet
#

what is this salad

agile meadow
#

ok and now i have it so that when i hit submit, my game doesnt crash

#

but it also doesnt do anything

#

the salad is me trying different things to get the right thing

#

i probably dont need the cast

#

can just do the getworld->getgamestate

#

im what they call a "chaotic coder", which is the nice way to call a dumbass

#

wait i do need the cast

#

because GetGameState returns generic AGameState*

keen hound
#

listen server btw

lost inlet
#

the owning controller

#

and only run it on locally controlled

#

not sure why the client bit is an RPC though

keen hound
#

fixed, but now rotation isn't replicating

#

im assuming im being stupid but

#

nvm i was

#

the thing that was rotating (the mesh) wasnt set to replicate

#

okay i take that back

#

the server is being replicated but not the client

#

i dont know if i'd use a rpc for this

verbal ice
# agile meadow

The game state can't be null in BeginPlay. It's null because you're getting the game state from the default gamemode for some reason. This will fail on clients since they don't have a gamemode.

#

Literally just do GetWorld()->GetGameState<ACPP_ArenaGameState>();

agile meadow
#

that should be the same as this right?

dark parcel
#

if you have multicast everywher, you've been doing it wrong. 95% of the cases you don't want a multicast, the 5% are for some edge cases that doesn't need to be in sync / stateful

keen hound
#

ic

dark parcel
#

Multiplayer Bps youtube tutorial mostly showed you the wrong way

#

they have no fucking clue. Just saw another one by matt aspald yesterday

#

another wrong video with many victims thanking him

#

If something needs to be stateful / sync accross machines, never use multicast

#

they can be dropped or not called all together on machine that have yet to join the server / outside relevancy

verbal ice
dark parcel
#

For your rotation

If Locally Controlled Actor -> Set Actor Rotation -> Set rotation variable (replicated, Server RPC)
On tick -> If Not Locally Controlled -> Set Actor Rotation to the value of the replicated rotation variable

@keen hound

#

use interpolation when setting actor rotation on Tick, because the net can't send rotation values fast enough to make the actor rotate smoothly.

keen hound
#

im trying to rotate the character without rotating the camera

agile meadow
#

aha! something is working. looks like my casts are working properly now, thanks for that folks.
i seem to have some sort of delegate cycle working with the RPC function telling the delegate to fire, which talks back with my chat. its just not updating the chat properly so now i gotta figure that out

#

still getting this weird error, and google hasnt helped determine what it is

verbal ice
#

What's the address

#

Is it local

#

What's the port

agile meadow
#

seems to be an IP address, not sure if its mine so i didnt wanna share it

verbal ice
#

what are the first two components

agile meadow
#

192.168

#

and there is a :0 at the end of it, which doesnt look like normal IP stuff

#

i dont think its my ip, just checked

verbal ice
#

Yeah it's local, you're fine

#

0 is invalid

#

Go to project settings -> find UDP in the categories on the left, change the port to something higher like idk, 34345

#

should be free

#

Might be in editor preferences but im not sure

agile meadow
#

alright

#

i get the same error regardless of what number i put for the port

verbal ice
#

Change the address to 0.0.0.0

#

port to 34345

agile meadow
#

aha. ok that made the log go away

#

thanks man

agile meadow
devout sonnet
#

I'm looking to test out my joining and leaving sessions in my game. If i do Listen Server, My game already has both players in a session together (making it hard to test joining a session). Can I have both players play Standalone and have them join a session hosted by the other?

verbal ice
#

for connections

#

probably an editor plugin like multi user editing

agile meadow
#

oh i do have that enabled actually

#

tho ive never used it

dark parcel
#

If you don't know what data to send as who, I suggest looking more into the usage of switch has authority and locally controlled actor

#

Also don't use get player controller 0 in mp. Read the compendium by wizard.

short arrow
#

alternatively you can enable the button in the editor "allow late joining"

#

which you can find in the editor settings

agile meadow
#

well, something is happening

#

this is a big step for mankind

#

Going to the moon: 👎
Getting a bad chat message to show onscreen: 👍

#

unfortunately it breaks after 1 message, and doesnt update properly, and its not wrapping, and the playername is wrong

#

its all kinda shit

nova wasp
#

it's something!

agile meadow
#

yes it is.

#

progress!

#

for some reason im hitting breakpoints in a Dissassembly file, and i have no idea what that means

devout sonnet
agile meadow
#

well thanks for all the help today guys. im gonna get off for now.

twin juniper
agile meadow
#

ikr. im not working those 16 hour days on this smh

oak flicker
#

I have control over the cameras if the client possess a pawn the camera jumps to complete different spot then the server which is the same base unit.

#

it makes no sense.

nova wasp
#

check the view target in each case

oak flicker
#

thanks, I could fix it.

azure hull
#

Hi. Got case, where I've got actor component attached to PlayerState, and got a variable that tries to get info from PlayerController in OnRep_Var call.
Component exists during Lobby, which means that when player connects, it creates host's PS and trigger's this OnRep_Var.
But PlayerController is still not valid here in the OnRep_Var, due to PlayerState being created before PlayerController.
OnRep is written in cpp.

Any way I can secure that OnRep would execute when waiting for PlayerController to be valid? Or should there be a better approach on this?

boreal wadi
#

I have a pretty involved question about server rewind in regards to melee combat. I really don't even know how to format the question in a way I would get an answer.

TLDR: I'm using a fixed tick simulation for character movement. What would be the proper method to check for hits when the mesh is being interpolated but the actual server side hit boxes aren't?

The reason this is confusing to me is because the visual mesh that the client hits is in the past. Then add on top that its being interpolated from an even older position to its current one. Meaning when I request a hit validation from the server and I pass the frame the hit occurred on, there's a high chance I wouldn't get a hit confirmation. As I type this I realize I would need to calculate the offset caused by the interpolation as well as use the server's current frame instead of the clients frame. Even then this is all a jumbled mess in my mind lol.

nova wasp
#

why does the mesh have to be interpolated?

#

this is getting into very fancy manual physics territory but I don't see why you have to forcibly move all bodies

#

the whole point of doing fixed tick with interpolation is to separate these if you ask me

I personally tick anim instances in a fixed tick way and I haven't bothered interpolating them yet (out of laziness...)

#

but regular unreal skeletal meshes support interpolation for bones so it's just a matter of flipping some things

#

mind you of course at extremely low hz fixed tick things might not be so nice

#

At 60hz it's not very bad looking without any interp

boreal wadi
# nova wasp why does the mesh have to be interpolated?

The mesh is interpolated so that you don't see other clients jittering about. Since the server could be sending updates as low as 30hz and you're rendering at 60+. My montages are ticked in sync with the server but still when the trace comes out on X frame the client I query against is interpolated

nova wasp
#

I don't mean the visuals, I mean the actual positions

#

of course you interpolate incoming updates visually

#

what exactly is the point of fixed ticking here? consistency with some specific parts? less costly frametimes?

#

If you want to resolve rollbacks then you need to rollback the actual simulation state anyways and re-do things with the new "actually it was this" inputs

nova wasp
#

ah, that makes sense being something fixed on their own 😦

#

why not start with that? I assumed you were doing this all manually

#

As for validation I think it's just going to be "fuzzy" at times

#

unless you have a somewhat reliable deterministic sim + way to rollback raw state to the actual initial state of a given frame then your comparisons are doomed to be fuzzy

#

if you mean validation as in "this hit made sense"

#

arguably you could try to insert your game's rules into the actual prediction steps unreal does as a callback etc

#

as for things on the server itself... there are some ideas

#

Riot Games when making valorant basically re-wrote almost all animation blending to be more deterministic to help with resolving hit validation vs anim state iirc

#

My anim instance is as dumb as possible and is designed to just be at most a couple of blends + animation sequence sample timings 100% driven by code and not random state machines

#

and even then I doubt I can get away with truly relying on it at high speeds and variance... haven't tried that much though

boreal wadi
#

Yea its kinda tough to find help because not many are using Mover or Network Prediction. I have something that works like 55% of the time but was looking for a more stable solution. Thanks for your time

#

@hollow gate Looks like you about to type some HEAT party_manny

hollow gate
# boreal wadi Yea its kinda tough to find help because not many are using Mover or Network Pre...

if you are using some sort of motion warping with your melee , the server will move to the enemy where it is on server and move you there too (you get corrected) , traces in this situation will be same on server and client.
in the case you are not doing that, you need lag compensation on server before you do the hit registration.
lag compensation is simple with mover, every end of simulation tick just save state on server with simulation time. client then sends the current interpolation time in his input cmd (this represents the simulation time the sim proxies are at for that client), server uses that value to find the state of every character in that time and sets location rotation etc.. to that state , does his attack trace then sets them back to what they were.

oak flicker
#

when I print string the ai_contoller on client, it is empty, on server its correct. I cant move the pawn, how do i fix this?

boreal wadi
hollow gate
oak flicker
#

I tried this as well, run on server cast to gamemode and move him from there its still empty

#

do I need to cast to the PC again or what?

versed tiger
#

Ho, I wanna open multi levels on one server!
how? one server! no multi servers!

oak flicker
#

AICon is set to rep

boreal wadi
hollow gate
# boreal wadi Okay. Right now my server keeps a snapshot of every frame for a short window of ...

are you using my fork of NPP? the npp subsystem has function get interpolation time for actor. you give it the autonomous proxy actor in the produce input function and gives you the sim time proxies are at, you can send to server and he can use that as it is. he can blend between 2 server states if interp time is in between, that is all.
you do want to do the saving both on server and on local player, and use it with all targeting at all time. if it's local player in normal sim tick he won't rewind anything cause the time is the same. but he might need to rewind when he is rolling back , in case you have effects that happen you need them to happen again during roll forward, since sim time at that point might be different from the sim interp time provided in input, local player would roll enemies back to where they were and do attack again.

nova wasp
#

And that way surely you would get within like, less than a meter or so? Thanks for the actual info because all I can do is express the theoretical here as I don't use NPP

boreal wadi
hollow gate
hollow gate
crisp shard
#

I’ve been reading this convo trying to understand what you guys are talking about and I’m just curious what is this NPP and concept you guys are talking about?

I have similar issues whenever there is high latency with hits etc so I’m interested to learn about this topic

hollow gate
# crisp shard I’ve been reading this convo trying to understand what you guys are talking abou...

https://www.youtube.com/watch?v=P4IKS5k47Wg&t=1144s
NPP stands for Network prediction plugin. am pretty sure you can do lag compensation for chaos network prediction too.
it is not super complicated but wouldn't say it's really simple. it's a framework to allow for building multiplayer systems that was revived by the new Mover 2.0 plugin that is supposed to be the new movement framework for unreal actors. if you use it for movement you can have accurate lag compensation.

The recently released Mover plugin is an experimental tool supporting movement of actors with rollback networking. In this session, we will discuss its high-level concepts, compare it with CharacterMovementComponent, take a look at what's running under the hood, and see what's planned for future development. Please note the README documentation...

▶ Play video
errant sparrow
#

Glass made a deterministic physic with no rollback in ue4. Wondering what magic was that. It even work for millions of army. All that without multiplayer rollback at all in ue4.

boreal wadi
#

I have hope they will implement it. I just found out they've implemented a crouch using the modifiers

hollow gate
#

i don't need to change my code to follow epic fixed smoothing. cause it's same code just missing stuff.

boreal wadi
hollow gate
crisp shard
#

Would love to do some better correction logic and prediction logic tho

#

(Without having to go nuts on the cpp)

hollow gate
# crisp shard (Without having to go nuts on the cpp)

there is alot of BP support but it's not 100% very few things need to be done in c++ specifically creating new data structures for your own replicated state and inputs. rest all is pretty much doable in blueprint from creating new movement modes to different root motion type moves.

vagrant grail
#

Can someone explain to me what is an event dispatcher in a summary and how does it behave in multiplayer.
Like tell me if my understanding is wrong but is just a way to broadcast an event and we can create a binding to intercept that event and execute some code that we want.

And for multiplayer when binding and calling an event dispatcher, like does the context (server / client) matters ? Like does an event bound on Client could also be received on server and vice versa ? Or depending on where it's called and bind it's received only by the same context ?

What about event dispatchers that are bound or called in a simple (event so not server only, or client only) but being both as in unreal, if an event isn't set to run on server or un on client, it runs both on server and client. So does that mean an event dispatcher is that's called or bound that way would execute on both server and client at the same time ?

lost inlet
#

Delegates (event dispatchers) have no replication

hollow gate
lost inlet
#

So it being MP or not is irrelevant

vagrant grail
hollow gate
# vagrant grail So something like binding an even on a en event node that's to "Run on Owning Cl...

there is no replication in event dispatchers none, only the entities bound to the event that live in the same world of the broadcaster will receive the event. like if server broadcasts , only server entities will receive it.. again no replication in this. replication happens in the RPC that get called from whomever is listening to the broadcast and received it.. in the context of the dispatcher MP is irrelevant like sswires says above. you RPCs are what does replication.

#

so in your case.. the owning client would get the event that he is listening to and then would send a SERVER RPC to ask server to do something if i understood what you are trying to say correctly

lament flax
#

usually since broadcasted stuff comes from states, you use a notfify replicated var, and in the OnRep you broadcast

#

you still have to bind before on the instances and sides you want (watch out for race conditons)

vagrant grail
vagrant grail
lament flax
#

Technically the server and client objects arent same

#

So it follows the same rules of broadcasting like in singleplayer

hollow gate
#

they actually are not.. completely different words in different machines

#

if you want to be sure only server objects deal with this event, your approach is correct. if only server object is listening, he won't receive unless the event was broadcast on the server

#

i think you are trying to make sure the event is only received and runs on server. and that is fine

ashen scroll
#

Guys I have a stupid question

#

I never tackled this when I first did multiplayer and now I need to

#

For dedicated servers, why and how do we need to use the version of UE5 from GitHub, there is a specific term for how its called but I forgot how.

#

With that from what I recall you can run servers using Visual Studio

#

Aha I found it, the Source Code version

#

Ok found a video for it, so the question now is, can I port a project from the Epic Games version to Source, if so, how?

queen mortar
#

Hey there. I was wondering if it is even possible to replicate movement the correct way (so that it works with packet loss, ping, .. reliably) with just blueprints. The type of movement which I'm focusing on is sprint and crouch. I just came across something called GAS which is using prediction but it seems like people use c++ even for that.

unique summit
#

Hello. I'm doing a simple menu to join multiplayer game by IP. But as soon as the 2nd player join the game, it crashes with this error:

Assertion failed: Actor->GetLevel() == this [File:D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Private\Level.cpp] [Line: 571]

I dont get what is going on, I do the same thing in another project, without issues

dark parcel
# queen mortar Hey there. I was wondering if it is even possible to replicate movement the corr...

every blueprint multiplayer movement tutorial out there are scams. They don't work with CMC framework and they showed to all the victims without introducing lag.
The moment lag is introduced, even 2 or 5 ms. Suprise, suprise. Things break and desync into chaos.

The right way is to work with CMC framework where you need to toggle the bit flag in FSavedMove. Which is only possible to do via C++.

#

there is also many things you can't do with bp alone when it comes to multiplayer. So if you want to pursue multiplayer that is not turn based, you should learn the language because hitting the bp wall is rather quick.

twin juniper
#

toggle FSavedMove ?

unique summit
dark parcel
#

was gonna post that video

unique summit
#

u should watch this if you want a good understanding of the movement, especially in a multiplayer game

#

it is NOT trivial

dark parcel
#

there are reserved bits, you can toggles for your crouch and sprinting needs

queen mortar
#

Okay that's good to know thanks guys

twin juniper
thin stratus
#

@hollow gate Ever thought about the Input Delay coming from Fixed Tick and how to get around that despite pushing the TickRate high?

unique summit
#

it is not exposed to BP

dark parcel
unique summit
#

you could do a subclass of CMC that exposes it, but well

thin stratus
#

Also, ever thought about the fun of 2 AutoProxy Sims running at the same time on 2 different Actors? :D

#

NPP is such a headache sometimes.

#

Or rather, often.

fair halo
#

Has anyone else noticed that, even with the default 3rd Person character project, if you play as listen server the Server’s view of the client has it animating the run speed half as fast as the client sees locally?

#

You can even open the rewind debugger and see half the footstep events getting fired and the animation playing back ~ half as fast, though the play rate for both is showing as 1x

dark parcel
#

I noticed it but not in editor, only in packaged

#

try it with 3 machines, the client should see other machine just fine. It will be the listen server that sees the proxy characters playing animation at incorrect rate

#

Kaos gave me the fix, I think that should be pinned because for listen server. It's broken from the get go, even with default Templates

fair halo
#

@dark parcel Aha, thanks! Will do. We're seeing the issue in PIE as well and thought it was something we'd messed up, but I'm able to repro it with a fresh project. The listen server just sees all abp client animations playing at half the rate the client sees

#

But the default motion blur values are so dang high it's hard to spot unless you're looking for it or have the rewind debugger up :p

dark parcel
#

That's the only time I have issue in Pie.

fair halo
#

@dark parcel Strangely I am sure, yeah. I'd created it specifically to test this. I can toss up a video or jump into a discord channel if you're at all curious

dark parcel
#

I'm already on my bed 😔

#

Toss the video anyway, maybe someone else know the fix

#

@fair halo you might want to change the frame rate on client. See what happend on server after you changed it.

hollow gate
# thin stratus <@396299599654027265> Ever thought about the Input Delay coming from Fixed Tick ...

accumulating the input in produce input instead of making fresh one and clearing it post simulation tick fixes this issue because the input is still being consumed in its entirety. there's no "delay" per se in this situation because all of the input is accumulated and becomes like it's pulled on same rate as simulation, physics on other hand is on another thread so the delay between actually polling input and applying it in physics thread then seeing it in game thread since it is being smoothed for game thread through interpolation. i have made tests with hit scans (to test lag compensation and i never noticed any input lag). overwatch and valorant both use fixed tick simulation with input polling accumulation and they are arguably super fast paced game with valorant being super tactical. i don't think using input polling in a fixed tick is a problem.

hollow gate
#

maybe you talking about 1 player controlling 2 entities?

fair halo
#

Per @dark parcel 's rec- posting the default ThirdPerson template set to Listen Server, 2 players, with average network lag simulated. Seeing the Listen server observe client ABP at an incorrect playback rate, doesn't seem to be framerate dependent. Both server/client agree that the playback is at 1x so there's something odd happening with the update frequency on the Listen server of a remote pawn. Any advice would be appreciated. 🤔

thin stratus
#

Your average gamer won't notice that but the pro scene will def notice this on 20 or even 30 Hz Sim

thin stratus
#

There are also some talks on UDN about adjusting the order in which NPP calls some of the SimulationTick logic to allow better communication between 2 or more Systems or 2 or more Instances of one System.

#

E.g. two Mover Simulations affecting each other's OutputState, or Mover and some other System talking to each other.

atm NPP runs each System and each Instance of said System one after another.

hollow gate
# thin stratus There is def InputLag. It's naturally because RenderTick Input is only consumed ...

right after a fixed tick is not a thing tho cause it means at start of next tick which is no delay, if you say press a button during sim tick , so the delay is less that StepMS and in this case it is being polled. you can do hypothetical math all you want but in the end a human can't press a butter at a rate faster than 90ms maybe slightly less for super humans, but we still need to account for this.

thin stratus
hollow gate
thin stratus
#

Valorant and Overwatch aren't examples for this.

#

Valorant TickRate is WAY higher.

thin stratus
#

Yeah all good, there is still input delay :D

hollow gate
#

a fast paced melle centric game

#

you can calculate the math and it will always be < StepMS . fighting games been doing forever. it'snot something new we have to deal with

#

and you can argue fighting games need precise inputs

thin stratus
#

Fighting games are not 100 player games with 20hz tickrate though

thin stratus
#

Also relatively sure most Fighting Games run Independent and cap the FPS.

hollow gate
#

i thought they didn't have anyone and still figuring it out

hollow gate
thin stratus
#

One of those ideas was to cut SimulationTIck into the Tick and a second "Gather Output State" method.

#

So all of the Instances and Systems would tick, but only after that they would all run a "Give me your final output state" call.

unique summit
#
{
    // Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
    PrimaryActorTick.bCanEverTick = true;
    MaxPlayers = 4;
}

// Called when the game starts or when spawned
void AChouChouGameSession::BeginPlay()
{
    Super::BeginPlay();
    MaxPlayers = 4;
}

and yet GameSession->MaxPlayers keeps returning 16. What am I missing ?

hollow gate
thin stratus
# hollow gate and how is that different?? the input is still being pressed and polled by windo...

If you press Jump the Input of course goes through with Fixed and IndependentTick and the Pawn will get its callback and set some "bWantsToJump" flag. Independent Tick will then call Produce Input the next RenderFrame, grab the bWantsToJump boolean and run SimulationTick and start the Jump.
FixedTick, however, will only Produce Input during its Fixed Tick call. So between the player pressing the Key, setting the bWantsToJumpFlag on the Pawn and NPP actually gathering that flag and simulating is larger.
And gamers do feel that delay.

#

Especially on low TickRates of course. Valorant runs 120 TickRate or so. There it doesn't matter. Not sure about Overwatch.

hollow gate
thin stratus
#

Which tick? I'm not talking about low FPS.

thin stratus
hollow gate
thin stratus
#

And also between 2 Mover Instances >.>

thin stratus
# hollow gate i was answring the fighting games caps fps. if they cap to low it's same situati...

What I meant with the Fighting Game is that they cap to 60FPS and uses Peer to Peer networking with the Sim also running at 60FPS. It's a completely different setup and requirement than a 100 Player Dedicated Server.

Volarant and Overwatch don't need that much CPU cause they only have a fraction of players and map size. Fortnite would be a better case, but no clue when or if they will ever use NPP.

thin stratus
#

The MaxPlayer part is usually also specified by the ?MaxPlayer= option when traveling to a map (as the host). Do you maybe have that somewhere? You can check your logs too to see if something is setting the MaxPlayer to 16 via the URL.

unique summit
#

It is actively used yeah

#

Gonan try the ?MaxPlayer thanks

thin stratus
#

Just keep in mind that the CreateSession stuff and the AGameSession are two different things.

unique summit
#

It did the tricks, thanks

#

oh, I thought they were related

#

createSession mostly opens the socket, but has nothing to do with the session object, that is created by the GameMode ?

thin stratus
#

AGameSession is an Unreal Engine class. It isn't related to the Sockets, neither is it related to what CreateSession does.

#

It simply a class that represents the "Session" but on Unreal Engine's side.

#

The CreateSession node also doesn't actually open any sockets. That's why you still need to do call Open Level with ?listen. You can do that without CreateSession too.

#

What CreateSession does depends a bit on your current Environment and what OnlineSubsystem you are using. If you are using the standard Null Subsystem, and/or you are hosting a LAN, match, all this does is add a local Session entry, and if someone looks for a LAN Session via "Find Sessions", it gets asked via the Broadcast IP of your Network and responds with its Session information.

#

If you are using something like the Steam Subsystem and you just an online game, CreateSession actually uses the SteamAPI to create a Session on Steam's end, which is also where FindSession then gets its list of Sessions from.

#

Online Session with Subsystem NULL is in fact not a thing. The only thing you can do is connect via IP directly (if the port is open on the host) and the CreateSession node is in theory redundant then.

#

"What is a Session then?" you might ask. Relatively simple: It's information about the "Multiplayer Session", such as "How many Players are allowed to join?" "How many Players did already join?" "Who are these Players?" "How can I connect to the Server?" "What is the name of the Session?" and whatever else you want to add, such as the current Map Name, GameMode, the Ping, etc.

#

So just a lightweight information container that, for online, is usually put into a database of a "MasterServer", which returns the list of Sessions if someone asks for it. And that can the be used to show available Sessions in the UI and/or join the Session and then connect to the Server.

#

Joining a Session, btw, is not the same as connecting to the Server. The Join Session node does just both of it for you.

#

So the whole Create,Find,Destroy,JoinSession stuff is all just about that information container, that either sits on the hosts PC in LAN; or is additional send to some backend for others to find the Session and get info on what is going on and how to connect to the Server.

#

Opening a Socket is cut lose from that. You can do Session stuff without actually doing that (then no one can connect, but well), and you can also open the socket and not do the Session stuff, then people need other ways to know how to connect to the Server.

#

Hope that makes somewhat sense.

unique summit
#

Yeah it makes sense

#

thanks for the infodump

#

Is it doable / easy to support both dedicated server and listen client for a multiplayer game ? or should i expect nasty gotchas ?

thin stratus
#

Coding-wise, you more or less just need to keep in mind that one case is a Server without visuals, and one case is a PlayerServer with visuals.

#

So in cases where you would do something that affects the ListenServer, but not the DedicatedServer, you have to split your logic.

meager heart
#

Can someone help me identify what actor would have both of these roles, in a setup where I have 3 players (1 listen server and 2 clients)?

  • I'm trying to debug an issue where there's some duplicated logic being fired messing with my GAS setup specifically when this logic fires twice, and they specifically are the only actor with these two roles
meager heart
# thin stratus Both of these roles?

Yeah it's a single character actor which has remote authority and is locally an autonomous proxy, trying to deduce which actor that could be in this setup with 2 clients

thin stratus
#

The Character I would guess

#

On the owning Client's side.

meager heart
#

Are you saying the server's character actor? (Also yeah this is firing from my character class so it is a character)

oak flicker
#

I just want to move a selected pawn in multiplayer without possessing them, so in legit 12 hours, I couldnt get it to work. the solution was to store the pawn reference in the gamemode and then get it from there to have a copy of its ai controller to make it move where I want him... now its rubberbanning on two standalones, lol that means it works.

thin stratus
#

This is one of the Clients, printing the Roles on their end.

#

LocalRole -> AutoProxy
RemoteRole -> Auth

meager heart
#

Oh okay, so it's the server-side actor of one of my clients? Sorry still getting used to this

thin stratus
meager heart
#

Oh okay, the remote role was throwing me off then

It's also interesting when that same actor fires a reliable function on the server it doesn't actually run

thin stratus
#

The Server has Role Authority, the owning Client has Role AutoProxy.
If you print this on the Clients end, it's gonna be Local -> AutoProxy and Remote -> Auth. And if you print it on the Server it will be swapped.

#

There might be some special rules for the ListenServer, but if LocalRole is not Auth, you aren't on the Server.

#

Unless you print that on an Actor that is locally spawned by the client and not part of the replication cycle.

meager heart
#

Okay this really helps, thank you! I'm trying to figure out what's going on with this actor in particular, this is all firing during OnRep_PlayerState() and for some reason it doesn't cause an issue when I breakpoint and it's driving me crazy lol so these logs are what I have to go off of, so thanks for the explanation

thin stratus
meager heart
# thin stratus What is firing during the OnRep?

All of these logs, and I think most importantly my call to UAbilitySystemComponent::InitAbilityActorInfo(), which when this is firing 'incorrectly' it's causing one of my remote players to basically be bound to the ASC of another one of my characters

Uniquely when it fires 'incorrectly', it's the only time that the player state controller* is valid when this function runs, if that is any clue to what might be happening

#

player controller not player state^

thin stratus
#

But the prints are from LogCollab

#

What does GAS have to do with that?

#

Or is that your custom log?

meager heart
#

But I guess if it's firing on the client-side characters, then it makes sense why the controllers are valid...

#

And yeah sorry that's my custom log lol

thin stratus
#

OnRep_Controller in the Character fires only on the Client fwiw

#

Server doesn't run OnReps

#

C++ ones at least

meager heart
#

Yeah that makes sense, alright hopefully I can use that info to try to figure it out, I need to go take a break

#

Thank you very much for the help though!

thin stratus
#

I'm not actually sure what you are struggling with haha

#

The prints are not telling me much

#

But good luck I guess :<

meager heart
#

Yeah it's not clear to me either lol but all I know is the bug is happening, this is basically me trying to pinpoint something and it's taken me a bit to associate this logic with the issue but I'm sure they're related because it doesn't happen when they log a certain way

thin stratus
#

I don't think you really told me what bug you even have. Or was it that "duplicated logic firing" part?

crisp shard
#

is a "tmap" a structure array ? i get "replicated tmaps aren't supported" or something along those lines, and im wondering how i could get a structure array to a client widget without sending it as it is

thin stratus
#

TMap is a TMap

#

Just like TArray is a TArray

#

You can cut the T off if you are in BPs

#

If you changed a Variable to a Map type and it's replicated, it won't work.

crisp shard
#

ahh there's a map inside of this strucutre i think

#

so you can just sending strucutre arrays to widgets then, and im just mistaken /

#

?*

thin stratus
#

An Array of Structs can replicate. But the properties inside of it still individually need to support replication. No clue what widgets have to do with this as they aren't something relevant to Multiplayer/Network

#

The TMap in the Struct that is in the Array will not replicate.

crisp shard
#

yea got you, im getting server data and passing it to the client to create a widget but i need to get the players items and this would end up as an array so i was just ensuring it could do that, but the map is inside of a different strucutre related to spell info so i can just replace it with something else

clear zephyr
#

im having this issue where the the first player works but the second is not working right. I figured out how to debug it and this is the error message im getting

#

LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor BP_ThirdPersonCharacter_C_1. Function GrabLedgeServer will not be processed.

nocturne vault
#

I'm currently learning about replication for multiplayer but I'm having an issue changing material parameters for host and client. Ive been trying different things for the last hour and I can only get the material to change on begin play, and when the client triggers the input.

#

for some reason, the host can't see the emissive change on the material himself, but can see it when the client changes it

#

Here is an example of the problem. The first one grabbing the flashlight is the host, even if I press F8 and look at the flashlight, I don't see the emissive change on myself. It only works for the client

sinful tree
# nocturne vault

Don't multicast stateful things.
Use Replicated W/ Notify variables to contain the state.
Flow can be:
Input from player > RPC to Server
Server RPC > Sets Replicated Variable (w/ Notify)
OnRep Function > Performs the logic associated with that variable being changed.

nocturne vault
sinful tree
#

Sounds about right, and then move your logic for what happens when that state changes to the OnRep function.

nocturne vault
sinful tree
#

You probably want to use the "Flashlight On" variable instead of the "ON" variable for these.

nocturne vault
#

when I run it standalone it works. When I play as listen server, it doesn't change for host, only client

sinful tree
#

Time to start breakpointing and see where the logic fails.
Everything looks correct from what I can tell.
You have:
Input > Run On Server Event
Run On Server Event eventually calls something that sets the boolean.
Your OnRep is requesting something to change with the value of the variable.

The only thing I can think of off the top of my head based on what you've shown is that you don't have the flashlight actor marked to replicate.

nocturne vault
#

I'm using a component for my items

#

And its for skeletal mesh assets

#

I have the component set to replicated

sinful tree
#

How are you attaching that component to your player when they pick it up?

nocturne vault
#

on event begin play of the component. so when I pick up an item, it spawns the item component for that pick up

sinful tree
#

How is your Event Pickup Interface called?

nocturne vault
sinful tree
#

Multicast = You're creating unique instances on each computer... These would not be replicated.

nocturne vault
#

jesus... the tutorial I watched did a terrible job then...

sinful tree
#

Seems like :/

nocturne vault
#

it has a lot of views too

#

I'm completely new to multiplayer and replication so it's pretty confusing for me still

nocturne vault
#

lol, changing the emissive works but now that I took out multicast, the flashlight doesn't get attached properly the socket

dark edge
nocturne vault
#

seems like the client doesn't attach the component to the third person mesh of the non locally controlled players now that I got rid of multicast

unique summit
#

I have a replicated TArray<AActor*>. is it normal that the actors are not replicated ? Do I have to spawn them explicitely on each client ?

#

(said actors are spawned before the other client join the game)

lament flax
lament flax
#

So the clients joining late get updated

unique summit
#

Some stuff down the chain might not be reped, you are right

unique summit
#

So my actors are correctly synced, but not their movement. I am using SetActorLocation is it expected ?
These actors are going mostly in straight lines, but I need to keep their position synced. Is there a better option ?

agile meadow
#

i think im close guys!

dark parcel
#

Context is important tho

unique summit
#

Yeah, I just did not rep the class that contained said array

#

Works fine now

#

also fixed my movement issue with a poor man replication

dark parcel
#

Well repping the array or not don't have much to do with spawning. Unless you want to spawn locally, based on the array data

unique summit
#

Since the array is correctly repped, the actors in it seems to be repped to

#

I only spawn them on the server, and they show on the clients

dark parcel
#

If you just want to spawn actors for everyone. Tick replicate, spawn on server. Done.

#

The array serves no purpose unless you want to store it.

Make the array replicated if client needs to know.

#

And rep notify if you want to call a function when the array is updated, for client.

unique summit
#

hmmm the client does not need to know about the array. The array is actually a pool to reuse actors

dark parcel
#

Then you don't need to replicate it

unique summit
#

Thanks

#

It should save some performances

dark parcel
#

Spawning and destroying will be handled by server

#

Ain't nothing the client can do about it anyway except for their own copy

nocturne vault
#

I still can't figure out what I'm doing wrong. After I removed Multicast from my Pick Up input, the items don't attach correctly for clients. The last screenshot I attached checks if the player is locally controlled and attaches to the socket for the first person mesh and third person mesh accordingly. The result from this is: Item attaches to First Person hands for the host and host sees items on Third Person hands for Clients... BUT for the client, the item isn't attached to their first person hands, and they don't see the item attached to the third person hands for the host.

#

How can I correctly attach items to host and clients without using multicast?

kindred widget
nocturne vault
#

The way I have it set up, the host sees the items attached correctly for himself and other players. But clients attachments seem to be messed up not attaching to the proper place. I’m at a loss and can’t figure it out.

lost inlet
#

I don't think I've had to ever rely on component replication to attach meshes for an item/weapon to a character

nocturne vault
#

Are components the wrong way to go for items in multiplayer?

nova wasp
nocturne vault
#

This is basically what I have set up. Player interacts with a BP actor, it spawns an item component for the specific item, then attaches

nova wasp
#

does bp support replicated subobjects at runtime?

dark parcel
#

If the attachment are like slots, it can just be a rep notify variable.

On rep, set mesh to w.e it is.

lost inlet
#

yeah I think I've used a combination of an item owner and item state for mesh attachment before

#

which were replicated with ReplicatedUsing

nocturne vault
nocturne vault
nova wasp
#

I wonder if this helps with bp only stuff

lost inlet
#

not sure about items as components though, pretty much always done them as actors. easier to compartmentalise

#

it can work though I'm sure

nova wasp
#

I think it depends on what they need to do in context

#

I think they should be as dumb as possible until they need to have a real visual mesh

#

I would prefer having them as a list of structs that point to their class + quantity or other simple instance data

#

then when selected or something they represent themselves as a mesh

#

of course dropping or throwing things would need to spawn a full on actor in the world

nocturne vault
#

It worked (attached correctly) when I used multicast, but I wasn’t able to change the material parameters of the items when a player uses the item

lost inlet
#

if you want to be all data oriented then yeah

nova wasp
#

I guess it might be a bit too tryhard, I dunno

nova wasp
#

only things that are replicated are replicated (I know that looks like a silly comment but... yeah)

lost inlet
#

replicated variables with OnReps are still the preferred method for replicating stateful data and having an event to react to

nova wasp
#

if you change material parameters from replicated state like an onrep that would work and be nice for late joining etc

#

OnReps my beloved

nocturne vault
#

So host and client can see flashlight emissive change

nova wasp
#

so it's not sending the repnotify? Try to think about the actual root cause here I guess

#

Another thing to do with visual stuff like that is to consider if there are other things that happen along with it that it could listen to instead of needing more replicated state to deal with

#

For example: why replicate 5 things that always have to change together when the client can just get 1 thing that all 5 listen to

#

Like equipping a weapon playing an animation... you already know they equip the weapon and which animation it has so you don't need to send the animation that plays, it can just be derived and played locally

#

The flashlight here is probably fine on its own I suppose, I don't know what the design is

nocturne vault
#

I'm confused and lost. Multicast attached properly for host/clients, but I wasn't able to change material paraments correctly. Without multicast, I can change the material parameters for the items the host and client are using, but it doesn't attach correctly for clients

nova wasp
#

I'm lost too because I don't know which one needs to come before the other

#

If it never attaches can it receive the onrep for the material param?

nocturne vault
dark parcel
nocturne vault
dark parcel
#

Youtubers are clueless

nova wasp
#

and yeah frankly multicast should only be for something that is a one-off

#

it's just massively less of a headache to use an onrep

#

check these articles out (from Vori)

nova wasp
# nocturne vault

can you try to suss out what it's attached to ont he client side? I wonder if it's just using the wrong relative transform

nocturne vault
nova wasp
#

that's not what I wrote, I wrote about what it is attached to and how

#

get the parent socket and the relative transform

nocturne vault
#

Could it be a problem with replication on Animation BPs?

dark parcel
#

anim bp does not replicate

#

and no, I don't see how's that got anything to do with anim bp

#

you should just check what codes get executed when client run it

#

though stop using multicast, those youtube multiplayer tutorial lead you astray

nocturne vault
#

I haven't been using multicast in the last 4 hours trying to figure out how to attach correctly to clients

dark parcel
#

multiplayer is about knowing what code runs on where and who does send what and does what

nocturne vault
#

I also tried put it on an actor blueprint instead of a component. Still gives me the same issue where client doesn't see items attach correctly

dark parcel
#

with the goal to make the world seems the same as others

#

you want to know what code gets runs on the client and figure out why it doesn't produce the same result

#

Can't tell with limited info but your mesh and FPS mesh, are you sure they have the right socket offsets?

#

perhaps one of them isn't placed correctly

#

just go to your skeletal mesh and attach the flashlight to see if the socket is in the right place to begin with

nocturne vault
dark parcel
#

debug

nocturne vault
#

is client 0 supposed to be the client? listen server is just the host and client 0 is the client? It says NetMode: Client 1 on the window

nova wasp
#

Client 0 will be the first non-authority client in this case

#

the PIE windows kind of use 1 first while internally it's client 0, kind of confusing

#

either way debug printing will show the world name (listen server/client n)

nocturne vault
#

How could this be possible? I picked up the flashlight as the host, but the simulation was set to Client 0.

nova wasp
#

what called this?

#

this is kind of a fundamental thing where you need to be able to see why things happened, the blueprint debugging window can show a call stack

#

I don't know how we are supposed to guess based on random nodes without context

#

so showing what this came from is required to get any help

nocturne vault
#

ok let me check blueprint debugger

nova wasp
#

you could add a breakpoint or even make a branch that changes based on if it's a server or not to catch this situation etc

nocturne vault
#

I added a breakpoint, and when the host picks it up, for the client it shows to add it to first person mesh. But, the host isn't the locally controlled player for client0

#

so I don't understand why the branch for is locally controlled is True

#

That's the problem. The client is doing the opposite. is locally controlled is showing as false when it should be true

#

and true when it should be false

#

is there another way I can check if the it is the local player besides Is Locally Controlled?

nova wasp
#

what is "it?"

#

That also doesn't show what called this

#

Remember that we can only see what you show us, I can't see your project

nocturne vault
#

I'm not sure what you are asking for what called it and how to check that. I'm using the breakpoint to see what happens when the client picks up the item

nova wasp
#

what I mean is what events happened to reach this point

#

was it a specific onrep? an event?

nocturne vault
#

Player input runs on server and does interface event on the Item actor. Then it spawns the item component where it attaches the actor based on if the player is locally controlled

#

this image is pretty much the whole process

nova wasp
nocturne vault
#

that just sets the item to the current holding item

#

the problem is the branch for is locally controlled

nova wasp
#

I am not trying to be rude here, I don't think there's anything wrong with your bp set up

#

I'm just trying to help, but I can't help with random information and not what I directly want to see

twin juniper
#

the blue line 💀

nocturne vault
#

how can I get what you want to see? I'm not sure

nova wasp
#

why this node was reached (the callstack) and what kind of object is being passed into IsLocallycontrolled

nocturne vault
#

get owner to cast to BP_Player is going to IsLocallyControlled

nova wasp
#

was this your player? another player? from an rpc? an onrep?

nova wasp
#

what is BP_Player?

#

is it a pawn?

nocturne vault
#

This is how the Component is spawned

nova wasp
#

neither of those are a call stack

nocturne vault
#

the player picking up is the target for add component and item to spawn

#

I'm not familiar with a call stack

nova wasp
nova wasp
#

so the beginplay for the replicated player pawns will run on clients and server

nocturne vault
#

I'm sorry if I am a bother. I tried to look at the call stacks and not sure how it can help me

nova wasp
#

what is ROS_Pickup?

nocturne vault
# nova wasp Beginplay runs on all clients fwiw

Yea, I figured that. But the idea was that IsLocallyControlled will make sure the items get attached to the right. If they aren't locally controlled, then attach to third person, locally controlled then first person. The thing that is happening I think, is that the clients are running the opposite of the branch for locally controlled

nocturne vault
dark parcel
#

RPCs on Triggered for item pick up?

#

if you want to pick up an item when you press a button, just use started pin

#

triggered runs every frame

nova wasp
#

it depends on thei IA setup but yeah by default this would fire on tick while held

nocturne vault
#

good to know

dark parcel
#

Yeah, depend on the game but if that's not the intention, you are wasting bandwith

dark parcel
nova wasp
#

They want this to swap based on if they are locally player controlled

#

I'm wondering if it's a timing issue, the remote roles might not have swapped this early

#

I would like to see some simple print string thing to see how each client considers each playerstate locally controlled, it relies on remote role being ROLE_AutonomousProxy to work as expected here from what I can see

swift sorrel
#

yea. when in doubt, use prints.

nocturne vault
#

wtf

#

I added a delay with 0 duration and now it works

nova wasp
#

yep, one frame later the roles are swapped I think

nocturne vault
nova wasp
#

try printing the remote and local role of the player each time

#

before and after