#multiplayer
1 messages Β· Page 718 of 1
in thirdpersoncharacter
you activate dooropenclosed
you can pass "self" as a reference by giving dooropenclosed an input variable of thirdpersoncharacter
and use that
that way the player ref will be the player open/closing the door
(since it's a default class that should work without any shenanigans, characters are replicated innately by some under the hood code)
You lost me there
(use the appropriate character type for your program, thirdpersoncharacter I think it was)
@jovial pike I'm 99% sure that's what's causing your issue and doing this should fix you up
gotta run for dinner though
I understood that part, I just dont know how it would fit into my existing bp. thank you for your help π
Why is 4.27 bugging out for me with networking errors. Didn't change any of my replication code yet now this error is popping up: LogNetTraffic: Error: UActorChannel::ReadContentBlockHeader: Sub-object not in parent actor. Literally was not there the other day. And copy and move over to 5.0, its all good
at the start of the dooropen/closed event, use that input pin to set your playerref
Worked! Wow you earned that meal. π Thank you @magic yoke
Nice to have a bug that's quick to track down, I was figuring it'd take a lot longer since I was looking at someone else's blueprints lol
Haha! You taught me a valuable lesson though with the setting the playerref, I appreciate it.
Is it possible to load a softobjptr on server and set on a static mesh component (for example) that replicates and expect it to be loaded and set on the clients as well as the new connections? Or do I need to set it ona replicated variable and make clients load and set on the OnRep function?
I have 3 maps - MainMenu, Lobby, Game
Would it be a smarter idea to make Lobby and Game 1 map, or is it better to keep them separate?
For now my lobby just shows all connected players, and leader can start game.
Later it will be picking skins etc
Suggestions?
Easiest is keeping lobby and game together, so you won't have to travel properties around
it will be a bit more coupled
for sure
are you using GAS by any chance?
yeah, kinda hard cause my actual game map is so dependent on stuff happening on begin play
might be hard to move things around
but I do wanna do this....eventually when I have skins & stuff that you can select in lobby, or even something as simple as transmitting color, it should be seamless
any suggsetions on how I can refactor my code to have those beginplays run only when traveling to. the game map?
selecting skins and such can be just a series of IDs in your PlayerState that can be seamless travelled through CopyProperties
so you can do whatever you please as long as you understand how to seamless travel between maps work
I do, but I'm having a problem
Even when I don't use seamless travel, some of my beginplays in game map don't get called
The Ancient demo implements non-gas input components, maybe you can take a look there π
oh yeah don't rely on level blueprints much
try to keep your stuff centric to the gameplay framework classes, there are handles now that get called on map travel
I'm calling OpenLevel in my GameMode though
BP's?
yes
mh not too sure about BP's, did seamless travel in BP's but that was a while ago... I don't remember if there was a flag to activate it
there is, now even I'm ocnfused
but what am I even seamless traveling for? right now I don't want it
I just want open level to work without causing issues in my game scene
what issues exactly?
some code in my game's gamestate class isn't running
which code, where is it placed
beginplay
and it doesn't call after traveling i suppose
so beginplay of your GS doesn't get called on map change
lemme check
well it is being called π€
it's something else, I'll gather some more info
π
Hi, has anyone used LevelInstances in a multiplayer scenario?
We're trying them out but we're getting some issues around net name lookup...
LogNetPackageMap: Warning: InternalLoadObject: Unable to resolve object. FullNetGUIDPath: ...
Oh I think I found a UDN thread that this is a bug fixed in Main...
Does OpenWorld() called in GameMode not get all the clients to stay connected to the same server?
Are you sure the players aren't still travelling when you're checking playerstate count?
And probalby not
Seamless is for when the game server moves all already connected players to a new map
yeah p sur
but I don't want to persist the gamestate, gamemode etc
will all that be overriden if the new map uses different game mode?
Fairly sure you can seamless travel to a different game mode
OpenMap, I think, will disconnect everyone and just locally open a new map.
yeah I don't want this
{
UWorld::SeamlessTravel("Overview_Demo");
}
Am I doing it right, now?
Or is the path probably wrong?
No I mean, is the arg correct?
"Overview_Demo" is the name of my map, will the code find it?
Should probably use /Maps/ThatMap or something
what path the absolute URL start from? Content?
Yeah
Is there any way I can assign this string somewhere?
?
The map name, can I assign it as a hard reference somewhere? In case the path changes tomorrow
Cause I tried running the game after supplying an invalid path, and my editor crashed xD
There are many ways to do that yes, use a soft ptr and set the map in Blueprint
What type is this? (i.e maps)
ULevel IIRC
man UE has confusing nomenclature. map/level/world π¦
Also, can't assign my game level to to ULevel!!
@bitter oriole have you done this before? I'm completely clueless.
I mean where do I even start? First of all, ServerTravel() in C++ takes in an FString, so what's the point of me assigning a ULevel*?
You wanted to have a safe path so obviously you'll want an asset reference
Safe path? But how does that help? Can I get the path of the asset reference in code?
Yes
Edit: ok I guess I can: GetPathName();
Soft object pointers will literally be the path
One last hurdle. I can't assign my level in editor. Any thoughts?
World->ServerTravel(PointerToGameMap.ToString());
So like this?
Where PointerToGameMap is a TSoftObjectPtr
What's the danger of an RPC not being set as reliable (when it should be)? Will the rpc sometimes not fire off depending on connection strength?
yes. Use Unreliable for transient effects - explosions, sounds etc
Reliable for actual game state that needs to be propagated no matter what
cool thanks guys
Note that, like weak pointers, soft pointers will not prevent the target object from being garbage collected, so once loading is completed, it may be useful to 'pin' the object instance with a hard object pointer to keep the object instance in memory.
This doesn't sound very fun.
You don't want the Blueprint referencing a level to force-load the entire level and all its assets in memory as soon as you spawn it
So what's the solution here then?
Solution to what problem
You asked how to get a path that would be safe to use
I said use a soft pointer to a map so that renaming the map won't break the string
You do not want the level loaded
You just want a nice path
@#'.)```
Last error I guess: Why is the map being suffixed to the `.`?π€
Overview_Demo.Overview_Demo???
You'll need to parse it
Most of the time, it's better to just keep a list of map names somewhere
E.g. a custom developer settings file, or config file etc.
so, soft pointers are useless? π¦
Any path you keep is going to keep the path to the internal object
Or you can use FSoftObjectPath::GetAssetPathName() to get the actual asset path etc.
Rather than the package + subobject path
Or GetAssetPathString()
I mean you do need to be very careful here. If you load that soft pointer, the entire level and it's content will load
Yeah??? I'm going to get rid of that soft pointer then
The soft pointer can just be treated like a path, that's fine
World->ServerTravel("/path/to/Maps/Overview_Demo");
This is working much much better.
But yeah, just don't load it yourself by accident, just use it for paths
btw one more q, this lobby to game level transition takes time compared to just playing the game level in PIE
Is that because Unreal is caching something in PIE when I directly my game level?
Well it's loading the level
If you just play in PIE, the existing PIE world is reused
gotcha
So, I've tested my Dedicated server for the first time, since upgrading to UE5
Issue is that it no longer works
It took a while to connect the client and server, but once the connection was established, the server crashed and the live coding console spammed a lot of
And then ended in:
Call to function NtWriteVirtualMemory in module ntdll.dll failed. Error: 0x8000000D
Call to function NtResumeProcess in module ntdll.dll failed. Error: 0xC000010A
Successfully installed 2 patches (0.000s)
Registering module E:\UnrealEngine-5.0.0-release\Engine\Binaries\Win64\UnrealEditor-LiveCoding.dll (PID: 14596)
Call to function NtSuspendProcess in module ntdll.dll failed. Error: 0xC000010A
Call to function NtReadVirtualMemory in module ntdll.dll failed. Error: 0x8000000D
Call to function NtWriteVirtualMemory in module ntdll.dll failed. Error: 0x8000000D
Call to function NtResumeProcess in module ntdll.dll failed. Error: 0xC000010A```
I checked the crash log, and some assertion failed, I'm not too fluent in Unreal debugging though π
https://pastebin.com/qzQtvjWe
Don't use live coding would be the obvious solution I'd think
I mean it's risky at the best of times let alone while you've got a network game running...
Hi I'm trying to replicate an actor after spawning like this but the clients aren't getting it. Is it possible to do this?
That was a interesting surprise, live coding was the issue, thank you^^
does anyone know if it';s possible to make dedicated server builds without source?
like, can i build it somewhere in the cloud? jenkins or gameci or something?
Not sure if its possible to do it like that, unless your entire game dev is hosted on the cloud. Is there a reason why you can't get visual studio up and running on your local machine?
i can but i need the source build of unreal to build dedicated servers
and thats 200gb
and my mac has like 200gb left
I was wondering if I pushed my code to VCS and that triggered a build on the cloud (if it has the right settings), and then give me an exe
btw what's the average size of an unreal server build for a very small game?
how big is the binary itself?
The server build target is usually smaller than the client build, but there's no average size it all depends on how large and complex your game is.
it's really small
it's a board game lol
server build will have literally ntohing. no physics computations, nothingf. just like 15 repnotifies to worry about and a handful of client RPCs
if this was a non unreal project I'm literally staring at KBs (if it was a websocket server build)
My server build is about half the size of my game build
what's your game build size
6gb
and what kinda game is it?
full fledged 3d? PC?
capture the flag
why is it half? unreal server build won't include asset data like meshes, lighting etc right?
yea, its a headless build meaning there's no need to render out all the gpu stuff, it just handles the logic
its a exe that runs in a terminal window
dunno, also it says here right from the docs that a server build requires a source build https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Networking/HowTo/DedicatedServers/
So you might be out of luck trying to find a workaround
it sounds like your server build is unoptimized
not necessarily. There's probably an option where I don't hjave to build on my local machine at all
the source build can be on another machine somewhere, that's the power of ci/cd
either way you still need a source build
yes, but not necessarily on your local machine
use an external service
playfab or somethign similar
@near bison You could try checking out Render Farms, but I suspect they are mostly used for remote rendering of GPU intensive scenes and may not necessarily be used for source builds.
Might I ask why you call the server and do a multicast? Because it sounds like the server call isn't working properly and is just doing a multicast (which would do exactly whats happening here: clients execute locally, server executes all)
You could do that, but it should work just as well (if not better) by using just a server call from the player, otherwise a multicast will create an issue where any players that join late will not know that it has been equipped so it wont be equipped for them
you probably don't need the second linetrace since you still have the info from the first one, but yeah. Linetrace which does a server rpc in the player which then calls the interact function.
If the server rpc is done on the actor you're interacting with, it likely won't be called on the server since the client won't have ownership of it
yeah okay, never done it that way but I'm sure it would work
Wait a component on the player or the actor?
Assuming everything is fine on the component, can you send a screenshot of the actor's bp? I'm really not sure what the issue is
no @kindred gazelle
Reliable for actual game state that needs to be propagated no matter what
This is wrong. RPCs should be only used for transient stuff, for state use replicated variables.
Reliable RPCs simply go through a reliability mechanism to not be missed, but new connections will not replay them.
what's going on Bib?
aham π can I see code??
Yeah I knew that generally, I was just confused at the time since a colleague used an rpc that was unreliable when I felt it shouldn't be that way. You guys confirmed my thoughts but it turns out it was used only for a short effect but the real stuff was all done through onrep var elsewhere
send the pinned article to your friend https://vorixo.github.io/devtricks/stateful-events-multiplayer/
in case you think there's so confusion around about RPC's and OnReps
let me put the pieces of the puzzle alltogether Bib
oh btw Bib, you don't call the _Implementation() one
you call RS_InteractTrace()
RS_ I suppose it means server
Usually by convention you'd call it
ServerInteractTrace()
and make the change I mentioned
instead of calling the _Implementation() one
call RS_InteractTrace()
and once that's done, I'm missing some bits of the server impl to say.. breakpointing will definitely help Bib
yes
x'D
okay so that was it then
yes, you don't call the _Implementation() directly
Unfortunately Bib, haven't dug into the effects on calling directly the _Implementation() one, just don't π€£
I don't think it's something worth researching unless you want to know how UHT handles this
one sec
Character::IsLocallyControlled should return true for AI characters on the server right? Even if it's a listen server
looking at the code, it looks like it should
but so far the interesting bit is IsLocalController
that can be found in AController
nice blog @pallid mesa π
thanks π
tho i struggle to imagine there are ppl out there who do not implement correct stateful replication
is this common π€
way more than you can imagine
that's why I did the blog post, at least once or twice everyday around here
the closest i got to grief was a COND_OwnerOnly on a rep var on a pseudo auto proxy with a manual net owner
still wasnt replicating properly to the overriden owner
pseudo auto proxy sounds fun
yeah it wasn't a good time
there are going to be some quality releases blog post soon by the community and for the community
π blessed
we are lucky to be in such a good place with people willing to share
happy to do a collabbb
(jk I know nothing in Unreal)
plz make a guide on how to build dedicated servers somewhere in the cloud without downloading a 200gb source build
XD
isn't it 200gb though?
easily done
data ingress isn't an issue tho
storing the artefacts/pch etc is where they get U
unless you know the tricks
btw, for my (small) mobile board game that i built in unreal, what's a good build size for my server?
the gmae has literally nothing. like 20 rpcs and 10 repvars
you know that by saying this, you are committed now to write an article, right?


noo my dev ops side hustles
am I gonna get a response saying "100mb" now? π¦
tbh I don't think I can ethically publish half of the cloud infra stuff publicly like that
it would kill like 10k jobs in UE
but u should π¦
also, any answer for this ?XD
Why not just buy an external hard drive? You're probably going to need a lot more than 200gb in the long run.
yeah looks like I'll have to
i'm a big believer in smol software π
Epic isn't.
Especially if you plan on using any of the megascans
i will never use any of that
I will build the whole game in Rider, unit test everything, keep my scenes really small, download low poly packs
and ship π
the less I can open unreal editor the better π
btw hard disagree. I don't think you'll be killing any jobs either
Just release an ebook / course under a pseudo name? Nobody will know...
https://gyazo.com/afee331f9bb910711672cd6aa87eed2b
having some trouble with fast array replication, i've done it before but never seen these errors, any ideas?
my fastarray code looks like this:
USTRUCT()
struct FDamagingEventItem : public FFastArraySerializerItem
{
GENERATED_USTRUCT_BODY()
UPROPERTY()
FDamagingEvent DamageEvent;
UPROPERTY()
float Time;
void PostReplicatedAdd(const struct FDamagingEventArray& InArraySerializer);
};
USTRUCT()
struct FDamagingEventArray : public FFastArraySerializer
{
GENERATED_USTRUCT_BODY()
UPROPERTY()
TArray<FDamagingEventItem> Items;
UPROPERTY(NotReplicated)
class UHealthAttributeSet* OwningHealthSet;
UPROPERTY(NotReplicated)
class UDamageAttributeSet* OwningDamageSet;
bool NetDeltaSerialize(FNetDeltaSerializeInfo& DeltaParms)
{
return FFastArraySerializer::FastArrayDeltaSerialize<FDamagingEventItem, FDamagingEventArray>(Items, DeltaParms, *this);
}
void OnAdded(const FDamagingEvent& NewEvent, const float EventTime) const;
};
template<>
struct TStructOpsTypeTraits<FDamagingEventArray> : public TStructOpsTypeTraitsBase2<FDamagingEventArray>
{
enum
{
WithNetDeltaSerializer = true,
};
};
Regarding Networked movement (extending move data) I still kind of don't know what to do exactly.
What do I need to do to get the exact results, as if I used CompressedFlags? I have dodging, sprinting, wallrunning and walljumping, now I want to add climbing and sliding, but how exactly can I save the moves and how do I check for those flags? (like "bClimbingKeyIsDown")
Not even sure, if it actually works or not. Because currently I still use the compressed flags I have.
My event on network error for a timeout never fires. IN fact client side no network events fire when the server goes down.
Hey guys i am having some issues with multiplayer replication on a custom class that ive created. The client can see the server moving around and the server can see the client but the client can't actually move it can only look around but the server doesnt seem to see anything other than the character
Anyone have an idea what this might be? I have overridden the possedby function could that be the issue?:
void ABBCharacter::PossessedBy(AController* NewController)
{
//Server GAS Init
if (AbilitySystemComponent)
{
AbilitySystemComponent->InitAbilityActorInfo(this, this);
AddStartupGameplayAbilities();
}
}
fixed it by adding Super sorry
put 3 backticks ` before and after your code blocks
formats them nicely like this
thats a linker error, generally indicating a missing function body or module include in build.cs
a tiny resized screenshot was definitely the best way to share those errors
it works if you hit the link instead of the pic
fastarrays module is engine, so its not build.cs
and it seems its running linker errors from included NetSerialization.h header
got Networking included in your build.cs?
I highlighted with Gyazo, looks fine in browser.
do I just add "Networking" to public dependency modules? I don't remember having to do that in the past when using fast arrays, is that something my IDE might have done automatically before, or wasn't required before UE5?
IIRC I had to at NetCore to my Build.cs for fastarrays. I'm on 4.27
How would I figure that out, for future reference?
Like how do you know what the name of the module a header is in needs to be, is it the folder name?
you can google the unreal engine API doc
each class has a module listed
but Networking was a guess, as all of them come up as Engine module
did it even work?
Canβt check, at work π¦
How bad of an idea was to write a game for single player to later on decide to convert it into multiplayer? Am I facing nights without sleep or itβs not that bad?
I did that. And I just began from scratch. It was easier... Somewhat.
Especially as I had lots of advanced movement stuff.
It depends on your style of game
For most types of games, converting to multiplayer takes so much work that it is better to do a full restart, which is not necessarily as bad as it sounds
I never made a multiplayer game so i donβt know how to convert my game into one
Is there like a YouTube video or something that covers all of that?
No
It is an entire Discipline
There is a PDF compendium somewhere that someone wrote thatβs pretty good
But Iβm not home right now
the how bad an idea basically depends on how familiar are you with unreal
its best not to tackle unreal basics parallel to unreal networking
I'm having some trouble with multicasting, when the interface event gets called on a client character, the MC print string works fine on all clients and server, but when the interface event gets fired off of the server character, the MC print string only shows the server
Is it possible to do well replicated curve based movement? (Using animation curves to drive players speed and movement)
thats possible only if IsFiring is false
when you call t with server character
Server RPC called on server is just a normal function
other options include this being say, a PlayerController and All players being all 2 players
I thought root motion outside of montages were frowned upon for multiplayer
GameplayTasks work nicely driving that
we have a jetpack skill that uses root motion, predicted movement and uses a float curve to manipulate height
and its smooth
interesting, thank you
i did not write that system though, so i can't give you much in the way of details off the top of my head
Hey so when I push begin play only one of my character's camera works and the other is like under the map
odds are the other controller doesn't even have a pawn, but is instead using a camera from playerstart position
gotcha, it seems pretty undocumented. Doesnt seem worth the effort for a movement system
GAS documentation might have something on it
heres what it looks like
it is a system GAS uses
yeah, that looks like 2nd controller never possessed the pawn
so how can i fix this?
i have no idea what you did, so i really can't tell
ill check it out, thanks
It looks like client 2 is the one thats working and client 1 is not
Thank you for pointing that out. I re-did the test and with still no luck, all the print outputs were on the server and none on the clients. Maybe I'm not understanding the replication correctly?
what class is that in?
So it drops all RPCs
as the multicast is not visible on client player
i missed that
My guess is either not replicated or additionally owned by the server
it would have to be replicated for client shot to work
but servers weapon not relevant to the client
It's called on an actor class spawned in by individual character classes
For server rpcs it has to be owned by that client
For multicast it has to be marked as replicated
Class is indeed marked as replicated
#multiplayer message @thin stratus
is it only relevant to owner?
No
there is an illuminati eye bottom right of the outliner in PIE
switch to client world
and see if both character's weapons are present
So I've a player possessing and attaching to another character. While possessed, if I play anim montage or anim sequence via blueprint, the player get removed from possession and get detached. Is this collision or replication issue?
I get a lot of errors in the client world, and only one weapon is present
try to turn on always relevant on the weapon, to see if its a relevancy issue
Both guns are there, always relevant on the weapon spawns in a third gun on the server
begs the question, how do you spawn the weapon?
hey guys why does my character still replicate even though all replication settings are off
Is that what you meant?
Using seamless transition and I was wondering if anybody knew a good source of knowledge for having everything transition in a good looking fashion to the client.
For example going from my lobby > transition level > actual level to the client looks like lobby, flash of black (transition level), then the next level loads (not everything is loaded in immediately so props may be missing), their camera defaults to 0,0,0 and then they are given a character and it looks good again.
I would rather have stuff like the camera defaulting to an angle of my choice, instead of just 0,0,0. Also having the player only actually spawn in when everybody has finished loading the level etc.
I am not really sure what I am looking for, I tried searching stuff along the lines of changing default camera, and waiting for players to load but I am not really finding much.
Iβm working on building my own client prediction for a pawn that is not a character. Right now, the movement/location of the pawn is marked as replicated, but if I start going down the path of doing client side prediction Iβm guessing I will have to stop replicating the movement and instead handle it manually using the prediction logic so that I prevent rubber banding. Does that sound right?
Turns out I'm just a big idiot and forgot to turn off this π€¦ββοΈ
Thank you for trying to help me out though, sorry
I still have a problem with the image transfer of the object. When the room owner (red hand) picks up the object, the other hands can see it, but when the other hand picks up the item, the room owner cannot. Is there a problem with the object or with the character?https://blueprintue.com/blueprint/gkohxlku/ - https://blueprintue.com/blueprint/_7dl5qvl/ - https://disk.yandex.com.tr/d/fMkX9dyiDFkSlQ
If I have a ball that is my player, its using "add impulse" for movement like the roll a ball template. But going through making it for multiplayer doesn't seem to work for me, The host seems fine but the clients when you hit forward they just rocket off the map at mach 10.
@winged badger from the issue earlier of getting linker errors when trying to use FastArraySerializer, it looks like the module is called "NetCore" and adding it to build.cs fixed the issue, thanks for the help!
I want to ask something related to Unreal engine netcode. Do I need to deploy more than one GameServer to start multiple game sessions? Let there be 100 groups of four people playing independently of each other in my game. They are each in their own world. What kind of deployment model should I consider for such a structure?
one dc server binary per server instance
u can hold many DC servers in the same physical machine
can even do core allocation to constraint cpu usage
I have a sort of "singleton" actor that is spawned immediately when the server/host starts playing (and is also owned by the server), and I want it to also be spawned for all clients that will be joining the game later.
Since it's an integral part of the game/communication I'm currently spawning it in "GameState::HandleBeginPlay" and storing the spawned instance as UPROPERTY(Replicated) AMyActor*.. in the GameState.
However, when other clients connect to the game, this instance does not exist for them.
I'm obviously not well-traversed in the world of replication..
Per now, there's no code running on the clients to actually spawn the actor, but I thought having the variable replicated in the GameState would automagically sort that for me since they all have a copy of the GameState, but it seems not.
Do I need to perform actual GetWorld()->Spawn..-code to spawn the actor for all clients when they connect to the game? If so, what about ownership..?
So when coding my game server, should I code so that it can initiate more than one session?
In this case, I can put a load balancer on it and deploy it more than once.
@static flare you can't guarantee the actor will have replicated by the time you need it, there's no way around that. What you can do is setup an event somewhere that other objects can bind to, and it can push that event when it's received
The same rules are true for any replicated actor. You're not even guaranteed to receive the Game State immediately
not necesarily, that's a high level abstraction you can manage manually
unreal work ends in generating the individual server binaries, anything you do above that is your call
The actor itself needs to be replicated btw
You're replicating a reference to the actor there, not the actor itself
So how would I make the server and clients all get the same actor, when the client doesn't have the actor it references?
replicate the actor and when the actor executes begin play in the client, register it
can do it generic with world subsystemsβ’οΈ if it's inherent to your game
So what is the best practice in this regard?
well it's budget dependent
you can automate server deployment, like AWS does with a high degree of controllability
but so far the first step is to monitor what you need
and to aim for less if possible, as an universal solution
resources cost money
in our amateur-ish project we rented some nitrado servers in different regions
and slapped 5 dc binaries in each, all by hand
we had a person in charge of setting these up and doing some basic mantainance
@twin juniper
You're replicating a pointer to an actor there, not the actor itself. The actor you spawned server-side must be a replicated actor.
But just bear in mind that it will take an arbitrary amount of time for that actor to resolve client-side
I guess each DC binary was managing multiple rooms at this point
According to the power of the server, for example, you can play 1000 rooms with 5dc binary?
Wait a minute, that's too many servers
in our case we had 5 dc binaries per server
and each dc binary handled a 40 player TDM match
by server i mean a physical server PC
Each dc binary is developed to manage more than one match.
Did you consider this while writing the server code? Or is there a way to do this automatically in Unreal?
meaning that if we got 3 pc servers
we got 15 matches
no, as I said, you just generate the dc server binary
put it in the pc server
execute it
and profit
if you want 5 dc servers
u put 5 dc server binaries in the server
execute them and profit
haha
it's simple
so each server PC handled 5 tdm matches
meaning 5 dc server binaries running in the same PC
it's just an executable
a program u run
i understand but how do you make a dc have more than one match
I didn't
It's literally running multiple instances of the engine
You said each dc has 40 match capability
no
40 players match
hahaha
each dc server hosts a 40 players TDM match
not 40 matches x'DD
i mean... u'll have to measure how many rooms u can put in a single dc server binary
so measure, profile, monitor
and constraint it to some resources if you can
Another option is to deploy a container for each room with docker
I can limit ram and cpu usage with Docker
not recommended
I'd use docker to automatize server deployment with a high level abstraction
but one dc server binary for many rooms with limited capacity looks like a nice idea
then when dc server binary is full
deploy another dc server binary
Thanks for help. I got a clear idea in my head
Got someone an idea here? I'm stuck for days now.
Is there any way to synchronously request it immediately?
gotcha
Why does UPROPERTY(Replicated) and UPROPERTY(ReplicatedUsing=...) behave very differently?
I haven't added anything for GetLifetimeReplicatedProps or anything yet, I just spawned an actor and stored it in a UPROPERTY(Replicated), and nothing replicated (I assumed because I'm missing GetLifetimeReplicatedProps..). But then I changed it to ReplicatedUsing=OnRep... and it replicated perfectly..
It has to be replicated in GetLifetimeReplicatedProps()
Otherwise you'll get a warning in the log
AFAIK they shouldn't be any different in that aspect
Yeah I will, I just noticed that it did this and thought it was weird. It's 100% reproducible, but could perhaps still be a race condition of some sort due to the onrep I guess.. Weird.
Well GetLifetimeReplicatedProps() is called once on the class when a new replicator is created
Might just be some weird fluke
or might explain why it's called ReplicatedUsing.. would explain that mystery
Hello, I have a pet that follows the player which is controlled by an AI controller. It works in singleplayer, but now I'm trying to convert it to multiplayer.
I've managed to spawn the pet on each player and I'm starting to see the scope of this multiplayer conversion... I'm basically already stuck and concerned that this pet following system is too complex (I can also possess the pet and fly around) and that it's outside of my capabilities.
Besides watching videos on replication, I have no practical experience with multiplayer implementations. What would you guys recommend me to do? Any advice would be greatly appreciated!
So first of all, the "Pet" has to be a replicated pawn actor spawned server-side. All AI logic etc. should generally only run server-side, clients will just get position/rotation etc. updates about that pawn.
Possessing it is another ball-game. You will need the player to possess the "pet" server-side, then they'll be able to control it. Hopefully you are using the character movement component and if so, all movement etc. should just work. If not, you might want to consider doing so.
If I understand right, the pet is using floatingpawnmovement
The major thing I'm struggling to wrap my head around is which variables and such I'd have to replicate
This is in the thirdpersoncharacter bp and called on begin play. Is this right so far?
Should be fine yep, the pet actor itself should be replicated
The only movement component with any proper multiplayer support is character movement
oh...
You can make it work for others, but realistically it needs to be done in C++. Options in BP are pretty limited
And it is complex to do from scratch, which is why most people just hack character movement until it suits their needs
This is mostly relevant for the possession part right?
Like, if we for the time being ignore the possession system, this wouldn't necessarily be relevant I guess
I'd be fine with just restricting the possession system for now until a future update, but I'd really need the following part to work
If the following part is just AI moving it around that should be fine
It might jitter around a bit, you may want to implement some smoothing somehow
And be sure to test with real-world conditions like lag, jitter and packet loss
Yeah, I'll keep that in mind if I ever get that far lol
I think the setting of the Player REF variable with the get instigator node seems to work, beyond that I'm pretty much clueless
Idk if get controlled pawn works in this workflow, or if I need to replicate the set variables and so on...
Well the problem is that the Pet actor might replicate before the Character to some clients (even the owner), so there's a chance "Instigator" will return null if you do that too early
You can get around this in C++ by using the OnRep callbacks for those properties, but they aren't available in BP
So you may need to replicate your own references to the players' pet, using RepNotifies to set other properties from that etc.
All actors replicate individually and any actor could be received before the other, regardless of how they're spawned etc. The MP code has to be resilient to that to avoid such race conditions
This is generally much more difficult to deal with in BP because you don't have access to the callbacks for existing references
Do most multiplayer projects use c++?
To be honest any reasonable MP project should expect to have to use some C++
BP has only a fraction of the tools available
And that's unlikely to change
Not to say you can't do it, I'm sure some people have managed - but as someone whose only ever really worked on MP, I wouldn't advise it
I haven't looked into C++ and unreal yet, is it a drastic change to a project or can the project be mostly the same as is with some added C++ stuff... idk if that makes sense
Like, if I just have to create a small file and add it (kinda like a bp) then that's okay with me, but I don't know what that looks like in reality
which means Reliable Check Box at Custom Event
Yeah you can add C++ in the background and slowly replace BP parts for sure
Generally though if you're going to do MP, it's worth starting with it from the get-go. Getting things working step-by-step. Generally more work to convert a SP project over because you end up throwing a lot out
Means it's guaranteed to be received.
anything more? some example
That's all it means
when is it best to use it?
When the RPC has to be received for the game to function
So it depends on what you're doing with it. Firing a weapon? Probably needs to be reliable. Spawning an effect? Can probably be unreliable.
aaa, I understand ;p thanks
Just don't call reliables from tick or something like that
Apart from being more expensive generally, you can flood it and the client will get kicked.
Yeah, I spent the last few weeks cleaning up my project to the point where it's a very clean (for my skill level atleast) 1.0 singleplayer version that I can build up on. Currently I have only two major features and the pet is one of those.
I plan on adding quite a few basic rpg systems, like fighting enemies, loot, inventory and stuff like that, but I first wanted to create a clean foundation to work off of. Which is why I'm trying to convert everything to multiplayer compatible now, before I start working on the rpg elements. Hope that makes sense...
Yep for sure
I really hope that I'm not setting myself up for failure with this, considering that I'm a solo dev and even singleplayer systems are anything but trivial to implement for me lol
I'm looking for someone who can easily tell me the most important rules related to this π
when it comes to calculations, health, stamina or some important variables, this must be done on the server and then sent to the clients
and I don't really know how to do it properly
or when I create a timer that subtracts some health from time to time, this timer must also be made on the server, I guess
when it comes to variables and changing their values ββon the server, it is probably enough that after Event Run On Server I will do Call to Event Multicast?
but when it comes to something that is visible to other players, such as Sprint, in order for it to work properly on the client, without any lags, then need to be done also local?
I don't know if I mean it right, could you explain it better to me, or write if I understand correctly?
MP is absolutely a lot more difficult. Probably 5-10x the raw amount of time/work required, the major difficulties come from understanding how it really works and being able to design for it/problem solve. If it's your first game or something, I'd stick to single player
Any stateful changes e.g "Health" should be replicated properties. Events are for one-off events only that don't make persistent changes.
As for sprint, realistically it's only possible to do it properly in C++.
You can fudge it in BP, but it's not flawless
There are probably a plethora of tuts out there to hack together an MP sprint in BP
I'm learning and would like to know what to avoid in multiplayer games
and how to do it correctly
Check the pins in this channel
If you want one golden rule, it's this:
- State = Replicated Properties
- One-Shot Events = RPCs (Custom Events in BP)
The thing is, I'm committed to this particular project long term and even if I ignore the whole rpg side of things, multiplayer still feels like something I'll have to do eventually.
In it's most basic form, this project is a virtual art museum with a heavy focus on community. I plan on hosting events and stuff like that within it. They could be singleplayer, but multiplayer would allow to build a much tighter community.
So, I'm in a weird spot... Either I take the dive now while I still only have a few systems to convert, or screw myself in the future. Idk, I'm really torn on it.
It's better to build your project as multiplayer from the beginning and it ends up single player than the other way around.
Almost every game in this age ends up having multiplayer elements which can be a pain to hack on when the game is fully fleshed out as single player.
Why do you say this? Iβve done sprint systems in BP without issue; but maybe Iβve overlooked something?
Makes sense, but practically speaking, if you have zero gamedev experience it's already hard as hell to implement singleplayer systems properly. So starting with multiplayer, ups the barrier of entry right away to a very unreachable level for most. Atleast that's my experience of it.
Which is why I setup my museum in a very static way, where I only built the things that would work in either singleplayer or multiplayer, like displaying statues/paintings and such. So, the core of it is fine either way. The difficult thing now is starting the process of learning multiplayer implementations with the few things that are busted, like the pet system that I have.
That system was the most recent thing I implemented and I had to first see if I can even pull it off in singleplayer.
Now I'm at the point where I have to start working on more complex systems that wouldn't work in singleplayer and multiplayer right away, so this is the point where I have to dive in. Hope that explains why I haven't done any multiplayer stuff yet.
I think the issue is as soon as ping and package loss gets introduced the blueprint solution falls apart.
I work with a 500 ping and never got sprinting in blueprints to work properly.
yes, blueprint doesn't have any tools to recover from packet loss or high variance
True, I understand your perspective. It's going to take time but it'll be worth it.
Unless you have the bucks to spare for a multiplayer programmer
literally only networking tools you have is blueprints are:
1 - RPCs
2 - Marking variable replicated, OnRep is also a nasty hack (property changed, not replication callback)
3 - basic replication settings on the Actor
4 - dormancy
which is less then 10% of stuff available in c++
It is. But it's still somewhat fun. Until you reach the point where art assets are needed and you don't want to create some kind of shovelware.
Or you get stuck because UE documentation lacks a lot at more niche parts.
Replication graph
thatr works without c++?
Oh blueprints π
I gave up on any serious multiplayer there
Works great mind you, but I do more c++
Someone knows what to override in the Serialize() and ClientFillNetworkMoveData() functions?
That section is so cryptic... Like there is no example project using that at all.
https://docs.unrealengine.com/5.0/en-US/API/Runtime/Engine/GameFramework/FCharacterNetworkMoveData/
You need to build it into the character movement rewind/reconcile system to do it 100%
That can only be done in CPP
BP will usually get you by well enough though
But if it was a competitive game or something, BP wouldn't cut the mustard
Hey guys, I've setup a 'Set Overhead Nametag from Main Menu' System. Currently the host can type their name in a textbox from the Main Menu, hit start server and it'll load the level and be displayed correctly clients side. However when another player types in their name and hits joins server it overwrites the hosts 'Player Name' with their own text and both the host and client can only themselves as the most recent set 'Player Name' while the other players are unset (which is a replication issue?). Do I use an integer to differentiate the players by hooking it into the Save Game Slot & Load Game Slot nodes to make them unique?
Image 1. Main Menu Widget Button Gets Text Input and sets 'Player Name' (saved within a SaveGameObject)
Image 2. Level runs 'Set Player Name' function which runs a custom event (PlayerState)..
Image 3. Custom event makes the 'Player Name' variable RepNoteworthy, then (Loads the Saved Variable)
Did anyone buy a Multiplayer Template on Marketplace?
I'm thinking of buying one, cause no matter what I try, nothing works. (v4.27.2)
PlayerName needs to be set once, never use a Reliable RPC on Tick
Yeah I need to remove that
aside from being able to clog the reliable buffer, reliable serves no purpose whatsoever when sent on Tick
because if it was unreliable, it would just keep resending data before the client had any idea reliable RPC failed and had to be resent
second point, GetPlayerPawn/Controller/Character[0] is generally dangerous in MP
problem being that the index 0 is interpreted differently on different machines
Yeah I know that you're not meant to do that, I just needed to fill the node for it to work
As for differentiating players
simplest working version of this
PlayerState -> BeginPlay -> if (Cast GetOwner to PlayerController IsLocalController) -> Load Save -> Send ServerSetPlayerName RPC with name as argument
then display the name in pawn's playerstate for each of the pawns separately
im not sure if PlayerState can set PlayerName in BP on whatever engine version you're using
but GameMode has a function to rename players
Alright i just have a question, it goes through the hasauthority() but doesnt spawn particles and replicate them to all the clients?
no, owner of the PlayerState is the PlayerController, not PlayerPawn
that cast will always fail
sorry haha I'm new to all of this
also, you're creating widgets on server only
which is a fail
also, this is not normal BeginPlay
executes on Server doesn't belong there
Theres really no need to make ui on the server
Yeah I created a custom event instead because I figured they also fire off on beginplay aswell
Any suggestions on how I can listen to my players joining my Lobby level? Right now in OnPostLogin and OnLogout events, I add to a replicated Controllers list in my GameState. in the OnRep I do my required UI changes. Any better suggestions?
anyone? π
It goes through the HasAuthority() but none of the MuzzleFX or FireSound and Animation replicates, Please help!
Well, All the other clients should hear the gun and also see the muzzleflash
- My self should also see it, Since rn i dont
ahhh
Extract all the VFX and SFX stuff into a multicast function.
π
Hey! I wanna make a hot potato styled game, and but i don't know how to check if the bomb hit another player, and if the bomb does, how do I know who threw it?
or I know how the other player equips it, but don't know how to make the player who threw it loose it's tag
Any idea how I should approach this? I'm trying to figure out what needs to be done. I'd appreciate it if someone could help me here.
Have you checked the source for the original implementations of those functions?
Or they don't have any?
Send over a character/pawn/actor reference on interact
That way the door knows what's doing the interacting.
Then you can choose which direction to open.
what's the state of chaos vehicles in multiplayer?
Chaotic?
anyone?
The thing is, I don't understand what I need to change at all. What do I need to add in those functions to get the flags from my derived classes? The source didn't help me with understanding what I need to change. And there are no examples which extend the move data.
Either because no one needed to do that, no one understood what do or no one was willing to make some example project.
If I had any idea what exactly I'd need to do to make it work, I'd actually do some kind of documentation about it, so I can use it later again.
Why are you starting with multiplayer if you don't know how to detect a collision?
x'D aren't they used in FN?
Ah.. I see. That's unfortunate then.
I'll take a look later and see if I can figure something out
Thanks. That'd be awesome.
I know how to detect collision, but Idk how check who passed on the bomb, to make that player loose the tag
Have a LastHolder variable on the bomb
yeah but do I get display name? or id? and if so how do I get the Player ID¨?
Who has the tag, the player or their character?
Why are you using tags? The bomb can just know who's holding it
I think I'll just pass the bomb on with a line trace, since having the player throw the bomb and other people getting hit by it and all that jazz just over complicates stuff
Okay, that has nothing to do with what you're asking about though.
no ik, but I thnk I'll change the way they pass the bomb
since having the bomb being thrown is way harder (atleast for me) to make
If I want an event to only happen when everybody has finished loading with seamless transition, am I supposed to hold them in the transition level until the next level has finished loading, or do I just add a loading screen to the actual level?
With seamless transition they get a frame of black (transition level), then they see the actual level as it is loading in objects. I would rather hold them in a loading screen while all players load and then have the actual level run
They do which, hold players in the transition level while loading, or have a loading screen in the actual level while players load?
not totally sure which technique is employed but the loading screen keeps active until a series of rules are accomplished
I recommend you to look right away
I see, do you know where in particular to look? I assume the gamemode or something? The lyra project is very bulky and I am new to UE
ouch... just removed lyra from my computer, would do a fast exploration to point you were to look
but I have to download it yet again
π¬
I will just download it and have a look around and see if I can find it. Thanks for the help
Anyone know how to validate a fire rate on the server with variable network latency?
with approximate accuracy i'd say
Wouldn't that allow room for hacking
it doesn't matter if you catch the cheater on the first attempt
as long as you catch him
So like a batch check?
Record the shot times, and when they start and stop firing
Then calculate if its off?
you can just record last, say 10 shots
and then randomly check that time between first and last is not significantly less then 10x the delay between shots for that weapon
True, that should work well
it doesn't matter if you catch them on their 50th try, the inevitability of getting caught is what ultimately makes them not use that cheat
depends on the game
and how confident are you you won't catch a false positive
which is the other side of the coin here
Yup
That's what I am worried about
But I guess I could do the check multiple times
And flag the person/ something
and i'd check client, not server timestamps when shots were fired
which i'd send along with the firing package
So if they send an incorrect time stamp, then server side rewind wouldn't give the shot?
you can still get a temporary dropout in connection and have 6 reliable RPCs get resent together
Makes sense
client timestamps are for your rate of fire validation
With projectile weapons it would be a bit harder I'd say
They could maybe send like -10 for the timestamp, then up to 0
While they shoot
But I guess I could validate that as well
Maybe
honestly if you just release without that teleport random enemy right infront of your muzzle whenever you fire hack working
you'll be fine patching things afterwards
i do know few people who released with it,and still ended up ok
Sounds good, Ok, ill go try that
that happens when there is no positional validation for the shot on server
hack just grabs a random enemy (or less then random), teleports their pawn locally in a way that their head is right in the bullet's path
then reports a killshot to server
That won't work in my game
I validate the shot location from the latest camera location
On the server only
So I don't think that could work
camera location pulled from where?
Saved in the server side rewind component
As well as just the servers version of the camera location
since i can just send you ServerUpdateCamera RPC prior to this and you're fucked still
No it doesn't work like that, I record the position on the server only
So there is no RPC
Only the CMC updates the character location, then in turn the camera location
that location is coincidentally also the center for your relevancy calculations
But I can still fix that, by just using an offset from the players location
Since its a first person shooter
Thanks for bringing it up
Ill try to disable bUseClientSideCameraUpdates, dunno if that will cause lag tho
There is no way to do that kinda thing with the characters location right?
camera is attached to a weapon socket, yes?
in that case you would just need to additionally verify that camera is close to the weapon as not to have been teleported halfway across the map
Wait wtf, camera stuff is replicated to server? TIL, and I've messed with Unreal for 8 years.
/** If PlayerCamera.bUseClientSideCameraUpdates is set, client will replicate camera positions to the server. */
// @TODO - combine pitch/yaw into one int, maybe also send location compressed
UFUNCTION(unreliable, server, WithValidation)
void ServerUpdateCamera(FVector_NetQuantize CamLoc, int32 CamPitchAndYaw);```
in APlayerController
i think yes
or at least mostly relevancy
if you have a separately controllable camera relevancy adjusts to what you're looking at
how do I detect if a player joins a match for the first time?
specifically for the first time ever
Hello, I'm using the network Profile to see how my game is going and a doubt arose, there are actors who have a very high waste of 100 and I don't know if this is good, if so, I could lower it considering that it is the worldsettings, playerController and playerstate
Save games probably.
Especially if you want it to survive a reboot
no way around that via blueprints?
This is for a mod project i'm working on, and I can't access the save games I believe
Can you make your own savegame? It's just a file wrapping a struct you can save on disk. Like how minecraft has a file per world and a file per player etc.
You sure it doesn't already exist?
If you can make your own additional ones just make one with an array of all player IDs who've joined OR make one per player if you need to store other data like location and inventory or whatever.
hmmm the project basically gets packed at the end and I have to upload it on mod.io, where I can use the mod ID in my online server to load the mod in. No clue if it would actually find my save games folders
will have to look into save games then, actually no clue how that even works to begin with ahahhaha
sooo something like this on event begin play?
First check to see if the save exists
That's your check to see if they've ever joined before
aaah how do I do that exactly?
Slot name
that should be what's unique
use the play fab name or whatever
but prolly need to do some investigation to see what is already being done. I bet they already have a save per player
In Minecraft you would have a file called Mano.dat or whatever. That's the save file for Mano
if Mano.dat doesn't exist and Mano is logging in, then they've never been on the server before
Hmmm I couldn't find any other save game objects in the unreal files
so basically something like this?
Read up on save games. That would probably work for creating the save (assuming Mordhau isn't already doing that and now you just nuked the stock save file).
You want to check if the save exists first.
I think Iβm be able todo the bomb throwing now actually
Is there somewhere I can read more about the c++ options? Iβve done lots of tutorials about multiplayer, and I e not heard much about what extra stuff is available?
[2022.05.26-22.21.47:859][701]LogNet: Join succeeded: AAA
[2022.05.26-22.21.56:854][874]LogNet: UNetConnection::Cleanup: Closing open connection. [UNetConnection] RemoteAddr: XX.XX.51.168:64189, Name: IpConnection_2147459359, Driver: GameNetDriver IpNetDriver_2147482482, IsServer: YES, PC: BP_PlayerController_C_2147458680, Owner: BP_PlayerController_C_2147458680, UniqueId: NULL:ATXD-1E779E5C4ECE5914B86174B684EFC73D
[2022.05.26-22.21.56:854][874]LogNet: UNetConnection::Close: [UNetConnection] RemoteAddr: 26.88.51.168:64189, Name: IpConnection_2147459359, Driver: GameNetDriver IpNetDriver_2147482482, IsServer: YES, PC: BP_PlayerController_C_2147458680, Owner: BP_PlayerController_C_2147458680, UniqueId: NULL:ATXD-1E779E5C4ECE5914B86174B684EFC73D, Channels: 19, Time: 2022.05.26-22.21.56
[2022.05.26-22.21.56:855][874]LogNet: UNetConnection::Close: CloseReason:
[2022.05.26-22.21.56:855][874]LogNet: - Result=Cleanup, ErrorContext="Cleanup"
[2022.05.26-22.21.56:856][874]LogNet: UChannel::Close: Sending CloseBunch. ChIndex == 0. Name: [UChannel] ChIndex: 0, Closing: 0 [UNetConnection] RemoteAddr: 26.88.51.168:64189, Name: IpConnection_2147459359, Driver: GameNetDriver IpNetDriver_2147482482, IsServer: YES, PC: BP_PlayerController_C_2147458680, Owner: BP_PlayerController_C_2147458680, UniqueId: NULL:ATXD-1E779E5C4ECE5914B86174B684EFC73D
[2022.05.26-22.21.56:858][874]LogOnlineSession: Warning: OSS: No game present to leave for session (GameSession)
Do you guys know what close reason Result=Cleanup, ErrorContext="Cleanup" means ?
Does a listen server count as being an empty server if no other clients have connected to it? I ask because typically the listen server includes itself as part of the player count.
Listen server has a player visualization so it should count as 1
Dive through the source code
So you can't really search for an empty listen server
it will never be empty
it will always have itself at least
Right
While there should be at least 1 player(the host), you can tell other clients that want to join that this server is empty(has 0 visitors), but I don't know why would someone want to do that
if you were thinking of using empty listen servers as dedicated ones - i really wouldn't
i am now aware of any place that has a summary for that, but c++ can:
1 - use Replication Graphs
2 - use Push Model, however little that helps
3 - use custom Net(Delta)Serialization for types
4 - use FFastArraySerializers, which are pure awesome
5 - has proper replication callbacks, including OnRep function overload that has pre-replication value as an argument
6 - has far more fine control over replication conditions, like it can fire OnReps even if the value is unchanged if told to do so
7 - it can actually manipulate structs, among other things allowing you to replicate only some of struct members
8 - override a ton of very handy virtual functions that were never exposed to blueprints (like AController::SetPawn or OnRep_PlayerState
9 - it can replicate UObjects that are not Actors or ActorComponents
10 - it can even spawn an Actor separately on server and client and replicate it after the fact
in addition c++ has more fine control over literally every aspect of Unreal
Can't the Push Model be used using BP only?
I thought it's as easy as to turn on that flag in the config file
how? you don't have access to FDoRepLifetimeParams
I see, good point
I think you need to turn on this flag for that in the config file
so you can do all or none?
Yep
no fine control there π¦
If you enable that cvar, bp props set the params when they're registered
Eh tbh there's literally no drawback
It automatically marks em dirty if you call the Set node
i had some issues with struct members not working with push model properly
it wasn't if i don't set the struct member itself, but instead set one of its members and mark the struct property dirty
i did not have time to explore why at the time, so i just turned push model off for affected 2 structs
Ay
Could be operator== maybe
I think it still checks for changes although I'm not sure
Maybe I'm confusing it with the changelist
but also, push model just helps a little, its my least favorite thing on that list
fastarrays being #1
I like the fine grain control of telling the engine when to replicate a prop
Makes me feel in control in an otherwise chaotic engine

Haha also when you have too many players
i replicate a majority of my Actors by turning their replication off and having few manager actors with fastarrays do replication work for few hundred actors each
I think the Push Model was just an attempt by Epic to improve perf, but overall, not much difference
my NetworkManagers have 8 fastarrays
Unless your operator== costs 5 ms
one handles interaction, other damage/death, then one for buffs, one for gameplay tags...
Neato
so more complex actors have several functions they need to call when updated on server
but all in all, its far more responsive then any vanilla solution
if the player initiates a thing that changes an actors skelemesh.. does that get replicated as part of the actor?
that's just wishful thinking isn't it
it doesnt
skeletal mesh components are not replicated by default and generally replicating them causes more problems then it solves
you replicate the change inside the actor and use onrep to adjust clients
Hey guys does amazon aws gamelift sdk work in UE5? I couldnt find any info online π
How would RPCs normally be handled where the player could potentially spam them? For example in csgo you can bind the mouse wheel the select the last weapon you had, then just scroll the mouse wheel to flip between your weapons quick which, in my case, would send an RPC each switch
rate limit
I thought that was a client setting. It's different from tick rate right?
ye
So is there any solution yet for the steam session region lock? We are making a coop game and we want everyone around the world to be able to play together. And yeah i know changing download region in Steam fixes the issue, but we can't expect our customers to change their download region to be able to play with their friends, that's a bit ridiculous. If you pay for a game that is advertised as coop it should just work. We don't want players to have to fiddle with region settings and stuff. I was wondering if EOS subsystem has the same issue?
Found this interesting post online, but sadly no info on how to use these filters. https://gyazo.com/dcbfc05d1949336bf6ce371d35bf285f We are using advanced steam sessions and sadly I don't see any option to change server fetching filters / method. How would we be able to use these filters?
holy smokes I ran into that issue with a game I bought and I was like "holy smokes that's utterly ridiculous, who could possibly have borked that up so bad"
So it's unreal causing it lol?
Sounds more like a bad plugin limitation. We have settings that allow distances. But they're easily accessible in C++.
You can't without making changes to the online subsystem implementation or making the queries yourself, but either way that won't solve a region lock filter being imposed by Steam.
Don't think we've had any issue with region locks though, but we are on dedicated servers. Lobbies work very differently
If you want to make the Lobby filter worldwide, you can edit FOnlineAsyncTaskSteamFindLobbiesBase::CreateQuery() and change the distance flter to worldwide
SteamMatchmakingPtr->AddRequestLobbyListDistanceFilter(k_ELobbyDistanceFilterWorldwide);
But obviously there's very good reason you don't do this by default...
k_ELobbyDistanceFilterDefault, // only lobbies in the same region or near by regions
k_ELobbyDistanceFilterFar, // for games that don't have many latency requirements, will return lobbies about half-way around the globe
k_ELobbyDistanceFilterWorldwide, // no filtering, will match lobbies as far as India to NY (not recommended, expect multiple seconds of latency between the clients)```
Thanks for the information. I'll research this. π
Hey. Anyone facing issue with the vehicle template in ue5? The speed of the car in client doesnt go above 50km/hr. But the standalone or listen server speed is fine.
hello bro I have same error as u had did u solve it ? please hit me up with a message....
HI, where is the best location to make atimer which is counted on server and shares the time with the clients?
Is there a way to estimate the maximum player capacity of a game server?
Maybe you could test with 10, 20 and 30 players or whatever are your capabilities and then extrapolate from that data? That should give you some rough estimation
In CS:GO's case the Source Engine sends client inputs to the server for processing, so it's part of it and won't cause any spam. In your instance, yeah just ratelimit.
After pressing the play button, is it possible to add another client afterwards? I want to see if this system I'm working on works when someone new joins the server.
you need to enable join in progress in editor preferences @lone steeple
then you get add client button next to play/stop
Oh wow, that's convenient! Thanks π
Do you have your own app id? I thought region lock was removed once you have the app id in place
Should i work on multiplayer from the get go when i start building a game, or can i just work on converting it into a multiplayer game later on?
I know nothing of multiplayer except some tutorials i saw, so i just have a general picture of it, and know that you need to replicate βοΈ . So for now im making my game single player, but its intended to be full multiplayer asap. Should i start doing it now, or i can leave this for last?
I would start working on it from the beginning. Because converting it can be a pain.
hi, it is the first time that I use the network profile and I see that my main actor and the world has a "waste" of 100, is this bad?
I have a teleport button that I can interact with which teleports the player. Works fine in singleplayer but I need to convert it to multiplayer.
The screenshot is within the teleport button bp and specifically in the interact interface function. Could someone help me out?
@lone steeple You can try using the game state player array to get the list of players and teleport them (must run it on the server). something like this:
Interesting but I need just the player that pressed the button to be teleported
Okay, just tell the server to teleport them. You could use an RPC on your controller class
I don't think I get it lol
You'll never get this to work as you can only send RPCs (The "Replicated to Server" event) if the client is the owner of the actor, which I'm guessing wouldn't be the case here....
Normally you'd want to do something like:
Character Interact Input > RPC "Replicated To Server" event, passing along the actor the player is attempting to interact with (you can add inputs to events which will allow you to do this) > Server Validates if the interaction is valid (ie. player is in range of actor requesting to be interacted with) > Pass to the actor to perform the interaction required (normally VIA an interface call)
So what's the basics of your setup? It smells kinda ECS-ish. You have a network manager per domain that's syncing all Buffs or stats or whatever cluster of data for many actors right?
its not ECSish
it just simplifies the code
as each fastarrayitem needs to be able to handle postreplicatedadd/change
and its simpler keeping them to 1 responsibility per fastarray
but yeah, the general idea is one actor replicates few hundred others
Good point. @lone steeple your controller class is replicated, so if the teleport actor you have there could tell the interactor's controller (client side) to send an RPC, then the server can teleport them with something like this (in the controller class):
Yeah, but then I'd have all the different interact functionality in the controller again, rather than in the individual actor's interfaces.
Like this??
I'm so lost
Well, you'll have to pass the input to the server at some point, so you might as well follow @sinful tree's outline and use an RPC with the input, then forward it to the actor interface for everything else
If I had an ability that spawns jumppads on the server, could they launch players and would it be replicated or would I need to find a way to make it work for multiplayer?
That looks about right. The input triggers the RPC on the controller, which then talks to the interactable actor server side
Seems to be working! What an interesting workflow
Nice!
Yeah, I just need to set the rotation now somehow π
Attempted to send bunch exceeding max allowed size. BunchSize=78542, MaximumSize=65536
Seem we have limitation to send a string data(json) length up to 65536 bytes? 
Yes, and realistically you don't want to be anywhere near that limit
Replication is built for small, fast packets - not data transfer
Well, what would you suggest to get that data? prolly custom TCP or web communication?
A custom UDP socket probably
Dont think UDP can reliable to get correct data
far away cuz of packet loss and MTU partition
All UE networking is UDP but it has it's own system for ensuring reliability
All assuming this is just a one-off transfer
Another option is you chunk it, and send it in chunks via RPCs
And you wait for the ack that the last chunk has been received before sending next one
But this is something you'd want to avoid for general gameplay ofc, but is probably okay when initialising or something
ye just want to data once time at lobby
alright do you know there is ideas to make chunks with blueprint or C++?
I don't know of one, but it's not too hard in theory
Just split the data into chunks of bytes, and ping-pong RPC's from Server->Client until it's all sent
Well just asked if theres ready idea would be time save for me but i will think about this. Thank you very much!
yeah not sure of anything off the top of my head
I don't understand why this doesn't set the rotation of the interactor/player. Could someone help me out?
Why can I set the location just fine, but can't set the rotation? Doesn't quite make sense to me.
Same problem but reversed... You can't run a Run On Client RPC when the client doesn't own the actor (again the BP_TP-Hub is the actor in question)
Similarly, you don't need to run a "Run On Server" event for the "Set Rotation Server" event, as at that point you should already be running on the server.
Interact > Run On Server > Interact Interface to Target Actor > Do whatever needs to be done on the server.
If you need to go back to the player controller that triggered it, then you'd have to be sure to utilize the interactor reference you're passing through your interface already allowing you to go back to the player controller, then doing your Run On Owning Client event there.
So there's no way to to just have everything in the actor bp that I'm interacting with, like in singleplayer
Sure you could... For example, you can have a replicated "with notify" vector variable on your player controller. Whenever you want to force the client's rotation to update, you can set that value on the server from anywhere, so long as you have a reference to the player controller you want to update.
Then on the OnRep function, you use the variable and set the control rotation using the node you're trying to use.
This would require additional setup in the controller for each specific interaction. As far as I know, this isn't necessarily required for singleplayer, since you can do pretty much everything within the actor you are interacting with. If that's one of those multiplayer quirks, that's fine with me, just trying to understand it better.
No it wouldn't.
You have a reference to the player controller currently. Your "Generic Interact" function can be used to set a value on the player controller as you're passing the reference to it through the interface. That means you can set a value in that player controller on the server and have the client respond to that change.
A generic interaction interface is what you've set up, which means that the actor being interacted with can respond to the interaction however they want to. It's just a matter of getting any thing that changes back to the client and you only have two options for that, either an RPC or through replicated variables, and if you want, a client can react to a replicated variable if it's set w/notify.
Interact > Run On Server (passing a reference to the actor the client intends to interact with) > Interact Interface (target is the actor the client passed through, and yes, you can pass through the interacting player controller) > Target Actor does what it needs to do such as change variables, call functions, etc. any of which can be used just as you would in single player with the caveat that it's run on server only, so you need to utilize appropriate replicated variables and call Run On Client RPCs (on actors owned by the client) if necessary.
I want to make a projectile simulator subsystem that only runs on server.
Unfortunately, I don't think that would work properly because of subsystem replication issues.
I tried creating the subsystem only on server but it doesn't seem to work. It creates on client and even one more place that I can't determine.
I'm guessing I'd have to use a manager actor instead?
It's inheriting the FTickableGameObject btw, for ticking the simulation.
My brain is pretty fried right now, but how do I set which Run on client event needs to be triggered after interacting?
This works, but obviously isn't a good setup
That's definitely one way to go about it, and what's nice about it, is that it keeps the code decoupled.
As far as what I was thinking it's more that you utilize the "Interactor" reference within the interface function and you can use it to call something like the "ClientsideChanges" event you have there.
Do I have to use an event dispatcher for something like that?
Ok, this is probably stupid, but couldn't I technically have an interface specifically for clientside changes, with multiple functions for each particular change.
Event dispatchers are usually useful if you need to wait for an event to happen, or if you need multiple things listening to something.
In terms of replication and passing around for a single operation, it's usually not necessary.
Generally speaking, yes, you'd need functions or events for any different change that needs to happen. Here's an example of using a second interface to go back to the player controller. This too would keep the code decoupled.
Um i tried something about chunking strings, but "get substring" is broken or what? i want to get string between 5 and 6 it gets up to 5 whole string..?
the code
do you have any idea Jambax?
That second interface is implemented in the playercontroller right?
huh interesting. Thought that my idea with that would be dumb
Is it really necessary to send the JSON to the client? I mean, is it not possible to perhaps break it down into variables at that point? In a structure of some kind? I know not always possible but... may be a better solution if you can.
it has name, status, and profile icon code, and some other datas inside that json
what i can use for it else json
(doing friend list interface btw)
So however you'd be consuming the JSON on the client side, do it on the server instead and create a structure that can hold the data that is necessary to be replicated to clients (ie. the data that each friend has), then replicate an array of that structure.
JSON has a lot of extra unnecessary stuff in it, like the brackets, quotes, even the field names.
Not sure how many you can send at once, but it'd probably be easier to page out a certain number of friends then trying to chunk the strings.
umm making 110k structure array
110k friends?
hook net insights when you do and provide some data pls
But again... Still would probably be smarter to page out an array response from the server.... Eg client asks for friends starting at position 0, server reads friends from 0-50 and sends those in the array back. Client when necessary can request more when it reaches the bottom of the list, then requesting friends starting at position 50, etc.
so paging system
i see
just wondering, isnt Structure data has more bytes than json?
same form id name status etc with json and structure
thought sending String more cheaper o.O
lets call 1k peoples inside in array
depends turns into a no
for almost all use cases
let's use a simple char array as our use case...
each char array element -> 8 bit
ie: encode an int8 number -> 64
int8 encoding 8 bits.
char encoding 16 bits.
its dependent on the nature of the data
well mostly using strings(char) so there is no int or either float
same char at json and structure
if all you are sending are strings that can be easily tokenized
you can encode it and decode it using an extra 8 bit char per token
it'd be a matter to see if its worth given your use case
u mean combine others in to one with parse in to array?
it's just a bit of a PITA to recode it back
So I'm trying to use anim notifies to enable and disable collisions for hitboxes, but I'm not sure how notifies and notify states work in regards to replication
name,online,battleground,profileicon1
then parsing that text with get array 0,1,2,3
no just data table name
ah oki hehe
its 0-100 id
good good.
yes?
sending through string more cheaper than structure itself guess? 
alright
but, use the profiler
don't trust a random in the interwebs
I'm using background knowledge, haven't tested it
maybe we get surprised
will test through limits 
perfect, and again, I'm interested in data
whatever you find, if you can share it, it'd be awesome!
π
(still worried about "get substring" works well or made mistake on somewhere)
You guys got any knowledge on how to handle animation notifies/notify states in multiplayer?
if animation played on everyone, the notifies fires on played clients
if you want to fire that notifies only on server, use authority or is dedicated server bool branch
Well, I'm trying to use notifies to switch colliders on and off for attacks but I suppose that doesn't sound like the best way to go about handling collisions then
well there is always latency so this possible. maybe switches collision first on server then your client
@sinful tree Sorry for pinging you! For whatever reason, the first teleport works, but any afterwards don't change the rotation anymore. Any idea why?
On the server it's fine, but on each client it only works once
This is so confusing
Anyone know why the client only changes the rotation only the first time I interact with this actor? Any time after the first interaction, I still get teleported, but my client doesn't change the rotation anymore. This is genuinely confusing to me π΅
Could it be because the rep notify doesnt trigger because the value doesn't change?
Repnotifies only fire when the value is changed on the server and is actually different from the version clients already have. For example if a bool is false and server sets it to false, repnotify wont fire on clients because the value hasn't changed.
If the desired control rotation doesn't change after the first time it was set client won't have it's notify event fire and thus no code inside the notify will fire
Just needs a small change... Instead of using a replicated variable use an RPC.
Wait, why does it execute on server again?
My bad... meant to do run on client.
Oh okay, well atleast I caught that which means I somewhat understand what's going on lol
but that seems to have fixed it!
That's really interesting and probably why it didn't work! Thank you for explaining that π
And thank you Datura as well ofc! Wouldn't have figured it out on my own that's for sure!
A repnotify is for when you want something to change when a value is changed on the server and you want clients to update something based on said value. Great for when a value is changed when a client isn't even around (outside relevance range or not connected yet). When client connect or comes withing range the value will replicate and client can do with it what it needs to do using the repnotify event.
RPCs (multicasts) are for when you want stuff to happen right away and only once. If clients that aren't around have missed it, too bad for them it has happened and won't happen again. Great for replicating effects such as particles or sounds or whatever.
Like you dont want to spawn sounds or particles or any cosmetic stuff on repnotify because then clients will get random effects when they come within range or when they connect.
Ohh I see, makes sense I guess!
Hey, what's up for everyone, i'm have some problems with replicate some morphtargets, i'm using de OVR lipsync and the Ready Plyer Me, but when i try to replicate all the visemes animations of the mouth, the other player can't see anything... i lost much time on this and i need to put this in a multiplayer game, i need your help! I will send and image with my BPs, to show what i'm doing, showing the begin play, the logic of OVR lipSync, and in left, the replication of the two custom events. To understand what is occuring, when i talk, with other people in VR, to me show the 2 character moving the mouth in same time and in the same way, like the two characters are controlled by me, but for the other people nothing happens.
Hey, how can I remove the local player from the PlayerArray in GameState? And how would I make that work for both dedicated server and P2P architectures?
There is a function that is called that adds playerstates to the array. Just override it and don't do it if PlayerState->GetOwner() == GetLocalController()
Can't really say anything about P2P. P2P doesn't exist in Unreal by default.
Can I not call set view target on a remote player controller from the server?
This is my gamemode blueprint, I transition to this gamemode seamlessly from the lobby gamemode.
I want players to immediately have their camera set to a cinematic camera (on a rail) that plays the intro sequence. Then they are spawned in and can play.
So I tried handling the new player by setting their view target with blend and after a 3 second delay (for intro) it would run the parent function to actually spawn them.
There are a few issues though, only the first player controller sees the cinematic camera, any player being handled after this refuses to run the node and just has the camera sit at the player start.
As well as this only the last player to be handled actually spawns in, I assume this is to do with the delay because other players are being handled before the delay finishes and calls the parent function, so it never gets called. Unsure of the proper way to handle this as well.
Hrm, I have tried working around it by having an event within the player controller to set the view target, and just calling that event from the gamemode. However that also has the same issues
GameMode is ServerOnly
ViewTarget is a Client Concept
You get nothing by setting the ViewTarget of a Client on the Server
The Client has to call the function locally
Place it into BeginPlay or so with IsLocalPlayerController check
Or use the PlayerCameraManager and return the custom camera transform if some condition is given
I see, is calling the function on the player controller not client side though?
I moved this functionality over to my custom player controller and it still doesn't work for clients
No
