#multiplayer

1 messages ยท Page 142 of 1

fossil spoke
#

Also probably a good idea to reduce the NetUpdateFrequency to a value that you are comfortable with.

#

The lower the better

lucid badger
#

Yeah this can be super low

fossil spoke
#

Well it cant

lucid badger
#

Even very brief desync wouldn't be a problem I Just don't want items permanently diverging

#

I get you if it's too low it never fires

#

I just meant, as low as it can go

fossil spoke
#

You can use things like the significance manager to handle adjusting the update frequency for further away ones

#

You might want ones really close to the player to have a very high rate so they appear smoother

#

And ones far away can be a lower rate because you are less likely to notice the hitching

lucid badger
#

Slapping this in broke it now the items are just stuck in the original spawn position on client

#

Is that the wrong way to disable phys?

dire cradle
#

It's fine, but probably better to keep it disabled by default and activate it if authority instead of vice-versa

lucid badger
#

It seems that with that off, it's no longer syncing position

#

or rotation

dire cradle
#

is it disabled by default on the mesh?

lucid badger
#

I have it set enabled on the mesh, I can try inverting it, you think that'll fix? Thinkge

#

Enable on auth

dire cradle
#

Yes

lucid badger
#

wtff that did fix it

#

Why ??

dire cradle
#

Because before it wasn't being turned off on clients

#

You were activating the physics on the server on a mesh that has physics already enabled by default. And not turning it off on clients either

lucid badger
#

On false, no authority, it sets it false

#

Or am I misreading

dire cradle
#

Assuming you did it

lucid badger
#

Starting True and Setting False on No Authority seems to me like it should do the same as Starting False and SEtting True on Authority, but it does not Thinkge

#

Perhaps just to do with the timing of beginplay I guess

#

Probably if I did it in constructor then it'd be the same

dire cradle
#

Thought it worked

lucid badger
#

All good Okay appreciate the help

dire cradle
#

I did some testing

#

And simply doing this works, with Actor and Movement replication enabled

lucid badger
#

Yes

#

I said it works that way I was just curious why it doesn't work the other way around. I.e. on by default and disable when remote. But I'd bet it's just the timing of begin play

dire cradle
#

Oh then it's fine, it's definitely about the timing

lucid badger
dire cradle
#

That timing issue probably won't happen inside the construction script, might want to use that instead.

lucid badger
#

I feel like this is a MP question, since it's a MP reason why I want to do it Hmmge

Is there a way to crank graphics waaaaaay down for Play in Editor mode, for testing purposes? with 4 players on one PC it gets a little slow heh

#

I'm made to understand that Run Under One Process is much faster but when I do that, my shit breaks, and the tooltip suggests it is bug-prone Thinkge

sweet sage
#

Do anyone have something like this?

#

When playing root motion montages and colliding against moving objects, they are on different positions for each machine and replicated proxies sometimes don`t collide, etc

prime stump
#

anyone here familiar with playfab?

dire cradle
#

I used it once

prime stump
#

were having a problem with the server allowing connections... its probably something stupid

#

like i get the servers up and running and it gives the clients the ip/port to connect to...but its just not listening on those ports so the clients time out

dire cradle
#

Without playfab does the server work correctly?

prime stump
#

yes

dire cradle
#

Are you using the container mode?

prime stump
#

yeah

dire cradle
#

I didn't use the container mode but I think it requires some verification of some sorts if I'm remembering correctly.

#

Disable the container mode and try that way and see it it works

prime stump
#

ok stdby

#

yeah...here is the issue...i could never get the process mode to work, servers kept failing to deploy...also with process mode we can only run 1 server per VM which is not ideal...i can try again as a test but we really want containers for scalability.

dire cradle
#

It's the containerazation thingy, I don't know how it works but it's probably relevant

spice gorge
#

I'm having an issue with properly connecting a client to a server since I added seamless travel over Steam.

In the OnlineSubsytem the listen server player starts a session upon the complete delegate firing it calls

GetWorld()->ServerTravel("/Game/Maps/Home?Listen", true, false);

The client opens up their online menu and sees a broadcast of the server game and can hit join.
Upon the join delegate firing it calls TryTravelToCurrentSession()

PlayerController->ClientTravel(ConnectString, TRAVEL_Absolute);

Here's the weirdness:

  • The client goes nowhere. They just sit in their own level and don't travel to the host map
  • If the host changes level (via a trigger) which uses the Blueprint OpenLevel function with the map name ?Listen in the options. The client gets pulled into the new level.
  • If the client leaves the server and reconnects it all works fine and they automatically travel to the server map
  • If the host ends the server and starts a new one the problem begins all over again
#

The usual stuff for seamless travel is there. The bool is enabled in the GameMode and the transition map is set. Which I guess is a given because once it works it works. It's just that initial map load that's causing the problems.

dire cradle
#

When you start the server use open level instead of server travel

spice gorge
dire cradle
#

As far as I know Server Travel is to carry players that are already existing in the scene to the target level.
If they never really joined then there's no one to pull, open level ensures clients will be pulled to the server scene as soon as they join.

spice gorge
torpid lantern
#

Does multicast only go to relevant actors in replication range, or all connected clients? How careful do I need to be with my multicasts?

dire cradle
#

If the event is ticked reliable then relevancy is is irrelevant, if unreliable it will check for relevancy and decide to update or not.

hollow eagle
#

That's... wrong. RPCs can't be executed on actors that literally do not exist on a client.

#

If an actor isn't relevant to a client and the client does not know anything about it, any RPC on that actor sent to that client is going to be dropped.

#

Apparently the engine is/was dumb about this.

#

And immediately opens a new actor channel for actors that aren't replicating

#

jfc

dire cradle
#

Yeah relevancy doesn't mean the actor doesn't exist

hollow eagle
#

It does for dynamically spawned actors

#

(assuming the client is up to date)

#

but at least in some situations the engine will apparently replicate the actor anyway. And then immediately remove it from relevancy again.

#

just one more reason reliable multicasts should be avoided in almost all situations

#

ah, turns out this behavior is actually controlled by a (default-on) cvar and it requires that there already be an actor channel. Still something to be avoided, but not quite as ridiculous behavior as I assumed.

toxic falcon
lost tinsel
#

how unreliable is it when you put "unreliable"? it's like, if the bandwidth is saturated then it won't execute the rpc?

chrome bay
#

and won't be resent if it fails to arrive

twin juniper
#

What does normal video games use? Local Predicted or Server Initiated?

#

Like Fortnite or sth.

chrome bay
#

Depends

#

Also if I didn't know that was a very specific setting in an ability, I'd have no idea what you were asking there

sharp vigil
#

How does Iris even work? Do I just enable it and call it a day? lol I'm reading the docs right now on it and that's how it sounds in a nutshell to me?

meager spade
#

Iris is very experimental

#

Most stuff should work either minimal ini file setup

#

But not recommended atm

#

Unless you have a reason for iris, I would ignore it

lost tinsel
chrome bay
#

All net traffic is UDP in Unreal, but essentially yes

#

it's 'Fire and Forget'

lost tinsel
#

cool, ty ๐Ÿ™‚

crude quail
#

Since it seems like subsystems in unreal cannot do server rpcs, how would you typically elevate a subsystem request to the server? It's awkward to create a subsystem and then a client object who's only job is to listen to the SS and simply RPC for it

chrome bay
#

use an actor

#

SuUbsystem spawns an actor (server side), RPC's go through that

crude quail
#

yeah so the process has to be Initiator->Subsystem->Client Object RPC'

#

I cannot do better than three steps of indirection to just send a single rpc?

stoic lake
#

Good to hear!

gloomy tiger
#

Hey, a few questions about shooter + multiplayer in a scenario I don't care about cheaters (its coop), am using GAS and it's a third person shooter where the position of the character doesn't necessarily reflect where they're aiming.

  1. How would you deal with shooting? Client sends to server an RPC informing it has hit X, Y and Z characters? Or you go full predicted by the server and only informs character X is shooting and each instance simulates it?
  2. AI life - do you replicate it to everybody? I believe, in general, it's not a good practice but would like to hear your experiences.
  3. When hitting walls, for example, I want to spawn a particle. How to go about it? Client -> Server RPC -> Multicast? (in our context, hitting walls don't break them etc, it does nothing, its pure aesthetics)
chrome bay
#

Only Actors can send RPCs, so it has to go to an actor eventually

chrome bay
#

There's no catch-all solution

gloomy tiger
#

Shoot, send the aim direction + origin to Server. Server checks and shoots too, or rejects. Replicate some minimal information about the shot to all clients so they can simulate it locally too. Really depends on the type of game, the weapon, the projectile etc.

That's good insight. No projectile - raycast only. Weapon: automatic.

chrome bay
#

Hits are similar. Client tells the Server they hit something, server either agrees or disagrees. Or you do full Server-side hit detection.

#

ShooterGame is old but has a reasonable implementation

#

Projectiles are SSHD, Raycasts are CSHD

gloomy tiger
#

SSHD and CSHD ๐Ÿค”

chrome bay
#

Server-SIde Hit Detection vs Client SIde Hit Detection

gloomy tiger
#

Or you do full Server-side hit detection.

This is probably... the smoothest, network-wise? ๐Ÿค”

chrome bay
#

SSHD means you tell the server you shot, and it does everything else. Players have to account for latency

#

CSHD means players generally don't have to account for latency but is far more complex to implement

#

Since ofc, the Server needs to validate everything the client sends, and you're dealing with different frames of reference when validating the shots

sharp vigil
#

Is this kosher? I'm setting a struct of resources for teams on my gamestate but when I'm retrieving the values I don't use an RPC since the gamestate is automatically replicated. Should I be sending requests to the server to retrieve the values from the server gamestate?

Edit:After reading this.. the server should be the source of truth lol

solar stirrup
#

I do wonder if it'd be sane for shots to start off as raycasts, and if they don't hit anything, they get turned into projectiles by the server for them to travel

chrome bay
#

IIRC insurgency does that, raycasts for the first 50M or so then projectiles to make it more 'responsive'

#

Seem to remember hearing something

sweet sage
#

Are there any events for when dormant actor wakes up and sleep?

gloomy tiger
#

or particles, etc?

#

bc I mean, probably it invovles a sh-t ton of techniques to make it performant - I bet it wouldn't be a mere SpawnActorOfClass AProjectile and les go baby

#

Pooling and all

sweet sage
ashen scroll
#

OnPossesed?

sweet sage
#

A mob/monster

#

not player

ashen scroll
#

aa

#

still

#

it works for controllers

#

but i probably dont know what you're talking about

#

so i wont comment further

ashen scroll
#

oh i see

#

yeah i have no idea honestly, probably shouldnt have responded lol

forest bolt
#

Has anyone ever experienced crashes with GetPlayerControllerFromNetId ? For some reason my UniqueNetIds are CRASHING when checking the .IsValid().

tardy fossil
#

Itโ€™s a little surprising to me UE doesnโ€™t have a in house solution for projectile prediction like they have with character movement. I guess thatโ€™s a lot harder to make it flexible enough to work with everything

forest bolt
forest bolt
flat night
#

So I did the whole checking the pawn, but I had the same issue - the pawns get validated very quickly, while the Client viewpoint is still in the middle of the world, until it starts using the proper camera. Do you have one camera and how do you assign it to players?

And this is my questions to others I guess as well, if you have 1 camera in the scene that you want all players to use on joining the game, how do you do that? I currently have one camera in the level and in the gamemode I use GetAllActorsOf and set it to a var that later on I use NewPlayer->SetViewTarget(SharedCameraActor); in HandleStartingNewPlayer_Implementation but that is quite slow apparently. And I have no idea how to make a callback so that I get a notification when the Client has started using the one camera in the level so I can start the game.

rich dune
#

Hey,

Im running into an issue with vehicles and desync. I can attach my player to the vehicle and drive around with no problems. But as soon as a detatch the player from the car and take ofer the character models control again, it's no longer synced and I'm warping and teleporting around. any ideas why?

mystic estuary
#

Most likely CMC is telling you something

mystic estuary
rich dune
flat night
#
Super::HandleStartingNewPlayer_Implementation(NewPlayer);
    
    PlayersInGame.Add(NewPlayer);
    
    if (SharedCameraActor)
    {
        NewPlayer->SetViewTarget(SharedCameraActor);
       }```

this is what I do to set a new player to the camera I have in the level. And I mean that the process of the player joining and starting to use that camera is quite slow. It's not like the player joins and they immediately start using that camera (which is static by the way)
mystic estuary
flat night
#

thanks!

mystic estuary
mystic estuary
flat night
#

My assumption is that the calling happens immediately, cause I have some other code afterwards that fires. But the Client looking for that camera and starting to use it takes time
And if you ask how much time....idk, I have to time it, but I wouldn't know if it's always the same. If it is, then it would be a simple timer to do, but I can't rely on such an arbitrary method

mystic estuary
#

If it calls the HandleStartingNewPlayer() immediately, does it mean that it processes the NewPlayer->SetViewTarget(SharedCameraActor); for long time? You don't have to measure it precisely. Is it 5, 10, 15 seconds? I'm asking just to get an idea

flat night
#

5

#

just timed it

mystic estuary
#

And for these 5 seconds, what does the new player see?

rich dune
flat night
#

they are just in the origin. I can see on the Server that the player has been spawned

mystic estuary
#

Can you try to step through the APlayerCameraManager::SetViewTarget()? It looks like that they set some timers internally for blending purposes. It might be something to do with that

#

step through with debugger upon new player login*

solar stirrup
#

thanks

#

Insurgency's guns do feel pretty damn good

flat night
mystic estuary
#

You're looking for the reason it delays the function. As I said, it looks like it's setting some timers inside. Take a look at the timers duration it sets, and compare it to the 5 seconds delay you're getting.

flat night
#

is that it's going to say somewhere in the debugger here that value?

mystic estuary
flat night
#

adding a breakpoint on line 156 doesn't make it stop so I can see whether it's giving any value

mystic estuary
#

Can you try to put a breakpoint in void APlayerController::ClientSetViewTarget_Implementation( AActor* A, FViewTargetTransitionParams TransitionParams ) to see whether it's called immediately after the HandleStartingNewPlayer(), or perhaps it's called after 5~ seconds after that was the case?

flat night
#

seems to be immediately

#

I wasn't using that function honestly until now

#

just added it for testing

mystic estuary
#

You don't have to use it manually, it's called in the SetViewTarget() at some point

#

Either way, does the ClientSetViewTarget_Implementation() call the inner SetViewTarget()?

flat night
#

seems like it

mystic estuary
#

Does it get a valid NewTarget (the first argument)?

What does it do inside the SetViewTarget() when it's client-side?

#

Also, a quick tip. In order to know whether you're client-side or server-side you can use the {,,UnrealEditor-Engine.dll}::GPlayInEditorContextString in your debugger. Adding it to watch will tell you that interesting information anytime you open up the debugger

flat night
#

you mean like this?

mystic estuary
#

Yeah, like this. It should've worked ๐Ÿค”

#

btw, do you have the debug symbols downloaded? Their absence might be the reason it doesn't find anything

flat night
#

maybe not, I will need to have a look

mystic estuary
#

If you're unsure, you most likely don't. That's fine, but it's heavily encouraged to download them if you're going to work a lot with C++ in UE, as it gives a lot of extra debug information. The only issue is that they are 50GB or something

flat night
#

okay, I will get them

mystic estuary
flat night
mystic estuary
# flat night you mean like this?

That's fine. To see whether the NewTarget is valid simply look at its value in this tab. When it has a name and properties in 99% of cases it's going to be valid.

To check what it does inside SetViewTarget() you have to step into the function using F11 (or the button above the properties in the aforementioned tab), but I'm unsure whether you need the debug symbols. You actually might need them since that's kind of the point of downloading them. Since I haven't worked without them in a while I cannot be 100% sure about it.

I guess download them, and in mean while perhaps look at how other people switch the camera, if you haven't already. I personally haven't worked with cameras really, so I only have ideas on how things should work. ๐Ÿ˜„

chrome bay
flat night
mystic estuary
#

I see. I guess we can go the other way around: instead of getting to the problem from its origin, we can try to get to it from the very end -- from the function that actually makes the player see using the camera you're setting. The only question is what this function is. After that it's just the matter of going down the call chain, and see what delays a certain function in all that chain. With that knowledge most likely we can find either a workaround or a fix for that.

flat night
#
{
    K2_OnBecomeViewTarget(PC);
}```
this is the end one and I cannot go anywhere else.
I am not sure exactly what's going on, I do not see any real timers, and if the timer is for the blend, I tried setting it to 0 but nothing happened
#

I mean, worst case scenario, if it's always 5 seconds, which I cannot really pinpoint until I test a bit more with others, I could put a timer to start the game after those 5 seconds and just have a loading screen in place...not a great solution, but I don't mind ultimately if it really is concise

mystic estuary
#

Practically you need to put a breakpoint in the BecomeViewTarget(), and look at the bottom left angle, there you'll have all the functions that took place before calling this one. Look for those that are relevant to the camera, and see whether anything is called by a timer manager, i.e. something has asked to delay that function

flat night
#

Thanks Tony, I will have a look later, I downloaded the symbols, but need some break, cause my mind is tired by this point ๐Ÿ˜†
I will message later with the results

mystic estuary
#

Sure, take a break. Debugging such issues is always a pain as you have to understand a lot of someone else's code ๐Ÿ˜„

jade patrol
#

how do you pause a multiplayer game in listen server? I want to pause a game and show a popup with some data from the server. But when the game is pause the multicast that tells the clients to open the popup is never triggered because the game is paused :D. So how do you pause the game but still allow clients to receive data and do ui stuff?

chrome bay
#

pausing the game shouldn't stop network traffic. It just stops level ticking essentially

jade patrol
#

oh I see, it needs to replicate with Reliable checkbox on

dark edge
#

What are you actually trying to do?

jade patrol
#

I stumbled upon another issue, the player state does not replicate properties while game is paused?

#

Basically what I want to do is to pause the game and show same menu to players where they can choose a random ability from a list (like a vampire survivals but multiplayer) . So I'm generating the abilities on the server for all the players and save it in player state (each player can choose from their own ability list and can see what other players are choosing). This works fine for the server but the clients will not update the list while the game is paused :/

nocturne quail
#

add item to player inventory should ever be called by client?

nocturne quail
# solar stirrup Probably not

so in this situation can we call server event from UI?
lets take a look at an Accessory item attach to AK47 and i drag it and drop it in my inventory from UI and the UI is not available on server!

solar stirrup
#

I have a component on the player controller that holds the RPCs for inventory actions in my case

#

You'll need something similar

nocturne quail
#

Ok thanks

bright summit
#

silly question but, how can I check if my footsteps on multiplayer are working? When I focus on another client the previous one is muted

spiral crystal
#

Yeah i'm doing the same. UI is calling something like "Move Item" (Server Reliable) on the player controller, server is executing MoveItem_Implementation and then calling a MoveItemExecuted (Client) on the player controller which will then update the UI.
If it needs to be fast you can already update the UI clientside and then just correct if the server response is received (or don't send a response at all if everything is ok)

bright summit
#

thx

bright summit
spiral crystal
#

Damn ๐Ÿ˜„

#

maybe also try the standalone thing

bright summit
#

need this thing in editor

spiral crystal
#

as a quick hack maybe just add a +1 velocity in the move function so the char is always walking?

twin juniper
#

Or a more simple question is: How do i check in code if the current blueprint in which the code is running is the real player (the player that is controlling the machine) or not?

#

Maybe, if there is something like get current player's index? Because i know the real player index is always 0 so can check with that?

dark edge
#

is locally controlled

twin juniper
quaint roost
#

would anyone be interested in discussing a latency-tolerant hitstop with me? I have some ideas for it but they all have major pros/cons. i'm hoping we can all learn something from the discussion

#

my defininition of hitstop is just setting montage play rate to X for Y seconds

#

triggering it would be server-authoritative, but i want all clients (including autonomous proxy) to keep in sync with the server as much as possible

limber fox
#

i need help understanding how to use gamemode and gamestate

#

do you put the variables in gamemode or gamestate
it seems like everywhere i look has a different answer

jade patrol
#

gamemode is server only and gamestate is replicated and all clients has it

limber fox
#

i know that much
but should the gamemode have the variables and the gamestate takes from that or the other way around

fathom aspen
#

Game mode holds rules, game state holds state. To get a better idea always open them and see what properties and functions they already entail, then u know more or less where yours should be placed

cobalt pollen
#

Oof. Making a game with basic floating movement but I want the player to be able to attach pieces onto their character (spaceship). Looks like networked character movement only uses the capsule, going to just resize the capsule to contain anything as I attached pieces I guess >_>

dark edge
#

What is actually doing the moving?

#

If it's a spaceship I'd probably use physics myself but that's up to you

cobalt pollen
#

I tried both

#

I might try physics but then prediction is up to me right

dark edge
#

Why do you need prediction for a spaceship? There's nothing more smoothly accelerating and slower responding than a spaceship

cobalt pollen
#

For physics collisions was my impression

#

But yes you'd think it's simple

#

As far as movement goes at least

dark edge
#

It is that simple, just play with the physics replication settings

#

If I were doing a spaceship game that's exactly how I'd do it, but it depends on how physics driven you want it to be

cobalt pollen
#

I'll try it out thanks

gloomy tiger
#

Created a blank project -> added some spawns -> packaged -> clients connected to me have ~60 ping with only cmc replicating

ideas?

fossil spoke
cobalt pollen
#

That seems like a normal ping (if it's not a LAN ๐Ÿ˜…)

fossil spoke
#

Only the Server can replicate changes of variables.

#

The Server will always be Authority over all Actors

#

Therefore an Autonomous Proxy cannot change a variable on its own and have that affect other Clients value of that variable.

#

Thats not how it works.

#

The architecture of how the networking layer is setup REQUIRES it to be Server Authoritative

#

There is just no way around it

#

Unless you want to do massive changes to the engine

#

Stop trying to take shortcuts

#

Work how Unreal wants you to work.

#

Its like that for a reason

hollow eagle
#

the value is set but the server never receives it

#

clients cannot tell the server to set any variables except through an RPC

#

there is no Client -> Server replication, period

#

clients can only set variables for themselves

fossil spoke
#

The only mechanism for Clients to affect change on the Server or other Clients is by routing it through an RPC

fossil spoke
#

There is no difference, other than Autonomous means it is locally controlled by a Player.

gloomy tiger
#

And it's a listen server; am hosting here, at home.

slow wing
#

What happens if I create an actor component during runtime only on the server, and set it to replicate, is the construction of that component replicated?
If not, then if the client also locally creates the component at runtime (say via a replicated event), are those 2 components then kept in sync via replication? how does unreal maintain the association between the server and client copy of the runtime spawned actor component?

forest reef
#

My clients seem to get the wrong location of their gun component. This location is used to spawn in the gun's projectile. Using the actor's location everything works correctly. Using standalone or listening the locations are set correctly. The picture shows one debug sphere going to 2 locations. I'm really not sure why this is. Any ideas?

gloomy tiger
#
  • I create a session (listen server; Steam; UE 5.3.0; windows 11 etc)
  • Friend who literally lives across the street connects to my session
  • Each one of us are possessing our own Pawns, who have no components but a SkeletalMesh; NetUpdateFrequency of 25 and no variables replicating whatsoever but the actor itself
  • Map we are connected to has nothing but some static meshes to be the ground
    - 60 ping
    I wondered, why?

Then we tried a few things:

  1. I asked him to host a session so I could join, same ~60 ping,
  2. I asked another friend to join my session, same ~60 ping,
  3. Disabling Steam Sockets, same ~60 ping,
  4. Tried a different NetDriver (SteamCorePro), same ~60 ping,
  5. Tweaked each and every TickRate config on DefaultEngine.ini related to NetDriver (and IpNetDriver), same ~60 ping,
  6. Build, re-build, clean build, relaunched Steam, relaunched Editor, and all the standard procedures one might blindly try, same ~60 ping,
  7. We launched another co-op, listen server, Steam game we released back in 2020 (UE 4.26) and there we got around 12-17ms regardless of who hosted it
  8. Launched another listen server co-op Steam game, same thing; 12-17ms regardless of the host

All the above said as we are running out of ideas... does anybody have any idea of what we could be missing?

(Below I leave a stat net picture of the client; not sure how much it may tell you but perhaps it could lead to something?)

sharp vigil
#

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

I'm getting this when I call an RPC to to update values on my gamestate from my character. Shouldn't I just be able to set it from my player char BP? I thought my client owns this actor?

Nvm figured it out. Gamestate is owned by the server so if I call an RPC on it it wont work.

finite goblet
#

is OnRep Called in case of FFastArraySerializer ?

fossil spoke
#

As a FastArray exposes functions that express when elements have changed via replication.

#
    /**
     * Called before removing elements and after the elements themselves are notified.  The indices are valid for this function call only!
     *
     * NOTE: intentionally not virtual; invoked via templated code, @see FExampleItemEntry
     */
    FORCEINLINE void PreReplicatedRemove(const TArrayView<int32>& RemovedIndices, int32 FinalSize) { }

    /**
     * Called after adding all new elements and after the elements themselves are notified.  The indices are valid for this function call only!
     *
     * NOTE: intentionally not virtual; invoked via templated code, @see FExampleItemEntry
     */
    FORCEINLINE void PostReplicatedAdd(const TArrayView<int32>& AddedIndices, int32 FinalSize) { }

    /**
     * Called after updating all existing elements with new data and after the elements themselves are notified. The indices are valid for this function call only!
     *
     * NOTE: intentionally not virtual; invoked via templated code, @see FExampleItemEntry
     */
    FORCEINLINE void PostReplicatedChange(const TArrayView<int32>& ChangedIndices, int32 FinalSize) { }
chrome bay
sweet sage
#

Think tarisland, where i can have more than 5000 mobs over the open world map. Running all them when players can`t see more than 100 is not worth it

#

I`m using void AMmorpgCharacter::OnSerializeNewActor(class FOutBunch& OutBunch) to awake AIs but how to detect when it is ready to sleep?

strong junco
#

I have a gameplay ability that should spawn particle effects and sound effects at a location. What would be a proper way to have them replicate to other clients?
I also need to update variables on the particle effects at certain points in the ability

sweet sage
#

Do it runs only 100? do bots count as CMC?

thin stratus
#

CMC is the CharacterMovementComponent. In theory yes

chrome bay
#

Anybody using World Partition in MP currently?

#

Seeing an issue where the persistent level is being GC'd and the engine is trying to stream it out, curious to know if anybody else has run into this.

strong junco
# strong junco I have a gameplay ability that should spawn particle effects and sound effects a...

I don't want to replicate the particle system directly because apparently that will be too network intensive, and I don't want to use RPCs
My current idea is to use UAbilityTask_SpawnActor, or maybe even create my own UAbilityTask_SpawnParticleSystem
Then have the ability update those as it goes. But I'm still unsure how to let the owning client do it's own thing based on the locally predicted ability, and have other clients respond to the actual ability run on the server

thin stratus
#

I'm wondering. In a competitive game, where there are teams (let's say 2), if a character could turn invisible to those not in the same area (e.g. a high grass field or brush), what's the sanest way of handling that?

Simple state replication and handling the visuals on each client allows for cheating.
IsNetRelevantFor would be better, but I read that the delay on this actually taking effect is pretty high.

#

Let alone the fact that I don't know if the project I might use it on is properly perpared and doesn't break on itself if NetRelevancy stops replicating the whole character -.-

thin stratus
# strong junco I don't want to replicate the particle system directly because apparently that w...

I did something like this for a "drawing" ability on a MOBA. At least I think it sounds somewhat similar.
I basically spawned the Actor twice, once replicated and once locally.
And made sure the additional actor that would come in from replication is hidden.
One can also probably fiddle around with NetRelevancy for that.
The Ability would modify the individual instance, with the Server one being used to replicate the changes to the SimProxies.

sweet sage
#

You can hide client side and stop sending updates

#

But don`t destroy

#

It will use the last known position, not that bad

chrome bay
#

Dormancy doesn't kill the actor, but also resends everything when the channel reopens so isn't ideal here I don't think

thin stratus
#

Also Dormancy is not per player or?

chrome bay
#

Dormancy itself like relevancy takes a while to kick in too, to avoid channel spamming

#

Ah yeah that too dormancy is global, not sure they ever did get per-connection dormancy working

thin stratus
#

So it would also break it for teammates and the local player

strong junco
thin stratus
#

This is more meant to hide from the other team unless they are in the same area

chrome bay
#

I suppose you could do a mix of both, send properties and use relevancy, so you get the 'immediatte' effect from properties until relevancy actually kills it off

thin stratus
#

So the NetRelevancy condition is something like if (IsOnSameTeam() || IsInSameArea()) return true;

chrome bay
#

The only issue would be if relevancy stops the properties being sent, so you might actually have a case for a reliable netmulticast ๐Ÿ˜„

thin stratus
#

Right, but I'm more worried about the other way round

#

If an enemy walks into the area, they need to see the previously not-relevant Character again

#

Preferably as quick as possible

#

And NetRelevancy has this strange delay

sweet sage
#

What is the problem with NetRelevancy? popping?

chrome bay
#

yeah, well I guess it has to reopen the channel and that could take a while to spawn the actor etc.

thin stratus
#

Given a freshly spawned actor spawns quicker

#

I don't think that's all

#

I feel like it's more a "Let's ensure the Actor is not relevant for at least x seconds before we really kill it off"

chrome bay
#

Oh yeah that's definitely a thing

#

I think it's like 2-5 seconds

thin stratus
#

Yeah and that's the thing I need to have instant

#

I wonder if that's a cvar

#

Well "instant" you know

chrome bay
#

It might be yeah. IIRC it's to avoid spamming close/open channels when you're sort of hovering on the relevancy distance

#

Otherwise you could get a huge spike of packets due to imprecision or micro movements etc.

sweet sage
chrome bay
#

Nah this is a lower-level thing

burnt coral
sweet sage
chrome bay
#

@thin stratus

RelevantTimeout=5.0```
thin stratus
#

Laughable that this exists

#

Somewhat happy though if that solves stuff

#

But worried there isa good reason not to put that to 0.0 or close to it

chrome bay
#

Yeah there is, it's to stop spam when hovering on the cull distance

thin stratus
#

We have no cull distance in this game

chrome bay
#

Ah well, you're fine then ๐Ÿ˜„

thin stratus
#

It's a MOBA with a somewhat small map

#

The idea is to hide peeps that walk into the brushes

#

Typical MOBA stuff

chrome bay
#

yeah

#

wonder how paragon did it

thin stratus
#

But I'm not so insane to just OnRep that and wait for cheaters xD

chrome bay
#

...did they do it?

thin stratus
#

You wouldn't know. You aren't a dirty cheater.

#

You are the one that rages at why that <insert champ name I forgot> knew you were trying to gank the lane while sitting in that brush for 2 minutes.

thin stratus
#

I know that, but that's sadly not applying here

#

Valorant is FirstPerson, and the problems they faced are entirely different ones

#

Still a good read

chrome bay
#

It's a good solution but also one that only works when you can dedicate a very knowledgeable person to one very specific task, and have a highly controlled game environment

#

Gotta love the comments on that article though "lel this is old tech what"

#

Idiots everywhere

sweet sage
#

Or is it like lol bush

sweet sage
# thin stratus I know that, but that's sadly not applying here
    /** Gives the actor a chance to pause replication to a player represented by the passed in actor - only called on server */
    UE_DEPRECATED(5.3, "Replication pausing is deprecated.")
    ENGINE_API virtual bool IsReplicationPausedForConnection(const FNetViewer& ConnectionOwnerNetViewer);

I have found that but is deprecated

thin stratus
sweet sage
#

Have u seen that?

#
bool AShooterCharacter::IsReplicationPausedForConnection(const FNetViewer& ConnectionOwnerNetViewer)
{
thin stratus
#

Don't think the project is on 5.3 yet, but using something deprecated isn't gonna be it

sweet sage
#

I`m using 5.3.2

#

I`m not sure why it is deprecated. Looks useful

sweet sage
# thin stratus Don't think the project is on 5.3 yet, but using something deprecated isn't gonn...
void UVisibilityBasedReplicationNode::GatherActorListsForConnection(const FConnectionGatherActorListParameters& Params)
{
    Super::GatherActorListsForConnection(Params);

    // Get the current connection
    UNetConnection* Connection = GetConnectionManager().GetActiveConnection();

    // Iterate through actors in the PotentialActors list
    for (AActor* Actor : PotentialActors)
    {
        ACharacter* Character = Cast<ACharacter>(Actor);
        if (Character && !Character->IsVisible())
        {
            // Exclude invisible characters from replication
            ExcludedActors.Add(Actor);
        }
        else
        {
            // Include visible characters for replication
            ReplicationActorLists[Connection].Add(Actor);
        }
    }
}

If you use replication graph you can create a custom replication graph node and override GatherActorListsForConnection.
But you need to trigger it on visibility change

thin stratus
#

I will certainly not use replication graph haha

chrome bay
#

tbh there's little point now anyway, iris is gonna replace it

hollow swallow
#

In an RTS game, where should i be spawning stuff server side, like where to put the events

sweet sage
#

Is fortnite not production?

chrome bay
#

Fortnite is the test bed

#

Once Epic is happy with how it works in Fortnite it'll be moved out of experimental, of that I have no doubt

sweet sage
#

I see

#

I will replace now replication graph with iris then

#

Lost time with replication graph

chrome bay
#

Iris isn't really 'ready' in 5.3 tbh, still some issues

#

But the filters stuff is basically rep graph IIRC. Doing a deep dive on it soon

hollow swallow
#

Am i doing something wrong here? Client spawns a "building" client side so they can see placement, then when they click it calls place building, then im trying to make it spawn server side and destroy the client side visual one

thin stratus
hollow swallow
#

The client spawns the actor originally though, does that not count as client owned?

thin stratus
#

Your RPC would need to be in something the Client owns and is replicated

#

No

hollow swallow
#

or should i get the building actor to call to the player controller

#

rogey

thin stratus
#

Ownership is a network thing

#

The Actor isn't even replicated

#

tbh, the Building shouldn't really do anything unless for whatever reason that's how it works for you

#

You should ahve some Building Manager that does all of that

hollow swallow
#

Yeah it wont really do anything

rocky kestrel
#

How much in meters is NCD?

solar stirrup
rocky kestrel
#

Ty!

fathom aspen
chrome bay
#

They do but I'm pretty sure any pending reliables have to be acked before the channel is closed

fathom aspen
#

Ah, so in a situation where it was relevant and becomes unrelevant before it had a chance to repliacte... i see ๐Ÿ˜„

#

So that doesn't apply to replicated properties you say... mhm

chrome bay
#

yeah, properties are unreliable so probably no garauntee you get them before channel closes

#

That's what I'd expect anyway

hollow swallow
#

can server edit a blackboard value?

#

i have a few npcs that i can select and move, theres 1 thats in my level and i can move that one fine. But when i get the server to spawn in a new unit and i select it, i cant move it for some reason

#

"accessed none trying to read property CallFunc_GetBlackboard_ReturnValue_1"

cobalt pollen
#

Playerstate updates less frequently, I've never used wait for attribute change before so can't help much there, but maybe use repnotify attributes and respond to that instead of working the other direction?

final holly
#

guyz how can i send RPC with widget

#

i know widget's are not replicated

#

but how can i solve this problem

#

what is the best approach

cobalt pollen
#

Send it with the playercontroller? ๐Ÿ™‚

final holly
#

thanks for reply bro

#

yea i am able to send with player controller

#

but problem is

#

i have to write all neccesary functions in player controller

#

SOLID principles are dead in multiplayer ?

#

i wan to know this

#

So i mean for exaple there is door and door have widget

#

i wan to call open door function

#

do i have write opendoor rpc in character

#

and trigger with the widget

#

i can able to with Interact interface

#

this works and flex

#

but interact interface only one have code block i cant every control with the interface funciton

cobalt pollen
#

Logically is the door asking to open itself?

final holly
#

nope

#

a button on the widget

#

the button trigger in the opendoort function

cobalt pollen
#

The player is using the button though so I don't think it's unreasonable to involve the PC in the logic/interface

#

But ultimately it's the way the engine is written and it's easiest to work the way it's intended

final holly
#

So, is it possible if I send an rpc via Pawn and the player obtains this pawn control?

#

thank for your effort Kelso you are good man

cobalt pollen
gloomy tiger
unkempt tiger
# gloomy tiger So, we are continuing our quest from yesterday, but today with a new approach: ...

I know this may not be of help at all but since youre stuck I might as well, these are my in my DefaultEngine.ini and I've never had this ping issue

[/Script/OnlineSubsystemUtils.IpNetDriver]
MaxNetTickRate=60
NetServerMaxTickRate=60
LanServerMaxTickRate=60
NetClientTicksPerSecond=60
MaxClientRate=120000
MaxInternetClientRate=120000```
sorry for the borderline pseudohelp, I don't have any other leads other than vague engine config settings
lucid badger
#

I'm trying to do "As Client" (i.e. 1 player on a dedicated server) and getting a crash that leads to this:

OnViewportResized(GEngine->GameViewport->Viewport, 0);

I'm guessing tha'ts because there's no viewport on the dedicated. Duh. So the correct function to wrap this in is

IsRunningDedicatedServer()

Correct? Hmmge

#

Well that worked anyways heh

dark edge
#

Test the round trip time with rpcs

lucid badger
#

So PIE with listen server + 1 client (separate instance) is very laggy, even though CPU is not going above 35% and GPU 40% and it's literally same computer so why is there so much lag? Hmmge

#

This is a barebones project with absolutely nothing going on yet

#

But like just a sphere with replicates movement is jittery as hell

#

I think it's throttling the other when either is in focus

#

This is off

#

But FPS still goes way down as soon as window loses focus

#

And client lags when server is out of focus

#

Engine is optimizing for in/out of focus I think. I bet there's a console command or something...

#

Okay, yeah, confirmed.

#

When I put both in standalone it's much more obvious

#

Focus-based throttling is my number one most hated thing in computers man

#

I hate when software tries to be "smart" in a way I didn't ask for

#

Why don't you let me worry about what is in focus

dire cradle
#

Might be Windows changing its priority

lucid badger
#

Windows? Thinkge

#

I've never had windows throttle any other software based on focus

dire cradle
#

Or the engine is lying in some way lol

lucid badger
#

Well

#

This is standalone now

#

Editor prefs aren't relevant, right?

#

There must be a console command or some ini setting

dire cradle
#

Oh that's not in the project settings, right

lucid badger
#

For the engine itself ?

#

Also

#

When one is on focus

#

CPU is only 60% and GPU is 10% (tiny windows)

#

So it's not like we're pushing resources

#

It's just throttling itself when out of focus

#

I don't see how windows oculd be responsible for that Hmmge

#

I guess this isn't really about multiplayer anymore though so I'll look for a more appropriate channel

torpid whale
#

Hello

My character is a mesh that only the player sees and has another mesh that only the rest of the players can see (the typical Owner not see), I would like that when an item attached to the character spawns, the rest of the characters only see the item that is attached to the mesh they see, and not the item that is attached to the mesh the player sees

It's quite difficult to explain hahaha

lucid badger
#

Reading this:

Client-side prediction with server authority is considered the gold standard, however it comes with downsides; it is vastly more complex to develop, takes considerably more time to develop, and has high processing costs so for larger games such as battle royales or high player-count shooters it can become incredibly prohibitive for a server to process the prediction of so many players.

My game is coop only, so there is no point in any attempts to mitigate cheating. Is it possible to just... not use server authority for movement? Since there would be no benefit for me Thinkge

fossil spoke
#

Though, if your game has low player count (which most Coops do) you probably wont benefit as much from the decrease in overhead as other types of games might

lucid badger
#

I'm not concerned with the overhead as much as the extra dev time

fossil spoke
#

If you are using the CMC, then it costs you nothing in dev time, as its already supported.

#

By default.

#

"Prediction" isnt a singular system you just enable or disable for your game.

lucid badger
#

Hmm yeah now that I think about it the stuff I would need to not be server-auth is the stuff GAS is doing Hmmge

fossil spoke
#

It is a concious choice by a programmer to introduce to a particular feature.

lucid badger
#

GAS is what's setting the movement speed conditionally

fossil spoke
#

Some features, like the CMC, already come with it developed.

dark edge
#

They're both authoritative, they're both right, so who's actually standing in the spot?

lucid badger
#

Why would two people being in the same spot be a problem? Thinkge

dark edge
#

I mean maybe it is, maybe it's not, IDK if you have collision between players. But there's all sorts of problems you can encounter similar to that. 2 people having different ideas on the game state.

lucid badger
#

Sure. In my game there's collision between players but they nudge each other, so they'd just shove each other mutually until colliders depenetrated Shrugeg

#

I get what you mean though

#

THe thing I'm having trouble understanding is how I execute a prediction hmm how do I run code on the client that it normally isn't allowed to run because lack of authority

#

I'm reading a lot of stuff and just seeing people talk about performing predictions but not how

dark edge
lucid badger
#

I have sprinting implemented via GAS movespeed attribute and an ability that applies a modifier to increase it. Also stamina consumption and so on

#

So prediction needed around when stamina depletes and so on

#

But I'm stuck on Square 1 because I can't even figure out how to "edit the client-side stamina value"

#

I just keep reading more and more posts and guides and not a single one has illustrated what it actually looks like to predict something

#

They just say when/why you want to do it heh

#

I'm like a PHD on the theory at this point

fossil spoke
#

A prediction is simply executing an action immediately that you are assuming is going to be accepted by the Server as correct. The Server will execute the same action and send down a result, if the result differed the Client will correct itself to what the Server decided was correct (thus meaning the prediction failed).

#

If there was no difference then the Client carries on and does no corrective action.

lucid badger
#

Yes that's the part I fully grasp

#

100% understood

dark edge
#

that's what GAS gives you

lucid badger
#

So how do I execute an action immediately that I assume will be accepted by the server

fossil spoke
#

Run it on the Client

dark edge
#

execute ability?

fossil spoke
#

Depends on what it is

lucid badger
#

So for example Stamina drain or recharge

#

GAS only replicates the final value of stamina when it replicates

#

So it goes up jittery/unsmooth

dark edge
#

That doesn't sound right

lucid badger
#

It is. It doesn't replicate periodic effects, just the outcomes (via replicating the actual attribute)

#

So when the attribute is updating say 10 times per second on the server

#

It's not gonna replicate 10 times per second on the client

#

So it's unsmooth

#

So I'd like to "simulate" it on the client

#

Predict it

#

But I cannot seem to find any way to modify the client's perceived value while waiting for the next replication

dark edge
#

itnerpolate / extrapolate

lucid badger
#

Oh the widget could lie... and OnRep_Stamina can just force the widget to the correct position every time Server updates Stamina... Thinkge

#

Wait but

#

Then widget shows 50 stamina, but you cannot use 50-stamina-cost-ability

#

Surely there is some way to force the client's stamina value to what I predict

#

Then client predicts it has 50 stamina, allows activation of ability, by time ability activation reaches server client does have 50 stamina so it works

#

If the widget is faking that won't work

dark edge
#

prediction is hard as fuck

#

I'd just interpolate towards realvalue at somespeed

#

it's conservative, it'll never lie to you really

hasty yoke
#

yo i need to connect to this game with a friend and i'm not sure what im supposed to fill in as a host/join because I have weak understanding of ip and ports can someone help me

#

does anyone have any idea

#

if i need to write in my public or private ip address, and how i setup my port forwarding rules? i opened a port but im not sure if i got the info right

lucid badger
#

Changing the widget doesn't allow me to fire an ability with gas that requires the correct amount of mana or stamina

fossil spoke
#

@hasty yoke Are you using Sessions? You should probably do some research on how connecting to other matches is usually managed in Unreal.

lucid badger
#

The stamina regen is per second, so knowing what to set it to is trivial, it's just math. The question is How to actually set it via the client's prediction logic

#

It predicts a value that the server is probably at--good! Now how do I set that value

hasty yoke
fossil spoke
#

@lucid badger Clients can still set a local value of a replicated variable.

#

When the Server sends a new value down, it will override the Clients

lucid badger
fossil spoke
lucid badger
#

I don't seem to have "client side prediction-only effects"

lucid badger
#

Yep I'm all over that

#

It's guilty of the same thing with regards to Prediction. All when/why but zero "how"

hollow swallow
#

Is that the correct way to spawn an actor? This is inside my building component on the player controller

lucid badger
#

kaos is helping me in the #gas channel now, apparently you have to use Wait Net Sync but I don't yet grasp why it worked Hmmge

hollow swallow
#

It works fine in stand alone, but not in client. Do i need to replicate the "Building To Place" variable?

#

pretty much at the moment, the client spawns a building locally just to see it and position, then when they place im calling those server functions to spawn the building server side and destroy the local actor

fossil spoke
#

That wont work.

#

You are passing through an Object (The locally spawned building) to the Server.

#

You admitted its local only.,

#

So how would the Server know what that object is

#

In order to use it to get the class to spawn etc

#

You would need to pass through the static information you need to the Server instead.

hollow swallow
#

ah right, so would i have to tell the server what the object is the same time i spawn it locally, in a replicated variable, then use that to spawn on server side?

fossil spoke
#

Pass through the Class and the Transform

#

Instead of the building object itself

hollow swallow
#

rogey got ya

#

i think... ill find out soon xD

fossil spoke
#

There is no need for a replicated variable

#

You just need to change the Params on your RPCs

hollow swallow
#

so just pass the class instead of the object

fossil spoke
#

And the Transform

hollow swallow
#

yep

fossil spoke
#

Since the class is an abstract, it has no idea what a Transform is

#

So you need to pass the Transform as well to be able to place it correctly on the Server

hollow swallow
#

also one other thing, i have a springarm for a topdown camera on my players that they can adjust the length of with scrolling to zoom in and out, yet if i got client i get this error

"Blueprint Runtime Error: "Accessed None". Node: Set TargetArmLength Graph: EventGraph Function: Execute Ubergraph RTS Controller Blueprint: RTS_Controller"

Do i really need that to be replicated to work if its only ment to affect the local client?

fossil spoke
#

Unless you have Server code that relies on the length of the SpringArm (which is doubtful) then no, you dont need the Server to know about it.

hollow swallow
#

Thats all i have and it is only for the client so not sure why i get the error and springarm doesnt work at all

#

nothing else references to the springarm

hollow swallow
#

Got the building spawning properly now though, thanks for that

cobalt pollen
# hollow swallow

Well is your BP player property set at this stage? Probably not hence the error

hollow swallow
#

Probably not, i thought being client side it should be fine

cobalt pollen
#

You can always just get controlled pawn

hollow swallow
#

Yep that worked, thankyou

#

Thatll help me fix a heap of other widget visibility stuff too i imagine xD

cobalt pollen
#

If you ask your game to read a property you should think about how that property gets set

hollow swallow
#

ahhh just that one thing fixed soooo much stuff xD

#

Thanks for the help guys

#

down to 0 errors now. Time to make some more spaghet to get them numbers back up ๐Ÿ˜…

hollow eagle
#

launch from the debugger in the first place

opaque dagger
#

-WaitForAttach on the command line

hollow eagle
#

-server YourMap

opaque dagger
#

-WaitForDebugger does the same, if it's easier to remember

hollow eagle
#

it doesn't do the same

#

oh, as waitforattach

#

you'd need both

#

IDE or with -WaitForAttach from the command line. Or neither if you're running single-process PIE

#

if you're not running a separate process for the server it's entirely unnecessary to do any of this

#

...no? it changes nothing about how you build

sweet sage
#

Is there any way to benchmark multiplayer games ? (dedicated server)

Can i start a lightweight client

upbeat basin
#

Is it impossible to send UObjects created on client side with server RPCs? I wanted to do a data payload kind of a UObject but even if I make the UObject replicated, server won't get the object that I'm sending, since it doesn't exist on server, right? Only solution comes to my mind is creating a struct and sending that. But that requires to put every parameter in that single struct and I would be happier to be able to create custom classes to separate and group related variables together and create object according to my need

solar stirrup
#

You'll want it to be a struct

#

However, you might want to take a look at FInstancedStruct

#

sounds like it might interest you

#

It's a wrapper for "any" USTRUCT

#

So you could make a struct that has your UObject class as a field and then an FInstancedStruct for "any" data that specific UObject needs

upbeat basin
#

Oh that sounds like it could be fitting to my needs. I'll check that, thanks

torpid whale
#

Is it possible to make: me (client 0) see something different from the rest of the clients?

latent heart
#

How different?

torpid whale
#

Yes, because I have a first person project, and being firstperson, the character is 2 meshes, one is the arms that the player sees and the rest is the complete mesh that the rest of the players see

#

But, by equipping a flashlight in both hands (the one with only the arms and the one seen by the rest of the players) I want only the correct one to be seen for each client

nova wasp
#

"only owner see" or just completely having it only exist for the local player I guess

torpid whale
#

Thanks

thin stratus
#

DefaultEngine?

oblique arrow
#

I want to spawn damage number actor only on my client

UFUNCTION(Client, Reliable)
void SpawnDamageNumbers(float InDamage, bool IsCrit, FVector EnemyLocation);
void SpawnDamageNumbers_Implementation(float InDamage, bool IsCrit, FVector EnemyLocation);
void ASentinelCharacter::SpawnDamageNumbers_Implementation(float InDamage, bool IsCrit, FVector EnemyLocation)
{
    AFloatingDamageActor* DmgActorReference = GetWorld()->SpawnActor<AFloatingDamageActor>(FloatingDamageActorClass, EnemyLocation, FRotator(0, 0, 0));
    DmgActorReference->InitializeTimeline();
    DmgActorReference->CalculateDamage(InDamage, IsCrit);
}

Where im calling this is in GameplayEffectCalculation

void UDamageGameplayEffectCalc::Execute_Implementation(const FGameplayEffectCustomExecutionParameters& ExecutionParams, FGameplayEffectCustomExecutionOutput& OutExecutionOutput) const
{
...
    ASentinelCharacter* Sentinel = Cast<ASentinelCharacter>(SourceASC->GetAvatarActor());

    AEnemyBaseClass* TargetEnemy = Cast<AEnemyBaseClass>(TargetASC->GetAvatarActor());

    if (DamageMulti > 0.0f)
    {
        InDamage *= DamageMulti;
    }

    if (CritMulti > 0.0f)
    {
        UE_LOG(LogTemp, Log, TEXT("Crit Calculation"));
        UE_LOG(LogTemp, Log, TEXT("Random Range %f"), FMath::RandRange(0.01f, 1.0f));
        UE_LOG(LogTemp, Log, TEXT("CritChance Range %f"), CritChance);
        bool IsCrit = FMath::RandRange(0.01f, 1.0f) <= CritChance;
        if (IsCrit)
        {
            InDamage *= CritMulti;
            UE_LOG(LogTemp, Log, TEXT("Crit evaluated"), InDamage);
        }

        Sentinel->SpawnDamageNumbers(InDamage, true, TargetActor->GetActorLocation());
    }
    
    OutExecutionOutput.AddOutputModifier(FGameplayModifierEvaluatedData(DamageStatistics().InDamageProperty, EGameplayModOp::Additive, InDamage));
    UE_LOG(LogTemp, Log, TEXT("Damage - %f"), InDamage);
}

the problem i have is this actor still spawns on server and not on client

thin stratus
#

Is ASentinelCharacter Client Owned?

oblique arrow
#

Yes

thin stratus
#

The only reason this would happen is if it was in fact not

#

That's an actually possessed Character?

oblique arrow
#

Yes

#

I will make a screen how it looks in game

thin stratus
#

On another note, you might want to do this in your AttributeSet Post GE bla.
Sometimes Damage is still changed by the Attribute before actually applying

#

E.g. by a Shield

oblique arrow
oblique arrow
#

i can of course

#

but i need to make something that will tell me that is a Critical hit

thin stratus
#

Hm I think there was something you can do via Tags for that reason

#

Kaos might have an idea

#

But either way, the RPC would be the same

#

Not entirely sure why it's spawning on the Server atm

oblique arrow
#

My theory is Execute_Implementation is server only

#

and that is causing this

#

but still

#

function is called on server

thin stratus
#

Well yeah that is indeed only server side

oblique arrow
#

and executed on client

thin stratus
#

But you need the Server to call the RPC anyway

thin stratus
torpid whale
thin stratus
#

Then access it after spawning?

torpid whale
#

How?

thin stratus
#

OwnerOnlySee is a Component Variable

#

You need to get the Component that you want to make only owner see

torpid whale
#

It is not a component, it is an actor

thin stratus
#

I know, but that boolean is not an Actor variable

#

It's set per SceneComponent

torpid whale
#

The idea I had was to access the spawned static mesh and mark that boolean as true, but I can't access the static mesh

nova wasp
#

Actors that are visible do so with component primitives

#

Or just set the value in the asset I guess

torpid whale
#

The problem is that the same flashlight that I spawn for my character, I also have to do it for the rest, I don't know if I'm explaining myself correctly

nova wasp
#

The static mesh is possible to retrieve at runtime by finding the component?

#

Or exposing a function that does this in the flashlight, or setting things in the flashlight based on local net role etc

#

Is locally controlled etc

torpid whale
#

That worked, just that node I needed

#

thank you so much

nova wasp
#

Keep in mind that you might have to change what this means later

#

If people want to move the flashlight between players etc

torpid whale
#

I don't know any other way to change it, because I can't expose a variable from the actor because I'm spawning the actor through a variable of type actor class reference that I get when I pick the item

#

I realized that, with the character that I control, for some reason I also see the flashlight in the mesh that shouldn't be there

nova wasp
#

That mesh can be hidden for the local client

#

Multiplayer code is just a lot of "actually, the client does this"

#

Or sim proxy (other clients on a client) etc

torpid whale
#

I understand, thank you

sharp vigil
#

Any idea how to send data to a gamestate from a client?

unkempt tiger
#

through the player state

shut wave
#

Anyone Ever seen this? I'm using the EOS subsystem on UE5.0.3 and trying to get the player names. It only returns some 3 digit numbers (e.g 325 and the next player name is 326)

thin stratus
#

Sounds like the PlayerId which is a UE thing

shut wave
#

The blueprint looks like this

thin stratus
#

Replicated PlayerController array

#

Lovely

shut wave
#

I tried it with the straight set player array, not the replicated one

#

Whatever I tried it doesnt return anything else than the numbers

thin stratus
#

Yeah then the Subsystem seems to apply the name strangely

shut wave
#

Have u ever seen this tho?

#

or any idea on how I could force to get the name? Possibly with custom c++ even?

thin stratus
#

I don't use EOS

#

The ID itself sounds very much like the PlayerId

#

That youcan get from the PlayerState

shut wave
#

yea, thanks anyways! Why not replicate the array btw?

#

It's for a replicated player list

thin stratus
#

Because the PlayerController doesn't exist on anyone but the local Client and the Server

#

A client doesn't have access to other player's playercontrollers

#

That's why the PlayerArray is having PlayerSTATES

shut wave
#

The script is run by the gamestate*

thin stratus
#

Which are replicated to everyone

#

Doesn't matter

#

PlayerControllers don't exist anywhere but owning Client and Server

shut wave
#

Okay interesting, appreciate it!

sharp vigil
shut wave
thin stratus
#

With NULL, yeah

shut wave
#

yep, so its less of an eos problem I would assume

thin stratus
#

Every Subsystem can provide a name for the PlayerName stuff

shut wave
#

yea so its more of a problem of the get player name node isnt it?

thin stratus
#

Yes and no

#

The name it returns is provided by the Subsystem

#

E.g. Steam would set it to the Steam Name

#

idk why you get a number for EOS

shut wave
#

Is there anywhere where I could see whats going on?

#

Access the get player name node somehow?

thin stratus
#

In C++ you could follow back on the name

#
FString APlayerState::GetPlayerName() const
{
    return bUseCustomPlayerNames ? GetPlayerNameCustom() : PlayerNamePrivate;
}
#

bUseCustomPlayerNames is probably false, at least I assume so

shut wave
#

alright, how would I access the C++?

#

On some nodes I can double click the output and it opens visual studio

#

Doesnt happen here

thin stratus
#

PlayerState.h and search for it

shut wave
#

Opening which file would I open? ๐Ÿ˜… Havent worked much in c++ with the engine yet sry

#

nvm. I found it

thin stratus
#
    // Init player's name
    FString InName = UGameplayStatics::ParseOption(Options, TEXT("Name")).Left(20);
    if (InName.IsEmpty())
    {
        InName = FString::Printf(TEXT("%s%i"), *DefaultPlayerName.ToString(), NewPlayerController->PlayerState->GetPlayerId());
    }

    ChangeName(NewPlayerController, InName, false);

shut wave
#

is that the fix, or what I'm lookin for?

#

wait lol

#

thats it

#

it has no return function in it

#

should I just add: {
return bUseCustomPlayerNames ? GetPlayerNameCustom() : PlayerNamePrivate;
} to the end?

thin stratus
#

no

#

If you have no idea what C++ does then you shouldn't touch it :D

shut wave
#

fair enough lol

shut wave
thin stratus
#

What I posted is what UE does:

FString AGameModeBase::InitNewPlayer(APlayerController* NewPlayerController, const FUniqueNetIdRepl& UniqueId, const FString& Options, const FString& Portal)
{
shut wave
thin stratus
#

It seems like if no Name is passed by the connection spring

#

Then it will take the DefualtPlayerName of the GameMode

#

And add the PlayerId

#

The PlayerId is what I meant looks familiar to this

shut wave
#

ahhh thats why

thin stratus
#

So I assume your DefaultPlayerName is for one empty

#

And there is no ?Name being passedb y the connection string

#

Why there is none passed, that's a different story

shut wave
#

so the problem lies in the game state array of the player states?

thin stratus
#

No

#

The Problem is the connecting player not passing over a name I would think

#

When joining, a player does this:

            // Send the player nickname at login
            FString PlayerName = GetNickname();
            if (PlayerName.Len() > 0)
            {
                URL.AddOption(*FString::Printf(TEXT("Name=%s"), *PlayerName));
            }
#

With GetNickName being

#
FString ULocalPlayer::GetNickname() const
{
    UWorld* World = GetWorld();
    if (World != NULL)
    {
        // Try to get platform identity first
        FString PlatformNickname;
        if (UOnlineEngineInterface::Get()->GetPlayerPlatformNickname(World, PlatformUserId, PlatformNickname))
        {
            return PlatformNickname;
        }

        FUniqueNetIdRepl UniqueId = GetPreferredUniqueNetId();
        if (UniqueId.IsValid())
        {
            return UOnlineEngineInterface::Get()->GetPlayerNickname(World, UniqueId);
        }
    }

    return TEXT("");
}
shut wave
#

imma check

thin stratus
#

There you can see the Online stuff coming into play

shut wave
#

yep

thin stratus
#

World is probably valid

#

Bit strange that both functions would fail

#

Maybe your EOS setup isn't correct

#

but that would cause it to send an empty name

#

You can see that in the Logs too

#

There should be a BROWSE entry in the logs

#

with some ID and also the ?name stuff

shut wave
#

lemme check

tardy fossil
#

hey, so I made a custom ASpectatorPawn class and set it to my default spectator pawn, and that ASpectatorPawn class has a CameraComponent as a root component. When the servers makes a player go into spectator mode with ClientGotoState(NAME_Spectating), it doesn't seem to use the camera component.. it seems to be some generic camera.. and this ONLY happens in dedicated servers.. in a listen server it isn't an issue.. which doesn't make a whole lotta sense cause spectators are purely client side arent they?

midnight torrent
#

Hi! Can someone explain to me UObject replication logic(especially in TArray)? I read different documentation about replication, but something I didn't get. Do I need to create instances for server AND client, so they replicate with each other, or just on server only?
Because I already have replicated TArray of UObjects, but it's created in BeginPlay, so they called both on server and client, and they works perfectly. But when I try to create new object realtime on server - client OnRep get information about TArray changes, but all new elements are nullpointers

shut wave
#

I searched everything and I can't find anything that ever calls for the players name

thin stratus
#

When joining you should have something in client and or server loh

#

Log

shut wave
#

yep

#

PIE: Server logged in

#

PIE: Play in editor total start time 0,168 seconds.
LogViewport: Scene viewport resized to 1550x861, mode Windowed.
LogEOSSDK: LogEOS: Updating Platform SDK Config, Time: 0.057717
LogPlayerController: Error: InputMode:UIOnly - Attempting to focus Non-Focusable widget SObjectWidget [Widget.cpp(802)]!
LogViewport: Display: Viewport MouseLockMode Changed, LockOnCapture -> DoNotLock
LogViewport: Display: Viewport MouseCaptureMode Changed, CapturePermanently_IncludingInitialMouseDown -> NoCapture
LogBlueprintUserMessages: [BP_GameState_C_0] 346
LogBlueprintUserMessages: [GM_Lobby_C_0] Player Connected

#

--> the last 2 lines are called by my string trying to read the players name

#

earlier there is this note: Start Session (User: ...)

sharp vigil
#

Does this sound dumb?
I have a game with multiple clients. 2 clients are on the same team. They have a building that npcs bring resources to which both clients share.
If client ones npc delivers to the building first then I would ignore client 2โ€™s npc contribution? Does that seem like a reliable way to sync things across the network? Fastest client would keep everyone in sync in this case. No one is clicking these npcs. Just assign them a job and they do it

prisma snow
# sharp vigil Does this sound dumb? I have a game with multiple clients. 2 clients are on the...

Well, the clients should't probably be the ones running that logic, you'd rather have that happen in the server and replicate the resources to the clients.

The second part of the issue is the order in which the resources are collected - I don't see many issues there - you can implement a queue so that there is some kind of order and timing on delivering the resources (for example, vespene gas mining in starcraft), or you can just let them deliver the resources instantly, there is no problem at all with that.

sharp vigil
#

i guess on that part Im confused. How would I have the delivery event be client agnostic* Right now I have my teams and their values on the gamestate (which I know is on the server and repped to clients). Ive done a bit of reading but I feel like Im missing something

prisma snow
#

It's the first pinned message on this channel

sharp vigil
#

yes I use it often

prisma snow
#

Well, actors are replicated - basically the server will be running their logic by default (specially for characters etc). Your server usually is the system running the most logic and replicating values to clients, that's the default setup for Unreal (and many games/engines)

#

You can check for authority/net mode to conditionally execute logic

sharp vigil
#

ahhh right so I check if the npc has authority then that means its running on the server.. trigger delivery event boom

#

i got you. I think I was just thinking myself into a hole lol

sharp vigil
#

one server to rule them allโ€ฆ ๐Ÿ˜„

quartz iris
#

How would I go about making a similar system to Galactic Conquest in the original Battlefront 2?
https://www.youtube.com/watch?v=txCE7kIGQK0
Where you can select your fleet/character and move to the nearest planet

#starwars #battlefront2 #elitedifficulty

  • This game is quite difficult on Elite difficulty. I've been playing this game for 17 years and I even struggle sometimes so I wanted to make a series detailing how to beat each mission on the hardest difficulty in the game!
  • If you like this style of videos, make sure to...
  • LIKE - COMMENT - SUBSCRIBE...
โ–ถ Play video
quasi tide
#

Simple idea - That is a map in of itself. Each point has a reference to the map it will go to. Then to move the ship (IE - the player), you just do something like AStar for simplicity.

quartz iris
#

How can I limit where the player will be able to go to?

quasi tide
#

Could probably even cut out the AStar part and have an even more simple approach in that things are referenced to each other and then you just do a simple move to the points

quasi tide
quartz iris
quasi tide
#

I'd definitely recommend studying up on it. Pretty foundational algorithm for pathing. Even if you don't end up going with it here.

#

It's used quite heavily in many areas

quartz iris
#

I just need a basic system where you can only travel 1 location ahead and not just go anywhere on the map

quasi tide
#

Then do the 2nd one I mentioned. Where you hand set things up.

#

I gave you the simple high level ideas. Now you need to break them down and implement them the way you'd like.

quartz iris
#

I'm not sure how to make the movement system though

#

Like how to limit the locations you can jump to

prisma snow
#

Hi! I have a question about debugging multiplayer. There seems to be a bug in Niagara, in which running more than one game under the same process will cause some exceptions. Running server and client(s) under different processes fixes the issues. However, this also makes debugging less straightforward, since the client is launched in it's separate process, detached from IDE debugger. I assume I should be attaching the debugger manually to the client and debug in that way, right?

cobalt pollen
#

If I change bAlwaysRelevant for an actor on the server at runtime (on an actor that spawns as only relevant to owner) is that possible and/or do I need to make an additional step to replicate the actor onto the other clients? I've tested setting it on the server and the value changes but the actor doesn't show on the other client/s

#

I probably just need to have the client-only actors stay that way and use an RPC to spawn new relevant actors and delete the client-side actors, it's not an event that will happen frequently so not a big deal

forest reef
#

I'm trying to spawn a projectile at a components location. it works on the listening server \ client and standalone... but not when I do play as clients. I tried messing with replication and making sure the components replicate but nothing seems to change. The projectile spawns somewhere below the ground. How can I get this projectile to spawn on the component and not someplace else? Debug sphere show the component location in both the wrong spot and the correct spot.

dire cradle
queen escarp
#

Hey this works fine, except when i play as client then i get access none :/?

forest reef
#

@dire cradle UFUNCTION(Server, Reliable)
void HandleFire();

void ABaseCharacter::HandleFire_Implementation()
{
    if (GetCharacterMovement()->IsFalling()) return;

    FActorSpawnParameters spawnParameters;
    spawnParameters.Instigator = GetInstigator();
    spawnParameters.Owner = this;

    UObject* GunBarrelTipObject = EquippedWeapon->GetDefaultSubobjectByName(TEXT("Gun Barrel Tip"));
    USceneComponent* GunBarrelTip = Cast<USceneComponent>(GunBarrelTipObject);
    GunBarrelTip->GetComponentLocation();

    UWorld* World = GetWorld();
    if (World && ProjectileBlueprint)
    {
        World->SpawnActor<AEnergyRifleProjectile>(ProjectileBlueprint, GunBarrelTip->GetComponentLocation(), GetActorRotation(), spawnParameters);
    }
}

I have tried a lot of things but I tried this. The component replication is set manually in the blueprint.

queen escarp
#

@dire cradle hey this is related to the stuff u helped me with yesterday any ideas ๐Ÿ™‚ ?

dire cradle
queen escarp
#

oh right

dire cradle
#

It's a bit hard to explain the solution through text

queen escarp
#

hm

#

@dire cradle got an example or something or should i google +

dire cradle
#

I'll provide an example

sweet sage
#

Can i ClientTravel without a loading screen?

queen escarp
#

nice ty

dire cradle
#

^ Game Mode

#

v Player Controller

#

It's probably a good idea to return the controller itself in addition to the character with the delegate as well, didn't do that here

#

So handling multiple clients at the same time wouldn't be an issue

sweet sage
#

Do ClientTravel maintain state? how?

queen escarp
#

@dire cradle ion the player controller the last node "event dispatchers" it need logic inside it also ?

dire cradle
#

No, just the commented section

queen escarp
#

@dire cradle oh okey,
im unable to find the bind event :/

dire cradle
#

Have you created the delegate?

dire cradle
queen escarp
#

yeah in player controller

dire cradle
#

compiled?

queen escarp
#

oh wait* mybad

#

yeah missed that one

sweet sage
#

Guys how do i ClientTravel to another ip/port but don`t show a loading screen / use same world position?

queen escarp
#

@dire cradleok yeah that worked so it creates the widget but dosent asign the widget afterwards

#

hm

dire cradle
#

Assign the widget? Do you mean it doesn't add to viewport?

queen escarp
#

nah the choose widget spawns correctly for all palyers when i select unit it spawns but the "player hud ui" dont sapawn

dire cradle
#

Have you called the "Start" event you created yesterday in the character?

#

From the GameMode after you spawned the player

#

or in controller i dont remember

queen escarp
dire cradle
#

Looks like it's fine

#

Do pass the controller in the onSelectedCharacter event though like I mentioned

#

it will be less error prone

#

No idea why the hud doesnt spawn, it might get fixed if you do this though ^

queen escarp
#

hm okey,

#

sec

#

where do you mean :/?

dire cradle
#

just add a player controller reference

#

and pass "self" when calling it

#

Then use that in the gamemode instead of pulling from the handle new player starting event

#

dont forget to compile

queen escarp
#

like so ?

dire cradle
#

Yes

#

no

#

add to the delegate as well

dire cradle
queen escarp
#

done

#

testing

#

oh the UI dident even spawn on standalone,

#

yeah the client gets the UI created and created the character but unable to move & UI so maybe the controller gets assigned wrong ?

#

@dire cradle

#

so if i change this to player character 0 it worked for the standalone (locally)

#

so the problem must lie here

dire cradle
queen escarp
#

yeah i know, it was just test where the issue were

neat prism
#

I have an issue where my game isn't properly replicating the location of my "muzzle" on my weapon actor.

Standalone: the muzzle is properly located and its direction is properly drawn (blue sphere, purple line)

Client: the muzzle is not properly located.

This is frustrating because the muzzle is clearly properly attached to my scene root and moves/rotates with the character.. However there is a vertical offset where the muzzle is just sitting below the barrel. I'm not sure why it does this.

#

Beyond this issue, when I have a subsequent "look at" command exectue in the animation blueprint, the client+server visually properly update the static mesh and point the gun itself at my crosshair... but the muzzle itself and the debug drawers do not follow

dire cradle
#

does it work now? @queen escarp

queen escarp
#

the start was an "object" i tried passing the player controller so i changed to that

dire cradle
#

Revert the stuff you did in the character and make the "Start" event Run On Owning Client, reliable

#

@neat prism Can't have an idea without knowing how the muzzle is attached / spawned / its location drawn etc

neat prism
queen escarp
#

wdym revert the stuff i did in the character :/?

dire cradle
#

The cast

#

it will always fail

#

You plugged a player controller reference to a character class cast

queen escarp
#

ah aye

neat prism
#

Muzzle component itself derive from its own c++ class (perhaps unnecessarily?)

queen escarp
#

@dire cradle ok if iwanna make it reliabe it hjas to be run on server /owning ?

#

oh owning ofc

dire cradle
#

reliable basically means it wont be ignored, skipped if the server is under heavy load

queen escarp
#

yeah i know that*

#

ok so now it worked for listen/locall

#

but client still unable to cotnroll/ui

neat prism
#

Should have also said: the muzzle compnent is attached to a socket that exists on the selected skeletal mesh

dire cradle
neat prism
#

so it is strange that the static mesh visually replicates to all players and the server but the muzzle itself isn't properly following

dire cradle
#

is the start event run on owning client now?

neat prism
#

Then the drawing of the muzzle location is simply in the character blueprint behind an IsServer HasAuthority check

queen escarp
#

@dire cradlehm no

dire cradle
#

do it

queen escarp
#

the start evene itself is runn on owning client

#

but its being called in the bind event

#

how do i change that on those events ?

dire cradle
#

you cant, i guess you have to do a workaround

#

it's ugly, but usually it solves the problem

queen escarp
#

hm

#

now its not possessing the unit , its spawning but not possessing

dire cradle
#

possessing has nothing to do with this change though

#

this comes after possession

queen escarp
#

oh it broke the link

#

secv

neat prism
dire cradle
#

try putting a static mesh instead of the muzzle and check if it's position reads correctly

queen escarp
#

ok so now its running opn owning it spawns and possessess, but still cant move / ui

dire cradle
#

if it does, it's a problem with the muzzle component's C++ side

queen escarp
#

on client standalone works*

dire cradle
#

the hud doesnt spawn?

queen escarp
#

well i changed the "start event" to also run on owning then it spawned but still cant move

neat prism
sinful tree
queen escarp
#

@sinful tree yeah nmoticed that also

dire cradle
#

Can't move yes, but does the player hud spawn? @queen escarp

#

it will tell us if the start event is even running correctly

dire cradle
queen escarp
#

it creates the ui now

#

but its not hooked up

#

ill show u

dire cradle
#

then do what Datura said and you'll be able to move

#

not hooked up?

queen escarp
#

i did and the input works*

#

this is standalone

#

this is client

dire cradle
#

The errors tell you where to look at

#

why do you need a reference to the parent class of the character?

queen escarp
#

all 4 different player unit chooices derives from the parent class

dire cradle
#

Still doesn't require a reference?

#

The child classes already have access to any variable or event in the parent class

queen escarp
#

hm

#

well the player hud is a child of "parent widget class" wich is this one

#

it basicly just hold referenses

#

but those fail on client side

dire cradle
#

i see

queen escarp
#

since widgets are always locall not created on server using the "get player character 0" would work right ?

dire cradle
#

yeah it should

sinful tree
#

If the player doesn't have the character to begin with, then the cast would fail, which means none of the other variables would be getting set either.

dire cradle
#

the widget gets created in the character itself

#

after possession

#

wait, not necessarily

#

nope yeah it shouldnt be a problem

queen escarp
#

since the parent wb is created before i select characrt

#

maybe thats why

#

maybe i should create the "parent widget" after i create character

dire cradle
queen escarp
#

no the parent one is never created

#

so it creates when game begin

dire cradle
#

im confused

queen escarp
#

the parent wd is never created

#

im onyl creating the child ones

dire cradle
#

are the widgets being created before the character gets spawned and possessed?

#

I thought you were creating them in the start event, which is done after the possession

queen escarp
#

oh right yeah im creating the player hud widget in the start event

#

and when the player hud is created then the parent one is also created right ?

dire cradle
#

parent one?

#

Im just lost

queen escarp
#

ok so this is where im creating the "player_Hud" wb

#

and the player_hud widget is a child of "Parent_Wb"

dire cradle
queen escarp
#

yeah right

#

since its creating in owning player player the owner should be fine right

dire cradle
#

yeah it's local

#

There must be something else in there you're referencing that's causing a problem

queen escarp
#

well in my "player_Hud"

dire cradle
#

check if the casts are failing in the widget

queen escarp
#

im referencing stuff from the "parent_Widget" inside the "player_Hud"

#

those are the stuff im getting errors from

#

this is the parent Wb

dire cradle
#

check if those casts fail

queen escarp
#

ohh you know what

dire cradle
#

in the beginning of the start event, could you put a short delay like 0.2 seconds?

#

and see if that changes anything at all

queen escarp
#

hm yeah

#

then the game mode failed

#

but game mode cant be accessd from clients should be "authority only right ?"

dire cradle
#

game mode only exists on the server so that's normal

#

you cant cast to it in the client

#

it's a timing issue, in the widget do this, hold on

#

This will make sure to wait until the controller finishes possessing the character

#

remove the game mode cast, and it will work

dire cradle
queen escarp
#

hm yeah so did "if server" removed the game mode fail ofc

dire cradle
#

use has authority switch

queen escarp
#

and tried tdelay on character but its still giving error

#

there is no node liek that in a widget right

dire cradle
#

that means you're trying to access the variable before it could be set

#

validate them before using them

meager spade
#

you should neve ruse Get Player Character or Get Player Controller by index in multiplayer games

dire cradle
meager spade
#

never use*