#multiplayer

1 messages · Page 35 of 1

thin stratus
#

Generally speaking, there is no interpolation for simple actors and you obviously don't want to make them Characters.

real ridge
#

ah okay I thought its somewhere default in engine that I can just tick box and its replicated and I dont care more

thin stratus
#

You can tick ReplicatesMovement

#

But again, that will just set the transform to the latest one replicated

#

If the time between two updates is "high", it will teleport

#

And the local client pushing the box will also have to wait for the Server to tell it that it moved

#

Won't feel nice

#

For the Plane stuff, I'm not sure how one would do that. I assume a Character can be used.
I also saw a MovementComponent on the Marketplace that allows for more custom shapes and BP extensions

#

But that plugin is 300+€ iirc

#

(which is totally worth the price, cause coding that yourself takes weeks and months I would say)

real ridge
#

yea I am just coding session and eos stuff

#

and its like 6 months

#

XD ah

upbeat elm
#

So, after this talk I have started making the function how I'd actually want to do it. The issue came back, dunno why or what I am doing wrong.

https://blueprintue.com/blueprint/1ifoebvo/

(For anyone else reading this, issue is that when executed as ListenServer, the client with authority possesses their pawn, but can not move. The other clients can. Adding a default pawn to the gamemode does fix this, but I'd rather not)

#

If I spawn and posses right away, before doing anything else, it works. Exact same inputs.
But since I might set different pawns etc depending on what team u are assigned to, it would save me having to possess twice if I can find a solution to this.

timid moat
#

Hi!

shy radish
#

Hey Fellas, does anyone have any tips on how to debug for multiplayer code?

To be more specific I've been stuck on an issue that I don't quite understand with firing a weapon. I've used RPC calls, made sure the weapon was spawning correctly, and even logged it to see maybe I could find the issue there, which shows that its supposedly working correctly (that being: if has no Auth run ServerBeginFire method)... But the result is always the same, Server sees all clients actions besides for some reason client 3, and clients only see actions they perform themselves but don't see server's or any other client's actions.

Anyone know how I can debug this and get to the root of the problem?
Thanks for the help!

timid moat
#

I'm testing a game with Unreal editor. I have two players, both running as Standalone. If I use OpenLevel with the parameter ?listen from one of them, am I creating a listen server or a dedicated server? I'm asking because the caption of window for the player still says "Standalone".

#

Thanks!

agile loom
shy radish
agile loom
agile loom
shy radish
#

what is a session?

agile loom
shy radish
timid moat
shy radish
# agile loom And set to replicate?

Ahh my bad thought you were telling me to create the session... yes SetReplicates() is set to true on both the Character and the WeaponBase class

shy radish
#

yes

agile loom
agile loom
shy radish
#

not on constructor?

agile loom
thin stratus
#

Eh

agile loom
thin stratus
#

This sounds a lot like you are performing a ServerRPC

#

And you don't have the Client actually own the Weapon

#

But maybe also replicates fwiw

#

Make sure you pass in a proper owner when spawning the Weapon on the Server

agile loom
#

Yes, maybe you spawn the weapon on the client

thin stratus
#

so you can actually utilize RPCs that target or require owning clients.

shy radish
#

I am, in the Character for the CurrentWeapon I am doing OnRepUsing to a method that sets the owning pawn and the instigator and all that good stuff

thin stratus
#

You do that when spawning

#

In the SpawnActor method

#

As Owner

#

And nothing else :D

shy radish
#

that too

thin stratus
#

Cause all the other stuff doesn't matter for RPCs

#

The Owner has to be set on ServerSide when spawning the REPLICATED WeaponActor

#

Then you are good to use RPCs in it from ClientSide

shy radish
thin stratus
#

Alright. Might be worth using the Controller of the Character for Owner instead

#

But it should chain upwards anyway when trying to check for the net connection

thin stratus
thin stratus
#

Can you share more than just 2 lines ofcode :D

#

Also don't do screenshots fwiw

shy radish
#

my bad XD one sec...

thin stratus
#

```c
Your Code
```

#

I would place the SpawnWeapon call into OnPossess or whatever that event was called.
That calls Server only anyway and guarantees that the Character has a proper Controller.
Then change the Owner to the Controller instead of this.

Not sure why you have ServerSpawnWeapon. That looks wrong.

shy radish
#

Character CPP

void ABaseCharacter::BeginPlay()
{
    Super::BeginPlay();

    if(HasAuthority())
    {
        SpawnWeapon();
    }
    else
    {
        ServerSpawnWeapon();
    }
}

void ABaseCharacter::SpawnWeapon()
{
    // Set Spawn Params
    FActorSpawnParameters SpawnParameters;
    SpawnParameters.Instigator = this;
    SpawnParameters.Owner = this;
    SpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;

    // Spawn Weapon Actor
    CurrentWeapon = GetWorld()->SpawnActor<AWeaponBase>(WeaponClass, SpawnParameters);
    OnRep_CurrentWeapon();
}

void ABaseCharacter::ServerSpawnWeapon_Implementation()
{
    SpawnWeapon();
}

void ABaseCharacter::OnRep_CurrentWeapon()
{
    CheckValid(CurrentWeapon, "Failed to Validate CurrentWeapon") // This is just a macro wrapper for null checks and log
    CurrentWeapon->SetOwningPawn(this);
    CurrentWeapon->AttachWeaponMeshToPawn();
}

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

    DOREPLIFETIME(ABaseCharacter, CurrentWeapon);
}

Character Header

    UPROPERTY(Transient, ReplicatedUsing = OnRep_CurrentWeapon)
    AWeaponBase* CurrentWeapon;
    
        void SpawnWeapon();

    UFUNCTION(NetMulticast, Reliable)
    void ServerSpawnWeapon();

    UFUNCTION() void OnRep_CurrentWeapon();
thin stratus
#
void ABaseCharacter::BeginPlay()
{
    Super::BeginPlay();

    if(HasAuthority())
    {
        SpawnWeapon();
    }
    else
    {
        ServerSpawnWeapon();
    }
}

That's wrong

#
  1. The Server RPC won't call on BeginPlay, cause the Character is usually not possessed at that Point.
  2. Why even the RPC? The SpawnWeapon call limited to HasAuthority is totally enough.
#

Rest looks fine. One could argue that the SetOwningPawn is redundant if you make that variable replicated, but this works fine too.

#

Or rather if you just use Instigator for that, but w/e

#

I would swap BeginPlay for the OnPossessed event though

#

And drop the ServerRPC

#

PossessedBy might be the function

#

(name-wise)

shy radish
#

So then I move the server RPC to OnPossesed?

thin stratus
#

No

#

You get rid of that thing

#

You only need

void ABaseCharacter::PossessedBy(AController* NewController)
{
  Super::PossessedBy(NewController);

  if (IsValid(NewController))
  {
    SpawnWeapon();
  }
}
#

And change SpawnParameters.Owner = this; to SpawnParameters.Owner = GetController();

shy radish
#

got it

#

thank you so much for the help! I will go ahead and try this out

thin stratus
#

Also

#

Your ServerSpawnWeapon is a reliable Multicast

#

That is a thing that only the Server can call

#

Calling that outside of Authority makes even less sense

shy radish
#

I see

thin stratus
#

And the function is mislabled cause of that, cause you would only prefix a ServerRPC with "Server". A NetMulticast would have "Multicast" in front of it

shy radish
#

got it will do so from now on!

shy radish
timid moat
#

Hi!
This the first time I try to develop multiplayer games.
Do you know any good resources which talk about what are sessions in Unreal?

I only find tutorials about how to implement them. I want to know which is a session, when to use, how it works...

I'm asking because I don't know if it is mandatory to have a Online Session System on all multiplayer's games.

I have found that there are different types of session systems:

  1. Online Subsystem Null.
  2. Steam
  3. Epic

But I don't understand the differences between them because I don't know what sessions are.

Thanks!

bitter oriole
#

Short version

#

There'll be one too on PS4/5, etc

timid moat
kindred widget
#

A Session is just connection information.

bitter oriole
#

Sessions are literally just that - a way to say who's playing with who

#

(responding to the deleted message there)

#

They're handled by your platform

#

You then use the session to connect to a server

timid moat
#

Is it mandatory to have a session in all multiplayer's games?

kindred widget
#

A session itself is just connection information. Meaning that it's what subsystems use to connect a user to a host. A host has to create a session and the subsystems handle passing that data to searching clients, who can use the session info to connect to the host who has created that session.

#

How it actually works to connect is largely irrelevant to most people who aren't working for Epic, Steam, Google, etc as from a game developer standpoint, it's largely platform agnostic. The subsystems and sessions are designed to not really care what platform they're being ran on so that it's easier to port a game from one platform or another with nearly no changes for the developers.

#

So, to answer the direct question, yes your host has to have a session, and clients will use that session info to connect to the host.

#

While not actually multiplayer relevant. Some platforms use sessions to track playtime as well, even offline. The new Lyra stuff for instance actually creates offline sessions to do their level opening for single player stuff like the little bomb game.

timid moat
#

@kindred widget, thanks a lot

thin stratus
#

I do want to note that sessions are actually not needed for a host to host and a client to connect.

#

But if you don't have a session to communicate the information, you'll need the IP of the host and the host will need to open the server port.

#

(Port stuff is not 100% session related but part of what a subsystem provides you with called NAT punchthrough)

torpid girder
#

hello, i need a little help figuring out the process, i want a player to select a character while spectating, once they have selected a character they are now allowed to spawn, the game mode needs a way of getting the select character, i have unique keys so i just need to replicate this key somewhere from the client and validated it on the server. i assume I can't use the player controller between spectating and spawning, so where to store this key

#

maybe the player state?

#

A PlayerState is created for every player on a server (or in a standalone game). PlayerStates are replicated to all clients, and contain network game relevant information about the player, such as playername, score, etc. - ok so i don't want to do that,

thin stratus
#

And when the Player wants to respawn you call "RestartPlayer" on the PlayerController.

#

Also on the Server.

#

And in the GameMode you can override GetDefaultPawnClassForPlayer (or something along that line), and cast the Controller that is the Input of that function to get the Class the player selected.

#

That's more or less the most Unreal Engine way of doing it.

torpid girder
#

oh i am mad, i thought there was a spectator player controller 🙂

latent heart
#

You could also override restartplayer, which is the function that actaully spawns their pawn

torpid girder
#

first off i need to launch a player in spectator mode

torpid girder
#

how do i stop RestartPlayer being called in the game mode? is that called from the player controller?

#

i think i need to manipulate player state

agile loom
viscid tapir
#

how to get the character reference we just killed ? it's for a function purpose

#

btw is it useless to "Switch has authority" in the gamemode ? it should answer in the affirmative

torpid girder
#

i think an easier way is PlayerState->bOnlySpectator = true;

viscid tapir
#

i see but the player has 2 lifes

#

so he can respawn if it is the first time he gets killed

dusky yarrow
gray orchid
#

So im having this problem where a UI is created and them I want to delete it after an event but no matter what I do it wont go away but it works on the server's screen would anyone know how to fix it?

fathom aspen
#

I can smell a GetPlayerController(0) from one message away

#

To make it easier for us to help you, better for you to share code

gray orchid
#

sorry here you go

gray orchid
#

?

fathom aspen
#

This is not a node you want to use in MP, and looks like this code is being run on server

#

But considering the code is cropped I will keep guessing

#

Send full screenshot

#

Make it easier for us to help, not to keep guessing

gray orchid
#

sorry

#

the respawn timer is the event from the first screenshot

fathom aspen
#

So you are firing a server RPC just to fire a client RPC back

#

That's nonsensical

#

And I have no idea where that server RPC is called from

#

But anyways let me make the pipeline easier for you so you implement it yourself

gray orchid
#

the accual event its self works fine the widget just wont go away

fathom aspen
#

You want to remove a widget from player's screen? Widgets should be managed by HUD. HUD exists at the local controller level pretty much like Widgets do. If you're on server by the time that happens then all you need really is to either client RPC or waiit for an OnRep to be called then to access HUD then to access the widget and remove it

gray orchid
#

so have the RPC in the main player hud and call it from there?

fathom aspen
#

If you're doing it on an event that is called on both server and client, like BeginPlay, then you want to use IsLocallyControlled to make sure you're at the local controller level

fathom aspen
#

So it won't fire RPCs

#

Great time to check multiplayer compendium in pinned messages

#

It will also tell you not to use GetPlayerXXX(0) nodes as they are not for multiplayer

#

There are always other ways to get what you want

#

For example you are in Character class and you want to get PlayerController? Use GetController

#

You are in Controller and want to get Character? Use GetControlledPawn

gray orchid
#

did you make the compendium your self?

fathom aspen
fathom aspen
#

I did another compendium that's not relevant to your issue

gray orchid
#

there one with your name and PFP on it

fathom aspen
#

It's also in pinned messages

gray orchid
#

oh ok

fathom aspen
gray orchid
#

im just using it so the widget goes away after a count down I had it use floats but I guess I changed it at some point

fathom aspen
#

Read that compendium and what I said and reiterate when you're ready to go. The newer code will look 99% different

gray orchid
#

thank you

devout dagger
#

the OnRep functions can is inside a RPC?

fathom aspen
#

They can be called manually wherever you want, but usually you do so when it's a cpp OnRep and you're on server, and you want the server to get the OnRep effect

devout dagger
fathom aspen
#

There is nothing incorrect about it if that's what you need.

devout dagger
#

thank you for your answer

shadow marten
#

Is there a reason to why the server on the left sees the client on the right rotate however when the server rotates it does not show which is what I want to do the same with the the client.

How am I able to fix this?

ember vine
#

how can i reconnect to my dedi when in standalone ? i thought itd be like open 127.0.0.1 but doesnt seem to work

latent heart
#

Standalone testing mode or standalone netmode?

ember vine
#

uhh, like in editor you select the dropdown from viewport into standalone game, with netmode client and it spawns a dedi aswell

latent heart
#

It might not be running on the default port

fathom aspen
ember vine
#

ohh of course, im so dumb i've literally used this in other UE multi games before LUL

#

reconnect doesnt work if my client boots up first though 😦

thin stratus
#

That's more or less it

#

Doesn't have any smoothing/interpolation, but should work

proven fog
#

How do I get a PlayerController to call a method on every machine's instance of the Controller's Character?

dark edge
#

What event triggers the timeline?

whole iron
#

i just got my first (successfully rigged) model to work in UE5. I want the game to be first person multiplayer but im wondering how I get the player to not see their player model and see other players models (and have the client player see their hands like how Apex Legends, CSGO, Team Fortress 2, and other games "overlay" the characters hands and weapons and hide their actual model [so when they look down there isn't feet])

Anyone have any advice, resources, or general ideas on how to do this?

tranquil yoke
#

Anyone knows how to make Actor do the networking via GameNetDriver + BeaconNetDriver exactly at the same time ?

tranquil yoke
#

how does ActorChannel is linked with Actor reference, I cant find where Channel sends the information to Actor ?

oak oracle
#

Hi Devs,
virtual void PostLogin(APlayerController* NewPlayer) override;
On LAN game PostLogin doesn't get called on hosted player ,any ideas how to solve this issue ? i want to get the Pawn of Hosted player

agile loom
#

Server should call the multicast

vivid prawn
#

is the anyway i can run the game as server with command line?

#

like for launching the game, I use
start "" "../UnrealEditor.exe" "../myproject.uproject" -log

#

how about if i want to run it as server (headless)?

agile loom
vivid prawn
#

yup

#

looking at all .exe files, not sure what are UnrealMultiUserServer.exe and UnrealMultiUserSlateServer.exe

#

or UnrealTraceServer.exe?

#

or should i spend 2 hours building the engine from source with Deployment Server tag

thin stratus
#

MultiUser is probably that thing where multiple people can work in the same project live or so

#

But exe files aren't bat files

vivid prawn
#

yeah, i'm making the bat file by addressing the .exe file and .uproject

thin stratus
#

-server -game should start a headless editor based server

vivid prawn
#

nice thanks 🙏🏽

thin stratus
#

I found something cool

prisma snow
thin stratus
#

Yeah we don't have that in UE

#

Partially cause we don't have P2P connections

#

But it's probably still good to learn about it

prisma snow
#

so resimulating can be super tricky

bitter oriole
#

You can do rollback code, you just have to be smart about it and expect differences. For example for movement, rollback to the server state and replay your moves, compute the new expected transform, and then don't apply the reconstructed state but compute the delta between where you were and where you should have been. Simply apply that delta smoothly on tick over a period that would be, say, half the average server update period.

thin stratus
#

Isn't that dragon ball z game in UE?

#

I assume they implemented it if it's such a standard for those 2D/2.5D fighting games

chrome bay
#

You can also separate your actual "simulation" too for fixed times

prisma snow
#

(but he doesn't do rollback)

chrome bay
#

Deserts of Kharak showcased something similar in a talk too, for similar reasons (RTS)

prisma snow
#

That was Unity right?

#

I saw that talk

chrome bay
#

yeah

prisma snow
#

Basically anything that needs lockstep

chrome bay
#

pretty much

prisma snow
#

FrostGiant are doing the same

#

but they are going for rollback I think, which would be a first in RTS

chrome bay
#

to be honest, I imagine most lockstep engines are the same. It's practically imposible to make a compltely deterministic engine I imagine

#

way too many variables

prisma snow
#

Dunno how Spring does it

timid moat
#

Hi!

#

Do you know a good tutorial about how to work with sessions (OnlineSubsystemNull) with C++?

#

Thanks!

bitter oriole
grizzled stirrup
#

Spelunky 2 has a rollback implementation AFAIK, very interesting to see how they managed to handle the physics and such so well over the network

#

A bit of a shame that not many people seem to be playing the multiplayer as it clearly took a lot of work to achieve

trim plume
#

Hi. How can I do Set Velocity on a character with multicast? It seems to only be setting on client only, and won't allow to be set when triggered from server or multicast.

torpid girder
#

i've managed to spawn in to the world in spectator mode, now i want to spawn a playable character, so i've called PlayerState->SetIsSpectator(false); on the player controller, but i think i need to call something else to get the game mode to take over

timid moat
fathom aspen
fathom aspen
fathom aspen
prisma snow
fathom aspen
#

Yeah they must have put some ridiculous time making/writing it 😄

prisma snow
trim plume
fathom aspen
trim plume
#

I can set it perfectly in any custom event or where ever, but not in server or multicast events.

fathom aspen
#

You need to call UpdateComponentVelocity after you set velocity

#

Which is cpp only

sinful tree
#

You can however apply a force or or an impulse to the character in a certain direction to have them move.

deep fable
#

Hello ) Im not sure if its right topic but have question

#

Im looking for some software that can emulate high ping

#

like i want to test my game at ping 50 and 100 for example

agile loom
agile loom
agile loom
#

Or even using negative numbers to travel in time

thin stratus
#

That's why they failed. They didn't have that ini file.

dusty mural
#

Hi All, Been investigating Dedicated Servers lately and think that I recall somewhere that Unreal Dedicated Servers can be connected in a cluster to allow for ultra high user scaling. Does anyone have any information on this that might be helpful? Thanks

prisma snow
bitter oriole
#

Get it, cut whatever you don't need if it makes you feel nice

#

Just don't expect a tutorial on how to create that plugin again

young sphinx
#

Hi guys, as I know level streaming doesn't work with multiplayer, what about new HLODs?

bitter oriole
#

Level streaming does work in MP, it's just that the server loads sublevels for everyone

young sphinx
#

ye, so lest say I wanna make 2km*2km level for MP I have to make it single level with proprietary culling systems, right?

#

so server will hold loaded base level and spawn/despawn actors depending on clients location

fathom aspen
#

Right, which World Partition already does

young sphinx
#

doesn't it require changing source code?

fathom aspen
#

It doesn't for players that are not listen-servers. It just that listen-server player will load all tiles

#

So if you want listen-server not to, then yes you want to mess with the source code

young sphinx
#

okay, thank you peepoheart

valid imp
#

What is the difference between distance-based grid spatialization with the replication graph and the basic actor net relevancy?
Aren't they both about not replicating actors that are too far from the player?

fiery wadi
#

Hi, This is probably a silly question I have just started to dip my toes in Multiplayer, When you launch say 3 Standalones and use Create Session nodes in one of them, Should that session be visible to all others if they use Find Session Nodes from inside a standalone game ?

#

So Player 1 hosts the Game and then Player 2/3 join the session from a standalone game to enter into a multiplayer scenario?

dark edge
#

over the internet you'll want some sort of subsystem

fiery wadi
#

Yes I read that if i want Internet play i need to use a Subsystem like Steam, Epic etc.

#

but i cant see why i get 0 results from a hosted game from this code?

#

Player 1 enters the lobby map fine as if to say "Hi im waiting for moer players"

#

but the player 2 cant find the session

#

I just realised the Find Sessions Node says "0 sessions found" coming off the OnFailure (Will OnFailure) fail if theres 0 sessions?

glossy drift
#

Then on play I get the Server print, but I am also expecting a "Client: IsmComponentMain_0" that doesn't show up. I am running a 2 person listen server.

worn wagon
#

What's the replicated yaw value used by the animation blueprint on a skeletal mesh in the Character class? The values I keep using are always slightly delayed compared to the visual rotation of the skeletal mesh, I have tried:

Character->GetControlRotation()
Character->GetBaseAimRotation()
Character->GetViewRotation()
Character->GetActorRotation()
Character->GetReplicatedMovement().Rotation

GetControlRotation, GetViewRotation, & GetActorRotation are accurate for the host, but none of them are accurate for the client. GetControlRotation for example doesn't work at all for the client.

#

To give some more context, I'm creating a turn in place animation where the leg rotation is effectively cancelled out but the upper body continues to rotate, so I need the exact value that is used by the skeletal mesh, otherwise the feet are constantly lagging behind a few frames.

#

Okay solved, Character->GetMesh()->GetComponentRotation()

#

Guess it makes sense to get the skeletal mesh component rotation directly

pallid mesa
#

there are a couple of CVARs you can activate to enable experimental server streaming in world partition

#

Take a look at WorldPartition.cpp and WorldPartitionStreamingPolicy.cpp

#

In fact the server streaming setup works for both, listen and dedicated servers

#

However have in mind its experimental, so there might be vulnerabilities (I'm 100% sure there's one)

fathom aspen
# pallid mesa <@736483148988284989> This is wrong in 5.1

Yeah I forgot to mention that article (and tbh it's clear) that it was written way before 5.1 was a thing, so I counted on them to check the latest released code (considering they are going to mess with it) how it behaves 😄

dusky yarrow
#

that's a nice to not admit you're were wrong (jk)

fathom aspen
#

I can always be, and I'm really down for peeps to correct me, at least that's how I learn 😄

#

But I vaguely remembered it was fixed in 5.1: #multiplayer message
But I didn't have time to edit/add to that message

pallid mesa
#

oh look its me

fathom aspen
#

Soon I won't have time to show in the discord Sadgebusiness

pallid mesa
#

hello mum im on the tv!

#

Nah it's okay, you are answering loads of questions all the time... you might have missed it, its okay. But understand that if I read some outdated info I will have ti address it hahaha

fathom aspen
pallid mesa
#

Laura, dont kill us

thin stratus
pallid mesa
#

come on, go and kill #cpp 🙈

#

eXi!!!!!!!!!!

fathom aspen
#

You're known as a killer in your free time (a bug killer)

thin stratus
#

s/he -> they

pallid mesa
#

lmao, evil Laura

thin stratus
#

I mean, I had to ban someone who was repeatedly calling us all lazy for not answering literally all questions.

fathom aspen
#

I saw that 🙋‍♂️ , and you handled it pretty intelligently. Respect!

#

But again was it worth to get blocked for being helpful? aPES_Sob

thin stratus
#

My vacation ends on Monday and I have to get back into competitive multiplayer coding.
I think somewhere along the way my joy for mp died.

pallid mesa
fathom aspen
pallid mesa
#

shush

thin stratus
#

Why not both

#

Honestly already too late lol

#

Fucking gaming industry

pallid mesa
#

😅

thin stratus
#

Right, where was I

pallid mesa
#

right banning Wizard I think

thin stratus
#

/strike Laura Offtopic in multiplayer

pallid mesa
#

hahahaha

fathom aspen
prisma snow
#

it would seem that we spread lounge across all programming channels

thin stratus
#

It just the idle time until the next question

prisma snow
#

guys how do I multiplayer

pallid mesa
#

elevator music plays

#

so... I want to make a mmo in Unreal...

thin stratus
#

GetAllActorsOfClass<AShard>

fathom aspen
prisma snow
thin stratus
#

I'm sorry for not drawing you a freaking node

#

Denied cause entitled moderator

fathom aspen
#

Soon I will get over that one, so it'll stay unread forever patrick_hehe

pallid mesa
#

you just said you will not pass by very often Wiz

fathom aspen
#

Hmm odd, shift+esc is just ~ for me

#

I think I'm too not discord to understand

#

Ah maybe because I'm on a 60% keyboard?

prisma snow
pallid mesa
#

wait, your keyboard is a progress bar?

fathom aspen
#

Ok I'm sure that feature is useless, so I don't care

prisma snow
#

mine is 100% and very heavy

prisma snow
pallid mesa
#

good night ~

fathom aspen
thin stratus
fathom aspen
#

Yeah it's gone wild

prisma snow
#

couldn't resist the sales

fathom aspen
#

I adore black fridays tbh, but they make me bankrupt

prisma snow
#

we should make raids to other channels

prisma snow
thin stratus
#

How can it be that for like 20+ minutes, no one had an actual multiplayer problem/question

fathom aspen
thin stratus
#

Can we archive already?

fathom aspen
thin stratus
#

For the poor souls who think web is a platform to dev on

fathom aspen
prisma snow
prisma snow
dusky yarrow
fathom aspen
prisma snow
thin stratus
#

Imagine actually going into channels with questions and answering them

thin stratus
#

I have not noticed

thin stratus
#

The trick is to make everyone believe that you are so busy that you can't answer atm.

dusky yarrow
#

i wish i would get paid for helping people

thin stratus
#

Well let's limit it to answering questions on discord for free

fathom aspen
thin stratus
#

Just do tutoring. Actually the more fun part of my job. And peeps are super thankful (even though you are getting paid and it would be weird if you then don't actually help...)

fathom aspen
#

That's part of the long-term plan, wizardcell.com should be updated at some point 🙏

thin stratus
#

Almost 30 min without a proper question

#

Think I just quit and go to bed...

dusky yarrow
#

it should have ads at every corner of it

#

@whole grove how are you so consistly active btw? dont you like sleep or something?

fathom aspen
#

She must have got some dragonHell powers, I'm sure

thin stratus
#

I would love for Discord to show timezones on profiles

#

Why the f do I get pinged in #umg...

fathom aspen
#

She is dragonHelllllll 🐲

prisma snow
thin stratus
#

There are also a lot of peeps that have a hard time learning on their own.
Especially with how shitty tutorials and docs are for UE.

prisma snow
thin stratus
#

Some of them struggle for weeks and have everything cleared up after a single hour of personal help.

fathom aspen
dusky yarrow
prisma snow
thin stratus
#

Even if docs would be good and tuts would be better, some peeps just can't learn with that. They need someone they can bombard with questions. And they need handholding at the start.
I usually let the person choose how the session will be.

#

I'm not sure how much demand there is for tutors tbh. We are only advertising it as one of many things. But I could imagine that there are a lot of peeps who would pay for a few hours to learn.

#

I mean I know that I will get a teacher for Japanese once I learned the damn signs.

thin stratus
#

You need to learn the Editor, the Coding Language, the Framework, the Bugs...

prisma snow
#

And each person learns very differently and in different ways

dusky yarrow
#

i learned english by just talking with people. i sucked and looked stupid at first but i got better over time

#

the key to learn something is to not worry about making yourself look stupid

thin stratus
#

Yeah doing that. Signs just take a while. I've been through the Hiragana ones and currently learn the Katakana ones.

#

Yeah, but learning English vs Japanese, depending on your native language, is a huge diff

#

Yes.

#

shi, tsu, n and so.. I think.

#

something something

#

MY GOODNESS

#

It's not like they could have chosen signs that are easier to tell apart

#

eoaöüö

#

Like that

fathom aspen
#

🈲 ㊙️ ㊗️ (it means you're free to ask)

thin stratus
#

My wife is currently learning Korean

#

Started taking lessons last week

#

What I saw there made me like Japanese again

#

Someone new is typing. Finally a question?

#

I scared them away

#

Don't you dare letting us down with just engaging the already offtopic discussion

fathom aspen
#

I can tell if that is a question, it has to do something with movement

thin stratus
#

Was boring.

young kestrel
#

Is there someone that actually knows how to use FCharacterNetworkMoveData?
I have no clue how to use it correctly and the documentation is not helpful at all.

fathom aspen
#

Cedric it must be you, I'm too CMCless to answer it aPES_Sob

thin stratus
#

Too complex. I'm out.

#

Well, let's see.

thin stratus
#

The Flags are the older system basically. Where you had 4 or so custom flags

#

Let me have a quick look at the CMC

#

Yeah so

#

The CMC has two modes atm iirc

#

With and without the packed data

#

Without the packed data it would just send the MoveFlags along

#

With the PackedData they are send via void UCharacterMovementComponent::ServerMovePacked_ServerReceive(const FCharacterServerMovePackedBits& PackedBits)

#

Where it ultimately calls

#

void UCharacterMovementComponent::ServerMove_HandleMoveData(const FCharacterNetworkMoveDataContainer& MoveDataContainer)

#

And then void UCharacterMovementComponent::ServerMove_PerformMovement(const FCharacterNetworkMoveData& MoveData)

#

Pulling out the flags const uint8 ClientMoveFlags = MoveData.CompressedMoveFlags;

#

After that it just calls MoveAutonomous again like usual

#
    /**
     * Handle movement data after it's unpacked from the ServerMovePacked_ServerReceive() call.
     * Default implementation passes through to ServerMove_PerformMovement(), which may be called twice in the case of a "dual move", and one additional time for an "old important move".
     */
    virtual void ServerMove_HandleMoveData(const FCharacterNetworkMoveDataContainer& MoveDataContainer);
#

If you have custom Move data, you usually override this function

#

or wait, one sec before i mix that up

#

Yeah, that's called right after the struct got serialized

#

Here you should be able to set whatever values you need

#

You can also override the PerformMovement one

#

Depends on what you want to do

#

Means you can do what yo uare doing in your UpdateFromCompressedFlags

#

In that HandleMoveData function instead

#

At least the MoveData-> parts

#

Preferably before calling Super :P

young kestrel
#

Means I would need to override "ServerMovePacked_ServerReceive" and "ServerMove_HandleMoveData" as well, if I understand it correctly?

#

They really should update the documentation. Those functions aren't even mentioned in that small footnote, where they mention FNetworkMoveData

thin stratus
#

It think this only really became a thing close the end of UE4

#

And kinda without really announcing it

#

You don't need to override Receive

#

Unless you need to

young kestrel
#

Yeah I think it was like 4.26

thin stratus
#

Just giving you options

#

For your specific code you posted

#

I would probably do HandleMoveData

#

Perform your WallRunKeyDown = MoveData stuff

#

And call super

young kestrel
#

Thanks! I'll write that all down, so I won't forget it 🙂

thin stratus
#

There is also MoveData the other way round

#

For the Client Corrections/Adjustments

#

There should be similar functions then

#

The sad part here is that there are functions that would need to be overridden that are a bit big

#

Eh here is the client version:

    /**
     * On the client, handles the move response from the server after it has been received and unpacked in MoveResponsePacked_ClientReceive.
     * Based on the data in the response, dispatches a call to ClientAckGoodMove_Implementation if there was no error from the server.
     * Otherwise dispatches a call to one of ClientAdjustRootMotionSourcePosition_Implementation, ClientAdjustRootMotionPosition_Implementation,
     * or ClientAdjustPosition_Implementation depending on the payload.
     */
    virtual void ClientHandleMoveResponse(const FCharacterMoveResponseDataContainer& MoveResponse);
#

If you have those keys pressed booleans

#

You kinda also need bool UCharacterMovementComponent::ClientUpdatePositionAfterServerUpdate()

#

But that's a bit of a shit show

#

Somewhere in the middle it does this:


// Save important values that might get affected by the replay.
    const float SavedAnalogInputModifier = AnalogInputModifier;
    const FRootMotionMovementParams BackupRootMotionParams = RootMotionParams; // For animation root motion
    const FRootMotionSourceGroup BackupRootMotion = CurrentRootMotion;
    const bool bRealJump = CharacterOwner->bPressedJump;
    const bool bRealCrouch = bWantsToCrouch;
    const bool bRealForceMaxAccel = bForceMaxAccel;
    CharacterOwner->bClientWasFalling = (MovementMode == MOVE_Falling);
    CharacterOwner->bClientUpdating = true;
    bForceNextFloorCheck = true;

    // Replay moves that have not yet been acked.
    UE_LOG(LogNetPlayerMovement, Verbose, TEXT("ClientUpdatePositionAfterServerUpdate Replaying %d Moves, starting at Timestamp %f"), ClientData->SavedMoves.Num(), ClientData->SavedMoves[0]->TimeStamp);
    for (int32 i=0; i<ClientData->SavedMoves.Num(); i++)
    {
        FSavedMove_Character* const CurrentMove = ClientData->SavedMoves[i].Get();
        checkSlow(CurrentMove != nullptr);
        CurrentMove->PrepMoveFor(CharacterOwner);
#

Cause it could be that the last SavedMove that it replays ends in the key being released

#

So it saves that the key was pressed at the moment

#

You could theoretically do this like this I guess:

bool UYourCMC::ClientUpdatePositionAfterServerUpdate()
{
  // Save State

  const bool bReturn = Super::ClientUpdatePositionAfterServerUpdate();

  // Restore State
  
  return bReturn;
}
#

But yeah, that's just a side note I guess...

#

Thanks for coming to my ted talk

#

I'll be off now cause it's freaking 2 am

fathom aspen
#

I need those Ted talks to keep going 😄

young kestrel
#

Man thanks! Btw yeah It's 2am here as well. I actually wanted to stop 3 hours ago 💀

thin stratus
#

Also, what a simple question. Way too boring. Hope you peeps get more complex ones soon.

fathom aspen
#

Wait till Iris questions start coming our way

#

Already handled ditched a few of them

young kestrel
#

I should look into iris, but I'm way too lazy for that. Also, it's way too new to be used in any kind of productive projects.

fathom aspen
#

Yeah, I got really burnt-out trying to get it work, and trying to understand it without it working is meaningless to me, so to keep away atm is key tbh

#

The bar of questions has been raised quite high that I should consider moving to #lounge #bed

prisma snow
#

testing if something is deterministic is not easy as well, specially if not isolated. You first need a scenario which is repeatable, send inputs to the system, and verify outputs

#

Iirc some RTS did a double simulation of each frame on debug mode, so that any non-deterministic frame got caught in the spot

young kestrel
#

Btw I'm kind of amazed that the chaos wheeled movement component works perfect in clean and sterile multiplayer environment.
Didn't try with adding articial pings though, because I'm lazy

I probably shouldn't look at the code though, if I were trying to extend it for hover crafts and to get it working replicated. 😅

fathom aspen
# thin stratus

I got clearly weaker after that vori comment, you are #MP's only savior now

thin stratus
#

Always have been

#

I have not tried it yet. I only read random peeps stating it's all cool and supported, but that's about it

#

Someone probably has to properly test it

#

Well fwiw UE does go more and more multithreadded

#

I think even the CMC has async code now

#

But I'm too scared to look at it

amber saffron
#

well since you all seem like you are bored, can someone give me some pointers on how to implement my multiplayer system.

i want to have Player A host a game, when they load on to the map, either the map, the gamemode/gamestate, or them, not sure which does it, spawns like a bunch of items that will be hidden out of view, that every player(A,B,C,etc.) that joins, will pull instances from to build things. each player will have their own sort of blueprint for building things.

i read over the pinned guide and it was pretty helpful, and i got something working but not really. i implemented the spawning system on an event begin play in the gamestate, and as of now just a simple overlap box in a blueprint that when the player runs over it pulls the building blueprint from the player character passes it to the gamestate to build the the blueprint and then adds it to the overlap box blueprint in a certain spot. this works and doesnt work. and this is currently all in blueprint. if i need to use c++ i will attempt to learn it if needed. any guidance is much appreciated.

edit:
about to go to sleep but wanted to get this posted so that i could have something to go on in the morning, thanks again

glossy drift
#

@pallid mesa Legit thanks for the couple guides you wrote, they helped me figure out the last couple issues I had with using FastArrays for networking.

fluid summit
#

Hi! i'm using Advanced sessions for networking, but i'm thinking on upload the game to EpicGames so people can try it. Does anyone know of a easy solution like advanced sessions that works well with epic?

With steam i need to register and use a good idea, the 480 that steam provides for testing is useless even within the same country.

timid moat
#

In other tutorials, the authors don't say anything about change it.

#

Thanks!

young sphinx
thin stratus
#

(+ I think you posted when all the bored people where already sleeping again)

thin stratus
#

Try that, see if it helps you more

thin stratus
#

Like

#

Isn't that still locked off mostly and requires going through some application process with Epic?

#

Redpoint, or whatever the studio is called, has some free (no support in free version iirc) plugin

timid moat
#

Thanks

trim plume
trim plume
dim trail
#

when im calling methods within a server method implementation for some reason my float input isnt correct?

#
void USkill::Server_SkillShot_Implementation(APlayerCharacterBase* Src, APlayerCharacterBase* Target, int32 SkillID, int32 SkillLevel)
{
    switch (SkillID)
    {
    case (ESkills::WA_PUSH):
        int32 ExtraDamage = CalculateAttackRatio(Src, SkillID, SkillLevel);
        Status->StartStatusChange(Src, Target, EStatuses::STATUS_PUSH, 0.f);
        Status->StartStatusChange(Src, Target, EStatuses::STATUS_STUN, 1.f);
    }
    return;
}```
#

should be 1

still arch
#

I've struggled with this all day, I have a build system that has been working as it should before I switched to using Enhanced Input system. Now the networking seem to have taken a hit. For some reason, the client seems to be out of sync when it comes to the value of "bIsInBuildMode" where when I first press it "EXIT BUILD MODE" is being printed and vice versa.

bIsInBuildMode is (Replicated, Reliable).

rose egret
#

how do I calculate angular velocity (Yaw only) from current and previous data ?

#

CurrentYawVelocity = FRotator::NormalizeAxis((GetActorRotation().Yaw - PreYaw) / DeltaTime); ?

still arch
amber saffron
#

@thin stratus no problem, let me try to explain it a little better. On my multiplayer map there is spot A and spot B. When player A host the game I want the multiplayer map to spawn a bunch of items that all players can use to build things. Player A gets spot A to build in. When player B joins I'm trying to get what player A built in spot A to be replicated. And then whatever player B builds in spot B to be replicated as well.

fathom aspen
#

Just spawn things on server and make sure they replicate. That's all about it.

fathom aspen
fathom aspen
tardy fossil
#

hey, would it break networking if i override PerformMovement and do my own velocity and acceleration calcs there, and ignoring the use of StartNewPhysics

thin stratus
#

Probably

#

Why not override CalcVelocity

#

@tardy fossil

tardy fossil
#

hmmm that might be a better idea

#

that will get called regardless of what physics state the player is in right

thin stratus
#

Different phys states might have different functions

#

Like falling for example

tardy fossil
#

hmmm maybe it would be better to use the custom physics state and write the code in there

thick jungle
#

heyall! Small question, I hope.. I've got player1 in-game, and then player2 joins. On the PC of player1, the PlayerState::PlayerId is 0. Anyone any clue how I can fix this replication bug?

hushed rain
#

Anyone know why a flashbang UI effect would show on the server pawn but not the client?

quasi tide
#

Because you didn't rpc it to the client

#

(We can't know without seeing code)

hushed rain
#

then it does the flash ui code which works fine on server, both characters see the cosmetic explosion but only server gets the UI flash

sinful tree
# hushed rain

It doesn't work on the client because you're using a Server->Client RPC. The name gives it away "Run on Owning Client" which you likely wouldn't give ownership to a client for this type of actor.

Change that to a multicast and it should work for all.

hushed rain
#

It's weird because the explosion radius is registering the correct pawns being hit

thick jungle
#

anyone knows if playerId on the PlayerState should be valid on ALL clients?

hushed rain
#

Ah it seems my widget is not creating for the client on beginplay

severe monolith
#

i have a problem where i use the "get player array" from the game state, but it simply returns a single player state when i PIE with 2 instances.
What's wrong here?
It's like it doesn't even create the second player state, yet i can still move the ingame camera with both instances

#

So the player controller exists

#

Or maybe it doesn't. It fails to cast to the owned player pawn

#

I am so confused

#

Shouldn't a new player instance spawn a new player controller, player state and player pawn?

thick jungle
hushed rain
#

Widget wasn't initializing for client.

amber saffron
# fathom aspen Just spawn things on server and make sure they replicate. That's all about it.

yeah that's what i assumed the process would be, here's my code setup
1.) i start with calling (first image) on the begin play of my platform bp (this is a build location on my multiplayer map, Spot A)
2.) it performs (second and third image) to spawn the parts in the map (this code is in the gamestate, not sure if that is the right location to have it.
3.) when a player runs over a collision box (image 4) it then assembles the parts on platform bp via code (image 5) that is also in the gamestate

image 1 is in platform bp
image 2 & 3 is in gamestate
image 4 is in platform bp
and image 5 is in gamestate

thanks and sorry for the long post and images

sinful tree
# amber saffron yeah that's what i assumed the process would be, here's my code setup 1.) i star...

Begin Play also fires on the server and you shouldn't need to have the client tell the server about it beginning play in this instance. You can determine if it's server's begin play by using a HasAuthority node and using the Authority path, or by checking IsServer() in a branch. Server->Client RPCs require the client to own the actor that you're calling the RPC on, so that RPC may not even be firing unless the client owns that actor.

Same with your overlaps. Those can normally be detected on the server, and you can validate if it's server detecting the overlap, no need for the client to tell the server through an RPC that it overlapped.

amber saffron
valid imp
#

I have a big (5k) order-sensitive TArray which I want to replicate. I implemented a netserialize which compresses it, but it's sad to lose delta serialization. What can I do?

Fast TArray replication does not preserve order so it's not good for me.

pallid mesa
#

you can use fast tarray replication but have your own ID, and via a linear lookup you can provide reliability

#

in case you can afford 4 extra bytes in your data structure

#

also you can always chunk the array and send it in chunks manually over the wire

#

controlling for sure the bunch size
and as long as you keep monitoring your reliable buffer -- if you decide to follow this RPC based solution... watch out for logins and disconnections

glossy drift
#

Anyone know if FastTarrayItems have a limit to how much data can be in them? I can send 3 floats and an int32 but 7 floats and an int32 throws an assembly code error (maybe serialization?)

pallid mesa
#

ugh not sure about this one... but... 7floats +i32 its 32 bytes iirc

#

its not much

#

try to cull the floats using compression and see if it lets you send it over the wire

glossy drift
#

Hahaha yeah I'm really having a hard time debugging it when I just get pointed to assembly. Thanks for the input vori!

#

Will do!

valid imp
#

It's an array of 5k bytes, I can send it all after zlib compression in one RPC. It's just it's a waste to always if only one element has changed. I wonder if it would be possible to check how big the change is, and if too big I just compress&send

timid moat
glossy drift
glossy drift
chrome bay
#

Hard to see the error. Max changes in a Fast Array per update is 2048

pallid mesa
#

Where is this number defined?

chrome bay
#

There are CVars in FastArraySerializer.cpp

pallid mesa
#

because it matches to the description of what Erik is saying

chrome bay
#

But also, replicating an array of 2K elements... 🙃

glossy drift
#

Bwahahaha I know I am trying to replicate Instance Static Mesh Elements

chrome bay
#

At some point, you're gonna hit a ceiling

glossy drift
#

Yup I'm probably just gonna throttle the loading and call it a day

chrome bay
#

Just break the ISM into smaller chunks

#

(or generate from a seed, rather than replicating them all)

pallid mesa
#

yes, please

glossy drift
#

I'd love to generate from seed but these are dynamic objects hahaha

prisma snow
#

To replicate my RTS units, I split the 1-2k i to 10/20 chunks, so each RPC is only 100-200 elements

chrome bay
#

RIP

prisma snow
#

might work

pallid mesa
#

but indeed, rather than using replication, you might also use chunked rpc's

#

just be careful on how you do it

#

and watch out for logins...

chrome bay
#

Can you not even generate the initial setup from a seed and just replicate deltas from that point on?

#

Still not ideal though, as then you have highly variable cost

pallid mesa
#

can also treat it with deltas, but it's very manual

#

whereas the first "replication" is just checking against the reliable buffer

glossy drift
#

I think... best solution is to just dynamically split up my Instance Static Mech Comps when they hit a certain limit of elements.

#

Thank y'all for the awesome input tho, y'all are lovely and I highly appreciate your input

#

Jambax's seed and delta idea is what I am using for terrain

pallid mesa
#

no worries, there are a couple of techniques I learned about after speaking with Zeblote on how he approaches brick replication

#

quite interesting if you ask me

prisma snow
#

I can confirm that updating 1k items in 10 chunks (per second) worked perfectly in my context with two players

chilly arrow
#

How can I fix this issue? I add the input mapping context on the player controller on begin play, it only happens if I run 2 instances, if I were to do singleplayer there would be no issue (1 instance)

near furnace
glossy drift
pallid mesa
#

you can check against the reliable buffer and do send over time, bu having track of what you could send and whatnot.

chilly arrow
glossy drift
#

Yeah... that would get messy hahaha, idk if I am smart enough for that implementation. 😅

pallid mesa
#

I will write a post about that, because it's quite interesting 😄

glossy drift
#

Time to mess around

#

Yoooooooooo that would be hype!

glossy drift
#

@pallid mesa Thought I'd share something of my own since you have helped me out so much. You can use the Replication ID of a FastArrayItem to populate an Instanced Static Mesh Component Instance ID if you offset by 1. (ReplicationId -1 = InstanceId) to make ISMCs with replicated and synced Instance Ids for O(1) Adds and Removals. From my testing I think it would work up until ReplicationId hits int32 max.

pallid mesa
#

Can you rely on the ReplicationID to ensure order?

glossy drift
#

I believe so, Give me a day or two and I'll have some solid stress tests

chrome bay
#

You do need to be careful doing that

glossy drift
#
 *        There is nothing special about them other than being unique.
chrome bay
#

ReplicationID is syned and replicated, but you have to be careful because it increments constantly. It's also dropped by copy constructor etc.

#

Incidentally if you do wrap, it'll break

glossy drift
#

Yeah wrapping will break hahaha

smoky gate
#

Hello, the camera starts jittering for the client when moving on a server, can someone tell me why, please? (edited)

chrome bay
#

Fast Array doesn't actually guarantee that RepID is unique, but it's a fair assumption that you won't exceed 4 million unique item insertions

glossy drift
#

Hahahaha yeah

quasi tide
#

Sorry - I'm making Borderlands.

chrome bay
#

You'd also be better off not removing, and just updating existing ID's instead

#

That way you can also benefit from per-item delta replication

#

But, frankly if you have a fixed order - you'd be better off avoiding fast array altogether and using a static array

#

A fixed-size array will still rep faster

#

Fast array is meant for large data sets with removals/adds anywhere within the array

#

It's not always faster/cheaper than simpler methods

#

As in:
UPROPERTY(Replicated) FInstanceData Data[1024] etc.

#

Use push model to mark indices dirty

glossy drift
#

Definitely better of not removing and just updating existing Id performance wise. But that is the step that would overreach the amount of complexity my tiny brain can handle hahaha. You are on another level my friend. I didn't even know you could do delta serialization without Fast Array. I shall look up what push model is hahaha.

#

Thanks for the tips!

chrome bay
#

Well, by default everything delta-serializes. In fact before 4.27, fast arrays were one of the few things that could NOT delta serialize

#

But you will save masses of additional overhead if you can use a static array, even more so if the individual elements are atomic and can be packed/compressed

#

For most applications though, static arrays aren't that useful - but if you have a chunk of data that is always the same size, it's a win

glossy drift
#

You have expanded my horizons thanks Jambax! I have new things to google! I'll take a look and see if Static Allocation fits my needs. I greatly appreciate it!

late scarab
#

Hello, I am hoping someone can point me in the right direction as I think my understanding of replication is causing my issue.
The issue is that on the Character actor on the Event Possessed, the “Is Locally Controlled” bool is True on the Host but false on the client.
The game is currently running on a LAN connection with the Create Advanced Session from the Steam plugin. This is also a listen server.

I’m trying to figure out why the Client does not have local control.

trim plume
fathom aspen
prisma snow
late scarab
# fathom aspen Because event Possessed gets called on the server only and for non-hosts players...

Thank you! I can't believe I missed the big server icon on the event.....
Now originally I thought my issue was related to the client not being owned but that did not fix it.

When the character spawns it runs this function, however the Set Owning Player Variable does not update for the Client. It gets Null.
I tried adding a delay but that did not help either.
The function is not replicated and runs once when the character spawns.

fathom aspen
#

I can't tell what event drives this code from the cropped image

#

A full screenshot would help

late scarab
#

First image, this is the start of the event that I updated after your help earlier.
Second image is the function that calls the first cropped image

#

The Create - Add HUD is called in the Tick event after the Do Once.

prisma pelican
#

is it better keep spawn location in game mode or game instance?

fathom aspen
quasi tide
fathom aspen
#

You create widgets inside HUD class on BeginPlay for example @late scarab
HUD is known to be a good widget manager and it also exists at the local controller level so you don't need to check anything

quasi tide
#

omg - did it get bigger? @fathom aspen

prisma pelican
quasi tide
#

This used to be 41 minutes, I swear

fathom aspen
quasi tide
#

GameMode it is.

#

GameInstance should be used for things that should exist throughout the lifetime of the game.

fathom aspen
quasi tide
#

Ah - going for the monolithic blog approach I see

fathom aspen
late scarab
fathom aspen
#

Correct, that way you don't have to deal with 90% of the stuff you are dealing with now

#

And you can always refer to HUD to interface with widgets

prisma pelican
late scarab
#

I used to call this function on the begin play event however, I had the issue of the begin play running before the character was possessed.
Sounds like I should have kept it off the character to start 🙂

late scarab
fathom aspen
#

Correct BeginPlay has that issue too

quasi tide
#

Use the controller to manage the AHUD instance. Characters/Pawns should have no knowledge of UI imo

fathom aspen
#

That's why if BP peeps want to do something locally when pawn is possessed I suggest them to fire a client RPC when Possessed gets called

#

But spawning widgets shouldn't really be mixed up with character

late scarab
fathom aspen
quasi tide
fathom aspen
#

🤣

#

That mf gonna explode the whole thing

#

I wonder what happens when I pass the 1 hour mark? Does it start counting in hours? Or does it keep saying mins?

#

I'm not eager to tell as of now, but I can't find someone who did it 😔

late scarab
quasi tide
#

Here's more of an API design question - do you think, when writing something in C++, the server/client RPC stuff should be exposed to BP designers?

Example:
ChangeWeapon
ServerChangeWeapon (obviously this is the Server RPC)

Do you think it should be exposed to BP where the Server version is callable as well as the non server? Or just one or the other? Internally though, it does work properly.

fathom aspen
#

Literally talk to HUD and make HUD manage the widgets. It's just another level you have to go through, nothing more.

late scarab
prisma snow
#

locally

fathom aspen
twilit radish
prisma snow
#

the real database was postrgresql

quasi tide
prisma snow
#

the learning experience was learning how to write that name

quasi tide
#

Right now, I'm in the camp that the designer should not be exposed to the RPC stuff directly.

quasi tide
#

So only the regular ChangeWeapon is exposed.

fathom aspen
prisma snow
#

I mean, I guess it depends on who the designers are and how the project and workflow is

quasi tide
#

Well - it's my project and my company; so I can do w/e the heck I want, lol.

My thought process is that designers shouldn't be exposed to the nitty gritty, they should just do their stuff and not really worry about it as much as possible.

fathom aspen
#

Yeah sounds much safer than to let designers deal with RPCs, especially server ones (security-wise that is xD)

#

But it's more about them creating non-working code than security I would say (considering you implement _Validate in cpp)

quasi tide
#

In general, the way I design systems is for the end-user comfort more than my own. Should be easy for the end-user (currently it is mostly me, but when I onboard future programmers/designers, I'd like to have these rules already in place)

prisma snow
chilly patio
#

theres no way to properly do networked movement in blueprints is there?

fathom aspen
#

GMC plugin?

latent heart
#

There are many "proper" ways.

#

Everyone has their own take and there's no one definitive answer.

chilly patio
#

do you have one for example?

latent heart
#

In only blueprints, though, it'll be a challenge.

#

Depends on the type of movement you want.

fathom aspen
#

I think that's what they meant, and I don't see it feasible at all xD

chilly patio
#

i see 😔

dark edge
#

You need a map or something my dude

amber saffron
# dark edge What The fuck

lol it surprisingly all works, just cant get it to replicate correctly not sure where im messing up at

uneven kraken
#

I have a replicated Actor with a replicated ActorComponent.

When the RepNotify/OnRep is triggered for the parent Actor, am I allowed to assume that its children have also been replicated? Or, should my mental model be, only the object that the RepNotify was fired for, has been replicated, and its replicated fields may still be uninitialized/null/invalid?

fathom aspen
#

Though AFAIK, if the ActorComponent was created and attached to the actor at the same frame then they will make it in the same packet @uneven kraken

uneven kraken
#

Okay, thanks Hunter & WizardCell!

quasi tide
fathom aspen
#

But again Hunter's answer for safety. And soon enough with Iris we'll be able to make some nice replication assumptions

quasi tide
#

I'll believe Iris when it is actually being used

fathom aspen
#

Still nice to peek through the source to see that it's aimed to make our life easier 😄

uneven kraken
#

First time I've heard of Iris, sounds potentially amazing, are there any estimates on its development timelines?

quasi tide
fathom aspen
quasi tide
#

Apparently UE is trying to be more MT overall from my understanding

#

Throw more cores at it baby ❤️

quasi tide
#

I want them to depreciate stuff and then actually remove depreciated stuff

#

I still find depreciated stuff from like 4.17

fathom aspen
#

But if that happens then I won't have fun telling peeps not to fire RPCs from BeginPlay 😔

quasi tide
#

Let's cross one hurdle at a time ya'll. Let's focus on seeing if Verse will be worth a damn. Epic only has Fortnite money, so they're kind of struggling.

uneven kraken
fathom aspen
fathom aspen
quasi tide
#

Exciting times for 2028

fathom aspen
#

Yeah I haven't reached that part yet, but I'm already guessing they must have changed something on that part, which is a big change really.

#

Unsure how I feel considering I will feel beginner™️ in #multiplayer land soon™️

quasi tide
#

If I can't make my BP only MMO with Iris, is it really an upgrade?

fathom aspen
#

Good question

quasi tide
#

One could hope.

#

Sometimes feels like they have a requirement to maintain backward compatibility

fathom aspen
#

Oh yeah lowkey that bothers me. But we're already bloated KEK_Waddle

quasi tide
#

4.17 - I think it's time to just remove it bro

#

I'd be fine with like 2 or 3 version warnings to be honest. With how many clients Epic has with UE - that should be more than sufficient.

fathom aspen
#

Whoever chose the original name must be sued.

quasi tide
#

If it don't crash the game, it doesn't matter

#

The problem with warnings is that they are yellow.

#

Not enough urgency

tribal solstice
#

Hey ya'll - is it possible to replicate a 2D Scene Capture Render Target? For example, one player has a screen that allows them to see the other player's camera view.

glossy drift
tribal solstice
#

@glossy drift Ah, so have a local camera that tracks the position of the other player's camera and just render that camera to a local render texture?

glossy drift
#

yup!

rose egret
#

when we SetControllRotation in Autonomous proxy, how and where is it send to server ?
and I want to get the controll rotation on server when its arrived .
looking for a way to get controller angular rotation

#

in brief
I want to have angular velocity of my actor and play some animation based on that

timid moat
#

Hi!

#

I'm checking the AGameSession source code (cpp file) and I've found this comment: Acts as a game-specific wrapper around the session interface. What does game-specific mean?

#

Thanks!

#

Are there many kinds of game sessions?

nova wasp
#

Game here probably means it has winning/losing matches/players etc

ionic coral
#

when i host a game as soon as i spawn it instantly goes to the menu like the server closes

timid moat
thin stratus
#

Either the whole game or the current match

timid moat
#

Hello. I have a quick question about Sessions in Unreal. I have implemented all the code related to sessions in a class that inherits from GameInstance. But, there is another class, the AGameSession. How do you use this AGameSession class? In the documentation says that it acts as a game-specific wrapper around the session interface and the game code makes calls to it when it needs to interact with the session. But, I think I have implemented this wrapper in the GameInstance class. Thanks.

thin stratus
#

You can still communicate with the Session code from there if you want

#

Didn't I already tell you that the AGameSession class only exists on standalone and server?

#

Your best bet is to look at Lyra, ShooterGame or Unreal Tournament

#

And see what they do with the class

#

Other than that, no idea, I haven't had to use the class much if at all in the past 6+ years

rose egret
#

is there any data type or enum for ENegative, EZero, EPositive?

#

I dont want to use int8

#

Im just replicating sign

pallid mesa
#

use a int8 bitflagged one

#

int8 Sign : 1;

#

at the end of the day, sign is binary, It's positive or negative. (Assuming 0 positive non-normative)

rose egret
#

when I posses a pawn, its rotation is set to the rotation of Controller, however I set the control rotation to zero before possess
when is it set ?

timid moat
thin stratus
#

Again, I would have a look at those 3 projects

timid moat
#

Thanks.

#

But you don't need to answer. Now, I have a better idea about the differences.

thin stratus
#

So, just based on where you place the Session Code, there might be no difference.
The main difference and issue I encountered is that if you are connect to a Server, as a Client, you lose all access to your Session Code

timid moat
#

Thanks again.

thin stratus
#

Means if you want to call FindSessions while already being connected (if your game supports that), then you can't, because there is no AGameSession object for clients when being connected.

#

And since it really doesn't matter much where you place the code, despite "AGameSession" fitting more name-wise, I usually place it into a GameInstance Subsystem.

#

That ensure everyone who uses the tutorial, even those who need to use Session code as a Client, can do that

timid moat
#

Great!

#

Thanks a lot!

sage light
#

Hi guys, I have upgraded to 5.1 and seems like I have the IRIS networking plugin installed. How do I use it?

#

Will movement replication now be done by iris?

#

or do I have to set it up

woeful lantern
rose egret
#

@timid moat u wanna know the real meaning of shit ? its GameSession, OnlineSubsytem and lots of other classes that do nothing but just passing data to eachother

grand kestrel
#

What does IsNetRelevantFor typically use as the SrcLocation? It is passed a playercontroller, a pawn, and the fvector, but cannot see where it comes from

fathom aspen
#

It comes from a FNetViewer's constructor, it equals ViewTarget->GetActorLocation()

grand kestrel
fathom aspen
#

Then you are not looking at the ViewTarget the engine is looking at

#

In that ctor it's InConnection->ViewTarget

#

I would debug and see what that is

fathom aspen
#

I'm talking about this: FNetViewer::FNetViewer(UNetConnection* InConnection, float DeltaSeconds)

grand kestrel
#

Oh

#
    if (ViewingController)
    {
        FRotator ViewRotation = ViewingController->GetControlRotation();
        ViewingController->GetPlayerViewPoint(ViewLocation, ViewRotation);
        ViewDir = ViewRotation.Vector();
    }

It does this

fathom aspen
#

Right and look at the line before that if

#

That's basically what you're looking for

#

Oh right it changes inside that if, that's an out param

#

Yeah then look what happens in there

grand kestrel
#

That did the trick. Thanks 🙂

golden zealot
#

Hey how do I client travel if I'm not using any subsystem or plugin?
How do I get the TravelURL?
Is it just the IP of hosting server or is there something else also?

#

I have the public IP address of Hosting player's session. But Client travel to that doesn't work even after appending :7777

#

i.e., their external IPV4 address

latent heart
#

And what command are you using?

golden zealot
latent heart
#

Honestly not sure. I would try forwarding the port on your router to test first.

golden zealot
# latent heart And what command are you using?

I'm not using any commands. Its a listen server and I just do ServerTravel with ?listen to it.
And on another machine, I just find session and join it successfuly but how do I get to that same map?

latent heart
#

A session isn't the same as joining a game.

golden zealot
#

Ok so what will I do when I publish it? How am I supposed to open port on hosting player's router?

#

😦

latent heart
#

Try forwarding the port manually to see if that's the problem... if it's not, investigate other potential problems!

golden zealot
#

Ok and if it indeed is a port forwarding problem then what would I do?

#

what is steam sockets :/
I don't know

#

Where should I learn this? Do they have docs better than unreal's?

#

Alright thanks. I'm on it 🙂

prisma snow
#

How do Steam sockets work? I guess theu route the traffic through their servers to avoid NAT issues

#

Interesting, they use WebRTC for P2P traversal

hushed rain
#

Supposedly steam sockets is broken in 5.1

prisma snow
#

I'm mainly interested in the WebRTC stuff

#

having p2p connections without relying traffic to servers + no port forwarding

arctic mesa
#

how can i replicate a physics object in such a way that the client can also change it's position and rotation? i have a telekinesis skill that changes a physics object's position, but only the server is able to do it

latent heart
#

Basically how every p2p works at some level

#

(or it isn't p2p)

#

These days anyway.

prisma snow
#

Although I remember somebody talking about WebRTC as possible modern solution

latent heart
#

Nope.

#

A NAT punchthrough is a router thing.

#

It means that you send out a message to/from specific addresses, the router opens the path for a return.

#

You would probably punch through to a server I guess, but it doesn't route the traffic through the server.

prisma snow
#

Ahh, I thought it did

latent heart
#

It allows the other client to connect to you directly through the now open port.

prisma snow
#

I see

#

I did some research about the topic (although I'm not the one handling it in our project) but found the router/NAT stuff a bit confusing

latent heart
#

NAT is basically "I see a packet from port x from the internet, I will translate this to lan ip on port y"

prisma snow
#

for "safety"

#

although I also saw people say it's not really that much safer

latent heart
#

Don't know about a "second layer". It's pretty irrelevant to how the system works for games.

#

You don't need to know how mouse hardware works to control your player camera. Same deal.

prisma snow
latent heart
#

Yeah, I wouldn't rely on anything that needs manual port forwarding.

arctic mesa
#

how do i do that? i really didn't want to bother you by asking this, but i've tried everything i know to no avail

dry pebble
#

I have a question for multiplayer peeps! What is the main variable that gets replicated to other clients that allows their animations to run? Is it velocity? E.g we use speed and direction for a walk/run blend space. Which variable is replicated from the character movement component to allow those animations to run?

pallid mesa
#

velocity is one variable you can use, and you can transform it into a single scalar using the length of the vector that you can use to drive your anims

#

I recommend you taking a look at the state of the art solutions available in the learning samples tab

#

Lyra is a good example to learn modern animation techniques

#

I've personally learned by looking at the UT's animation graph a while ago

dire dagger
dry pebble
dry pebble
dire dagger
#

Most of the Anims work without replication. You could replicate f.e. Blendspace Integers to everyone, so when you Carry a AR its different from a Shotgun. Other than that.. hm.

dry pebble
pallid mesa
dire dagger
dry pebble
chilly arrow
#

Replicated variables can only be changed on the server if I want the change to be replicated to other clients right?

pallid mesa
#

depends™️ it's not about replication, because you don't replicate data... but animation logic is a whole amalgam of transform operations that can get a bit expensive, so use the profiler 👍 @dry pebble

dry pebble
pallid mesa
#

also there are techniques to reduce the significance of the animation logic and do throttling in favour of a smoother experience for your autonomous proxy in terms of CPU time... but the more solutions you add to the pile, the more code you'll have to mantain

#

so my main recommendation is... tackle only the problems that you have

pallid mesa
dry pebble
pallid mesa
#

Have in mind Fortnite is a mobile game, so some of these optimizations are a must in their context... at least given the low spec ratio they aim for

dry pebble
fathom aspen
#

End of pfp era that is Sadge

arctic mesa
#

anybody know how i should make an rpc that sends a physics object's transform data from the client to the server?

pallid mesa
sinful tree
arctic mesa
#

and i connect a get actor transform node to the input?

sinful tree
#

Sure

dry pebble
pallid mesa
#

I hope it'll come back

fathom aspen
#

I don't, mine is a ™️

#

But tbh I'm finding MJ cool, so I'm thinking about it cool_think

arctic mesa
# sinful tree Sure

so this is in the object's bp, the second image is in the player bp. should this change the scale when i walk into the object?

fathom aspen
#

@whole grove Can you hit me with what I need to get started with MJ stuff?

arctic mesa
#

aaand i just tested. the answer's no

sinful tree
# arctic mesa so this is in the object's bp, the second image is in the player bp. should this...

No. You probably can't run the RPC on the "Magic React Item" itself unless the player is the owner of that actor. Additionally, as you're sending through a transform, you're supplying three parts: Location, Rotation & Scale. If you attempt to use just one part, the others would still apply. If you only intend on using scale, then send through only a vector and you can later apply it rather than sending a whole transform.

When you run the Multicast, you've so far not doing anything with the event - you're calling for something to happen, but haven't given it any instructions on what to do when that event is called. If your intention is to have something changed on that actor, you need to actually use the appropriate nodes to tell it what to do when that event fires.

arctic mesa
#

so i populate the multicast the event with the actual instruction on what values to change?

sinful tree
#

Yep

arctic mesa
#

should i promote transform to a variable and use a set node to change it's values?

#

or should i move the rpc code out of the item

sinful tree
#

I'd really recommend if you're this new to unreal you skip the multiplayer bit for now. Just try to get it working single player first. Look up what you need to do in order to set the scale of something. Once you've learned how to do that, then it's a matter of converting that to multiplayer which is mostly about input -> replication -> results.

#

For what its worth, you probably won't need to multicast anything. You'd make a variable for your scale value as a replicated variable w/notify, and on the OnRep function, you'd set the scale of the object.
So then before that, it's a matter of sending any data you want to send to the server, the server then sets the value.
So then before that it's a matter of having your client successfully send an RPC to the server with the data you want to send, which has to be done on a client owned actor like Player Controller/Playerstate/Possessed Pawn.

unique cloak
#

Does anyone here is using rider and knows if it’s good to use just rider for databases?

quasi tide
#

If you're talkin' about connecting to a DB - it works well enough.

unique cloak
#

im talking about the whole functionality of the db

quasi tide
#

You're connecting to a DB and using it. What more do you want?

#

Rider itself is not a database

unique cloak
#

I mean I can code on that right?

quasi tide
#

Rider is an IDE - yes, you can write code in it

unique cloak
#

what do I need for the db stuff? just that right?

quasi tide
#

Completely up to you

unique cloak
#

for games

quasi tide
#

Answer is the same

#

You may or may not need a database

#

Completely up to you

#

How you do your database is also completely up to you

#

Maybe it is SQL, maybe it isn't. Maybe it's just using Steam's cloud stuff. Maybe it isn't. Maybe it is just some random json file on a server you own.

#

Completely up to you

unique cloak
#

mongodb

#

I want to use a data base

#

im making a multiplayer game

quasi tide
#

Then use one?

unique cloak
#

yeah but just using rider for that is fine? I will miss features?

quasi tide
#

Rather than a full on DBMS tool? Probably.

#

But you have what you need for the most part

unique cloak
#

is datagrip a dbms?

unique cloak
quasi tide
#

Fuck if I know.

#

The database stuff built into Rider works well enough for me

unique cloak
#

I never used db dedicated servers and baas so im learning about it.
it will be important for my game

#

I want to make an fps hero game like valorant and overwatch

#

so I dont know what are the tools I need

#

I just know that I will probably use AXR baas mongodb but I dont about know these other stuff

#

you think that rider will be enough for me too?

#

I know

#

but I already have rider and I dont know if thats enough

#

how can I know if thats enough or not
?

arctic mesa
#

well i got something working, pressing right click sets the object's location to 0, 0, 0 and the change propagates through all the clients, but when i try to use a "get actor location" node to constantly update the actor's location, nothing happens

#

what am i doing wrong here? rmb is bound to US, but i did try making it run UM as a server rpc, still didn't work

winged badger
#

you know when you set relative transform, its relative to root component, right?

arctic mesa
#

ah, i see, so im using the wrong node to set the transform?

winged badger
#

root component can't have a transform relative to itself, its always FTransform::Identity

arctic mesa
#

well, setactortransform with the actor as the target also doesn't work

winged badger
#

well, setting the actor location to itself also won't make any visible change

arctic mesa
#

i thought of a control flow that would go like this
rmb -> run US event -> run UM event -> Change actor transform to the current transform in the client or server instance

winged badger
#

when you go and think about it

#

that multicast fires

#

and now whatever comes out of it is executed on client

#

which means GetActorLocation/Transform is evaluated on client

#

and when you set that location as new location, nothing changes

arctic mesa
#

AND something i've omitted and prob shouldn't have, rmb also activates a telekinesis skill that lifts the object

#

which is why the multicast is setup the way it is

winged badger
#

client can't magically fetch actor location on the server by running GetActorLocation

#

which means, if you want to force update actors position via multicast, you have to... ?

arctic mesa
#

get the client transform data and send it to the server?

winged badger
#

the other way around

#

server doesn't care what client thinks about where the server controlled actor should be

arctic mesa
#

send the position data down to the clients then

winged badger
#

so you add a Vector/Transform parameter to that multicast

arctic mesa
#

and i pass to the parameter where i want the actor to be?

winged badger
#

yes

#

then the GetActorLocation is evaluated on server and sent to the client via that RPC

#

which makes client know the location on server

#

note: its still terrible way to update actor position, but it will at least work

arctic mesa
#

so if i want the client to change the ball's position, i make the client tell the server where to place the ball instead of the client placing the ball by itself?

winged badger
#

only place where you can multicast from with any effect is the server

#

client multicast is just a normal function ran on that client

arctic mesa
#

rmb -> run server event -> run multicast event -> somehow get the client's transform data -> send it down to the other clients?

winged badger
#

if client moves the ball, in this simple setup

#

then Server RPC would also have a vector/transform parameter

#

only way client can send data to server

#

this will result in a super choppy movement, but you got to learn to crawl before you can walk i guess

arctic mesa
#

smth like this then?

#

client runs the server event and passes it's actor transform data to the server event?

winged badger
#

if its a client auth, yes, but that will look weird

#

teleporting ball

arctic mesa
#

teleporting? wouldn't it sync for the server as well?

winged badger
#

it will teleport on server

#

unless you send it on Tick

#

but if you send it on Tick, then MC from server, you will choke your network

arctic mesa
#

yeah...guess it would lag out, then again, this'll be the only physics object in the scene