#multiplayer
1 messages ยท Page 378 of 1
So ideally you can cache your player state on your char
And then access it as you like
i have the end of when projectile has hit the player in Projectile BP
and now...
maybe i could set owner to player controller?
to get player state from that?
you can get the PC from the pawn too
so you dont really have to, but sure why not
it shouldnt make any difference
since you wanna score the player, not the character
Just set the owner to whatever is more comfy for you
Dont use that node.
uhh
now you just score whatever pc comes first
not the one that necessarily did the shot
so i need then GetController?
you wanna get the controller of whatever fired your projectile
Not exactly GetPlayerController gets the local controller only executed purely on the client. If executed on the server will return different things on dc server and listen server
otherwise some other player is getting the score
GetController ()
Yes
you wanna get the controller of your set owner specifically
That one. If self is your pawn.
after it hits someone
Yeah looks right
it will give 1 score per hit, not kill, seems legit
XD
i could make it so killing someone gives 2 points
you will need a different event for that then
Yes
after you take damage
check on whether or not you have died
and if so, pass the instigator of the damage
to properly award the kill
Or you can reward players that hit the people
or that ...
what i want to do - 1 point per hit (takes 5 hits to kill someone) and 2 points for kill, so you have something why you want to kill someone but not just hit him
I see
and per death it takes away 2 points
nvm me then
Yeah can do aswell, just check the hp of the hit person
yep
and it fixed my scoreboard too, because points were not going for players they should be going
Nice :) glad to help
Also something else, if you cache your playerstate in your player controller
mhmm
You will avoid a cast
another problem xd
And that will make the code to run faster (to sumarize)
when i get the health of player, it shows different on server and client
is that a blueprint thing?
BP
Because I usually dont bother caching my casts
afaik it's more of a compiler thing in c++
when i check health client sees 3, server sees 2, client sees the health but +1
Its better to cache when you are going to use a lot a variable
maybe cuz client does that first ยฏ_(ใ)_/ยฏ
Make sure you get the appropiate health value
Because the rpc takes a lil bit to replicate
You avoid this problem by using an onRepNotify on the health variable
oh i did 0.05 seconds delay
and it fixed
it was in that Projectile BP, not in character
but i dont want to go through several BP's to change 1 variable, i have my solution ๐
same with fixing stuff - just get duct tape and tape it together... if it works it works ยฏ_(ใ)_/ยฏ
what he said
so god damn much
I am only now getting around making stuff a bit more clean
and consistent in naming lol
im trying to do it the cleanest way
although you should try to build stuff in a way that's easily extendable
and not too locked down
so like everything of the 1 thing is in 1 BP, so it doesnt go to other and back
yea
goes doubly so for any multiplayer project
because you gotta do client prediction and stuff
and it gets kinda messy
i cant decide... if player has 5 hp and 1 hit takes away 1 hp, 1 hit gives 1 point, 1 death takes away 2 points, then should for kill it give 2 or 3 points?
thats a design decision
and we dont really know your game well enough for that I suppose
mhmm
Just do what you like more :P
time for meth math
Hehehe
๐
that game im making is a deathmatch game with few minutes on timer
Quick question. A variable acquired in C++ beginPlay, returns null in BP begin play
Im the opposite, I give points for everything
da fuq
@magic crest called the parent on BP?
yea you gotta call the super
Right click on begin play node and click on "AddCall to parent"
@magic crest
4 points total
If you dont call the super method it wont execute
so i will better have it on 2
i know i had it at some point. one moment
i wont be able to get that game to steam
thats why i use "SELECT YOUR NAME"
thing on joined session
and for testing i always name 2 players - xd and xd1
have you seen what gets on steam? :v
i wont be able cuz i dont have money im not even 16 xd
how to open level as a host so everyone else goes with him in BP? (im using "Open Level" and "Open <Host IP>")
try ServerTravel
serverGravel ๐
Servertravel + options string
don;t forget ?listen
In BP's you need to execute a command
Ye
Hey how would I make this work for all clients and not only the pawn owner? http://prntscr.com/iqkyna
NetMulticast RPC
No idea what you just said lol
You have to tell each client to play the animation
Okey how do I do that?
you're working purely with blueprints right?
Yep
this should help
tl;dr an RPC is just one game instance telling another to run a function
a NetMulticast in specific is ther server telling ALL clients to do a thing
Okey got it
@magic crest the ReceiveBeginPlay() (BlueprintImplementableEvent with blueprint DisplayName BeginPlay) is called from AActor::BeginPlay(), which is in turn called from your Super::BeginPlay()
so anything in your c++ class that is above Super::BeginPlay() call will execute before blueprint
and anything else after
Thanks @winged badger Btw, does your name mean 'evil'. If so, fala na pomoci ๐
can anyone help with my problem above?
@twin juniper your multicast is most likely faster than the replication of winner, i would not replicate the winner but send it with the multicast
like this?
y
@magic crest The Parent BeginPlay calls the BP one. So if you override it you mighr want to move the Super call to the end
Damn that's old. I should have scrolled
Hi I'm using dedicated I'm connection with ip. I am using steam but ฤฑ don't want to use matchmaking.(Some of the available Steam Interfaces include:)
How do you guys generally handle optimization in multiplayer games? I'm hoping there's an easy system that allows me to hide certain objects from a single player but show them to other players. Like if the player disables Foliage for example, to simply hide all the foliage meshes in my level for that player alone. I know this can be done but is there any useful documentation you can point me towards?
@tulip creek This might not be super helpful but if the actors aren't replicated you can just hide them client side. Otherwise I think you might find network relevancy stuff useful
in my game i sometimes need things to be invisible for non-local players so I have a multicast version of SetOwnerOnlySee that I wrote. basically it just checks what machine it's on and sets visibility appropriately
dunno if that's what you're looking for. let me know
Hello. Can any recommend any decent tutorials on how to create local/online multiplayer via blueprints? I really struggled to follow along with the Replication Live Training video Unreal put out. I am mostly looking to handle replication for now. Ill worry about the rest of the stuff if I ever get the hang of replication.
Can you do dedicated server with steam (advertised by steam) on BP project? Or do I need big boy code to do it? Seeing mixed results in searching online.
@hard lance have you looked into the Multiplayer blueprint sample?
for whatever reason i can't find a link to it. it's in the epic launcher, somewhere, but here is the docs https://docs.unrealengine.com/en-us/Resources/Showcases/BlueprintMultiplayer?utm_source=launcher&utm_medium=ue&utm_campaign=uelearn
The project itself is kind of wonky, but the logic is there in theory
I've also found that this plugin is EXCELLENT https://forums.unrealengine.com/community/community-content-tools-and-tutorials/41043-advanced-sessions-plugin
Advanced Sessions Plugin
Message to users 09/08/2017
I'd like to note that the original intent of this plugin was to shore up blueprint support for sessions
it exposes most session functionality to blueprints so you won't need C++
thanks, ive got listen host working, I can see it and join that session, but not when run it as dedicated server running on my server VM
in any case, from what ive read in the meantime here, it seems like i will have to use some big boy code
@lusty dust I'm not totally sure about your issue but I think you'd more or less need to set up a steam session on your ded the same way you would on a p2p. I believe there's a function in the advanced sessions plugin i posted
(in order to get it advertised)
I use a dedicated server, I do not want to set up sessions with "Steam Create Sessions" I want to connect with IP. I want information on SteamID, inventory and friends list, how can I do it? @thin stratus
@high heart Thanks. I cant seem to find that project either. I assume its been deprecated. But I can take a look at the docs you linked. Thanks
@hard lance it's in the learn tab under "Gameplay Concepts"
Multiplayer Shootout is the one
still i think the advanced sessions plugin is probably better
Thanks @high heart. I will take a look at that project and do some research on the advanced sessions plugin too when the time comes. I haven't hooked up a plugin yet
hey guys so i have a actor that simulates physics in my level, but the client cant see it at all. I have replicate movement checked on all the components, and yet the client still can't see it. When I have simulate physics unchecked he can see it.
I have a replicated bullet, when hitting a wall it does:
- call multitask RPC, to play a spark VFX
- destroy itself
Now I must add a small delay between 1) and 2), otherwise the client won't execute the RPC since it's marked as pending kill (destroyed)
Is there a cleaner way to do this? A 0.2s delay feels kludgy
you could call the multicast then TearOff
it will make it stop replicating
then you can destroy it on each machine locally
@verbal wave Why not simply call server shot , do traces or whatever you need to do, have a struct with needed data, replicate it and then re-run the whole 'shot simulation' on the client once the struct replicates.
Something like this:
void WeaponClass::ServerShot_Implementation()
{
if(trace)
{
HitDataStruct.HitLocation = Hit.Impact;
}
// Call manually, since it won't trigger on server
OnRep_HitData();
}
void WeaponClass::OnRep_HitData()
{
PlayShotEffects(HitDataStruct);
}
void WeaponClass::PlayShotEffects(HitDataStruct& HitDataStruct)
{
SpawnParticleAtLocation(HitDataStruct.HitLocation);
}
.. and then during gameplay when Fire action is pressed, this gets triggered. You bound it to an action in playerController.
void PlayerClass::OnLeftMouseButtonPressed()
{
ServerShot();
}
Someone correct me if I'm talking rubbish, but this is how I handle my shots. Rama's recommendation from the wiki
Works like a charm.
@magic crest my projectils are slow (grenades, spider webs etc). I can send a replicated struct to the gun or the pawn, and play effects on hit. However since the projectile has seperated actor I want to seal everything inside it.
Your methodology is awesome though! I can already think of scenarios that this can apply really well, thanks.
Oooh, sorry. I wasn't aware you had projectiles. I immediately thought 'fast' bullets.
What about SetLifeSpan() ?
@winged badger I forgot TearOff, gotta try it out. Thank you
@magic crest still feels a little naughty ๐
@verbal wave I saw that on udemy course, they said it exists exactly due to latency
@winged badger actually if the TearOff RPC arrives faster than PlayEffects (due to terrible network conditions), PlayEffects still wouldn't execute, right?
@magic crest makes sense. much better than delay indeed
But, i'm puzzled. Are you not spawning the projectile over the network? Doesn't the projectile hit the wall on all machines?
or I can set lifespan first and set invisible / disable collisions for everything immediately
and its not a RPC
That's what I usually do. For pretty much everything, like equipping a wep. Spawn it hidden, start pull animation, trigger visibility, finish pulling out anim.
virtual void TearOff()
at laest, i don't think it is, it just needs to stop replicating the actor
it doesn't have to notify clients about it, i believe
@winged badger then the client doesn't know it's teared off. But I can include the destroy self part in PlayEffects, that'll work
@verbal wave Can you use my methodology and instead of playing effects, spawn the projectile locally with data (like direction and projectile speed) set on the server?
Or does the projectile change during flight? ๐
i also tend to spawn projectiles locally, server settles if they hit anything relevant or not
Yeah. All you need is quick data and then do slow animated things locally.
basically, i use the Fire(Pressed) to set state EFiringState::Firing
It's also a good approach to keep your visuals away from logic code in case youyr server becomes dedicated.
then replicate that state
so you can safely ommit the OnRep call on the server, since he doesn't need visuals displayed
and Fire(Released) to set EFiringState::Idle
that way i replicate stuff only when firing state changes
Exactlz, @winged badger . Just replicate states, like bools or enums and react locally
@magic crest for bullets they just play effects on clients when hit a wall. But for grenades I actually replicate their movements and handle everything server side because they may go differently because of players movement
bounce of of players?
grenade = replicated actor
yea
i see
so you just need to multicast the animation for character tossing it
and replication of grenade actor takes care of the rest
Personally, I'd keep the projectile non replicated. You can assume that the character's approximation simulation will be close enough (or even better than projectiles approximation movement simulation), so local projectiles will bounce of local players.
In the fps example, if you replicate the vector and launch speed, it hits the exact location every single time. I've even played with physics simulation. It was VERY close. Had a small deviation after a 100 shots
It was mainly due to fps drops having to run 2 instances of the game on one (fairly old) machine
Does anyone knows a good way to save my player info data which was prepared within the main menu to get over the connected session via open <ip>? I tried so many things which werent working ๐ฎ And of course its a multiplayer game so game instance is not a good option.
PlayerState?
bit of a strange issue im dealing with regarding my dedicated server
with a lower tickrate, no RPCs are dropped for any client but there are frequent and random disconnects all around
basicaly anything under 60
even tried 1 tick as an experiment + gameplay joke and i got disconnected as a spectator
so i know its not network stress causing it
but
setting the tickrate to 120, while dropping a lot of nonreliable RPCs, resulted in 0 disconnects
what could cause a lower tickrate to disconnect players despite the overall network stability being better?
there isnt a happy medium for no dropped RPCs and no disconnects, 60 disconnects players and occasionally doesnt display kill/death messages
@solar halo I have previously used the playerstate but it will be always reset after I have entered the session.
Hm
@inland pond save your user settings into a struct and create a variable for that struct in the player state which can then be broken
then each value can be set by the server as a replicated variable
I store stuff on PS and when I connect it's fine so idk.
So for example I replicate a variable in my PS and it carries over from level to level.
Yeah thats already downloaded ;P I have also tried his CopyProperties Override
@graceful cave Okay I will check. @solar halo Thats interesting I will double check if I havent made a mistake.
@solar halo replicated variables were only replicated if set on server side right?
I'm pretty positive you can only replicate stuff on the server.
derp you can replicate on client, but I'm only doing Replicated on the UPROPERTY and DOREPLIFETIME(class, var);
@bitter oriole Thanks! I think this was my mistake I have made ๐
That's what I was thinking, but then I remembered the Client decorator for UPROPERTY.
I dont get it lol. This is within my JoinMenu. The UpdatePlayerInfo gets called within playerstate on the server.
This is the event at the player state
And this section gets called on the gamemode right at the beginning. And already here is the player name not the correct one.
create a struct like this
and in your game instance or wherever you want to set the values
make this variable
get the variable in the graph and drag this off
restore all pins
then you can properly save values to it
then you can get those values in your player state
Thanks for your detailed description. Inside of the collapsed nodes I am using break. And the struct you were refering is in my case playinfo. Switching the node set Player Info with set member [...] still hasn't made my playername come into the game mode :S
actually im wrong with the last part
get a reference to your game instance in your player state
and get the struct variable from there
instead of creating a new variable in the player state
thats assuming you made the struct in the gameinstance to begin with
Does it work with your setup on your machine? I cant get it to work
basically your gameinstance should look like this
and your player state should look like this
Hi all, currently working on a multiplayer game, and the player can switch between 1st and 3rd person. When this is done, we have a 1st person representation of the gun, and a third person representation, and each has child static mesh actors for the weapon attachments.
In terms of the visibility chain, the 1st person weapon should only ever be seen by the owning player (bOnlyOwnerSee) , and then we turn on and off the 3rd and 1st meshes for that player via SetOwnerNoSee appropriately when the move into and out of first person.
Currently I'm having to call the same on each of the attachments meshes too, but this seems like a lot of micromanagement
Is there any easier way to setup this visibility chain? For instance, can I just set each of the attachments owner to the appropriate gun and then SetOwnerNoSee on the weapons, at which case it can go down to the children and do the same?
Aka, just call it on the weapon and that automatically calls it on the child actors meshes
@graceful cave Thanks for all the effort but its still not working. Ill give up <.<
@inland pond do all your players have the same wrong name?
you need to be on client-side exec when you fetch it
if they are setting it locally (or using Steam name)
then RPC that to the server
Do you mean from the game instance or player state ?
when your players enters his name, it exists only on his local machine
wherever you stored it
server can't get it directly
server can't query information from clients
But I call it on the server the storage function and it also arives at the server which I have checked with a print function (Exevute on Server Only)
so UpdatePlayerInfo prints the correct name?
this is the function I call from my Widget with the updated player name.(Thits function lives in the PlayerState) After this function I call open <ip>and on retrieving the playerinfo on the game mode of the new session its the default name. ๐ฎ
then you update it, and immediately transition maps?
Yea then I call open <ip>
but before you do call open IP
your client is the host
you can't set info on the server before you join it
indeed ... well
Damn so this is the big mistake I have made all the time. ๐ฎ But what can I do to get the PlayerInfo struct at OnPostLoginfrom the player currently connected...
its not ready yet OnPostLogin
if you grab the PS and test if its valid directly from the event
it won't be
Mhh then I need to call an event within the playerstate on beginplay and notify the game mode that a player now have a player name ready and update it to all players
And indeed the event would be needed to be called on the server
@winged badger Thanks Zlo I will try it
Omg It worked! somehow begin play from playerstate get called twice but thats another problem. Nice Thanks!
@inland pond yes begin play will get called once for the client and once for the server
So, I have a question on Begin Play spawning and "owning connections" https://docs.unrealengine.com/en-us/Gameplay/Networking/Actors/OwningConnections
and RPC calls: https://docs.unrealengine.com/en-US/Gameplay/Networking/Actors/RPCs
If I spawn an actor on Begin Play, it seems it has two owners (I checked via a simple print string), the server-side and client-side pawns, server calls an RPC on that actor and it's fine, client is not. So obviously this leads me to the actor that I spawned on Begin Play to either be owned by a different client (how?), it's sever-owned (I didn't do a Is Locally Controlled or Switch Has Authority) or not likely unowned.
Basically, can anyone tell me what's going on exactly so I can wrap my head around it? I tried doing Is Locally Controlled branch before, and sure enough it did have one owner of that actor. The issue then, it didn't look the same to the other clients. But the server saw it just fine.
TL;DR: Begin play spawn looks great on both client and server. But RPCs drop from Client. How can I achieve the same thing, but ensure that I can do a ServerRPC call to that actor while maintaining the same visuals.
Any help would be greatly appreciated. Thank you.
@worn nymph nice, was just needed a switch has authority ๐
you can only call server RPCs on actors and components that have a UActorChannel
meaning they are attached to your PlayerController
the server versions of those actors and components can freely interact with server objects, as if it was a single player game
so you don't do GetSimulatedActor()->DoSomethingServer() on client
instead, inside one of actors/components owned by your PC you do ServerDoSomethingWithSimulatedActor()->GetSimulatedActor()->DoSomething()
word Server in example function name indicating that it is a Server RPC
Tick() and BeginPlay() happen on every actor on both client and server, independently
techniques to filter what you want to do depending if its a client/server include SwitchHasAuthority (in BP) or GetOwner()->Role == ROLE_Auhority (c++, GetOwner() not required if you're doing it from pawn or PC)
IsLocallyControlled is good only if you wanted to say, display a widget over the item you're looking at, or do something equally client-specific
and only if your PlayerPawn is accessible with self(this) or GetOwner() or GetControlledPawn()
(in other words, if you are checking IsLocallyControlled from an object owned by your PlayerController)
Do steam sessions expire after an amount of time? I've noticed that if I sit in an open lobby (in my game this is just a normal steam session) for an hour or so nobody can find my game. It's also possible that advertisement is just failing sometimes, but it's proven a bit tricky to test. Anybody @here have info about this?
has anyone used the messagebus and ue4's networking at the same time?
@wild prawn ? ๐
basically i want finer control over who gets what when than ue4 networking allows, so pub/sub is perfect
@terse dawn I get around the "all server RPC's must be on the PlayerController" thing like this: https://github.com/GeorgeR/RPGBase/blob/master/Source/RPGBase/Public/ContainerInstanceAccessor.h
If I want to update a skeletal mesh (was created in the constructor c++ and bReplicates is true) to all the player would I have to use a NetMulticast ??
//.h
UPROPERTY(VisibleAnywhere, Replicated, BlueprintReadOnly, Category = Default)
class USkeletalMeshComponent* TMesh;
//.cpp In the Player file
ARPGPlayer::ARPGPlayer()
{
bReplicates = true;
TMesh = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Mesh"));
TMesh->SetupAttachment(GetMesh());
}
void ARPGPlayer::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(ARPGPlayer, TMesh);
}
//.h
UFUNCTION(NetMulticast, Reliable, WithValidation)
void ChangeMesh(class USkeletalMesh* Mesh);
//.cpp
void UTESTing::ChangeMesh_Implementation(class USkeletalMesh* Mesh)
{
if (Player->HasAuthority())
Player->TMesh->SetSkeletalMesh(Mesh);
}
bool UTESTing::ChangeMesh_Validate(class USkeletalMesh* Mesh)
{
return true;
}
multicast probably the easiest method, you could use OnRep / property replication but YMMV either way
@hidden thorn "update sk" ?
Like the SK moving or animation?
or, switching them out
^
I see now
yeah, MC or RepNot
I am using MultiCast as it seems easier and since I am new to networking I will try to understand the RPCs first and then use OnRep (so far I didn't had to use them)
With what I have there the servers' mesh changes but the clients' mesh doesn't not on his own screen or on the server.
your mileage may vary.
That means nothing to me, what is that supposed to mean?
I've never heard that before
seems like for the mesh you'd want everyone to know asap and won't be doing it frequrently, multicast might be useful, but replication will ensure things actually stay in sync with what the server sees, which may or may not be important
Ok
Alright
Has anyone ever experienced "collision" or character offset issues as the client?
This is in VR btw, but may be applicable in other MP games
why does no one ever participate in my fun threads: https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1443897-multiplayer-exploits-and-how-to-fix-them
In creating my RPG Base plugin, I've been thinking about possible hacks and how to stop them. Can anyone think of more?
Hack: Player lags, buildings don't
Morning...
@heavy marlin Reason why is because the hacks & solutions you mention are basic networking principles which has been documented countless of times
you guys might find this useful: https://forums.unrealengine.com/community/community-content-tools-and-tutorials/1443976-free-profanity-filter
I needed a simple profanity filter so I made a plugin. Right now it only checks if a string, name or text contains a profane word and returns true/false. Each
@night jay they may be basic but seemingly every game that comes out has the same exploits
Well alot of indie devs don't do any proper network research
funcom made a few MMO's then released conan exiles and it is/was full of exploits
same with SOE
so i dont agree
Then the decision was concious
they patched them though
UE4 has replicated authoritive movement from the server from the get go
The 2 hacks you've mentioned would already be mitigated if you follow basic protocols for this
yes i know i was just trying to start the conversation
If Conan messed up with this, that means they tried their own solution which failed
Golden rule is if you trust the client you gonna have cheaters
This is a good book as well
don't forget the launch exploits The division had on PC... client authoritative ammo... cheat prevention is often overlooked
Meh
TBH, you shouldnt' get too wrapped up in that
Unless you really are trying to push competitive
Cheaters are going to cheat
You won't be able to stop them
No.
But still competitive
im more concerned with item duplication
Not every MP game is trying to be in teh competitive scene
i mean there are so many ways to do it
It doesn't have to be in the competitive scene to be competitive
Memory dupe is too easy
BEing competitive means wanting to win, nothing else
But when someone talks "competitve" in MP games
It's still a competitive game
we're talking eSports level
Then call it esports
competitive in games means .. yeah that
every game is competitive to a certain degree.
That's the point
?
So you're gonna have cheaters in any competitive game
lol
yeah so its less about the fact people cheat, and more about how it impacts on other players
If you waste too much time on things people are going to circumvent anyyway
i dont care if someones duplicating a pot plant
You are going to lose scope way too quickly
But just because people will be able to circumvent cheating, doesn't mean you should have no kind of security whatsoever
omg australian book prices are horrific
I never said that?
I just said, don't waste your time on it
Implement some basic stuff, move on.
@night jay is a pedantic pete
Gee, thanks
I had to Google that...sadly
haha
Me too
I thought he said Peasant
I was like..peasant, okay
But anyway, there's nothing wrong with being a worryrat
Which seems to be close enough to that word
Do people actually say pedantic
I've just seen cheating destroy a games' lifespan, be it competitive esports or not
yes
Like, I just said it outloud and it just sounds weird
mootjuh my point was while we were trying to discuss how much you should worry about it you were arguing what precisely constitutes a competitive game
it was funny
I don't disagree that cheating will ruin games
But, if you ever get to the level that cheating is a huge issue
Then you are probably rolling around in dollar bills
naked
yeah thats true
And if you have that kind of money
You'll be able to license out some tougher cheat prevention
you can hire a network wizard?
As a programmer you would probably not see all those dollar bills yourself though
But for most on here, that's not their biggest concern. Or should it be.,
yeah so you pay them a pittance and throw cake at them
Depends, you can opt into royalty on top of salary
while you do wheelies in your segway
Anyways regarding your concern regarding item duplication, same story as character movement
The server manages your inventory
Yup, but also, you can just put it in the cloud ๐
Isn't that the cloud
Oh yeah
I'm going to make a quick check on server, to see what spawned, see what people got in their inventory, make sure it's legit. then if so, beam it up to the DB.
when they log in or if they want to server travel/go into Single Player mode, they can take what they have
Hey.. which object do you guys keep responsible for loading / streaming levels? GameInstance or something else?
Yeah, that
alright
yeah gameinstance is boss
erm.. how do I forward declare a struct? I'd like to use the FLevelStreamingLoadedStatus in GameInstance, but I'm getting errors. I got it to work by including the .h needed. Is this the proper way?
the include is in MyGameInstance.h
Thnx
I have this thing setup by one of the designers, but I'm not too familiar with BPs so I'm not sure how this should be transfered to C++.
Currently this is on a character which is replicated. Basically, the server needs to call RepLoadLevel and then magically, this gets called on client. How do I declare the RED thing in C++ (is it a multicast dynamic delegate) and which object should it be declared on? Does the objecct need to be replicated? Is GameState a good place?
Ignore the logic (branches)
This is in details when RED thing is selected
or is this just a normal RPC?
Ok. I think I got it. Please, correct me if I'm wrong. The blue RepLoadLevel node is a UFUNCTION with NetMulticast and the red node is the implementation, yes?
Was just curious if you can work on a game using the pre-compiled binary version of UE4 from the Epic Games Launcher that is intended to eventually be a dedicated server based Multiplayer game.
Basically is there any challenge moving from Epic Games Launcher to Source compiled once we decide to work on Multiplayer?
is there a way to get owner only properties to update to a new owner, or do I have to send them manually when to initially update the new owner
@heavy marlin message bus is not intended for multiplayer. it's primarily meant for distributed applications on the same network at this time.
you could set up something that works over the internet, especially with the TCP Messaging plug-in, but that will require some twiddling. there's currently also no way to add network endpoints programmatically.
i think you'll be better off just bending the existing Unreal networking to your needs
so many people trying to connect to my game
that the servers literally shitting the bed
lmao
Does UE offert funtionality to "transfer Host" ?
In older games, when you played Multiplayer and the Host disconnected, you became the Host.
Would be useful in Coop Games
if any1 has the spare time, i would appreciate the view, thanks. this issue has halted work for 2 weeks now :/
You would need some sort of database, but it doesn't necessarily need to be SQL
Or you could host it in a third-party service
Anyone know how to make dedi servers use all cpu cores?
It seems to only be using one
@twin juniper All game logic in UE4 is on one core only
Is there a reason for why this is happening??
//.h
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Clothing)
class USkeletalMeshComponent* BottomMesh;
//.cpp
void ARPGPlayerState::ChangeMesh_Implementation()
{
Player->GetPlayerOutfit()->ChangeMesh(Mesh, Player->BottomMesh);
}
//.h
UPROPERTY(VisibleAnywhere, Replicated, BlueprintReadOnly, Category = Character)
class ARPGPlayer* Player;
//.cpp
void URPGPlayerOutfit::ChangeMesh_Implementation(class USkeletalMesh* Mesh, class USkeletalMeshComponent* MeshComp)
{
GEngine->AddOnScreenDebugMessage(-1, 2.0f, FColor::Green, "Change Mesh");
//This doesn't work, it changes it on the server but not on the client
Player->BottomMesh->SetSkeletalMesh(Mesh);
//This works
MeshComp->SetSkeletalMesh(Mesh);
}
Hey people!
Is open <ip>:<port> the only way to connect to a server?
@gloomy tiger APlayerController::ClientTravel()
@wild prawn thanks for the tip, ill take another look at what I can do with the built in networking
Does anyone know how to give each client(and the host) a number and then see who has a certain number and give them a certain role in blueprints? I've already asked in #blueprint but since I can't figure out my issue I thought I'd come here
@tawny raven If you're using sessions or steam sessions there's a unique id built in
I am using Steam Sessions.
Get Unique Net ID will return a unique number
Get Unique Net ID From Player State is usefull too. In game state there's a player array
the index of the player array is usable but it's probably better to use unique net id I think
ive been having the same issue for a while and still havent found a good solution
when im hosting my game on a listen server, there are no disconnects
on a dedicated server, players frequently disconnect whether its hosted on a VPS or my own machine
ive been disconnected from the server on my own machine before
set the max packet size and client netspeeds really high and that didnt change anything
happens at any tickrate it seems
sometimes its a standard disconnect and other times the screen goes black and all the hud elements return N/A implying there is no owned character
logs are your friend @graceful cave
the server console just says what it says during a healthy disconnect usually
sometimes it says they timed out but doesnt give any other info
hey guys so im trying to set a skeletal mesh, but the client can't see the mesh being set
Theres the target which goes into a multicast event which then goes to a run on server event.
has anyone got any idea what may be happening here? It seems the animations aren't replicating properly outside of a certain radius of other players on the network. The character seems to be fighting with an X-Axis variable somewhere when that radius is exceeded
Hey guys, how would you link two pawns together? Like restrict their movement so that they canโt move more than some distance away from each other?
In a multiplayer game of course
On separate pcs
This is supposed to change the mesh on the weapon pickup, it is changing, but he just can't see it. It's a visual thing. The Server does everything just fine.
@graceful cave and do client logs have anything to add?
@nova ermine if you are multicasting, its server event, then multicast event, never the other way around
yeah thats what I have @winged badger
@kindred geyser the movement animations should be working out of the box
without any additional replication
@nova ermine put a print node here and to make sure its getting to that point
too low resolution i can't read anything on it
yeah thats what I thought - however I'm using a TurnInPlace (rather than RootMotion) system which somehow is conflicting with the character's direction when rotating. Been trying to figure this out for days now lol
@graceful cave it does, it spawns the weapon in the clients hand so I know it fully gets through it all
who is unable to see the weapon in his hand?
No they can see it spawn in there hands, but the client can't see the weapon swap onto the ground
are you doing any by-hand replication @kindred geyser ?
@graceful cave
because that manequin was flickering just about at the usual net update frequency
id still try putting a print node right before it changes the mesh on the ground to make sure the client prints too
should ideally see Server: and Client 1: in the console
yeah i am passing some variables to the server manually when the turn in place takes place, which all seem to be correctly implemented as far as I can see
triggering an animation by hand maybe with RepNotify?
hmm. I will take a look. thanks for some direction.
it looks like client is simulating movement and runnig the animation
but something interrupts it about 10 times per second
what i can't understand is how it's working when within a radius that is close to other players, but outside of that zone it starts to play up
@graceful cave okay so the client doesn't print, how do I fix that?
did you tweak the NetCullingDistanceSquared?
no i dont think so, will take a look
make sure every branch is checking replicated variables
the client and server may have different instances of whats being checked
do I have to set the variables to replicate?
yeah and make sure the server is setting them so all clients update
print at the start of your multicast to make sure the client gets that far
then check each branch
like all the variables? The booleans, and the object and actor refs?
btw @satan you can increase the amount of stuff beeing logged with console commands like "log lognet verbose"
yep i have that set
be prepared for spam, tho
you can print something from bluepint on GameInstace HandleNetworkError i think its called
that is easy to spot when you skim
like 200 x characters
and whatever logs are involved in causing it, will be just above that
i have that event in my gameinstance but it just prints the error message ingame for the client
its either ConnectionLost or the screen just goes black
without the client being aware of a disconnect
all widgets stay etc
so, no "graceful" exit to main menu?
judging by these settings, it seems this shouldn't be causing this effect
only sometimes
that usually happens when a RPC targets something that doesn't exist
or when you overflow the reliable buffer
most likely the reliable buffer
like multicast from a PlayerController, or a GameMode
is the reliable buffer something that can be increased?
its strange because theres literally 0 issues with listen servers
i only saw it once after one of my designers decided its a good idea to add a few multicasts in MonsterBase_BP
didn't have to go farther then just removing those for a fix
but reliable buffer overflow is pretty noticable in the logs
havent seen any red in there
you might not have something attached to a PC on a dedicated server
a component created in actor that can't tick on dedicated server, something like that
would be a weird design choice, but can also cause random disconnects
thats what i was thinking but it looks like everything has that checked
and its really inconsistent
i barely get disconnected at all and can go 4-5 sessions without it
also, failed validate can DC
but someone else with similar ping gets it constantly
or rather, will DC
failed validate as in?
code implementation of server RPC has bool MyClass::MyFunction_Validate()
in addition to _Implementation
if that function returns false, it means the client's cheating, apparently
its a UFUNCTION(Server, Reliable, WithValidation, ...)
ill have to look at client logs next time it happens
just close game immediately so its at the end
its strange that it only happens on a dedicated server though
makes me think theres some net setting somewhere that listen servers ignore
for example, i couldnt get listen servers to obey the NetServerMaxTickrate setting and had to cap my framerate
as host
or non reliable RPCs would just get dropped
so it makes me wonder if theres some other setting somewhere
thats uncapped on listen servers and prevented disconnects
so far ive only changed max packet size and client netspeed
@kindred geyser yep, w/e is causing it, its not there
replicating movement of attached components inheriting from USceneComponent can also cause all kinds of artefacts
excuse my ignorance... w/e?
whatever
oh lol
yeah, I'm having trouble sourcing the issue hey. Will be onto this until it is done. Its certainly a strange occurance
thanks for your time man
well, components that are attached get moved with the character normally
but if you replicate their movement as well, then you will get several sources replicating the movement of same character
yeah i had that issue on a different project, causing double speed animations on the client
and the fact that one packet was sent first, does not guarantee it will arrive first
but that was because i replicated the variables twice
the funny thing is, on that project - this wasn't an issue lol
the radius in which it happens might just be that so close some variable is below some threashold for MovementComponent to try and simulate it, so it doesn't
hmm interesting
so perhaps i'm assuming the wrong culprit
radius might be irrelevant
i'd definetely look into why its happening, and not why its happening only over 1000 or so UU away from the observer
duly noted
(mind you, this was a guess on my part, never went to read the code how MovementComponent simulates movement)
but your NetRelevancy radius is 15000 UU, and that flickering happened much closer then that
as far as I'm aware, this system of TurnInPlace isn't the norm when it comes to rotating the character with animations... its typically done with RootMotion - so I must be missing some form of replication when the Rotate Variables are passed on
well, server will definetely replicate RootMotion and correct whatever client thinks the position is
unless you turn off ReplicateMovement, i think
in which case it might rotate right, but fail to move, depending on your setup
I know it has to be something simple I'm missing - the code that initiates all of this seems to be correct. However I've checked all the available boxes that are relevant to this situation. Obviously not everything though ugh
back to the drawing board
thanks again, Zlo
found something finally!
[2018.03.15-23.42.50:612][363]LogNet: Error: UActorChannel::ReadContentBlockPayload: ReadContentBlockHeader FAILED. Bunch.IsError() == TRUE. Closing connection. RepObj: NULL, Channel: 9
[2018.03.15-23.42.50:612][363]LogNet: Error: UActorChannel::ReceivedBunch: ReadContentBlockPayload FAILED. Bunch.IsError() == TRUE. Closing connection. RepObj: NULL, Channel: 9
[2018.03.15-23.42.50:612][363]LogNet: UNetConnection::Close: [UNetConnection] RemoteAddr: 162.248.92.183:7777, Name: IpConnection_6, Driver: GameNetDriver IpNetDriver_6, IsServer: NO, PC: BP_PlayerController_DM_C_0, Owner: BP_PlayerController_DM_C_0, Channels: 104, Time: 2018.03.15-23.42.50
[2018.03.15-23.42.50:612][363]LogNet: UChannel::Close: Sending CloseBunch. ChIndex == 0. Name: [UChannel] ChIndex: 0, Closing: 0 [UNetConnection] RemoteAddr: 162.248.92.183:7777, Name: IpConnection_6, Driver: GameNetDriver IpNetDriver_6, IsServer: NO, PC: BP_PlayerController_DM_C_0, Owner: BP_PlayerController_DM_C_0
[2018.03.15-23.42.50:612][363]LogNetTraffic: Error: UChannel::ReceivedRawBunch: Bunch.IsError() after ReceivedNextBunch 1
so you are replicating null somewhere
i wonder what could be causing that to only apply to certain players though
i think this means that client got rid of the object while dedicated server is still replicating the thing
heres a line before that actually
[2018.03.15-23.42.50:612][363]LogNetTraffic: Error: ReadContentBlockHeader: Stably named sub-object not found. Component: [12010]RocketProjectileServer_C_5.[12014]Sphere, Actor: RocketProjectileServer_C_5
that is useful
actually yeah i found something in the blueprint that might be causing it
its just a dummy object that everyone else sees and the actual damaging rocket is created only on the client
if the owner of the server rocket is the local controller, it just tells the server to destroy it
else it multicasts the explosion and explosion sound and then destroys it
so that makes sense
its getting destroyed twice by the server technically
im surprised it doesnt crash more often lol
ok yeah every time that message appears in the log its due to that actor
for a (probably pretty incomplete) explanation about stable naming
i'd guess that Sphere component reference is replicated at some point, and component isn't set to replicate (or rocket isn't set to replicate)
it does replicate
what confuses me is why it doesnt generate errors every time
but heres the issue
its set to owner no see since its a dummy
and the owner just destroys it since it has nothing to do with it
but other clients need to see it explode
after the explosion it goes on to destroy it
which is where the issue is coming from
and then server replicates it and boom
i really hope this is the issue anyway
cuz my game is almost done and this is the only major problem ive been trying to solve
it makes sense
so changing ServerDestroy to run on ownling client instead
should deal with it the way i intended
and it would be random
i think the replication wouldn't fail as long as destroyed dummy doesn't get GCed before server replication kicks in
(IsPendingKill == true) would not crash the clients connection, that is
i'd go for setting the dummy Hidden for those who don't need to see it
and destroy it on server only (replicated dummy) when its time for it to die
right im just thinking of the best way to do it
how the whole system works is
the client spawns his own rocket thats only on his client and thats what actually registers the damage
at the same time he tells the server to spawn the dummy
wait, client in charge ot telling the server if it did damage?
both of them are sent a variable upon spawning with the time they spawn so when the client rocket explodes, the server checks all dummy rockets sharing the time with the client rocket and calls the blueprint i showed you
yeah it does, im not worried about cheating considering this game is just something im gonna play with friends
there are other reasons other then cheating why its a bad idea to implement it like that
like client having only approximate information
yeah im aware that it can make weird things happen for the person getting hit by the rocket
getting killed by something that appeared to miss
but unless it has full ping compensation its nearly unusable
and its been pretty rare to get die to a clear miss even when playing with guys who have 150+ ping
well, i'd never go for a solution like that, but its your design ๐
haha yeah id never do it in a real game but if you saw what i was making youd probably think its okay
thanks for the help, i woulda never thought to check the clientside logs
yw
Am I correct that If I want to use the same map for different game modes e.g (FFA or TDM) I need to copy those maps like Arena01FFA and Arena01TDM and set each to their idividual game mode via game overide? using seamless travel from Lobby into Level ๐ฎ
How do you know if your issue is related to CPU usage, or Network Bandwidth?
@inland pond no, you shouldn't need to copy the maps, you should be able to have a sub-level you can choose based on the game mode. The game mode override can be done via server launch arguments for a travel
@glacial hamlet @LifeArtist#2293 You can specify a GameMode on Level Load
?game=GAMEMODESHORTCODE
Where GAMEMODESHORTCODE can be specified in the Project settings and assigned to a GameMode of your choice
e.g. TDM to BP_GameMode_TDM Class
right, thats what I meant to point @inland pond at
Yus (:
@glacial hamlet @thin stratus Thanks for you both responses. Is this is only working with the open command and not servertravel command?
Okay thanks ๐
Anyone have a checklist of things to check if you are having network issues?
define "network issues"
Left click => takes 5 seconds to process
Movement teleports you backwards
...etc
Complete disconnection
of a player
when u get > 8 players
lel
@winged badger I'm pretty sure that's all net issues
what does left click do?
it does if its exec is local
This is all the rpcs
anything with "reliable buffer overflow" in the logs?
no
im barely using it tbh
I get a ton of this though @winged badger
not the spawn actor thing, the other one above it
figured
looks like your movement simulation is taking too long
8 iterations x 0.05 = 0,4 < 0,406
but i never took apart a MovementComponent so can't really help you with why
@winged badger Another issue is that these three RPs are being called even when my player isnt moving:
SetMovementInputVectorOnServer
ServerMove
ServerUpdateCamera
Look at the number of calls
its ridiculous
did you add those?
ok
No not really
over what time was that profile result recorded?
@winged badger So im wondering
i had my netupdatefreq set to 18 on my player
could that have been causing hitching lol
that is udner 2,5MB
which is not alot really
3 seconds worth for a decent connection
@winged badger the default is 100
i tend to keep them between 2 and 10
It makes perfect sense for movement calls to eat up this much data
after all you are constantly updating the player position
they are also fairly compact per individual call
I think I fixed it
Thanks to this post:
`[โ]SheeEttinHobbyist 4 points 1 year ago
Go all the way into advanced permissions on the top level folder. Set yourself as owner. Give yourself full control. Set it to apply to folders, subfolders, and files. Set it to replace permissions on child objects (make them inherit).
That should recurse through everything and fix any permissions issues. But that's not necessarily your problem.
permalinkembedsave`
I just set my Projects folder so my windows user had "Full Control"
For some reason, I didn't have Write permissions to some files
Dedicated server environment, when I allow a client to uncap framerate the server starts rubberbanding him around when connected if the framerate is really high. Is this because the clients sending packat rate is tied to framerate? Should I do something like change the trickrate on character ?
NetUpdateFrequency
is how many net updates happen each second
and it definetely causes more traffic, ConsumeInputVector happens on Tick
and goes to server
it is a RPC so its not dependent on the NetUpdateFrequency tho
@winged badger how can u limit player tick rate then
to a certain value
And what's a good value?
I was looking at that, I'll give it a try in a few minutes
tick the actor @ 120 or something
you can get movement component to tick slower
independently? I was looking for it
they also have tickrates
Thanks I'll look again
It's really dumb that the FPS affects that rpc
seems poor by design
to have to restrict player fps
to save on performance
techniaclly, you don't
and there is no guarantee capping movement component's tick will improve anything net-related
if you have resources to spare you can increase number of simulation iterations there
Objectively speaking, sending less updates to the server will reduce the number of rpc calls to that function.
About client FPS's that was something tested on 4.18 and they did have an effect on server net saturation
Didnt dig enough to give a proper explanation but it does.
I didn't sniff the network data but when I uncapped and the output was 300+ the issue was really obvious.
It shouldn't be too hard to track down
Ayee
I would always cap it at something sane for myself but if a client wants to uncap it would be nice to allow it
if I want to alter the tickrate on the movement component do i need to go up to the parent? I'm not seeing any settings in the detail panel on my custom class
There are some variables related just navigate on your pawn/character details panel and check what you have there
Also in your DefaultEngine.ini
You'd like to adjust the NetServerTickRate value to fit your necesities
Will do - haven't got there yet but plan on checking out the network stuff when I get closer
In the meantime this fixed it - .00833 works out to about 120 times a second
120 ticks/second
although I could only set it on the character itself - there was no where to only do it on the movement component
could be because it's derived from a c++ class that's derived from the base class I dunno - I'll look into it
UActorComponent::SetComponentTickInterval()
Going all the way back to Q3 engine I remember there being issues that had to be fixed when it came to framerate and networked movement. If I learn how it works and can manipulate the settings that seems fine?
I don't have enough of an understanding to talk with authority on the subject but it's probably better to leave it open ended for flexibility. What I want it to do might not be the same as what someone else wants or needs
Why are people saying to increase tick rate to 60
the default is 30
But my question is:
Is this dependent on number of players? If more players, do we increase or decrease the value
You want to scale it depending on number of clients or are you asking if it scales automatically?
@twin juniper: tickrate is number of times per second that client/server syncs or to be more specific, sends data to each other. I don't know how it works exactly in UT, but in old HLDS servers I used to set 60 tickrate server side, as not many players would have monitors with more than 60Hz on those old days. Today, I don't think if it would be any reasonable to go over 120 in any multiplayer game (does modern monitors ever go over 120 Hz, could we even notice it for most of gameplayes?). For MMO/card game/etc. it can be waaay below 30 without any notice most of the time, but for FPS (like CS) it sounds way too few nowadays (I could propably end with 120 eventually 140 or so if I could get a few asks for that). More updates means more resources being used (especially net usage and engine simulations server side increasing cpu/gpu usage), what could end up with more costs, ie using amazon's gamelift, you could end up with more instances in use, what would increase your costs. You should balance beetween user experience and server costs. I'm sorry for writing a bit fuzzy, but I'm not familiar with UT servers, so I gave you general information about tickrate. Ah, and about limiting ticktare depending on number of players, it depends on UT implementation I am not familiar, so I can't tell you if it's possible at will (I bet it is), but it sounds like a bad idea for me, in general. I would rather end up with more instances than decreasing user experience at will.
@flat haven I am trying to attempt to get at least 50~ players on my servers.
I would need to lower it greatly I'm assuming
See example of Fortnite from few months ago: https://youtu.be/SwZ_NUruGTM?t=3m30s (at 3:30). It takes ~50 updates from players per second, but sends about 20 back. It varies from ~100 to ~2 players. Imagine you begin with 30 tickrate at 10 players, and end up with like 10 at 60 players. You need to balance user experience and server costs, but I can't go in details with UT, unfortunately.
Both Fortnite and PUBG are built with the Unreal Engine, and use amazons cloud service AWS to host their game servers. But which development studio is better...
@flat haven No, this isn't for UT I was just looking for information online and found that thread.
My game is basically a multiplayer survival game. However, it starts to have massive lag when player count > 8-10~
Which is VERY bad
So I am using NetMulticast to change a "ChildActorComponent" ActorClass which works but when I want to use AttachToComponent it doesn't work.
void ARPGPlayer::SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent)
{
// set up game play key bindings
check(PlayerInputComponent);
PlayerInputComponent->BindAction("TakeItem", EInputEvent::IE_Pressed, this, &ARPGPlayer::LocalChangeItem);
}
void ARPGPlayer::LocalChangeItem()
{
if (HasAuthority())
ChangeItem();
}
//NetMulticast Method
void ARPGPlayer::ChangeItem_Implementation()
{
LeftHand->SetChildActorClass(SomeClass);
LeftHand->AttachToComponent(GetMesh(), FAttachmentTransformRules::SnapToTargetIncludingScale, "HoldItem");
}
bool ARPGPlayer::ChangeItem_Validate()
{
return true;
}
So as you can see LeftHand->SetChildActorClass(SomeClass) works just fine on both server and client but the AttachToComponent doesn't, I assume I am doing something wrong and there is a right way of doing this.
I know there is a workaround, where I would move the mesh inside the bp so I don't have to change the socket but I want to understand why this isn't working.
Is world rebasing working in MP?
How would I restart a dedicated server via the graph/a C++ function?
Or just reset the current level
@ me if you answer please
has anyone used spatial OS yet? any opinions on that?
figured it out, with a plugin tho http://prntscr.com/iskjym
@past totem it looks like there are a few other ways too - https://www.youtube.com/watch?v=QNLYliyH3e0 https://www.youtube.com/watch?v=LseY59ffKK8
What is the Restart Game Node in Unreal Engine 4 Source Files: https://github.com/MWadstein/wtf-hdi-files
What is the Reset Level Node in Unreal Engine 4 Note there seems to be some discrepancy between what the comment says for this node and what actually happens...
@thorn merlin thx!
What do you guys think is the best hosting provider for multiplayer games?
I've been using Digital Ocean standard droplets.
amazon ec2 has a lot of scaling options and locations all over the world
It's also very expensive
Do you guys just contact the companies with info about your game and they host it (if they want)?
you can bring the costs down if you pay in advance, use linux - there is also this https://www.unrealengine.com/en-US/blog/discussing-multiplayer-infrastructure-with-gportal
havnt looked too much into it tho
I mean, to host for example a survival game for people to buy a server for
You still pay them?
@past totem ?
@twin juniper ?
I mean
We provide game server hosting services in both North America and Europe. Great value high performance game servers for Ark Survival Evolved, 7 Days to Die, Minecraft and more!
For example for them to add my game on their site
Would it cost money?
I would love to look into that though
I'm currently getting free servers from them for advertising xSD
I might ask them about it when I get more progress on my game
Anyone know right off why this doesnt work on clients well it does but its real jumpy going up not smooth on server smooth
@past totem I would love to know that too to be honest
hmm I can ask them now rl hold on
Please do!
I asked him (the manager) but he aint online rn
Also I'v kinda of a random question, if you are hosting a game it's because you are interested or beacuse you are getting paid from the developers? (or both)
It sounds like they are just interested, there is also a channel to suggest games on their Discord
The problem will be just getting them interested :P Which I'm sure if the game is selling it wont be a problem
is it possible to tell from the role/remote role whether a APlayerState is the local play's or not?
or is there a better way? (I'm wanting to avoid replication delay like you might get from Controller::PlayerState)
@twin juniper Because that's what makes the difference between average netcode (Fortnite) and great netcode (BF). In today's world, there is no excuse to use a low tickrate, unless you're intentionally bloating the bandwidth with bullshit (i.e. servers tell the clients how each pixel on an animation should behave rather than just sending an enum representing an animation state).
NetCullDistanceSquared seems to take a decent amount of time to update. Sometimes it NEVER updates the object
Also looks like my Multicast functions are playing for ALL players, even if they are not net relevant, based on netculldistancesquared
RPC is not replication @twin juniper
RPC is you explicitly calling a function over network
Isn't there a way to make RPC's only call when net relevant?
its not affected by tickrate, net dormancy, net relevancy or anything else
you could call in a Client function on the Controllers/Pawns
each one separately
and determina how relevant they are yourself
I think
Multicast functions
should automatically take into account relevancy
only call on relevant clients
its not how network infrastructure works tho
It's how it should work.
There will never be a use case for why a multicast would need to be still called on clients that are not relevant.
and
say you multicast from a GameState
or a PlayerState
a chat update perhaps?
You don't use multicast for that
You can just loop through PlayersArray and call client RPCs on them
objective updated animation
world event started
there are cases where you don't want multicasts filtered by their distance to some actor
especially if multicast happens in an actor that doens't really have a physical state
so its location is really not relevant
personally i think only purpose of multicasts is to notify users of something (animation, UI update, play sound)
oh
only movement should send RPCs on Tick and as it happens, does that out of the box
in #multiplayer its usually NetMulticast ๐
๐
@fleet sluice OSS UWorks
OSS UWorks
OSS UWorks 
notifying all users Victor is happy?
each would need to have an attached IsNetRelevant
thats in the actor class already
Notifying all customers when OSU is ready ^^
yep, and you'd need this per function
yeah but presumably the internal implementation of netmulticast just iterates through playercontrolelrs
and could just as easily do a 'is net relevant for' before calling
for each
but yeah, you could almost as easily do it yourself, so no biggie
It should, but that's not how it works
Internally, multicasts are broadcast to anyone regardless of relevancy
The relevancy check is done locally, on each client, AFTER they get the multicast'ed call
oh?
Spent the last month digging through someone else's shit in the NetDriver and its associated classes
hmm
There are even comments about how "things are like this because X but should be like Y"
i always imagined it went thorugh each server playercontroller and found the relevant actor channel
sad
well net multicasts are for visual fx anyway
and you can usually piggyback whatever you'd use them for when you're replicating some state
yah, onrep is my dearest of friends
like setting FireState::Reloading on the server and using its OnRep t trigger reloading annimation
speaking of, i had a nasty onrep problem a few days ago
with onrep(mycustomstruct)
sorry, onrep(myoldcustomstruct)
it didnt fill in the previous values in myoldcustomstruct
only the actual replicated var in struct
i did string logs in all the constructors and operators and found that it first ran copyconstructor with correct values... but then ran regular constructor and passed that to the onrep
like it was deliberately trying to sabotage me
this onrep(oldvalue) thing isnt documented at all
gotta love those undocumented caveats
i couldnt even find the code, because its all generated
what it should have done was obviously copyconstruct old value, set new replicated var value, then pass that into onrep
instead it did a completely new struct and set replicated var value only?
witchcraft
Is there a way to save and load save data to a server? I have an avatar with custom variables to morph the character, there are over 100 variables. I am using an SQL server for multiplayer (think MMO), instead of saving and loading over 100 variables to the sql table, is there a way I can write/read a SaveData variable?
save data is where? client?
fire them all into binary field mebbeh
long as you dont plan on changing the order of the vars in the future