#multiplayer
1 messages ยท Page 564 of 1
GameName=GameName
Port=7777
[OnlineSubsystemSteam]
bEnabled=True
SteamDevAppId=480
bVACEnabled=True
SteamAppId=480
bUseSteamNetworking=false
[/Script/OnlineSubsystemUtils.IpNetDriver]
MaxClientRate=1000000000
MaxInternetClientRate=1000000000
InitialConnectTimeout=120.0
[OnlineSubsystem]
DefaultPlatformService=Steam
i only want the steam overlay and i will handle the servers myself
what am i missing?
port forwarding?
@limber gyro
You need to define 2 netdrivers.
And set DefaultPlatformService=Null
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="/Script/OnlineSubsystemUtils.IpNetDriver",DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver")
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="/Script/OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver")
+NetDriverDefinitions=(DefName="BeaconNetDriver",DriverClassName="/Script/OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver")
[OnlineSubsystem]
DefaultPlatformService=Null
PollingIntervalInMs=20
bHasVoiceEnabled=false
[OnlineSubsystemSteam]
bEnabled=True
bUseSteamNetworking=False
[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName=/Script/OnlineSubsystemSteam.SteamNetConnection
This will by default use the IPNetDriver, but also enable Steam for Clients.
bUseSteamNetworking=false is important.
This disables the SteamSocketSubsystem from overriding the default SocketSubsystem.
Critical for the Server to be able to accept connections via IP.
And Clients to initiate those connections.
You will have the Steam Overlay when running the Game via Steam.
ok, but can you explain to me how those line are achieving that?
how is it telling the clients to use certain stem stuff
Well i kind of just did.
i understand that i need those lines to do what i asked, i am just trying to understand what exactly does what
DefaultPlatformService=Null```
This decides what the default OSS will be, important for letting the Server NOT use Steam.
ok, so if that tells the server to not use steam, how does the client know how to use the overlay
becuase i tried that before and the overaly didnt show up
bEnabled=True
bUseSteamNetworking=False```
This enables the Steam OSS, but disables its overriding of the default SocketSubsystem, which is super important for Clients/Servers to still use IP connections.
The overlay will show up when the Client opens the game via Steam.
Not in Editor no
im also using lobbies and friends, let me check if every thing is workign correctly
it crashes with that .ini
i guess i am screwd then
im trying to join playfab servers but using steam for friends list and lobbies
so that they can join together
We have exactly the same setup but using GameLift instead.
I used PartyBeacons to manage the lobbies.
i have no idea what that is
Guess you should do some research ๐
is that stea mor ue?
what a mess
Yep
if i move to EOS will i be able to do direct IP connections without all this trouble?
or is it the same mess?
No idea, dont use EOS
But id say it will help
Although will likely come with its own set of challenges.
i feel like i have my hands tied here
im developing this game alone and nothing is easy
t least when it comes ot backend
Yeah using Steam OSS is either all or nothing. Unless you do custom management of it all like we did.
i assume ur not coding alone
well i assume u have some years of experience then
A few ๐
how did u do the custom management
what would that look like
and how long did i take you?
also why did u guys chose AWS, its a mess and a half
The Team has worked with AWS before being the main reason.
Its more expensive than troublesome IMO.
You pay for the whole Amazon ecosystem really.
But anyway.
It took a while to get Steam working with IPNetDriver setup for Servers.
aws was my first option until i discovered playfab, it was 100 times easier to setup and they have a nice interface that makes thing way more smooth
I havent used Playfab.
you should
Might check it out on the next project lol
the only bad thing i have to say about playfab is that they dont use sockets
but most services dont
my original idea was to do everything with playfab but then i realized you couldnt see your friends online because they dont use sockets
kinda defeats the porpouse of having a friends list if you cant see them online to play with them
You could make your own Friends List with Playfab im sure.
When the game starts just log with Playfab that they are online??
I dunno ๐คทโโ๏ธ
lol
Surely they have some sort of persistence system
they do have friends list functionality, the thing is ur just sending a json to the server that says, "user loged it at X time"
if they log out u have no way of knowing it
Yeah, not familiar with it, so hard to give advice.
what about this thread
After switching from 4.19 to 4.21 clients could not connect to dedicated server anymore.
I build UE4 from the source, rebuild dedicated server from the
this guy managed to connect with IP by setting some subsystems to null
do you have any idea how to do that?
i did try to bypass the id check on preLogin but when you connect the server crashes
not sure if you read it before
but it seems like a decent alternative to managing everything yourself
This is why you set the following.
DefaultPlatformService=Null
[OnlineSubsystemSteam]
bEnabled=True
bUseSteamNetworking=False```
ye i know, but i am trying to not lose 1 month of work haha
the guys says: My solution was to remove the check in PreLogin and then yeah it created problems converting between FUniqueNetId types. So I Made a routine that could convert everything into a NULL online subsystem unique ID (which is basically just a string) and the server just keeps those around.
but how would you go about setting that to null?
and where?
the preLogin method?
Yeah well thats why its a pain, the OSS system is pretty rigid, especially when it comes to Steam OSS.
but do you have any idea how to set that to null?
You most likely have to override a bunch of stuff and provide a conversion between whatever UniqueNetID structure is being used down into a Null OSS UniqueNetID structure.
Each OSS has its own format for UniqueNetID
Which is where the issue comes in.
i think its about time i leave game dev and get into gardening or something ๐
i think i found the discord of the guy that posted that, im gonna see if he can give a hand
Hi there, I want to use "Linear" mode for "Network Smoothing Mode" of my Character Component. It's working well on dedicated Server, but If I use Listen Server with 2 players, the server still use Exponential mode ... anyone know why is this happening ?
If I use "Disabled" mode for "Network Smoothing Mode" the Listen server does use Disabled mode. Only that Linear mode does not works on the Listen Server : /
Once upon a time, I managed to have people be able to load up the dev build I had, and they could hop in the same session that I created. Now, they can't even view the server in the browser. I'm wondering if anyone would be able to help point me in the right direction. Steam is enabled and works fine.
I have also found that I now have to set it to a shipping build instead of the dev build as hosting a session or even going to open the level for a single player environment gives me a fatal error message now.
@real cedar Make sure your steam and your friends steam has the same Download region in the Steam settings. That was the issue with I had.
@hybrid wren How do you set that?
Steam -> Settings -> Download -> Download Region
Hmmm. Alright I will give that a try.
I've just been compressing the build and giving them the link via dropbox lol
@hybrid wren Thank you very much for your help. Finally got to test it and yes, that definitely worked. Just trying to figure out why they are getting a black screen now when trying to join the server. Will have to check the logs.
Be careful with this settings, sometimes it get reset on my steam ... not sure why
black screen usually means they aren't connecting, and you aren't handling errors, and it's just loading /Maps/Entry or whateer the default is
I've told my testers just to reset their download stuff back to what it was prior when we're not testing
That's what I kinda thought, stuck in a loop or something when trying to connect. Unfortunately, it wasn't spitting out any logs
shipping config?
if so, you need to enable logs in shipping, and build the release from engine source, if you want to see logs
mine logs just fine, just not in a folder im used to
appdata/local/projectname/saved
in shipping
thats where my logs go. but i had to enable it
beccause there is the #define that when it is 0, the UE_LOG() macros evaluate to nothing
controlled by bUseLoggingInShipping in the build target,and that needs a TargetBuildEnvironment.Unique
and aunique environemnt, requires building from source
๐คท
Yeah I'm in shipping config because I get an error that crashes the build every time I try to open a level, while I'm in the dev build
turn off teselation in your landscape material for now
for me the crash happens in shipping
lol
so i had to disable all tesselation so we could resume testing
lol, Steam support sent me a way how to avoid Steam Guard -
https://partner.steamgames.com/doc/sdk/uploading#Building_Depots
it always did it automatically for me. so that's why the other day i couldn't understand why you kept having to do it.
ah, the copying of the sentry file, I see.
How do you disable tesselation? (Sorry for the noob questions lol)
I've a RepNotify variable that's "expose on spawn", server spawns the actor and set's the variable.. Client's execute the rep notify, which is fine for dedicated servers.. but for listen server's the rep notify is never fired (given it's also the server).. is this known to be the case? and if it is, how do people handle them for listen servers?
I could in theory test for listen server in BeginPlay() of the spawned actor and manually execute the things the RepNotify does.. but seems hackish
@soft shell Yeah RepNotify is only executed on the client when it receives a notification from the server that the value has changed. One way I resolve this is I just call the RepNotify function on the server after changing the value. If the RepNotify is just a cosmetic effect, then you can add an additional check to make sure the game is not running as a dedicated server before calling it
did anyone done automated multiplayer tests for gameplay ?
Thanks, that's exactly how I implemented it..
Does anyone know of any fancy ways where I can run a windows server executable with -log and have it print to the same command prompt? Iโm trying to run my server in a docker container without having to use -t to keep it alive indefinitely.
did you tried -log ๐ค
yeah. The -log causes the docker container to exit since it starts up the new log inside of another command prompt
I tried that one too. Linux was my preferred platform but for whatever reason, it won't package one of my plugins. Felt like I tried everything to get it to work including trying to package on the Linux machine itself as well as different linux docker containers + a full fledge install of Ubuntu desktop on a vm
Its weird. Linux will build client/server flawlessly and it just throws errors saying it can't find /Script/pluginname/filename repeatedly for the same plugin until it finally crashes.
I think the only thing I haven't tried yet is to download the source on my ubuntu machine and build for linux. Really don't want to do that but I might just so I can use Agones :/
if i spawn a grenade on clients pc and the grenades actor is set to replicate
will it spawn on everyone else's pc?
and why
Only actors spawned on the server can replicate.
thanks
is they anyone in here that can help me to make my gaming server public to get all people across the world to get access I have a customer in Kuwait if you can help DM me
To bump faxcorp's response, how is your gaming server hosted currently?
@upbeat crystal is that steam?
is it configured to filter out the games by region?
@winged badger I have no Idea I installed Windows server 2019 assigned a static IP that is it I have no idea on filters i have opened ports the server is on my network at home @royal sparrow
i asked if its steam, not where you installed the server
it's not steam no it is installed on my custom built system
How can I create lag compensation for my players' collsion?
By storing all collision data every frame for as long as the max correction time, for each player, on the server
@bitter oriole I couldn't figure out a way to store the collision data, how would I go about doing that?
In blueprints if possible
can someone help me real quick with a function with websockets in the engine
TSharedRef < IWebSocket > CreateWebSocket
(
const FString & Url,
const TArray < FString > & Protocols,
const TMap < FString , FString > & UpgradeHeaders
)
i dont know what to put for the last 2 params
this is such fucking bullshit
is the PreLogin function the first time the server receives the player's unique net id?
We have a weird sound problem in our multiplayer game. We are playing sounds with the play sound notify in anim montages, but if the actor using the notify is behind the player and culled away the sound plays multiple times
@wise zephyr if you need just a listen 8080 socket you could use
FHttpServerModule::Get().GetHttpRouter(8080);
FHttpServerModule::Get().StartAllListeners();
Hi, can anyone tell me why this movement is not properly replicated on client and what I should do for it to be? (This is just a simple example to illustrate my problem)
@real needle what are you trying to do
@real needle what are you trying to do
@karmic briar I am actually implementing swinging movement and I run into trouble where it was lagging on client and smooth on server. So I created a simple test like this to show the problem
Movement replication is complicated. Since you're using a character though, Unreal has a built in system for character networked movement. You shouldn't be hard-setting the actors position on tick, you should be using input events and calling Add Movement Input
The example projects all show how to correctly move a character
And the Add Movement Inputs are the only movement functions which are replicated?
@real needle the functions are not replicated, but they go through a very complex process in the character movement system that is networked
@chrome bay And if I am using AddForce function, can it be somehow replaced with the networked functions?
So long as you call AddForce on the character movement, it sort of works already
You just have to make sure you call it both server and client side, but it won't be smooth
It's not meant to be used often
Are pointers safe across RPCs?
RPC will be in a UActorComponent, Component is set to replicate, and the actors that the component will be a part of will be replicated, and the pointers are to these UActorComponents.
haha, thank you very much, Steam
@kindred widget They are yes, assuming the pointers are to UObjects and can be resolved
Just posted a new multiplayer tutorial:
http://jambax.co.uk/replicating-uobjects/
what does the "reliable" check do?
Makes an RPC reliable
vs. the default which is unreliable
Reliable guarantees it will arrive (clients are kicked if they drop reliables) and maintain order of execution within the same actor
So... If I want to have multiple local players on one client in a networked game... how much will I be fighting Unreal? Because it looks like it's kinda designed around online games having only one player per machine
I have a replicated TArray of UObject*. The UObject themselves replicate properly.
But what's the best way to find out what have changed in the TArray?
Yeah, my plugin now works in multiplayer, but struggles in singleplayer.
Great ๐
Hi guys is there a good way to figure out if all your objects have been spawned and replicated before starting a match ?
@worthy knot You would mark the RPC for ChangeWeapon reliable. You would NOT want to mark SendThrottleValue reliable as it presumably is changing all the time and missing a couple updates won't matter. A reliable RPC will retry until it's successful nor you get kicked. Don't send a million of them.
@analog prism It gets a little hacky but it's not impossible. There are games that have been published with mixed local/online co-op.
@waxen socket Neat--any specific examples? Maybe someone out there has some lessons learned they can share...?
The method that I'm aware of is to spawn extra controllers while still unconnected to a network using CreatePlayer. Then, when you join or create a session, those extra player controllers will travel together and replicate properly on the new map.
Guys I m writing my generic RPC function, UFUNCTION(Reliable, Server) void ClientToServerRPC(ENotifyRPCType NotifyRPCType, UObject* AdditionalData); My question is do my UObject needs to be network supported like below ```virtual bool IsSupportedForNetworking() const override;
/** This is to replicate variables. */
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;```
@waxen socket and they'll change to the new playerController classes no problem?
When you use CreatePlayer, I believe it spawns them as the default controller class, yes.
@stable kindle I would assume that if you use property replication and reliable RPC, then on client-side UE should be preserving the order of events? So if you make all the necessary changes on the server, before starting the match on server, then clients should be getting all the changes before starting the match too.
Though I'm by no means well-versed in networking, and more knowledgeable ppl here may disagree with this rather naive assumption.
Are you encountering situation where the match started before all necessary changes are replicated?
Sounds good @waxen socket. Right now I'm actually trying to work out how to route the controller inputs the way I want so I can have one local player be allowed to use mouse and keyboard. Wondering if there's a plugin that helps handle it better than I can
Hm, I haven't yet done that but I've seen resources around explaining it.
Should one develop a game to be suited for Dedicated Server and Listen Server structure?
Is that something devs do?
Juggling around with Authority, NetMode to optimize both ways for their game?
For example, if I develop only for Dedicated servers, I only need to create widget's on the clients, but if I would want to have Listen Server as an option too, I need to differentiate the NetMode too, so the Listen server Player creates that Widget too.
I kinda do that, yeah.
Although according to Jambax in this post: https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1554410-online-game-netmode-and-role
Role is generally more useful than the NetMode, since it governs what can/can't be done locally. Sometimes (but rarely), you need both.
Thx
Okay, good to know. Thank you @chrome bay!
@rich ridge You can't send arbitrary UObjects through RPCs - the object itself has to be replicated by something else first, like through an actor channel.
AKA, the object already has to exist at each end.
Calling that will just result in the object resolving to nullptr at the other end.
Ohhh, so any workaround this
Not for UObjects no
Meaning fundamental types will work like int, float, string, etc
You can sort of send arbitrary data via RPC by sending either a TArray of bytes and telling the other end how to decode it, or using a wrapper struct which has a custom netSerialize method
The Gameplay Abilities system kind of does this, but there are limitations
Have a look at FGameplayAbilityTargetDataHandle for an example of how to handle it with a wrapper struct
It sends a type and uses reflection to create and deserialize the data
There are still limitations but it can sort of be done
Nice trick though, thanks a lot.
@stable kindle I would assume that if you use property replication and reliable RPC, then on client-side UE should be preserving the order of events? So if you make all the necessary changes on the server, before starting the match on server, then clients should be getting all the changes before starting the match too.
Though I'm by no means well-versed in networking, and more knowledgeable ppl here may disagree with this rather naive assumption.
Are you encountering situation where the match started before all necessary changes are replicated?
@chilly mist yes actually the game state actually callsHandleBeginPlayas soon as it's replicated i think. even without the server having started the match
Properties and RPC's do not replicate in order
They are independent
When an RPC arrives there's absolutely no guarantee that the properties will also be up-to-date
The only guarantee is between Reliable RPCs on the same path (same sender, same receiver)
I have seen in many examples "reliable" and "Reliable" . What is the difference between them??
I guess I was too naive x_x
@chrome bay I have this setup which I did few days back, and I don't get NPE UFUNCTION(Reliable, NetMulticast) void SetDraftPickState(UDraftPickDataModel* InDraftPickStateDataModel);
as you said the uobjects will be null for RPC functions, but they are not null
has anyone here played with origin shifting in MP ?
Hello guys. Should i care about this note? "no value will be returned by reference"
seems like is a bug according to google
no
Just want to share an information, we can send arbitrary UObjects* in RPC function calls.
it depends if they are addressable
i.e. assets, replicated objects in world (actors, components, any other subobjects you replicate manually)
@fleet raven I m creating an UObject like this and passing to RPC function and it works. static UDraftPickModel* Get(uint8 InHeroId, ETLPTeam InTeam, FString InPlayerId);
if you are just using NewObject, with no extra stuff, the ptr will be null on the other side
UDraftPickModel* UDraftPickModel::Get(uint8 InHeroId, ETLPTeam InTeam, FString InPlayerId)
{
UDraftPickModel* DraftPickModel = NewObject<UDraftPickModel>(GetTransientPackage(), NAME_None);
DraftPickModel->Team = InTeam;
DraftPickModel->HeroId = InHeroId;
DraftPickModel->PlayerId = InPlayerId;
return DraftPickModel;
}
no its not null on my server
(however, it might have a value on the same side, such as when calling a multi cast rpc on the server side, the clients will still have null)
yeah that's not a thing unless you modified the engine to achieve this
i didnt modify the engine
i put breakpoints to validate this
@fleet raven can i DM you
i don't think his is new feature, other wise epic would have advertised this feature like iPhone commercial
hey is there any functions that will exicute on the server exactly when they join? i have a multicast function updating alot of stuff but i need to quickly send an array over when the game begins and only then , any help is appretiated, i have been messing with begin play and what not and i can get int the clients pawn which i want the data to get to from the server so i try to run a server function and it says :: No owning connection for actor MySnake_C_1. Function returnserverlocations will not be processed. and i dont mind doing a total work around like i believe an event might work but i wondering if there are any OnJoin:: functions.
that would like fire anything in them when another player joins the game, so i can have a server function that sends data just to the new players replicants . of the other players
ill look it up and try it thanks both those sound good
why would you not use Controller Rotation pitch?
How do I replicate my Input Axis Value for MoveForward/Right ?
How can I save the pose of a skeletal mesh and apply it to another one? I am creating lag compensation and I just need to get the skeletal mesh's pose from a specific time and apply it to the hitbox, which is another skeletal mesh which is the same as the playermodel
@mortal kernel Something like this will work but if you're using the CMC, just add the movement locally and itll handle it.
and what exactly do I do on the server side then ?
Because I will need to have it in the animation blueprint
Look at how the default 3rd person template does it.
If you're using a humanoid character, do it that way
I do it this way for my project but it's a vehicle.
but I need the axis value for the strafe movement
the default tp bp is just "get velocity and vector length" boom speed...
it's not replicating
@mortal kernel You should be deriving strafe and forward alphas by the resultant movement and facing direction. Unless you want running full speed into a wall and just jogging without moving to be a thing
Show your setup
I don't have a setup
So you haven't tried anything and it still doesnt work? lol
I tried earlier and ran into an issue so only the clients could see the servers animation but the server couldn't see the clients animations
show where you're sending the value
Anyways, you need to send the axis values to the server with a NON RELIABLE run on server event
then in the event, they need to set a replicated variable
That'll let everyone have the values
The problem is that your local player will have the replicated values so they'll be delayed
why does it have to be non reliable ?
because you're sending it every frame
reliable will keep retrying until it gets through if network conditions arent perfect. There's not a whole lot of sense in sending something you are updating many times a second as reliable
I see maybe this were the reason why it sometimes happened that I could stand infront of the other player without him to see me
If that's happening, your stuff is all effed up. The Character Movement Component should work pretty good
If this is your first UE4 project, I recommend NOT doing multiplayer.
I want multiplayer and If I'll have to go through hell I'll take it
@mortal kernel I like your attitude xD. I think that's a path we have all walked.
@mortal kernel you should probably start by reading this a couple of times then http://cedric-neukirchen.net/2017/02/14/multiplayer-network-compendium/
@mortal kernel if you're a visual learner like me, this is a good place to start with the basic concepts of networking (it's blueprints but the concepts are very applicable to both c++ and bp) But make sure to follow up this with eXi's network compendium doc as it fills out more details than what Billy goes over.
https://www.youtube.com/playlist?list=PLZlv_N0_O1gYwhBTjNLSFPRiBpwe5sTwc
@winged badger and others. Not sure how everyone feels about this super old very good tutorial (from Epic's Billy Bramer circa 2014) but he's still one of if not my fav dev tutorials from Epic to this day on this topic's fundamentals ๐
is it possible to send server-side movement inputs to an Autonomous Proxy? Right now, it seems to be viewed as corrections by the client and looking very spazzy.
@lilac bear while you can in theory make a networked game using only blueprints, i would not recommend it
it only has bare bones network functionality
@winged badger agreed, I used these tutorials to understand the basic concepts of networking ๐
and part of it is hacked in
@rich ridge I'm still very much willing to bet that only works in the editor environment because of the shared memory/process.
Incidentally Epic suggest the same thing I did - use USTRUCT() and use the same method as FGameplayAbilityTargetDataHandle
But yeah they also confirmed that the object won't be available at the other end so will resolve to null. Strongly suspect that editor mischief is at play.
@chrome bay Yes your assumptions is absolutely spot on and it does makes a lot of sense for UObject* not null in RPC function call. I will validate it right away.
Yes you were right, I launched my game is separate process, and I get NPE.
Haha yeah, it would be nice if it did work though
Though even if it did a struct would probably be better anyway to avoid the overhead of an object
yes, now i m going to revert that commit.
@rich ridge bitten by static uobject in single process?
No it's not static UObject, the game instances are running under same process , so they share memory and thus my objects was never null in function RPC
When I ran my game in separate process, I started getting nullptr
yeah so you got bitten by the single process bug
Yes correct
some guy in #gameplay-ability-system had the same issue
he said my uobjects replicated fine in editor but broke in standalone
Same here
it also has to be replicated via an Actor
or ActorComponent
in the ReplicateSubobjects function
Right
else it will never be sent anywhere, and it also must be created on server per normal replication rules
i'm having a problem where a replicated actor is getting spawned before a variable is replicated.
I'm having the server set the variable (replicated) then spawn the actor (replicated), then the actor does something with the variable.
all of the clients see the actor spawn before they get the variable update, so then the actor uses the outdated variable info
{
bool WroteSomething = Super::ReplicateSubobjects(Channel, Bunch, RepFlags);
if (SomeUObject)
{
WroteSomething |= Channel->ReplicateSubobect(SomeUObject, *Bunch, *RepFlags);
}
return WroteSomething;
}
kinda like that
@fervent spoke spawn the actor deffered
assuming you are doing it in c++
i'm using BPs
i thought expose on spawn set variables were serverside only
like
if the server spawns the actor and sets the exposed variable
then none of the clients receive that variable info
eh
it just sets the property, and if its replicated, it will be set before the Actor calls BeginPlay on client
google said that doesn't work but i will try and report back
Tell us how to improve Unreal Engine 4!
this thread specifically
unless i am confused
the property has to be replicated
if its not replicated, clients will use the default property value
ooh
not the server set value
Iโm just getting started into multiplayer, my question is where would spawning an ai actor for a wave based gameplay be best at. Iโm leaning towards game state but not sure if game mode would be better.
make a spawn manager
either as an actor in the level
or in GameMode
as AI is only spawned Server side
it doesn't matter
i have a SpawnManager in the level that handles it
I too use a SpawnManager actor.
@waxen socket why actor, why not Uobject for managers???
These managers don't need most of the logics of actor
The respective GameMode can assign world context to managers in BeginPlay
Manager doesn't need replication, controller, etc logic . They just maintain some state and fulfill business logic.
And actors they kind of fall in presentation layer.
Mine has a collider to see when spawned objects go out of bounds, arrow components to help me visualize the trajectories of the spawned enemies and other bits and bobs.
@rich ridge plenty of reasons to use an Actor
you might have SpawnPointActors on the level, if you have a SpawnManagerActor on the level, you can set the references in editor/on PreSave for example
there is also that SpawnManager might want to replicate something for the UI visible on clients, say time to next wave or wave count
it depends on the game, but in some advantages of a standalone Actor are just too good to pass
Mine has a collider to see when spawned objects go out of bounds, arrow components to help me visualize the trajectories of the spawned enemies and other bits and bobs.
@waxen socket don't you think this violates the single responsibility of a class??
and it doesn't, recovery and debug are part of its responsibility to handle the spawning
This is reasonable
there is also that SpawnManager might want to replicate something for the UI visible on clients, say time to next wave or wave count
@winged badger now this violates single responsibility of class.
Apart from spawning it is also doing RPC, so multiple responsibility for a class.
I meant replication
and its just making sure that its client side instance has the correct data for the UI
it doesn't manage UI, just broadcasts changes
that UI hooks into
why would you hack in a separate object to display a spawn manager data on clients?
(in case you need to show spawn manager data, not every game does)
we for example, show current wave and the time left until next one
Showing spawn manager data on clients means some sort of RPC
just a replicated variable is sufficient
and networking (keeping clients in sync) is not a separate responsibility for Actors/Objects in networked games
Ohhh yes right if your manager is actor based.
doesn't matter whats it based on really
if you need any of its data on the client, replicating it is the par tof its primary responsibility
Yes I got your point now.
I too now understand my own class better thanks to Zlo.
does this function works within the editor as I start 10 clients in different process and one dedicated server processUFUNCTION(reliable, server, WithValidation, SealedEvent) void ServerNotifyLoadedWorld(FName WorldPackageName);
it works just fine, ever read the comment above it?
/**
* Called to notify the server when the client has loaded a new world via seamless traveling
* @param WorldPackageName the name of the world package that was loaded
*/
UFUNCTION(reliable, server, WithValidation, SealedEvent)
void ServerNotifyLoadedWorld(FName WorldPackageName);
so it wouldn't be called after you start a PIE session
as you didn't seamless travel into the level
i m getting error. virtual void ServerNotifyLoadedWorld_Implementation(FName WorldPackageName) override;
my IDE throws error while compiling but it show this function in override list
SealedEvent means it's not virtual
the only usage of this specifier in the engine
cool, isn't it?
well, you can override HandleSeamlessTravelPlayer instead to do what you need to
yea i did that
but its still a super clumsy practice
virtual void HandleSeamlessTravelPlayer(AController*& C) override;
this is not working, the first map load is non-seamless travel
i guess I need to override this from GameInstance and manually send RPC to server about the map load for first time as it is non-seamless travel virtual void LoadComplete(const float LoadTime, const FString& MapName)
Is it possible to change a replication type? I have a component that I'd like to replicate differently based on where it's being used, but I'm not exactly sure when GetLifetimeReplicatedProps is called or how to affect a variable before it is.
@kindred widget https://docs.unrealengine.com/en-US/Gameplay/Networking/Actors/Properties/Conditions/index.html
Detailed information about how to conditionally replicate Actor properties.
Sorry, to be more clear, I need to change if a variable is replicated just to owner or if it's replicated to all connections. This just shows how to set that initially and how to change if it's currently replicated or not replicated.
i am trying to expose login function to BP so i created a custom game instance and added the following in it:
bool Login(int32 LocalUserNum, const FOnlineAccountCredentials& AccountCredentials);```
but getting the following error
https://cdn.discordapp.com/attachments/710371393321042050/749337351066746930/unknown.png
it seems to be defined though
Hey there. Anyone have experience replicating subojects?
@gray scroll you can only expose UObjects or Ustructs to blueprints
@eternal anvil do you mean uObjects?
Yes I do
@rich ridge I've been getting this error
LogNetTraffic: Error: UActorChannel::ReadContentBlockHeader: Sub-object not in parent actor
Just saw some older conversation about it in the cpp channel and am reading about NetSerialization now
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
virtual bool ReplicateSubobjects(UActorChannel* Channel, FOutBunch* Bunch, FReplicationFlags* RepFlags) override;```
override these 2
Yup, I have done that
{
bool WroteSomething = Super::ReplicateSubobjects(Channel, Bunch, RepFlags);
WroteSomething |= Channel->ReplicateSubobject(MyObject, *Bunch, *RepFlags);
return WroteSomething;
}```
@rich ridge I have done that as well
and finally override these 2 in uobject ```virtual bool IsSupportedForNetworking() const override;
/** This is to replicate variables. */
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;```
The specific issue I'm running into is this adding a replicated UObject to a TArray belonging to another object
the replicating UObject has to be the part of replicating actor
After overriding the functions you mentioned above the replication works fine, but if I try to add a replicated UObject to an array and delete the old owner I get the error
Can't it change parents (outers?)
this is hardcoded into engine
Right
Thanks for the help. I'm going to see if there's a way to accomplish what I'm trying to do
@wheat magnet anything pure c++ engine code will work on any supported platform by engine. So yes you can write multiplayer game for HTML5. and for dedicated server the binaries are for OS like windows, Linux, not for browser stack like chromium, etc
is there any example project of html multiplayer or any article that helps?
Setting up UE4 for HTML5 development.
i want local multiplayer in html5
like LAN based
yes, not dedicated, but it should lan based
please checkout shooter game, you can package that game for HTML5
Documentation for the C++ example game project ShooterGame
when i try to run Find session or something related to that node, and then when i run package game in html5, it always gives this error
this is html or javascript based fatal error, I can't help much
i would suggest you post on answerhub
How correctly use cull distance for bp actors?
@eternal anvil how are you instantiating the object?
i fyou're using NewObject<> just make sure teh first parameter is the actor instead of null.
so it's package outer is the actor.
eg, when I instantite item UObjects
, ItemClass->GetClass()
, ObjectName
, EObjectFlags::RF_Public | EObjectFlags::RF_Transient
, ItemClass, false);```
PackageOuter in this instance is either the container (component) or actor if it's holding onto it, in the case of say, an item pickup
@gleaming niche Thanks, I am. Maybe there's something fundamental I'm missing but the problem is this:
I want to "transfer" the UObject from one actor to another. After that transfer I want to destroy the previous actor
I can do the transfer but when I destroy the previous actor the UObject goes away as well
changes name, plus can change the otuer.
So I'm using rename, and was at first just passing nullptr to the name. Changing the outers though
how would i make a multiplayer system to works cross platform? windows, mac, ios, android
@eternal anvil @gleaming niche Outer doesn't replicate, but is rather assumed to be whatever Actor the ActorChannel replication came through belongs
so, Rename() won't work on clients out-of-the-box
and you can't use the Object itself to replicate Outer and Rename OnRep, because that replication will arrive through the wrong ActorChannel, too
and yes, that means if you have a replicated UObject with ActorComponent for an Outer after replication its Outer will be the ActorOwner on clients instead
so, Rename, sure, but should be done through the new Actor that will replicate it from then onwards
(its not enough to call it on Server, need to call it on clients manually as well)
Thanks @winged badger! It was actually your comments I was referring to in cpp. Let me try to wrap my head around what you've said before responding
So here's what I'm doing (this is all psuedo code with fake types so forgive me. The general setup is the same)
I have Actor A with UObject* O and ActorComponent B with TArray<UObject*> OArray
Both A and B implement ReplicateSubobjects
A creates O like this NewObject<Type>(GetWorld(), NAME_None, RF_Standalone
At some point in the game B interacts with A
When this happens B adds O to OArray
When O is added, B changes O's outer to B on the server and client O.Rename(nullptr, this) // Called from withing B on server then again via client RPC
After a few seconds A is destroyed
The problem is that O is also deleted when A is destroyed
is OArray UPROPERTY()?
and why do you explicitly set the World as Outer?
when creating them
and do you actually add it to OArray when you Rename?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
@winged badger The array is a UPROPERTY (even though I forgot to mark it as one in that paste ๐คฆโโ๏ธ)
I set World as Outer because I saw someone mention that and the standalone flag to avoid garbage collection
sorry guys, I'm being a tad lazy while I search for this answer on the web. Answer if someone knows off the top of their head:
-Is there an easy way to access the before/after values of a replicated variable update during the "rep_notify" function?
void OnRep_MyVar(VarType OldValue);
the engine code will check which overload of OnRep you declared and call the correct one
also, why it has to be a UFUNCTION
ah nice, thanks @winged badger! ๐ Seems I found an old forum discussion confirming your statement as well
https://answers.unrealengine.com/questions/110910/are-all-replicated-variables-updated-from-the-serv.html
Does anyone know how to fix the Incompatible_unique_net_id error when connecting to a dedicated server as i tried everything i could find on google but still cant fix it
Is there a function that will be called in UObject on the client after the object has replicated to the client for the first time, but not each time its properties are checked
just read the unreal docs about RPCs. Not entirely understanding why anyone would ever want to leave one as Unreliable.
why not just have everything as reliable?
how to use cull distance for bp actors?
you might want to use unreliable for less important things like effects since it's possible to overflow the reliable channel
when something is marked unreliable and the network is saturated, there's a chance it would dropped
also filling the reliable buffer will cause the player to disconnect
Reliable == stuff the MUST happen
Unreliable == Stuff that does not always have to happen. Like player movement input, is all sent via Unreliable, cause who cares if we miss a couple of RPC's?
a player activating a skill or shooting a weapon, well that should really be Reliable
does any 1 know if theres a list of already built in URL options like "Name" somewhere? i wanna take look at that to make sure i dont overlap anything.
I'm having an issue where a client player is not where the server player sees them. Is there a reliable checkbox for that?
Also, can I increase the size of the reliable channel?
Or reliable buffer? Both were mentioned above
guys, where I can read about fundamentals about accessing to characters by internal player id in multiplayer with Steam OSS or Epic OSS?
I need info about next criteria:
How works internal OSS player registration, its model..
assuming you are testing locally, I don't think Reliable/Unreliable will make a difference. If there's any desync locally there's some issue
is the client that's out of sync autonomous or simulated? also is this a custom setup or using UE Character?
@twin juniper theres not much documentation about that around, i am afraid ur gonna have to look into the code itself
The prelogin and login functions do some stuff with the player id, you can start there
@limber gyro I've an exp within srcds only, and only on sourcemod which provides simply methods.. but not understand how it woks in ue
@twin juniper documentation is lacking in that area man, theres not much you can do
@twin juniper Im using the topdowncharacter from the topdown template. The only change is that I am using "addMovementInput" with arrow keys instead of the default passing left click through the controller. I am testing an 2 separate laptops on the same network, but sometimes am able to test with a buddy on a different network, form his home. He was sharing his screen and I saw my character at a different part of the level than my character actually was on my screen. I dont know about autonomous or simulated. I am using whichever is default I assume.
autonomous would be the character you play on your local client, and simulated would be other players on your local client that you don't control
looks like your desync is an issue with simulated pawns since your pawn is desynced on his screen
The project is not super complicated atm so.. not sure how to prevent desync
I immediately assume it is because im running to many checks or inefficiently using event tick, but im not. I dont use tick for anything atm
but also having the same issue within the same network
Is there a difference when coding for dedicated server vs listen server?
I'm currently working on a standalone project to test proof of concept, soon I'll have to switch to networked game.
The game suppose to run on a dedicated server tho it's not needed early on, can I work on it as listen server and then port it to work as dedicated server?
I'm doing that because listen servers are much easier to setup
@stray crescent very little for the intial dev phase
optimizing for listen/dedi is where it becomes significantly different
the big practical difference is that IsServer doesn't mean there are no local players present on listen server
but you can easily code so that it works for both
Is there a way to get notified when a player is added to PlayersArray in GameState???
At client side not server side.
do you have your own GameStateBase derived class?
in that case you can just override AGameStateBase::AddPlayerState(APlayerState* PlayerState) and do:
void ACustomGameState::AddPlayerState(APlayerState* PlayerState)
{
Super::AddPlayerState(PlayerState);
// custom logic here
}
Ohh yes, I will do the trick.
can anyone please help me with some problems..
i am spawning an actor from server and it is rplicated..and i am also calling a reliable netmulticast rpc from server ,just after spawning.the function executes on my listen server but the client does not receive this call. if i call the function on server after a delay after spawning..the client also execute the function..is this expected behaviour? should not the reliable rpc get called on client too after the replicated actor gets spawnned?
@hearty loom I also experienced that. Don't know what your exact case is, but what I have done as a workaround to this was to:
after spawning that object on client I was doing an rpc to server to inform it that it can safely multicast to me and I will get that rpc
but maybe it would be better for you to switch into replicated properties?
uea @empty axle ..for my work i seitched it to replicated property..and its working..thank you very much for helping out..
Quick question: when does a replicated property get replicated/where can I find more information about property replication timing?
Or I guess more simply: does a property replicate immediately when it is changed?
Hey guys I really need help for a little something in my multiplayer first person shooter... When I shoot someone+ I can kill him and after 3 second, I spawn another "FirstPersonCharacter" and then I make a posses node but instead of being the person who just died to posses the newly created character, the server posses it...
If someone is willing to help me with that little problem, I can send pictures of the code
I'd really appreciate if someone could take the time to help ๐
(IT'S BLUEPRINT BTW)
@dapper hatch are you having the server's copy of the client's player controller call the Possess() function?
@analog rover NetUpdateFrequency variable on owning actor defines what is the frequency of replication
So if you will have frequency on owning actor set to some high value then yes it will be replicated in the same frame that it changed
Can someone help me out with world composition. So when you import a tiled landscape..there's no option while importing (or enabling after importing as well) to have edit layers. However.. ..if you create a landscape normally and enable edit layers..you can then just adjacent landscapes and they all have editable layers. My question is..does this somehow 'break' something if I use a tiled landscape with editable layers in my open world landscape?
just add*
@dapper hatch yeah, don't use GetPlayerController[0] until you understand exactly what it does ๐
i would imagine you are sending an RPC, which then calls GetPlayerController[0] to do something with first controller
only, that GetPlayerController[0] if used from RPC is evaluated on server
not client
@empty axle @analog rover high net frequency everywhere is a good way to create network congestion
if adaptive rate is on
if you want to force replication immediately, use ForceNetUpdate() for that one update
there is also NetPriority, each evaluation an Actor doesn't replicate, its NetPRiority gets a bump
and generally not all Actors will replicate right away if there is a lot of them
so, enter our game designer, plays with numbers a little, increases priority to 100 for one of the trash mobs, and when there are 50-60 of those in the level, it takes half a minute ++ for any other ACtor to panic enough to actually replicate
got another question about repnotify functions. If I have a TArray<UStruct> setup with repnotify, I presume this will call the repnotify function on all clients/servers for each assignment? Here's my crude code example:
UPROPERTY(ReplicatedUsing=OnRep_myUstructArray)
TArray<myUstruct> myUstructArray;
...
//in myClass.cpp
void myClass::myFunction()
{
//assuming array length of 3
for (int i = 0; i < myUstructArray.Num(); i++)
{
myUstructArray[i].myUstructInt = 8;
myUstructArray[i].myUstructFName = 'test';
myUstructArray[i].myCustomActorClass = someCustomActorInstance;
}
}```
Would this call the OnRep_myUstructArray once, three, or nine times for clients (and server yes)?
as you run that sync, once, all changes were done between 2 evaluations of its Actor for replication
i don't think i even use TArrays for replication anymore
oooh interesting, what would be your approach to something like this?
I saw UKaos mention those a week ago or so too
cool, I will look into it for sure right away. How would that change this rep call wise? (if at all)
it has an array of FFastArraySerializerItems
each one gets an indivicual add/remove/change callback on client
TMap replication is not supported in blueprints in version 4.20
Is there a good workaround for replicating TMaps with blueprints? My TMaps are [Int Vector, Int]
I don't need to "replicate" as much as I need to update the client's TMap based on the server's.
its not supported in any version
make a struct with FIntVector, int32, then put it into an array and replicate that
How would one "predictively" spawn an actor? In my case the character is equipping a weapon actor, and I want to try and set the character's weapon actor locally, send a RPC to the server, and replicate the equipped weapon back to the predicting client
It seems like there isn't really a way to synchronize a locally spawned actor and a server replicated actor, so I was thinking I'd need to spawn the weapon actor earlier on the server, some time before the character tries to equip it
Hmmm. I'm trying to spawn an actor that replicates ..but only the client sees it. I have the actor to replicate but idk what else I need to do?
@analog rover I know GAS can do it, I'm interested in how it's done tho, if even in the simplest form
@round star What machine is spawning it and from what actor?
I am playing as the client..the player is spawning the actor from inside the player bp..the actor is just a weather balloon that goes up into the sky..only the owning person can see it but everyone should
@round star Actors the client spawns will only appear to them. In the Character BP you need to add a run on server event that spawns the balloon.
That means that the Character on the Client machine tells it's server side duplicate to do the spawning
ooooooooooooooooooooooooooo
@round star Remember that input only happens on the client side, you need to relay stuff to the server side
and that works now XD...I am new to anything networking related... >_>
hrm, does anyone know off the top of their head, of a way to search for sessions WHILE you're already connected to one?
ah maybe it's another issue, nm.
@round star Just keep a simple concept in mind with networking. Anything the client does needs to be RPCed to the server in some way or form if you want to make a difference that isn't solely on the client. The server on the other hand, has the ability to both RPC to clients, and replicate variables/actors.
@dark edge Not sure they actually do that in GAS. They have some "We could do it here." comments, but the SpawnActor nodes in GAs do not have any prediction logic with them.
UT spawns projectiles predicted iirc. So one could open the UT source and look at that.
@analog rover
@thin stratus From what I recall of looking through the UT code, they spawn projectiles then lerp to replicated one from the server when it comes over. I suppose what I'm thinking of is a generalization of that, and without having to route all logic through the projectile/actors owner.
@dark edge i told you and Tank the only way you can spawn an Actor client side and have it networked to an Actor instance server spawned
it has to have a static NetGUID
and it has to be resolved via its Name
and if that doesn't match, all your clients get disconnected
you also have to spawn it on all clients if you're going to turn on its replication
otherwise you'll get all clients with exception of owning client disconnected
we use the technique to spawn an entire level - as long as nobody is using a laptop or a potato, 33k Actor procedural level is spawned, networked and ready for play in ~12 seconds
we do not use it after BeginPlay is called
basically comes to this - only replicated Actors that work and were not spawned by the server then replicated over are the ones loaded from package
So it seems like my best bet would be to spawn the weapon actor server side some point prior to the character equipping it, but just hide it, and unhide it on the client when I'm "predictively spawning" it
i would definitely not use the above approach for something spawned after BeginPlay
Anyone having trouble spawning particle systems on other clients?
In what way?
@winged badger when you say the above approach, you mean trying to match locally spawned actors with the server spawned actors via NetGUID?
yes
๐
My RootMotionSource_ConstantForce works fine on the client triggering the force but it rubber bands on other clients, is there anything I can do?
@round star Just keep a simple concept in mind with networking. Anything the client does needs to be RPCed to the server in some way or form if you want to make a difference that isn't solely on the client. The server on the other hand, has the ability to both RPC to clients, and replicate variables/actors.
@kindred widget Say a client moves a mesh but everyone needs to see that its moved. I can get the static mesh in an actor ..use switch has authority is either true and multicast.. or false and run on server (from client) ??
@analog rover we also don't let server replicate its actors before our procedural generation is done for everyone... if it starts too early, those actors are still netaddressable, but their replication doesn't work
Yeah, it honestly sounds like way more trouble than it's worth except in your situation where you're procedurally generating levels
It couldn't hurt too much to spawn a few weapon actors server side I suppose
@round star How you handle it is personal choice and based on the end result. If you're using a listenserver design, you can pretty much get away with just telling both clients and server to call a Server rpc and have that RPC do something. That way your logic remains consistent for the server player and all clients. In reality, you can probably do the same thing if you're using a dedicated server, since it won't have a personal controller itself. So the RPCs should function the same. In simple terms, if you want all clients to see that mesh move and make sure of that, replicate the actor that it's a part of. If you don't really care and also don't care if newly joined clients see it moved or not, then multicast is fine. From a lot of what I've seen though, majorly you should RPC to the server, and let the server replicate back. You'll usually get the best results that way instead of using multicasts a lot.
@analog rover if its a few pickups etc
just spawn them server side
when your generating an entire level with a lot of replicated stuff, normal methods do not work
if the map is static and those actors were pre-placed its even easier
but our map is basically an empty shell so we couldnt allow 5000 replicated actors to spawn and go to every player
I don't have the full mechanisms done yet, I was thinking of spawning from an inventory, but right now I'm just working on the attacks
you on about equipping a weapon locally?
mostly every game, the weapon actor is spawned on the server
when you first pick it up/get given it
equipping can be done locally (like i do), but actual giving the weapon is done on the server
Yeah, I was thinking of spawning it when it's added to the inventory or something
thats what i do
its spawned, and just kept there
cause i use repgraph, it only replicates when the owner replicates, and when its not equipped its set to dormant
so my inventory never replicates on there own, only when the owner (the pawn in this case) replicates
Interesting, I'm not using replication graph yet, dunno if it'd be worth it
(The idea is for the games to be ~4 players max)
yeah we dont use it in work project
(the one with proc levels)
but we had a lot of fun doing it, some issues had me a Zlo stumped, honestly Unreal is full of pitfalls, you can easily fall into
Guys, is it possible to make more than one multiplayer game in a single process instance? For example 2 games, 4 players (1v1 and 1v1), but 1 game instance. I'm asking because unreal instance is pretty heavy, I thought it would be better and cheaper if we just have multiple games in a single instance.
why ue4 keep recompiling engine when i try to package dedicated multiplayer game
does it happen only once? it first compile on visual studio, when i try to build package, it again start compiling from start
why it happening each time
i'm using 4.25 source version
I think that will happen even if you package any project
[Q] How do you trigger when a player is in range of replicated actror
what I mean is where can I have access to where that happens
so I can reset the values manually since I have a big data that is not needed for replication since it would be used for once
sounds like a question for #blueprint then since this is not being replicated
not really
it is actually about replication
replicated data gets reset after its out of net distance
when it gets back I want to know when
it doesn't get reset
non relevant replicated Actors that are not loaded from package are destroyed
and spawned again when they become relevant
Hey guys i got a issue , i've made a weapon that shoot automaticly the problem is the shooting doesn't stop for the client when he release the button but for the server it work just fine
how accurate is Get Server World Time Seconds when called from a client? specifically wanting it to get timestamps for rewinding hitbox positions
read an article a while ago that said it can drift a noticeable amount, but im not sure how much that is or how old the article is
not accurate enough
depending on your network load, it can be few seconds off
and worse yet, it changes only when gamestate replicates
you should occasionally send a server RPC with the clients timestamp to server, and have it respond with client RPC sending client's own timestamp and server timestamp back
from there you can calculate delta between server's and clients WorldTimeSeconds
and then you have as accurate a network clock as it gets @vivid seal
and it takes 10 minutes to setup
i had a similar system doing that in bp, been moving everything to cpp and was hoping there was something already doing that i could access, but thanks. do you recommend doing that inside the game state or inside the player controller?
PC, GS can't send server/client RPCs
oh duh
add a couple of static functions for easier access
accessing FirstLocalPlayerController via GI, then the server time delta from there
on a related note, for uobjects do you typically pass a world reference into constructor to give them access to game mode/game state/etc., or is there a better way to access those things
just overriding GetWorld() will let you use the functions requiring world context
in BP
UWorld* UMyObject::GetWorld() const override
{
if (HasAnyFlags(RF_ClassDefaultObject | RF_ArchetypeObject))
{
return nullptr;
}
return GetOuter() ? GetOuter()->GetWorld() : nullptr;
}```
ah okay
when you press RMB on the event graph
BP calls the GetWorld
and in case of CDO (on which it will get called) it won't be a nullptr result, but something... else
i no longer remember what
in any case, nullptr is good enough
you still need to give them a sensible Outer when you instantiate them at runtime for it to work
ofc
anyone here used ue4-docker to build dedicated servers? mine is stuck on this thing for almost an hour before im doing it on windows server 2019
ue4-docker build 4.25.3
mine is stuck on this
@waxen imp is the guy who made this right?
why would you change what worked?
@winged badger so to follow up on some of our last discussion yesterday regarding replicated variables the other day. Let's use the ustruct array again as an example which contains both atomic data types and pointers to class instances. When does this replicated variable have it's onrep() called when I am making numerous updates within a a single function? Is it after the function ends and before the next function is called or end of actor update, or what exactly?
You mentioned "... you run that sync, once..." and that the "changes were done between 2 evaluations" last time. I'm not sure I understand exactly what you meant by "sync" and "2 evaluations". Thanks in advance! ๐
Actors aren't queued for replication, or replicated as soon as you change them
so you made 1, 10, or 5000 changes to it before its turn to replicate, it will replicate just once
and call OnRep once
perfect, that's precisely the behavior I'd prefer in this instance. So when can I expect the call to replicate? I presume it may vary?
I theorize that there is probably some set of phases that perform things like actor updates, physics updates, network updates etc. I'm not sure about those larger phases (what they are and the order of execution) but I would imagine if all actors perform their updates before network replication begins in a single tick/frame/update. At which point I can safely presume any number of function calls and assignments to variables that occur in this theoretical actor update phase will all be replicated at the end in a separate network phase update?
This is a lot of non-sense I'm spewing. i need to find some documentation about game update flow to give myself some concrete understanding. :S
Guys question, is this a good practice to do like this (its a simple sprint function to set walk speed) for networking or there is more better way?
that will jitter, badly
client RPC servers no purpose
you need to set max walk speed locally and call the server RPC
and you need to replicate the speed to other clients as well
its not jitering like this
@winged badger for me this works fine on all clients, i just looking if there is better way
@taskhas if you don't see a jitter it must be due to you testing with little to no lag, once you introduce an unreliable connection you will see jittering occur with the start and stop of sprinting because the client will wait for a response from the server before he sets his own run speed. I agree with Zlo's recommendations
When you're in blueprint you can see which client you're on when debugging. Is there a way to see which client or server c++ code is running on??
@abstract pike You can put print strings in. It'll print what client or server it's running on. Eventually you'll just understand where events run from and it's easy to follow your execution line between server/clients.
@kindred widget I really just want to know which client, 0 or 1, so how do I print that?
@abstract pike Print String
@kindred widget I'm talking about c++
You can use the same print. Just need the UKismetSystemLibrary. You can call it with UKismetSystemLibrary::PrintString(this, "PrintThisText"); Barring that, if you really want to write it out manually, you should check out that print function's definition. It shows how it decides which to print. Basically switches on NetMode and appends the strings after.
hi guys, if i change a replicated variable in clients pc, will it replicate to other clients?
@shrewd tinsel No. It will stay that way on the client until you change it on the server, then it'll overwrite whatever is on the clients.
Only replicated things changed on the server will ever replicate to clients. Much the same as multicasts, they need to be ran on the server to multicast to all clients.
@shrewd tinsel So what you would want to do is to change the variable locally, but also send an event to the server to change it on there, so that it replicates to everyone
alright nice thanks
Or optionally, only send it to the server and don't set it locally, but let the server do it. Depending on whether you want "client side prediction", but thats a more advanced topic
@quick flint yes, I'm the maintainer of ue4-docker. If you're concerned that the build has frozen then it might be worth running it with the --monitor flag, which will print system resource usage at regular intervals and should give you an idea of whether it's still performing processing. Details here: https://docs.adamrehn.com/ue4-docker/building-images/advanced-build-options#enabling-system-resource-monitoring-during-builds
@waxen imp ended up doing that and let it run overnight, interestingly it got past that but said that there wasnt enough disk space and crashed, although i check the disk and i have over 100 gigs left
how do i get rid of this docker container lol
What was that new update for prediction that was being worked on?
@waxen imp i tried to run ue4-docker clean --all and i still didnt get my disk space back lol, i have 400 gigs last night, now im at 100 gigs
@still cape still being worked on
Probably won't be in a mass-useable state until UE5
Sort of useable already though
do you know where the repo stuff was @chrome bay? I used to have the repo and was messing with it but lost it somewhere
It's in their master branch on github
oh right it was a plugin
actually I think it's in release now, but the more recent versions require chaos to be compiled in I think, so master branch for latest
Though it probably does work without Chaos still, but the two do interop now
For the rollback physics anyway
Hey, guys. Do you know a good way of refreshing Widget when smth changed on server side? Like, Ive opened player's inventory and smth changed in it so I need to show changes in opened Widget
Widget should probably just tick and query inventory for changes
Trying to drive UI from gamecode directly is always a clusterfuck from a design/maintenance POV
Do people just implement their own networked physics right now?
I'd assume so I guess
Nobody does networked physics and lives
gaffers articles doesn't really apply to UE
somewhat understand it
largely due to the way physics engine is implemented
hmm
The Smooth Sync plugin claims to work on physics.
Two approaches in UE, currently:
-> Server auth, deal with the input lag and rubber banding
-> Client auth, implement your own anti-cheat checks.
Widget should probably just tick and query inventory for changes
Hmm, looks like you are right, 1 ticking widget wont make player's PC suffer ๐
You can always broadcast events that the UI subscribes too, that's a common pattern
"OnInventoryChanged" etc.
I thought about it too. Just Multicast some things
Well for UI you want to avoid using any network commands, it's not neccesary
Anything is better than that
I can't ever recommend making direct calls to UI from game code tbh
Just let the UI sit on top of the game and query it for info and/or bind to relevant events
RepNotify on variables, how about that? UI will redraw on changes then
rep is fine, just broadcast events
This is just my opinion but in general, I find it's never worth the effort of polluting the game code with UI code.
Same thoughts, thats why Im here ๐
So, are you saying you use a lot of event dispatchers for directing UI, Jambax?
Just gets completely un-maintanable once the UI get's complicated enough
Yeah that or just tick the UI, and have it grab info itself
Tick? Really? I've been warned off of Tick, and bindings so much I never use them anymore.
Tick in UI is fine honestly
HLL is an insanely UI-heavy game and, the whole thing is ticking, and it's not even remotely close to being a bottleneck
Huh... I wonder why everyone's always warning about it then.
talking multiple hundreds of user widgets on screen at a time
But how can you rotate UI to the player w/o Tick?
Tick is honestly fine, it can just be a good way to kill performance if you're doing something heavy with it
Talking about Ui in world in this case
Well exactly
depends how you do it I guess. If you use widget components they do whatever the component says
If you're using 2D widgets but projecting them to screen based on world positions, we tend to hijack the AHUD tick, since it's one of the last things to run in the frame
@waxen socket Also have you ever used "Bind" in UI? Cause if so - its a Tick too (just in case)
I used bindings a lot because tutorials sprinkle them all over the place. Then I was warned off them and now I never even think about using them.
But, unless your UI is actually a bottleneck - sod it, use em if it makes life easy
Ticking > Bindings always
Probs not relevant to #multiplayer btw
But why? I thought its just like Ticks
is there a handy delegate or something for handling map load failed? I'm calling ClientTravel and I want to know if it doesn't work
HandleNetworkError maybe?
can't remember the exact name, but game instance binds to it
Jambax, one more q, if you dont mind ๐ Have you ever tried to launch a lot of AI in multiplayer?
What amount of them?
Yeah, I know that its hard for computer anyway, just thinking what will be with network if I will try to launch 100+ AI's ๐
Yeah, you are right, will need to think about it too anyway :/
have to squeeze everything you can
Kinda sure that I will end up editing Movement components ๐
FYI paragon doesn't use characters for it's minions
They're just little agents stuck to the navmesh
*didn't I guess... RIP
Lol, there are games with lots of minions, so they have a workaround for sure ๐
Thanks for advises, going to edit my UI again rn ๐
@quick flint to completely remove everything I'd suggest manually untagging the container images you want to get rid of using docker rmi <IMAGE> and then running docker system prune to remove any remaining intermediate layers.
Hey i have a problem with calling Server RPC. Basically It's an RTS like so I have multiple units owned. On client I don't have the AIController but on Server I have it.
So i created a ServerMoveTo function inside the unit
Basically on the Server I can move the server units
But from client the RPC is not getting called even though I'm owning the unit
I checked the owner on the server and its pointing to the correct one (the client controller)
@taskhas if you don't see a jitter it must be due to you testing with little to no lag, once you introduce an unreliable connection you will see jittering occur with the start and stop of sprinting because the client will wait for a response from the server before he sets his own run speed. I agree with Zlo's recommendations
@lilac bear ok i will try to test it and redo it maybe
@shrewd tinsel Not likely. I wouldn't try it either. Gamestate is usually reserved for game level data that all clients need to see.
And definitely no on Widgets. UI should be entirely client side. It should only ever get information from or call events on actors that exist on that client.
thank you for answers
How can a client own a pawn that have an AIController?
If I spawn from server a pawn and assign an owner to it on client side its not calling the rpc, if the AIController is not spawned then it's called
@novel hemlock what are you assigning as owner? You should assign PlayerController? as owner server-side. I think.
@dark edge I tried both ways and by assigning the PlayerController without spawning the AIController it worked. The problem is that like that I am not able to use the features of the AI Controller. Behaviour trees, MoveTo functions and so on
@novel hemlock cute profile picture
@novel hemlock replicate the AIController, set PC Owner for the AIController and set AIController as Owner for the Pawn
note: if you want a predicted movement using pathfollowing component, you have plenty of overriding to do, CMC is hardcoded to work with Character that is AutonomousProxy and a PlayerController
I'm applying a root motion constant force but it rubberbands in other clients, is there a way to fix this?
note: if you want a predicted movement using pathfollowing component, you have plenty of overriding to do, CMC is hardcoded to work with Character that is AutonomousProxy and a PlayerController
@winged badger Yep i said a pawn but its actually a character, anyway idk the solution didn't work for me :C
I replicate the controller and set the owner of that with my PC
@harsh lintel this is more of a GAS.
Anyone here has experience with steam ISteamMatchmaking interface? I'm a bit lost in sending and decoding chat messages
what's the problem
Problem is that I'm not familiar with working raw c++ pointers and binary data and I don't have a good idea where to start sending custom data with the message
gimme sec, ill show you how i handle sending chat messages over steam
Can I convert a class to binary to be send in the message and then cast that binary data back to be that class/struct?
You want to serialise your class
Feels like the best structure for data
you mean for text chat?
text chat + sending a message when matchmaking is started and a message when match is found and the connection info to that match
And whatever else I need in future
well
i just take in a string
convert it to a tarry of bytes
and send it along
FMemoryWriter Writer(Buffer, true);
Writer << Message;
Writer.Close();``` like this
What about serializing a class that has for example following fields: textMessage, EnumMessageType, connectionPort etc. and sending that. Then I could construct that class from the binary data?
there is already a function in engine to convert string to bytes and vice versa StringToBytes(Fstring, TArray<uint>, Size);
you have this right
virtual bool SendLobbyChatMsg( CSteamID steamIDLobby, const void *pvMsgBody, int cubMsgBody ) = 0;
which sends the lobby chat message
FMemoryWriter Writer(Buffer, true);
Writer << Message;
Writer.Close();
Steam->SendLobbyChatMsg(LobbySteamID, Buffer.GetData(), Buffer.Num());```
this will send a chat message out
void USomething::GetLobbyChatEntry(CSteamID SteamIDLobby, int32 MessageID, uint64& SteamIDUser, FString& Message, int32 MaxLength, EChatEntryType& ChatEntryType)
{
CSteamID TempSteamIDUser;
TArray<uint8> Buffer;
Buffer.SetNum(MaxLength);
int32 Length = Steam->GetLobbyChatEntry(SteamIDLobby, MessageID, &TempSteamIDUser, Buffer.GetData(), MessageMaxLength, &ChatEntryType);
SteamIDUser = TempSteamIDUser.ConvertToUint64();
FMemoryReader Reader(Buffer, true);
Reader << Message;
Reader.Close();
}``` i mean this will get a lobby message
``` when supplied into this function
Where do you get the MaxLength or is it just something you hardcoded?
Okay
Can that FMemoryWriter be used to write any type of data to the buffer?
Is that FString that you feed to the Write with << Message?
So according to that I should be able to serialize/deserialize custom ustruct with memorywriter and reader just like that string message?
But at least I got sending a text message working now. Thank you so much!
By the way have you had problem where the steam callbacks are always called 2 times?
how to port forward without router for testing dedicated server?
from windows or linux?
I'm trying to get at UGameMapsSettings::ServerDefaultMap from a client, so that I can choose to host a P2P game over steam and it'll use whatever map is specified for dedicated servers
They've unfortunately made it private and not given an accessor outside of dedicated servers
UPROPERTY(config, EditAnywhere, Category=DefaultMaps, AdvancedDisplay, meta=(AllowedClasses="World"))
FSoftObjectPath ServerDefaultMap;```
Is there a way for me to read this value using the UPROPERTY system, bypassing the private access in the class?
Is there any way to prevent a Client or Multicast RPC from running before BeginPlay has ran on the client?
Something similar to bAllowTickBeforeBeginPlay?
Turns out there is a way to read that, I'll post it here for posterity:
FString GetDedicatedServerMapPath()
{
UClass* GMSClass = UGameMapsSettings::StaticClass();
for (TFieldIterator<UProperty> PropIt(GMSClass); PropIt; ++PropIt)
{
UProperty* Property = *PropIt;
if (Property->GetNameCPP() == TEXT("ServerDefaultMap"))
{
FSoftClassPath* ServerDefaultMap = Property->ContainerPtrToValuePtr<FSoftClassPath>(UGameMapsSettings::GetGameMapsSettings());
if (ServerDefaultMap != nullptr)
{
return ServerDefaultMap->GetLongPackageName();
}
}
}
return FString{};
}
I'm having a weird problem with multiplayer. I am trying to use the find session node and then connect to hosted sessions. It reports that it is connecting but the level does not change to the hosts, am I doing something wrong?
I was trying to use the multiplayer shootout for reference
NVM, just figured it out, needed to put "listen" in the options for the level I open. Doh!
Has anyone using steam api directly had a problem where the steam callbacks are always called twice?
Any tips for making a battle royale
just updated from UE 4.18 to 4.25. When I start my game server with the -log argument, it does open a command prompt (this is windows) but the window stays blank even though the server starts up sucessfully.. any ideas?
bummer, having another issue. So when doing the following:
--in AmyClass.h
UFUNCTION()
virtual void OnRep_MyRepFunction(TArray<UmyUStruct> myOldArray);
UPROPERTY(ReplicatedUsing=OnRep_MyRepFunction)
TArray<UmyEnum> myArray;
--in AmyClass.cpp
void AmyClass::OnRep_MyRepFunction(TArray<UmyUStruct> myOldArray)
{
//do some processing here comparing myOldArray to myArray and execute logic for various transitions of state in myArray...
//this needs to get executed by both client and server for any side affected vars or function calls that may be performed in this function.
}
void AmyClass::foo()
{
AActor myActor = doSomeAssignmentHere;
//assuming the myArray variable is not Empty
myArray[i].myActor = myActor; //this will allow the OnRep function to be called on all clients
if (ROLE_Authority == ENetRole::ROLE_Authority)
{
//Since OnReps are not called on servers, we need to call this function manually,
//however I'm looking for a better way to transmit the old myArray value when calling on server (something similar to how the clients do it?),
//rather than manually storing a copy and passing in as the oldValue. Is this possible?
OnRep_MyRepFunction(TArray<UmyUStruct> oldValue);
}
}
Any ideas on how to pass the oldValue into the manually executed authority/server call to OnRep...()? Apologies for the lengthy example code, replication is hard ๐ฆ
There is no alternative as far as im aware.
I was afraid of that, but no worries, deepcopy it is then ๐
@lilac bear can't you use static array instead ?
anyone seen these errors before when launching a server?
the file does exist there, just not with the "PROFILE" suffix
I'm assuming something is messed up in build configuration or something somewhere, but not sure how to find what
@rose egret I assume you mean to use static AmyClass::myArray? Sorry, I'm a bit of a static noob (in practice) so you may need to give me a bit of an example of that use case?
@lilac bear you know the whole TArray is replicated when you change / add an item ?
there are some easy tricks if your array size is short and static.
UPROPERTY(ReplicatedUsing=OnRep_Func)
FmyUStruct InventorySlot[8];
void OnRep_Func(const FmyUStruct* pre)
{
}
struct FInvNumeric
{
UPROPERTY()
FmyUStruct Slots[8];
};
UPROPERTY(ReplicatedUsing=OnRep_Func2)
FInvNumeric Inv;
void OnRep_Func2(const FInvNumeric& pre)
{
}
not sure if the first one can handle OnRep_ ๐ค
Has anyone using steam api directly had a problem where the steam callbacks are always called twice?
@rose egret Yep... I'm very noob at wielding const and static classes but that looks interesting. Sadly, in this case myArray is dynamic for my purposes :/ but I will keep your method in mind for the future, thanks! ๐
@lilac bear there is also FFastArraySerializer ! see NetSerialization.h
hehehe, yep UKaos, Zlo, and you have referred me to it ๐ that is forthcoming while I get my head wrapped around it, that'll be version 2.0 XD
Could anyone help me please : I'm following a tutorial on how to make a multiplayer game using Steam and I'm stuck at the second episode because my main menu doesn't show up in game, and in the videos it does and I don't understand why as like 1 hour ago it was showing and I followed everything step by step : https://www.youtube.com/watch?v=y0DKAV26mgw
Welcome to Part 2 of my UE4 Steam Multiplayer course, where we're redoing the old Epic Blueprint Multiplayer tutorial by Wes Bunn from way back in 2016.
In this video, we'll be continuing with the creation of the Game Instance class and building out first widgets. We'll get t...
And here are all the tabs I use, tell me wich one do you want to see and I will screenshot to help you to find the problem please
Pelase ping me
@vagrant grail I may take a crack at helping you there Diversity but it is a bit late for me, if you're still having this issue tomorrow after 7pm CDT feel free to give me a ping and we can maybe step through. There are quite a few pros here though who can probably beat me to the punch tho.
@vagrant grail Your best bet is to start breakpointing your code or put print strings up.
Somewhere you are adding the Widget to the Viewport. Put a Breakpoint or PrintString on it. If that doesn't call, go one level upwards, check what calls this AddToViewport (e.g. via find references) and put a Breakpoint or PrintString on that. You should at some point find a part of the code that calls, and a part afterwards that doesn't call. The problem then sits in the middle of that.
Us explaining you your problem is not a good way to learn
Question for people here, I don't exactly know where to put this in so putting it here. Im trying to find a way to make a system where I can place a file in the user's dedicated server once they verify it to allow it to show up in the server browser. Does anyone know of a way to do this? Im not sure if there is a function in UE that allows placement of files or potentially just modifying a file to place a key in that server. If someone could let me know if you have ideas and ping me that would be great!
Wanting to setup some sort of system that makes users verify their server before being allowed to show up on the server list and unsure of the best way to do it.
@thin stratus First I have this that I can't solve and can't play the game to test my print strings
rename your event, because something called LaunchLobby already exists.
as the error says
but in the tutorials he calls it like that
look here https://youtu.be/y0DKAV26mgw?t=30
Welcome to Part 2 of my UE4 Steam Multiplayer course, where we're redoing the old Epic Blueprint Multiplayer tutorial by Wes Bunn from way back in 2016.
In this video, we'll be continuing with the creation of the Game Instance class and building out first widgets. We'll get t...
check exactly at the time code set by the video
That's an Interface event though, so it comes from an Interface class.
Do you have another LaunchLobby function in the GameInstance itself?
I also wonder what the Interface is for
It's not like you will have more than one GameInstance....
wondering the same myself.
i just for the hell of it, made a bluepint and the same thing
no problems.
now to delete.
Guess it's a typical tutorial of someone who hasn't figured it out themselves yet. But I guess it's nice there are tutorials at all
Just not that the user now thinks "Oh it's totally normal to make an Interface for a singleton class."
@thin stratus Don't think so, where in the GameInstance exactly should I look to see if there's another one ? He explained why he uses Interface class in his video, He tried to create an updated version of the multiplayer tutorials made by Unreal years ago, but updating it in some ways that he thinks are better and works in 4.24 and 4.25 (as the Unreal Tutorials were made for the 4.11 in 2016)
I won't watch the video, not having the time for it. The Interface doesn't make sense to me. You are free to write me his explanation of why he would do that.
For the "where to look": In your GameInstance BP on the left side you have a list of Functions. Check if one exists with that name.
Agree with @thin stratus
On the SteamGame Instance or BPI_GameInstance ?
Steam
interface makes absolutely no sense on gameinstance.
since you cannot actually change the class.
you can only ever have one gameinstance
Why did he do interface on his tutorials tho ?
Because he doesn't know better? You should always have in mind that the person teaching you doesn't know what they are talking about.
Everyone can make tutorials. Doesn't mean they are correct.
Check if you have another LaunchLobby somewhere in your event graph
Or try to refresh the node via rightclick
True but I was looking for one for the 4.25 as the one made by Unreal was for 4.11 and it was out in 2016
Already check but none is there
Hi , somebody who are into multiplayer , can shade some light on me, I am working on my custom physics simulation , few years already , I was made pretty nice SP demo , next reasonable step will be to people can drive cars, in MP, I know MP for vehicle is P in the A, but i wanted to go step by step . My question is , what was change in term of MP from version 4.17 ? , in which I still doing my things, I am not doing any prediction yet , and in 4.17 my vehicle have smooth movements, in 4.22 it have choppy movements.
Thnx
@vagrant grail Unfortunately in BP, a lot of people are relying on interfaces because they don't understand class inheritance and casting or for some reason find it confusing. They think it's easier to use interfaces to get around casting despite that it's more or less the same thing. You'll see it quite often in the blueprint channel.
@kindred widget The guy in the video talked about Interfaces being more performant than casting and stuff like that
And now I'm stuck as I followed this video and made alot of changes, is it possible to go back and remove everything I did following these videos ?
Interface being more performant? ๐
Yeah he said that
That is a dumb myth propagated by people who don't do their own testing to understand things and just repeat what they've been told. Casting doesn't affect performance in the slightest. The Isvalid check in the cast does, but pure casting does not. And even the isvalid cast is still faster than interfaces in blueprint. You can test it yourself by making a simple loop that casts to a class to get a variable, or calls an interface function to get the same variable type. Interfaces are slower.
Yeah some other people told me that, so I unsubscribed from this guy
Is it possible to go back when my project was a bit cleaner ?
Not without source control. Or luck. How many different classes did you change?
2 anti-patterns here:
- Using interface for the purpose of performance. Interface is not related to performance at all.
- Premature optimization.
So yeah if that's what's in the tutorial, run.
@kindred widget I think I have 2 BP that are changed, but they were majorly created only for this tutorial
If you want to revert them back to the way they were, you can check out your saved folder. There should be a Backup folder in there. Can check if you have a backup of that class at a date/time before you started.
I'd save what you already have though just in case.
but isn't it possible to backup the whole project instead of separate files ?
Sure, but not automatically. Not without a backup program that'll do it for you.
oh damn, why Epic Games didn't add this feature tho ?
Source control is kind of a rite of passage for developing anything. There's not really a point for Epic to do it, because most people are just going to use their own methods anyhow. Bear in mind that most serious projects are worked on by multiple people on multiple machines. There's already quite a few solutions to that available. Not really a high priority I'd assume.
For Solo developers, it's as easy as just right clicking your project folder and sending it to a new zip.
Yeah but automatic saves and no third party softwares required would be awesome
I wouldn't complain. But I can definitely understand why they don't bother.
Interfaces are a design thing btw, not a performance thing.
Has anyone using steam api directly had a problem where the steam callbacks are always called twice?```
I think I figured this out. The STEAM_CALLBACK macro functions were also called on some engine object that wasn't added to any other class
Is there a solution for when your clients character is at a different location on the server than where the client has moved their character? Had a moment where a friends character was next to mine in-game, but according to a screenshot, he was on the other side of the arena.
The character is set to replicate. Even upped the priority by 1. Beyond that, don't know what else to try.
I'm at a loss for what to try. Whenever I launch my server executable (4.25) I get errors loading PhysX libraries:
however, all the files ARE in the correct location, they just dont have the "PROFILE" suffix:
Good morning. Should I be wary about replicating a struct this large or are integers and names reasonably small?
Integers are, names are not
Int = 32 bits per element
FName = replicated as a string essentially
anyone have any statistics on unreal's multiplayer system
like benchmark tests
and network tests
or straining the network connections with thousands of actors
for example?
Probably nothing useful. Usually any network related profiling is entirely dependent on your game
I have this weird thing where a reference to my custom character class isn't being properly set and is somehow null on both client and server when playing on client
However, when playing on just the server, everything works okay
Thanks, Jambax. Do you think replicating that struct every ten seconds give or take would be fine then?
Well your first issue is that TMap can't replicate
TArray is the only container with replication support
u should rly never want to do that lol
replicate a tarray
any of u read about basic Big O stuff lol
think about how expensive that is
replicating an array isn't necessarily a problem, UE is quite smart about it
But it's not fast. And if the length of the array changes, the entire thing is sent
I don't need to send it every tick. Probably just once a match.
There's FFastArraySerializer but it's C++-only
One-off data packets I wouldn't even worry about
But you probably want to RPC them rather than replicate them
No point having the Server constantly checking properties that only send once
Or, if it's an "initial" property, use COND_Initial on it
It constantly checks them eh? I guess it has too...
Yeah, and individually per connection at that
So if your actor has a net update frequency of 100hz, all properties are being compared against their most recent changelist state at 100hz, for each connection
Okay. I'll look into doing it with an RPC. Thanks!
If it's one of those "the match is over here's all the info you need" kind of structs, then yeah RPC makes sense