#multiplayer

1 messages Ā· Page 80 of 1

frank birch
#

and try making that

#

fail small, fail often šŸ¤”

icy jetty
#

True, but the way I’m wired, I need to work on something I actually care about

#

Like a game I would enjoy playing.

#

Keeps me motivated

#

And tbh, I fail in one way or another almost every time I press play lol

graceful flame
#

Can a testing configuration client build connect to a shipping server build? Do they have to both be the same build config? Assuming there's no differences other than the build configuration.

dark edge
#

The problem with RTS is its a large genre

#

what would work for a small scale RTS like Company of Heroes would absolutely NOT work for something like Supreme Commander

frank birch
#

I made a RunKittyRun once, offline, simple minded AI... 5 wolves... 3 fps

#

that's when I realized I sucked

#

but I got better 🦾

#

(also, tower defense can be a good "fail small" approach to an rts šŸ¤” )

dark edge
#

how do you get 3 fps

frank birch
icy jetty
#

Lol

#

Yeah tower defence sounds like a fun project

prisma snow
#

actually optimized js is probs faster than C++ sometimes

frank birch
#

12 years ago, 17 year old me thought he was smart and could do pathfinding in javascript from scratch...

glass orchid
#

Is it better to store information such as Character selection and lobby ready status on the player controller or in the playerstate?

kindred widget
#

Do other players need to know if someone's ready, or what character they've picked?

glass orchid
#

yes to both

kindred widget
#

Other players don't have access to other player's controllers.

#

Imo, I'd recommend not putting it on the PlayerState either if it's lobby only information. Make a basic LobbyState and throw it on your GameState and store stuff there until game starts.

glass orchid
#

ive got pawns in the lobby that reflect the selected character and ready status, but they only display the information.

glass orchid
kindred widget
#

I was more recommending a modular solution. I don't personally like storing stuff all game if it's only used briefly. In this case an actor component on GameState could exist when in a lobby state and be destroyed when not in a lobby state. And store player's lobby states.

glass orchid
#

im planning on saving the selected character to a savegame object so that when you restart the game your character selection is still the same, (granted, it doesnt have to be stored once the actual match has started)

i suppose could store everything on each lobbyPawn, since they dont persist between levels.

#

argh data management is tricky šŸ˜†

regal geyser
#

Why does this work only on the server and not on clients? I basically just want to have 1 static camera that each player will be looking from.

glass orchid
regal geyser
glass orchid
#

assuming this is for when the game starts, you can just set up a playerstart wherever you want the initial view will be

haughty maple
#

I have a question regarding replication of player state and seamless travel.
Our current setup involves a listen server with multiple clients connecting to it, and then doing a seamless travel to another map.
After a seamless travel, most of the time, the players states replicate across correctly, but in a low chance, (< 5%), the player state doesn't arrive at the client correctly.

I'm not sure where the error is coming from, but when it did occur, it only affected one client. The host and the other clients were able to receive his player state correctly, but he did not.
The client did receive this in the log

log: LogNetTraffic: Error: UActorChannel::ProcessBunch: New actor channel received non-open packet
UActorChannel::ReceivedBunch: Received a MustBeMappedGUID that is not registered.

but I'm not sure what that error actually means. I searched in google, UDN, and the discord and while there is some mention of it, but nothing really points to what the error means, and what needs to be done to resolve it. Does anyone have any experience with this issue? Is this something the client or the server needs to fix?

haughty maple
#

I may have stumbled on a fix in UE5.0+. If anyone else encounters this issue,

net.ResetAckStatePostSeamlessTravel=1

will reset the ack state of GUIDs. The result from their documentation is:
Enabling this may prevent problems with Actors not replicating after travel due to clients missing entries in the NetGUID cache.

hollow swallow
#

im setting a lifespan on one actor, then trying to check it on another actor. i have done a server > mc to set the lifespan on the actor, and its printing correctly but when i try access it, only the server can see the correct value, clients cant. is there a certain way i need to do this?

#

is lifespan just not replicated at all?

fossil spoke
#

SetLifeSpan creates a timer with the passed in value.

#

When that timer expires it simply calls Destroy on the actor.

#

Actor Destruction is replicated if the Servers version is destroyed.

#

So calling SetLifeSpan on the Servers version of a Replicated Actor will ultimately lead to the Clients version being destroyed as well (assuming it doesnt get TornOff prior for some reason)

#

So generally speaking it is unnecessary to RPC down to the Client to set Lifespan.

#

Keep in mind though, that if you destroy a Clients version of the Actor (through SetLifeSpan expiring or a call to Destroy) the Servers version will still exist.

edgy helm
#

Hey, noob here. How can I change player’s names and show them in multiplayer correctly? When I do this every client sees different names. I did thin in player state, could someone send me a snippet o r explain how I should do this?

rose egret
#

guys I get this error and dont know why

#
Epic Developer Community Forums

Hi there, For replay, I am replicating a bunch of "Tarray" s which are being updated in tick continuously, and i am getting this warning then recording stops. I am not trying to send this data from Server to client, only i want this data in my Replay. if I remove the replicate property for those bunch, i am not getting the warning and i could ...

#

is it because of replication or repliable RPC s ?

#

this happens when new player try join the game. they get disconnected immediate becaue of overflow

winged badger
#

You should be looking at the callstack

#

At a glance looks like version mismatch

#

Or a mismatch between cooked content and your binaries

#

Less likely

viscid tapir
#

I just did something that is really not clean I believe.. OnRep functions were not called when my TArray was getting modified in a for loop on clients (it was working well on server) so I just used a Client RPC at each modification of the TArray... Its now working as intended but i'm confused why do OnRep calls get ignored ? Like the variable is changing the value (in this case an element of the TArray) so why wouldnt it trigger OnReps ?

pallid mesa
#

is it on blueprints?

#

if its in C++ and if you predictively change the array before is reps down from the server, the onrep wont be called on the client side as there is no change when the array wants to replicate

viscid tapir
#

Its on c++

#

wait let me read

#

Hum I think i got it, can i share you my code ?

pallid mesa
#

post it here

viscid tapir
#

Yeah ofc !

#
for (int32 i = Index; i < MaxIndex; i++) { // In the AddCard() function (cards are basically items)
        if (InventoryContent[i].IsNullCard()) {
            /*LastChangedCard.Key = CardToAdd.CardRowName;
            LastChangedCard.Value = i;*/ //Old Method
            InventoryContent[i] = CardToAdd;
            SetCardClient(CardToAdd.CardRowName, i); // New method
            /*if (GetOwner()->HasAuthority()) {
                OnRep_Inventory();
            }*/ //Old Method
            UE_LOG(LogTemp, Warning, TEXT("Item Got Added !!"));
            return true;

void UInventoryComponent::SetCardClient_Implementation(FName CardName, int32 Index)
{
    OnCardModified.Broadcast(CardName, Index);
}
void UInventoryComponent::OnRep_Inventory()
{
    /*if (APawn* MyPawn = Cast<APawn>(GetOwner())) {
        if (MyPawn->IsLocallyControlled()) {
            OnCardModified.Broadcast(LastChangedCard.Key, LastChangedCard.Value);
        }
    }*/ //Old Method
}
        }```
pallid mesa
#

the array above is only modified on the server?

viscid tapir
#

Yes, this function is called from server-only

pallid mesa
#

ahh, yeah btw if i read correctly you were making a card game, right?

viscid tapir
#

Its more like an inventory where you store cards

#

that have effects

pallid mesa
#

i remember from reading you back to back these past days..

#

i really recommend you to try fast array serializer

viscid tapir
#

Oh yeah Kaos also told me that with big arrays

pallid mesa
#

it can also be convenient because of the callbacks u got there

viscid tapir
#

there is like 20 slots in the array which is pretty big i guess

#

Well i'm going to read some docs, thank you

pallid mesa
#

ah no, thats not really a lengthy array, but the convenient callbacks you get on a fast array serializer will make your life asier

viscid tapir
#

Ok i see

#

Btw the current version is working but i suppose is really not optimized (calling "useless" RPC)

#

as we could avoid calling this one

pallid mesa
#

regarding the issue with the tarray... unless you made it push based and you need to mark it dirty... meh im not sure what is happening; but yeah you really do not want a client rpc, that wont preserve state for your client if he gets a sudden recoverable disconnection

viscid tapir
#

I understand

#

I did not make it dirty btw

#

might come from there perhaps

hollow swallow
dark parcel
#

Guys I read that root motion animation should be avoided in multiplayer game since it derives location based on the animation.

In multiplayer setting what would be the solution then for animation that mostly require root motion in single player game?

edgy helm
#

Hey, quick question. Why is it that after servertravel the players don’t spawn in? The spawning logic is inside the player controller class.

thin stratus
#

Is it Seamless ServerTravel?

#

Are both GameModes using the same PlayerController class?

edgy helm
#

It is on beginplay

#

It is seamless

#

The game mode is the same

thin stratus
#

Well if you also tell me that both cases have the same PlayerController class, then you are basically falling for the problem that the PlayerController is not being respawned and won't run BeginPlay again

#

Spawn the Pawns in the GameMode and you should be fine

edgy helm
#

Oh ok, but does that work even when the game starts?

fathom aspen
#

Yeah, why not. That's how vanilla Unreal spawns Pawns (through GameMode)

edgy helm
#

Oh ok thank you.

#

But um… I tried simply putting the characters as default player characters after servertravel… but now one spawns correctly while the other spawns a camera at player start with which you can look around but no character…

thin stratus
#

If they spawn inside of each other and you didn't set the Collision to Always Spawn in your Pawn, it will fail to spawn

#

The Log should also show something about that

edgy helm
#

But this time I only set them as default player characters, I have no control over the spawning of them

thin stratus
#

The Pawn Class (or actor even?) has the Collision stuff as a Member Property

vestal token
#

Hi does any1 know some good book maybe about Unreal Engine networking in depth? Like really in depth. not just replication and RPC and how to use them in my game code, I want some information about UDP protocol implementation, also encryption implementation how replication works on low level and also RPC, how Editor compiles server how RPC binding works and so on.
Some good articles or videos also would be nice. TY.

thin stratus
#

I highly doubt that exists

#

I have at least not yet heard of any such resource

#

Despite reading Source Code itself

vestal token
#

@thin stratus I'm kinda learning UE5 right now (Started like 2 mounts ago), and realized there are bunch of videos about UI\Graphics\Blueprints and so on, like tones of them, but almost zero information about UE networking and also server side like how it works on low level, just to understand all logic and be sure about what I'm doing in my code.
I'm reading a book so far about game networking in general, like TCP\IP, Sockets and so on, rly handy info up there, and it would be nice to get some about UE networking.

thin stratus
#

You might find some small bits and pieces on random blog posts, but nothing really like a book I would guess

#

Yeah I mean, that's because probably 98% of UE's users don't care of the low level stuff

#

That's why it has a mid and high level API to use

#

If you really want to learn it and you can't find anything online, you'll have to read through the source code

icy jetty
#

put on your goggles and dive in

marsh gate
# vestal token <@94211915902889984> I'm kinda learning UE5 right now (Started like 2 mounts ago...

I am slowly compiling an Unreal Engine Deep Dive on the architecture of the engine: https://github.com/SyedAman/UnrealEngineDeepDive. If you find what I have so far useful and want more in a certain section (like networking), I can add more.

Networking
The original Unreal game shipped with its multiplayer networking layer built on top of the User Datagram Protocol (UDP) as the chosen transport layer, taking inspiration from its competitor Quake. This is due to UDP's lower latency and the fine-grain control it provides to the developer compared to TCP. UDP packets contain less headers and do not require an established connection. Furthermore, UDP does not guarantee packet delivery, nor the ordering of packets. While this reduces reliability of UDP, this also reduces the overhead in sending packets.

Whereas for TCP, dropped packets are retransmitted and packets contain additional headers to maintain ordering. The additional overhead this creates is unacceptable for games like FPS games with low tolerance for delay. One of the biggest issues with using TCP for FPS games for example, is that TCP will retransmit dropped low-priority packets even if it means delaying high-priority packets. For example, a packet for shooting a sniper rifle might be delayed because of a dropped VOIP packet once TCP retransmits it and waits for successful acknowledgement.

Unreal Engine implements its own custom networking protocol called Unreal Datagram Protocol (UDPG) built on top of User Datagram Protocol (UDP) that provides reliability to the unreliable data you get with UDP due to dropped and out-of-order packets.

Relevant files:

UdpMessaging/Private/Transport/UdpMessageProcessor.h

#

Client Side Prediction

It is good to provide context and some history here. The original Quake 1 released with the client-server network topology and "Dumb Terminal" networking model where essentially all the simulation was taken care of server-side. There was no client-side prediction, dead reckoning, nor any other kind of lag compensations made to improve the player experience. Although this reduced vectors for cheating, this creates a poor player experience. This meant that when a player moves his avatar, the following sequence of events occur:

  1. His local game sends a packet to the server containing the move input
  2. The packet takes 50ms (hypothetical) to get to the server
  3. The server receives the client packet and updates the avatar's position
  4. The server sends a packet to the client with the updated avatar position
  5. The packet takes 50ms (hypothetical, both ends usually are not identical) to get to the client
  6. The client receives the packet with the latest avatar position and updates avatar

By then, it has been a 100ms round-time trip (RTT) before the client can even update its position in the game. To make matters worse, the client is now 50ms (1/2 RTT) behind the server. This creates a noticeable delay for the player, who might be running at 60fps (16.7ms per frame). By the time the player sees his avatar move, he would have rendered 6 frames already!

For a Quake 1 multiplayer update called Quake World (1996), John Carmack made significant improvements to the player experience that would change multiplayer gaming forever and influence the networking model of games to this day (including Unreal Engine). He introduced client-side prediction:

Instead of waiting for the full RTT (e.g. 100ms) to update the local avatar, the client will run a local simulation of the movement action. Then, the client makes appropriate adjustments when receiving the authoritative packet from the server...

rose pollen
#

I have weapons that are child actors of monsters in my game and am running into issues where if the monster respawns when the player is far away and then the player walks up to the monster the weapon doesn’t seem to replicate and the monster will basically do it’s thing while swinging an invisible (to the player) weapon. Is there something tricky about replication and cull distance for child actors? I basically want the weapon to be relevant whenever the monster itself is relevant

pallid mesa
#

try to avoid using Child Actors Components. I - to date - keep suffering net addressability issues over them on seamless travel

rose pollen
#

I see, do you recommend I just use a variable that is a reference to the weapon actor and bind it to a socket?

pallid mesa
#

the way these work is pretty cursed, you are better off to just have the weapon representation actor as something you attach to your pawn

#

yes

rose pollen
#

K, will try it thanks. I actually had thought about doing it that way originally lol

visual glen
#

Hey all, pretty new to networking games, was wondering if it would be possible to add a way for players to connect to each other AFTER creating the networked gameplay, or if that's something I should consider before I start development

fathom aspen
#

Imo matchmaking isn't a critical task, and neither that it's going to be an easy one, so it can wait.

#

First make sure that your game works from the network perspective, and for that this channel pins has many handy resources

worthy plinth
#

If I'm modding a game, and I require the element index of a variable within a package(s) (multiple within game files)
What's the best way I can approach getting this? It's for a UE3 abandoned game, need element indexes of specific variables to edit values on a fan revived server.

fossil spoke
#

You are better off finding a community that specifically deals with UE3.

#

The question itself is also offtopic for this channel.

worthy plinth
#

Unfortunate

silent valley
woven basin
#

Thanks you for the work with this. It’s articles like this that make it possible for people like me to continue on my indie game Dev stuff. Really appreciate it!

arctic minnow
#

Why is this not replication on the other client?

#

šŸ™‚ šŸ™‚

fathom aspen
#

From what we can tell, you are setting replicated properties on client (from input). For a replicated property to propogate to other clients it has to be set on the server (can be done via a server RPC called from input for example).

#

Check this channel pins to get educated on these kind of stuff

#

And if you're a blueprinter, check "multipayer in blueprints" doc from Epic

gaunt cliff
#

need help trying to debug a server crash, the server binaries are linux and we are with windows, we have the debug symbols, the crash dump, but we are not able to start the debugging process with visual studios, is there any guide or tutorial to do that ?

viscid tapir
#

I'm trying to learn FFastArraySerializer class but i'm having issues meanwhile VS is telling me there is no apparent errors.. Do i need to add something in modules or to include something else than #include "Engine/NetSerialization.h" ?

viscid tapir
#

This is the error i'm getting btw : "__declspec(dllimport) class UScriptStruct * __cdecl Z_Construct_UScriptStruct_FFastArraySerializerItem(void)" (__imp_?Z_Construct_UScriptStruct_FFastArraySerializerItem@@YAPEAVUScriptStruct@@XZ) referenced in function "void __cdecl `dynamic initializer for 'public: static struct UECodeGen _Private::FStructParams const Z_Construct_UScriptStruct_FCardItem_Statics:: ReturnStructParams ''(empty)" (??__E?ReturnStructParams@Z_Construct_UScriptStruct_FCardItem_Statics@@2UFStructParams@UECodeGen_Private@@B@@YAXXZ)

gritty nymph
#
UAbility::UAbility()
{
PrimaryComponentTick.bCanEverTick = true;
    SetIsReplicatedByDefault(true);
}
void UAbility::UseAbility_Implementation()
{
    if (UseStamina())
    {
            if (GetOwner()->GetLocalRole() < ROLE_Authority)
            {
                Server_HitscanFire();
            }
            else
            {
                HitscanFire();
            }
}
bool UAbility::UseStamina()
{
    UPlayerStats* PlayerStats = Cast<UPlayerStats>(GetOwner()->GetComponentByClass(UPlayerStats::StaticClass()));
    if (PlayerStats && Cost < PlayerStats->GetCurrentStamina())
    {
        PlayerStats->UseStamina(Cost);
        return true;
    }
    return false;
}
void UAbility::HitscanFire()
{
    AZaProjectCharacter* Owner = Cast<AZaProjectCharacter>(GetOwner());

    UCameraComponent* CameraComponent = Owner->FindComponentByClass<UCameraComponent>();

    bool bHit = GetWorld()->LineTraceSingleByChannel(HitResult, SpawnLocation, SpawnEnd, ECC_Camera, TraceParams);

    if (bHit)
    {
        if (GetOwner()->GetLocalRole() == ROLE_Authority)
        {
            Multicast_HitscanHit(HitResult.ImpactPoint, HitResult.ImpactNormal);
        }
    }
}
void UAbility::Server_HitscanFire_Implementation()
{
    if (!ensure(GetOwner()->GetLocalRole() == ROLE_Authority)) return;

    HitscanFire();
}

bool UAbility::Server_HitscanFire_Validate()
{
    return true;
}

void UAbility::Multicast_HitscanHit_Implementation(FVector HitLocation, FVector HitNormal)
{
    if (HitEmitter)
    {
        UGameplayStatics::SpawnEmitterAtLocation(GetWorld(), HitEmitter, HitLocation, HitNormal.Rotation());
    }
}
void UAbility::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);
    DOREPLIFETIME(UAbility, AbilityType);
} ```
#

anything blatantly obvious messed up?

#

when I shoot withthe client

#

it disconnects from the server

#

with this error LogNetPackageMap: Warning: UPackageMapClient::InternalLoadObject: Unable to resolve default guid from client: ObjectName: NODE_AddMyAbility-0, ObjOuter: /Game/ThirdPerson/Maps/UEDPIE_0_ThirdPersonMap.ThirdPersonMap:PersistentLevel.BP_ThirdPersonCharacter_C_1 LogNetTraffic: Error: ReadContentBlockHeader: Client attempted to create sub-object. Actor: BP_ThirdPersonCharacter_C_1 LogNet: Error: UActorChannel::ReadContentBlockPayload: ReadContentBlockHeader FAILED. Bunch.IsError() == TRUE. Closing connection. RepObj: NULL, Channel: 3 LogNet: Error: UActorChannel::ReceivedBunch: ReadContentBlockPayload FAILED. Bunch.IsError() == TRUE. Closing connection. RepObj: NULL, Channel: 3

fathom aspen
#

UAbility isn't found server-side when the server RPC runs, and hence why the server translates that as the client is trying to create that subobject on the server, which is prohibited

gritty nymph
#

Ok sooo the solution

#

Is 🄺

#

Server using it , it works fine but clients 😭

#

I can’t see anything in the code that would make it happen

ivory bear
#

Anything come to mind as to why the client, On Begin Play, checking if LocalController (and HasAutority (remote "I am the CLIENT") ) comes up false ("not my pawn") while the hosting player possesses his pawn?

gritty nymph
#

Because the host is the server ?

gritty nymph
edgy helm
#

Hey, I am having a word issue in which my clients don’t spawn in. There is no spawning logic, just a default character established in game mode. Any help is appreciated. Cheers.

fathom aspen
#

It's something that you messed up because any of the template projects that come with the engine have that working by default. Maybe the output log can give you pointers...

fathom aspen
#

So the check will obviously always almost fail

#

Clicking my face or finding the related pinned article should tell you that

#

Also as was mentioned, host always has authority (no remote execution)

weary cliff
#

I'm trying to decide what would be the best system to use for a coop P2P multiplayer game. Any suggestions on the best systems to look into to achieve this?

fathom aspen
#

What do you mean by "systems"?

weary cliff
#

Like EOS, Online Sub Systems, Etc.

#

There is a lot of options and not sure what would fit the needs best

fathom aspen
#

EOS is a type of an OSS

#

So if you're asking what OSS I should choose, it's literally up to what platforms you want to target

#

If you're asking about the server configuration, then it should be listen server

#

Do you have a working prototype?

weary cliff
faint eagle
#

Does anyone have any idea wtf is this log flooding? According to stacktrace it just comes from engine, but i don't remember it ever happened before. The engine is UE5.2 preview and the project is relatively fresh without external plugins or huge code base šŸ¤”

fathom aspen
weary cliff
#

Entire game is based around it

fathom aspen
#

Yeah which you can test locally on lan

#

Null subsystem should do it

weary cliff
fathom aspen
#

I would make sure the game works from the network perspective first tbh

ivory bear
fathom aspen
#

Yeah sadly I saw that Epic used it like that in one of their streams from 6 years ago, which is unfortunate NM_PeepoCryDrink

viscid tapir
#

Hello ! i'm trying to find out why is this code not working ? 12 external errors are found at the end of compilation.

USTRUCT(BlueprintType)
struct FCardItem : public FFastArraySerializerItem
{
    GENERATED_USTRUCT_BODY()

    UPROPERTY()
    int32    TestInt;
};

/** Fast serializer wrapper for above struct */
USTRUCT(BlueprintType)
struct FCardContainer : public FFastArraySerializer
{
    GENERATED_USTRUCT_BODY()

    UPROPERTY()
    TArray<FCardItem > Items;

    bool NetDeltaSerialize(FNetDeltaSerializeInfo& DeltaParms)
    {
        return FFastArraySerializer::FastArrayDeltaSerialize<FCardItem, FCardContainer >(Items, DeltaParms, *this);
    }
};

template<>
struct TStructOpsTypeTraits<FCardContainer> : public TStructOpsTypeTraitsBase2<FCardContainer>
{
    enum
    {
        WithNetDeltaSerializer = true,
    };
};```
Here is a line of an error : 
```unresolved external symbol "__declspec(dllimport) private: static int FFastArraySerializer::MaxNumberOfAllowedDeletionsPerUpdate" (__imp_?MaxNumberOfAllowedDeletionsPerUpdate@FFastArraySerializer@@0HA) referenced in function "public: bool __cdecl FFastArraySerializer::TFastArraySerializeHelper<struct FCardItem, struct FCardContainer>:: ReadDeltaHeader(struct FFastArraySerializer::FFastArraySerializerHeader &)const " (?ReadDeltaHeader@?$TFastArraySerializeHelper@UFCardItem@@UFCardContainer@@@FFastArraySerializer@@QEBA_NAEAUFFastArraySerializerHeader@2@@Z)```
edgy helm
#

Is it possible that my clients don’t spawn in because the spawn is already occupied by the server character?

dark parcel
toxic lion
#

in a blueprint, once I set a variable OnRep is called once on the client, and once for all other players

but in C++ if I don't manually call OnRep then it only runs once on the client, and doesn't run for the rest of the players. If i do call OnRep, then it runs twice on the clint, and then again for all other players

How can I get this to work like it does by default in blueprints?

fathom aspen
viscid tapir
#

No

#

I did not

#

What do you mean for actor ?

#

Framework/Actor.h ?

fathom aspen
#

Nope, ctor stands for constructor

viscid tapir
#

Oh no idk what it is ?

#

ah a regular constructor

#

i did not see one in the example code

fathom aspen
#

Start by adding the module

viscid tapir
#

It should be okay ?

#

It worked !!

#

Thank you

fathom aspen
#

Basically the code that runs it in your case runs on clients as well

viscid tapir
#

But what is the ctor ? In the code i provided previously there is no constructors

fathom aspen
#

And that's usually bad (unless reasons - prediction)

#

Replicated properties should be set usually only on the server @toxic lion

fathom aspen
fathom aspen
#

GAS does that for you out of the box, and handles prediction for you along the way

#

I don't know where you've read that animations shouldn't be root motion oriented in a multiplayer game. That's totally wrong

toxic lion
fathom aspen
#

Yeah usually it's to make sure that you gate that code with proper methods

#

HasAuthority is one candidate

#

IsNetMode and GetNetMode are others

toxic lion
#

I am calling it via HasAuthority, but just now realizing the issue is because the actor was being replicated that I was experiencing the difference as opposed to BP

fathom aspen
#

Sometimes HasAuthority doesn't workā„¢ļø the way you desire

toxic lion
#

I haven't found a good way to handle third person and first person item wielding, and was trying to attach the item to first person arms mesh if locally controlled, and third person mesh if not via an OnRep replicated variable

#

but since I need the item to be replicated, not just a mesh, I was using an actor (flashlight that emits light)

fathom aspen
#

Yeah I see nothing bad about that

#

That's probably how I would do it BlobShrug

toxic lion
#

yeah, unfortunately, at the moment it's causing the item to be spawned twice.

#

I'll need to keep playing around with this

dark parcel
fathom aspen
#

I've never used root motion out of GAS and I don't think I ever will, so I'm not sure

dark parcel
#

šŸ‘

#

I've been working for single player games over the years and would love to tap on multiplayer. When it comes to rpg combat, should the hit detection be done on the server side always? In a 100ms scenario what would be the best practice? Suppose we do the hit detection on the local so the player feels the game in smooth experience, what sort of validation we can test on the server side?

ivory bear
vestal token
#

@marsh gate Ye I already have some info about UE Networking from some forums and other sources, but I was thinking there are some real good sources that can explain step by step how UE Networking works, but seems there is none of that so will try to find out by myself reading sources etc. The only reason why I want to know how it works is the question is this best of the best for MMO games networking or it's not and I better find something else\better. Because my goal now is to implement my own standalone server for the UE Client. And would be nice to know is UE Networking good for MMO itself or no, I mean only protocol logic without any replication logic or RPC, I know if I want to use it for an MMO I will have to implement those things by my own and I already have some code from some other projects, so the only question now is it good for MMO kind of games or not at all...

eternal anchor
#

does anyone realistically use _Validate functions ?

obsidian cargo
#

Are there any recommended patterns for handling VFX that should play on every OnRep EXCEPT for initialization? IE: A character level up "ding" effect that should play when the character levels up, but NOT when the character level is set due to loading / spawning / any other init?

fathom aspen
#

Assuming that level is a POD type, a hack would be to check inside the OnRep if owning Actor HasBegunPlay

fathom aspen
fathom aspen
fathom aspen
#

For the 2nd part, just expose a variable that cache it

hollow eagle
#

It is incredibly rare to actually want to use a validation function. You'd only ever want to use it if the client is trying to do something entirely wrong and only possible via an unreconcilable difference between client/server or because it'd obviously mean they're trying to cheat something.

#

I can't even think of such a situation, quite frankly.

fathom aspen
#

ShooterGame has it iirc

hollow eagle
#

it's very hard to tell the difference between a high latency/high packet loss client and someone actually trying to cheat

#

at least from a single RPC.

fathom aspen
#

And many games where inspired by that game, so I would guess they have it too šŸ˜›

hollow eagle
#

ShooterGame isn't exactly a bastion of good hit detection design

eternal anchor
#

I 5hink it would be more useful if it just prevented RPC call instead of outright disconnect

hollow eagle
#

Agreed, I'd find that way more useful

vestal token
#

@fathom aspen I rather mean: Is it possible to rewrite this **UDPG **protocol for an MMO kind of a game like improve\optimize and so on, but keep original logic and actual UDP as core. For example Lineage 2 uses TCP and it can handle 5000 concurrent users on one server, But TPC is kinda oof protocol for MMO šŸ™‚ So UDP should be much better, but the question: is it better as UE Implementation or it is worse than even standard TCP...

hollow eagle
#

You're not going to be using unreal's networking for that kind of scale

#

you're probably not even using unreal as the server

eternal anchor
#

To be perfectly honest with Iris it is entirely possible to make MMO networking on scale, without tossing half engine away

hollow eagle
#

Yeah but managing that many players with a single unreal process isn't

eternal anchor
#

The problem is, just replicating player positions and abilities is least of your issues

hollow eagle
#

the networking isn't the only bottleneck, and you're not going to be using a single server to manage that many players

#

at which point you need a way to manage players across multiple servers, which inherently requires a custom solution. Whether that's entirely custom server software or something like spatialos

eternal anchor
#

Technically you can use single server, but you have to multi thread ahit out of it. Which means throwing away entire game framework

hollow eagle
#

you'll be at the point of effectively rewriting the engine inside itself šŸ˜›

eternal anchor
#

Yeah, other option is using something like haeden to make cluster or spatialos, but realistically stitching servers using Rpc have it is own issues

#

Division has interesting architecture, where basically single process, spins multiple worlds, which allows for nice seamless transitions to other players worlds, and "peaking" into other instances realtime

hollow eagle
#

destiny is also interesting to that effect with their "bubbles"

#

each zone of a world is managed by a separate server, moving between zones does very fast matchmaking to connect you to a new server managing the new zone. If you walk back to your old zone the system remembers which server you were on and if it's still running it tries to reconnect you.

#

they use hybrid p2p/dedicated server networking though - they've got probably the most complicated solution out of all of them...

pallid mesa
#

I believe SpatialOS GDK for Unreal added a top layer over Unreal's RPC and replication system for multi-server state synchornization

#

the concept is quite interesting, but never dug into it, or know if its even a workable solution

hollow eagle
#

I haven't heard particularly good things about spatialos, but the idea behind their tech is neat

queen escarp
chrome bay
rose pollen
#

Have you looked at open world server for unreal at all, I think mortal online does something similar (or maybe straight up uses it)

obsidian cargo
chrome bay
#

It works for any property that's received in the spawn packet

#

So usually, the initial state when receiving the actor

obsidian cargo
#

Does the spawn packet get sent when spawn is completed, or some time later in the frame?

chrome bay
#

All network updates are sent at the end of the frame

obsidian cargo
#

Great, I thought so!

#

Thanks for the info

#

Also, thanks for the article about sub objects and inventory system

chrome bay
obsidian cargo
#

I was considering going that route, but will instead use an XpComponent

chrome bay
#

Used it in HLL to stop weapon muzzle FX playing a one-shot when players came into relevancy range

prisma snow
chrome bay
#

TBF that subobject article is a bit dated now, needs updating for the new stuff in UE5

obsidian cargo
#

I figured, but it also looked like a lot of engineering overhead for little gain

prisma snow
eternal anchor
chrome bay
#

Very few scenarios where you need replicated UObjects tbh, but at least 5.0 made it a tad easier

obsidian cargo
prisma snow
chrome bay
#

Still far superior to gameplays cues and that nonsense when it comes to cost

obsidian cargo
#

Even though I'm using GAS

#

LOL

eternal anchor
obsidian cargo
#

Portions of my systems do not use GAS and I do not want them to take on that dependency

prisma snow
obsidian cargo
#

What makes GCs expensive?

cold moat
#

oh LOL this is totally the wrong channel, sorry I read quickly "materials" LOL

eternal anchor
# prisma snow handling 5k entities kind of needs something magical though, and Iris is not *th...

kind of is. You can create custom "protocols" per object type you replicate to optimize every bit (bit pointless honestly but you can). It defaults to push model, so there is no iteration to check if properties changes, and there are build in extension point to customize what get replicated to whom (spatially, logically, or w/e you want). Like with Iris you can optimize shit out of network usage without modifying engine code at all

chrome bay
eternal anchor
#

the lowest hanging fruit right now is UNetConnection, purerly because i is uobject with all it's overhead

obsidian cargo
chrome bay
#

Probably not an issue for most games tbh, but I prefer making something that does one job well than every job mediocre

#

Becomes more of a problem at scale really

eternal anchor
#

rule of thumb: abilities are cool, but unless you do some fancy stuff, I would treat them as activation proxy. You use them to activate some other system, since they have solved problem of what can be activated/what is blocked by what and so on

#

like just don't activate ability every 0.1s

#

like in case of weapon there is literraly zero benefit for each shot being ability activation, further more there is little benefit for even replicating shoots in first place

chrome bay
#

And don't use it to replace everything. GAS works better when it's supplemented by bespoke stuff, not when you try to shoehorn all game logic into it

#

Thankfully Epic are starting to split GAS into more opt-in chunks

eternal anchor
#

the epehermal GAS 2.0 refactor

#

we may even see it before CMC 2.0

obsidian cargo
#

I was excited to integrate Lyra into my project, however I've had to rewrite a large portion of it. Some of the rewrite is because of odd usage of GAS.

chrome bay
#

The interaction system in Lyra is a perfect example of how not to use GAS

#

Horrid implementation

obsidian cargo
#

Yeah I have avoided that part so far

#

I'm not using interaction or equipment

eternal anchor
#

haha yeah giving ability to every interactable object in range looks bit over kill -;-

obsidian cargo
#

Was a great place to learn about DataTables and OnContruction for pickups

chrome bay
#

Lyra is alright, has good and bad parts, but it's abstractions make it a PITA to figure out. Best to just farm the stuff you like from it and do the rest yourself IMO

#

Like all the samples really

obsidian cargo
#

A lot of my modifications have been about reducing the abstractions tbh

chrome bay
#

I'm just so over the obsession with GAS tbh

prisma snow
obsidian cargo
#

I like the Lyra Experience system, or atleast the idea behind it

eternal anchor
#

as I said I'm pretty confidednt you can solve the networking part with it. the rest, well you still have to rewrite half of the engine

#

like Iris works pretty much independently from rest of engine

obsidian cargo
#

Is the GAS FPredictionKey a good way to handle prediction?

#

I ended up incorporating a similar pattern for prediction in a completely unrelated system.

chrome bay
#

Prediction Key stuff is fine, pretty simple to implement. The "complexity" in GAS just comes from rolling stuff back

prisma snow
obsidian cargo
#

Ah that makes sense

#

I'm not using rollback

#

I do some "roll forward" extrapolation on longer VFX for late join / relevance

pallid mesa
#

i didnt understand the fact of using an ASC in the GS to determine the different phases of the game, rather than using the vanila phase system and extend it from AGameMode
layers of indirection on top of layers of indirection

chrome bay
#

IKR

#

Lots of complexity for no obvious benefit

obsidian cargo
#

Is the AGameMode phase system well implemented?

chrome bay
#

Worked for UT, Gears etc.

obsidian cargo
#

I've not yet incorporated Lyra phases into my code, but I also plan on using AGamePhase reconnection logic

#

It might make more sense to just ditch the Lyra stuff to reduce game mode merging

#

*Lyra phase stuff

chrome bay
#

The only downside is sometimes, because it's such legacy code, you sometimes run into some old issues - but once you follow it through, it's quite straightforward

pallid mesa
#

also, old issues are often known

chrome bay
#

yee

pallid mesa
#

switching topics, why are child actor components still broken? 😦

#

The idea is neat, but they are so unresilient

wise zephyr
#

has anyone made a multiplayer game for switch? i think its supported by EOS..but i am using EOSCore plugin by eeldev but that plugin isnt supported for switch...Can i use Epic Online Services for multiplayer on the nintendo switch? would i have to interface with eos in c++?

eternal anchor
pallid mesa
#

you dont need an ASC or abilities for that

eternal anchor
#

you don't

#

but you also cant do with with just single game mode

obsidian cargo
#

So the Lyra Game Phases are about using experiences to customize which phases are available on a given map?

eternal anchor
#

given experience

pallid mesa
#

if you use Lyra, you get to use the same GameMode for all your experiences, which I get... you can still do that with a custom component without the need of an ASC

eternal anchor
#

they are detached from maps

#

As I said I don't disagree

#

they went for GAS, because it is probabaly what they use internally to do it

#

and it was proven method

pallid mesa
#

yes yes, it works, but you know... it feels like kiling a mosquito with a bazooka

#

XD

eternal anchor
#

maybe

#

for me

#

it is just solution

#

w/e if it is ability on GAS on GameState/GameMode

#

or custom component, with custom tasks, with custom

#

you get the idea

pallid mesa
#

sure

eternal anchor
#

I mean custom solution for what the experiences are doing, is probabaly just as complex, just from different direction

pallid mesa
#

yeah, anything will be complex XD

#

except ofc scoped solutions

#

but in this specific case, - game phases - ... the purpose of what GAS was designed for seems non suitable

eternal anchor
#

the name might be misleading

#

reality is GAS is designed to run logic

#

not spells

#

or what you would consider Abilities

#

Gameplay Graph would be better name to not confuse people

pallid mesa
#

well, but understand that the multiple layers of complexity that GAS provides - prediction, reconciliation, cancel/block - are not very applicable here

eternal anchor
#

they are not, thus you can safely ignore them

pallid mesa
#

yep hence the fact of making the claim of "using GAS for this?"

eternal anchor
#

abilities provide way to run logic and respond to events

#

and to easily create said logic in blueprints

pallid mesa
#

but yeah, its another solution, as you say 😁

#

but got my eyebrow raised XD

eternal anchor
#

don't think about it like it is for making fireballs

#

though it certainly was created with it in mind

pallid mesa
#

yes I know what GAS is capable of xD

#

you can do whatever with it
but there are times where... eh... maybe it feels like fitting a ball on a squared shaped hole... like the shooting being an ability that activates every 0.1s

eternal anchor
#

in any case there is actually plugin called Gameplay Graphs

#

probabaly commited by pure accident to engine

#

well you have two choices

pallid mesa
#

Gameplay graphs exists??

#

whats that

eternal anchor
#

write everything to fit perfectly your particular use case

#

use what is on shelf and ignore functionality you don't need

#

literally nothing, that's why i think someone commited it by accident

pallid mesa
#

oh lol XD

eternal anchor
#

you can read from plugin description it is specialized graph for gameplay

#

I'd say it's GAS 2.0 but more modular

pallid mesa
#

well I believe its all about scope

viscid tapir
#

GAS 2.0 is a thing ? officialized ?

twin juniper
#

No

quasi tide
eternal anchor
#

it is drop in replacment at first

#

so if you are not deep into customizing networking, nothing changes

quasi tide
#

Oh I was just more curious than anything. I'm waiting for more titles to release with it and more information about it overall before I commit to it.

#

I'd rather go with the tried and true currently šŸ˜…

rose egret
#

I wonder why NetRelevency dosent work for my editor placed bNetLoadClient=true
relaiable RPC is called even if they are out of relevency

subtle peak
#

Why does this not work? The player pawn calls the interact interface and this is the actor that receives it. Works for the server but not the clients

quasi tide
#

Player should call a server interact function on itself

thin stratus
#

Read the ownership and RPC part of the network compendium once more

#

The client doesn't own that actor so the RPC doesn't work

#

You gotta RPC in the character already

#

Or wherever that interact is being called

worthy wasp
#

@thin stratus - nice overhaul on your NetworkCompendium btw! I like the way its put out now.

subtle peak
fluid summit
worthy wasp
#

i havent been to it in a few weeks - its a rework of the pdf that it used to be.

#

its a very nice format is what i'm trying to say

thin stratus
#

Yeah I turned it into a react MDX docusaurus page

#

Cause that's much easier to modify and extend and also to reference

#

Eventually I want to release the MDX files on a git repo for PRs. And also allow printing the page to save it as a pdf again

fluid summit
#

oh yeah, it's quite better this way. easier to digest

thin stratus
#

But printing it requires some css media queries which I didn't want to fight with yet

worthy wasp
#

I remember back when iw as originally doing UE work - there was a way to log what level of authority the debug log was using... IE: SERVER: C LIENT:

I cant seem to remember that method - and I dont see much online regarding it - or maybe i'm looking at the wrong keywords.... Any pointers ?

thin stratus
#

Pretty sure you just manually have to check the netmode

#

Check what Printstring is doing fwiw

#

The BP node

worthy wasp
#

i dont see it showing authority verbose in UE 5.1

#

just shows a message... not CLIENT: Blah SERVER: Blah

#

back in 2018 (my last time of doing UE work) - i had a method of it doing so...

pallid mesa
#

if you start multiplayer on PIE and you use UKismetSystemLibrary::PrintString(...) it will do that

#

just ensure you are not instantiating two standalones

worthy wasp
#

maybe thats the issue - i'm doing standalone and i'm trying to debug this.

#

that makes sense.

gray orchid
#

So I have an animation that plays with a sound in it, and for some reason the server plays the sound fine but the client wont play the sound no matter what I do does anyone know how to fix this?

thin stratus
#

Ah wasn't there something with broken cues ?

#

Or Anim notifies

#

I remember something vaguely

gray orchid
#

wdym?

quasi tide
#

And wasn't that fixed in 5.2 though?

#

TLDR: Something with anim notifies is borked on the server or the client. Can't remember which

gray orchid
#

is there a way for me to fix it?

quasi tide
#

Maybe? Search through this channel's history about anim notifies.

#

It was sometime this year

#

Godspeed my child

thin stratus
#

At least I wasn't misremembering

worthy wasp
#

UE 5.1 - 3rd Person Template

Any reason why anything special has to be done to input setup for player controls to work on ListenServer when map travelling (as the listen server client) with option - listen ?

#

i have 0 input response - yet remote clients work fine.

#

take that back - i can move - i cant turn

#
void ASteamTestCharacter::Look(const FInputActionValue& Value)
{
    // input is a Vector2D
    FVector2D LookAxisVector = Value.Get<FVector2D>();

    if (Controller != nullptr)
    {
        // add yaw and pitch input to controller
        AddControllerYawInput(LookAxisVector.X);
        AddControllerPitchInput(LookAxisVector.Y);
    }
}

I"'ll assume i need to !HasAuthority() this?

#

yah that didnt work either :/

fossil spoke
#

Make a job listing if you are looking to hire someone.

weak osprey
#

OK, I'll do that thanks.

amber barn
worthy wasp
#

its gotta be something with replication - i'll work on it in a few....

fathom aspen
#

Are you seamless travelling?

#

A wild guess would be that the PlayerController is persisting but the context mappings are not, and hence the problem

worthy wasp
# fathom aspen Are you seamless travelling?

I was not seamless travelling - however that also doesnt change anything.... Again - movement is fine (because the character movement component is replicated). I"ll fk around with the RPC events for the LOOK later - i just thought it to be a bit awkward that a default template like this wouldnt work.

amber barn
#

hi guys, is it possible to replicate the scale of an actor? cant seem to find anything about it

dark edge
amber barn
amber barn
dark edge
#

If it doesn't just repnotify a float and in the onrep apply it to scale

amber barn
#

yeah figured that would be the way otherwise

#

ok thanks

amber barn
# dark edge If it doesn't just repnotify a float and in the onrep apply it to scale

i ended up just checking these boxes on the blueprint but im not sure why.. the code in C++ didnt make it work..

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

    if (HasAuthority())
    {
      SetReplicates(true);
     SetReplicateMovement(true);
    }
}

void AArenaFloor::Tick(float DeltaTime)
{
    Super::Tick(DeltaTime);

    if (!HasAuthority()) {return;}
    
    if (GetActorScale3D().X <= CurrentFloorSize - ShrinkAmount)
    {
        bShrinkFloor = false;
    }

    if (bShrinkFloor)
    {
        FVector NewScale = GetActorScale3D();
        NewScale.X -= ShrinkAmount * DeltaTime / ShrinkTime;
        NewScale.Y -= ShrinkAmount * DeltaTime / ShrinkTime;
        SetActorScale3D(NewScale);
    }
    
}
noble sentinel
#

How can I make a session friend only and not make it appear on server list?

glass orchid
#

Does anyone know if Epic plans to add RPC validation to blueprints as well? As i understand its only for cpp

glass orchid
thin stratus
pallid mesa
# gray orchid wdym?

Set this in your DefaultEngine.ini

[ConsoleVariables]
a.EnableQueuedAnimEventsOnServer=1
glass orchid
pallid mesa
#

also, RPC validation is a rarely used feature, so I dont see that happening

thin stratus
#

Yeah I don't think I ever used that :D

glass orchid
faint eagle
#

remind me how do I get custom match parameters from url? i.e. open 127.0.0.1?RoundNum=4?StartImmediately=false, how do I get RoundNum and StartImmediately in game mode?

#

nvm lol i think chat gpt has given me sufficient answer

thin stratus
#

And if so I just do it in the RPC itself and handle it properly by correcting the data if needed

glass orchid
#

Thank you for the insight 😊

worthy wasp
worthy wasp
#

using default appid 480 - this only appears on my friends list - not on public viewed games (i have 2 methods to view games listed)

vestal token
# rose pollen Have you looked at open world server for unreal at all, I think mortal online do...

Yes I saw that project, but this is more like Blade and Soul (MMO game) model, with teleports every 100 meters and any zone. I don't want this kind of implementation where any move in your game will show you load screen... I want something like Lineage 2 where you can literally walk from one side of the map to the opposite side of the map without a single loading screen. I don't mind about channels on some zone, but not loading screens every single side move... Looking back to 2004 year Lineage servers handled 5k connections, I don't want to believe after 20 years we still can't reproduce this capacity...

worthy wasp
#

0 changes to template configuraiton for input bindings.... 0 changes to blueprint setup.

#

movement works fine :/ cant figure this out for the life of me.

worthy wasp
amber barn
worthy wasp
#

lol yah i didnt expect this...

amber barn
worthy wasp
#

you can do it any number of places - your game player controller... i did this on a widget when i was doing a backhandler (CommonUI) - and experienced its behavior enabling the TURN/LOOK input that was previously broken :/

#

i moved this to my Character OnBeginPlay now

amber barn
#
    if (APlayerController* PlayerController = Cast<APlayerController>(Controller))
    {
        if (UEnhancedInputLocalPlayerSubsystem* Subsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(PlayerController->GetLocalPlayer()))
        {
            Subsystem->AddMappingContext(DefaultMappingContext, 0);
        }
    }
#

i just add this?

        FInputModeGameOnly InputMode;
        PlayerController->SetInputMode(InputMode);
worthy wasp
#

thats default setup.... yes. here's a way to do it in CPP:

PlayerController->bShowMouseCursor = false;
FInputModeGameOnly mode;
mode.SetConsumeCaptureMouseDown(true);
PlayerController->SetInputMode(mode);
#

the show mouse is your flavor... however you want.

#

i just copied/pasted my stuff

amber barn
#

nice seems to be working do you also rotate the character based on the mouse pos?

worthy wasp
#

i dont but thats easily pulled off - lots of videos on it.

amber barn
#

damn it

        // FInputModeGameOnly InputMode;
        // PlayerController->SetInputMode(InputMode);
``` stopped my inputs from working completely
#

well my mouse button 1 from working

#

and didnt fix the turn

worthy wasp
#

stand by 1 sec

#

lemme verify this (again)

amber barn
#

this defs seems like the right path though

worthy wasp
#

it works fine for me :/

#

standalone - listen server netmode

#

but i do see that my escape key for UI isnt owrking.... lets switch to GameAndUI

#

sec....

#

trying this - standbye:

        FInputModeGameAndUI mode;
        mode.SetLockMouseToViewportBehavior(EMouseLockMode::LockAlways);
        PlayerController->SetInputMode(mode);
#

i swaer to god

#

commonUI is broke shit

#

:/

#

every time ir estart the editor on these 2 new UI's i've made... i have several others made using hte same classes :/

amber barn
#

no change me with that code

#

i needa read more about this

#

it seems like it should be simple to get this going

worthy wasp
#

template should work out of hte box

#

ok so.

#

theres somethign with the mouse consume...

#

i have to hold down right click to move it

#

or left click

amber barn
#

yeha i dont get that either

worthy wasp
#

BUT - my inputs (escape key) is working now...

#

so lets dial this in....

amber barn
#

i tried a bunch of stuff

#

i onyl get it to work when i hold down a mouse button

#

haha

#

but even then..

#

its not whati want

#

the vector is normalised

worthy wasp
#

default PROJECT settings -

#

nothing new here...

#

i was trying to find CAPTURE things - but nothing sticks out.

#

i'm officially at a loss...

#

this doesnt behave like this in any other project i've done.

rose pollen
vestal token
#

@rose pollen Hmm, this is interesting tbh. Do you have any links about this game server architecture maybe? Or about how did they implement this?

rose pollen
vestal token
#

@rose pollen Found some overviews about this game on yt and first one calls "Worst MMO Ever? - Mortal Online" Laughing till now šŸ˜„

dusky yoke
#

How can I replicate a random float value within a range?

I tried setting the value, sending it to the server, but no dice. Multicasting it didnt work either. The value is set to replicate.

rose pollen
hushed heart
#

Hello, I have a question that's probably pretty tired, I'm sort of stuck after a couple weeks of independent experimentation, boiling down to a classic issue. I was just wondering if there are any functional ways around it.

I'm trying to implement my own networked movement without the CMC because I need a non capsule collider and I need some level of prediction and correction. I also need more use of the velocity and deceleration since I'm making arcade vehicles.

However, before I can even begin to implement the latter, my first step is sending inputs to the server from the client and having the server mimic them exactly, but this is unsurprisingly a big hurdle for me.

The way I do it is that pressing inputs causes the client to enqueue events, with acceleration/reversal tracked in one queue and rotations tracked in another. Then on each tick, the client pops both queues, performs the rotation, then sends it to the server which adds it to its own queue. The same process of popping and then performing the movements occur on the server too.

Now, this is almost perfect, with the very slight discrepancies. My guess is it mainly stems from deceleration, which I handle like the Floating movement component, is ending up different because of the different deltatimes. The big issue here is that the very slight discrepancies lead to huge ones, most often when it causes the vehicle to catch a wall on one side and not on the other.

I'm really not certain how to tackle this anymore, I wonder if it might be possible to use a fixed tick of some kind? I've also been trying to dig into the Network Prediction plugin to see if it can help with that, but there's no documentation available for it. If anyone has any advice or resources I'd really love some help, I'm quite out of ideas blobsmilesweat thank you!

quasi tide
#

There's always the General Movement Component

viscid tapir
#

How can I broadcast a delegate declared in a class from a struct ? Is there any tricks ?

{
    for (int32 Index = 0; Index < InArraySerializer.Items.Num() - 1; Index++) {
        if (InArraySerializer.Items[Index].Card == this->Card) {
            OnBookUpdated.Broadcast(this->Card.CardRowName, Index); // this doesn't work as it doesnt know about OnBookUpdated
        }
    }
}```
static prism
#

good morning guys

#

i have a question

#

do you have any unreal service for multiplayer games for free for small as a test?

pallid mesa
#

yes, you can use eos and the devauthtool if you want to connect standalone instances over the wire

viscid tapir
#

I think my question should go in cpp

pallid mesa
#

its a common practice

subtle peak
#

Is it possible for two players to possess one vehicle? One drives the car, the other shoots the turret for instance?

viscid tapir
#

Oh yeah i saw it in GAS

#

Ty !

#

maybe a ref to the inventory ? (as the delegate is actually in the inventory component)

pallid mesa
#

but no you cant have two controllers possessing the same pawn

subtle peak
#

Thanks!

viscid tapir
#

Ok thank you !

hushed heart
gentle escarp
#

Hey, I'm making a multiplayer game and I got a small issue: when I try to attach an actor to a component, it doesn't attach to the mesh if it's not visible

#

I have owner no see enabled and when I try to attach an actor, it spawns to the character's feet. It replicates properly on the other clients' side but for some reason it doesn't work properly on the owner's side

gentle escarp
#

This works properly when the mesh is visible though

true spade
#

Hi, I have a question about creating host migration, what will be a valid steps for it, how it should be done, currently the only things that has to be "saved" is player location and that's it, I just want to assign new client as a host and continue with the session. Therefore, is there some kind of best practice or steps how to accomplish it? Appreciate in advance for answer šŸ™‚

fathom aspen
#

Search in this channel for "host migration" and you will be flooded with answers

quasi tide
#

How did you confirm that it is not being executed on the clients?

solid wave
#

Because on the server it switched the animation decided by what layer we are in, on clients only the old animations are played

#

@quasi tide

quasi tide
#

Did you verify that the client as a valid EquippedItem?

thin stratus
#

And why is this coming up so often lately

pallid mesa
#

i bet it is because listen servers by default are barely usable in production 😬

thin stratus
#

It almost feels like some random youtuber talked about games needing that or how easy it is

pallid mesa
#

🤣

solid wave
#

@quasi tide yes, i use GAS to spawn the item and it spawns correctly and sets boolean on AnimInstance that tells we should now switch the AnimLayer. But it just wont change the animations as it does on server.

quasi tide
#

Are you trying to change it via the ABP or something?

#

I set the new layer when I actually equip my item

#
  1. Client sends a server request to equip an item
  2. Server equips it and then onreps the Equipped item
  3. On the client's onrep function, it does the actual equipping logic
#

This is the flow of 98% of the things in a networked game

solid wave
#

I just did layer switch on on multicast and passed current weapon from server function to multicast as a parameter and now it works, splendid!

pallid oxide
#

about dedicated servers, does the whole team need to build the engine from source?

#

or just the server needs the source built engine?

pallid mesa
#

later

pallid oxide
#

what?

pallid mesa
#

the server needs the source built engine

pallid oxide
#

so the team can run the version of unreal from the launcher then?

pallid mesa
#

yes, altho it would be more convenient to host the engine

pallid oxide
#

wdym by hosting the engine?

pallid mesa
#

puting it into your repo (beit p4, plastic, svn, git...)

pallid oxide
#

oh ok

#

thanks!

magic vessel
#

I'm trying to get my stamina system to work with a listen server. I have reduced my system down to this and I still don't understand what it going wrong

#

It is still saying that the rep notify is still being called on the server, with 2 windows (1 is the listen server and the other is a client)

pallid mesa
#

that is not a rep notify :x, thats a client RPC

magic vessel
#

Which is still being called when I set the Stamina variable and is still being called on the server

#

I'm honestly confused by this

#

I'm coming from working with dedicated servers

pallid mesa
#

can i see your rep notify code?

#

but please erase the OnRep_Stamina custom event, thats not what you want

magic vessel
#

I've put it back into a generated rep notify function

#

This is the output

#

I really don't understand what is going wrong here

magic vessel
#

Can someone please explain how to do this, or link a resource?

kindred widget
fathom aspen
#

OnRep won't be called if Stamina was 50 by default

#

Also what owning Actor are we talking about

#

What if it's not replicating

kindred widget
#

Presuming he's expecting a client print. I'd definitely go with either not replicated, or wrong PIE conditions.

magic vessel
#

The component and owning actor are both set to replicate

kindred widget
#

Is the default for that 50?

magic vessel
#

Nope, it is 0

kindred widget
#

What actor is the component on?

#

Just some random AActor class?

magic vessel
#

It is the third person characte BP

#

Ah

#

I just tried putting it on the controller but that didn't fix it

icy jetty
#

Well it’s 0 but you’re setting it to 50 on begin play

kindred widget
kindred widget
icy jetty
#

Aye ik, just saying for clarification

#

In case people didn’t see the screenshot with switch has authority

obtuse field
#

What is the difference between RepNotify and ReplicatedUsing?

obtuse field
#

So, like RepNotify can be overriten by blueprint, and ReplicatedUsing not?

kindred widget
magic vessel
kindred widget
#

And if you put it back in the Pawn?

fathom aspen
# magic vessel

In which case this means you only have one player in a listen-server scenario

#

Which is always going to be the server

kindred widget
magic vessel
kindred widget
#

That's... Odd

magic vessel
#

I know šŸ˜…

kindred widget
#

As a class default component, it should tick on any machine it exists on.

#

Could you maybe print on the Pawn's tick and see if the component even exists on the client?

#

Or that the pawn exists on the client. šŸ˜‚

#

Or that the client exists.

magic vessel
#

There are no client messages neither on the listen server or on the client,

kindred widget
#

But you have two PIE windows open?

#

And can you see your pawn moving on the second window when you move around, or?

magic vessel
#

Yes

kindred widget
#

And you put a print in the Pawn?

magic vessel
#

Yes

kindred widget
#

lol wtf?

icy jetty
#

How are you connecting them

#

Server and client

kindred widget
#

It's Play As ListenServer in PIE.

#

Two players. One server, one client.

icy jetty
#

Yeah but bp wise I meant

magic vessel
#

Just double checked, I was running them under separate processes, when I re enabled it I'm getting a server and client message

kindred widget
#

Oh, yeah that'll do it.

magic vessel
#

It is PIE as well

kindred widget
#

Separate Process can't print to the editor.

magic vessel
#

Next question, how would I differentiate between a listen server and the client it is attached to? So the same machine, but the different roles

#

Or can't I?

kindred widget
#

In what way?

#

Or better question. Why do you need to differentiate?

icy jetty
#

Could probably use a print node after that switch authority, I imagine

magic vessel
#

I have a local player subsystem that holds the stamina information for each local client, how would I get the local player from the listen server's machine?

kindred widget
#

Why do you need a subsystem here? Aren't you storing stamina on the component?

magic vessel
#

I am, but I also have a widget that I want to display the information on

kindred widget
#

Still not understanding the subsystem. Widget should be able to access the controlled pawn and get it's stamina component.

magic vessel
#

Oh yeah, I'm going to be honest I have been trying to debug this for way too long and my brain is fried xD

kindred widget
#

Speaking of widgets.. I have stepped in a bug where opening a CommonActivatableWidget with Menu mode bugs out input components...Doesn't flush input... ffs

rose egret
#

I dont understand why my component GetWorld() returns null when used inside MyStruct::NetDeltaSerialize

raw thunder
#

Hello everyone,
When sending data assets through network with an RPC, should I send the Data Asset reference or something else like FPrimaryAssetId? For example I want to add an Item to my inventory and want to have a replicated inventory on the client.

kindred widget
#

The data asset itself should be resolvable if it's a predefined asset.

#

People do weird things and create data assets at runtime though so.. that won't work if you're doing that.

magic vessel
#

I'm not sure it is the best idea to send data assets through an RPC, you should be aiming for the least amount of traffic as possible. I've had no issues using soft object pointers

raw thunder
#

What does that mean? Like it automatically optimizes the data size?

kindred widget
#

A pointer to an asset is smaller than a softref.

raw thunder
#

I use predefined assets, not at runtime

magic vessel
#

I didn't know that, I thought they were better bc the assets don't have to be loaded in at the time of usage

raw thunder
#

But should I send a pointer? Is it possible through RPC?

kindred widget
#

Depends on your use. If it's not loaded on the client, it'll hard load it when it arrives. So it can be better to send a softref if you have the ability to async load it.

magic vessel
#

async loading in C++ and bp is quite easy, though in C++ there are limited resources for finding out how

kindred widget
#

I keep all of my item assets loaded in a subsystem. My Items replicate their data asset. The data asset has everything heavy softreffed anyhow so the actually memory used is tiny.

raw thunder
magic vessel
#

Side note on soft ref is that it doesn't get unloaded straight away

magic vessel
# raw thunder Thanks nice tutorial

You're very welcome, it was a pain in the ass to find a good tutorial on the subject but I found this one a few weeks ago and it works wonders

raw thunder
kindred widget
#

If your data assets are small. I'd recommend preloading them into a container. I did this in a GameInstance subsystem. It gets all of my inventory data assets from a specific directory and populates a GameplayTag/DataAsset map.

blazing spruce
#

Hi, im working on this draw system, i have it so when the player interacts with the draw it changes their camera view target to a camera attached to the draw, then when they exit the draw it returns their view target back to their character, i made it so when interacted with it sets the players location and rotation to a point that is just in front of the draw regardless of their location or rotation before interacting with it then when they exit the draw it should reset their control rotation to 0,0,0 rather than where it was before interaction.. setting the actors location is replicating okay but not the rotation, the client keeps their rotation from before interacting and is returned to it when exiting the draw, anyone know why set actor location is replicating but not rotation?

#

So you can see in the vid the server player on the left has all correct behaviour, it sets their location and rotation regardless of where they were located or where their camera was facing before interaction and then when they exit it set their control rotation to 0,0,0 correctly, but for the client player the set actor location is replicating but it didnt replicate the rotation nor did it set the control rotation to 0,0,0 when exiting.. any ideas how i can correct this?

#

This is the code on my On Interact interface call event

kindred widget
shadow pumice
#

How to make the server create a game and also how to make a client choose what server should he connect to?

blazing spruce
kindred widget
abstract pike
#

Does anyone happen to know what "ResolutionConnectionTimeout" is for?

If I google it I get only seven extremely unhelpful results....

kindred widget
#

Seems to close the connection if it hasn't received anything in the timeout range.

abstract pike
#

Yea OK, just having a poke around now as well and does seem to be a timeout specifically for "Address resolution" whatever that is in the network handshake process

nocturne quail
#
ReplicatedItem.WeaponMesh = MyDataTable.WeaponMesh;

so ReplicatedItem will still be replicated if I assign its data using CPP UStruct having bp data table loaded back in VS to assign values for UObject?
ReplicatedItem is a UObject.
nocturne quail
eternal canyon
nocturne quail
#

the question is if I set its properties using data table, it will still be replicated?

eternal canyon
#

yea

#

it should be like setting them using any other thing

nocturne quail
#

so it just sets data from other things and replication didn't effects? it remain the same as it is?

amber barn
worthy wasp
#

i'm working 100% fine with blueprints nodes - not the C++

#

tested both PIE & Standalone/packaged

amber barn
#

ahh ok thats fine, do you mind sending a screenshot of the relevant part?

#

i can recreate in cpphopefully

worthy wasp
#

same as it was before - this should work in C++ as well too.... theoretically

#

thats in my Character class

amber barn
#

thank you ill give it a try

#

does that green part work for all clients?

worthy wasp
#

all my UI inputs work fine - but i'm not using a HUD class like someone suggested before

amber barn
#

cause it works on theindex

worthy wasp
#

tooltip says - "on a network client - this will only include local players as remote player controllers are not available"

#

player controller isnt a networked object

#

however the server has a list of all player controllers (through game mode)

amber barn
#

ok cool, im getting the same behavior as the code version but rotate still scuffed i think its the trigger event andhow i rotate the char,
what trigger event do you use?

#

for look/rotate

worthy wasp
#

0 changes to template default

#

everything is raw from a fresh built project.

amber barn
#

awesome, ok thank you

unique cloak
#

hi, I have a question and it kind of specific and kind of not

#

So

#

the thing is

#

I replicate an array to the client

#

but when I see what is in the array everything is NULL

#

its for the chat system and the client can see the messages

#

yeah so can anyone help me?

fossil spoke
#

What is UListViewEntryData?

#

Does it support net serialization?

#

You cant replicate arbitrary objects. They need to know how to be serialized across the network.

#

UListViewEntryData sounds like some random type you have found somewhere in the engine code?

unique cloak
fossil spoke
#

What is it trying to achieve?

unique cloak
#

Chat system with list view

#

So I construct it for players that are joining mid game

#

With the array of the data there already is from the beginning of the game

#

But the array is empty and after I replicated it its elements are null

fossil spoke
#

Yes because as i said earlier plain old UObjects (that are not packages) cannot be referenced across the network

#

You are better off using a struct instead.

#

When replicating data you want to reduce to the minimal required information to reproduce what you need.

unique cloak
fossil spoke
#

Ok

#

Do that then?

unique cloak
#

šŸ˜…

#

that’s gonna be hard

hollow eagle
#

Not really. You shouldn't be replicating an entire list view... just the individual bits of data that a list view would need to show.

unique cloak
#

I’m not it’s the data

hollow eagle
#

For a chat system you'd just have a struct with some strings or whatever information you want and have your list view read from it.

#

Ok, then don't use a UObject for it

unique cloak
#

Ok so I will reimplement stuff

#

So do you guys know how to do it?

hollow eagle
#

I don't know why you think you need to reimplement much. If you're using any of the built in list view stuff you just need a simple wrapper around your struct to use it with UListView. Replicate the structs, generate new objects to contain them on the clients to allow the list view to access them.

unique cloak
#

Wrapper? wdym?

hollow eagle
#

I mean you have a UObject that contains your struct. You create that UObject as you receive new structs from the network. Or build your own list view if you really want, but that's the "easiest" solution assuming you're using UListView.

lucid wren
#

how to move an actor in multiplayer?

#

for some reason my boat moves only with the host, no client can moves

unique cloak
#

Or like it’s not really part of it because when I declare it is above the class?

hollow eagle
#

the replication of the struct is completely unrelated from the UObject

unique cloak
#

Do I need to make a struct variable there too? In the UObject

hollow eagle
#

the UObject is something you create on the client side after the struct has been received. You can copy the struct, or have the UObject point to an index in the array, or whatever you want to do. The point is that the UObject is something that a client creates for itself as a utility to let a list view show data - it has nothing to do with replication.

unique cloak
#

So I need a UObject just to make the struct there?

#

After that I have nothing to with the UObject?

hollow eagle
#

you have your array of structs being replicated

#

separately you have each client create a UObject for each struct in that array. Those UObjects are what you give to the list view.

unique cloak
#

I have a class for the list view entry and the list view entry data. The data one is a UObject

#

Though technically everything is a UObject

#

But the entry class one is from a UListViewEntry class I think

unique cloak
tight jacinth
#

How to unit test client-server interaction on UE4?
I did not find the ability to start the server and connect the client to it inside the unit test.
Automation Framework does not provide such an opportunity?
I need to start the server, connect the client(s) to it and check:

  1. Something is happening on the server (for example, a bullet hit an object). You need to make sure that the code worked correctly (for example, lives decreased) and that it was replicated to clients.
  2. Something happens on the client (for example, the client pressed the E button next to the car). You need to make sure that the server will respond correctly (for example, put it in a car) and the clients will replicate all this.
prisma snow
tight jacinth
gritty pumice
#

Hello everyone!
I have a multiplayer game design-related question!

I am working on a multiplayer game similar to Sea of Thieves, however, I struggle to correctly sync the boats between clients and I have lots of issues concerning player movements while the boat is moving such as stutter, clipping through the boat, etc...
The boat is being moved using physics, by setting and linear/angular velocity of the root component (which simulates physics and is a primitive component).
The way the replication is currently handled is as follows:

  • The "replicate movement" checkbox is checked. The boat is set to replicate with a frequency of min:30 and max:60
    1 - if we have authority, then calculate the physics (linear/angular velocity) and apply them to the boat, if the player is locally controlled, simulate point 2 below
    2 - let unreal replicate the movement, replicate down to the clients any cosmetic events like animating movable parts of the boat

Doing it this way causes lots of stutters, out of sync, and lots of player position corrections, especially while the boat is moving. I have tried running the server on a separate machine and only running the client with a packaged game on my machine. The issue remains.

I have tried the following without success:

1 - Limit the boat speed to 800cm/s max (previously was 2000)
2 - Temporarily disabling server checks and enabling client authoritative movement while the character jumps
3 - create a custom component that is attached to the boat that is responsible for replicating the transform of its parent, aka the boat, periodically (like every 0.15s for ex). Then, every client then smoothly interpolates between the current position of said actor and the replicated value from the server (using RepNotifies), this method is what has worked the best so far but still has its drawbacks in terms of gameplay
4 - Replicating the velocities and allowing clients to simulate on their side and periodically replicate the transform

#

It would seem that the engine isn't very good at replicating movement while moving on a somewhat fast-moving object
I would appreciate any suggestions to a different approach or any resources that may lead me to the right path!

viscid tapir
#

Micro-optimization question. Should I pass the struct (5 or 6 properties inside including a FName for tracking purposes) to a RPC server or a FName which will be used to FindRow from a UDataTable in the RPC itself ?

#

void ACardShop::TryBuyCard(AActor* TargetActor, const FCardStruct& CardToBuy) or

void ACardShop::TryBuyCard(AActor* TargetActor, const FName& CardToBuy) 
{
  FCardStruct* TempCard = CardDT->FindRow<FCardStruct>(CardToBuy, "Context"); // I still don't get what the context means lol
  if (TempCard) {
    // Buy card
  } 
}```
rose egret
#

uint8 CardToByIndex thats micro optimization but sending FName is ok

viscid tapir
#

So you recommend me the second version ? Since we save some bandwidth but we compute stuff locally (I believe this is the reason šŸ˜… )

woven otter
#

Hello, im having trouble with a light that can be turned on/off on a multiplayer game, im trying to make it so that all players can see the light, but it doesn't "turn on" while testing the multiplayer running the server, but it does on PIE, any idea on whats wrong here?

chrome bay
#

You can also quite easily limit the maximum RowName string length with data validation to essentially fix the cost

viscid tapir
#

Oh I see but I was wrong, it is actually a simple function called from server. Which is pretty annoying by the way, because I need to create each function in the player controller for ownership

#

I mean i can't call a RPC directly from the shop actor because i don't own it which means that i need to create manually each function as RPC inside of the PC and i connect the given shop function

chrome bay
#

Make ACardShop a replicated actor that the player owns. EZ

viscid tapir
#

Really ?

#

or sarcastic ? šŸ˜…

chrome bay
#

Or give the player a "Card Shop Interaction" component that contains the functionality etc, that you add/remove to the player controller when needed if the ownership approach isn't viable

#

Bloating the PC directly with game logic that can be componentised is not ideal generally

#

INB4 somebody says "just use GAS lawl"

viscid tapir
#

Actually the first approach seems okay to me but that would mean that every player own the shop ?

chrome bay
#

Only one person can own an actor at once

viscid tapir
#

or dynamically own the shop for the buy duration

#

Yeah I see

chrome bay
#

Depends if more than one player can interop with it. Sounds like in this case, you want to go with the component approach.

viscid tapir
#

Yeah many players can interact at the same time

#

Yeah let me read your approach & think a bit about it

chrome bay
#

If the component only contains RPC's, you don't even need to replicate it.

#

Just make it a permanent part of the PC

#

If you spawn it dynamically, it must be replicated ofc

viscid tapir
#

Well I see

#

But in what ways does it change really from having everything in the PC (which is obviously not clean)

#

since its an actor component

chrome bay
#

All the logic is componentised. Makes it easier to remove/move/refactor etc. later

viscid tapir
#

its like an extension of the PC but if it is attached only to the PC, i can just put it in the PC ?

#

Oh okay

#

I see, it's for readability and maintainability

chrome bay
#

Kind of, but it just seems like a good usage in this case. If you wanted to put that component on some other object later, like a character, they could interop with the system too

viscid tapir
#

Yeah you are right

#

Thank you !

kindred widget
# woven otter Hello, im having trouble with a light that can be turned on/off on a multiplayer...

You'll want to ditch the multicast entirely. Your boolean has an OnRep function that should be setting the light on or off.

But the real issue is your interface. This code will work for a listenserver. But no client can use this. You cannot ServerRPC through an actor that the client does not own. So what you need to do is make some sort of generic RPC in your Pawn or Controller, that takes an actor or object reference. You do an RPC to server with that, and then run the interface on that after the RPC.

magic vessel
#

I'm having issues with my listen server code again, I can't seem to get the component on the player pawn to update the User Widget

#
void UStaminaWidget::SetStaminaComponent(UStaminaComponent* AttachedStaminaComponent)
{
    StaminaComponent = AttachedStaminaComponent;

    UDebugFunctionLibrary::DebugLogWithObjectContext(this, FString::Printf(TEXT("Attempting to Set Stamina Component")), EDebugType::DT_Log);
    
    if(IsValid(StaminaComponent))
    {
        UDebugFunctionLibrary::DebugLogWithObjectContext(this, FString::Printf(TEXT("Stamina Component Set: %s"), *StaminaComponent->GetName()), EDebugType::DT_Log);
        StaminaComponent->OnStaminaValueUpdated.AddUniqueDynamic(this, &UStaminaWidget::OnStaminaValueChanged);
        StaminaComponent->OnMaxStaminaValueUpdated.AddUniqueDynamic(this, &UStaminaWidget::OnMaxStaminaValueChanged);
 
        OnStaminaValueChanged(StaminaComponent->GetCurrentStamina());
        OnMaxStaminaValueChanged(StaminaComponent->GetCurrentMaxStamina());
    }
}
#

The widget gets displayed on the screen, but it doesn't change on the listen server whereas it does on the client

#

I've reduced the problem down to this:

#

Still ain't working

kindred widget
magic vessel
#

I figured it out, I forgot that with listen servers and rep notifies, you have to call the rep notify manually for the listen server to get the update

frank birch
#

i've seen it many times by now on replicated booleans using an int (from int8 to int32) of 1 instead of a boolean.
Is there a better performance optimization for this? šŸ¤”

#

common sense would dictate that a boolean is a bit...

#

and an int8 is well 8 bits

#

so a boolean should be better

#

(asume regular replicated property, not being manually achived or anything)

#

oh, wait, it says int32 myVariableThingy:1 does that mean that it only uses one bit?

#

well, I guess that computers can't do bits after all

quasi tide
#

Yes, it is only one bit.

#

Boolean is more

#

But it comes at the cost of being more cpu intensive.

#

So it's a trade off

#

Better bandwidth, but more cpu

#

But don't go thinkin' that it'll bring your game to a complete crawl

#

I know that's how people start thinking when they here something performance related

frank birch
#

not my first rodeo šŸ˜…
premature optimization and/or optimization without measurements is hardly ever good šŸ˜›

kindred widget
#

@twin juniper Tagging you here as it's less of a C++ issue. But in general for session based matchmaking, all you need to care about is the OnlineSubsystem and the sessions it finds. If you use the new CommonSessionSubsystem, it's really simple to find sessions and populate a listview with it. I know you're not a BP fan, but above is a fairly simple implementation for a widget with a Listview in it for easy session finding.

twin juniper
rose egret
#

is FFastArraySerializer ordered ? I made invenory by that but in some cases items order are different in clients

kindred widget
twin juniper
#

It is all the same just that they used AGameSession.

#

Well this demo is old and the way of things have changed. Would go by your advice and use one of the subsystems class

kindred widget
#

Huh. I've never actually looked at this class before. šŸ˜‚ But yeah this has nothing to do with session searching. This is gameplay handling stuff for an already hosted session.

twin juniper
#

I know that most of the stuff can be done with BP easily. I just wished that there was a much easier workflow between BP and C++.

kindred widget
#

I find the workflow fairly easy between the two in most cases. What do you generally get hung up on?

twin juniper
#

Can you give me an overview of how to use Gameinstancesubsystem with game mode? I understand how to use the former

kindred widget
#

Not fully following the question? GameMode will be created long after any GI Subsystems. You can just get the game instance and get a subsystem from it.

twin juniper
#

How does creating a session lead to a new level being loaded?

kindred widget
#

That depends on the system you want to use. But the general overview is that you'll ask your OSS to create a session, and on the callback of that you'll open a new level with the Listen parameter.

kindred widget
#

Not sure. Have learned most of it from just reading through source stuff.

#

You can kind of get a decent overview from the CommonSessionSubsystem though.

#

Do you have Lyra installed?

twin juniper
kindred widget
#

I don't think so. In that case you might want to check out uh...

#

SteamAdvancedSessions?

#

AdvancedSteamSessions?

twin juniper
kindred widget
#

Maybe. It exists in a plugin called CommonUser

twin juniper
kindred widget
#

Oof

twin juniper
#

I would check tomorrow maybe I'll find the usage example in shooter game demo itself.

twin juniper
icy jetty
#

Is it the RAM or the VRAM

#

I guess it doesn’t matter

clear raft
#

Hi, can anybody help me with a client issue?

kindred widget
# twin juniper Thank you for your support man. Really appreciate it 😊

From what I can see of the older systems. It seems to mostly boil down to this.

IOnlineSubsystem* OnlineSub = Online::GetSubsystem(GetWorld());
check(OnlineSub);

const IOnlineSessionPtr SessionInterface = OnlineSub->GetSessionInterface();
check(SessionInterface.IsValid());

SessionInterface->AddOnCreateSessionCompleteDelegate_Handle(FOnCreateSessionCompleteDelegate::CreateUObject(this, &ThisClass::OnCreateSessionComplete));

Then in another function this gets called with some parameters.

SessionInterface->CreateSession(*UserId, SessionName, *HostSettings);

Ultimately ending up at the OnCreateSessionComplete which boils down to...

GetWorld()->ServerTravel()
kindred widget
twin juniper
clear raft
#

yeah sorry, so basically I was using the ue 5 first person demo and I wanted to create a simple multilplayer system: a server and some clients. I made that if the server or the clients collide with the block you can see in both screens the movement. Then I made that when the server shoots the clients cna see the bullet and the block moving when it hits them; but when the client tries shooting something strange happens. I was following a tutorial that said that after the enhanceinputIA_Shoot function I should make a function called server fire which executes on Server is written here, but when the clients tries to shoot he basically freezes and then changes to "another level" which is still the same but cant see the server no more and it moving or doing anything.

#

whoops sry for the double screen

#

I understand it might be hard to actually realize and understand what I wrote so if you want a video of it please tell me

fathom aspen
#

Do it with ALT for the focused screen print

kindred widget
#

That's odd. Sounds like an open level call somewhere, or a client disconnect.

#

DC would go back to main menu though I think.

#

Unless you don't have one specified and that level is your main menu.

clear raft
#

so what do you say I should do?

#

Because I'm really a beginner in this field and I really wanted it to work

violet trench
#

Is it hard to teach yourself multiplayer?

clear raft
#

?

#

Yeah that is what I'm trying to do but encountered this error

kindred widget
# clear raft so what do you say I should do?

Hard to say initially. If you have any OpenLevel code, breakpoint it and see if it's running when a client shoots. Otherwise it's all trial and error. C++ would be easier as you could just breakpoint the OpenLevel code and see where it's coming from.

clear raft
#

I dont even know what an OpenLevel is. I just took the first person demo and run it without changing anything

kindred widget
clear raft
#

The amount of background I have with multiplayer is two or three games in javascript with socket.io

kindred widget
violet trench
kindred widget
#

5 weeks to 500 years.

clear raft
#

damn

#

So what do you suggest I do to my project?

violet trench
kindred widget
#

There really is no answer to that question. People learn at different paces. And BP only for networking is hard to do anything substantial. You are missing a lot of the networking toolkit and more importantly a lot of the networking debug ability.

clear raft
#

So let's say I wanted to make a game about boat fighting, for it should I learn blueprints or c++

#

ok so I disconnected the code that comes after the function

#

but still it disconnects

#

seems as if the client doesnt like the function

kindred widget
#

IMO. You'll have a hard time doing BP only for anything past a multiplayer walking simulator.

#

To be more clear about that statement. You CAN do a lot of things with just the RPCs and replication that BP has. You can hack together a decent game out of it if you are careful enough and severely temper your ambitions.

west robin
#

I am right by saying I can't simply replicate a Multicast Delegate? So when its called it calls on all clients right? I'd need to setup a multicast or something

kindred widget
#

Also as a side note. Make sure that what you're doing really needs a multicast.

#

Most of the time tutorials or people using multicasts ends up with them simply needing a RepNotify variable.

scenic turtle
#

hey all, quick question here, I want to run an event on a exiting player controller, which all it does is forward some values to the game mode, however, this does not happen due to the event is not even called, I guess the PC gets destroyed before. How can i ensure that it will get called? Thanks in advance

west robin
#

@kindred widget Thanks for confirming! I did test but just wanted to make sure haha! Yeah, I've noticed that! Thanks for the help! šŸ™‚

icy jetty
kindred widget
# icy jetty Would you mind explaining the difference ?

In general replication is for state. Need to set a light to on? That's state. You should be setting a replicated variable.

Need to play a one off emote montage that won't matter if it doesn't play when a player enters relevancy range? That's a multicast.

icy jetty
#

I c. I’ll need to do some more research on this. I have some multicast nodes currently, based on a tutorial I watched, so I was curious whether I should be using rep notify instead

kindred widget
#

The literal difference is if a new player needs to know about this thing.

#

If you have a player join late, and you've multicasted that a light is on and they join after that. They will see the light as off. Where as an OnRep will automatically update that for them when it's relevant.

glossy kettle
#

are you woke to the new UE net framework that's 5x Iris performance@pallid mesa

pallid mesa
#

eh?

icy jetty
#

In my case the player would have to be there the whole time for the game to continue, so I guess multicast should do the trick

dark edge
#

it's easier

rocky kestrel
#

Then anim instance class takes those from pawn owner interface call

#

I did fishing rod amount exactly same and it works. But this doesn't.

red vine
#

Hi there I'm having trouble getting my blueprint here to work.
I construct a notification object in GameMode (Server only) to send to a Specific Client.
It sends with no problem to a PlayerController Component.
But when I try and give the client the notification through replicated events it finds it invalid once it hits client:

Do replication events not make copies and pass a copy to client?

kindred widget
red vine
#

(I'm using objects as I've been discouraged from using nested structs)

sinful tree
kindred widget
#

Which if they're UObjects, and you have not done the C++ work to replicate them, they're not netaddressable.

red vine
#

"Looks like I picked the wrong week to stop sniffing glue"

#

thanks guys I'll likely just replicate a single variable as I'm not allowed to use C++ in this project

icy jetty
#

We need a c++ bad reaction emote

red vine
#

I wish I could use it, but it's unfortunately for a mod, so it has to be all blueprints.

#

šŸ˜…

kindred widget
#

Speaking of UObjects and replicating. I wonder if that's going to get exposed to BP soon. They made that a ton easier in 5.0

rocky kestrel
kindred widget
#

Would assume something odd with the animbp then. This all looks fine.

ivory bear
#

Replicated projectiles. Prior to proper replication, green markers and bullet impacts matched. After replication (tested and is properly replicating) you can see the impacts line up with rotation on horizontal, but not vertical. Any good refs for this out there? I have gone through 7 tutorials and all end up the same.

...and above and below red line produce same results

dark edge
kindred widget
icy jetty
rocky kestrel
#

This is from anim instance c++ class.

kindred widget
#

Smart Objects are an AI thing as far as I know.

rocky kestrel
dark edge
unique cloak
#

@hollow eagle Is that what you meant?

red vine
dark edge
unique cloak
#

@hollow eagle

kindred widget
unique cloak
unique cloak
#

There is a problem @hollow eagle

naive ore
#

in general, if i have a fully functioning Co-op style LAN party multiplayer, would the transition to a dedicated server be smooth, or is it different from the ground up? I understand it would require a source build of the engine, and a server build switch. My question is more about foundational stuff. It is essentially all going to work the same as the local network listen server, or is it totally different code as in the base BP or c++ level?

unique cloak
hollow eagle
#

Please stop pinging me. I didn't respond to your first two pings, I'm clearly busy or not able to answer your question. If you have a problem then be patient and wait for someone to answer you.

unique cloak
unique cloak
#

ok so guys

#

can you tell me why the list is empty even though I replicate the struct that is in the list? do I need to replicate both?

#

Client

#

Server

#

maybe I wont have a UListViewData at all and I will just have the struct on the game state?

#

nope

#

I need the UObject to add item

fossil spoke
#

@unique cloak Stop trying to replicate the UListViewEntryData object, you have been told before that this is not how to approach the problem.

unique cloak
#

Yeah I forgot my bad

#

So how can I make the data to be replicated?

#

I have a struct there

#

That is a variable

#

Like in the photo

#

But it doesn’t work

#

It’s not replicated

fossil spoke
#

Read some documentation or follow a tutorial, you are severely lacking in understanding on some very basic and fundamental concepts for networking/replication.

storm zinc
#

So in my game mode I am overriding the PreLogin and I can capture things, but I have created a multicast event so that I can pull two points out as an event inside a blueprint. However, the UniqueId comes out as a struct, and I would like to convert it to an FString so I can just store it like that in the gamemode.

DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnAuthenticatedUserCapture, FString, clientNetworkId, FString, clientToken);
That's what I'd like.

So how in the PreLogin() function, do you convert const FUniqueNetIdRepl& UniqueId to an FString and get the actual uniqueId to be passed?

fossil spoke
#

@storm zinc Call the ToString() function on it?

#

FUniqueNetIdRepl is a Blueprint type

#

You can pass that out directly to Blueprint if you like.

storm zinc
#

ya it comes out as a struct but nothing in it so.. maybe I could do a ToSTring in blueprint perhaps

fossil spoke
#

You wont be able to.

storm zinc
#

mm

fossil spoke
#

Why do you need it to be a string?

storm zinc
#

I just want to use it like a key in a dictionary

#

so I can associate a network id with a token

fossil spoke
#

Then you dont need it to be a string, the type itself should be fine as it can be compared?

#

Eitherway, calling ToString on it to pass it into Blueprint as a String is fine.

storm zinc
#

ok. we will see.

#

This has been a journey for sure... many hours of trying to get this to compile lol