#multiplayer
1 messages Ā· Page 80 of 1
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
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.
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
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 š¤ )
Running on an arduino?
how do you get 3 fps
javascript, coded with my elbows and optimized with "haha, no"
not even js runs so slow
actually optimized js is probs faster than C++ sometimes
12 years ago, 17 year old me thought he was smart and could do pathfinding in javascript from scratch...
š£
Is it better to store information such as Character selection and lobby ready status on the player controller or in the playerstate?
Do other players need to know if someone's ready, or what character they've picked?
yes to both
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.
ive got pawns in the lobby that reflect the selected character and ready status, but they only display the information.
So i should store it in the gamestate then?
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.
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 š
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.
its called before controllers are assigned to players.
Oh I see, thank you!
assuming this is for when the game starts, you can just set up a playerstart wherever you want the initial view will be
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?
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.
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?
Lifespan is not replicated.
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.
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?
guys I get this error and dont know why
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
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
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 ?
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
post it here
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
}
}```
the array above is only modified on the server?
Yes, this function is called from server-only
ahh, yeah btw if i read correctly you were making a card game, right?
i remember from reading you back to back these past days..
i really recommend you to try fast array serializer
Oh yeah Kaos also told me that with big arrays
it can also be convenient because of the callbacks u got there
there is like 20 slots in the array which is pretty big i guess
Well i'm going to read some docs, thank you
ah no, thats not really a lengthy array, but the convenient callbacks you get on a fast array serializer will make your life asier
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
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
Cheers mate, yeah i spawn / destroy on serverside, i just needed the lifespan to set a visual but i just had to make my own timer to get it sorted. cheers
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?
Hey, quick question. Why is it that after servertravel the players donāt spawn in? The spawning logic is inside the player controller class.
Is it on BeginPlay?
Is it Seamless ServerTravel?
Are both GameModes using the same PlayerController class?
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
Oh ok, but does that work even when the game starts?
Yeah, why not. That's how vanilla Unreal spawns Pawns (through GameMode)
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ā¦
You gotta ensure that they have Spawn Points available
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
But this time I only set them as default player characters, I have no control over the spawning of them
The Pawn Class (or actor even?) has the Collision stuff as a Member Property
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.
I highly doubt that exists
I have at least not yet heard of any such resource
Despite reading Source Code itself
@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.
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
put on your goggles and dive in
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:
- His local game sends a packet to the server containing the move input
- The packet takes 50ms (hypothetical) to get to the server
- The server receives the client packet and updates the avatar's position
- The server sends a packet to the client with the updated avatar position
- The packet takes 50ms (hypothetical, both ends usually are not identical) to get to the client
- 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...
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
try to avoid using Child Actors Components. I - to date - keep suffering net addressability issues over them on seamless travel
I see, do you recommend I just use a variable that is a reference to the weapon actor and bind it to a socket?
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
K, will try it thanks. I actually had thought about doing it that way originally lol
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
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
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.
Unfortunately you are unlikely to find help on anything to do with UE3 or prior engines here. This server is specifically for UE4 and UE5 (including UEFN).
You are better off finding a community that specifically deals with UE3.
The question itself is also offtopic for this channel.
Unfortunate
Root motion animation is possible, it required additional synchronisation though. If you use #gameplay-ability-system then it takes care of some of the heavy lifting for you.
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!
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
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 ?
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" ?
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)
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
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
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
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?
Because the host is the server ?
Found it apparently it doesnāt work if I use the constructor ā¦
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.
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...
BeginPlay gets called usually before Pawn gets assigned a Controller (possessed)
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)
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?
What do you mean by "systems"?
Like EOS, Online Sub Systems, Etc.
There is a lot of options and not sure what would fit the needs best
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?
Still working on it, not yet finished.
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 š¤
Get it finished first. Matchmaking isn't something you want to worry about if you're just starting
Prototype requires coop
Entire game is based around it
Fair point
I would make sure the game works from the network perspective first tbh
Thanks. Was following a tut and some prop/equipment init was done at the start of begin play and found that as I added more functionality, that "stuff" was not getting added or added correctly. Will take a look at your linked content.
Yeah sadly I saw that Epic used it like that in one of their streams from 6 years ago, which is unfortunate 
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)```
Is it possible that my clients donāt spawn in because the spawn is already occupied by the server character?
I am not using gameplay ability system. What additional synchronisation needed?
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?
Did you add "NetCore" to your modules? and did you define a ctor for the item struct?
Nope, ctor stands for constructor
Oh no idk what it is ?
ah a regular constructor
i did not see one in the example code
Start by adding the module
Make sure the OnRep runs only on the server
Basically the code that runs it in your case runs on clients as well
But what is the ctor ? In the code i provided previously there is no constructors
And that's usually bad (unless reasons - prediction)
Replicated properties should be set usually only on the server @toxic lion
I think there is a default one and it was sufficient, that's why it wasn't the case
Basically a code that guarantees your animation runs on all instances that need to see the animation
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
thank you. Going to take some time to fix up my code
Yeah usually it's to make sure that you gate that code with proper methods
HasAuthority is one candidate
IsNetMode and GetNetMode are others
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
Sometimes HasAuthority doesn't workā¢ļø the way you desire
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)
yeah, unfortunately, at the moment it's causing the item to be spawned twice.
I'll need to keep playing around with this
Thanks, could you be more specific as what needs to be replicated or sync when it comes to the root motion?
I've read everywhere that root motion animation caused jitter effects from the root motion battling the location of the character with server location
I've never used root motion out of GAS and I don't think I ever will, so I'm not sure
š
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?
Where would you init a datatable of weapons on the server and how would you "get" them from a character blueprint?
@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...
does anyone realistically use _Validate functions ?
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?
Assuming that level is a POD type, a hack would be to check inside the OnRep if owning Actor HasBegunPlay
Usually they return true, but yeah they have good uses (hit detection etc.)
UE is not MMO friendly if that's what you're asking, but I know of an MMO that was made with it, but ofc they customized the engine a lot
Datatables are static, and are set at compile time. So the first part of your question is out of place
For the 2nd part, just expose a variable that cache it
those aren't good uses - hit detection disagreements can happen in normal gameplay. Failing _Validate would kick the player for not doing anything wrong.
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.
Hmm good point, but I was aiming for malicious hits rather than a normal disagreement
ShooterGame has it iirc
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.
And many games where inspired by that game, so I would guess they have it too š
ShooterGame isn't exactly a bastion of good hit detection design
I 5hink it would be more useful if it just prevented RPC call instead of outright disconnect
Agreed, I'd find that way more useful
@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...
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
To be perfectly honest with Iris it is entirely possible to make MMO networking on scale, without tossing half engine away
Yeah but managing that many players with a single unreal process isn't
The problem is, just replicating player positions and abilities is least of your issues
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
Technically you can use single server, but you have to multi thread ahit out of it. Which means throwing away entire game framework
you'll be at the point of effectively rewriting the engine inside itself š
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
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...
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
I haven't heard particularly good things about spatialos, but the idea behind their tech is neat
Check GetWorld->TimeSeconds != CreationTime. That'll let you easily skip properties that replicated on spawn
Have you looked at open world server for unreal at all, I think mortal online does something similar (or maybe straight up uses it)
This also work for properties that were set by the server in the same frame as spawn but after finishing the spawn?
It works for any property that's received in the spawn packet
So usually, the initial state when receiving the actor
Does the spawn packet get sent when spawn is completed, or some time later in the frame?
All network updates are sent at the end of the frame
Great, I thought so!
Thanks for the info
Also, thanks for the article about sub objects and inventory system
Used it here too:
https://jambax.co.uk/better-burst-counters/
I was considering going that route, but will instead use an XpComponent
Used it in HLL to stop weapon muzzle FX playing a one-shot when players came into relevancy range
Iris won't make Unreal handle 5k characters, it does't even handle 500 decently enough
TBF that subobject article is a bit dated now, needs updating for the new stuff in UE5
I figured, but it also looked like a lot of engineering overhead for little gain
afaik dedicated servers run on a single thread by default
As I said Iris can cover "networking" part without rewriting entire engine, that the other parts of engine scale terribly is another topic
Very few scenarios where you need replicated UObjects tbh, but at least 5.0 made it a tad easier
Very nice write up on burst counters! I was intending to study that topic in the near future.
I'm not even sure about that part, Iris can help but Unreal's network stuff has never covered more than a few dozens, I doubt it is 50x more efficient - at this point I don't even see array serializers being that useful
Still far superior to gameplays cues and that nonsense when it comes to cost
This will be the 2nd VFX related replication that I'm doing to avoid GCs
Even though I'm using GAS
LOL
MMO networking is not that magical compared to say FPS networking. It boils down to replicate less stuff less often
Portions of my systems do not use GAS and I do not want them to take on that dependency
handling 5k entities kind of needs something magical though, and Iris is not that magical
What makes GCs expensive?
oh LOL this is totally the wrong channel, sorry I read quickly "materials" LOL
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
GAS adds constant overhead to everything, can't beat just an incrementing counter
the lowest hanging fruit right now is UNetConnection, purerly because i is uobject with all it's overhead
Oh I see. You are referring to the large amount of data they pack into every situation to handle every possible scenario
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
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
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
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.
The interaction system in Lyra is a perfect example of how not to use GAS
Horrid implementation
haha yeah giving ability to every interactable object in range looks bit over kill -;-
Was a great place to learn about DataTables and OnContruction for pickups
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
A lot of my modifications have been about reducing the abstractions tbh
I'm just so over the obsession with GAS tbh
Well it sounds great, I'm still skeptical about the boost it can provide - I guess we will see how much it can push the current limitations of the engine
I like the Lyra Experience system, or atleast the idea behind it
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
Is the GAS FPredictionKey a good way to handle prediction?
I ended up incorporating a similar pattern for prediction in a completely unrelated system.
Prediction Key stuff is fine, pretty simple to implement. The "complexity" in GAS just comes from rolling stuff back
I understand it's usage for the common case (gameplay abilities xD) but I don't get why it would be suitable for the entire game
Ah that makes sense
I'm not using rollback
I do some "roll forward" extrapolation on longer VFX for late join / relevance
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
Is the AGameMode phase system well implemented?
Worked for UT, Gears etc.
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
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
also, old issues are often known
yee
switching topics, why are child actor components still broken? š¦
The idea is neat, but they are so unresilient
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++?
They can be different for different experiences
you dont need an ASC or abilities for that
So the Lyra Game Phases are about using experiences to customize which phases are available on a given map?
given experience
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
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
yes yes, it works, but you know... it feels like kiling a mosquito with a bazooka
XD
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
sure
I mean custom solution for what the experiences are doing, is probabaly just as complex, just from different direction
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
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
well, but understand that the multiple layers of complexity that GAS provides - prediction, reconciliation, cancel/block - are not very applicable here
they are not, thus you can safely ignore them
yep hence the fact of making the claim of "using GAS for this?"
abilities provide way to run logic and respond to events
and to easily create said logic in blueprints
don't think about it like it is for making fireballs
though it certainly was created with it in mind
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
in any case there is actually plugin called Gameplay Graphs
probabaly commited by pure accident to engine
well you have two choices
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
oh lol XD
you can read from plugin description it is specialized graph for gameplay
I'd say it's GAS 2.0 but more modular
well I believe its all about scope
GAS 2.0 is a thing ? officialized ?
No
Do we have any updated roadmap for Iris? Any example usage or anything like that?
it is drop in replacment at first
so if you are not deep into customizing networking, nothing changes
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 š
I wonder why NetRelevency dosent work for my editor placed bNetLoadClient=true
relaiable RPC is called even if they are out of relevency
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
Ownership
Player should call a server interact function on itself
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
@thin stratus - nice overhaul on your NetworkCompendium btw! I like the way its put out now.
Thanks! It works now š
Was it overhauled? : o how long ago?
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
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
oh yeah, it's quite better this way. easier to digest
But printing it requires some css media queries which I didn't want to fight with yet
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 ?
Pretty sure you just manually have to check the netmode
Check what Printstring is doing fwiw
The BP node
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...
if you start multiplayer on PIE and you use UKismetSystemLibrary::PrintString(...) it will do that
just ensure you are not instantiating two standalones
maybe thats the issue - i'm doing standalone and i'm trying to debug this.
that makes sense.
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?
Ah wasn't there something with broken cues ?
Or Anim notifies
I remember something vaguely
wdym?
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
is there a way for me to fix it?
Maybe? Search through this channel's history about anim notifies.
It was sometime this year
Godspeed my child
At least I wasn't misremembering
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 :/
Make a job listing if you are looking to hire someone.
OK, I'll do that thanks.
im having a similar problem, if you can post an update if you solve it, id greatly appreicate it
its gotta be something with replication - i'll work on it in a few....
Are you seamless travelling?
A wild guess would be that the PlayerController is persisting but the context mappings are not, and hence the problem
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.
hi guys, is it possible to replicate the scale of an actor? cant seem to find anything about it
does replicate movement not cover that?
it doesnt seeem too.. haha i thought the same
https://docs.unrealengine.com/5.1/en-US/API/Runtime/Engine/GameFramework/AActor/SetReplicateMovement/ im not 100% sure how to read the docs tbh cause this doesnt really tell me aything
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);
}
}
How can I make a session friend only and not make it appear on server list?
Does anyone know if Epic plans to add RPC validation to blueprints as well? As i understand its only for cpp
Im still learninf about all of this myself but i think youre looking for online beacons/party beacons. Theyre classes that connect to sessions independently to retrieve information, like wether that session is public or private
Probably not. Have at least not heard anything. Multiplayer in BPs will forever be just enough to do some basics stuff
Set this in your DefaultEngine.ini
[ConsoleVariables]
a.EnableQueuedAnimEventsOnServer=1
Unfortunate, thanks for the info!
also, RPC validation is a rarely used feature, so I dont see that happening
Yeah I don't think I ever used that :D
What do you do to validate data?
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
There is barely a point where the client sends any
And if so I just do it in the RPC itself and handle it properly by correcting the data if needed
Okay yeah that makes sense.
Thank you for the insight š
If you're using advanced sessions plugin....
Step1: GetAndStoreFriendsList()
Step2: see pic
FOR THE CREATE: - all defaults
using default appid 480 - this only appears on my friends list - not on public viewed games (i have 2 methods to view games listed)
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...
Anyone familiar with ListenServer configuraiton/setup of INPUT not working - its only on non-replicated function - in this case Look isnt working for either client/host
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.
i think i may have just accidently figured it out by setting up a widg3et lmfao.....
I was setting up an escape menu for this project and did this... and low and behold the game input for turning worked fine after executing this function!!!! Give this a try!
yo,, what that's it!? awesome thank you! ill try it
lol yah i didnt expect this...
where did you add this? in the bp for the character?
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
ahh ok cool, do you mind sharing the code snippet? i swear im doing this
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);
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
nice seems to be working do you also rotate the character based on the mouse pos?
i dont but thats easily pulled off - lots of videos on it.
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
this defs seems like the right path though
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 :/
no change me with that code
i needa read more about this
it seems like it should be simple to get this going
i completely agree
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
yeha i dont get that either
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
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.
Mortal online has no loading screens anywhere you can just walk across the world and doing so would take hours, itās big. There is a second or two of lag when you walk from one server to another but near the edge of a node they replicate things to both servers so you can see across it, itās really quite seemless
@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?
I wasn't directly involved or anything so I could be wrong, but I have reason to think they used OWS and just edited it to do seamless travel, you can ask on the OWS discord, I believe people have done similar there but I haven't checked it out in depth or anything as its not exactly what I need
@rose pollen Found some overviews about this game on yt and first one calls "Worst MMO Ever? - Mortal Online" Laughing till now š
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.
Haha, game is deeply flawed in many ways but the server tech is not the problem lol
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
thank you!
There's always the General Movement Component
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
}
}
}```
good morning guys
i have a question
do you have any unreal service for multiplayer games for free for small as a test?
yes, you can use eos and the devauthtool if you want to connect standalone instances over the wire
I think my question should go in cpp
you can hold a reference to the array owner in your fast array serializer
its a common practice
Is it possible for two players to possess one vehicle? One drives the car, the other shoots the turret for instance?
Oh yeah i saw it in GAS
Ty !
maybe a ref to the inventory ? (as the delegate is actually in the inventory component)
well each controllable movable part would need to be at least an actor if you want to use the ownership system
but no you cant have two controllers possessing the same pawn
Thanks!
yeah, whatever works for ya
Ok thank you !
Yeah, I learned of it relatively recently. If I completely exhaust every avenue besides client authority (never doing that ahaha) then I'll consider splurging on the GMC.
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
This works properly when the mesh is visible though
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 š
Search in this channel for "host migration" and you will be flooded with answers
How did you confirm that it is not being executed on the clients?
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
Did you verify that the client as a valid EquippedItem?
tl;dr not possible out of the box and I doubt anyone really knows the required c++ and engine changes for this
And why is this coming up so often lately
i bet it is because listen servers by default are barely usable in production š¬
It almost feels like some random youtuber talked about games needing that or how easy it is
š¤£
@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.
Are you trying to change it via the ABP or something?
I set the new layer when I actually equip my item
- Client sends a server request to equip an item
- Server equips it and then onreps the Equipped item
- 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
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!
about dedicated servers, does the whole team need to build the engine from source?
or just the server needs the source built engine?
later
what?
the server needs the source built engine
so the team can run the version of unreal from the launcher then?
yes, altho it would be more convenient to host the engine
wdym by hosting the engine?
puting it into your repo (beit p4, plastic, svn, git...)
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)
that is not a rep notify :x, thats a client RPC
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
can i see your rep notify code?
but please erase the OnRep_Stamina custom event, thats not what you want
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
Can someone please explain how to do this, or link a resource?
Are you testing this in PIE with multiple clients?
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
Presuming he's expecting a client print. I'd definitely go with either not replicated, or wrong PIE conditions.
Is the default for that 50?
Nope, it is 0
It is the third person characte BP
Ah
I just tried putting it on the controller but that didn't fix it
Well itās 0 but youāre setting it to 50 on begin play
Back in the character, Does printing it on tick show client prints, and are they at 0 or 50 if yes?
The issue is that he's not getting client OnReps.
Aye ik, just saying for clarification
In case people didnāt see the screenshot with switch has authority
What is the difference between RepNotify and ReplicatedUsing?
Blueprint
So, like RepNotify can be overriten by blueprint, and ReplicatedUsing not?
No, all server
O.o How is the component created? No tick prints on the client at all means it doesn't exist on client.
Here
And if you put it back in the Pawn?
In which case this means you only have one player in a listen-server scenario
Which is always going to be the server
RepNotify is the BP term for ReplicatedUsing. But they're the same thing basically. Sans that Repnotify is weird and calls the notify from any sets even on server.
Yeah, same method and result
That's... Odd
I know š
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.
There are no client messages neither on the listen server or on the client,
But you have two PIE windows open?
And can you see your pawn moving on the second window when you move around, or?
Yes
And you put a print in the Pawn?
Yes
lol wtf?
Yeah but bp wise I meant
Just double checked, I was running them under separate processes, when I re enabled it I'm getting a server and client message
Oh, yeah that'll do it.
It is PIE as well
Separate Process can't print to the editor.
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?
Could probably use a print node after that switch authority, I imagine
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?
Why do you need a subsystem here? Aren't you storing stamina on the component?
I am, but I also have a widget that I want to display the information on
Still not understanding the subsystem. Widget should be able to access the controlled pawn and get it's stamina component.
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
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
I dont understand why my component GetWorld() returns null when used inside MyStruct::NetDeltaSerialize
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.
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.
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
What does that mean? Like it automatically optimizes the data size?
A pointer to an asset is smaller than a softref.
I use predefined assets, not at runtime
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
But should I send a pointer? Is it possible through RPC?
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.
async loading in C++ and bp is quite easy, though in C++ there are limited resources for finding out how
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.
Thanks nice tutorial
Side note on soft ref is that it doesn't get unloaded straight away
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
Ok thank you! I'll try both and see what is the best for me.
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.
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
Unsure, but usually ControlRotation is client authoritive. This looks like you're trying to set it on the server? Which the client would entirely ignore.
How to make the server create a game and also how to make a client choose what server should he connect to?
Fixed the control rotation with this, still confused about how the set actor location replicates fine but not set actor rotation
If it's a Pawn. Then most Pawns are set to rotate to their control rotation. Setting it's rotation is immediately overwritten by control rotation.
Does anyone happen to know what "ResolutionConnectionTimeout" is for?
If I google it I get only seven extremely unhelpful results....
Not 100%, but quick search through code shows it mostly being used in UNetConnection::Tick
Seems to close the connection if it hasn't received anything in the timeout range.
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
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.
I already replicated the UObject and it is working
ah ok so whats the problem exactly?
the question is if I set its properties using data table, it will still be replicated?
so it just sets data from other things and replication didn't effects? it remain the same as it is?
hey mate, did you get any closer? i havent haha
I"m sorry i didnt message you back....
i'm working 100% fine with blueprints nodes - not the C++
tested both PIE & Standalone/packaged
ahh ok thats fine, do you mind sending a screenshot of the relevant part?
i can recreate in cpphopefully
same as it was before - this should work in C++ as well too.... theoretically
thats in my Character class
all my UI inputs work fine - but i'm not using a HUD class like someone suggested before
cause it works on theindex
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)
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
awesome, ok thank you
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?
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?
Itās the data (uobject) of the list view entry
What is it trying to achieve?
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
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.
I have told that with a struct I need to reimplement the list view stuff
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.
Iām not itās the data
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
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.
Wrapper? wdym?
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.
how to move an actor in multiplayer?
for some reason my boat moves only with the host, no client can moves
But if the struct is in the UObject, do I need replicate it
Or like itās not really part of it because when I declare it is above the class?
the replication of the struct is completely unrelated from the UObject
Do I need to make a struct variable there too? In the UObject
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.
So I need a UObject just to make the struct there?
After that I have nothing to with the UObject?
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.
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
Why do I create an object for each class? Because I declared it there?
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:
- 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.
- 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.
idk if there are automation scenarios to test this, but what you describe is way way beyond the scope of unit testing
Oh yes, rather integration tests. I meant that I need to automate this process
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!
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
}
}```
So you recommend me the second version ? Since we save some bandwidth but we compute stuff locally (I believe this is the reason š )
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?
Yes. A TMap lookup is fast, and lower bandwidth is always preferable
You can also quite easily limit the maximum RowName string length with data validation to essentially fix the cost
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
Make ACardShop a replicated actor that the player owns. EZ
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"
Actually the first approach seems okay to me but that would mean that every player own the shop ?
Only one person can own an actor at once
Depends if more than one player can interop with it. Sounds like in this case, you want to go with the component approach.
Yeah many players can interact at the same time
Yeah let me read your approach & think a bit about it
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
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
All the logic is componentised. Makes it easier to remove/move/refactor etc. later
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
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
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.
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
Would initially assume it's a timing issue. Is the pawn valid at that construct time? And do you have the right pawn?
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
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?
https://stackoverflow.com/questions/61088540/c-ue4-bool-vs-uint8-1-vs-uint32-1-pros-and-cons-of-each
well, I guess that computers can't do bits after all
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
not my first rodeo š
premature optimization and/or optimization without measurements is hardly ever good š
@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.
Thank you for your response š
I was confused because ShooterGame demo in UE uses AGameSession to manage sessions that is taught to be done using Game Instance Subsystem in cedric neukirchen's tutorial
is FFastArraySerializer ordered ? I made invenory by that but in some cases items order are different in clients
Most OSS are GameInstanceSubsystems. Even CommonSessionSubsystem is one. I'm not sure about the AGameSession though. Haven't ever had to use that and being an actor it doesn't sound like it's useful for session searching.
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
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.
Is it? The code structure looked so same. I'll have another look tomorrow but maybe it's wise to just not meddle with unnecessary stuff.
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++.
I find the workflow fairly easy between the two in most cases. What do you generally get hung up on?
I mean to get classes from BP into C++ via subclass. Most of it is repetitive work.
Can you give me an overview of how to use Gameinstancesubsystem with game mode? I understand how to use the former
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.
I mean I know how to implement all the create, join and whatever you may functions but how to use the GI within game mode
How does creating a session lead to a new level being loaded?
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.
Can you recommend any resource?
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?
I don't. Is it available for UE4?
I don't think so. In that case you might want to check out uh...
SteamAdvancedSessions?
AdvancedSteamSessions?
But it's source maybe online?
Maybe. It exists in a plugin called CommonUser
I tried installing UE5 but my PC RAM is too low that it crashes.
Oof
I would check tomorrow maybe I'll find the usage example in shooter game demo itself.
Thank you for your support man. Really appreciate it š
Hi, can anybody help me with a client issue?
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()
Will need some specifics.
Oh okay. Got it. So this is how you use Travel function.
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
Do it with ALT for the focused screen print
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.
so what do you say I should do?
Because I'm really a beginner in this field and I really wanted it to work
Is it hard to teach yourself multiplayer?
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.
I dont even know what an OpenLevel is. I just took the first person demo and run it without changing anything
Depends on your background. Also depends on your general experience with singleplayer code. Mostly comes down to curiosity and tenacity I guess.
The amount of background I have with multiplayer is two or three games in javascript with socket.io
Not sure then. Unhook code til it doesn't DC š
ok! how much it takes if i know (something) about bluprints?
5 weeks to 500 years.
hm
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.
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
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.
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
Correct
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.
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
@kindred widget Thanks for confirming! I did test but just wanted to make sure haha! Yeah, I've noticed that! Thanks for the help! š
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.
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
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.
are you woke to the new UE net framework that's 5x Iris performance@pallid mesa
eh?
Oh ok, that makes sense
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
Just start using repnotify
it's easier
Any idea why "all" clients lean when one leans?
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.
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?
Hard to say from what you've posted. None of it looks out of place. Can you confirm that the bools are only being set on one instance on the server from the input?
(I'm using objects as I've been discouraged from using nested structs)
Object references passed through RPCs are only sending the NetGUID of the object. If the object exists on the client (either VIA it being replicated or it having been spawned separately on both the client and server with a net addressable name) then the reference will be valid on the clients.
Which if they're UObjects, and you have not done the C++ work to replicate them, they're not netaddressable.
"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
We need a c++ bad reaction emote
I wish I could use it, but it's unfortunately for a mod, so it has to be all blueprints.
š
I'd be curious to know why you were told nested structs were bad?
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
Those bools only being set in image.
Would assume something odd with the animbp then. This all looks fine.
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
show where you're getting the pawn owner
GetBaseAimRotation will help you here a little. But in general it won't always be perfect due to lag.
Thereās something about Smart Objects on the roadmap, so maybe?
This is from anim instance c++ class.
Smart Objects are an AI thing as far as I know.
Anim instance c++ class
log the result of try get pawn owner and make sure it's a different one per anim instance
I was told BP Structs were bad for a series of reasons from people on here, apparently they are quite fragile and access times can be daunting?
- Good for prototyping
- Bad for development
Also C++ structs are so easy to add you might as well just do it
While true. You cannot use C++. So, it'd still be your better option.
There is a problem @hollow eagle
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?
Changed that
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.
ok just saying that what you told me didnt work, maybe I was wrong somewhere but I did what I thought you told me to.
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
@unique cloak Stop trying to replicate the UListViewEntryData object, you have been told before that this is not how to approach the problem.
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
Read some documentation or follow a tutorial, you are severely lacking in understanding on some very basic and fundamental concepts for networking/replication.
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?
@storm zinc Call the ToString() function on it?
FUniqueNetIdRepl is a Blueprint type
You can pass that out directly to Blueprint if you like.
ya it comes out as a struct but nothing in it so.. maybe I could do a ToSTring in blueprint perhaps
You wont be able to.
mm
Why do you need it to be a string?
I just want to use it like a key in a dictionary
so I can associate a network id with a token

