#multiplayer

1 messages Β· Page 54 of 1

upbeat basin
#

Is it IsLocallyControlled that is not working or your BeginPlay/Tick events?

#

Where do you call this macro from?

near granite
#

tick is only executed on server after open new level!

near granite
upbeat basin
#

I mean, where from pawn

#

Where is the execution line coming from

near granite
#

In tick of pawn!

upbeat basin
#

And what is your PIE play settings, dedicated or listen server, how many players?

near granite
#

I open the server and Joining it by PIE!

upbeat basin
#

Are you sure you're connecting to a server

near granite
#

in the Entry Level, there is open level function to join the server opend. so i click the play botton in the Entry map level

upbeat basin
#

If ip is wrong, server is not open or anything, you'll stay in standalone mode, which will make you authority

near granite
#

before joining server

upbeat basin
#

So your macro would exit from the server output execution pin

upbeat basin
#

It would print a bunch of logs saying someone is connected

near granite
#

but problem happend in the next level that is LV_1

upbeat basin
#

How/where do you change level?

near granite
#

I open the LV_1 by this code from the holo mother, every level's pawn is same

upbeat basin
#

Well, that should be the issue

#

Your input for Key 1 is being processed in Client, not server

#

Which means you're opening a level in client, this would disconnect the client from server

#

If you want to change level and carry your clients with you as well, you need to call OpenLevel in server

near granite
#

additionally,

upbeat basin
near granite
#

additionally, this one is the moment that i open the LV_1 level!

near granite
#

I never thought about it!

near granite
#

When streaming sub level is also same?

#

How can i carry my client when change level?

#

but my client move to sub level of holo mother, and i move to LV_1 as persistant level....client and i not in the same level..but you mean the client in my computer?

thin stratus
#

Server usually calls ServerTravel <mapname>

#

In BPs via a ConsoleCommand

near granite
upbeat basin
near granite
rose egret
#

how to know a client is connected to DedicatedServer in BP

#

I mean I want to know im connected to Dedserver or ListenServer

kindred widget
near granite
#

Level Set Transform is not working, level is always loaded in 0,0,0 not as i set

meager fable
#

Hi, I'm trying to package my game on oculus quest and when I switched to OnlineSubsystemOculus from OnlineSubsystemSteam I'm getting the following error when trying to host a session as a listen server


2023-01-19 16:51:21.225 18389-18434/com.company.game D/UE4: [2023.01.19-15.51.21:225][219]LogOnlineSession: Warning: Oculus: Can't start an online game for session (GameSession) that hasn't been created
odd sundial
#

I'm trying to plug my input axis into animation bp without replicating that float value.... is it already replicated somewhere?

For anyone who may come across this, I used this simple algo to determine a localized velocity and used that to determine my right/left axis input value without replicating anything extra:

FVector::DotProduct(-Character->GetActorRightVector(), Character->GetVelocity());
dark edge
#

It's probably the case where it's locally controlled AND has authority, that is, listen server or standalone

tight crow
#

Hey all. I have a 'ChildActor' component on my Player Character, and I am trying to pick up an item, and then have it set the Child Actor to a specific BP. This all works fine, except when i try replicating it to the other player, so they can see the person is holding it.

I have the Child Actor component replicated, but if I check the 'Replicates' option in the item BP, it doesn't show on either screen. If I leave that unchecked, only the player that has the item out can see that they are holding it. Anyone know how to achieve this?

valid bough
#

Hey would something like character level (like league of legends only relevant for the time of game) be stored in the game mode , game instance or character or playerstate?

rose egret
#

how do I get something unique per actor (like unique name or id)? I made a save game system but it dosent work with WP, loaded actors have different names I feel

grand hatch
#

i have setup EOS subsystem for my project and it all works well until you try to join a session. It just finds a session joins it (or at least the join session node gets a success) after that my menu with host/find session buttons dissapear (as i have setup with my nodes) but after a bit of waiting it just comes back but now i cant press host or find session, if i do they instantly fail (i have made sure that the hosted session is live via the devportal). Does anyone know why this happens? (im on ue 5.1 and using advanced sessions plugin)

twilit radish
twilit radish
grand hatch
twilit radish
#

Personally I find the pawn/character more something to be used for things like health etc.

twilit radish
#

But as a disclaimer the component sucks as it does some weird things. I had issues with it in the past within actual builds that didn't occur within the editor.

frigid niche
#

Say I'm building a persistent world, is it common to save actors like players, objects, npcs, so on. So if I restart the game it can load "stuff" back in the correct positions with correct variables?

twilit radish
#

If it's a persistent world, yes. I'm not sure how you want to persist anything beyond a restart if it's not saved somewhere πŸ˜›

#

The way games do it's usually different but it all comes in the end down to in some way storing the data that is required to rebuild the world upon a restart.

#

Survival games as an example usually split up their world into "chunks" which then get loaded dynamically based on where players are, bringing it all into memory at once and having to load an entire world like in Minecraft would be way too resource intensive. Some games can however totally get away with this. Think of perhaps a colony sim where you only have a small town to manage or whatever. But it simply depends on your needs.

frigid niche
#

@twilit radish ok, yea. I'm on the right track πŸ˜‰ now though, if I create a save object, it could handle all the saving, but I feel that it's maybe safer to use a couple different save objects, is that true?

twilit radish
#

I can't tell you, really depends on your game. You could split up your world into a fully dynamic system like Minecraft for example. You could split it up into a few distinct areas if you have a hand crafted world that's not too big or you could dump it all into one file if that's possible. In the end it comes down to how much data you put in there.

frigid niche
#

@twilit radish hmm ok.

rose egret
#

@twilit radish
I mean netstartup (statically placed) actors , I found out when WP level is loaded actors have different names
something like this:
"BP_ProvinceLootBox_C_UAID_D45D641E2674305D01"_1722036828
I guess they add random id to end of the name

#

πŸ€”

#

thats actually fun cause afaik this way they generate a new name entry evertime πŸ€”

grave lynx
#

question about dedicated server, must tuto create 2 maps, one for server and one for players. On the server map, they are removing all static mesh. Why? and why we need 2 maps

rose egret
#

yea

pallid mesa
#

so every time the cell loads these actors get a different name?

#

or the name is stable between loads and only this ID is generated the first time they get unloaded-loaded

rose egret
#

I just load level (dedicated server, listen) and they have different name

#

I guess the UAID part is diffrent I have to make an new map and check

thin stratus
#

Please rephrase

grave lynx
#

why we need to duplicate the map for server and game default map?

valid bough
fossil spoke
grave lynx
#

thanks u are right

limber gyro
#

have the improvements to replication that epic did for fortnite been implemented in ue4/ue5?

fossil spoke
#

@limber gyro You might need to be more specific than that.

#

What improvements are you talking about?

abstract pike
#

Hi, when an actor is deemed no longer relevant it's destroyed on the client but is there an easy way to have an actor not destroyed but stop replicating?

limber gyro
#

considering a game of the same kind

#

or if u need to go and change stuff

fossil spoke
#

You could in theory do that yes.

#

Without modifications to the Engine.

limber gyro
limber gyro
#

ive seen people on the forums try like 30 something and have no issues

fossil spoke
fossil spoke
#

But Fortnite is not the reason its possible.

limber gyro
#

i know that in theory with optimisation it can be done

#

probably more

#

im just not very aware of those limitations since ive never dived into that kind of game with many players

fossil spoke
#

You need significant understanding of how to design and optimize game systems in Unreal to achieve 100+ players.

limber gyro
#

so i was trying to get a feel for how easy it would be

fossil spoke
#

It is not easy.

#

That doesnt mean it cant be done.

#

If you arent a seasoned developer/programmer, you will likely not achieve it.

limber gyro
#

what number would u say one could realisticly get without optimisation out of the box?

abstract pike
# fossil spoke You may want to look into Dormancy. This stops replication to a connection for a...

Thanks for replying!
Yea just reading about it now on fortnite. I'm just trying to start using replication graph at the moment and so do you know if there are any differences with how Dormancy behaves?

Also, is there a good article about best practice for using dormancy? I see calls like flush net dormancy but I can't tell if that's the correct thing to do over just setting dormancy to something else

fossil spoke
limber gyro
#

lets say a game like unreal tournament

fossil spoke
#

There are so many factors that contribute to the performance of a game.

#

Its quite literally impossible to predict

#

On a broad scale

fossil spoke
#

UT is exactly the same.

#

Its designed to play with small numbers of Players.

fossil spoke
#

The best thing to do is just read the Source Code.

limber gyro
#

i've been working on a overwatch style shooter for a while now and i got all the matchmaker and stuff done BUT ive been entertaining the idea of doing a small mmo after and i have no idea how far a multiplayer shooter is from an MMO, ive heard that MMOs are the hardest thing ever to develop tho

fossil spoke
limber gyro
abstract pike
fossil spoke
limber gyro
#

i see that u work on ashes of creation, how did u guys go about the server?

#

did u use anything from unreal at all?

fossil spoke
#

Intrepid likely have multiple extremely experienced network engineers handling their Servers...

limber gyro
#

so is that custom architecture a separated c++ programar that just sends data?

#

if i am allowed to ask

fossil spoke
#

The bottom line is, unreal is not designed for MMOs out of the box.

limber gyro
#

yes i know that, im just curious if they have actual game logic being handled by an outside program

polar cobalt
#

anyone have a resource/guide on separating the simulation tick rate from the network tick rate in unreal?

limber gyro
#

did u guys redo the cmc?

#

sounds like a pain in the ass

polar cobalt
limber gyro
#

every one could use some tech blogs about MMOs

polar cobalt
#

i feel like individual engineer will never be able to talk about it

limber gyro
#

theres nothing out there afaik

polar cobalt
#

because of PR/IP reasons

limber gyro
#

i really had to dig deep to get some resources for a c# matchmaker, i cant even imagine where to start if i were to do a custom mmo server

#

it really is a pain when u have to rely on documentation and faith

twilit radish
#

I don’t think you’ll find many if any resources on proper MMO stuff. The reason being that it’s extremely specific to the games and just overall difficult. The Division 2 has custom software in able to support hundreds of players on a single instance according to them and that stuff goes far to optimize that. Also with a team of people.

polar cobalt
limber gyro
#

docs alone can be daunting

limber gyro
#

not the inventory stuff, the replication stuff haha

limber gyro
#

those u can find tons on youtube, they are good mostly to check if the have a better algorithm or if the do things in a more clever way

#

speaking of tick, whats the default tick rate on an unreal server?

polar cobalt
#

client tick is based on fps tho

limber gyro
#

thats quite low, i might need to look into that also

polar cobalt
#

ehhh, it depends right, higher tick mitigates actor-advantage, but other ways to mitigate actor advantage could be to increase the length of actor-actor engagements, like giving players more health, or designing maps to provide more defensive advantages

#

tick rate is kinda a "fairness" mechanism in some sense I think, although it has other benefits for overall quality

#

I just want to make sure network ticking is independent from simulation ticking and that the client/server network tick rates match

#

but maybe what I find will help you, dunno

fossil spoke
#

Physics simulation?

twilit radish
#

I guess the general state? So physics, game logic etc. versus actually sending the data.

quaint sleet
#

Hey guys. I tried to Google it and search here but I'm not sure I know the answer. I'm working on a prop-hunt like game and I'm a bit stuck on possessing. I managed to trigger possessing on server, pick from multiple characters, random possess for newly connected players and it works fine BUT the server delay is annoying. I trigger the possess on server but it takes like 50-200ms even on local dedicated server. Sadly, it seems like there is no way to possess on client ... or is there?

quaint sleet
fossil spoke
#

Having an individual Character class for every prop type is a naive approach and just asking for trouble.

shell chasm
#

.

polar cobalt
# fossil spoke What do you mean by Simulation?

not exactly physics; physics can be enabled for a simulation and you can have physics related events or state, but I mean, like, the non-rendering stateful information related to the game; like you might have 200fps rendering rate, but your simulation rate might only be 10 or 20 ticks per second; if rendering is faster than simulation and the simulation involves movement for example, then rendering needs to interpolate the positions from the simulation....in a client-server model the server doesn't render, so it only has a simulation tick rate, and usually that is married to the client tick rate (they're the same) because it's easier to reason about, i guess it's just a convenient word for separating the rendering (always local) with the parts of the game that are communicated across the network

glass vector
#

is physics sleep, rigid body sleep replicated in multiplayer?

#

I have like objects on the client side that don't seem to want to sleep at all, especially when they are near or stacked on top of each other

#

they just keep wiggling around, and it's causing fps drops

#

Do I have to force rigid body to sleep on the client side?

worn steppe
#

hello, can anyone recommend a good resource for learning how to do networking in UE5 "the right way"? I'm working on a new project and I've never added networking before, hoping to find some kind of solid resource so I can have a good mental model of what's going on

fossil spoke
worn steppe
#

ah, thanks, sorry I'm discord-dumb

fossil spoke
#

The network compendium here is a good start.

latent heart
#

Cedric the Networksplainer.

twilit radish
tranquil yoke
#

Does any one know, how to manually make any actor gets disconnected from NetDriver, so when netDriver Destroys it should not destroy the actor on Clients ?
I add a actor class to BeaconNetDriver, but when beaconNetDriver will end, it should not destoy the class with it, I tried NetDriver->NotifyTearOff(actor), but this did not work.

latent heart
#

TearOff doesn't destroy the actor, it should actually do the exact opposite.

#

If called on the server, it stops updating it and lets the client do whatever.

twin juniper
#

Has anyone ever tried to replicate a TMap in unreal 5?

peak sentinel
#

yes

twin juniper
#

does it work?

#

I remember back in unreal 4 it didn't. And also tried with an array of TPair, and same

peak sentinel
twin juniper
#

ahaha explain pls

peak sentinel
#

you can replicate it, but its terribly inefficient

#
bool FHT_MetaTagContainer::NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess)
{
    bOutSuccess = true;
    bOutSuccess = Map->SerializeName(Ar, MetaTag);

    if (Ar.IsSaving())
    {
        uint8 bSerializeMap = KeyedMetaTags.Num() != 0;
        Ar.SerializeBits(&bSerializeMap, 1);

        if (bSerializeMap)
        {
            uint32 Count = static_cast<uint32>(KeyedMetaTags.Num());
            Ar.SerializeInt(Count, MAX_uint8);

            for (TPair<FName, FName>& Itr : KeyedMetaTags)
            {
                bOutSuccess &= Map->SerializeName(Ar, Itr.Key);
                bOutSuccess &= Map->SerializeName(Ar, Itr.Value);
            }
        }
    }
    else
    {
        uint8 bSerializedMap = 0;
        Ar.SerializeBits(&bSerializedMap, 1);

        if (bSerializedMap)
        {
            uint32 Count = 0;
            Ar.SerializeInt(Count, MAX_uint8);

            KeyedMetaTags.Empty(static_cast<int32>(Count));
            for (uint32 Idx = 0; Idx < Count; Idx++)
            {
                FName Key, Value;
                bOutSuccess &= Map->SerializeName(Ar, Key);
                bOutSuccess &= Map->SerializeName(Ar, Value);

                KeyedMetaTags.Add(Key) = Value;
            }
        }
    }

    return true;
}

Jambax was posted this a few years ago

twin juniper
#

oh okay a custom netserialize

#

well for that I prefer to have an array of custom struct

#

but thank you for the enlight

twilit radish
#

I feel like it should be doable to implement a FastArraySerializer that then dynamically adds and removes from a map based on a callback no?

limber gyro
#

i was reading a post on the ue4 forums on how to set the tick rate, the thing is, its for the ipNetDriver

#

[/Script/OnlineSubsystemUtils.IpNetDriver]
NetServerMaxTickRate=30

#

if i am using the steamNetDriver, does this work?

#

do i need to put that line under the steam net driver?

#

how would that look?

twilit radish
#

@limber gyro Give this a try, but obviously with whatever value you want it to be. Seems to be what the engine is using for DefaultEngine.ini

[/Script/SteamSockets.SteamSocketsNetDriver]
NetServerMaxTickRate=30

#

Although not sure if that actually overrides the default value or not πŸ€”

shy yarrow
#

When I want to test the multiplayer in the editor,To test the function OnHit() , If I test the client-related editor first, it doesn't work, but if I test the server editor first, then test the clients, it works for the clients as well., anyone know why?

clear island
#

quick question, If I set bAlwaysRelevant to true on an actor, net cull distance is basically ignored right?

chrome bay
#

yep

#

skips those checks entirely

clear island
#

hmm I see

twilit radish
shy yarrow
#

It seems that they only start working when I first click on the server editor and then go back to the client editors.

shy yarrow
clear island
#

getting some weird problems and just to test, I set it to true to see if they still happen, but when I set bAlwaysRelevant to true, all is good πŸ€”

#

obviously I want to avoid setting it to true

#

but

#

it seems to cause issues when attaching actors to mesh sockets?

chrome bay
#

Presumably you have replicated movement on?

clear island
#

when an actor re-enters net cull distance, it gets recreated, but it seems its replicated state, is now different

chrome bay
#

Make sure whatever you're attaching it to is also replicated

#

Otherwise the "attached" actor won't be able to resolve it's attach parent client-side

clear island
#

oh hmm thats interesting

#

I'm attaching the actor to a car

#

but the car is client authoritive, so it doesn't have "Replicate Movement" set to true

shy yarrow
#

guys look at it , OnHit function ,first not work for client , but after I go to server screen and then come back again to client scrren , it start working for clients as well

clear island
#

since its handling the replication itself

chrome bay
clear island
#

this is unchecked

chrome bay
#

Yeah but how is the server then telling other clients where it is?

#

Client A sends movement to the Server - how does the Server send that to Client B, C, D etc?

clear island
#

hmm let me check the code I bought this plugin from the marketplace

clear island
#

it works pretty well

chrome bay
#

Yeah that's bad then

#

The engine already supports this btw. You have to send movement to the server from the client-owner, but what you are supposed to do is have Replicate Movement "ON", and uncheck "replicate physics to autonomous proxy" on the cars root primitive.

So long as the authoritive client has possession of the car, that will work

clear island
#

things just get weird when the actors re-enters net culling distance, all other cases work very well

chrome bay
#

There's a good chance late join won't work either

clear island
#

theres similar issues yea

#

its not broken completely its just that the socket gets rotated somehow, when the car re-enters net culling range

chrome bay
#

Yeah so it doesn't really work then. The first problem to address is using RPC's to send the vehicle state to other clients, that should be a replicated property. If you follow what I wrote above, you don't even have to do any real work for that

clear island
#

the driver* socket

chrome bay
#

You also want to make sure character movement and character movement smoothing is disabled when the player is attached to the car, otherwise that will interfere

#

You'll probably need to make some small additions to the character movement component to do it proper

clear island
#

doing SetComponentTickEnabled(false) when I attach the character to the car socket

#

on the CMC

chrome bay
#

that isn't enough

clear island
#

really? damn maybe thats the cause of the rotated socket issue then

#

because its enough when all players are in net cull distance range

#

but when a driver takes a car far away and comes back

#

when the players see him returning, his driver socket is rotated

#

for some reason

chrome bay
#

We basically disabled PerformMovement() and SimulateMovement() whenever the capsule is attached to something IIRC

clear island
#

btw when I attach the driver, I'm also possessing the Car

#

but for passenger im just attaching to the socket and thats it

#

I noticed I had to disable the CMC tick for passengers

#

for drivers I haven't done that since I'm possessing the car, so Im hoping thats ok, maybe?

#

also this vehicle system has its own "kinematic like" physics, I believe thats why unreliable RPCs were chosen, instead of replicating variables

#

to send them at the same time its ticking the physics simulation

chrome bay
#

That's even less reason to do it tbh

#

It's also pointless because you'll never get those RPC's at the simulation rate anyway

clear island
#

isn't the replication rate tied to the server tick though?

chrome bay
#

And in a "real world" environment, it'll look terrible

#

It is - but no garauntee you won't exceed the available bandwidth, or packets get dropped etc.

#

Which is why stateful replication is so important.

#

I can tell you on reliable authority that kinematic vehicles are a waste of time

#

source: I did it for years

clear island
#

well I didn't create the plugin myself just bought it, but thanks thats useful information

#

but yea now that I think about it, I believe this vehicle system will never work unless the car is set to always relevant

chrome bay
#

Here's what we/I've done in the past:

- "Seat" actor replicates the "Occupant".
- "Occupants" are notified from the "seat" when the enter/leave it. This drives attachment.
- After they have attached, movement is aborted and all input consumed. Smoothing is disabled.```
#

It's important that the "seat" actor has an equal or larger relevancy range than it's occupants

clear island
#

that is very similar to what I've done so far I think

#

seat variables are replicated

chrome bay
#

The most important part is that ONLY the seat replicates it's occupant - not the other way around, and not both

#

Otherwise you have endless race conditions

#

So there needs to be a single point of authority

#

And if entering a seat performs the attachment, you must disable attachment replication otherwise those two concepts fight each other too

clear island
#

what do you mean with "Attachment Replication" and "Smoothing" ? I just disabled the tick on CMC

chrome bay
#

I mean quite literally in our case:

{
   // Do nothing
}```
clear island
#

I'm doing the passenger/driver attachment on rep notifies

chrome bay
#

Right - but the characters existing replicated movement will fight with that

clear island
#

I didnt even know this was a thing

clear island
chrome bay
#

Doesn't matter

#

replicated movement is independent of the character movement

#

It sounds like what you have is basically lots of conflicts between what the engine already does and what you're doing

clear island
#

so that empty OnRep_AttachmentReplication will fix it? or do I need to change anything else on CMC I'm working with a source build anyway so if theres anything you recommend changing let me know

chrome bay
#

I wouldn't change CMC directly, I'd make your own specific one for you project and make changes there

clear island
chrome bay
#

Editing engine code should always be a last resort, especially stuff as low-level as that

#

Yeah but it only works until it doesn't πŸ™‚

#

So it doesn't really work

clear island
#

hmm I see

#

so that empty OnRep_AttachmentReplication alone wont do?

chrome bay
#

I don't know honestly, there's a lot of ways to approach this

#

Doesn't sound like it's the only issue - but just note that with replicated movement on, the engine will already replicate what you're attached to and with what offset

#

We use our "seat" system to drive attachment on clients instead, we ignore the attachment from movement replication

clear island
#

what I dont get is why the socket offset/rotation would change on its on own when the car re-enters net cull distance

chrome bay
#

Depends how you're attaching it

clear island
pure vigil
#

I need a reality check. If a NetMulticast function being called from the server only ends up running on the server that means the object the function is on is not set to replicate, right?

chrome bay
clear island
pure vigil
#

Ok. Follow up question: Anything special I need to do to get a component (attached to a character) to replicate? I've got
SetIsReplicated(true);
in the constructor

chrome bay
#

Also FYI, we attach the capsule and mesh independently:

GetCapsuleComponent()->AttachToComponent(SeatIFace->GetSeatAttachComponent(), FAttachmentTransformRules::SnapToTargetNotIncludingScale, CurrentSeat->AttachSocketName);
GetMesh()->AttachToComponent(SeatIFace->GetSeatAttachComponent(), FAttachmentTransformRules::SnapToTargetNotIncludingScale, CurrentSeat->AttachSocketName);
clear island
#

oh

#

I never even thought of that

#

hmmm

#

now that got me thinking πŸ€”

chrome bay
clear island
#

I guess it kinda makes sense that maybe there might some collision fighting, I just dont get why that only happens when the car re-enters net cull distance

chrome bay
#

Also why you need to disable smoothing, and you must make sure character movement is turned off at the same time as you attach client-side

pure vigil
chrome bay
#

Hmm yeah, maybe recreate BP

#

although details panels are weird in 5.0

pure vigil
#

Might be a livecoding thing, reboot editor

chrome bay
#

Can set the NetworkSmoothingMode

#

But it turns out, it's not even that simple πŸ˜„

clear island
#

working with a source build πŸ˜›

chrome bay
#

We've overridden the SmoothClientPosition function to avoid potential issues

#

None of this requires source changes

#

And it's very common for projects to make their own specialisation of CMC

clear island
#

oh cool I can just override it nice

chrome bay
#

Especially in MP

#

The TL;DR is attaching characters to stuff turns out to be a lot more work than you initially think

#

But our CMC is still ticking when attached

clear island
chrome bay
#

We just have it "handle" the seated state in a different way

clear island
#

so you said you dont do kinematic car physics, so what are you using instead, server authoritative physics vehicles?

clear island
#

but eventually figured it out

chrome bay
#

yeah the ordering is super important, takes a while to get it

clear island
#

until net cull distance comes in πŸ˜„

chrome bay
#

But it becomes easier once you have only a single property controlling the whole state

clear island
#

yep, learned that one the hard way πŸ˜„

chrome bay
#

When lots of them are fighting, it's basically impossible to avoid issues

twilit radish
#

You're telling me you don't want to spend months if not longer on trying to get client predicted server authoritative physics based vehicles working Jambax? 🀣

clear island
#

server side is best but yea with no prediction thats a no no for me πŸ˜›

#

another thing I was recently thinking, but not directly related to this, if my game is gonna have alot of vehicles in the world, maybe I'd benefit from using the replication graph, but then I had this idea: can I not just override the IsNetRelevant function and when that returns false, I set net dormancy to "Dormant" ?

pure vigil
#

Ok, guess I've got another question. I'm attempting to replicate a USplineComponent, something I've never tried before. And it seems like .. it just doesn't work. Points get added server-side and I noticed my ReplicatedUsing function wasn't firing, I figured adding points didn't flag it as having changed so I instead manually call a NetMulticast function. Server has the correct number of points, client does not.

    UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Replicated, Category = "Component", meta = (AllowPrivateAccess = "true"))
    USplineComponent* TrailSpline;
void UAC_TrailComponent::TrailNodeTimerTriggered()
{
    // This check is redundant but just to make it clear this only runs on the server
    if(GetNetMode() == NM_DedicatedServer)
    {
        UE_LOG(LogTemp, Warning, TEXT("Trail Timer Ticked"));
        TrailSpline->AddSplinePoint(GetOwner()->GetActorLocation(), ESplineCoordinateSpace::World, true);
        TrailSplineUpdated();
                // Number of points updates appropriately
        UE_LOG(LogTemp, Warning, TEXT("SERVER: Spline Updated. Points: %i"), TrailSpline->GetNumberOfSplinePoints());
    }
}

void UAC_TrailComponent::TrailSplineUpdated_Implementation()
{
    if(GetNetMode() == NM_Client)
    {
                // Number of points never changes
        UE_LOG(LogTemp, Warning, TEXT("Spline Updated. Points: %i"), TrailSpline->GetNumberOfSplinePoints());
    }
}

I guess I don't need to use a spline but it kinda encapsulates what I'm doing pretty well so I'd like to if I can

chrome bay
#

@pure vigil The spline component doesn't replicate any of it's properties

pure vigil
#

I guess I could also just send clients the location of the point to add and have them add it themselves. Just seems cleaner to replicate the spline .. though .. probably more network intensive than it needs to be

chrome bay
#

And note that what you're replicating there is a reference TO a spline component - not the component itself

pure vigil
#

Fair. My brain has trouble sometimes keeping that all in my head

chrome bay
#

If you wanted to do it, you'd basically just replicate an array of points and apply those client-side with an OnRep callback

chrome bay
#
TArray<FVector> ReplicatedPoints;

void OnRep_Points()
{
    SplineComp->SetPoints(ReplicatedPoints);
}```
pure vigil
#

I thought you were using some kinda multiplayer lingo I had never heard of, got worried πŸ˜†

chrome bay
#

No need to replicate the component itself, or a reference - unless it's created at runtime or something

pure vigil
#

I think maybe I need to rethink what I'm doing anyway. My idea for this was having a large map with players moving around creating "trails" as they move. The trails would be persistent, at least for a time. But .. these trails should be netrelevant even if the player is not. And having this be done from the player means this won't work

#

bleh. ok. back to the drawing board. Thanks for the help though, good to know the approach for splines was just wrong

#

Each point of the trail should have it's own network relevance, no need to make them all "alwaysrelevant". Which also means these points need to be individual actors, placed in the world. Don't like that.. it's gonna flood the world with actors.. but I don't see a way around it. Each point doesn't necessarily need to have a reference to the next point but it might be nice to be able to save the location of the next point so someone following the path could have an indication as to what direction to go. I think I can still use my component to spawn these path point actors. HMMMM this seems messy! but I can't think of another way. Sorry for the brain dump.

chrome bay
#

A lot of the time stuff like that is purely client-side

pure vigil
#

Well, I need all other players to know about the path created by all other players

chrome bay
#

You can do it, just have to be mindful of how much you send. Split areas into zones and replicate those etc.

#

An actor for each point would be uber excessive

pure vigil
#

I know relevancy is calculated based on the actor location so even if I have an actor with components that stretch super far away, those components will only be relevant if the actor is.

chrome bay
#

Just spawn actors for "zones", make the actor relevant for a bit larger than it's zone area etc.

#

Many ways to approach it

twin juniper
#

Hello guys !
Im looking for some creative and talented people to create the best Melee Battle Royale in gaming history!
dm me!

woeful ferry
#

Because talented people won’t work for free on another guy’s vision

twin juniper
#

Im not looking for money so i cant pay this much.

chrome bay
twin juniper
winged badger
pure vigil
winged badger
#

Single Actor, always relevant, timestamp + location paired with weak pointer to player for each player

#

Clients can then construct non replicated splines from there, or whatever you prefer to display the trails... or just leave footstep decals that time out on their own

pure vigil
#

Definitely cleaner. Thanks for the suggestion

twin juniper
stiff fractal
#

Is there a surefire way I can know that clients have finished creating and synchronizing replicated actors? I need to know that all of my clients have entered the level and are finished getting synced before GameState starts its work. I see that ULevel has bAlreadyInitializedNetworkActors. Can I rely on that?

#

I have a bunch of statically placed replicated actors in the scene tree that seem to take a while to get made on clients.

chrome bay
#

statically placed stuff should always be present though

#

Might not have it's latest state

#

Unless bNetLoadOnClient is false for some reason

stiff fractal
#

Would the fact that we're not starting on the level in question make a difference? We have a main menu level where you form a party and the host becomes the server, and then server launches everybody into the game level.

chrome bay
#

Wouldn't have thought so. Presumably just a server travel?

stiff fractal
#

I think so. I didn't write that part.

stiff fractal
#

The only strategy I can think of is that I know how many of all these actors there are supposed to be, so just have something at a higher level watch for some event they kick out when they do BeginPlay and keep track of how many report in to know if they're all done.

rose egret
#

how is a WP level loaded in server ?
i have been making save load system, I load state of the world in AGameMode::InitGame. for normal levels its ok because all are loaded when InitGame is called but not WP

stiff fractal
#

WP?

rose egret
#

WorldPartition

azure cape
#

hey, can only actors and components be replicated or is it possible to create an object that only exists through reference variables in a component and have it be replicated the same way said component's variable and behaviours would?

versed elbow
#

i have no idea wat to do about this.

#
if  ( bWasSuccessful )
    {
        
        // travel to server here.
        UWorld * World = GetWorld();
        if  ( World )
            {            //W:/0000 0000/__U__/MenuSystem/Content/ThirdPerson/Maps/Lobby.umap
            World -> ServerTravel ( "/Game/ThirdPerson/Maps/Lobby?listen");
                        }
    }


#

its not moving me to the lobby

#

and the weird part is . it does find steam but doesnt take me to the lobby map

versed elbow
#

ok . managed to fix it . fukin christ . wanted to blown my brains off.
[1] World -> ServerTravel ( "/Game/ThirdPerson/Maps/Lobby?listen");
make sure that this doesnt have typos
[2] add LastSessionSettings -> bUseLobbiesIfAvailable = true;
add that after to LastSessionSettings = MakeShareable ( new FOnlineSessionSettings() );
[3] in project settings add the maps . to the package build . under project - packaging , advanced.
[4] in defaultengine.ini in config make sure you have that set for steam. dev app id and all that bullshite

ocean geyser
#

question in regards to dormancy. for testing i set an actor to be dormant all (actor made in blueprint) and i do tests by changing replicated information on said actor and i noticed it replicates down to clients. i had read something about in blueprints an actor set to be dormant will get awoken when you change a replicated variable, replicate everything needed, then go back to dormant so i tried setting all the actors to be dormant in c++ by iterating over all teh actors i want to be dormant and setting it as dormant and that had the same effect. is this the intended effect? if memory served right with c++ actors this has a different result where the actor would remain dormant even if a replicated variable changed

fathom aspen
#

Correct, in C++ you have to FNU/FND for it to actually replicate

azure cape
#

Thanks

rose torrent
#

What function is called on the player controller when the pawn has been replicated?

fathom aspen
#

OnRep_Pawn

rose torrent
prisma pelican
#

does anything know how to enable lyra to use online network or lan for steam? The default is restricted to offline

worn steppe
#

When I set a variable to be replicated, does its value get sent every packet or only when the value is updated?

thin stratus
near granite
#

only client 1 should be move to LV_1 level , I first time to use client travel, this is on UE5.1

Which command should be used for?

#

when Client1 moves to LV_1, others move to another level..

oak oracle
#

hey devs , how to test staff for dedicated server locally ? there is no such thing

worn steppe
#

The Play As Client option will run a local dedicated server in the background that your client will automatically connect to

thin stratus
near granite
near granite
near granite
#

Can I create multiple servers and communicate between them?

(I want to make clients have diffenrent map...so..)

latent heart
#

Of course.

#

Just not with the standard client/server/replication system. You'd have to implement your own communication.

twilit radish
#

β€œClient travel” is used to switch the map on the client to some different map to bring it in sync with the server.

#

But yeah, without your own server or modifying the engine it’s not supported.

latent heart
#

You can always have the clients all on the same map, but in different parts of it with different levels streamed in and out. But that's a whole other issue.

near granite
latent heart
#

Unreal might not be the engine for you then!

#

Unless you can add your own communication layer on top.

near granite
#

I'm infant in UE...communication? for connection between servers?

latent heart
#

Yes.

#

Servers cannot talk to each other by default.

#

If you want multiple maps, you need 1 server per map and if you want those servers to generate some shared experience, you need them to talk to each other somehow.

#

Are you trying to make an mmo?

short arrow
twilit radish
#

Having to deal with synchronizing things between multiple instances sounds like an absolute pain lol.

latent heart
#

If you are trying to make some multi-node server mmo-style game, UE is only going to be half the battle.

near granite
latent heart
#

Socket? Websocket? UDP? TCP? Pigeons?

near granite
latent heart
#

Absolutely.

twilit radish
#

You’re going to need C++ at bare minimum depending on what you do.

latent heart
#

If you aren't very good at c++, you won't be able to achieve your goals.

#

You're going to need to do a lot of c++.

twilit radish
#

Also I would still not recommend it, you’re either going to make something way too complicated with multiple servers or need to decently modify the engine it self to support a custom server / networking or to support several worlds. It’s just not simple.

latent heart
#

You wouldn't have to modify the engine to get servers to talk to each other, you could just keep it in a subsystem in your project.

#

It's still not easy!

twilit radish
#

Assuming you go that route yeah.

near granite
#

I have to find in different way..thank you!

latent heart
#

Basically, if you have to ask how to do this, you can't do it.

#

Start smaller. πŸ™‚

thin stratus
#

I wonder if we should make a hall of fame

#

For those questions/users/ideas/etc

#

Blur the names but show each new one the ever growing list

halcyon raptor
#

Afternoon all, hopefully an easy one, but driving me nuts, what causes IsLoggedIn to be true. i have some projects that will show logged in even though they have no online functions, i have online projects that show isloggedin as true aswell, which stops the eos login prompt coming up.

oak oracle
#

hey guys , just a quick and noobish question , why if i am calling jump locally the actual jump movement got replicated to all clients and server just fine ? i would understand it if ue "Jump" function was a multicast event and if i call it on server , but here it is just a regular function and i am only calling it locally but it got replicated to everybody fine , why is that ?

twilit radish
#

Because the character system has a full networked system built into it. Which is also the case for the jump function.

twilit radish
twilit radish
twin juniper
#

Am I making a mistake by not using the gameplay ability system and doing my own custom solution?

twilit radish
#

"a mistake" - no. It's a tool, you can use it if you want and it can help you do certain things quicker / easier or similar. But you can be just fine without.

twin juniper
#

Yeah I just feel like adopting other peoples systems can be harder because you don't have as deep of an understanding of it as you would your own hand built system

twilit radish
#

The thing however is that it's an already established system, you learn how it works and you can use it. If you want the same functionality and build it your self you're going to have to figure out what works and what doesn't. But yes, often you have a less deep understanding of how it works when you didn't make it your self. But that's not necessarily always a bad thing as on the opposite side it saves a lot of time to not have to make everything your self πŸ™‚

twin juniper
#

Yeah I get that. GAS just has a decent amount of boilerplate you have to set up that makes it hard to even start working with the system

#

I haven't actually worked with it yet, but it seems like the consensus is that it's pretty difficult to get into at first

twilit radish
#

That's kind of a lot of Unreal systems in a nutshell haha. But like I said, if you think you can be fine without and do things just as quick or quicker by all means go for it. GAS probably has a lot of stuff you'll never need. But if you think it can be useful, give it a try and see if it's any good for your case or not πŸ˜›

twin juniper
#

I mean I am working on a moba for context, which is why I was on the fence about it

halcyon raptor
twilit radish
#

From what I can find it seems to just indicate whether or not someone is connected to their native platform, for Steam as an example it's described as:

Checks if the current user's Steam client is connected to the Steam servers.

halcyon raptor
pseudo merlin
#

hi all, I'm working on a co op game and have player cmc properties bIgnoreClientMovementErrorChecksAndCorrection and bServerAcceptClientAuthoritativePosition set to true to let clients handle their motion, despite that I still get corrections from server. Am I misunderstanding the use of these? I'm logging their value and logging corrections and see corrections coming in despite both vals being true on client and server

cursive steeple
pseudo merlin
#

curious to hear a situation it works in

grave lynx
#

I have an issue while with steam on a dedicated server. With steam subsystem off, everythin working fine. But when I turn it on, IU have this error:

 Login request: ?Name=PlayerName userId: STEAM:765611XXXXXXXXX platform: STEAM
[2023.01.21-16.27.34:529][652]LogNet: PreLogin failure: incompatible_unique_net_id
[2023.01.21-16.27.34:529][652]LogNet: UNetConnection::SendCloseReason:
[2023.01.21-16.27.34:530][652]LogNet:  - Result=PreLoginFailure, ErrorContext="PreLoginFailure"
cursive steeple
# pseudo merlin thanks good to know I'll verify my setup. what is your usecase btw?

I use a dedicated server (tho no extra systems to it just yet). The exact usecase is to let clients jump onto a bunch of physics objects that arent replicated, which they'd otherwise fall through thanks to the corrections.
If you need clarification on the blueprint setup, let me know, tho it really is just as simple as we discussed earlier c:

pure vigil
#

I have a replicated variable using ReplicatedUsing that gets updated twice in rapid succession. And .. what looks like is happening is that the OnRep function only fires when it is first updated and the second update is ignored. Is there a built in limit as to how frequently ReplicatedUsing functions can fire? (I realize what this means is I should find another way to approach this and not update it twice in rapid succession but I would like to understand what's happening here too)

daring bough
#

Hi! Is RepNotify safe? I heard it can be not called in some situations, like when actor too far or something like that. Is it true?

latent heart
#

Variables aren't updated straight away nad it's entirely possible you are simply changing it too quickly. The first change never gets replicated.

pure vigil
latent heart
verbal tendon
#

theres an example level somewhere that demonstrates the various scenarios, networking or advanced networking in example levels

#

I think they are part of the example content?

pure vigil
# latent heart Variables aren't updated straight away nad it's entirely possible you are simply...

It appears you are correct. I have a weird situation made even weirder by what I'm doing with it. My variable is an array of structs, the struct has a FVector, a timestamp and a bool - it's coordinates and a bool to say whether it has been "processed". The server (on a timer) will add entries to this array, a new FVector and always sets the bool to false. The server will also remove old entries based on the timestamp.

When the OnRep function is called, clients will go through the array and (for now) draw a debug sphere at the FVector location but only if the bool is false. They will then (locally) set the bool to true. I wasn't sure if that part would work, thinking possibly the bool would be overwritten but I have confirmed that doesn't happen.

The problem comes in when the server removes an entry. Suddenly new entries are being added with the bool as true. I believe this is because an old entry is removed, a new one is added in its place and somehow the clientside-set value of true persists.

Here's an example

Server timer triggers 
Add a new entry at (0,0,0)

Client Entries updated (OnRep called)
0 - (0,0,0). Bool is false. Draw and set bool to true.

Server timer triggers
Add a new entry at (0,0,1)

Client Entries updated (OnRep called)
0 - (0,0,0). Bool is true.
1 - (0,0,1). Bool is false. Draw and set bool to true.

Server timer triggers
Old entry at (0,0,0) removed
Add a new entry at (0,1,1)

Client Entries updated (OnRep called)
0 - (0,0,1). Bool is true.
1 - (0,1,1). Bool is true. ((THIS IS A NEW ENTRY AND SHOULD BE FALSE))

So.. The entry at index 0 was removed by the server and a new entry was added to the end. The OnRep function only gets called once and updates the clients with both the removal and additions.
The client already had 2 entries previously, both index 0 and 1 were set to true. And even though index 1 got updated with the correct vector, somehow the bool remained true instead of being properly set to false

latent heart
#

Set it so that the bool doesn't replicate?

daring bough
pure vigil
latent heart
#

Bp or cpp?

pure vigil
#

cpp

latent heart
#

Just don't put uproperty on it...

pure vigil
#

Also though.. I'm not sure that fixes the issue. Because if the value WAS replicating, it would be false. The server sets all the bools to false.

#

It seems to me this might be a matter of unreal networking trying to minimize the amount of data sent

latent heart
#

You want your client to set it to true, right? Not the server, from tbr perspective of the client.

pure vigil
#

Yes, each client should be setting them to true. Not sure if this is abusing the system.. modifying replicated variables clientside

latent heart
#

Not at all.

pure vigil
#

Ok. I confirmed removing UProperty from the bool didn't have any effect. Well, I did a livecode.. let me compile in the IDE and restart the editor to be sure

latent heart
#

Live code won't change that, I think.

pure vigil
#

Ok. Just had enough weird things as the result of livecode that I wanna be sure before continuing.

#

Ok. Double confirmed removing UProperty from the bool didn't change anything

#

I feel like.. Unreal is recognizing that the array is the same size (clientside) and instead of actually removing/adding elements, it is just replacing values in the array to save on packet size. But even though it updates the coordinates correctly it misses the bool somehow. ...

#

I could be way off on this.

latent heart
#

Maybe.

#

You could always try rpc broadcasts instead 8f regular replication.

#

Total control!

pure vigil
#

RPC or multicast?

latent heart
#

Not ideal, though

#

An rpc multicast.

pure vigil
#

Oh. I've always heard RPC used more to mean client to server communication

latent heart
#

Nope.

#

It's literally remote procedure call.

pure vigil
#

TIL

latent heart
#

Can be either way.

pure vigil
#

I think maybe one workaround would be to have two separate timers, one for adding and one for removing and ensure they're offset. It feels messy though and seems like it could lead to timing issues, especially with lots of people

#

If I go the RPC multicast route, I'd have to manually tell clients to update when an element is removed and again when an element is added.. hmmmmmph

latent heart
#

There's still no guarantee that there will be replication in between the timers.

pure vigil
#

True. bleh\

latent heart
#

Why when to remove? It's after a set time, right? Clients have clocks too.

pure vigil
#

Because it seems to me the only reason the issue is happening is because the client is told to update the array but the array still has the same size

#

I guess I could try to remove the elements clientside before the server has a chance to tell them to do it

#

But it would require me to be checking the timestamp very regularly and there would still be the occasional time it doesn't line up

latent heart
#

It seems you're just using the wrong approach somehow. Maybe you need to rethink it from scratch.

#

What is the aim, exactly?

pure vigil
#

I completely accept that. This is already re-work #3 or 4

#

I'm creating trails/footprints that follow the player

#

The idea is that each vector there will be .. something.. in the world to be able to follow the player. Either a decal or something else I haven't decided

latent heart
#

Right.

pure vigil
#

But I don't wanna draw the decal over and over, hence the bool

latent heart
#

Why do you need to do this on the server at all?

verbal tendon
#

So for starters, that doesnt need to be replicated

#

So scratch replication, scratch all your problems

#

you simply calculate the footsteps on the client

pure vigil
#

It's a big world and player A might not be relevant to player B

latent heart
#

So why do you even need the footsteps if they aren't relevant?

#

I would use a client side anim notify for this.

verbal tendon
#

Yes you need to work out what you are doing wrong, because you are most likely going to run into the issue again

pure vigil
#

Because if they get close enough, they should see the footprints they left

verbal tendon
#

but you also need to think about what needs replicating and what doesnt

#

well are the footsteps permanent? and regardless player relevancy is the wrong thing here

#

because you may stumble upon footsteps of another player even if they arent in relevancy range

#

in which case your system just doenst work

pure vigil
#

Not permanent but a decent duration. Yes, I want players to stumble on footprints of players even if they aren't currently relevant

verbal tendon
#

and if this is a 2P game you are overthinking it

#

Then you cannot obviously tie it to player relevancy, so your approach is flawed to start with

pure vigil
#

I am not tying it to player relevancy at all...

latent heart
#

Place decal actors, set them to replicate and be done with it? Give them a lifetime and they'll auto delete.

verbal tendon
#

This

pure vigil
#

That was one approach I was thinking about, definitely. That seems much more straightforward. I was just trying not to flood the world with actors, this was my attempt to make something cleaner..

#

though obviously failing

#

I guess I should have mentioned before, all the code I'm running is on a single actor that is set to always relevant that monitors the players movements

#

not on a player that will be network culled

verbal tendon
#

it keeps getting worse the more you describe the "cleaner" solution

pure vigil
#

πŸ˜†

verbal tendon
#

you now have a manager type class that is directly relying on other spawned classes

#

instead of having one single classes that is handling all of this

#

you place actors with a lifetime, you have all of the code in one file. done. modular, self-contained

#

it doesnt get simpler than that

#

and the fact that you are on rework

pure vigil
#

I believe someone else here steered me away from that approach calling it "overkill"

verbal tendon
#

#3-4 should have signalled you are doing something wrong

pure vigil
#

or "uber excessive" might have been the term

verbal tendon
#

Everyone here is a stranger on the internet

#

take advice with a grain of salt and apply your own reality context

pure vigil
#

Yeah, it's tough because my testing environment is super limited.

#

Like.. I have no idea how this will work with 10 players. Works fine with 1.

latent heart
verbal tendon
#

because my life context is starkly different from that of others, so that needs to be taken into consideration

#

talking career and such. Good coding guidelines are spot on

#

because the context is mostly the same for everyone

latent heart
verbal tendon
#

optimizing when you do know something will be a problem due to past experience, is fine

latent heart
#

Indeed.

pure vigil
#

Plus, I can have the network culling on those actors be super low. It's a top-down game so players wont need to see them unless they're like right on top of them

verbal tendon
#

Like spawning 100 replicated actors every tick... I can tell you without ever having tried it that it will be a problem

latent heart
#

You can have thr network distance culling on everything be super low then.

pure vigil
verbal tendon
#

something somethinig

pure vigil
#

haha

latent heart
pure vigil
#

I definitely have too much of a compulsion to try to do everything the right way to prevent future issues which as I say that I know is completely futile

#

and it has prevented me from finishing ... any project, really

latent heart
#

99% of projects are never completed. Or even get off the ground.

#

Especially revenue share ones.

pure vigil
#

Ok. Scrapping this manager actor and going back to spawned actors which I liked better anyways. Thanks for tolerating my questions and taking time to understand the situation

latent heart
#

πŸ™‚

clear island
#

what could cause an actor not getting destroyed/recreated when leaving/re-entering net cull distance?

#

I have a player pawn that I'm attaching to a car and I'm possessing the car

#

when he drives far away, this character gets destroyed when he leaves net cull distance and recreated when he enters the net cull distance which is correct, but not the car itself that he is driving

#

anyone know why?

clear island
#

(also the car is not set to always relevant)

pseudo merlin
#

do clients have any events for when any given pawn in the world is possessed by a new controller on server?

#

i was going to use reset but i think thats only for owning client

#

hm going to try OnRep_PlayerState

near granite
#

I want all players to go to the next level when one player presses enter

winged badger
#

and also, there is a AController::SetPawn function, gets called from both Posses and from OnRep_Pawn in the Controller

#

its a good place to put in common server/client logic in one place

#

PlayerState will typically arrive a bit later, as the PS Actor has to replicate in order for that one to fire, and it has low default NetPriority

winged badger
clear island
#

as in, IsNetRelevantFor() was returning false

winged badger
#

net static actors also won't get nuked

#

think preplaced in level

clear island
#

ohhh

#

yea ok

#

that would explain it then

#

is was pre-placed in the map editor

winged badger
#

their networking has a few differences from replicated actors spawned at runtime

#

they don't get destroyed when not relevant

#

they are always net addressable, and don't need to be replicated to be net addressable

#

meaning you can send a pointer to a net static actor through a say, RPC, and it can always get resolved

clear island
#

hmm makes sense

winged badger
#

that comes from them having consistent, unique names as part of the package

clear island
#

I would never notice these quirks by myself, there's definitely cases where I'll be spawning these vehicles by code and others where I'll be pre-placing them

#

but this explains the current behaviour then

#

this explains so much now

#

the vehicles I'm using do client prediction, so when the driver goes far away with the vehicle, imagine he was turning left the moment before getting destroyed by net cull distance, this causes the vehicle to be always turning left on the other clients, until the driver comes closer again

#

so I was wondering why tf is the vehicle not getting destroyed too, but I guess I'll just play with render cull distance

#

unfortunate that there's no client side event for when an actor goes outside of net cull distance

winged badger
#

you can try turning off bNetLoadOnClient on preplaced Actors to get them to behave consistently

#

haven't tried doing that, but that is the first thing i'd try if i had that problem

clear island
#

any potential side effects I should be worried about?

winged badger
#

i don't see any

clear island
#

awesome

fathom aspen
#

Am I able to serialize a UObject that has a TMap across the network? I think the answer is not because otherwise I would have heard about it somewhere...

winged badger
#

serialize using what technique?

fathom aspen
#

And replicating the TArray<uint8>

winged badger
#

ah

#

so you're making a struct that replicates a UObject that is not replicated by itself?

fathom aspen
#

No, the UObject is just a pointer in a dynamically spawned replicated ActorComponent

#

And yes the UObject is not replicated in itself

verbal tendon
fathom aspen
#

Yes that's what I feared πŸ₯²

winged badger
#

its not necessarily that simple

#

TMap keys have to be unique

verbal tendon
#

Again, that is simple

winged badger
#

so there is an additional breakpoint point here

verbal tendon
#

AddUnique for a small overhead

fathom aspen
#

So basically the TArray would be able to serialize just fine, right?

verbal tendon
#

yes as long as you handle replication properly

#

it would be advised to have them as replicated arrays inside of a container that is itself properly replicated

#

that would be the simple setup that is guaranteed to work

#

If you do something deviating from that you need to compensate accordingly

fathom aspen
#

Correct, but I'm trying to evade any replication on the UObject itself or even the TArrays that will replace the TMaps

verbal tendon
#

Whats the use case for replicating them?

fathom aspen
#

Hoping that deserialization will just map the data right on client

verbal tendon
#

are you serializing,deserializing manually and sending in bulk?

#

if you

fathom aspen
#

The data is pulled from a SaveGame that is managed by the host and I want to replicate it to the client

#

The whole data is just plain UObjects

winged badger
#

function on the SaveGame object itself that serializes it into a TArray<uint8>

#

and another that is able to initialize it from the same array

verbal tendon
#

I mean thats just sending the binary savegame data over the network. Thats assuming no post-deserialization actions need to happen and that its all plain data

#

sec

winged badger
#

pretty much yes

verbal tendon
#

Okay cool

#

As I said, caveat here is, no post-deserialization actions required

#

as long as when you read the data thats all you need, then you are good

#

make sure they are all UPROPERTY as thats what it checks when serializing

#

unless you have custom serialization

#

and also in this case you are totally fine using maps

#

since you are not actually using replication

#

you are sending the raw data over the network with an RPC, entirely different use case

#

this is highly inefficient, so just doing it once like savegame is fine. not recommended for during gameplay usage

#

πŸ˜„

#

I have a similar system with custom serialization to send editor data in real-time to a build on iPad

#

so designers dont need to wait on new builds to test changes

#

its a bit more complciated than that, but thats the high level overview

#

hit a hotkey in the editor and all the changes are now live ... yay magic

fathom aspen
#

Yeah this is done only once to initialize a standalone client that is joining a server host player. Basically there is a Saving System in place but I'm trying to make it work in multiplayer with least effort possible πŸ˜„

fathom aspen
verbal tendon
#

is the Raw byte array a replicated variable?

fathom aspen
#

Correct

winged badger
#

I prefer the RPCs here, replication can fail

verbal tendon
#

Uhm xD

#

Yes

#

@fathom aspen

fathom aspen
#

Would that explain it?

verbal tendon
#

So not just that it can fail, but also

#

that your array wont be replicated as you think it would

#

replication is going to be eventual

#

so your array gets piece-wise replicated in chunks

#

I strongly recommend sending the data through an RPC

winged badger
#

we had a fun release day, we have an Actor that is used for mission setup in the lobby, carries all parameters for procedural generation and persists though seamless travel

#

when we tested the game, we'd always meet in lobby and decide what to playtest

#

then the players came, and it turned out of the session owner changed the game difficulty, that Actor would just stop replicating to anyone joining the lobby after that

verbal tendon
winged badger
#

its better this way

fathom aspen
#

Dayum, why is that?

#

Some gotcha with persistent actors in seamless travel list?

winged badger
#

it takes more then a little hackery to replicate a subsystem, and in campaign play there can be multiple mission setup actors

#

anyhow, it was an engine bug with a result that our map generation parameters were not replicated to clients

#

resulting in complete map desync

verbal tendon
#

Fun times πŸ˜„

#

Especially on .. release day!

winged badger
#

since that day... if its really gameplay critical

#

reliable RPC, nothing else

verbal tendon
fathom aspen
#

Makes total sense, I will need to send that RPC to the locally controlled instance and the remote host then

verbal tendon
#

I got a system that lets you reliably RPC from anywhere, and its less boilerplate code than normal replication

fathom aspen
#

Thanks guys for the insights, and it feels good that I can keep the TMaps πŸ˜„

verbal tendon
#

And doesnt even need to be uobjects, so i got some normal c++ structs, its very neat

#

I want to open source among other things when I have time

#

Theres something I want to take out maybe that was project specific at the time, where we had locally simulated FPS elements

#

so it would split between server and client logic

#

My new boss is very keen on open source, so that is great news, I havent had that before. Now just gotta cross fingers that the company keeps being funded πŸ˜‚

clear island
#

if I have a replicated TArray of Actors, are the RepNotifies only called when this array is added or removed to?

#

or are they called when an replicated property inside the actors is changed?

low helm
#

Only changes to the array itself

clear island
#

so only when I add something to it or remove

#

good

low helm
#

Yeah

pseudo merlin
# winged badger OnRep_Controller

thanks for info. does this apply to clients who dont own the pawn? I'm surprised onrep_controller would fire because these clients dont have controllers except their own

winged badger
#

it won't, no

#

nor will SetPawn

verbal tendon
# fathom aspen Thanks guys for the insights, and it feels good that I can keep the TMaps πŸ˜„

Single line of code for defining name to payload mapping:
MAPPING_IMPL( Weapon_OnHit, FWeaponOnHitData );

Call site (this being a client-owned actor, in my case usually the character):
HANDLE_RPC_SEND_STRUCT( Weapon_OnHit, *this, Data );

Handlers:

void ExecuteOnServer_Weapon_OnHit( ACharacter& Character, FWeaponOnHitData Data ) { ... }```

So those handlers can be defined anywhere, the calls are resolved using ADL. That allows for various different gameplay systems to be neatly organized in their own code with no direct ties to the client-owned actor that actually handles the RPCs. The Character param is just because some of those systems need to know what actor they are for/from.
winged badger
#

but if you need to know from your simulated proxy pawn that it is possessed, you're generally doing something wrong

#

if this is for something like adding a widget component with a player name above the pawn

#

you can just attach the player state to its pawn and keep the widget component on the playerstate

#

simplifies things

fathom aspen
latent heart
verbal tendon
#

First thing on the open sourcing list is my blueprint corruption hotfix plugin

#

I already have the greenlight from the bossman. Just working 80h+ weeks atm to make sure we keep being funded, then I am taking a break

#

then eventually I get time to open source various things, cos the CEOs a supporter. He is purely amazing

latent heart
#

Is he also working 80 hours a week? πŸ™‚

verbal tendon
#

I think he does more like 60, to be fair he is a generation older, I heard bones get brittle and such with age

#

😁

latent heart
#

Hehe

verbal tendon
#

Speaking of which I should probably get back to work πŸ‘€ πŸ™Š

#

The small issue of a deliverable deadline EOD tomorrow

#

I travelled on Friday, and the keyboard I brought with me didnt work, so I had to remote desktop into my machine from a laptop ... just so i could have a working keyboard

#

Origin of setbacks are not from slacking off on Discord! Assuredly!

#

😁

blazing spruce
#

Hi, does anyone have any experience with beacon classes? I'm trying to set up a party system that works from the main menu, but I'm not enterally sure how I can get the client to connect to the host properly, where I'm having the issue is actually finding out what needs to be fed into the Host ID of the ConnectToPartyHost function.. I was told you could use the hosts unique net ID but that doesn't seem to be working, anyone have any ideas how I can connect people together correctly?

worn steppe
#

How should I decide if an RPC should be reliable or not? I assume the difference is that reliable RPC's are ack'd and unreliable RPCs are not?

#

Why would I not just mark everything as reliable?

blazing spruce
worn steppe
#

Right, so why not mark everything as reliable? I am struggling to think of an example where I would be OK with a request silently, randomly, failing

#

The more I think about it, the more I guess it makes sense to start with everything being reliable and then if there are issues down the line with bandwidth or latency then maybe go back and start setting things to unreliable. Unless there is something I am missing about this whole system, but it really seems like it's essentially just a TCP vs UDP type of situation here

verbal tendon
#

the other end doenst need to get every position update

#

high frequency, not important: unreliable

worn steppe
#

ah, that is a good point

verbal tendon
#

generally speaking you simply use replication for those

#

but unreliable rpcs are there, in case

#

the usual use case is reliable rpcs

worn steppe
#

gotcha, ok, I keep reading things telling me not to always use reliable RPCs so I was probably just overthinking it. but that type of situation it does make sense

verbal tendon
#

you can only send so many reliable rpcs

#

just use them sparingly, you will be fine

worn steppe
#

yeah, I can't imagine even in the worse case sending more than a few a second per player

verbal tendon
#

as in, when not using GAS. rpcs when you start firing a weapon, not RPC for every bullet that you shoot , when you have a gun that shoots at 1000 rpm

#

just be sensible and you will be fine

worn steppe
#

yea, that is reasonable. does GAS stand for something specifically?

latent heart
verbal tendon
#

GameplayAbilitySystem

worn steppe
#

ah, that is something I have yet to encounter

verbal tendon
#

Hence why I made the note, it has its own learning curve

#

and so I dont get dirty looks from someone that would interject saying you should just use GAS instead (!)

#

😁

worn steppe
#

πŸ˜„

woeful ferry
#

Use GAS

clear island
#

when I call a multicast on the server, it will run on all clients and the server but which first?

#

does it run on the server first and then all clients? or the other way around?

twilit radish
#

The server runs it first because it can call it local. What client runs it first after that is impossible to tell because of random latency.

#

But the server has no latency towards it self so will just run it instantly I assume.

clear island
#

I see

royal forge
#

i'm trying to figure out a way to ensure that a game client is up to date, in order to prevent outdated game clients from playing online. how would i go about doing this?

fossil spoke
#

The alternative is that you produce your own method for ensuring your game clients are up to date.

#

An independent program that acts as a Launcher is a typical approach as well.

royal forge
#

figures, thanks for the answer

clear island
#

the way I do it is when connecting to a server I send the build version (a variable I increment every update) of the client, and on the Gamemode class I just check if the client version matches the server version and if not, I reject the connection with an error message

winged badger
#

FNetworkVersion::GetLocalNetworkVersion

#

and have your build server inject the changeset ID via a config variable to be used in the version generation

vivid egret
#

I am ready to publish (almost)!!! I am unsure if I should go for SteamCore Pro on the Epic Store, or use the classic Steam Advanced Sessions. Does anyone have feedback or advice on this?

winged badger
#

not really almost ready to publish if you haven't figured our your session interface months ago

#

are you using c++ or blueprints only?

vivid egret
#

haha well youre very right. What do you recommend?

#

Blueprints

winged badger
#

not sure then

#

we tried UWorks for a time, which is very similar to SteamCore i think

#

but we also discarded it years ago, just simpler to do the whole thing in c++

vivid egret
#

interesting, okay. Ill look into C++. Im a psychologist, not a computer scientist, so I pretty much only know R/Python. Im sure ill learn something new

winged badger
#

both ShooterGame and Lyra come with complete network/session code iirc, just needs to be configured

#

and Epic does not mind you stealing that

fossil veldt
#

Yea p much if you want it all 100% BP you are shit out of luck unless you use steamcore, otherwise Online Subsystem Steam is perfectly fine and has everything you need

winged badger
#

main problem with doing anything network related in blueprints is when something goes wrong you can only curl up in the corner and cry

#

as your most powerful debugging tool is PrintString

fossil veldt
short arrow
#

that breaks too sometimes kekw

winged badger
short arrow
#

^

fossil veldt
#

you actually can there’s a unit testing command to enable sessions in PIE

short arrow
#

on a dedicated server, you can only print string everything

fossil veldt
#

actually works well enough for if you just wanna do quick PIE testing

short arrow
#

testing in editor is unreliable tho

fossil veldt
short arrow
#

plenty of things that work in the editor that don't seem to work in packaged games :<

fossil veldt
#

the struggle

vivid egret
#

This has been very helpful but has exceeded my ability comprehension at this point. thanks all! i will stop being a child and start using c++ lol

winged badger
#

that is why nothing that tends to break packaged only is ever in blueprint here πŸ˜„

winged badger
#

oh yes

vivid egret
#

Well I know the packaged version of my project works fine over LAN, so maybe that counts for something

winged badger
#

there is one more caveat to consider here Chroam

#

when you are testing your game, you are using it the way you imagined it should be used

#

which makes you uniquely terrible at testing your own stuff

vivid egret
#

Absolutely, Im a Human Factors Psychologist so Ive put a great deal of thought into that πŸ™‚

winged badger
#

when average Joe drops by, he won't be so kind

vivid egret
#

but im not free from bias

winged badger
#

and the game will break

fossil veldt
#

best thing you can do is setup tests :D, tests don’t care about your feelings

vivid egret
#

Unless the game integrates emotion as a real time variable πŸ˜‰

clear island
#

for me when it comes to multiplayer games one thing I learned when introducing a new feature is to test the following cases:

  • Make sure it works on the server (usually checking in the editor)
  • Make sure it works on simulated proxies
  • Make sure it works on autonomous proxies
  • Make sure it works with high ping (pktLag= 500 usually πŸ˜› )
  • Make sure it works for players who join late (very common for me as I use dedicated servers)
  • And finally, one I learned in the last few days, make sure you test what happens when actors go in and out of net cull distance πŸ˜„
#

if I cant make all those scenarios work perfectly just for me when testing, I never even setup testing sessions

#

and when I do, then there's a ton of new stuff I didn't even think about before that testers find out

#

but those first scenarios I mentioned are usually a pretty good start

vivid egret
#

How important is Net Cull Distance actually? Thats one thing I am worried about because I havent bothered trying to understand LODs and all that jazz.

clear island
#

well if you have big maps, is a real pain in the ass

winged badger
#

it has nothing to do with LODs

clear island
#

you can always set all actors to relevant but thats a bad idea

winged badger
#

replicated actors that aren't relevant are destroyed on clients, and respawned when they become relevant again

clear island
#

for games with small maps I think setting all as relevant is fine though

#

but if you're making a game with big maps, thats not really an option

vivid egret
clear island
#

well for me games with small maps would be overwatch, valorant, rocket league, usually team games

#

but yea any type of open world map, you need to use net cull distance

#

if you have alot of replicated actors that is

vivid egret
clear island
#

not familiar with that

vivid egret
#

Thats a map in OW

clear island
#

oh I see

vivid egret
#

This has all been very interesting. @fossil veldt @winged badger @clear island If any of you have published material, message it to me and I will purchase it soon to support your work.

clear island
winged badger
#

replicating Actors costs

#

relevancy is there to keep it more manageable

clear island
#

although usually if you cover the use case of players joining the server late, I think alot of the issues with net cull distance coming into play might already be worked out

winged badger
#

there is even relavancy system upgrades like ReplicationGraph to handle that better

vivid egret
#

I wish there was some tool to quantify processing load for each thing, or even a meta-measure of all things.

clear island
#

yea the replication graph is super interesting, unfortunately not much documentation about it

clear island
#

unreal insights

#

I use it alot to profile my dedicated servers

#

you can profile cpu and memory

vivid egret
#

mindblown I will look into this soon. I appreciate your great wisdom.

clear island
#

no problem, im still very much of a beginner, been using UE for almost a year now and I can say most of my issues have always been me fighting with the UE game framework, or finding out about some weird quirk that is not mentioned anywhere in documentation

#

the concepts I can understand, since I've worked in webdev for a long time, so some of the programing I find easy to understand, its just the game framework itself it takes some getting used to

vivid egret
#

Yeah thats relatively similar for me coming from a statistics heavy area, equation terms and variable manipulations are easy but the computer science concepts break me. (and most of my UE experience is for developing research interfaces for my colleagues laboratories which dosnt help). Good luck!

short arrow
#

God you worded it so perfectly

#

QA staff is underrated man

clear island
#

its even worse if you're using dedicated servers you cant test those from the editor

#

cant test all those cases of players joining late

#

its a pain in the ass

#

and since you need to have a source build to even use dedicated server sometimes even stuff you buy from the markeplace wont work because it hasn't been tested with dedicated servers

winged badger
#

you can do a somewhat reliable test in editor for hot joining

#

just need to enable the feature in editor preferences

clear island
winged badger
#

yeah, search for join in editor preferences

#

its under experimental still i think

#

you get a button to hotjoin a new player after you start PIE

clear island
#

oh my god

short arrow
#

Oh yeah testing with late joins is essential man, gotta have that turned on

clear island
#

you dont understand what I have been doing so far to test dedis

short arrow
#

Be careful, editor will crash if you add a client while you're breakpointing

clear island
#

closing editor then starting with -server param

#

thanks!

short arrow
#

Crashes a few other times too when I added a client

clear island
#

thats interesting, will give it a try

#

seems to be working good, one step closer to doing reliable dedicated server tests faster

#

yes, but it will run on client 2's game

winged badger
#

when a player starts the game, say a new client joining

#

its GameState will replicate that the game has started

#

and that will dispatch BeginPlay on that players world, locally

#

but that means for every actor in client 2's world, including the client 1's pawn in client 2's world

clear island
#

well you need to remember that on a multiplayer game, there is a "copy" (for lack of a better term) of each player character on every client's game

#

so for client 1 to see client 2 in his screen, he recreates a copy of it that is similar to the one on client 2's screen

#

I'm oversimplifying here, but the point is: BeginPlay will get called on every client

#

you can check if the client is locally controlled or a simulated proxy

#

and do things based on that

#

so you want to set those only for the character that is being controlled by the player

#

there is a function: IsLocallyControlled() you can use

#

it returns true if you are controlling that player

near granite
#

I want to make all clients to go to next level when one client clicks the key 1

I don't know well how to do this by using server.

after doing this, hands tracking is not working.

Could you check if this code is right for switching level of all clients at the same time?

clear island
#

np πŸ‘

winged badger
near granite
winged badger
#

no, seamless travel is same server, different map

#

and when server executes it engine will pull your clients along for the ride

near granite
#

Could you guide me a little bit more about seamless travel?

#

console command should be written like this --> ServerTravel/Game/.../LV_1(<--map name) ??

and should i make this code as "executed on server"?

sinful tree
near granite
#

I'm doing on UE5.1,,still available for this?

#

and i have to server travel 7 times becuase i have 8 number of levels

near granite
near granite
uncut atlas
#

hi, i'm learning about dedicated servers. how does your dedicated server build know what to do such as what map to run? i'm thinking the server build could load a lobby map upon startup and when players retrieve the ip and connect the server then server travels to a map where the game takes place. then after the game ends it'll travel back to the lobby map.

woven basin
uncut atlas
#

ah ok. good to know. thnx!

polar cobalt
#

LyraWeaponStateComponent.h::56-57

#

server reliable RPCs every time client-side hitreg fails or something; I didn't read all the details

#

I think I'll remove it

verbal tendon
#

Lyra is a technical demo/example game, and as with all of these, regardless of what Epic says, you should not use them as a foundation for a game, atleast if you are serious about it

hollow bridge
#

Hi is it possible to control 2 characters with 1 client? I'm trying to SetMovementInput for my horse but it doesn't work (unless I possess him or use RPC)

polar cobalt
#

Also, I'm not sure that making a game using Lyra as a starter is a per se terrible idea, but the first thing someone must do, if that's their goal, is to read, understand, and remove everything in lyra which can't be justified as aligning completely with their performance/design targets...but people don't usually do this, it's exciting to start a new project, and takes a lot of discipline and effort to carefully read thousands of lines of someone else's code......

verbal tendon
#

Lyra is the basis for a very specific tech demo with very specific constraints

#

Just like all tech demos, they serve a purpose. If you never want to make any major structural changes, sure whatever, but as soon as you are trying to add things that lie outside of these constraints you have a problem. It is best to start clean to know what you have, define your own requirements and constraints, add to that what you need

near granite
#

Through server travel, I'm moving clients to different level at the same time. instead of this, How can I make each player move individually at a specified time?

#

Now i'm doing like below

#

This is because sequencer playback should start at the same time on all clients, but the level loading completes at different times, so sequencer playback is out of sync.

worn steppe
#

I'm not sure about your question, but it seems like you could add logic to only begin your sequences playback once all players have loaded and are ready

near granite
#

I would like to adjust the timing at which all players move through the level slightly differently so that the sequencer plays at the same time.

worn steppe
#

If I understand you correctly, why not disable the sequencer autoplay, and then hold an array of booleans or something that starts false and becomes true when each player has finished loading the level, and then when they are all true then start the sequencer playback on each client at a single time?

#

and when players load the level, before the sequencer playback begins, you could add a 'Waiting on other players to load...' screen or something

near granite
worn steppe
#

I believe something like PostLogin() is called when a client finishes loading a new map

#

Pawn: Created by GameMode inside AGameModeBase::RestartPlayer(), called by AGameMode(Base)::HandleStartingNewPlayer(), called by either AGameMode(Base)::PostLogin() in case of hard travel, or AGameMode(Base)::HandleSeamlessTravelPlayer() in case of seamless travel.

#

I am not 100% sure if this event is called after seamless travel for already connected clients, but it seems like it is

#

perhaps someone else here can attest to that

near granite
#

Thank you for good material. I'll take a good look at it

verbal tendon
fathom aspen
#

HandleStartingNewPlayer is also for both and is BP accessible

fathom aspen
worn steppe
#

_> grumbles why do we need to use a source build to build a dedicated server grumbles

twilit radish
#

Because the people that don't need them would like to save a bunch of disk space :3

verbal tendon
#

That would totally not be why

twilit radish
#

Lol

#

EOS is still too good to be true. Nothing will change that opinion for me xD

near granite
near granite
twin juniper
#

https://youtu.be/SNNH7uJo40A
I am trying to implement Teleportation functionality in Shooter Game sample of UE4. The problem is how to get the facing direction of player.
Should I use Deproject Screen to world as the programmer does it in this video, or is there a better way?

Also should I call the functions that he called in Blueprints but from C++, or should I use blueprints as last resort.
Rather than using the complicated input blueprints like in the video, I just plugged the T key to TeleportPressed event that sets its bool to true and then used UpdateCharacterStateBeforeMovement to set the destination to transport to. Is this right? And then now all I need to do it set teleport destination correctly.

clear island
# chrome bay Depends how you're attaching it

hey, sorry for tagging, but just giving an update on this as I finally found out why the socket gets rotated when the vehicle re-enters net cull distance, its because I have the CMC component tick disabled

#

I disable the CMC tick when I attach the passenger which works fine to prevent the CMC from fighting with the vehicle movement, but when the vehicle comes back into range, the character CMC is already disabled, which causes the socket to go into weird places/rotations

#

I guess I have no other way to go about it than to create a custom CMC

verbal tendon
winged wave
#

Is there any good resource to learn the basics of a multiplayer fps in C++? I tried the legacy sample from Epic but besides the fact I think it is quite outdated, it lacks basic functionalities, like crouching, and when a character aims down sights the other players don't see any change on their screen (to name a few), I checked even paid resources on Udemy or the Epic Store for example but I couldn't find anything

quasi tide
#

Check the pinned resources. You just need to learn networking in general.

clear island
#

seems like even disabling PerformMovement, SimulateMovement and SmoothClientPosition still causes the issue

azure cape
#

hey, if I create an instance of a class inheriting from UObject, can the client send that UObject to the server or does it have to also already exist on the server in order to be replicated?

#

cause I'm planning an inventory system and I'd like for inventory items to be UObjects, and for the player to be able to send his current inventory to the server when he connects

crystal crag
#

That sounds like a terrible idea

#

Making the client the authority of what the inventory should be

#

Sorry, that sounded much more harsh than I meant it to sound

azure cape
#

I know but in my case having the save data on some server isn't an option

#

I'm also fine with clients cheating in items this isn't a commercial project anyway

crystal crag
#

Well I am not sure if that is supported. I would be surprised if it is. I know that you can replicate UObjects as part of an actor or actors replicated subcomponents method, I also think with some work you can technically make them work with RPCs, but I have never seen it tried the other way around for just plain UObjects

#

That's generally anti-server/client model, so I wouldn't be surprised if it wasn't supported

azure cape
#

I mean if it's not possible from server to client in any way I don't see how any multiplayer game in unreal would have an inventory system, and if it is then it's probably possible from client to server as well

crystal crag
#

It is possible from server to client

azure cape
#

how then? do you pass the UObject in a RPC or something?

crystal crag
#

I haven't looked into using RPCs on custom UObjects, I just have seen people talk about doing it with some work. I've never needed to use RPCs on them. I have replicated them from the server to the clients using the replicate subobjects method in C++

azure cape
#

and the client wasn't aware of the uobject's existence prior to the replicate subobjects thing?

crystal crag
#

Right, but that's a the role of the server, to spawn replicated actors when needed

#

Generally if you have a dedicated server, you would have some backing storage of some kind to keep a record of the player's data

#

whether that be savegame or a custom Db

azure cape
#

I don't have a dedicated server, this is peer to peer

crystal crag
#

I haven't used p2p and have only used dedicated server / client model, so I don't know what all is possible with it.

#

Not sure if p2p still falls under the listen server model within unreal engine

azure cape
#

p2p is listen server iirc

#

it's basically "one client is both a client and a server"

crystal crag
#

Right

#

I'm aware of how a listen server works (generally speaking), but wasn't sure if p2p falls under that umbrella still

jaunty panther
#

might anyone be able to help me with some replication problems to do with launch character?

azure cape
#

just read through this and it seems replicating subobjects is possible at least from server to clients
at this point I'm thinking of using subobjects only for inventory slots, with items being structs containint a reference to a dataasset with the "constant" data (ie item stats), and a list of structs inheriting from a "itemcomponent" struct that'd contain data that changes (like durability) and callbacks defining what to do when an item with that component is equipped/unequipped by a character

dark edge
#

True p2p doesn't happen in Unreal unless you go nuts and implement it yourself

still cypress
#

Hey guys I'm having a basic replication issue with a player character.
Replicate Movement is of course checked, both instances of the player are the same actor so there's no difference in configuration.
I think the issue might be that the camera or some other component transform is not replicating from the client to the server, but it does replicate from the server to the client.
As a temporary catch all, I do have Component Replicates checked for all player character components.

shy aspen
still cypress
shy aspen
#

Yes, that's the one that'll give you proper pitch values.

#

It's less accurate than Control Rotation, but it does the job

still cypress
verbal tendon
#

Thats as simple as it gets

shy aspen
#

Read from it to make your character look up / down. I didn't see any code in the video that shows how you're making your character look up/down.

still cypress
verbal tendon
#

You dont set the control rotation, you want to add input on the client

#

the rotation is replicated for the base aim

#

You handle everything else based on the rotation in the ABP

still cypress
#

I'm not at all saying you guys are wrong of course I'm just not understanding yet.
Get Base Rotation obviously just gives you the current rotation but doesn't actually rotate an actor or component.
If Base Rotation is replicated, how do I modify Base Rotation? I don't see a Set Base Rotation or something