#multiplayer

1 messages ยท Page 171 of 1

storm grove
#

Comment says it needs to be called before finishing spawning it, does that mean I need to defer spawn it?

chrome bay
#

Most likely yeah, before any network data gets created for it

storm grove
#

yay new problem I think, spawn deferred doesnt take spawn params

#

stopping me setting its name

#

Would it be hacky to just do what it does and set its name though

#

its basically just spawn actor but creates the params for you

#
    {
        if( Owner )
        {
            check(this==Owner->GetWorld());
        }
        FActorSpawnParameters SpawnInfo;
        SpawnInfo.SpawnCollisionHandlingOverride = CollisionHandlingOverride;
        SpawnInfo.TransformScaleMethod = TransformScaleMethod;
        SpawnInfo.Owner = Owner;
        SpawnInfo.Instigator = Instigator;
        SpawnInfo.bDeferConstruction = true;
        return (Class != nullptr) ? Cast<T>(SpawnActor(Class, &Transform, SpawnInfo)) : nullptr;
    }
#

Seems to have done the trick

visual mountain
#

I have a widget being created for the client, and the client clicks a button which is supposed to send information to it's pawn. However the information flow always seems to stop at the client trying to relate to the server. Does this have to do with using a widget on the client PC? should I use an in game widget or interface for this instead?

#

or am i misunderstanding the flow entirely?

hoary spear
#

widgets cant directly talk to server

visual mountain
#

that explains a lot

hoary spear
#

so any RPC must go through a client owner actor

#

typical flow is through player controller or player pawn

visual mountain
#

is it possible to have a widget produced for the actor instead of the PC to same effect?

hoary spear
#

Sounds like a untraditional attempt around the problem I'd say

visual mountain
#

oh i think i have it right, im just not RPC'ing

hoary spear
#

keep in mind you cant RPC in the widget

visual mountain
#

no it sends it to the pawn

hoary spear
#

then you're all set

visual mountain
#

ty so so much

quartz star
#

So i have a character that i want to rotate left/right based on the keys A or D.
But im not sure how to do that correctly, just modifying the rotation of the character doesnt seem to replicate to other clients.
Calling the function on server side and then replicating it down to other clients kinda feels wrong.
I'd highly appreciate it if someone could help me with this

kindred widget
quartz star
kindred widget
#

Then you'll need to handle the rotation replication manually. Cause normally control rotation handles that. That said you could drive your camera through your camera manager instead of control rotation too.

quartz star
kindred widget
#

Lyra has a camera mode system that makes it a bit more dynamic too. But it's largely using the BlueprintUpdateCamera function. That said you can also override the view target's AActor::CalcCamera. Many different ways to drive it.

quartz star
sturdy moat
#

Hey, I'm wondering whether or not it is common to replicate the bullet impact decals and effects from other players. It would obviously make sense from a gameplay perspective but thats a lot of objects to replicate. Does anyone know how this is usually handled in multiplayer games and if there are ways to make it cheaper on the server.

quasi tide
#

It happens locally

#

Don't replicate it

#

Client tells server it shot - server tells everyone else they shot. Logic is ran locally

vagrant grail
#

It's being called in GM_Core (the parent class of the gamemode GM_Werwolf) in the Event OnSwapPlayerControllers. And for the second thind I don't know what you're referring to because there's no property like that in my BPCharacter

kindred widget
quartz star
sturdy moat
# quasi tide Client tells server it shot - server tells everyone else they shot. Logic is ran...

Hmm wouldnt that introduce problems with cheating though if the shooting logic is handeled on the client? Currently Im using this tutorial https://www.youtube.com/watch?v=OhrijWnJdyE&list=PLzykqv-wgIQXompUswD5iHllUHxGY7w0q&index=13 as a framework and it runs the weapon logic on the server. For me the client says to shoot and then the server runs the logic, sharing the result (Hit Result) with all clients. Then it calls a WeaponEffects function which is ran by each client using the hit result. The picture below shows the setup, with green being run on client, blue on server and yellow multicasts. I'm planning to replace all the multicasts with repNotify.

Check out my Patreon: https://www.patreon.com/user?u=60713904 Join the {GDR}; Discord server and download my free project files: https://discord.gg/dUm3ZtYDuV
Buy me a coffee: https://ko-fi.com/bluntstuffy
Follow me on Twitter: https://twitter.com/BluntZombie

This tutorial is mostly about how to setup a multiplayer framework in Unreal Engine 5,...

โ–ถ Play video
keen condor
#

hello i'm learning GAS with Tranek doc and i tried to simulate high ping and packet loss(on client side), my fireball sometimes doesn't launch on client side , i just wanted to know if this behaviour was normal and if so how can i do to fix this

sweet sage
#

What should i expect about Iris netcode? player count on a dedicated server using only default character movement without anything else adding overhead?
(No AI, no Actors, except static geometry)

quartz star
queen pecan
#

I have generic RPC events I use throughout my project. I want to minimize code duplication.
For example:

Server_Spawn_Actor
Multicast_Spawn_Particle
Multicast_Play_AnimMontage
Client_Play_Sound
Client_Shake_Gamepad
Client_Shake_Camera

Basically a collection of generic events.

I need these to be:

  1. Implemented in one spot
  2. Easily accessible anywhere
  3. Works with RPC Server/Client/Multicast

One solution (which I'm currently using) is I have a BP_Generic.
Then in GameInstance, I have a variable of BP_Generic. This way it is accessible anywhere.
It works but I feel this is messy and I'm looking for an alternative.
I know there exists Subsystems but I think that's also going to run into the same issue since Subsystems don't replicate?

gilded vapor
#

If the CMC is replaying SavedMoves from the client and the client has also called an RPC for playing a montage....

It seems the CMC will many times apply the movement of the animation before finish/playing the actual animation.

Are most games relying on games simply not having enough latency for the differences to be notable?

#

I've hooked montage replication into the CMC which seems to work for me~~ but I'm curious on what other people are doing

quartz star
# keen condor

you call the gameplay event through an animation notify is that right?

keen condor
quartz star
# keen condor Yes

I had the same issue once, i fixed it with changing the Montage Tick Type to Branching Point in the Attack Montage

keen condor
#

Let me try that

#

Can you tell me where ?

quartz star
#

click the notify, then u should see it in the details

gilded vapor
#

^^sick color theme

quartz star
keen condor
#

@quartz star it's working perfectly wtff , how did you find that ?

quartz star
kindred widget
#

Just gonna tuck that away in my vault of random knowledge I'll likely need some day and will forget by then. ๐Ÿ˜‚

quartz star
keen condor
#

i'm talking about he visual part

#

Because i wan't my fireball to stop moving when reaching a certain range so it doesn't disapear instantly and and it has a nice trail fading effect (so it has a bit of gameplay logic in the visual part)

quartz star
#

Well yes you could handle the collision event locally to modify your cosmetics of that fireball, but you'd still need the server to verify the collision.
If the server doesnt verify the hit, it could look like you hit something but you actually didnt (Hit Reg)

If you just want the trail to fade away you could detach it from your projectile, let the particle finish and destroy it after

keen condor
#

Ok thank you verry much dude !

quartz star
soft copper
#

Anyone know why the default network interpolation for my actors in unreal is so bad? Are there some magic numbers to make this look good? Frequently there will be weird teleports / other jank with physics objects over the network.

dark edge
#

loosen them up

#

there's a lot of tunable parameters

crisp shard
dark edge
#

physic is a typo but it's still there lol

crisp shard
quaint roost
#

regarding VisibilityBasedAnimTickOption whats does "tick pose" mean? does that fire anim notifies? I assume refresh bones mean to actually do the bone movement

#

my game server only needs to move bones during montages. has anyone done something similar before?

essentially: "tick pose and refresh bones during montages only"

soft copper
vagrant grail
#

Why there are 4 players spawning instead of only 2 as I launched the test with 2 players ๐Ÿค” ?

naive rune
#

Hey all. I have a dedicated server packaged up for my game, but when launching the server, it is listening on 0.0.0.0:7777 so external clients can't connect. How does one change it to stop listening on the loopback, and listen for external connections?

#

for clarity; the dedi is hosted on a baremetal linux box in a data center, with a windows VM hosting the gameserver; both the firewall on the linux host and the windows VM are allowing 7777

worthy oak
sinful tree
# naive rune Hey all. I have a dedicated server packaged up for my game, but when launching t...

There's no additional configuration on Unreal's end as far as I'm aware. The port is the important part, and as long as you know your network traffic is appropriately forwarded from the port from your external IP address, external clients should be able to connect to the external IP address at your defined port number and be directed to the internal IP address of the server running on that port.

worthy oak
#

Also 0.0.0.0 is a โ€œlisten anywhere addressโ€

#

which for testing is likely what you want

naive rune
#

@worthy oak It's a gift to us from someone. I do not have access to the portal. Good thought, I do think it's network level. I'll dig deeper.

worthy oak
#

Yeah you would need to configure it in your network firewall. Tracking it down from your public IP all the way down the host ๐Ÿ™‚

soft copper
dark edge
#

try like 0.1 for each

vagrant grail
#

Why my characters spawn properly but i can't control it and my camera is on the floor ?

hoary spear
#

Failed possession?

narrow fog
#

I'm having a bit of trouble getting a transforming actor to replicate and I'm wondering if I'm misunderstanding something about how replicated movement works

I have a gameplay ability that allows the player to pick up and move an actor (unit) around a board. I've since attempted to move it to the Player Controller, but the results have been the same

When the server picks up and moves a unit, the X and Y position is replicated to the client, but the Z and rotation are not

When the client picks up and moves a unit, the Z is replicated to the server, but the X and Y position are not

The first clip is of the server character executing the ability on server, second is the client's view, third is the client executing on its machine, fourth is the server's view

ripe lotus
#

can you call a server function from a client's game instance?
i know you can call from an object that has a player controller as owner. but i dont know about game instances. i think there's one on the client as well.

vagrant grail
hoary spear
#

Playercontroller got the possess event for example

#

does your log tell you anything

vagrant grail
#

the print is called so it's technically possessed

hoary spear
#

make it a habbit to print some more contextual info

#

append the pawn name

#

but yes it does seem like possession happens

#

what does the logs say ?ร…

woven basin
#

Is there an equilivant of GPlayInEditorContextString for UE_LOG?

So that way I can see which client/server is outputting something on a UE_LOG in the console in real time?

narrow fog
bright summit
ripe lotus
# narrow fog Oh I see what you mean, the Z is a SetRelativeLocationAndRotation of the mesh to...

i wouldn't assume that everything works the same way. in any context. and i've worked with ppl who ~kills~ insisted on making everything work the same way always.
maybe you're assuming how ue works. and i dont know enough. but iirc ue does a lot of compression of data. e.g. send delta info and not the actual value.
the fact that you're changing the pos in 2 places seems like a way to step on yourself.
moving all into setactorlocation seems like a good idea.

#

btw. usually calling setrelativelocationandrotation is more performant than setting location and rotation separately. i think for network it would be the better choice too (but im not certain). not sure how it affects replication to set them separately.

hoary spear
vagrant grail
hoary spear
#

You got a camera on the char? Is it set to auto activate ?

vagrant grail
#

these are the logs

hoary spear
#

I guess it not we'd be stuck at center of char

#

This is not all the logs?

#

This is just your bits

vagrant grail
hoary spear
#

Yes ofc

#

Your logs have little value to me

#

Or others

vagrant grail
hoary spear
#

What did you change when this stopped working anyways

vagrant grail
hoary spear
#

I want to see anything suggesting something going wrong or being invalid I guess

#

player / spawn / camera / related

vagrant grail
hoary spear
#

To make what work exactly

vagrant grail
hoary spear
#

Inputmode UI Only

#

LogPlayerController: Error: InputMode:UIOnly - Attempting to focus Non-Focusable widget SObjectWidget [Widget.cpp(954)]!

#

Cant find much in here I guess

#

no errors that strikes me as related to this

vagrant grail
hoary spear
#

Did you clear the logs ๐Ÿ˜…

acoustic niche
#

Hey I'm having an issue with 5.3 where all clients are printing as client 0 and was wondering if anyone knew a fix for this? ๐Ÿ™

vagrant grail
# hoary spear Did you clear the logs ๐Ÿ˜…

i restarted the editor and I have all the logs back again but I don't have LogPlayerController: Error: InputMode:UIOnly - Attempting to focus Non-Focusable widget SObjectWidget [Widget.cpp(954)]! anymore ๐Ÿ˜„

hoary spear
#

Woop woop ๐Ÿคช

vagrant grail
#

i'm getting crazy I think

hoary spear
#

Back to singleplayer !

#

You wont regret it

vagrant grail
# hoary spear Inputmode UI Only

as i don't have the error now but still have thise issue with the character and the camera, I guess the error above isn't the issue ๐Ÿ˜„ So do you have something else to suggest ? ๐Ÿ˜„

hoary spear
#

Nah im out of time

#

Reduce changes, see what broke it , backtrack

#

Start a new project, do one thing at the time

maiden flame
#

Was gonna suggest the same.

Recreate the connection to gameplay process in a fresh project. Like Squize said, do one thing at a time, and ensure it works before moving on. Keep stuff as simple as possible.

#

If it works, you can always adapt the new system to the old one.

vagrant grail
hoary spear
#

Ignore that part for now

maiden flame
#

You could duplicate the project and redo just the other parts.

hoary spear
#

Do simple direct connect

maiden flame
#

That's fine too.

vagrant grail
#

I'm not familiar with that

hoary spear
#

Execute console: Open 127.0.0.1
Iirc

#

Or your public ip if you wanna go out/in

maiden flame
#

To be fair, I don't think you need the connection right now, just test locally inside Unreal. Isn't that what you're already doing?

hoary spear
#

Yeah true

vagrant grail
maiden flame
#

Well, I believe you are using Steam Online Subsystem, but when you connect, you're not logged in as a Steam user? The player's have your machine name?

hoary spear
#

Yepp

maiden flame
#

Anyway you could just set that stuff up if its necessary, it doesn't take long the second time ๐Ÿ˜›

hoary spear
#

Poteto tomato

hoary spear
#

Does it work if you start directly in the dev level?

#

In PIE?

#

(I never start from main menu unless im doing packaged test or right before it)

vagrant grail
vagrant grail
#

servertravel does work now in PIE for some reason

stone yacht
#

net.AllowPIESeamlessTravel did you set this ?

vagrant grail
stone yacht
#

If it's letting you do seamless travel i assume this is set to true

#

in PIE i mean

vagrant grail
stone yacht
#

you can open the console and run it without a value it should show you the current value.

#

im not sure how well PIE seamless travel is working at the moment, didn't work in the past at all.

vagrant grail
#

but now for some reason it works

maiden flame
#

But you still have the same problem, even if you start inside the gameplay level without travelling there?

vagrant grail
#

let me try directy from the level itself

#

except 1 thing that isn't working

#

which is this "Set IsInputEnabled" to disable the movement of the player when they join somehow it doesn't work and not being called

#

let me check if the prints before are being called

#

These are the prints

#

and GM_Werewolf isn't called nor the EventOnSwapPlayerControllers in it

hoary spear
#

Not sure what exavtly calls thhat event tbh

#

Guuess gm during travel and swap

vagrant grail
hoary spear
#

And you got a pc_lobby and some pc_game right?

vagrant grail
hoary spear
#

the only check is old and new isvalid

#

and player is valid

#

usure what player is atm

vagrant grail
#

I'm not sure to understand what you mean here ๐Ÿค”

hoary spear
#

/** UPlayer associated with this PlayerController. Could be a local player or a net connection. */

#

sounds like this would generally be valid

vagrant grail
#

Ok but what am I supposed to do ? ๐Ÿ˜„

hoary spear
#

Nothing, im just checking

#

in which GM have you setup OnSwap?

#

Werefolf... hmm

vagrant grail
hoary spear
#

ok

#

guess it should be called on the new one

vagrant grail
hoary spear
#

No need to call parent

#

as that's nothing

vagrant grail
hoary spear
#

Calling parent function onswapplayercontroller is an event that doesnt exist

#

its a BPIE

vagrant grail
#

a what ?

hoary spear
#

blueprintimplementableEvent

#

basically a pure Blueprint event

#

Oh right

#

you call the core implementation.

#

gotcha.

vagrant grail
#

I call it like this

hoary spear
#

yepp

vagrant grail
hoary spear
#

so whats the rest of the GM werewolf implementation?

vagrant grail
hoary spear
#

but Swap isn't called ?

vagrant grail
#

the print is supposed to be red, so none of those are that print

vagrant grail
# hoary spear but Swap isn't called ?

But when coming back to "Standalone Game" it's being called by my character isn't spawned and my camera is in the floor (and somehow now it's only doing that for the host, and the client doesn't even travel to the new level ๐Ÿคทโ€โ™‚๏ธ

hoary spear
#

I feel like there's logic here we're not shown either

#

i'd suggest starting a new project, as before

#

do one step at the time

#

and see what breaks , if it even breaks

hoary spear
#

Some mention bug with GetPlayerController, hopefully you're not using that anywhere

#

in multiplayerprojects thats a big no no

hoary spear
#

ARe you using that node anywhere?

vagrant grail
lost inlet
#

GetPlayerController(0) will always refer to the first player

hoary spear
#

Apparently some post from 2017 suggest its bugged tho

#

right after a seamlesstravel

lost inlet
#

it's kind of okay for clientside stuff if you don't have to factor splitscreen/local MP

hoary spear
#

it will return the old controller and not the new one

#

havnt verified this but

#

generally i never use it

#

and in a character, there's no reason to

lost inlet
#

I don't know why you would use GetPlayerController(0) when you can get the controller that possesses a character though

hoary spear
#

^

vagrant grail
lost inlet
#

And this is not usually how you use delegates in UI code

#

since you're creating a dependency on the HUD from the character BP

hoary spear
#

Its someone debugging through the c++ code of it

#

idk, havn't verified but i wouldnt dismiss it so fast

lost inlet
#

well I would because it gets plenty of use

hoary spear
#

UWorld::GetControllerList was the function in question in that post.

#

anyways, was mostly a remark. I suggest avoiding it regardless, as there's more often than not a valid reference to the actual owner anyways

lost inlet
#

someone somewhere 7 years ago debugged an engine function and that means it's broken

#

though actually that wouldn't surprise me too much with Unreal

hoary spear
#

(they dont have a good trackrecord of fixing old bugs ๐Ÿ˜› )

vagrant grail
#

so ? ๐Ÿ™‚

real ridge
#

Guys I have poblem I was using eos with Source build of ue when I packaged game I was able use EOS and now when I package game I cant join SESSION idk what problem it is, on another pc its working any ideas?

hoary spear
vagrant grail
hoary spear
#

How'd you enable it lol

vagrant grail
hoary spear
#

Both ig

tardy fossil
#

I like the way mr Snrub thinks

storm grove
#

What are some tips for replicating a montage - I would rather not multicast but its for single shot shooting events so a replicated int or something that had an OnRep reaction could work but I feel it would be slow and delayed.

What are you guys thoughts for something like that?

crisp shard
#

Why are you avoiding the multicast tho?

lost inlet
#

That was going to be my question too

storm grove
chrome bay
#

unreliable multicast is essentially the same as property replication really

storm grove
chrome bay
#

But it's worth noting that if you were doing this with gameplay abilities or something, it'd probably be doen via a gameplay cue which is essentially a multicast with a budgeting system on top

storm grove
#

alright good to know, i was originally considering a replicated counter that just triggered stuff like that

chrome bay
#

Main difference with the counter is that you want some amount of budgeting, but you don't want fire events to be dropped. Better late than never kind of approach.

#

Unreliable multicasts would still be budgeted, but unless they are sent right away, you never get that firing event

#

From a player perspective I figure they would complain if people think they're getting shot without anybody around them firing.

feral narwhal
#

I have a struct called Data which I store on every item in the game, would setting this Data to Replicate be expensive?

hoary spear
#

Tmap wont replicate will it

chrome bay
#

negative

hoary spear
#

So not so big ๐Ÿ˜„

woven basin
#

With the new UE_LOGFMT - is it possible to always have a string pre-pend if we overloaded UE_LOGFMT somehow? So that every string started with GetDebugStringForWorld(GetWorld()) - rather than having to put that in each ourselves - so all logs are like "Client 1: I did something", "Dedicated Server: it was me"

i.e. rather than write:

UE_LOGFMT(LogTemp, Warning, "{0}: Spawned container component for: {1}", GetDebugStringForWorld(GetWorld()), GetOwner()->GetName());

I'd rather write:

UE_LOGFMT(LogTemp, Warning, "Spawned container component for: {0}", GetOwner()->GetName());

#

At the moment I'm probably just going to make a helper class that does it old school style - but was hoping to overload the actual UE_LOGFMT somehow - but I cant get my head around some of the template stuff

#

At least the GetDebugString part is working...

flat night
#

Do you guys have a smart way of handling this issue?
I have a float Health and MaxHealth. I have various objects in the level that I place with different health. In BeginPlay I do this

if (HasAuthority())
    {
        Health = MaxHealth;
        OnTakeAnyDamage.AddDynamic(this, &AHayStack::ReceiveDamage);
    }

so that the BP sets the right health at the start. But in my Receive hit I have this:

void AHayStack::ReceiveDamage(AActor* DamagedActor, float Damage, const UDamageType* DamageType,
                              AController* InstigatorController, AActor* DamageCauser)
{
    
    Health =  FMath::Clamp(Health - Damage, 0.f, MaxHealth);
    
    
    if (Health > 0)
    {
        GettingHit();
    }

and the GettingHit plays some animations, sfx and vfx
the issue is that on start, the OnRep function plays

void AHayStack::OnRep_Health()
{
    if (Health > 0)
    {
        GettingHit();
    }
}

and does all the stuff in GettingHit. Which I do not want. But I am not sure how to bypass this. I made it work on my Character in a very roundable way by getting a value from the GameMode and setting it through the Controller, but it feels quite redundant. Is there some other way you'd do this?

hoary spear
#

Check old health

#

You can include that in the onRep

#

OnRep_,Health(const float OldHealth)

#

@flat night

flat night
#

Yeah, I am looking at it, but I am not sure exactly how to check that OldHealth

#

I am not super familiar with all the OnRep stuff yet

hoary spear
#

If Health > OldHealth
( Gained HP)
Else
( Lost HP)

Or if OldHealth == 0 -> Init Health (or -1.0 to be very explicit)

visual mountain
#

looking for suggestions on how to do an in game score board that displays to all players. i was currently attempting Widgets being sent to players but having difficulty with updating the client to the score. Would it make more sense to maybe use an in game actor, attach a widget to it and have it present to the players?

hoary spear
#

PlayerStates could keep their scores

#

Gamestate could have an array of the sorting

#

And clients just react to that array updating, along with binding to playerstate changes for each player

GameState -> OnRep_LeaderBoard

PlayerState -> OnRep_Score

flat night
#

@hoary spear got it working! Thanks!!

lament flax
hoary spear
#

No

lament flax
#

Why ?

#

Im curious

hoary spear
#

Its just not supported/implemented

lament flax
#

There is probably a backend reason

hoary spear
#

Not really

worn flame
#

Hello all, I'm currently setting up the Animation Budget Allocator, but the plugin seems to not take effect on Dedicated Servers. It does it job very well on Listen Servers and Clients, but it seems to be deactivated by default when I run a dedicated server.
I've never used the ABA before and I'm not experienced with dedicated servers. Could someone point me in the right direction? Docs were not helpful in this regard and I can't seem to find any forums posts.

hoary spear
#

Do dedicated servers even run animations?

#

Dont think they do, normally

worn flame
#

Think melee combat

hoary spear
#

Hmm..

#

You can do the calcs without playing it

worn flame
#

I'm interested in knowing more about the Budget Allocator not working on dedicated servers, though. It's a behavior that is not explicited anywhere on the docs or anywhere else on the plugin.

hoary spear
#

Fair enough, just figured it was related and due to anims not normally running on dedicated..

woven basin
#

yeah - animations arnt the same on dedicated as listen servers

#

I think you might need to enable "always tick pose" or something like that?

worn flame
#

Alright, but they run on my dedicated servers because the nature of my project requires so, guys. My question is about the ABA, not about running animations on dedicated servers.

worn flame
gloomy tiger
#

Dedicated Servers don't run the rendering pipeline, how would they handle animations?

worn flame
#

Animations are ran on the dedicated servers, otherwise my entire project wouldn't be working. I just need to understand how to enable the ABA on dedicated servers.

gloomy tiger
worn flame
#

If the server is authoritative over replicated scene objects - say, a sword - and said objects are mutated by animations - say, an SKM to which the sword is attached - and the server simulates the animations in such a way that the objects mutate accordingly, that's running the animations as far as I'm concerned. It's not some client doing so.

woven basin
#

looks like its set to not allow to run on a dedicated server

#

@worn flame

gloomy tiger
worn flame
worn flame
hoary spear
#

Care to share how you solved it ?

hoary spear
#

Right ok

#

So their motivation was prob due to anims normally not running on dedicated

#

Could've said in docu tho.

#

Im surprised theres no built method to just run the notify track on dedi servers tho..

#

And skip the actual animations. Do some quick lookup on bone locations when asked for

worn flame
#

Are you guys using 4.0 or smth?

#

lol

#

You even have a "Trigger on Dedicated Servers" flag

#

Why would they have that in Anim Montages if they didn't run on dedicated servers?

hoary spear
#

I dont want the montage to run tho

#

I only want the notify track.

gloomy tiger
worn flame
#

So yeah, anim data is run on dedicated servers

worn flame
gloomy tiger
#

We had to simulate footstep sounds based on movement start/stop. Was a nightmare.

worn flame
#

Yeah, we had a similar solution back in Unity working with Photon tech. The current version of Unreal is taking a lot of work out of our backs tho

hoary spear
#

So, as I said, I'm surprised theres no way to just grab the notify track and play only that

#

Sounds like a very useful thing

#

Havnt gotten to this part yet tho so maybe ill discover why its not possible (or that it is, and im just blind)

cursive steeple
hoary spear
#

I'll probably dive into the inner workings of montages and see if there's something i can do about it

cursive steeple
maiden flame
#

Squize, what do you mean? You only want bone transform data at the time of the notify?

#

Because otherwise, the server is basically just treating the montage as a timeline, unless you continously tick mesh transforms.

hoary spear
#

Except it includes Updating bone transforms, right ?

maiden flame
#

Not if you disable them, which they are by default.

hoary spear
#

Guess thats 90% of the way then

#

I want them purely calculated if they're read , thinking that'd be cheaper

maiden flame
#

Definitely.

#

It's useful to tick the transforms if you have traces attached to sockets and such. It can be turned on and off during runtime, but it's not immediate.

#

Well, it's probably pretty fast, I didn't test it much.

cursive steeple
maiden flame
#

Ah, that would be so useful lol.

#

Maybe if you use C++ idk xD

cursive steeple
#

aights thanks tho ๐Ÿซ 

hoary spear
#

ah yeah, restricting bones to be updated

half iris
#

It is "I wish there was more documentation about this feature" time again. Tonight lets talk about voice chat.

How in the world can a server be receiving voice chat data over the network, if the client isnt sending any (according to stat net debugging)?

#

Also, is there a specific testing setup required to test voice chat? Right now I launch 2 standalones on the same pc, connect them to eachother through advancedsessions. Is this a valid test case, or am I supposed to have 2 separate packaged builds, or 2 separate pc's entirely?

maiden flame
#

Eh, I think that is valid if it works, but obviously you can't be 100% certain until you test it in the environment your game will actually run. E.g. a packaged build using two user accounts over a wireless connection.

half iris
#

Right okay, that sucks a tiny little bit to be honest, but I suppose there are technical reasons as to why it works this way

#

I will start testing it in a packaged setup on 2 separate machines

#

thanks for the help

manic trellis
#

Hello there,
I got a problem with getting data from player state.

  • I have all me player related data in player state and some of it is settings on the game start.
  • I have multiple levels but when the player moves to different level then all the data in player state is removed.

is there any way I can get all the data from player state which is set in the different map but do not want to use game instance. As it is a multiplayer game.

sinful tree
kindred widget
nocturne quail
#

what the difference between these two Rep_Conditions?

    DOREPLIFETIME_CONDITION_NOTIFY(ATSLCharacterBase, bCrouching, COND_None , REPNOTIFY_Always);
    DOREPLIFETIME_CONDITION(ATSLCharacterBase, bCrouching, COND_SimulatedOnly);
#

so COND_SimulatedOnly will only replicate to other clients and will not replicate back to me

#

i have to run the crouch logic locally for me partially

vagrant grail
fossil spoke
#

The REPNOTIFY_Always is changing how an OnRep that might be attached to the variable gets called.

#

It will always be called when the value of the variable is sent to the Client, whether it changed or not.

#

REPNOTIFY_xxx is not a "condition" its a "notify" as the name implies.

#

COND_None is the "condition"

nocturne quail
fossil spoke
#

Yes

#

Because there is no condition on its replication

nocturne quail
#

but on dedicated server i noticed that we need to call the trigger function manually

fossil spoke
nocturne quail
fossil spoke
#

Is a Listen Server a type of Server?

#

The answer is yes.

#

So yes, you must call it manually on Listen Server as well

woven basin
nocturne quail
nocturne quail
woven basin
#

So CONDITION is "who gets it" - REPNOTIFY_X is "when" do they get it

woven basin
nocturne quail
#

so in summary, DOREPLIFETIME_CONDITION_NOTIFY replicates a property based on a condition and triggers property change notifications, while DOREPLIFETIME_CONDITION replicates a property based on a condition without triggering property change notifications

woven basin
#

If you look at UnrealNetwork.h and CoreNetTypes.h

#

That has a better source version of the CONDs available

#

DOREPLIFETIME(MyCharacter, bMyVariable)

is the same thing as writing

DOREPLIFETIME(MyCharacter, bMyVariable, COND_None)

and both of these are the same thing as

DOREPLICATE_CONDITION_NOTIFY(MyCharacter, bMyVariable, COND_None, REPNOTIFY_OnChanged)

#

So if you are happy with COND_None and REPNOTIFY_OnChanged - you just use DOREPLIFETIME.

Or you can change them using a function with additional options.

Or you can always just use DOREPLICATE_CONDITION_NOTIFY() and always explicity show COND_None etc - to help future you reading the code.

#

Most importantly is that REPNOTIFY_OnChanged is the default - not REPNOTIFY_Always. This specific part is saying - hey, for each connection that I want to send the notify to, should I? The "should" is if the old variable is 5 and the new variable is 5, REPNOTIFY_OnChanged wont send anything.

But REPNOTIFY_Always will always send the 5 variable even though it didnt change.

#

Does that help/make sense @nocturne quail ?

nocturne quail
woven basin
#

One last part is - regards of all those - we are only talking about COND sending to clients. the server will never get its own Notify. You have to do that manually in c++. I'm sure that is covered in eXi's link about it, and that is what Matt was talking about earlier.

nocturne quail
woven basin
#

FYI - I did some testing on the FastArray callbacks. They function same as OnRep - i.e. only clients get the callback, not the server.

So if I was running a listen server, and I wanted to hook the UI into the callback, I guess anywhere I do MarkDirty() I should do a check for IsListenServer and if so, broadcast the UI change there for the listenserver itself?

#

I dont see any obvious way outside of that looking at the source code - unless someone knows of a better/cleaner option

woven basin
#

ok - thanks @fossil spoke

fossil spoke
#

However you probably dont need to do any checks for the Server

#

Since only the Server should be calling MarkDirty anyway

woven basin
#

But I dont want to call UI broadcast on Dedicated? Although maybe I handle that in the UI hud that gets stubbed out

#

i.e. if my game supports both Listen and Dedicated

fossil spoke
#

Well you probably shouldnt be making a call to anything that specific

#

Instead you should just emit a generic delegate or something

#

OnItemAdded or whatever

woven basin
#

yep - understood - your right (as usual) - thanks

fossil spoke
#

That way external systems can decide what specifically they need to do, like updating UI

woven basin
#

appreciate the time - thanks

fossil spoke
#

๐Ÿ‘

manic trellis
torpid lantern
#

If I set an actor's owner to the player's playerstate, will that actor then become relevant to all players regardless of cull?

#

(Assuming NetUseOwnerRelevancy=True) .. I think the answer is "yes".

fossil spoke
#

If you have enabled bNetUseOwnerRelevancy then yes, that is how that works, so the Actor would always be relevant because the PlayerState is.

vagrant grail
#

Any saviour that could finally help me solve the issue of the client not having his character spawn nor controlled please ? ๐Ÿ˜„ #blueprint message

thorn vale
#

anyone have issues with VOIP with steamdecks? they seem to behave like their input is like 100 times too high and its just distorted terrible noise

latent heart
#

I don't suppose anyone has some convenient links on lyra and iris?

rancid wren
#

I am unable to join a server in my game. This is using the Steam Online subsystem. I cannot figure out why it does not connect. Please help.

quasi tide
#

Using Mover? Uggghhh. I hate the API of mover so far.

#

But this is a solid commit ๐Ÿ‘Œ

latent heart
#

Wasn't gpl one of those licences you weren't allowed to use?

#

I can never remmeber

vagrant grail
woven basin
#

When is it safe to call GetLocalRole() in a newly spawned Actor or Character? Can I do it in the constructor, or do I need to use one of the later hooks?

woven basin
#

ok - so its definitely not the constructor - I'm searching the code where its handled

dusty void
vagrant grail
dusty void
#

sorry i was doing smth

#

also what does it show when you try test playing

vagrant grail
dusty void
#

does it mess up in both or?

vagrant grail
thin fog
#

do anyone know why does 2 window doesn't work when I start my game in multiplayer only 1 screen work perfectly other screen button's don't work

bright summit
#

how is the best way to call these events to be reuplicated to others? calling them via OnRep ? Multicast will be not always relevant if client is too far

It will handle level blueprint logic, for example what will happen when player pushes the button etc.

modest crater
#

OnRep for states otherwise RPCs for immediate or one off events (unless its client requesting a state change then it would be serverRPC but you get my point)

#

pushes a button sounds like it could be a OnRep + variable

bright summit
modest crater
#

Thats literally the only way that would work in that case

#

Late joiners would miss the RPC

bright summit
#

ok I just wanted to be sure if there isn't an other way to do this

modest crater
#

There are other ways ofcourse, you could send an RPC to each client as they join with the current state to ensure but the correct way is to use OnRep and variable

bright summit
#

Why should I do it other way than proper way KEKW

modest crater
#

you shouldn't - I answered wanted to be sure if there isn't an other way to do this

bright summit
#

ok o k

latent heart
#

I'm sure that's a thing

bright summit
#

but I noticed the proble with that way is initializating variables. Events get called when for example door variable default state is closed. How to do it it would not be called on initialize?

latent heart
crude bronze
#

Can somebody explain to me the online subsystem? Does it automatically synchronize players when I start a session or do I need netcode?

modest crater
#

If they both start in the same state you wont get the OnRep

crude bronze
bright summit
#

Sure maybe I will give a more specific example:

I have a door which has "flag" IsLocked which I can check in editor to have this door locked on start, uproperty with EditInstanceOnly has default value false, so you are right it will be called because player which will join the game must update the door state so it is get called, and I am wondering how to prevent it in that specific case

modest crater
modest crater
#

although it kinda defeats the purpose of a replicated variable? Which is to replicate state of the value

bright summit
modest crater
#

I mean, you have access to ELifetimeCondition enums for the replication condition, you could also do a custom condition and go that route but idk, I would do this properly from the start, if something is locked then all clients should see the same state if thats your intention

bright summit
#

so I would have then make a seperate actors for door locked, door unlocked and If I want to havge door locked then use door locked actor instead of ticking, unticking the checkbox

modest crater
#

I am so confused but each door should have their own state yes, if I understand you correctly. You can do things like bit packing to save bandwidth if thats what you are worried about

chilly haven
#

When joining a game, does unreal direcly replicate the accurate initial state of an object, or will onreps be called?

#

(that's what I'm seeing, wasn't expected)

#

How do you then distinguish between initial state (as you perceive it), and something that changed while you were playing?

chrome bay
#

OnRep will be called if the received value differs from the default serialized value of that object

chilly haven
#

OK thanks.

#

How to distinguish the difference?

chrome bay
#

You can detect "initial" OnReps by checking the current time vs the spawn time:
GetWorld->TimeSince(CreationTime) <= 0.f

#

Only works for things spawned at runtime, and not for dormant actors

chilly haven
#

OK thanks... seems like a weak mechanism

#

Seems like a lot of onreps would need that test

chrome bay
#

Real question is why does it matter in this case?

chilly haven
#

So, I have a team that has an IsDefeated repl variable. When it changes, I announce the defeat. But when joining I don't want to see it.

#

Am I supposed to use replicated variable AND RPC?

lost relic
#

Hi . I have this roomscale movement system for VR that moves the player in the direction the RL player moves , works great, But trying to make it work in multiplayer but its not moving and just stutters

chrome bay
#

For things like that, you usually need to use the above mechanism or something similar.

chilly haven
#

ok thanks @chrome bay. seems like there should have been a less hacky solution.

chrome bay
#

Since in this case it's regarding joining, you can just check whether the world time is above a certain threshold

fossil veldt
lost relic
#

I also tried this but it stopped working completely

chrome bay
#

well the problem is you can't distinguish an initial replication due to join, or due to relevancy change etc.

fossil veldt
#

but I meaaaaan

#

The entire industry really is built on that GPL so personally it never bothered me, also itโ€™s only the quake code in that repo that is gpl, not my code, any file affected by gpl is marked with the specific license

chilly haven
#

Oh you are saying relevancy complicates the whole thing since the object may not be reflected immediately

lost relic
#

anyone? why is this working in single player but not on client?

tardy fossil
#

the multiplayer options menu?

fossil veldt
#

but Epic doesn't use GPL they have a custom licence

#

but it's an implementation for Mover so i mean, why would you

latent heart
#

Something about the gpl licence requiring transference to things it's used with. Honestly, I don't know anything about licences, I just know there are some that are entirely incompatible with UE stuff.

#

Because of Epic's EULA.

#

This means, for example, that you may not combine the Licensed Technology with code or content that is licensed under any of the following licenses: GNU General Public License (GPL), Lesser GPL (LGPL) (unless you are merely dynamically linking a shared library), or Creative Commons Attribution-ShareAlike License.

#

It even says it in there.

fossil veldt
#

hmmmm shit

latent heart
lost inlet
#

was CC ShareAlike always there

fossil veldt
#

well that's annoying

#

you're allowed to dynamically / shared linked a library

woven basin
# latent heart PostNetInit?

So I looked at all the docs about Actor 'lifecycles' - none of them make reference to this. The docs just say "Always called immediately after spawning and reading in replicated properties"

Any idea where in the lifecycle of an actor it actually occurs?

fossil veldt
#

which is a guess a workaround

latent heart
latent heart
fossil veldt
#

that's really god damn annoying

latent heart
#

Yeah. That might work. A third party separately compiled thing.

#

And have 2 licences on your repo.

fossil veldt
#

yep

latent heart
#

Though that only counts if the quake stuff is LGPL, not full GPL.

woven basin
latent heart
#

Neat!

fossil veldt
woven basin
#

My use case is attaching a storage component to a Pawn. I only want it on owner+server. The clients shouldnt have storage of the simulated proxies - so just working out when to do that check and attach the storage.

fossil veldt
#

So you deadass just can't use GPL code with the UE -__-

latent heart
#

Is the q3 helper stuff absolutely required?

#

Can you rewriet it yourself?

fossil veldt
#

Well I did rewrite it myself but it's obviously still inspired by Quake3

#

you can argue it's transformative

latent heart
fossil veldt
#

but idk

latent heart
fossil veldt
#

I am almost certain that you can't argue it's transformative in this case, so it's fucked basically

#

that's really really annoying

latent heart
#

Sorry ๐Ÿ˜ฆ

fossil veldt
#

all good! thanks for letting me know!

woven basin
latent heart
#

Is PostNetInit even called on the server?

#

I thought it was just for replicated objects.

woven basin
#

so where then - beginplay?

latent heart
#

Yeah.

woven basin
#

The other option is, now that I think about it, I do have the fastarray notifications only going to the COND_Owner, so I guess it doesnt matter if everyone is running around with an empty inventory...

#

maybe I just keep it simple...

lost relic
#

Why does this work as listen server, standalone But Not as client .

latent heart
#

One reason might be that you're calling an rpc on a actor you don't own as a client.

#

You can't call server rpcs on the game state or other players or random world actors.

#

The picture is a little too low res to see any more. But that might just be my phone.

latent heart
fluid prawn
#

It is low

#

For me also

surreal plaza
#

Do you guys run multiple machines or sandbox for testing?

hoary spear
#

Both

surreal plaza
quasi tide
#

Actually tracing what calls what and how it happens is ๐Ÿคข

plucky crane
#

quick question, if i wanted to add a collision sphere to a multiplayer map that grants any player inside of it xp that dynamically moves during the match where should I store that functionality, im thinking the sphere and its information should be an actor created by the gamestate and the score should be handled through the gamestate

quasi tide
#

In the actor. You can even have it as a server actor only.

#

Player overlaps -> grant XP -> change locations

#

Of course, if you want them to be able to actually see the zone, it has to be replicated

orchid eagle
#

Hello there
so i got a question
in my game i want to teleport my character to other levels
i did search on using async but the thing is idk if that comes already replicated or not and how would that work
i tried to search for any other info but i got none
so can anyone help explaining it a bit
i can get in a voice channel if anyone wants to so it would be easer to explain
thanks in advance โค๏ธ

woven basin
#

There's some guides pinned in this channel about it

orchid eagle
proven robin
#

Once again, i am turning to your expertise, i am trying to create a replicated PlayerList in my game, and so far i have the following

GAMEMODE (Picture 1):
Using Event Post Login to update a playerlist. Game mode calls a function on the Gamestate called Update Player List

GAMESTATE (Picture 2):
Passing the connecting player state, and updating my Connected players array(Repnotify) with the GameState Player Array Variable

NOTIFY(Picture 3):
Here i test if the Connecting player, already exists within the Player Array, and if so it should add a new item to a list, and if not it should create an entire new list of players

ISSUE:
All of this runs on Server and on Client 0, but nothing really happens on Client 1. I only get messages from Server and Client 0....

I cant seem to figure out if it has to do with the FIND function i am using to test if player already exists in the player array....

One other thing is that it looks like the "adding new player" happens multiple time.... hmmmm...

#

Sorry for the wall of text....

upbeat basin
#

For a mechanic like controlling another player's character, I was considering to unposses both characters and possess the target character with the new controller and setting the viewtarget on the new controller client, so both clients would see from the same player, while one is just a spectator and the other is controlling their character. But I'm concerned this might cause bugs in the future as it breaks the linkage of original controller-state-pawn objects. Would anyone like to add any input or suggest ideas about this before me actually trying it?

#

For example I also would like to make the original controller try to resist to the movement input from other player. Which I believe can't work with this way

fossil veldt
#

even for single player i donโ€™t think itโ€™s that complex tbh, I think ppl just dunno how to use it yet is all

#

thereโ€™s pretty much a grand total of 2 functions to be overridden

quasi tide
#

I don't have the time to keep exploring it though. Need to focus on my game.

fossil veldt
#

you have pretty much modes, layered moves, mover component, sync state, blackboard, input cmd

#

those are the main things

#

most important is modes, sync state, input cmd

quasi tide
#

Another lure of Mover 2.0 though, outside of the network stuff, is that it is supposed to be extendable by BP. So BP-only peeps can actually make a movement thing. Regardless if that is a good idea or bad idea ๐Ÿ˜…

#

But one of the gripes I hear from my friends coming over from Unity or Godot is that actually moving your actor, through a custom movement component is annoying because it requires C++ in order to even create a movement component.

fossil veldt
#

Yea iโ€™m not the biggest fan of that bit tbh, but it makes sense for layered moves I think

#

ah fair, iโ€™m not the biggest fan of BP in the first place so I guess I never cared

quasi tide
#

It really is a pain point of the engine imo. Because then you get these cursed friggin' solutions from BP-only people ๐Ÿ˜ญ

sinful tree
# proven robin Once again, i am turning to your expertise, i am trying to create a replicated P...

The PlayerState automatically manages the "Player Array", there is no need to replicate a second array with a list of playerstates.
To appropriately know when a player joins a game on both the client and server, you can use the Begin Play of the playerstate. You can have that begin play call a dispatcher in the GameState that passes along a reference to the PlayerState that joined which can create or update any UI necessary.

thin stratus
#

Both do, actually

proven robin
# thin stratus Both do, actually

!!! I REALLY - want to thank you for making that compendium!!!!! So well described, simple and to the point. Jesus u deserve som respect ๐Ÿ˜„

trim thunder
#

How do you guys separate Serverside and Clientside code? I'm coming from a classic Frontend + Backend perspective feels weird to just slap on an annotation parameter and have a Serverside only code.
Do you think it would make sense to move all Server/Client logic for an actor in Components or something?

mystic estuary
#

Hello, does anyone know whether Epic changed how they handle widgets on seamless travel?

I always knew that they are persistent (https://wizardcell.com/unreal/persistent-data/#should-userwidgets-persist-seamless-travel), however, it doesn't look to be the case anymore. I have made a bare example with seamless travel (screenshot), but upon it the widget gets removed mid-travelling (on transition map). I have checked the SeamlessTravel in GM.

Upon executing the console command, this is triggered

void UEngine::TickWorldTravel(FWorldContext& Context, float DeltaSeconds)
{
    if (Context.SeamlessTravelHandler.IsInTransition())
        Context.SeamlessTravelHandler.Tick(); // <<< Following the chain, it calls UGameViewportSubsystem::HandleRemoveWorld
        // ...
}

and then

void UGameViewportSubsystem::HandleRemoveWorld(UWorld* InWorld)
{
    // Gather all widgets...
    for (UWidget* Widget : WidgetsToRemove)
    {
        Widget->RemoveFromParent();
    }
}
kindred widget
# mystic estuary Hello, does anyone know whether Epic changed how they handle widgets on seamless...

They likely did. Because that was a huge glaring bug in 4. You should always expect widgets to be removed when travelling, and if you have a specific widget that you don't want removed, then you can override that yourself in the widget.

In 4.x you did this by overriding AddToScreen and removing the world delegate binding. with FWorldDelegates::LevelRemovedFromWorld.RemoveAll(this); I personally even eventually hacked the system to gather all of the viewport widgets and remove them because handling every single userwidget removal is a daunting and never ending task.

It looks like in 5.x normally added widgets are done through the new GameViewportSubsystem. Which calls the UGameViewportSubsystem::AddToScreen, populating the list used in the HandleRemoveWorld you posted above.

You can circumvent this easily by adding the widget you don't want auto removed directly to the GameViewportClient. There is code in CommonLoadingScreen that showcases this. Which adds a widget without using the subsystem.

// Add to the viewport at a high ZOrder to make sure it is on top of most things
UGameViewportClient* GameViewportClient = LocalGameInstance->GetGameViewportClient();
GameViewportClient->AddViewportWidgetContent(LoadingScreenWidget.ToSharedRef(), Settings->LoadingScreenZOrder);```
gritty warren
#

Would a cover system (like gears of war) require a custom CMC, or do we think we can get away with just using RPC's to 'stick' to walls? ๐Ÿค”

Wall running for instance requires a custom CMC, but those kinds of implementations usually use their own physics and such, which is not the case for cover. Hmm.

mystic estuary
kindred widget
#

Initially I want to say no. Sec

mystic estuary
#

All the calls you posted are not BlueprintCallable, so I would imagine that it is the case, unless there's some Kismet wrapper I don't know about

kindred widget
#

Yeah, not really. GameViewportClient isn't really BP exposed at all.

#

Generally you don't want to run AI on the client.

mystic estuary
thin stratus
#

Surprising to me that Wizard posts about them persisting, cause iirc that was removed in very early 4.x versions (below 10). So either they still persist in some cases, or that is really outdated.

#

@lime coyote Relatively sure that whole stuff is AIController bound, and AIControllers are Server-only fwiw

#

@kindred widget Does CommonLoadingScreen use UUserWidgets or Slate?

kindred widget
#

Technically both. It uses a UserWidget, but calls Takewidget on it to pass it to the ViewportClient

thin stratus
#

Hm, sounds it that would have the same problem with nothing being able to tick in the Widget

orchid eagle
#

okay so im really lost now
i really can't find any clue how i would use the seamless travel with blueprint and also to only just teleport one of the player to another map not all of the player
is there is clue to that please
i searched really everything on the seamless travel and async
i would really love to get some help with that any kind of guide will be so appreciated
my game is a dedicated server based game too just in case that would make a difference

thin stratus
woven basin
thin stratus
#
  • Seamless Travel with Blueprints is relatively simple:

You need to ensure the GameMode that you Travel FROM, has bSeamlessTravel enabled.
As well as ensure the Server is the one calling ServerTravel, no one else.
And last that you do this either outside of the Editor (Standalone or Packaged), or you try the experimental console variable to also allow it in the Editor, but that might crash.

kindred widget
woven basin
thin stratus
#
  • also to only just teleport one of the player to another map not all of the player

That is not possible. In a game where players are connected to a Server, you can only ever move all Players. If a player moves alone, they disconnect.

woven basin
#

Unreal doesnt support multiple maps on one server

thin stratus
#

What would that do for you? Then you get a local copy of a PlayerState?

mystic estuary
#

AIController::PostInitializeComponents() is called server-side only either way

thin stratus
#

That has been the case for the past years.

#

However, that is when using the MoviePlayer. That's why I'm asking what CommonLoadingScreen is doing

orchid eagle
kindred widget
#

You're meaning during a level load?

thin stratus
#

Yeah

#

Between 2 levels and fwiw the initial load too.

thin stratus
orchid eagle
woven basin
#

Level streaming

kindred widget
#

They still paint and tick. The issue is that people do unspeakable horrors most of the time and don't async load enough which causes gamethread stalls, so no paint calls. Movieplayer just circumvents that by running the slate paint from another thread.

orchid eagle
thin stratus
#

Or rather

woven basin
#

yeah - so dont use world partition - use streamed levels for different areas. Its an alternative option (but has different pro's/con's)

thin stratus
#

It ticks it manually.., but it doesn't correctly progress

kindred widget
#

It's also crashy. At least in 4.27 it has some exceptionally hard to track down bugs related to it.

thin stratus
#

What you can't do for exmaple is manually trigger the MoviePlayer and have it be removed after some Steam CreateSession callback :D

#

Cause the Steam Thread is waiting

#

I will need to test the CommonLoadingScreen stuff with some animated UUserWidget and see if that actually works. would be nice

#

Current project I'm working on internally has 0 level loads, so will take a bit :P

#

+- the first one

orchid eagle
thin stratus
#

There is always a good chance that whatever you are trying to make in UE with its existing Level/Partition and Server architecture just won't work

woven basin
orchid eagle
keen condor
#

Hello guys , i'm making a top down arena game (battlerite-like moving with z q s d), i'm trying to find the best way to do client prediction with the launch of a slow paced fireball. For moving my character i use the charactermovementcomponent built in which comes with a verry good client prediction, but for my projectile i have 0 prediction so my fireball spawns far away from my character when i emulate bad network. i've heard about spawning a fireball localy and then syncing it with the server one but i can't imagine any good way to sync them smoothly since it's a slow projectile (i'm using gas)

kindred widget
#

Does anyone know what might be a good super early virtual for playercontroller initialization where RPCs would be fine? I just need a place I can start bouncing RPCs to get and set some state.

lament flax
#

Hello
do you lways have to set GetLifetimeReplicatedProps when replicating properties ?

woven basin
#

its half the reason you use c++ for multiplayer - to get the right control and conditions over the replication

lament flax
#

okay ty

steep wolf
#

did you figure out if mesh pointers were replicated through path? if anyone else knows this, i would love to know too

#

i want to know if mesh pointers for static mesh/skeletal mesh have async load enabled for inbuilt replication like how data assets have async load ini settings

proven robin
sinful tree
# proven robin Not really sure about the whole, using Playerstate beginplay versus OnPostLogin....

Ignore the dispatcher for a second. The idea here is that "Begin Play" will fire on the server or on a client when that playerstate starts existing. The playerstate is created by the playercontroller, which is created from the gamemode when a player joins the game. That means you can use that begin play event on the playerstate to know that someone joined the game without needing to send any RPCs or use any replicated variables.

The trouble with using BegIn Play of a PlayerState to signal changes to UI, is that it's hard for the playerstate to know about any existing UI, and really, it shouldn't be the responsibiilty of the playerstate to manage UI. So instead, you can have a dispatcher on some other actor, like the GameState or perhaps even the HUD class, that your UI can bind to in order to know that a PlayerState has become active, and you have your PlayerState call that dispatcher on BeginPlay. If you include a PlayerState input on the dispatcher, then you can easily pass through the reference to the PlayerState that is calling the dispatcher to know exactly which PlayerState is joining. Your bound event in your UI then can utilize the dispatcher to know that someone joined, and what their playerstate is.

proven robin
#

OH so you create the dispatcher on the Gamestate, and call it from Playerstate, and then lastly binds to it on the UI BP.

I was thinking to bind to it via my HUD class, And let the HUD class do all the logic - But i can see why you would do it directly on the widget (less referencing)

thin stratus
# thin fog No one could help out?

I don't think anyone really has an answer to that. I assume those are both Standalone instances. You will need to debug this yourself a bit.

thin fog
#

alright then ill give it a try

proven robin
# sinful tree Ignore the dispatcher for a second. The idea here is that "Begin Play" will fir...

And just like that... It magically works... A little bit of springle here, and a little bit here.. and boom...
Jesus you can really overcomplicate stuff, when you do not know all the build in stuff in UE

Now i'm just a tad curoius, when playing as a Listen Server, all dedicated Clients gets the expected result, however the Client/Server does not? I would expect the "Window" to still be a Client, thus recieving a Playerstate etc... Maybe It has....

UPDATE AS I'M WRITING..

If i Delay the inital Call to the dispatcher, from PlayerState it works as intended, but i am not keen of relying on that .5 sec delay ๐Ÿ˜›

hoary spear
#

Nah thats unreliable^^

#

Are you limited to BP only?

#

Theres a few hooks to look at if not

worthy warren
#

I've developed a multiplayer server outside of Unreal. I'm connecting to it through an unreal client, and I'm using it mainly as a renderer/interface, with the main game logic happening on the server. It's a normal MMO approach. I'm currently looking into how I can represent geometry on the server - any good ideas? I need to calculate line of sight and do different raycasts etc. I've seen older MMOs use chunked geodata, but I'd love to know if better approaches has been developed since then. Or does unreal have a way of exporting terrain data for a server setup like mine?

clever hound
#

Why is it that when im destroying an actor. It only destroys it about 30-40% of the time

#

Destroy() happens on the server and the actor is set to be replicated

#

And I know that the Destroy() is being called every single time but it does the actual destroying only sometimes whenever it feels like doing it

#

The actor is used as a physics constraint

orchid eagle
#

hello there
so is there a way to show and object or actor or landscapes for only one player not the others
lets say i have 2 island on the same level and i want to hide one of them from all the players and only show it when i teleport to it
and would only be visible to the guys who teleported there
here is a video shows what i mean

#

its maybe not the right way to do this and wont be performance friendly but im really stuck at this point
i can't use data layers in world partition to load and unload terrain same i can't only teleport one player to another level in the server or that's what i know until this moment
maybe there is a way that im not yet aware of

#

i would really love if someone join me in a voice chat and see my project and if there is a way and he can at least just guide me or show the way that would really be so helpful
and im willing to pay if its needed
i just really need help right now

ripe osprey
#

Hi everyone, I have a quick question. I have a TArray containing USTRUCTS. If the TArray is Replicated and I modify a member in one of the structs, will the entire TArray replicate? Will the entire struct replicate? Or will only the modified member replicate?

kindred widget
# ripe osprey Hi everyone, I have a quick question. I have a TArray containing USTRUCTS. If th...

Yes and no. I don't specifically remember if the whole stuct is sent again or just the delta property within the struct.

But as far as the array, only the array's size and the changed entries are sent.

To clarify with a somewhat strange example, say you have an array of 32 entries, and it's currently synced on the client and host. You delete the entire array on the client and have 0 entries. If you then change entry 17 on the host, you will get a replication of only index 17, and the array size. So when the replication happens the array will resize itself back to 32 with all default entries and a correct value in index 17 only. The rest won't be updated until the next time the server replicates as you've only sent the data for index 17 and the array size.

ripe osprey
orchid eagle
#

i just got another idea which is
to make the other levels as separate servers
and the player would teleport to them or join that server from the main map which should be the main server they join from the server screen in the main menu
idk if that makes sense but is that possible

kindred widget
#

ARK: Survival Evolved does this. Each map is a separate server instance on the same machine with a "cluster" name. Each cluster can communicate with each other, I assume via beacons or sockets. But they largely save the character data to a local drive where the server runs and then the player connects to the new host and is set back up via that savegame data.

lament flax
#

but in UE, one loaded map equals one server

#

so to do a system like that you need some third party

kindred widget
#

You do not.

lament flax
#

?

kindred widget
#

I just outlined how to do it. ARK is done in Unreal Engine 4.

lament flax
#

i asked this question a few weeks ago and got this answer

kindred widget
#

Then I'm sorry that someone is not well informed and is answering questions they shouldn't be.

lament flax
kindred widget
#

You are mostly correct. Each server is one map. You need multiple server instances for multiple maps. But they can still communicate with each other via beacons or net sockets

lament flax
#

matchmaking systems like fortnite are proabaly not run on unreal but some API hosted outside of a unreal server

#

but thats intersting

kindred widget
#

If you're C++ capable, I'd check out beacons. I think there are some articles on them around Gears of War... 3? They're basically actors that allow RPCs without a full blown connection. Meaning the player doesn't have to travel to the same map to send and receive RPCs to the server.

orchid eagle
#

thanks for the great info guys i will try to look on that
and if i end stuck i will just go hire a network pro to make it ๐Ÿ˜…

#

one last thing is there a way to show an object or a terrain to only one client or multiple clients but not for all

pure brook
#

Hey does anybody know if there is a specific way to force a "spawn order" of sorts? For example if you have 4 Player Starts, could you have those spawns be used in a specific order. First player to join spawns at this one,second player to join spawns at that one, and so on and so forth.

hoary spear
#

can't wait to use this

kindred widget
# hoary spear can't wait to use this

I did it for Red Solstice to replace some SteamSocket stuff. We have a hotjoin lobby where the player is in the same session but not the same map as the host. But when they're picking stuff, they need feedback about whether they can still join the game with their selections or not. So they need to request data from the server when changing their loadouts. We were using Steamsockets, but I swapped that over to Beacons. Client requests a beacon through the host's session address and on connect binds some delegates and starts making requests.

I think GOW3 or 4 did it for their matchmaking. Basically creating beacons for servers via found session info to find the best place to matchmake a player into.

kindred widget
# pure brook Hey does anybody know if there is a specific way to force a "spawn order" of sor...

Extend your PlayerStart class and add something like a priority integer or something to it.

Then override your game mode places where it finds the correct player start, and instead get a list of your custom ones and sort them via their priority. Maintain an array of the used ones and filter those out too before selection and add the selected one to the array. When you run out of points empty the array so it restarts.

pure brook
#

Cheers mate!

orchid eagle
#

does this mean i still can get the player to another map while still connected to the same server ?

kindred widget
#

AFAIK that will just break your networking if mishandled.

kindred widget
# orchid eagle does this mean i still can get the player to another map while still connected t...

The thing is that you can't really be connected to a server, and have the full replication stuff going without being on the same map. At least if memory serves replication does not work with beacons. Maybe it does and I'm mistaken but from my personal knowledge replication doesn't work through beacons.

ARK does this by having multiple server instances running. You literally have multiple individual processes running on the same machine. Each of these are a session in themselves running on the same IP under different ports. When you join a map, you join a new session. When you travel from map to map, you disconnect from one server and join another.

You largely do the same thing with MMOs just that their systems are much more sophisticated and their game client is set up to mange it better. You exit one area and enter another and you're moved to a different server instance or process. Systems are in place to manage this by keeping your persistent data in their backend servers and to facilitate data transfer from server instances smoothly. ARK does this via SaveGame info. It saves to the server machine, which has other instances of the server running that can access the same data. The player disconnects from one server, and connects to another where that new second server can look up the data for that player from the savegame data and initialize their stuff correctly.

Beacons in this regard allow you to send messages to other servers you're not connected to. ARK doesn't do this but they could make a cluster wide chat for example if they wanted to. But they can use beacons to manage transfers between clusters more smoothly. Request access and mark a spot for a player so that no one joins in the middle of their transfer and steals the spot for instance.

orchid eagle
# kindred widget The thing is that you can't really be connected to a server, and have the full r...

lots of valuable info
i will try to run some test ask here and there and check the docs more and see what i will end up making
but as my game is already gonna be dedicated server based i might do as what ark did
and have the other dimensions as independent servers that would get created based on a player request when he interacts with the portal
and as he wont be there all the day i will see if there would be a way to make it timed by that i mean each dimension portal or lets say the server would run for like 12h then the game would send a request to close the server and i would force the player to teleport back to the main server/map before that happens if he was on that server

i think that wont be the best option but that will work and should be performance friendly as each map would be independent

any thoughts on that?
does that seem like a good idea?

kindred widget
#

Possibly could work. In theory your main hub map could act as a place to fix up the data if say a player logs off in a dimension. It would save their data and if they reconnect, would try to reconnect them back to their dimension session and map. Else it would leave them on the hub where you'd have to get their data saved from the dimension they disconnected from and you'd just fix it up and do whatever they normally do in the hub.

Then you can do whatever with dimension sessions without much hassle I think if you just handle gracefully saving associated player's data with it whenever killing the server so that you can fix them back up on the hub.

Then you just wouldn't really allow sessions from the dimensions to be shown on the server lists. You'd only show your hub servers. Dimensions servers would be managed internally in each hub it's connected do.

#

This said, I don't know what you need to do to spin up a new process, I've never done that one personally. Makes sense in theory though.

orchid eagle
#

yep it kinda makes sense but would need more digging
anyways thanks a lot mate that helped a lot โค๏ธ

woven basin
orchid eagle
#

that is really amazing
it would also work perfectly
the other worlds i can make them to be single player or self hosted
in case the players want to play with friends
i will give it another look and then consider what is the best for the project
thanks buddy HEART

fossil spoke
#

If it cant handle networking the separate worlds independently whats even the point?

crude bronze
#

299.99$ For something I can make in a couple of weeks is insane

fossil spoke
#

$300 for something that LevelStreaming already does?

#

lol

#

I cant see any reason why it would be useful without networking/replication.

woven basin
#

maybe I linked the wrong one

#

there is one that does multiplayer

#

I've seen it around before - let me see if I can find it

#

(no idea if it is actually good or not)

#

eh - my google skills fail me. or maybe it was this one all along.

But I agree with everything you said - I personally wouldnt use it either. I think there's other options. Plus, if your going down that path, it sounds like a complicated project, so there's that to consider for people relative to their skill

nocturne quail
#

why is character jittering if connected to dedicated server?

#
void ATSLCharacterBase::MoveForward(float Value)
{
AddMovementInput(GetActorForwardVector(), Value * WalkSpeed);
}
#

i was thinking my animations are broken, but playing as standalone works fine ๐Ÿคทโ€โ™€๏ธ

#

legs are jittering when start move forward

#

checking these two options fixed the issue

fossil veldt
#

dunno if ur game is the kind of thing where u care about that kinda thing, but just mentioning incase

nocturne quail
#

i have costum cmc in my other project which is specially made for that project

#

will not support this one

fossil veldt
#

You can just use Mover if ur on 5.4

nocturne quail
#

i am on 4.27

fossil veldt
#

ah then rip

nocturne quail
#

๐Ÿ˜„ yeah

fossil veldt
#

are u stuck on 4.27?

#

can't go up to 5 ever?

#

because an alternative to Mover is to just write ur Movement on NPP directly

nocturne quail
#

5 got its own issues which ue4 doesn't have

fossil veldt
#

and that will work in UE4

fossil veldt
nocturne quail
#

performace issues

#

and not supporting UE4 plugins

fossil veldt
#

In which regard? I actually found the opposite, big performance boost going into UE5 (so long as you turn off the new stuff like GI and VSM)

fossil veldt
#

can't you migrate them up to 5 yourself?

nocturne quail
#

it will needs lots of code changing in the plugins and most of them are not open source, they are compiled for ue4

fossil veldt
#

Ah ok fair enough

nocturne quail
#

i will once fully master ue4 and then move to ue5

#

or maybe 6 at that time

fossil veldt
#

UE5 is barely different to UE4 on the GameFramework side of things to be honest

nocturne quail
#

getting them will be easy, since this is all C++

fossil veldt
#

:)

outer sphinx
#

Hello guys, a question, how many clients can the unreal server support? the server that offers the native system?

fossil spoke
#

No body but you can answer that question.

crude salmon
#

i have an issue in my multiplayer project that when the host is running low FPS, important game logic triggered by anim notify events sometimes arent happening. Seemingly due to the event being skipped entirely because of low framerate? This issue has been resolved by replacing my Wait Gameplay Event nodes with simple Delay nodes, but that workaround is pretty undesirable IMO. Does anyone know of a way to make anim notifies more reliable, or a different workaround that isn't as wonky?

woeful jacinth
#

With heavy modification to the ue server most of the times

fossil spoke
#

I dont doubt you can get some pretty high player counts. But I never spoke to that specifically.

fossil spoke
#

Its also largely based on tradeoffs

woeful jacinth
fossil spoke
#

Yeah, which is my point, it really depends on your game.

woeful jacinth
#

Yup, I always recommend people start ground up doing their features for multiplayer and avoiding tick

crude salmon
#

But the Wait Gameplay Event nodes i replaced were all bp

woeful jacinth
#

Multithreading and ASync might be something you should look into if your game is lagging a bit to the point events and such are skipping.

If you're already in cpp, it should not be to difficult to get it setup.

#

Unreal is really good at MT and most multiplayer titles make use of it given the optimization needs for networked games.

crude salmon
#

I guess the issue here would be that because the event im interested in is an anim notify living on the timeline of an anim montage, in low FPS settings that event simply never gets triggered, so why would a separate thread here help?

Or do you think that the issue is that the main gameplay thread is overloaded in a low fps setting and thus isnt receiving the event or something?

woeful jacinth
# crude salmon I guess the issue here would be that because the event im interested in is an an...

1st option: optimize a little and see if you can get it running at a stable FPS on a potato PC, offload some game events and such to runnable threads.

2nd option is to fake it: if you know how long the animation will take to reach the notiff and anim is a separate thread; have a game time check that gets Now()+time from start of anim until the notiff is supposed to occur and do once fire the event if the time is at or over the now()+time

#

And check on your heartbeat

#

Or tick if you do not have heartbeat(highly rec using heartbeat logic)

crude salmon
#

For option 1, the game runs pretty smooth, im just trying to think of more stable code. I imagine even in relatively normal framerate performance situations, the chances of missing an anim notify are not 0, and that doesnt sit well with me.

Option two seems pretty similar to what the Delay node workaround im doing right now, but its incredibly wonky. Having to know all of your animation timing ahead of time in the code just sucks and makes your code a lot less flexible

#

So im hoping theres some other way

woeful jacinth
# crude salmon For option 1, the game runs pretty smooth, im just trying to think of more stabl...

Multiplayer is usually filled with little trucks to get things working. The trick of option two is that you can use it without a delay structure and just a check with world game time.

One option is to also find a way to determine when to run that event independent of the animation, no need to know the timing of the animation but will require a little eyeballing the event sync to get it right

crude salmon
#

I guess there could be a data driven approach here by coupling some sort of animation timing asset with each animation montage, effectively making your own anim notify system. But itโ€™s kind of crazy to me that unreals anim notify would be this unreliable, maybe im missing something?

woeful jacinth
# crude salmon I guess there could be a data driven approach here by coupling some sort of anim...

That's a solution and animation is not my strongest point so I wouldn't know if there's a better solution related to anim tools; animation chat might know!

In an example event I have an animation for multiplayer game that's an attack sword swing; my separate thread looper will be passed an int and data of how many loops it will have count before it starts an event that records box positions and draws a hit pattern in and between the boxes to calculate a hit.

Passing in a 12 means I want the event to fire after .2 seconds into the animation network wise regardless of where the play animation is.

crude salmon
#

And why did you implement it this way, rather than having the timing be driven by an animation asset? Did you run into a similar issue?

woeful jacinth
crude salmon
#

I must sleep now but ill get back to you. Thereโ€™s probably more than one way to have the animation drive events and i should look into it more

woeful jacinth
#

Yes, there is definitely something I'm sure other devs know of or an extension exists since there is no "my way or highway" when it comes to development thankfully

#

Like animation chat has some geniuses in it that have saved my ass

crude salmon
#

Those devils

woeful jacinth
#

I've seen magic pop out of that chat lol

crude salmon
#

Funnily enough that example of multiplayer sword swing and timing collision logic is literally my exact same scenario haha

#

Btw i use DidItHit plugin, is pretty nice

woeful jacinth
#

Nice! I just saw how fromsoft did theirs when they showed some debug gameplay and tried to recreate it a bit

heady python
#

is there a way to lessen the time it takes for NetRelevancy to take effect? Once my actor isnt net relevant for a client it takes 2 or 3 seconds to stop replicating

fossil spoke
#

There is a grace period before it stops replicating, incase it comes back into relevancy within that period. Its so if you as the Player are on the edge of Relevancy Distance for that Actor, it doesnt constantly try to Open/Close its Actor Channel over and over and over again.

#

You do not want to change this behavior.

heady python
#

I shouldnt even shorten the delay? i think its too long for what im trying to do

fossil spoke
heady python
#

hm. well thank you appreciate it

thin stratus
#

@heady python I did change that in a moba game a few months ago. It needs engine changes, yes.

#

There is a global variable you can adjust. I think via ini file. But the lowest you can go is 1 or 1.5 seconds or so. Setting it to 0 breaks stuff, cause there is more going in the background.

heady python
surreal hound
#

Anyone using AWS Gamelift for hosting server?

kindred widget
#

Is anyone aware of a virtual that runs on clients after both the Player's Controller and GameState are valid? Kind of looking for something like the PlayerController's Beginplay, but also something that isn't reliant on ReadyToStartMatch being true. Can make it myself with a couple of events but wondering if there's something native I'm missing.

hoary spear
#

I found nothing

#

Ended up just binding to all things

kindred widget
#

Yeah. :/ Was hopeful, but I just made my own.

kindred widget
#

Is there any reason that a ClientRPC would not run on a listenserver owned playercontroller? O.o

hoary spear
#

They run just fine for me ๐Ÿ˜ฎ

kindred widget
#

Hmm.. This is a bit baffling. Maybe it's somehow too early, but I don't understand how that's the case on the same machine.

Yet when debugging... If I run in Listenserver with 3 instances, 1 server 2 client.
I get three breaks for the ClientRPC call on the server. Once for Controller0 and once for Controller1, once for Controller2.
I get two breaks in the ClientRPC function, which is for the two client controllers.

woven basin
#

try adding the global check as part of the break to confirm which machine is actually been caught

kindred widget
#

I can see which machine it is through their playerstate's player names. Both of the running controllers have a remote role of authority. That doesn't change the fact that it's a reliable client RPC ran on three controllers, with only two calls making it through.

kindred widget
#

Apparently it won't run if ran too soon. I just hacked it up with a timer for next tick and I'm getting 3 breaks in the function now. :/

woven basin
proven robin
#

When passing, let's say, my Playerstate through an Event dispatcher. Can't i access selfmade variables i have made on that PlayerState, where i bind and event to the Event dispatcher?

Update:
Nevermind.... I just need to think, and pass a reference of the right type, and not just the generic PlayerState:D

fossil veldt
#

controllers are constructed predictively and then swapped via a control channel message iirc

#

it's like the only class that does this in the engine, so probably it can't route the RPC

kindred widget
#

Whoops, wrong mention.

#

But no, I was trying it on PostInitComponents. Trying not to rely on beginplay.

fossil veldt
#

PostInitComponents is basically straight after the constructor

#

iirc

#

definitely do GetWorld()->IsPlayWorld() if you do that tho, that function also runs in editor

#

Or infact it might be more appropriate in this case to override OnActorChannelOpened

kindred widget
#

Oh, I overlooked that. That one looks promising. ๐Ÿ˜„

#

Except that it only runs on clients and not the listenserver. Erg.

fossil veldt
#

rip lol

fossil veldt
#

like which?

upbeat basin
#

What would be a good approach to let 2 players control a single character? I want to do something like a player "possessing" another player's character and messing with the possessed player's movement

spiral crystal
#

Does someone know if I have non UPROPERTY members in a replicated USTRUCT if those take space in the transmitted data but with default value or if they are not part of the replicated data at all?

e.g. does it make sense to make a new, smaller struct only containing the replicated UPROPERTY?

fathom aspen
#

no, they take no space as they are not part of the transmitted packet

spiral crystal
#

Ok thanks!

modest crater
#

By default itโ€™s the reflected stuff, you can either mark it as NotReplicated or override the NetSerialize stuff with struct traits

#

To have more control like bit packing

naive rune
#

Hey all. I have a dedicated server set up for a Lyra based game, however, even after setting MaxNetTickRate=60 within of DefaultEngine.ini โ€œ[/Script/OnlineSubsystemUtils.IpNetDriver] based on https://forums.unrealengine.com/t/max-server-and-client-tick-rate-in-defaultengine-ini-cant-be-more-than-30/1228138/10

I am still getting the damn server rate of 30 (sometimes it even dips lower than 30) for server ping, and it's causing noticable gameplay issues on high framerates.

Epic Developer Community Forums

Thanks a lot, i didnโ€™t know about the log thing, it is helping me to solve another issue where the game crashes when compiled on windows but now i know from where the trouble is coming (and i also feel like a hacker ๐Ÿ™‚ ). However, the first โ€œtickโ€ i can find is before the game is opened on a session, it says : Bringing world โ€œbla bla blaโ€ (max ...

#

NetServerMaxTickRate <--- is this what I am missing mayhaps? About to try lol

coral badger
#

did โ€œLanServerMaxTickRate=60โ€ to the ini work? are you testing locally?

naive rune
#

@coral badger not locally, hosted on remote baremetal.

naive rune
#

gonna compile it in and see if it works that way...it should.

spiral crystal
#

If you say it dips lower than 30, maybe your performance is just bad?

naive rune
#

Shouldn't be, it's hosted on a monster, and is pretty well optimized (clients can hit 100+FPS on lower end hardware, like GTX 1080 + ryzen 3500)

#

Netcode is default Lyra, so unless that's trash, should be fine.

coral badger
#

I had a post while back where I had noticeable ping (100+ms) by default whenever I ran literally any UE5 project dedicated or listen mode in standalone. I'm interested in how it goes for you.

naive rune
#

When connecting to a host in a closer region, I ping 50-60 last I tested (can test again in ~30 mins) -- Currently testing against a server hosted farther away (eu vs na) and pinging about 120. Will tag you later when I figure out the tickrate issue, and let you know final pings too (not likely to be too related, but I'll pass on the info anyway!)

coral badger
#

That makes sense at least.

naive rune
#

Yep, pretty standard pings so far from my observation -- just having serious tickrate related issues.

vagrant grail
#

Why does my "Create" button create a session for both players instead of only the one who pressed the create button so I can later join him with the other player window ? I'm in "listen server", 2 players, Standalone Game.

nocturne quail
#
  • |
    GetCharacterMovement()->bUseSeparateBrakingFriction = true;
#

doing this two things fixed the jittering problems everywhere +now animations got very smooth and beauty effects

vagrant grail
thin stratus
#

If you select "ListenServer" and "2 Players" you start the game already connected.

native tapir
#

Is that possible Send UObject Client to Server? (Not Replicated)

If it's not possible, Do I have to convert UObject to UStruct and send RPC?

thin stratus
#

You want to ensure that you use the Play As Standalone (not the same thing as selecting Standalone for the actualy game process).

thin stratus
#

Other forms of UObjects, that are known to both sides upfront and are stabely named, such as any kind of Asset, would work fine.

#

If you need to send runtime ones and you don't want to set up replication, then yes, a Struct is needed.

native tapir
#

I think I misunderstood something

thin stratus
#

But then you are sending a byte array and not a UObject :P so technically I'm still right with what I said before

native tapir
#

Oh, that's right. Thank you I'm now fully understand

visual mountain
#

struggling a little trying to get widget text to update on the client. the server handles the calculation, how would I then pass the info to the client to alter the values of their Widget? between possibly passing it to the pawn, the player state or even the game state and any combination thereof I feel a bit confused.

kindred widget
visual mountain
#

literally nothing more than a number change

round bobcat
kindred widget
# visual mountain literally nothing more than a number change

Generally speaking your number should just be placed into a replicated property. Then you make that property OnRep, which gives you a function that'll run when it changes on the client and that gameplay class has a delegate it sends out which client's local UI can listen to.

That said you can also just make it normally replicated, and tick the widget's display too for quick testing.

kindred widget
round bobcat
#

I already have a widget to show health if that's what you mean by other damage display.

kindred widget
#

Sorry, I just want to clarify, are you trying to update a healthbar or show floating damage numbers?

round bobcat
#

a health bar

#

I already made the function to do it called UpdateHUDHealth in the character class, but the problem is the ReceiveDamage function is not working. I already tried to print a string when I was supposed to take damage, but the string never printed

kindred widget
#

Do you get breaks in the OnHit of the fireball?

round bobcat
#

nothing

#

The OnHit works. I printed the hit actors name in the OnHit and it worked

kindred widget
#

And it makes it down to ApplyDamage through those if statements?

round bobcat
#

Actually I think the OwnerCharacter is null so it doesn't go through the if statement

#

the first one*

#

I initialized the OwnerCharacter again, but it is still null

    ACharacter* OwnerCharacter = Cast<ACharacter>(GetOwner());

    if (OwnerCharacter) {
        AController* OwnerController = OwnerCharacter->Controller;
        if (OwnerController) {
            UGameplayStatics::ApplyDamage(OtherActor, Damage, OwnerController, this, UDamageType::StaticClass());
        }
        else {
            UKismetSystemLibrary::PrintString(this, "OwnerController");
        }
    }
    else {
        OwnerCharacter = Cast<ACharacter>(GetOwner());
        UKismetSystemLibrary::PrintString(this, "OwnerChar");
    }

    Super::OnHit(HitComponent, OtherActor, OtherComp, NormalImpulse, Hit);
    UKismetSystemLibrary::PrintString(this, OtherActor->GetName());
}
languid igloo
#

Do I need to do any port forwarding when using Advanced Sessions on steam? I've gotten to the point where I can "Join Game" via the friends list, but the Join Session node fails.

visual mountain
kindred widget
# visual mountain Ive made the variable on rep notify, though im not sure why i want it to fire wh...

The notify would normally contain a delegate/event dispatcher. You widget would get the thing with the delegate and bind a function to it.

This causes the widget to run it's update when the server replicates that variable to the client.

So in total. The server does stuff, sets that property. Along comes replication and sends it to the client. If the value has changed from what the client has, it'll run the OnRep which causes the delegate to run, which causes the bound widget to update.

hollow bridge
#

When using steam how can I get client remote ip? (from server or from client)

kindred widget
#

Usually you shouldn't need their IP. What are you requiring it for?

hollow bridge
kindred widget
#

That feels strange. Why doesn't it just work through the normal voice chat system like every other platform? O.o

visual mountain
kindred widget
#

No, you can't replicate dispatchers. They're local to the machine. Only the number property needs to be replicated.

hollow bridge
#

"The player IP address is optional, however for the best user experience, we recommend including this data. This is because a server close to a player's location has low network latency during the voice session.

sinful tree
hollow bridge
visual mountain
kindred widget
#

You're running this in blueprint?

#

And what class is the property in? Character, GameState, etc?

visual mountain
#

blueprint class is in game mode

kindred widget
#

That will be part of your issue. You need to move the property to the GameState. GameMode does not exist on clients and therefor cannot replicate anything.

visual mountain
#

so the number variable needing replication needs to be created in the game state?

#

or just pass through it

kindred widget
#

Correct. You can only replicate properties through a replicated actor. The GameMode is not replicated.

#

This is what your stuff in GameState should look like.

#

Then you can bind that in your widget as so.

visual mountain
#

ty ty. im so close

#

thats everything i have just in the wrong spots lol

onyx vessel
#

Helloooo,

I'm currently facing an issue in a multiplayer setup where the server does not recognize the client's character selection. Specifically, the client joins the session after the server/host and selects a character, but the server seems to override or fail to recognize this choice and incorrectly reflects a default or its own selection on the client's character even though I have set the rep notifies on updating the character materials and mesh. This problem persists across sessions and seems to be related to the order in which the server and clients join and initialize.

Has anyone encountered a similar issue or have insights on why the server might not be recognising the client's character choice? Any tips on how to ensure that the server correctly handles and replicates the client's selection when they join after the server?

Thank you in advance for your help!

#

Here you can see the implemented code snippets

sinful tree
# onyx vessel Helloooo, I'm currently facing an issue in a multiplayer setup where the server...

Replication is one way, server to clients, and the game instance only exists on the instance of the game where the code is running (Eg. server has its own game instance, and each client has their own), so grabbing the game instance and setting a rep notify variable would only technically work on the server and not for clients.

If you want your client to tell the server their choices, you'd send a "Run on Server" RPC with those particular choices. When running on the server, you'd then set a replicated variable w/ notify in something that can store that value permanently so you don't have to continually send the RPC from the client. I'd recommend creating a structure that contains both the outfit and the gender so that you don't run into race conditions if you require both parts of these to properly set someone up.

When the character "Begins Play" it can read that PlayerState structure to then set up the visuals on the character.
When the OnRep of the structure happens on the PlayerState, you can have it call to the pawn of the playerstate, and if it is valid, again, set up the visuals on the character.

onyx vessel
#

Ill check this and let you know. THANKS!

crude salmon
visual mountain
#

In multiplayer would you generally put game functions and operations in the game mode or game state?

dark edge
#

I like to use game state to hold state and game mode to modify that state (and others) but it's up to you

visual mountain
#

ive put my games operations in the game mode. im finding im having troubles pulling information from it to pass around

dark edge
#

Gamemode is private to the server only, gamestate is replicated

#

Playerstate* Winner belongs on gamestate

visual mountain
#

yeah so i feel have to move everything from my game mode to game state

dark edge
#

i mean not everything

#

just the stuff that clients need to know about

visual mountain
#

I think I have a solution and understand my mistake. thanks for the responses

woeful jacinth
short arrow
languid igloo
short arrow
#

unless you tried to join multiple times in quick succession

languid igloo
short arrow
languid igloo
short arrow
#

I'm pretty sure it's there for other services like EOS

#

Advanced Sessions is no longer Strictly limited to Steam, so some of functionality doesn't work for / wasn't intended for steam

languid igloo
#

The idea is to support both. Hopefully that won't be too problematic in terms of builds and configs.

short arrow
#

correct, but that means that some things will require additional knowledge and needs to be further implemented yourself

languid igloo
#

I gotta say, I'm surprised I actually needed a third party plugin for this to be anywhere in the vicinity of painless.

short arrow
#

I believe that is the case for Invite Recieved

languid igloo
#

Will be interesting to see if I'll need to dust off visual studio or not. I'm having fun with the visual nature of blueprints.

woven basin
#

Is there a 'best practice' for the local prediction of asset creation to be linked after replication?

i.e. Client throws an item on the floor from inventory. Locally I can show it instantly with a local client actor spawned. Meanwhile Client send RPC to server, server 'actually' creates item on floor, deducts from inventory etc. Server then replicates that new item actor to all clients so they see it.

For the original client, how does it know the new actor been replicated "back" is the one it has already created? Do I need to suggest a 'name' to the server in advance, so that it uses the same stable name, and thus the actor is replication linked in advance to be the same object?

I cant just skip replicating the new actor back to the client because whilst the original client wont have a duplicate, the item on the client wont actually be the replicated linked item?

#

The other option I thought of is I add a prediction key to the actor been spawned locally, and include the key on the Client RPC to server. Then server includes the prediction key in the actor been replicated, So when server replices to all clients, the original client can see "hey, there is a new actor with same key as the local one I have, ok I'll delete local one and just use the server one now"?

quaint roost
#

The server-spawned actor can probably look up the impostor once itโ€™s replicated and destroy it

#

and as a safety set a lifetime on the impostor just in case the real doesnโ€™t get replicated

woven basin
#

if the real doesnt get replicated, i.e. the server decides to not accept the client RPC, it can RPC the client to advise, so the client can destroy the imposter. Although a lifetime backup makes sense as well.

I do know for some things people suggest just do local client for an effect/montage to make it 'feel' instant, and I will do that as well for most things. There are just 1-2 things I need something to basically appear instantly...

#

But surely there is a way with c++ to spawn an actor that is then spawned on the server and "linked"? Something about "stable names"? Which I know is for static assets, but if you passed a name with the RPC, then the server could use that name, so the client knows its the same in advance?

fossil spoke
#

@woven basin From memory, UT would use the position of the Actor as a means to find its "master".

quaint roost
#

I donโ€™t know of anything out of the box. But I think you just need a unique ID that the client sends to the server. gameplay abilityโ€™s prediction key could work IF you use WaitNetSync before spawning on server to guarantee the prediction key is there

#

then when the server spawns the actor, attach the prediction key to it

fossil spoke
#

When a Projectile that was predicted would be spawned via Replication, it would find its predicted representation by find the closest in location to it.

#

Alternatively, you can just generate a GUID, which the Client sends to the Server, that the Server then applies to the replicated Actor

#

So when its replicated, it can link to the predicted representation

woven basin
fossil spoke
#

Might have been first iteration ๐Ÿคท

#

UT was never finished

#

Its also very old

#

lol

woven basin
#

I'll go look how it does that, cause I could swap out that check for location to just use a GUID there as 'the check' instead

#

thanks

molten matrix
#

I'm probably missing something stupid. I have capsule component set up for collision. So I've bound OnComponentBeginOverlap for that component.

When my player character begins overlapping, OnComponentBeginOverlap is called on both the server and my client.

When my AI character (same class) begins overlapping, OnComponentBeginOverlap is only called on the client. Not on the server.

Any idea what I'm missing?

quaint roost
molten matrix
#

Yeah

kindred widget
#

Where was the binding done?

molten matrix
#

Binding was done in the C++ constructor

vagrant grail
willow cargo
#

In my game state I have an array of references to 'BP Team Managers' this array is set to replicated
Each Team manager itself is also set to replicated
When one or more teams already exist on the server, and a new client joins the team managers are replicated to them, but the list in game state has empty references

In the team manager begin play (when local) I did add a temp solution of 'delay -> add to list if not in there' but I'd rather have a more permanent fix.

All done in blueprints

sinful tree
willow cargo
vagrant grail
#

For some reason, the engine keeps opening the main menu level even when I selected my game level in the editor ๐Ÿค” why is that ?

vagrant grail
#

Now I need to know how to make my player connect to the host without having to set up a full sever browser system. I just want to type 127.0.0.1 in the IP box then use that to connect. But I can't find anything related to IP in "Join Session Advanced" node to do that ๐Ÿค”

#

Got it ๐Ÿ‘

sinful tree
# vagrant grail Now I need to know how to make my player connect to the host without having to s...

Sessions are supposed to take care of that. You don't want players to have to use IP addresses anymore as that usually also means you'd need to have server hosts configure their network to port forward properly, or for players to even know what their external IP address is, which most won't.

One solution would be to use a "Room ID" system which you generate a room ID to insert into the session data when you create the session. A joining player can input the ID and clicks join, which then you'd use the same search for sessions but then filters the session list returned based on that ID, and joins the session with the matching room ID.

vagrant grail
sinful tree
#

What I just explained shouldn't require a sever list.
I'm guessing you're using Steam, in which case, if you're using the test app ID, then it should be no more difficult than having the first instance create the session and start as a listen server, and having the "client" search for all sessions and just join the first one it finds.

kindred widget
#

If testing on the same machine, open 127.0.0.1

vagrant grail
vagrant grail
sinful tree
vagrant grail
sinful tree
#

If what you're wanting to do is join a session, you need some way to trigger the logic to join a session. It doesn't have to be on the main menu, but you'd need the logic to join the session somewhere.
Here's an example, the top part is starting the test session and launching a listen server, the bottom is joining that test session. How I decide to trigger these can be a button press on the player controller or a button on a widget that I add to the screen, it can literally be any event you want.

If you're testing locally, then using the "open 127.0.0.1" console command is probably easier, but it's not really "joining the session" the same way as what a client would likely do in a launched game, so it may not be an accurate test for what you're trying to troubleshoot.

vagrant grail
#

I keep getting an error in my PC_MainMenu saying that my widget is "None" so it can't add it to the viewport but the widget is shown without any problem so I'm kinda confused ๐Ÿค”

sinful tree
vagrant grail
sinful tree
#

Seeing as this is your "Main Menu" controller, you probably shouldn't be launching as clients as that means the dedicated server in the background will also be launching on your "main menu" level.
Launch as standalone. Have one of your windows start the session/listen server, then have the other join it.

#

If for some reason you still want to launch a dedicated server (Play as client), then you shouldn't be creating widgets on it to prevent the errors, which means not using the Begin Play of the player controller to create the widgets without some checks to ensure the dedicated server isn't creating them.

chilly haven
#

Hi,
How worthwhile is it to make linux dedicated servers these days? How's the performance and hosting cost comparison?
Thx

thin stratus
unique kelp
#

Is it safe to send an RPC with a TSubclassOf that points to an asset in the project?

#

The client is sometimes receiving nullptr and I am never sending an invalid class