#multiplayer

1 messages · Page 237 of 1

haughty ingot
#

Just make your own engine, I get 1400fps sweeney_activate

  • (don’t)
quick lion
#

I used to be on 1060. Make sure to use the scaleability settings. The viewport takes literally all your FPS, you will love the engine once it runs smoothely

dark parcel
teal flare
#

I don't know yet how to make plugins, but more "folders" (with basic stuff) can be added into larger project : Resuable UI template, Interaction component, Inventory Component, Shooter logic, ...

haughty ingot
#

Ah, modules are very different then folders in your project solution

teal flare
haughty ingot
#

Sounds like you should look into plugins

#

That’s sorta the whole point of DLL

twin vessel
#

So does it work now?

#

Yeah i was saying that Super itself was returning true, thus stopping the function even before the stamina check

lethal wraith
#

Hey guys, I just stumbled upon push model for replication. Do you consider viable to work with this for a survival game with up to 8 people? My inventory has 36 slots and I don't know if it is worth using it or if I am alright with the old method

fossil spoke
#

PushModel just refers to a slight change to how Replicated variables are in need of replication

#

PushModel is opt-in per property.

#

Its not something you just enable and magically everything is now PushModel.

#

The Engine already extensively uses PushModel

#

AActor uses PushModel

#

APlayerState uses PushModel

lethal wraith
#

Yeah I know, that is why I am asking, if the performance improve is worth it to change the things to use the push model

fossil spoke
#

Etc etc

lethal wraith
#

for my arrays of USTRUCTS

fossil spoke
#

Do you understand what performance improvements are occuring when you choose to use PushModel?

#

PushModel does not affect TArrays

lethal wraith
#

I thought that by using the classic way of replicating the entire array is sent over the network while using the PushModel only the changed object that is replicated

fossil spoke
#

That has nothing to do with PushModel

#

You might be looking for FastArrays

quick lion
#

I thought, the GameMode handles spawning of joining players, but that is somehow not the case for me. It just spawn the connecting player as a spectator.
Im using a menu as level. Upon joining the host, the host's map gets loaded. It also shows the host synced with movement etc. But I only get to spectate. PlayerStart is set, and the GameMode has Default Pawn Class set (which works at least for the host)
Any ideas?

lethal wraith
#

Thanks a lot, I will look into it

grand kestrel
grand kestrel
fossil spoke
#

Generally speaking you should make every property PushModel, it can be annoying, but it adds up over time.

lost inlet
fossil spoke
grand kestrel
lost inlet
#

that's pretty much the pattern I've used since its introduction

fossil spoke
quasi tide
#

I use a setter even without push model

lethal wraith
#

And doesnt seem that annoying to implement

quick lion
grand kestrel
limber gyro
#

Im trying to find a good place to play a 2d sound when the room has enough players to start the game, the sound (a small song) is map specific so i figured the level blueprint would be the best place but it seems that blueprint only exists on the server, where would be a good palce to put this?

haughty ingot
lethal wraith
#

I was implementing push model. Apparently I need the source version of the engine? That hurts...

haughty ingot
#

For push model? Na

lethal wraith
lethal wraith
quasi tide
#

Of course they are right. They're insane enough to use slate for a regular ol' GUI program.

#

You don't argue with crazy

haughty ingot
#

No that’s @thin stratus trying to force me into something gross

#

ImGui4Lyfe

lost inlet
#

it's enabled in the editor, but your packaged game won't have it

#

UnrealGame.Build.cs doesn't enable it for the record

lethal wraith
#

oh god

#

that thing takes just too much space

#

but ok

#

tomorrow will be a new day and I do that

lost inlet
#

well order yourself a 1TB SSD, I could fit 3 source built projects on that at a pinch

#

and of course, use a native build, don't just build the entire engine and waste over a day on compiling

lost inlet
#

that seems less than ideal to begin with

lethal wraith
#

it isnt at all, but I will upgrade it then

#

I have enough space for now

haughty ingot
lost inlet
#

bWithPushModel controls the preprocessor definitions that result in it getting compiled in

#

it also requires a unique build enviroment (which means source built engine)

haughty ingot
#

Doesn’t sound right, I’ll have to do a test later.

lost inlet
#

posts the evidence that doesn't sound right

haughty ingot
#

Lmao relax

lost inlet
#

mileage may vary with Iris

#

since I believe that has its own push model implementation

lethal wraith
#

otherwise I would do it

quick lion
#

Does bReplicateMovement only work for hosts?
Or is it meant to be used with server auth movement? (As in, the client requests movement on the server and waits for location updates, instead of moving client side and than sending its location, because its learly not sending its location when moving client-side)

haughty ingot
#

It will replicate movement if the server changes any part of Rep Movement. (Sets location, etc)
Client setting the location won't automatically send to the server and replicate

quick lion
#

yeah I was expecting, the replic to work from client. But from what Im reading, it sais replc only works when location, etc. is changed on the server, so that wouldnt make sense

#

thanks for clarifying

haughty ingot
#

Client -> Server isn't replication just as a heads up. It's communication, but replication is replicating the auth world to proxies

odd gulch
#

.

grand mica
#

Hello! A simple question :-

How can I call an RPC on a client from the server to update the state of a non owning client?

For eg. Client 1 gets an rpc about client 2 from the server?

dark parcel
#

@grand mica that's a strange way to go about it

#

Replication is server to client

#

Design it that way

#

There isn't and there shouldn't be direct client to client coms

#

Not that you can even do that

#

That's P2p

#

Can you give a high overview of the gameplay feature you are trying to implement?

grand mica
dark parcel
#

It will send data to client every net update

grand mica
#

the data will be same for the clients. That's not what i want

dark parcel
#

Server have everyone controller

#

You can target specific player for the RPC

haughty ingot
#

Explaining what you’re trying to do specifically will help, it sounds like a fundamental design issue you have going on if you’re trying to go about this in a round about way

grand mica
haughty ingot
#

So.. you’re trying to rollback

grand mica
#

basically yes

#

it's needed to rollback the game state on a client, yes

haughty ingot
#

I mean rollback is a lengthy process. But you need the server to track whatever state you want to rollback per frame and then have the client send the server a request with whatever time stamp they’re trying to get data on. It’s not an easy thing to do.

grand mica
#

without replication. Replication would force same state on all clients

haughty ingot
#

Rollback

grand mica
#

sorry what?

fossil spoke
#

The Server would need to do that on their behalf

grand mica
#

eg. At frame 50 on server, it has frame 51 for client 1 and frame 48 on client 2
So at frame 50, I would need to tell the Client 1 that it's 51st frame should have the state of Client 2 of 48th frame

fossil spoke
haughty ingot
#

You’re trying to do something you cant do, and asking for advice on how to do it. That’s why it’s confusing. You need to think of an alternative way

#

That’s rollback

fossil spoke
#

Ok thats fine, but you have to use the Server to do that

#

Clients cant send RPCs between themselves

grand mica
#

and then updates a frame on a client

fossil spoke
#

Sure, so whats the problem?

lament flax
#

well

#

thats a lot of free money lurkin

grand mica
#

I am not very sure. Something on Game Instance Subsystem?

fossil spoke
#

Sure? I guess so? GameInstance is not what you would use, but it depends on how you want to manage this

#

Sounds more like a component on a PlayerController kind of thing if I am understanding what you want correctly.

#

Since this is like a per connection type deal

#

Probably need a manager on the Server, that then delegates to the component

#

🤷

#

This is your thing lol

grand mica
#

Yeah, right now I am sending it from the owning client to the server. Server collects it in its own manager. Now to send updates back to the client, I think it should be done on some manager, so i can update the non controlled actors.

grand mica
fossil spoke
dark parcel
#

I think what you actually want to is run the function on everyone from server except the client that send the data?

grand mica
fossil spoke
#

Then access their Pawn via the PlayerState (PawnPrivate)

grand mica
#

niceeeee

fossil spoke
#

Alternatively you can just send the Pointer to the Pawn in the RPC directly

#

It will compress down just fine

grand mica
#

I think I would need to make a structure of the player's state which would be compressed. I can tell the the unique id of the remote client it needs to update. Ofc, my thing to do 😛
But thanks for the suggestions

fossil spoke
#

You do you man

grand mica
#

xD

#

trying to do something based on first principles on unreal's existing networking system is ofc not very straight forward lol

upbeat basin
#

Does rollback really include server interfering with clients to force them update to a old state of the game rather than the current one? 🤔

verbal ice
#

because the server doesn't know about the client's newer inputs

#

so the server tells the client to correct that old movement, and then re-apply newer moves on top

#

that way it doesn't cascade into more and more corrections

upbeat basin
#

But is that not what cmc already does?

verbal ice
#

that's what the cmc does yes

upbeat basin
#

Then I don't know what's trying to being achieved on the night's previous topic, still thanks for the information

thin stratus
#

Hey there, would you please move something like this to #1054845120236757103 ? I would also be very careful with the Download link stuff.
Even if you "promise" it's not a virus, I hope no one downloads it, cause there is no way to ensure that you aren't having any malicious ideas here.
Best would be if you find yourself a proper service to host your game. If you plan on releasing the game, Steam is always the best option.
EGS could also work I guess. Itch.io would probably also be an option, but not sure how safe that is for the downloader.

hybrid meteor
thin stratus
#

Yeah no one is gonna do that. You want others to playtest your game, so you gotta make sure it's 100% safe for everyone without anyone having to do any tests.

hybrid meteor
#

i am saying its safe

#

you dont have to do any test i said it because of your message

upbeat basin
#

Can I say I'm a billioner please?

thin stratus
#

Please just post it to the work in progress channel with some more information and images of your project.
Don't want to derail this channel any further.

hybrid meteor
#

ok thanks

subtle kernel
#

guys, I'm going through:
https://wizardcell.com/unreal/persistent-data/#persisting-data-across-disconnects

I'm trying to preserve player pawn during disconnected time. It seems to be working good, but I'm not sure what is the right way of making sure that new controller will posses the old pawn, and won't be creating new pawn at player start.

For that I explicitly call posses on the right pawn(I save information about it during the LogOut and also starting timer for pawn autodestruction there). But later on posses is being called again from restart process(see screenshot).

How to handle it properly? How engine will posses the right pawn if I'm not doing it myself?

upbeat basin
subtle kernel
#

what it does in FinishRestartPlayer is:

NewPlayer->Possess(NewPlayer->GetPawn());

I guess it's the right pawn because I call Posses earlier

upbeat basin
#

Well you're right it doesn't seem like changing the pawn if there already is one

#

I thought RestartPlayer would spawn a new pawn regardless of existance of one

#

If you want to prevent double possess call, you might want to just call Player->SetPawn(SavedPawn) instead of possess, as finish restart already calls the possess

#

But still, to me it feels like your spawn/posession logic is split between RestartPlayer and Login. I'd personally prefer them to be in a single function with a check to whether continue with an existing pawn or spawn a new one from scratch, just for the sake of readability and maintainability

#

Do you have any visible gameplay problems with your current approach? I don't see any possible critical issue other than just having an unnecessary second call

#

Most of the stuff are checking whether the incoming pawn parameter is different than the one already set to do work

subtle kernel
upbeat basin
#

Possess or OnPossess/ReceivePossess(Or Possessed for BP)?

subtle kernel
upbeat basin
#

Ah if you directly override it then yes that would work twice

#

Then I'd suggest either checking if your delegates are bound already or calling SetPawn instead of Possess on GameMode::Login

subtle kernel
#

yea, I will call SetPawn

#

I think it's quite natural in this case

upbeat basin
#

Well there is one more thing though, if you're keeping your pawn still and visible in world, RestartPlayer might change it's location to a random PlayerStart as well

subtle kernel
upbeat basin
#

Hmm I'd expect it to find and set a new transform for the pawn 🤔 But if there isn't any problems then nvm

subtle kernel
subtle kernel
elder lotus
#

Hey, I'm having an issue when using serverTravel, When I go from one map to another the characters don't spawn. Any ideas?

hybrid meteor
elder lotus
#

Weirdly it works when I go form my lobby to a gameplay level but from gameplay level to gameplay level the characters beomce un possesed after they spawn I think

#

I should add this also only seems to affect standalone in pie it works fine

hybrid meteor
#

if it unposses then posses them again in the next level

lament flax
#

starting at what Actor/Component function is replication ready ?
for eg can i check for authority in postinitcomps

fossil zinc
#

Hey
Anyone here experienced with Replication Graph?
Traying to implement it on a Game in which the camera and the Pawn are not in the same location and the calculations seem to use the camera always as the reference point, but I haven't been able to change it, even by overriding the GatherActorListsForConnection in the UReplicationGraphNode_GridSpatialization2D

I look into IRIS as an alternative, but is not feasible for us since we are not currently using the Source engine and would like to see the results with RG first before trying that approach.

chrome bay
#

You need to put the pawn into a node that marks it always relevant for the owner

#

So it's gathered and replicated to that connection

fossil zinc
exotic wasp
#

curious to know this as well

grand mica
#

plus in a real rollback system, all calculations done on server and client are deterministic. So you just need to send the input to the server and then there's no need to worry about getting different results on different machines.

grand kestrel
#

@thin stratus @pallid mesa I think the next community resource I make is going to be actor based TIP [Turn In Place] because I want to kill Epic's mesh based TIP with fire. Its cancer and it pervades every project because Lyra uses it. Its an awful technique that is the TIP equivalent of the newbie programmer thinking their delay on begin play works to get a player controller.
Instead it:

  • Fights the sim proxy's mesh smoothing
  • Forces you to use inferior linear rotation smoothing
  • Forces you to use the inadequate linear translation smoothing that simply isn't good enough because Epic didn't separate them out
  • Or, separate them out yourself, which is a lot of work, and the code is one big cobweb that you have to re-learn every time you look at, and adds uncertainty and drastic time for isolation if you have sim proxy issues
  • Causes jitter on sim proxies
  • Has to be compensated for in every single animation/locomotion system you make
  • Causes issues with a lot of procedural systems esp. involving sockets and race conditions with the anim graph's rotate root bone node
  • Pervades your anim graph

Whereas actor based TIP:

  • Has no issues whatsoever
  • Can be tucked away almost entirely in code

I already have the completed solution, you just make a call from FaceRotation and I think PhysicsRotation (haven't looked in a while, it just works)
Once I integrate for actual game I'll make any changes that come from using in production then release under MIT

grand kestrel
#

Turn in place

#

Apologies, someone from work just called that out too 😄

#

I spent hundreds of hours, literally, developing TIP systems
Mesh based TIP was unfixable, in the end I realized the problem is that I was using Epic's solution without questioning how I'd design a TIP system if I had never seen theirs

exotic wasp
#

Wait Lyra just rotates the mesh and not the actor?

grand kestrel
#

Yeah.

exotic wasp
#

What the fuck

grand kestrel
#

They basically offset the mesh when you rotate the actor, so that it appears to stand still

#

And then they decay that offset based on the curve from the turn animation, which plays when it reaches a threshold

#

My solution isn't too dissimilar in essence, I hold the actor's rotation...

#

Because with theirs, the sim proxy keeps trying to smooth the rotation on the mesh that is a result of their offsetting the mesh, which causes it to jitter

#

And then because the mesh rotation and actor rotation are unaligned, every procedural system now needs to query the offset and account for it. And exponential rotation smoothing becomes unusable, because it needs to be linear because the actual mesh is offset linearly. Exponential is required for adequate translation results. But Epic didn't separate them out. Now I'm repeating the bullet points tho.

#

@potent cradle you have lived this problem 😄

odd gulch
#

Hello everyone,
I’m currently developing a game in Unreal Engine 5.5.2 that will support 12 to 16 players. I have prior experience with offline development, but I lack knowledge when it comes to Unreal's online features, and I haven’t been able to find sufficient resources on the topic.
While conducting tests on a listen server, I’ve encountered issues even with just 8 players. The ping increases significantly, and the character movement appears somewhat erratic. I haven’t experienced such issues with other engines. For instance, when running a similar test in Unity, I was able to optimize and manage it much more smoothly.
However, my project is based in Unreal, and I generally prefer using Unreal Engine. I’m trying to understand the root cause of this difference. Is this issue related to the default Character Movement component? Can it handle my needs with some adjustments, or would I need to create a custom system from scratch?
I’d greatly appreciate any guidance or advice from someone experienced with Unreal's networking system.
Thank you in advance!

grand kestrel
# odd gulch Hello everyone, I’m currently developing a game in Unreal Engine 5.5.2 that will...

Unfortunately you are simply in the learning stage of Unreal
And at the stage you're at learning-wise you don't have the knowledge to make a multiplayer game
Start with Cedric's networking compendium but I assume you have already, its pinned here

For character movement you can look at my PredictedMovement repo which is also pinned here; it is getting a huge update currently. Character movement needs to be predicted, so standard replication is inadequate, you will get latency delay with every input/response and the prediction will fight it, which is what you're experiencing. When I complete the update there will be a blueprint friendly version you can inherit which will give you:

  • Sprint
  • Walk & Stroll (a slower walk)
  • Prone
  • Aim Down Sights
  • Modifiers: Boost, Slow, SlowFall, Snare w/ partial client auth because its applied by server
    Modifiers have multiple levels (e.g. boost level 1, boost level 2, or slow levels based on the type of weapon you have, etc.), and can be local predicted or server initiated w/ partial client auth so that when receiving from the server you won't de-sync horribly. Its seriously robust

And you can reproduce their templates to add other movement abilities.

exotic wasp
grand kestrel
#

Sorry I edited that quite a bit, I'm still in the process of creating it so don't have info on hand already typed out

odd gulch
grand kestrel
#

Just go through the pins on this channel, they are good

#

Between CMC and GAS you can make an entire character based game top to bottom

#

But I should warn you, I've been in this industry for years, I'm paid reasonably well to make games not unlike yours, and I wouldn't touch your concept as a solo dev in a million years because I've seen what people who have skills I'll never have do to make the stuff I make actually playable for players

#

Esp. in the devops space

odd gulch
grand kestrel
#

I think you should do it as a learning experience regardless

#

Esp. for the purpose of learning CMC/GAS

#

But if my plan was to release a finished product it would be tiny as hell lol

#

The more experienced you get the more you learn that

#

The newbies make MMOs and the veterans make pong (not really)

#

I only learned what I learned by aiming for the sky tho, so again, go ahead and you'll learn

#

Just don't put money into your game 🙂

odd gulch
grand kestrel
# odd gulch But Unity's resources are very clear on this, and I can optimize without experie...

I haven't used Unity in over a decade and when I did, I was a newbie
So I don't know exactly what Unity offers
I know their networking tools were completely lacking and gave you nothing character-wise
And I don't know if they have net predicted character controllers already written for you
But if they don't then you're likely experiencing 0ms replicated netcode which can't function in production

quasi tide
#

It can in Korea 😠

#

Friggin' Koreans and their 4 ping

exotic wasp
#

I didn't even know unity had networking

grand kestrel
# odd gulch But Unity's resources are very clear on this, and I can optimize without experie...

These are the settings I use during PIE
It gives me ~150ms (use stat net to see)
You can't test anything with 0ms

I'm from NZ and connecting to our US West servers gives me ~180-200ms which is extremely useful as a dev because I get the worst issues in the worst way possible, reliably, which means I go and fix them or complain and get them fixed

Our QA team even has a bit of pkt loss so we see unrecoverable de-sync issues and can fix them so they recover (or write it off as unfixable, but we know it exists and can ask players to run some sort of trace)

You need to test your code in real world conditions or you're going to have players complaining that its unplayable, because it will be

#

The crux of the issue you're having @odd gulch is that Epic have provided you a frankly amazing net predicted character that you don't understand at all, so their net prediction will fight your replication

#

You gotta learn CMC

#

It works in the real world, unlike nothing in Unity 😄

#

Just kidding, had to do it

#

Also use p.netshowcorrections 1, it will draw a red debug capsule where the client was located, and a green debug capsule where the server moved it to during a correction

#

Probably with latency simulation and that command you will see a massive amount of debug capsules drawing that coincide with the jitter you've been experiencing

#

At least then you can clearly see when it occurs and work on fixing it

odd gulch
# grand kestrel I haven't used Unity in over a decade and when I did, I was a newbie So I don't ...

As far as I know, they are currently using a more innovative system than Unreal, but I'm not sure if the issue is entirely about that. Unreal uses a lot of unnecessary replicated data outside of my control. For example, it keeps sending the character's scale information even though I've made changes related to this in my game, and this still works as replicated. It uses many things in this way. In Unity, however, since everything is more editable, I can more accurately control and manage what should be replicated, but Unreal requires a bit more effort. But you can be sure that I will check what you said and take a look.

grand kestrel
#

If the scale isn't changing then it's probably not being sent

exotic wasp
#

It definitely shouldn't be replicating if there's no change

grand kestrel
#

I mean, if you replicate FTransform, you should only get the stuff that actually changes being repped, but when you receive the replicated FTransform due to a different property changing, you'll still see the last value

exotic wasp
#

Maybe there's something dirtying it somewhere?

odd gulch
grand kestrel
#

IDK, I haven't experienced anything like that, I don't think it's part of Unreal at least 😄

quasi tide
#

Also - keep in mind, Character/CMC is old as heck. You can always write your own stuff. Nothing is stopping you.

grand kestrel
quick lion
#

I want to replicate a struct FMyStruct which contains a few FVectors. Do I have to append the USTRUCT() macro to FMyStruct, for it to work in the replication? The struct is member of a APawn

quasi tide
#

Another thing to keep in mind - UE is working on a new networking model. Iris.

grand kestrel
#

😉

#

I understand its monolithic which sucks, but it's really not much of an issue once you've learned it

odd gulch
#

If we solve the issue, we can adjust some parts, it's not a big deal. Thank you for your help.

quasi tide
grand kestrel
#

Writing your own character would be a good learning experience but never worthwhile for 99.9% of devs making a game. Also at that point, you'd be better off bringing Mover up to parity like Cedric has been doing for his client, which seems like an astronomical amount of work

fierce birch
#

Unity's netcode side is a mess

#

(and I'm not really expert on the topic)

#

I've recently looked at unreals physics prediction and.. well.. it seems like a mess too

grand kestrel
#

Yeah unfortunately it is a mess

#

Its the new NPP plugin that Dave Ratti started but left part way through and I guess someone else picked it up, its very new and probably unfinished

exotic wasp
#

Mover uses it for better or for worse

grand kestrel
#

That means it'll hopefully get cleaned up lol

#

Or both will be ditched 😛

#

IDK what Epic's plans are regarding Mover, esp. in the context of Fortnite

fierce birch
#

also new modular vehicle relies on it

#

and is probably main reason why it's so glitchy

grand kestrel
#

I feel bad for you focusing so much on vehicle physics
The most neglected side of Unreal since Unreal 😄

fierce birch
#

I don't really rely on anything Unreal does for vehicles

#

you can't

#

it's impossible

grand kestrel
#

Yep

#

Ain't that the truth!!

fierce birch
#

but I do check what they do with it

grand kestrel
#

I will stick to rewriting CMC to have boxes instead of capsules
And angular velocity
For my arcadey vehicles 😄

#

At least Epic finally added arbitrary up vectors

quasi tide
fierce birch
#

they actually have physics programmers now with vehicle experience, but they still don't manage to package it in functional form

grand kestrel
#

They probably suffer from the age old issue of being IGNORED by everyone not involved in vehicles 😄

quasi tide
#

Which reminds me - @signal lance will your plugin be networked?

grand kestrel
#

I think I can answer that: yes

#

😄

signal lance
grand kestrel
#

You'd be the hero of so many people if you made an actual vehicle physics plugin with actual prediction

quasi tide
signal lance
quasi tide
#

Assuming it ever actually releases that is

quick lion
#

is it a problem, to create header files from within visual studio, instead of using the cpp wizard from UE-Editor? I feel I always run into wierd problem, when I do it

exotic wasp
#

No but visual studio will put your new class into a temporary directory by default and it will get deleted or not even built

quick lion
#

what im seeing, confirms that, thanks

lost inlet
#

OnlineServices is "OSSv2"

#

And for that I believe only EOS is supported and "OnlineServicesOSSAdapter" translates OnlineServices into OSSv1 calls

#

And then I think the VoiceChat interface exists because Epic used to use Vivox for Fornite before switching to their own system, both implement the same interface

vapid gazelle
#

Could use a sanity check:

  1. What is the difference between Net Load on Clients and Replicates when it comes to Actors? I can turn off Replicates on an actor, but turn on Net Load on Clients, and the Actor will appear on the client's instance. What does that even mean? Am I notifying the client of the existence of the Actor at map load time, but not replicating it ever again from that point on?
  2. I'm pretty sure this is true, but I want to make sure I didn't hallucinate this: BeginPlay is run on every instance where an Actor is replicated, there's nothing about BeginPlay that is server-only?
quasi tide
#
  1. Never looked into it. I only toggle net load on clients off on trigger boxes personally. Haven't wanted to do it for anything else.
  2. Correct.
signal lance
quasi tide
#

Give me it and I might

signal lance
quasi tide
#

"For respect to UE and its ecosystem, this plugin has no docs. Good luck!"

quick lion
#

Are there some common issue for ServerRPC not getting invoked on the server (common, as in, beginner mistakes)?

ABunny : APawn

// Bunny.h
UFUNCTION(Server, Unreliable)
void ServerRPC(FBunnyProps InProps);

// Bunny.cpp
void ABunny::ServerRPC_Implementation(FBunnyProps InProps)
{
    UE_LOG(LogTemp, Log, TEXT("Executing on server.")) // I do not get this log on the host
}

void ABunny::Tick(float DeltaTime)
{
    if (IsLocallyControlled())
    {
        if (!HasAuthority())
        {
            UE_LOG(LogTemp, Log, TEXT("Requesting ServerRPC.")) // log is shown on the client
            ServerRPC_Implementation(FBunnyProps());
        }
    }

    Super::Tick(DeltaTime);
}

open for other suggestions as well, if you see bad practise anywhere

quasi tide
#

You're trying to call it on a client that does not have network ownership of it

quick lion
#

thanks, looking into it

vapid gazelle
#

Are some networks simply never going to work when it comes to player-hosted UE sessions due to the nature of the connection? E.g. even when using the Steam networking layer, is it possible that you won't be able to join or host UE sessions if you're on cell phone network? Not an expert here, but I think there might be something tricky about NAT on these types of networks since you're sharing IP with a big group of people all connecting to the same tower. I think.

#

Here's what Perplexity thinks on the subject.

prisma merlin
#

Help, RepNotify of variable being ignored if set by server too quickly, even if on different actors.

#

If the server sets a Replicated variable on an actor, it needs to wait a few milliseconds to set it on any other actor or on the same actor, otherwise the client does not receive the information.

#

It seems to have a minimum replication rate, but it is very slow.

verbal ice
#

What's your scenario in this case?

quick lion
# quasi tide You're trying to call it on a client that does not have network ownership of it

I think I do have ownership. Im just getting kinda confused by something else. I start up 2 instances of the game in standalone mode.
Then I start a host session on the external instance.
I use the PIE instance to join that host.

Now I see the world in the Outliner (which I would normally expect to see, when I host from the PIE instance. If I do host from the PIE instance the outliner is empty)
I also see the logs in unreal, which come from the host (with the host being the external instance). When the host is PIE, there are no logs I would expect from the host...

this is soo wierd

dark edge
#

the last or the first?

quasi tide
prisma merlin
prisma merlin
dark edge
#

you're sainy you set ID to say, 3, then 4, and the clients ONLY ever see it as 3?

prisma merlin
quick lion
quasi tide
#

What is "ABunny"?

quick lion
#

A Pawn which can jump

prisma merlin
# dark edge show more of that code

Or rather, the default value of the variable is 0, as the first item in the list will set it to 0 again, the client does not receive it as it would supposedly be a duplicate set, It's like preventing duplicate replication of value, even if it was the first time.

quasi tide
#

Does the player control it?

quick lion
#

yes

quasi tide
#

How?

dark edge
quick lion
#

InputActions + AddImpulse (dont see how this is related to logs tho)

dark edge
#

just do the onrep logic at begin play to catch that case

quasi tide
#

So you take possession of it with the player controller?

quick lion
#

I did not do that explicitly myself. Maybe the default inplementation of GameMode does that for me?

prisma merlin
quasi tide
#

So it is your default pawn class?

quick lion
#

it is

dark edge
#

default GameMode will spawn and possess DefaultPawnClass for you

quasi tide
#

UE_LOG - if it is the standalone - does not write to a log if I recall.

#

If it does - you need to check the logs of where the game is running. I don't recall where those get stored.

quasi tide
#

Or just do something more useful than a UE_LOG

#

Did it work when you were running 2 PIE instances?

quick lion
#

I mean, I was not explicitly packaging the game. I do use the PIE with Number of players = 2.
But one instance runs in the editor and one externally

#

with the NetMode set to standalone

#

There was on option somewhere, which I enabled. But cant remember where it was.
It said, instead of starting an instance within the UnrealEditor, it will start a seperate Editor for each Player

prisma merlin
#

@dark edge Yes, that was it, As I am using the "Rep Notify" function when the server sets the variable, if the value set is equal to what it already is, the replication does not happen.

quick lion
quick lion
quick lion
swift sorrel
#

BTW the repnotify route worked perfectly! Thanks y'all for putting me in the right direction a few days ago.

ripe lotus
#

hello, i have a few replicate actors, that belong to the level, i'm trying to override IsNetRelevantFor, for a few actors i have. But it's not being called.
anyone has any idea what could be the issues?
i have overriden that function successfully on the pawns though.

undone kiln
#

I've been trying to make inventory systems, found "PyroDev"s inventory tutorial, and it's been flawless, but it's a singleplayer setup, and i'm trying to make it work in multiplayer.
I set components and items to Replicate = true, but when I set the parent item to replicate, it not only doesn't mirror item pickups in multiplayer, but the deleting actor on pickup completely stops working as well. The item is still added to the inventory.
The part that stores picked up items is a String Map Variable, which apparently can't be replicated, so maybe the issue lies here? Or maybe I just don't know enough about making things MP aha. Please let me know if providing pictures of specific functions or components would help identify the issue!

fossil spoke
#

Or maybe I just don't know enough about making things MP aha

#

This is the reason

#

Multiplayer is one of the hardest things to do in gamedev.

#

If you are using a tutorial that wasnt designed for Multiplayer, you are not going to have a great time with it

#

You dont make a SinglePlayer game and then convert it to Multiplayer, its just not a viable thing to do

#

Multiplayer almost requires you to start with it in mind

#

Its not an after the fact thing you just add later.

#

You either make a SP game or an MP game from the start.

#

And design/implement features accordingly

lost inlet
#

And it's a lot easier to make MP centric code work SP if you need both

undone kiln
fossil spoke
#

Then you just need more practice on probably less complicated features

#

Inventories are not an easy feature to get right either

lost inlet
#

And YouTube tutorials can be of extremely poor quality

#

So there's also that

undone kiln
fossil spoke
#

You need to crawl before you can walk.

undone kiln
#

Following tutorials is the best way i've found to learn new systems - it might take a few attempts, but once i've built a working system, I can go through it and learn exactly how and why it works. Unfortunately, most invo tuts are slightly outdated and it's all pear shaped before i'm halfway through, and while this tut is flawless, it's also not geared for MP - If i'm walking here, how do I crawl?

dark edge
#

just a small mechanic, like "abilities as actors" or "inventory system with an inventorycomponent and the items just being structs"

undone kiln
#

I actually took that advice 🙂 Got chatgpt to explain the difference between maps and arrays, and now reworking it to use arrays instead 😄

fossil spoke
#

If not worse.

#

Use caution

dark parcel
#

@undone kiln fyi setting replicate to true is just marking the object that it can be used to replicate

#

It will not replicate anything magically

#

Spend some time with pinned material in this channel.

#

Although if you just discover array and maps, diving to multiplayer is too early

#

Why not work on single player game for your first game. Maybe you can release your first game because they are way easier

eternal canyon
#

🧑‍🚀 🔫 🧑‍🚀

grand kestrel
fervent condor
#

Has anyone ran into an issue where the object on the server is in the wrong place? My character's weapon is not positioned in the correct place. I'm firing off a red debug line from the weapon on the server, and a green on the client:

upbeat basin
#

If it's dedicated server and weapon is attached to the character, is it possible your character's bones are not updated correctly on the server?

fervent condor
upbeat basin
#

There is an option on the character to update bone locations in server too (I don't remember the exact name so give me a moment to check). I'm not sure if it's caused by that though, it looks more like some kind of an offset rather than character T-posing in the server

upbeat basin
fervent condor
upbeat basin
#

Well, that was my only bit

fervent condor
lethal wraith
#

Hey, am I safe by using network prediction plugin by unreal engine or is it still not recommended to use, and I am better by doing things on my own? I heard fortnite uses it, so that is why I am asking

lost inlet
chrome bay
#

I also don't think Fortnite is using it at all, they seem to be leaning pretty heavily on the physics based character stuff now

#

If Mover has some kind of kinematic liason you'd be better off with that IMO

lethal wraith
#

I don't really know what Mover is... going to investigate it

chrome bay
#

Mover is "ok" but has some questionable decisions of it's own, whereas I would describe NPP as rotten to the core.

#

If you can do what you want with CMC, just stick with it.

lethal wraith
#

Doing things on my own might just be better no?

chrome bay
#

Unless you want a great source of technical debt

little pumice
lethal wraith
#

I just wanted to do simple things. My game wont be an fps or physics based. I was just asking out of curiosity

#

Could you recommend me any article about client side prediction so I can have a read? I just want to eliminate the lag on the client. The game will be a casual coop

chrome bay
#

The recommendation from me personally is predict as little as you can get away with

#

Movement is one thing, predicting game state is another entirely

#

And CMC already deals with movement for you

#

GAS can (to some extent) deal with gameplay prediction too

#

Plus it's also pretty quick to work with once you get your head around the core concepts

lethal wraith
#

Yeah, I was looking forward to use GAS but never used it on multiplayer, but as far as I know it doesnt do things entirely for you

chrome bay
#

If it's a basic casual co-op game that might be more than you even need

#

GAS is designed for multiplayer

#

And don't let the name fool you, nothing does things entirely for you, NPP included

dark parcel
#

eliminate lag is probably the wrong word

#

client prediction just means, you do the action locally first before you inform the server about it

#

think about deducting ammo count.. you don't want to wait for server to give you the actual number

lethal wraith
#

Yeah, right now I was doing the inventory system, and I was implementing inventory management and I want the UI to be responsive but I need to replicate everything to avoid dups

dark parcel
#

if you have 300 ms, you will wait 0.3 second before you see your ammo count changes

undone kiln
#

Sorry to interject, my inventory system now works in MP, with the caveat that it refuses to destroy actors once they've been added to an inventory, if anyone has any ideas there

dark parcel
#

so what you can do instead as client, you can just change the ammo count the moment the fire function is called

little pumice
dark parcel
#

ofc there are a few edge casses you have to addres but it's not complicated

#

@lethal wraith here's example of client prediction.
Press V -> Play Montage -> Server Play Montage

#

there you go, client already predict

lethal wraith
#

how can the server compare with something locally

dark parcel
#

ammo count is different though.

Client Fire -> UNprocesseseRPC++ -> Change ammo count -> ServerFire

lethal wraith
lethal wraith
dark parcel
#

doing it in your inventory system isn't a great way imho

#

do a small exercise

#

then move forward from there

lethal wraith
#

is there any article about it? Doesnt need to be in unreal

#

I mean a nice one 🙂

dark parcel
#

doesn't really help you understand imo

lethal wraith
#

you mean it because inventory is something that can have bugs that one can't "see"?

dark parcel
#

Just go client predict changing a material of a box

lethal wraith
#

its alright I will try to play with it on an empty project

dark parcel
#

if you can't do that, why trouble your self with inventory action where not everything should be predicted

chrome bay
#

my advice would be to fix these things only if they are actually a problem

little pumice
chrome bay
#

Predicting things adds masses of complexity, sometimes needlessly

#

There is also that angle tbh, if it's casual co-op and you don't care for cheating, client-auth it

#

I would usually not say something so unspeakable

dark parcel
#

need to do rewinding too when the state isn't valid

#

not everything can be predicted

lethal wraith
dark parcel
#

if other players have access to the same chest grid then don't predict it

#

just accept the lag imho

chrome bay
#

Also, misspredicting is usually far more noticable than latency

#

Because then you have to rewind and correct, suddenly the game didn't do what you already thought it did

#

That's usually MUCH more visible

lethal wraith
dark parcel
#

the issue doesn't only lies with cheating

lethal wraith
#

But, in the situtation that I gave before. Isnt updating the position of an item in the array acceptable? I am just saying because I dont want to introduce desyncs

#

Just trying to avoid bugs, by always having the same array in the server that I have in the client

chrome bay
#

In that case you probably just want to get it back from Server

#

Hard to say ofc

lethal wraith
#

Right now I am just calling the delegate that updates the required slots on the OnRep function of the inventory array

#

But that introduces delay in the UI which is not ideal

chrome bay
#

I've done that kind of prediction but it's not simple tbh

lethal wraith
#

Yeah, I have to spend some time learning it

#

there is no right answer

blazing spruce
#

Hi, im well confused.. I'm having an issue with my pre lobby widget, whenever a player joins the session their BeginPlay of their PlayerState calls a dispatcher on the GameState called OnPlayerJoined which is bound to on the pre lobby widget so whenever a player joins the session the pre lobby widget will creates a name card widget and add's it into the players list. This part is working fine, both client and server see's the correct player card widgets created, however the issue arises when a player leaves the session.. their EndPlay event on their PlayerState calls a dispatcher on the GameState called OnPlayerLeave which is bound to on the player name card widget so whenever a player leaves, the name card belonging to that player removes itself. This is working on the clients no problem they see the correct name card widget get removed however this doesn't happen for the server player.

Now the reason i think this is happening is because when a player leaves the session there is a Begin Play event getting called on a player state (somehow???) before the End Play event is called so it only appears that the server doesn't remove the player card widget of the player who's just left because when that Begin Play is called it calls OnPlayerJoined which creates another player name card widget.. I confirmed this by 1. adding a print statement to the PlayerLeft event to confirm the server player is def calling remove from parent which it is and 2. i stopped the 'OnPlayerLeft' call on the EndPlay event so it doesn't try to remove any player card widgets so then when the player leaves it creates another player card with their name on it.. because of this BeginPlay call, but i dont understand how that BeginPlay is getting called when the player leaves the session? Any ideas?

#

Also on the EndPlay i have tried it a few different ways.. ive tried it with a switch has authority node, but that just makes it not remove the widget for anyone.. ive tried it with a RepNotify called HasLeft which then calls the OnPlayerLeave dispatcher which removes the widgets from the clients not the server, ive tried it with a server rpc which does the same as has authority node and ofc calling the dispatcher directly which works on clients

upbeat basin
#

PlayerStates should be living longer on the server as a reconnection support to give back the old PlayerState, so you can get their previous states to make them continue where they left off, that might be the reason why your EndPlay doesn't get triggered on Server

#

On server, their replication is turned off (hence they should get deleted from clients and trigger EndPlay) and they're kept in an array called InactivePlayers in GameState, just like the PlayerArray

After looking at the engine, apparently the PlayerState of leaving player is duplicated and the actual PlayerState is being destroyed, instead of directly saving the existing PlayerState

blazing spruce
#

theres 2 players in that lobby, so how can there be a PS_PreLobby_C_0, C_1 & C_2?

#

Also not using c++ so cant access that InactivePlayers array

upbeat basin
#

Hmm, GameMode calls PlayerState->Duplicate() to save to the inactive player array. That might be where the BeginPlay is coming from

#

Can you set this to 0 or something low in your GameMode (it should be inheriting from AGameMode, not AGameModeBase for this) to see if after that time your second created widget is also get destroyed (because I'm not sure whether your problem is actually this or not)? I'm going to check if it's possible to determine whether a PlayerState is for an existing player or an inactive player for BPs

blazing spruce
# upbeat basin Can you set this to 0 or something low in your GameMode (it should be inheriting...

Okay tried that, setting the life span to 0 didn't do anything but setting the max inactive players to 0 makes the widget get removed on the server as well, although it is still calling the BeginPlay of a PS_PreLobby_C_2 despite their only being 2 players in the lobby, but its also now calls PS_PreLobby_C_2's EndPlay event so its removing the widgets, however that is giving me some errors in the editor now because PS_PreLobby_C_2 isn't valid

#

Still no idea why it makes another player state out of thin air lol

#

Gonna test it properly over steam to make sure

upbeat basin
upbeat basin
upbeat basin
#

Something like this

brazen orchid
#

Blueprint Runtime Error: "Accessed None trying to read property CallFunc_GetLocalPlayerSubSystemFromPlayerController_ReturnValue". Node: AddMappingContext Graph: EventGraph Function: Execute Ubergraph CBP Cj Blueprint: CBP_cj

#

why am i getting this error

lament flax
brazen orchid
#

i didnt even touch this nodes

#

when i unplugged output of receivecontrollerchanged event

#

there was no error

#

and no movement

#

no input*

kindred widget
lament flax
upbeat basin
#

It should fail the cast if it wasn't valid though

#

I think CallFunc_GetLocalPlayerSubSystemFromPlayerController_ReturnValue refers to EnhancedInputLocalPlayerSubsystem node's return value rather than the controller itself

brazen orchid
#

then i check cast failing or not

#

also cast is successful

upbeat basin
#

Was this a pawn event?

lament flax
#

Do a is local controller check

brazen orchid
upbeat basin
#

Yeah that's what I was going to say, if this is running on server for a client's pawn, it's normal it doesn't have a LocalPlayer Subsystem

brazen orchid
lament flax
#

Type that from controller

#

It return a bool

brazen orchid
#

its locally controlled

hybrid meteor
#

gys theres a problem when i package the game and someone logins and it opens the browser it says to the user application acces is restricted which means only members in the organisation can login. But it shouldnt happen in a published game beacuse then how will people play my game. Please help

upbeat basin
unkempt tiger
#

Anyone else notice that AGameStateBase::GetServerWorldTimeSeconds() actually returns weird af values when scrubbing replays during demo playbacks?

hybrid meteor
upbeat basin
#

What I meant was if you're using EOS subsystem and trying to login from Steam to dev sandbox, you need to save steam ids as player group to allow them. It shouldn't ask for it on live sandbox though, just a protection for dev sandbox

hybrid meteor
#

ohh sorry

#

thanks btw i also have another problem

#

i made a game in which character have a paddle which can go up and down , but when the clients joins in the session the clients character apears to be shaking up and down but the servers character is alright

#

how can i fix it

pale hazel
#

Hey, I'm playing around with the Network Profiler, and I'm wondering, are there any "official" benchmarks on what constitutes a good replication performance? Like here in this screenshot, I let 10 AI-controlled characters run around and profiled them for a while. I see my ActorReplicateTimeInMS is ~ 0.15ms, which I assume is... good? bad? expected?
Are there any benchmarks like "If you have ~1000 replicated actors, an average acceptable ReplicateTime is X milliseconds"?

upbeat basin
# pale hazel Hey, I'm playing around with the Network Profiler, and I'm wondering, are there ...

Is 0.15ms for 10 character replication too much to raise an eyebrow? That I don't know.

But personally I'd say the definition of acceptable would depend on your project and target frame time, from what I've seen around here with this kind of questions. Are you below your target frame time even if it eats up 5ms? That's still acceptable. Is your most crucial logic eating up most of the frame time or bandwidth? You build your game around it so let it be, as long as you're still below your targets

pale hazel
#

Thanks for the advice
I see, yeah that makes sense of course. I'm mostly worried that down the line my ReplicateTime is slow enough to impact performance, and me not knowing this because I don't know what the "normal" ReplicateTime is for a game my size. So let's say I don't hit 60 FPS and don't realize that my replication is a big source of error since it takes up too much time.
But I guess I'll figure it out when I get there.

upbeat basin
#

You can also profile with same amount of empty/without logic AIs to define your base value and see how much more you're putting on top of it to see if there is any room for you to shave it off

Which again can understandably raise the question of "is my stuff adding 0.1ms too much or not". But could at least give you some understanding of it over time to say "hey I've never seen this much of an impact before, let's see if there is anything to optimize"

pale hazel
#

Yeah, that sounds like a plan to at least have some data to compare performance to, thanks!

blazing spruce
blazing spruce
kindred widget
#

No manual widget creation code and whatnot. You make a listview entry widget. And one gets created for you, and you can override it's init event. You'll see an example of it when you look them up. You'll cast the object it gives to PlayerState, and you're good to go.

hasty elm
#

Hey guys, I have a question - if I have [an online] coop game where both players should always be together, i.e. on the same level and/or sublevel, is there a way to trigger a level switch in Unreal 5 without losing the client's connection?

I tried using OpenLevel but of course the client DC-ed, which is not what I want.

I've seen online some people post about using sublevels; is that really my only option?

thin stratus
#

And make sure the GameMode you are on is marked for SeamlessTravel.

#

Otherwise the Client will disconnect and then reconnect.

#

Results somewhat in the same, but SeamlessTravel is "smoother".

#

ServerTravel in BPs is done via ExecuteConsoleCommand node

#

With ServerTravel <MapName>

#

OpenLevel is a ClientTravel, so that is, as you notice, wrong.

hasty elm
dark parcel
#

How do you get the delta of 2 array?

I have a function AddCharacterToParty(actor Inactor)

Team Array.Add(InActor)

How can I get the actor being added on TeamArray onRep?

#

I can just loop the old and the new and find mismatch but is that the only way?

thin stratus
exotic wasp
#

^

thin stratus
#

The OnRep can give you the old value fwiw

exotic wasp
#

if you dont care about order, fast array would work for that

thin stratus
#

It is, however, really not that bad to just loop the arrays a bit

#

Epic does that in several places too. I doubt you have that many entries

exotic wasp
#

as long as the array isn't massive i doubt it would matter

thin stratus
#

Pretty sure I did that too somewhere. That was when I learned that marking some elements of a Struct as NotReplicated can be a real headache

#

I think I had some custom Cooldown setup for GAS with prediction and buffering etc.
And some properties of the Array containing the Cooldowns were not replicated on purpose.
Turns out, when the Array shrinks due to removing, e.g., Index 0, it doesn't fully move Index 1 to Index 0 on the client, but just fills in the replicated properties and leaves the non-replicated the way they are.

#

Took me a bit to notice that

exotic wasp
#

oh, so it doesnt even zero out the non replicated properties?

thin stratus
#

Nope :')

exotic wasp
#

gross

thin stratus
#

0: { RepString: "Foo", NonRepInt: 30 }
1: { RepString: "Bar", NonRepInt: 42 }

Remove Index 0 on the Server => replicates and becomes
0: { RepString: "Bar", NonRepInt: 30 }

#

Really yucky

#

I yeah, now I remember, I think I then wrapped the Array with a Struct, basically a Container.
And in its NetSerialize I handled that myself by serializing the new array into a local one, doing the compare stuff that ColdSummer kinda needs, and then reconstructing the actual array the way I was expecting it.

#

I love multiplayer.

twin vessel
thin stratus
#

I think they both suffer from that, but it's been a really long time since I dealt with this

normal viper
#

Would it be correct:
You can own Actors as a client if you keep setting Owner as Player Controller that firstly spawned the actor and so on (possible to call rpc from them).
Actors that are controlled by AIController cannot be owned in that way (so you have to send Request to Player Controller first, so he can call something on server).

thin stratus
nocturne iron
#

I'm looking to implement a centralized system for managing items in the ARPG I'm developing in my free time. I want it to function as a global subsystem where item and inventory data can be stored efficiently, and the backend server can communicate with my inventory database and trade services asynchronously.

Since the server will handle key decision-making -such as determining when and for whom items drop- I believe it would be impractical to split this system across multiple components, like individual PlayerState/Controller instances. A more unified approach would provide better control and scalability.

I also want to manage communication strictly through Server, Client, and Multicast RPCs to maximize efficiency and ensure robust client prediction. I find it simpler to work, and predict, with in these types of systems compared to replicated UPROPS.

Soo, Is it possible to replicate subsystems or is there something I can do to achieve this kind of architecture?

#

I guess my central issue is that Server RPCs only works on owned objects.

#

It seems that no matter how you turn stuff like this, it is always required to proxy stuff though a client owned object.

quasi tide
#

Easy mode:

WorldSubsystem with an actor proxy. Have the subsystem spawn the actor and then just route stuff through it.

Could also do a component on the game mode or game state.

#

Obviously you'll still have to respect the typical network rules when it comes to doing server rpcs

#

Scratch the gamemode actually. Because you want multicast rpcs

nocturne iron
#

Yeah, thanks.

#

I will do a proxy.

quasi tide
#

Could also do an AInfo type actor

#

The power is yours

nocturne iron
quasi tide
#

It's how some of the other stuff UE does it. Like AWorldSettings and other things that are configuration-y stuff in the world.

nocturne iron
#

Just curious, is there any reason for ownership being inforced so strongly? I (think) I woul absolutly love being able to just send request and handle them manually?

quasi tide
#

Rules of UE.

nocturne iron
#

So no actual arguments?

quasi tide
#

Makes sure people can't do server rpcs on things that they shouldn't

nocturne iron
#

I guess that makes a little bit of sense..

#

Do you know if it is possible to hook into something deeper and bypass it, or is that just stupid and i should obey the Epic gods? <3

quasi tide
#

I mean, I'm sure you can with enough digging. But I don't know where.

nocturne iron
#

Would make mental motel sooo much easier,

quasi tide
#

I'd just obey the overlords personally.

nocturne iron
quasi tide
#

Makes things easier.

#

But you can do entirely custom networking if you want.

nocturne iron
#

It would be fun to play around with. If it can be build on the protocols unreal already has in place effectivly. I think the ownership architecture forces some overcomplicated solutions, that could be drastically simplified in a few situations, like this.

#

Thanks for tips and helpfulness <3

ripe lotus
#

Hey ppl, i have an actor on the level, and i've overriden IsNetRelevantFor but it's not being called. Anyone has ideas?
I've set multiple replication flags on the actor including SetIsReplicated. it works on the pawn, but not on an actor that's on the level.

ripe lotus
#

with a static mesh set to movable.

ripe lotus
#

well, i just created a new empty aactor that's even more barebones, and seems it worked. so maybe the other actor is failing for some extra work. thanks amberleafcotton.

exotic wasp
#

ownership is a needed concept to prevent easy cheating

calm tendon
#

Does anyone know if it is safe to access the GameState object (and any actor component attached to it) in the BeginPlay() method of any Actor on the client? Or could it happen that any Actor's BeginPlay() method is called before the GameState has been replicated from the server?

dark parcel
#

Also the game state won't be replicated yet for sure

#

It takes time for server to reach client

#

This is true for anything on begin play

#

You always use OnRep to ensure that an entity is receiving the data

sinful tree
#

Trouble is that there's no OnRep or built in dispatcher to signal that the GameState is ready other than the BeginPlay of the GameState on the client.... You'd basically need to ensure that your gamestate Begin Play calls the logic required on such actors directly since those actors technically couldn't bind to anything to listen for when the gamestate is ready.... Which sounds like a bit of a pain since you somehow need to get those actors within the gamestate so that it can ask them to do something.

The alternative would be use something like the GameplayMessageSystem from Lyra where you can have actor just listen for generic messages, and then have the GameState broadcast using it to anything that may be listening. That means for the actors you can just check on their BeginPlay if the GameState is valid, if not, listen for the message, if so, just read whatever values from the GameState as you need or bind to other dispatchers that you may have on the gamestate.

calm tendon
nocturne iron
sinful tree
# nocturne iron Can you explain why? If I where to bypass it, wouldn’t a simple token be enough ...

If I send an RPC to the server through an Actor I don't own, the ownership check basically makes sure that I wouldn't be allowed to do so, both on the client side and on the server side. If someone happens to spoof their client to allow them to attempt to send the server RPC anyway, the server would still end up rejecting it.

So let's say we got rid of ownership entirely and I sent an RPC through another player's character - I could send something like a "Drop my Inventory" RPC on someone else's character - since the server can't validate the RPC came from the client who is supposed to be in control of that character since you've abandoned ownership, it would ultimately mean the server would probably drop the items for that character, even though someone who wasn't in control of that actor requested it. If you make your own system to validate who is requesting it based on a "token", you're basically just reinventing the ownership concept anyway and you would still need to ensure the token is assigned on the server first before allowing a client to make requests on that actor, otherwise you'd run into the same problem.

normal viper
#

Can I read data from actor not owned by client, by getting PC, interface get info, there i check team settings of requester and PC, and this gives me player state I need, can I just read info without server rpc from player state?

dark parcel
#

Received doesn't mean replicated

#

You could very well get the gamestate beginplay but that doesn't mean it is already replicated.

#

Read what wizard says right after the comment

#

In general you can only be sure that something is already replicated with OnRep

dark parcel
#

As client you have your own world, your own instance. You can read what ever on your instance, there's no need or an ability to ask for permission

#

You would just be reading what ever data is in your world.

#

If you need to ask server, their data then you do use server rpc then server answer back with client rpc

twin juniper
#

Hi there, I'm actually reworking my inventory system and need opinions on something. So atm when a player pick-up an item it gets added to a hotbar/quickbar but it doesnt gets equipped. Internally we are creating the item actor (which is the one displayed in it's hands when equipped), BUT there's scenarios where a player will pick-up an item and NEVER equip it, so I was thinking to move the creation part to when the item gets equipped for the first time, I'm just questioning actually if a player with medium ping would see a difference (even in ms) compared to another player as this could be frustrating while fighting and switching weapons and having a higher delay.

ripe lotus
#

i have a level actor that is replicated. i want to call multicast rpcs from the server. but they aren't being called on any client (only on the server).
can that be fixed or is it impossible?
the actor has a role "None" which seems odd to me. is just an actor placed on the level.

dark parcel
#

Also do note that client can't call rpc on actor they don't own.

#

So client getting that actor -> server rpc -> multicast will not work as the server rpc is denied.

ripe lotus
#

yups its called from the server itself.

#

which i find weird, because other things like a rotating movement with replicated setting works. but my rpc doesn't.

dark parcel
#

Show your code

#

I hope you don't rotate with multicast though

#

That do be the wrong way to do it

ripe lotus
#

hmm not sure i can show the exact code.

dark parcel
#

What are you trying to do btw?

#

Many people abused multicast for very wrong reason

ripe lotus
dark parcel
ripe lotus
#

the rpc is more complicated. it's on a component that i can't share. i have that component on pawns dynamically spawned and it works. but not here.

dark parcel
#

Well what shown hasn't got any rpc in it.

#

Just make a new actor, and have server call multicast functions

#

Print string

ripe lotus
#

yup that's what i said above, im preparing the code. give me a sec.

dark parcel
#

See if that work

ripe lotus
#

that's pretty much what the function does.

dark parcel
#

@ripe lotus I mean u got a bunch of override there that I never touched

#

Potentially making it not relevant etc would yield unexpected result

#

If the actor is not relevant then I would guess the rpc will not get called

ripe lotus
#

i didnt had those overrides and sitll didnt work.

#

and the actor is visible on the other clients, which it wouldnt if it wouldnt be relevant.

dark parcel
#

I can try after work

ripe lotus
#

this is my multicast.

#

and like i said, i have that component on a pawn, and it has been working perfectly so far.

dark parcel
#

And how are you calling it?

ripe lotus
#

i tried several ways, by a collider, by a callineditor function. and dynamically with other code.

#

i know it triggers because it triggers on the server. my log prints if its on the server or client.

#

and i've seen it print correctly with the pawn.

dark parcel
#

@ripe lotus sanity check, you omit the _implementation when calling the function right?

ripe lotus
#

void ANetTest::Multi_Implementation() {
UE_LOG(LogTemp, Warning, TEXT("%hs server=%i name=%s"), func, isServer, *GetNameSafe(this));
}

UFUNCTION(BlueprintCallable, CallInEditor)
void Test() {Multi();}

UFUNCTION(NetMulticast, Reliable)
void Multi();
#

i tried that. still only triggers on the server.

#

if i call it from a client's world, it's only from the client. so i know i'm triggering it on the right world.

dark parcel
#

Like I said you can't call multicast as client

#

Unreal is server to client model

ripe lotus
#

yeah i know. but anyway. just to rule that out.

#

this on the pawn works, on a level actor doesn't.

#

i tried searching online but found nothing.

dark parcel
#

@ripe lotus and the actor already set to replicate?

I think it should work

ripe lotus
#

(by this e mean a reliable multicast)

dark parcel
#

I will try after work

ripe lotus
ripe lotus
dark parcel
#

Hopefully someone else can clarify on the mean time

ripe lotus
#

thakns a lot.

#

i've also tried setting the owner to the 1st local player controller on the listen server, on beginplay. but no luck.

dark parcel
#

@ripe lotus you shouldnt need to do anything on the client

#

Server call MC and everyone should run the function

#

Just to clarify its server calling the mc right?

#

I have yet to see the code that calls it.

#

Your Test() need to be called by the server

ripe lotus
#

yes the server calls the mc. only the server gets the function. none of the clients.
the actor is replicated.

pseudo wagon
#

Try remove the line NetDormancy = DORM_DormantPartial; to see it work.

ripe lotus
#

i've tried setting it to dorm_awake; too. both not having it and having it as awake makes no difference.

pseudo wagon
#

Do you try to test with BP Actor.

#

Also when do you call RPC.

ripe lotus
#

i tried with a cpp actor and a bp actor.

#

i trigger iwth a button, whenever i want. it doesn't make a difference.

pseudo wagon
#

You are running listen server or server mode?

ripe lotus
#

listen server. why?

#

its working on the pawn. so i don't think that would be an issue.

pseudo wagon
ripe lotus
verbal ice
#

@chrome bay wanted to notify you of a typo in your burst counter article:

Ar.SerializeBits(&bIsIncrementing, 1);

bIsIncrementing should be bIsFiring from what I see

chrome bay
#

Oh lol.. classic

#

Thanks, I'll update it when I can

fervent condor
#

Oh I should probably mention its the Mover plugin, seems to be movement related, but not sure what the deal it

nova wasp
#

is this due to mover having a buffer of saved moves or because of actual time across the network? you need to compare actual rpcs/properties timing here and not just where they are I guess

#

FWIW I have no clue how Mover works in detail but I can say for certain that buffering heavily and storing past values is an extremely common way to handle character movement replication

fervent condor
#

can't be network, cause its local on this machine. Could be buffering though

chrome bay
#

Until they remove the Network Prediction Plugin as the basis for Mover it's not worth using IMO

#

NPP is a trainwreck

fervent condor
#

If thats whats causing the lag, it needs a lot of work

chrome bay
#

A lot of work is an understatement

#

I thought they had a kinematic liason for mover to treat it more like CMC, maybe that's not a thing yet

slim jay
#

Hey, im only having this issue in the shipping server build. The server runs fine in test and development builds. What could be the problem? I tried running it with steam both on and off but the result is the same

normal viper
# dark parcel Wdym by getting PC? Beware that client only know their own PC and no one else

Yes, but if you execute normal event, it is gonna execute on every player controller in the game right? and then inside pc is check if team=team, and the rest of code will actually run on server + on exact player state I want (where player 1 = player1 and player2 and 3 will be ignored), and question is if to read data from player state i need server, but i think i dont? event how to structure event (probaly would need to be function) to call rpc to just get variable?

dark parcel
#

Wdym if you execute a normal event it's gonna execute in every pc in the game.

#

I think you are still thingking the game is one entity for everyone

#

It is not

#

We all run our own code with our own instance. It's the job of the game developer to establish communication to give illusion that your world is sync.

normal viper
dark parcel
split siren
chrome bay
#

I'm not on HLL anymore, they were and probably still are just PhysX vehicles with server auth

hollow bridge
#

Anyone has a link to the last UE multiplayer session? It was 2 weeks ago and I can't find it

bright summit
#

I have another problem with replicated actors. Made the breakable prop actor which has components like static mesh ,geometry collection. Each instance in the level has applied other mesh, other properties etc. With this there is no problem at all until I want to spawn at runtime new actor from the template of another. On the server all properties are set properly from templated actor but client do not have them set properly because they are not replicated. There is a way to make it proper without replicating every property to the clients? It's a lot of data and I am assuming that I am doing something wrong

normal viper
# bright summit I have another problem with replicated actors. Made the breakable prop actor whi...

So I'm not sure if this will help you, but you might leave it as it is for the ''base'', and then inside this actor send request to the Player Controller. After taking Request Player Controller could call back to this actor and set properties only on his own client / only for himself. You would need to hold these properties in Player Controller though. I might be wrong but just helping to rubber duck the problem a bit 😄

tardy fossil
#

another thing you might be able to do, if the template is net addressable is pass it as a replicated variable and have the client copy the properties itself in an on rep or something

bright summit
#

so should I have separate blueprint class for every breakable prop in the game? 😄 that sounds like a terrible idea 😛

dark parcel
#

What's dormancy is all about? I read the doc but can't quiet grasp it yet. How is it any different then making an actor not relevant?

#

Apparently it's one of the best optimisation one can do as well

chrome bay
#

Dormancy actually closes the actor channel, so the actor isn't polled for changes

bright summit
# dark parcel What's dormancy is all about? I read the doc but can't quiet grasp it yet. How i...

https://www.youtube.com/watch?v=mT8VUVuk-CY I recently watched this, they talk a lot about dormancy

This week we'll be joined by Ryan Gerleve and Dave Ratti to discuss general server optimization in UE4, as well as techniques and solutions to improve your Actors' performance in a networked environment.

NEWS

Unlocking Breach’s combat with Unreal Engine
https://www.unrealengine.com/en-US/tech-blog/unlocking-breach-s-combat-with-unreal-engine
...

▶ Play video
dark parcel
#

Ty

dark parcel
chrome bay
#

Dormancy is always for all channels, per-connection dormancy has never worked AFAIK

#

And yes dormancy is a per-actor setting

#

Making it dormant basically destroys the replication channel for that actor, destroys the history state etc, and stops it replicating to all clients - but only once all relevant clients have acked the latest state.

#

There are drawbacks

tardy fossil
chrome bay
#

Opening the channel again is equivalent to just spawning a new actor (as far as networking side is concerned), so all properties are sent again.

#

Dormancy is usually reserved for actors which very, very rarely change state

dark parcel
#

🙇‍♂️

chrome bay
#

You could argue it only has to exist because the engine doesn't have a true "push model"

dark parcel
#

I will try to dechiper what was said and do some practical work

chrome bay
#

Relevancy still incurs cost

#

An actor which isn't relevant is destroyed by the client for example, and respawned when it becomes relevant again (unless it was a map startup actor)

bright summit
chrome bay
#

Also relevancy is per-connection

#

And actors might not be relevant to anybody, but will still be polled for changes

tardy fossil
#

i mean its the exact same as using templates and copying properties off them, just with less steps

bright summit
#

I know 😄

#

maybe you are right and this is not worth at all and simpler would be just to make a bp class per level for actors which should be dynamically spawned

#

I am wondering also about making the custom asset type which would hold all the info as breakable prop and allow me just to "drag n drop" to the level. It should have configured all properties etc. because dragging and dropping the actor class and then setting meshes, all other properties is kinda time consuming. So maybe if I would have something like this then making "spawner" would be easier 🤔

tardy fossil
#

could possibly look into that new dataflow thing for UE 5.5.. from what i understand it can create assets dynamically with programmable inputs.. like you can make a dataflow that takes an array of geometry collection assets and generate a blueprint or data asset for each

#

i havent used it yet so that might be inaccurate

bright summit
#

I will take a look, thanks

#

it looks just like "macros" for applying the same workflow to other assets for example to achieve the same fracturing method for geometry collection

late surge
#

Can someone explain to me online service like steam or epic do in multiplayer unreal game?

#

Like people can open session, join and play without a dedicated server or open port?

split siren
late surge
#

Yeah I know that, but do they have anything to do with hosting & joining session?

#

The player still have to host by themselves or joining a dedicated server right?

split siren
# late surge The player still have to host by themselves or joining a dedicated server right?

Don't quote me on this one, but for example Steam allows people join sessions on non-exposed ports via NAT punching.
It is not a feature all online subsystems provide, such as Facebook.
So the answer is kinda, allowing Steam Online Subsystem should allow players to join non-public instances, but it's more on Steam backend and Steam Client rather than the Steam Online subsystem.

dark parcel
#

@ripe lotus No problem whatsoever

#

Create an Actor -> mark it as replicate.
Server Call MC_Functions -> Clients will fire the function

upbeat basin
# late surge Yeah I know that, but do they have anything to do with hosting & joining session...

As stated above, store platforms have their own backend services like leaderboards, accounts, inventory etc. But they all provide their own SDK and implementations and expect you to integrate those SDKs into your projects to communicate with their services. The main functionality of the online subsystem (OSS) plugins in UE are to provide a unified interface to use those SDKs, without changing your code from platform to platform. So you can write your code once using the OSS plugins and change which one you want to initialize on your config files, without requiring to rewrite your code for a new store platform.

Most of the tutorials about OSS plugins cover sessions interface hence your question probably. If you develop a multiplayer game with listen server hierarchy, sessions interface of OSSs come very useful. Because in that case you would need to know your friend's or a random players IP and port to connect to their game. But most PCs are behind a NAT, which means IP addresses are not unique per machine but per router (I guess) and machines under the router have another layer of address distribution. You could solve this problem yourself but it requires a dedicated server again to let clients communicate through that server and exchange their local address information so they can establish a connection between them. In summary, OSS plugins that implement the session interface (both Steam and EOS does for example) provide you this functionality for free. So you create a session in their backend, connect other players to that session and get the connection string (using IOnlineSessionPtr::GetResolvedConnectString()) you need to connect to your game host (your listen server)

Sessions are also useful for the advertisement of dedicated servers too (like they are for listen servers). They can register themselves to, again, target platform's backend labeled as a dedicated server. So when players search for sessions you get your server list to select from

brazen orchid
#

can i run 16 player listen server or is it too much

upbeat basin
brazen orchid
#

so i could run in a small game?

upbeat basin
#

It's not impossible. But every bit of overhead you have will decrease the number of players you can have without impacting FPS and latency

#

Which will be a different number limit for every different player, since they'll have different specs

brazen orchid
#

is it related with host's internet connection

upbeat basin
#

Yes, host machine will be the most resource hungry one, both for bandwidth and CPU, since it'll have connections for each player, while clients will only have connection to server only

brazen orchid
#

can i assign the host before the game starts? if i want to assign host to optimal player

#

i meant any host can create a lobby when it hits max amount of players before the game starts

#

i want to change the host to player who has the good hardware build or internet whatever

upbeat basin
#

That might be tricky with listen server, I guess in theory you need to first gather all players under a host, decide who should be the host for the gameplay, decide on a way to let players specifically find each other again (or that host), abandon the current session and create/find the new one with the promised way of finding each other again

formal turtle
#

can someone tell me when exactly is Replication Graph plugin needed in multiplayer

#

in logs it tells me that the driver is null, so I enabled the plugin and added extra stuff into the DefaultEngine.ini

#

but just wondering if that is actually required

chrome bay
#

it is required yeah

#

Assuming you actually want to use Replication Graph - but you'll have to create your own implementation to have any real benefit.

formal turtle
#

so that can be ignored when using steam subsystem?

#

it just says it is null. for some reason our server is refusing to even get notified about incoming connections

chrome bay
#

Replication Graph is just a different replication method, you don't need it

formal turtle
#

ah

#

any idea if port 7777 should be listed as open when you open it for the server?

#

because it shows timed out/closed all time via port checkers

#

really dont know where the issue is, vps works fine on the other hand

chrome bay
#

no idea honestly

#

Keep in mind Steam specifically doesn't allow you to connect back to the same machine via steam

formal turtle
#

i only noticed that 7777 is being used when steam is not initialized which makes sense from binding pov, but when i use steam subsystem then it changes the port to 27015 which is normal for steam. however our server is not just nonresponsive...

#

is just not responsive*

hybrid meteor
#

would someone love to try my game

livid gale
#

over a week spent on this issue, and I can not, for the life of me, figure out how to get the save file created for the client to load for the client. Whenever reconnecting to the server it loads the server's inventory file.

#

The internet is surprisingly devoid of any and all multiplayer save system tutorials.

quasi tide
#

A simple way is to just save based on the player's unique id. Then when they connect, check if they have a save file. If they do, load it. Anything that is replicated should replicate once you deserialize.

livid gale
#

I thought so as well, but I seem to be Fing that up somewhere.

#

I'm passing the unique ID from the player state to the game instance and appending it to the save file name

#

so it is indeed creating a save file per ID

#

but whenever I test over steam it loads the server's save file. I'm at a loss.

#

I'm assuming this is the correct set up

dark edge
livid gale
#

@dark edge No clue, I haven't a single clue as to how this should even be set up, I've had multiple people tell me multiple things and each one conflicts with the other. All I'm trying to do is have the connecting client's inventory they had upon leaving the game reload if they reconnect to the host.

loud umbra
#

Hello guys, i think this is an easy question, but i cant get this SIMPLE RPC to work. Quick explanation of what I want to do: The picture is taken in my Characters Event Graph. I want to fire this function (Buy) which is stored in another actor (the shop character) on all clients. But it only works server sided?

exotic wasp
#

i also imagine that your first "Client" RPC is redundant and doesnt need to be a RPC at all

#

what does your Buy function look like?

latent heart
#

Client and Server don't mean "only run on the client" (or server, respectively)

#

(which a lot of people get wrong, not saying you did, plinyvic!)

lost inlet
#

<@&213101288538374145>

#

Thanks

mighty valley
#

Hello. I created a crosshair that dynamically changes depending on your current accuracy (Labelled "Bloom"), however, it only properly updates on client 1, and does absolutely nothing on client 2.

Does anyone know a fix?

#

All of the values that update the bloom run on the server (These are when the weapon fires, when not firing every tick, and when you equip the gun)

dark edge
#

gate that by IsLocallyControlled

mighty valley
#

Added a branch with the is locally controlled at the start of begin play, and it did nothing, same issue

#

Should I use the literal gate function?

dark edge
mighty valley
#

The widget exists everywhere, it's the movement of the crosshair lines that doesn't

dark edge
#

show how current bloom is updated

mighty valley
#

These are 2 of the examples. The firing one is large and also spaghetti code

#

Haha scam ai

dark edge
#

just update bloom on tick

#

no rpc or nothing

mighty valley
#

No replication

#

Got it

#

Sorry, I am still learning Unreal (Rapidly, but still struggling)

#

Still doesn't replicate the bloom

#

Trying something different

dark edge
#

and tick is where it's decreased

#

Shot -> bloom go up
Tick -> bloom go down

mighty valley
#

Nothing of what I am doing is fixing anything, in fact, most of it is making it worse.

mighty valley
#

The only time the code goes up, outside of setting a minimum, is this

#

The firing code that is a mess

dark edge
#

so CurrentBloom goes up everywhere

mighty valley
#

Yeah

dark edge
#

now make it go down smoothly on tick

#

and print it

mighty valley
#

It's going down on both clients

#

Not the crosshair

#

Just the bloom variable

#

I should rephrase that

#

The individual bloom per client is properly tracking

#

The crosshair is what's not updating

mighty valley
#

Could it be an error in the widget, or how it's created?

mighty valley
#

IDK anymore

echo pasture
#

not gonna ping cause I know that's annoying, but where in the unreal code base would I do something like this? Is it in the NetworkedPhysicsSettingsComponent ?

#

also I'm assuming 'replicates movement' needs to be checked for any of these settings to work right?

mighty valley
ripe lotus
dark parcel
#

I am 110% can do it in cpp too no reason that shouldn't work

#

What is your requirement for the test?

ripe lotus
# dark parcel What is your requirement for the test?

cpp actor, replicated, has a multicast reliable function, can be called from the server, received by the clients.
also would be good if it triggers IsNetRelevantFor.
placed on the level.
thanks so much for the help man.

meager heart
#

I'm trying to replicate some uobjects that I dynamically create at runtime using the documentation here, but for some reason they are always null when the client requests them

Am I missing anything? The actor who's creating them and adding them to its replicated subobjects also has bReplicateUsingRegisteredSubObjectList = true; in its constructor

formal turtle
#

If I have server done with unreal engine and Its connected to steam do I still have to put some code somewhere in instance or game mode that basically tells it to create a session with has authority node?

exotic wasp
meager heart
grand kestrel
#

@thin stratus @pallid mesa Here it is. Actor-Based TIP. Not Mesh-Based like Epic's (Lyra, probably Fortnite)
I'm going to release this publicly and try to establish it as the new standard 🙂
Pink shapes = server, blue shapes = sim proxy
Latency ~180ms, replication is only for sim proxies, and its a uint16 with push model

#

Info for anyone who is curious:

Avoid mesh-based TIP because:

  • Fights the sim proxy's mesh smoothing
  • Forces you to use inferior linear rotation smoothing
  • Forces you to use the inadequate linear translation smoothing that simply isn't good enough because Epic didn't separate them out
  • Or, separate them out yourself, which is a lot of work, and the code is one big cobweb that you have to re-learn every time you look at, and adds uncertainty and drastic time for isolation if you have sim proxy issues
  • Causes jitter on sim proxies
  • Has to be compensated for in every single animation/locomotion system you make
  • Causes issues with a lot of procedural systems esp. involving sockets and race conditions with the anim graph's rotate root bone node
  • Pervades your anim graph

Use actor-based TIP because:

  • Has no issues whatsoever
  • Can be tucked away almost entirely in code
pallid mesa
nova wasp
#

what does the sent data represent here? the current direction they are TIPing towards or the absolute rotation?

#

or something else?

grand kestrel
#

I can probably respond better in the morning, on phone about to sleep but..

grand kestrel
# nova wasp what does the sent data represent here? the current direction they are TIPing to...

There is actually nothing being shown on that screen, unlike mesh tip it's not offsetting from the characters rotation, it just stores the actual offset itself

There are two entry points used to rotate a character, ACharacter FaceRotation and CMC PhysicsRotation. Both of those get overridden to make a call to my turn in place component instead with matching functions that apply the offset to the rotation

#

I'll post video tomorrow with debug arrows

#

It's not shown here but it can tip with Orient rotation to movement, using last input vector

#

Not only strafe movement

#

My system is also vastly more feature rich and can increase turn rate when alternating direction or at max angle and supports multiple step sizes and anim states etc

grand kestrel
#

Watch what your sim proxies do when you rotate your control direction insufficiently to trigger a turn, they will wobble, because the root yaw offset is applied linear so if you smooth the rotation exponentially that's the expected outcome

#

Oh I think I misread what you said

#

I'll need to look again tomorrow on my PC. You can ignore my response

#

I will say this, having the actor rotation being the true rotation makes sense

nova wasp
#

It does seem more simple to not have to fight how smoothing works at first glance... I'll take your word for it

grand kestrel
#

I don't need to factor in any offset in my math, unless I want to know "where would you be facing if you didn't have turn in place"

grand kestrel
nova wasp
#

(sorry, wasn't trying to ask for the code there lol... you don't need to clean this up if you don't have time etc)

grand kestrel
#

I wanna stop people using epics solution coz it's nasty

#

Oh I know but you won't have to take my word is what I meant

#

I'm turning this into a plugin with the intent of releasing it free

#

So that people will stop using lyra solution

#

Mine also supports start moving animations by letting you blend out the turn offset based on the rotation curve from the animation so you get really accurate start rotation blending. e.g. start moving 135°, etc

thin stratus
#

;_; Why do we talk about animations and multiplayer when I have to get MotionMatching working with Mover.

dark parcel
#

Btw when you guys used motion warping, is it normal to deactivate correction?

#

If I don't do that, the character keep getting correction.

#

Like big time correction

thin stratus
#

Not really.

echo pasture
thin stratus
#

Server and Client would do MotionWarping at the same time after all. @dark parcel

echo pasture
#

probably the most embarassing code I've ever written in my life ^^

thin stratus
#

"we currently story all items client side"

Noice. That's a fun way to make sure the rest of your game has ugly code.

echo pasture
#

yup

dark parcel
#

Sometime minuscule but when it's not it cancels my next montage 😦

echo pasture
#

I need to make it server side fast before the code gets too ugly, it's already super ugly already and I can't afford it getting worse

thin stratus
#

Depends on what you are doing there. I usually make sure the Montages are played based on Movement code triggering them. E.g. for Vaulting.
Other Montages might be a bit tricky, but you can def make sure that Server and Client play them.

dark parcel
#

It's combo montages so not linked to movement.

#

They both playing but client have some correction.

#

I thought I had bug else where when some of the attack in client keep getting cancelled mid way

latent hamlet
#

I'm probably missing something simple, I've made a local multiplayer game, and I'm trying to get a pause menu to work where the player that presses the pause button is the one that can select options on the menu. However even if I open it using the second players controller, only player 1 can control it.

I have tried passing in the player index into GetPlayerController to then have that as the owning player of the widget as well as setting the input mode to Game And UI. Any other ideas of what I'm likely missing?

thin stratus
# dark parcel It's combo montages so not linked to movement.

Rapid execution of different Montages can be tricky. Disabling corrections during that isn't too bad of an idea.
Idk how you trigger these Montages exactly, but if you aren't using anything specific you could think about routing the input to trigger the attacks through the CMC. Not perfect but that would make sure they are in sync :P

thin stratus
thin stratus
thin stratus
#

Beyond that, "focus" is a huge thing in UE. Native focus handling is a bit wonky, especially with couch coop.
You gotta make sure you assign USER focus and not KEYBOARD focus or such things. Setting the InputMode is also fine, but you might cause it to focus the Widget with Player 0 due to the "WidgetToFocus" pin. That might just use the general Keyboard one, which will always be Player 0 iirc.

#

Might also want to consider using CommonUI if you aren't already.

#

That might help a bit with the focus etc.

latent hamlet
thin stratus
#

ActivatableWidgets in CommonUI can set the InputMode directly when getting activated (might need a C++ child of the class to expose the DesiredInputConfig though).

latent hamlet
#

I'll start digging down the focus path along with moving it to the player controller

thin stratus
latent hamlet
#

I am using CommonUI, who knows if I am correctly or not lol

thin stratus
#

When using CommonUI, I usually subclass the ActivatableWidget and expose the variables for the GetDesiredInputConfig call.
That way I can set what InputMode is being used per ActivatableWidget. Benefit of that is that you can turn your main HUD and all Menus to ActivatableWidgets and set their InputConfigs to Game or GameUI or UI.
Might need a bit different thinking for CouchCoop, as you might want to set it to GameUI or UI based on how many players have the UI open.

#

Otherwise, if you aren't doing any of that, make sure you handle the InputMode in a central place.

#

A lot of people start calling SetInputMode in every place they create widgets, alongside show cursor and what not.

#

Not realising that they might create code where WidgetA and B both set the input mode to UI, and then WidgetB closes, setting the Mode to Game while WidgetA is still there.

latent hamlet
thin stratus
#

Before common UI I usually had my InputMode logic in the PlayerController.
Wasn't pretty, but I basically checked on Tick (which Epic also does fwiw, and it's not bad to use Tick!) different conditions like "Are any Menus open?" "Are any Dialogs open?" etc. and then changed the InputMode based on that, keeping track of it with an enum. CommonUI has an enum for that already fwiw.

#

For Couch Coop it might be better to place that code into something else. Maybe the GameState Tick, cause you might need to scan all PlayerControllers for the open Menus to decide what mode you need to set.

#

That's why opening the Menu(s) in the PlayerController is useful, c ause then you have a reference to it there and the question "Are any Menus open?" is easy to answer.

latent hamlet
#

Sounds like a plan to me. Cheers for the help and direction with it

thin stratus
#

No worries. :P structuring UE projects becomes more natural over time. Biggest suggestion I can give is to "structure it the way UE wants it". The more you go with the flow of UEs GameFramework, the easier your dev-life will get.

dark parcel
thin stratus
#

Otherwise you always get a correction at the end.

dark parcel
#

But it's minuscule so not much of a problem

#

But then again can't tell what happens when game is on production

#

With many spells and many modifiers

lament flax
#

how should i set up the OldValue param for my OnRep function when using a TWeakObject ?

when the OldValue should be a valid ptr, on client its always "unknown"

#

well nvm im forced to use tweakptr

thin stratus
#

Can make it const fwiw, as that doesn't matter to the caller in theory.

#

But not 100% sure on that one.

lament flax
#

either way the old value is null for client, but it should hold the old ptr instead

#

idk if its the weakobjectptr fault or something else

thin stratus
#

Do you need this to be a WeakPtr?

#

If the Character (OldValue) got destroyed somewhere in this whole process, then it's totally possible that the pointer would be null.

lament flax
#

its not destroyed

thin stratus
#

A normal pointer shouldn't cause any problems with GC for an Actor.

#

Their Destroy call will cause it to be cleaned up anyway.

lament flax
thin stratus
#

Well the Weak stuff is usually helpful if you don't want the Object to be kept alive due to whatever holds the pointer.

#

But iirc for Actors this doesn't really matter?

lament flax
#

probably

#

i just wonder why i have this issue in the first place

thin stratus
#

Not sure. I never had a WeakPtr replicated with an OnRep that has the OldValue param

#

The new value is valid though (HidingActor)?

lament flax
#

yup

#

the only issue i got is when HidingActor gets cleared, the client doesnt have the previous ptr

#

okay UE is funny

#

i must have a ref

#
// broken
UFUNCTION() void OnRep_HidingActor(TWeakObjectPtr<ATFCInGameCharacter> OldVal);
// works
UFUNCTION() void OnRep_HidingActor(TWeakObjectPtr<ATFCInGameCharacter>& OldVal);
thin stratus
#

That makes.. no sense? haha

#

I should really check what is even passed into the OnReps

#

I always though it's something like this:

const Type OldValue = CurrentValue;
CurrentValue = NewValue;
OnRep_Value(OldValue);
#

In very simple terms

lament flax
#

i guess UE is doing some extra dark magic

thin stratus
lament flax
#

if you find anything intesting ill be glad to here you

split siren
#

A quick question about Iris. How could I associate extra information with uint32 ConnectionId. For example, I want to include a uint8 indicating the pawn class, which I want to fetch in prioritizer. (I can start with a single TMap<ConnectionId, FExtraInfo> )

I guess it should be in either EngineBridge or ReplicationSystem, but any pointer would be great.

pallid mesa
nova wasp
#

UEngineReplicationBridge is final

split siren
# nova wasp I suppose you can add your own prioritizer with some storage, no?

I have a custom prioritizer, and when a new connection is added to this prioritizer, I am going to
UReplicationSystem::GetConnectionUserData to get UConnection and getting the Controller and Pawn from there to set the initial Pawn class for that connection inside the prioritizer.

The problem is updating the data when user possesses a new pawn. Absolutely no idea how to propagate the data to the actual prioritizer because at best I can get a prioritizer handler not the actual object.

I am making changes to Iris as I go, but I want to make the least amount of edits before I fully grasp the system.

nova wasp
#

It might be better to consider the object netrefhandle of the pawn (after you get it of course)

#

but I'm not sure if you need that at this layer of iris

split siren
nova wasp
#

your prioritizer already knows what a pawn is? What's the point of your prioritizer just looking at ints?

#

If you want you can just make the pawns write to it when they init and deinit... I don't understand the goal of "separation"

#

your goal here is type letters into the computer to get a pointer to a thing to make it replicate more... separation is more useful for the overly wraught C array internals of iris

#

Iris has a lot of annoying things about extending it you have probably already encountered

split siren
# nova wasp Iris has a lot of annoying things about extending it you have probably already e...

Yeah, the whole data structure (at least inside prioritizers/filters) is rough to understand (at least for me). But can't argue that vectorizing the data makes it go pretty damn fast.
Extending Iris outside of IrisCore is basically impossible at the moment, since the ReplicationSystemInternal has core functionality that is not exposed.

You are right, I am overthinking it. Since I have a pointer to PC, I can hook into the OnNewPawn delegate to update the Prioritizer.

Thanks for the sanity check

dark parcel
#

@ripe lotus No issue
.h

UFUNCTION(BlueprintCallable, NetMulticast, Reliable)
void RunSomeFunction();

.cpp

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

// Called when the game starts or when spawned
void ATestActor::BeginPlay()
{
    Super::BeginPlay();

    if (!HasAuthority())
        return;
    
    FTimerHandle TimerHandle;
    GetWorld()->GetTimerManager().SetTimer(TimerHandle, this, &ATestActor::RunSomeFunction, 2.f, true);
}
// Called every frame
void ATestActor::Tick(float DeltaTime)
{
    Super::Tick(DeltaTime);
}

void ATestActor::RunSomeFunction_Implementation()
{
    UKismetSystemLibrary::PrintString(this, FString(" runs this function."));
}

#

dropped the actor to the level;

blazing spruce
#

Hi, is there a way to detect if a session is no longer available after you've searched for sessions? I'm trying to handle a scenario where player 1 hosts a session, player 2 opens the server browser which calls FindSessions and finds player 1's session, player 1 ends their session, player 2 still has player 1's session listed on screen and tries to join it but of course nothing happens because the session isn't actually there anymore, ideally i'd like to display a 'session no longer available' message or something rather than it just doing nothing

#

The OnSuccess of the JoinSession node gets called even tho the session doesn't exist anymore and IsValidSession returns true as well so neither of them can detect if a session isn't available anymore

#

I'm using bp's btw

mighty valley
#

Reposting this from yesterday because of continued issues:

I made a dynamic crosshair that is meant to display your current "bloom" on the crosshair. It works perfectly fine for client 1, but not for any other clients.

I have been going around different Discords and Subreddits trying to fix this issue, but most of the time, I have the same results.

#

On all clients, the bloom does update, I have proven that with printing text, but I am still having issues getting it to work with the widget properly.

round glacier
#

I feel like I'm hallucinating -- player pawns are NOT consistently named across the clients, correct? I'm running a listen server, and the non-listen-server client's pawn is logging as B_HeroBase_C_O (from their perspective), but the listen server's pawn IS ALSO logging as B_HeroBase_C_0 (from their perspective).

exotic wasp
#

if it's replicated, pretty sure the name will be the same

round glacier
#

that's what I thought too -- but looking at the ability system debug menu, each local one is _0

#

oh yeah, the GUIDs are the same though

#

the names are different

#

Here is the client's perspective