#multiplayer
1 messages ยท Page 627 of 1
yeah reading up on GAS and prediction keys and such is a good way to get the general idea of how things should work
but there's still a gap between reading it and understanding the concept, and actually implementing it in another system
also interesting is it looks like physics might be something it handles out of the box. That'd be awesome
its so weird that one of the richest companies has so little documentation on the subject.
and compared to other engines it has way more features.
well, they aren't really "one of the richest companies" and it's not that weird if you've ever worked at a large company
and having way more features is one of the reasons ๐
GAS supports some kinds of replicated movement out of the box with root motion ability tasks, but if you want something besides that you probably want to go with inheriting from CMC and adding custom movement modes
wait what is custom movement nodes?
character movement component stuff
character movement component comes with movement modes like Walking, Flying, Falling, etc., and also a mode called Custom that you can define however you want, and within that you can have different custom sub-modes
so for something like wallrunning, you'd likely be looking at making a custom Wallrunning mode and coding how you want the movement to work there
the replication aspect of it is kind of complicated and you will need to either read the docs on CMC or watch some videos on it
yeah but isn't it a unit_8 so there can only be 4 extra or am i misguided?
do you mean the flags?
or the custom movement modes
i think as far as movement modes you can have 255 if i am thinking about it correctly
if you mean the saved move flags, yes you only get 4 i think, but you can send other parameters in saved moves besides just the flags
do you have any video recommendations? i feel way in over my head. i started unreal with the basic single player stuff but as soon as it became that it was so much more. i can usually figure out stuff pretty good but i am having a hard time finding information
i dont blame you. give me a min ill find a few videos
thank you
i had basically the same experience, everything was good and made sense til i started working on client prediction and multiplayer
https://www.youtube.com/watch?v=4w8vSss4YiI
so this one isn't really a tutorial, but he goes through an overview of how replicated movement works in the CMC, its a really good overview
https://www.youtube.com/watch?v=Of8SGBa3WvU&t=99s
this one is an actual tutorial that implements a sprint and dash
Try my C++ Survival Game Course:
http://bit.ly/unrealsurvival
Discord:
https://discord.gg/meFRZfm
In this video I show the proper way to make movement abilities for your characters. This is done by creating a Custom CharacterMovementComponent.
We start from scratch with a third person BP project, but here is the completed project you can copy code from: https://drive.google.com/open?id=1w9mMlKlcFhTrr8wsf1_76h_4v_k2ysei
can you give me a description of your game concept?
mine?
yeah
im making a 4-player co-op game that emulates the Challenge Mode system from World of Warcraft, except as a third person shooter. Basically its a pve multiplayer shooter in which you try to speedrun dungeons. The main thing I'm aiming for is a lot of build customization through class/talent selection, and a lot of freedom in how to go about executing a dungeon run.
also i know i threw WoW in there as my example, it has nothing to do with MMO scale, just that particular part of running dungeons that I really enjoyed before blizzard removed it
So Iโve a bullet BP, when it hits something I want to spawn some BP_ cube. In bullet bp I have the player ref. To replicate can I just create a server event in player event graph and then spawn ?
You could detect the hit server-side and spawn it in the bullet
Hi, anyone knows a alternative for DrawDebugLine? (its to heavy with lots of them)
Depends on the goal
Need to display paths, lots like a thousand or two
Is it for the actual game or as a debug tool ?
Is it 3D or can it be done in 2D on the screen ?
3D, and and for ingame
Is there any difference in network efficiency between C++ and Blueprints?
DrawDebugLine only works in editor, you could try using a spline mesh or a particle system
hhhm, right.. a particle sounds indeed as a good idea
I think a spline mesh is to heavy to, as a average path contains like a average of 100 segments
No
Depending on how long your path will be but you can set draw distance on the segments but I`d still go with a particle system because they look way cooler ๐
Except C++allows for optimisations of course
I would consider drawing this in 2D splines after projecting the 3D data to the screen
Like using Slate splines
Spline meshes could also work though, especially if you need 3D occlusion
And then yeah, you could also use particle lines
You mean NetSerialize function or is there more to it? Creating a C++ Struct with a NetSerialize function and using that in blueprints still works right?
Great, thanks
The bullet gets destroyed and cube spawn needs happen in a loop since multiple cubes
@meager fable | @bitter oriole So any idea how a ribbon particle could be spawned persistent and not following a actor? Thats even possible?
hello folks, I just had a question if anyone used Golang for their netcode with Unreal engine?
Why would you?
That is indeed the question
People have been trying to use different network layers than Unreal's because they had particular constraints before, but using an entire different language just for networking and then plug it into Unreal is definitely not something I've seen before
I tried this, when clients are joining the server the a new PlayerState is getting created which resets all the data. My PlayerState data from local map is not carried over to the Multiplayer Map.
Which is why after connecting, the player controller should " load the data on the client and RPC the server to write it on PlayerState"
Obviously you cannot RPC the server until you are on the server
If I am understanding correctly, On Post Login run RPC in that player controller locally to fetch the data from the Player State. Right ?
Fetch the local data from whatever it is stored, save file, idk, and copy it to the remote PC so that it can write it in the player state
there is no save file. I am saving the data into a struct variable and I want to take this struct variable to the multiplayer map.
Hey guys, got a question. Is the overhead of having a 'server' RPC that I know will always be called by the server worth considering?
Use case: I've got a 'server' RPC in a Blueprint which fires another event function, and I'd like to also mark that event as 'server', in order to make it clearer where it's executed. Stupid move, or it's not a big deal?
It would make more sense to keep it a normal function and simply ensure in the function that it runs on server
So just add a condition in the bluprint then (I'm referring to a case involving only blueprints, no C++)
So in that case, having the function marked as 'server' RPC would be a bigger cost than adding an 'if' node at the start of the BP function?
I don't know if there's a cost involved, but erroneously calling this from the client would turn this into an RPC
While asserting that you're on server actually serves your purpose of ensuring it
True that, you've convinced me ๐ but generally speaking, out of curiosity, does it much overhead having it marked as 'server' and always calling on the server? I mean, I know that it would be fired right away, but I'm curious to understand how long is the 'trip' befaure it's actually fired
@bitter oriole can we have quick call ?
Like I said, I don't know about that.
No
Sorry Stranger, I misread ๐ thanks for the clarification
What's the difference between FindPlayerStart and ChoosePlayerStart? 
okay, reading cpp and:
FindPlayerStart
- first tries to match the player name to a start
- else checks if the player already had an start before
- else calls
ChoosePlayerStart - else just returns one spot, never fails.
ChoosePlayerStart
- A whole lot of checking if a spot is free, nearby, PIE and more
hello, I just want to know if the crossplatform is basically activated or we have something to do to activate it?
for steam support in UE4, most people refer to the advanced sessions plugin. Is there no out of the box solution for steam?
ah so the built in stuff is very minimal?
That's not what I said
I just asked what you wanted
Advanced sessions is basically just a Blueprint layer for the built-in OSS system
dont have a need, looking into steam support in UE4 and noticed that most of the time people recommend the 3rd party plugin
Hi, does someone know how to user ClientTravel?
Advanced sessions adds few features other than Blueprint
The AdvancedSteamSessions part of it does add some new Steam features
Like getting more data on a friend, including the avatar, and some workshop stuff
gotcha
does anyone know how to view what is taking up the most resources in a level
im getting random fps drops in some points in my level and im trying to figure out why
Sure, just profile it
Start the game without editor, hit stat unit, see if Game or GPU is higher, if GPU is use profilegpu, if Game is use stat startfile and stat stopfile with the profiler in the Session frontend window
gotcha
@empty axle why? Cuz I am learning go?
Just not a good idea.
Lol
Anyone know of any free or cheap Server OS's? I'm super familiar with VMware but I am currently using VirtualBox since it is free. I just need a server ISO. Anyone able to help?
Depends on what type of server you will be running?
Well, Domain controllers, some game servers, and maybe a web svr
At this point, im just more curious to see what is out there and what the options are ๐
Ive been looking at Microsoft, and Gamelift
Do you want to self-host?
Yeah, I want to eventually have it all hosted on my own physical servers
I just use stock Ubuntu for all my dedicated servers and Ubuntu server for databases and hole punching.
Oh?
I haven't been able to get my dedicated servers running on Ubuntu server, but i know of many who run everything on there.
Wow, it looks hella interesting. Thanks for sharing ๐
I was also looking at TrueNAS (https://www.truenas.com/)
But its more of a storage if anything ๐
Yeah, NAS (Network-attached storage) servers are for files only.
Yeah lol. It was one of the things a friend showed me that he found
@ember zenith To iterate on what Stranger said, I know nothing of Golang, but from a rudimentary search, the key fundamentals of why you would use that are already built into Unreal using C++ as long as you use things correctly. The engine is complicated enough without needing to add another layer between Unreal and an unsupported language. If you're planning on using Unreal, it's extremely advised to stick with C++, networking or not.
my original goal was learning Go with networking and my friends and I were doing a simple game just for laughs and I thought it would be a good idea to put them together.
That's fair. Just glancing over it, it is pretty similar to C++. Few syntax differences, but I doubt you'd have trouble converting stuff over. That being said. If the game is fairly simple, blueprint can handle a lot in that regard. C++ is only really necessary once you start getting past a certain scope.
Hello, I would like to have a 2-player network setup where the hosting player and joining player would each possess a different Pawn class. Where would be the best place to make this kind of distinction? I'm trying it in the playerController but I can't seem to be able to find which one belongs to the host / client ๐คทโโ๏ธ
thank you for the response! yeah C++ and Go have similar syntax, and tbh i wasn't really worried on that it it just I was curious if anyone here used Go and if they had any success with it.
@elfin citrus Most Likely GameMode. It usually determines character spawning through some of it's overrides.
The player character has a Scene capture 2d for a mini map will this cause issues in multiplayer with overwriting?
Is there any chance that i can change these values only for the client which calls the method ?
void AGenericPickup::SetHighlight(bool NewState)
{
if(!M_PickupMesh) return;
M_PickupMesh->SetRenderCustomDepth( NewState );
M_PickupMesh->SetCustomDepthStencilValue( NewState ? 2 : 0 );
}
(M_PickupMesh is a simple UStaticMeshComponent)
I'm highlighting them with PP and i want it to only highlight for the player which looks at it, but currently it would get highlighted for all players
while using listen servers, can player get the IP address of other players connected somehow?
for hosting sessions to anyone, what happens if you dont port forward UDP/TCP 7777? say i want to send out a early version of a multiplayer game to testers, do i have to specify to open the port forwarding?
Are you using steam or just direct ip connections?
I am having some trouble with an RPC I am trying to run. I am making a ping pong game and when a player goes to serve, I create one ball for the local client that is not replicated and create a "server ball" with a run on server command that is replicated to all clients. When the player hits the ball, it tells the server ball to run a multicast event which passes in the player controller that hit the ball and other transform/velocity data from the hit. This multicast event then goes runs on all remote clients to create a client ball (the first person serving doesn't need one).
this ball is created correctly--but then when this 2nd player tries to hit that ball, the hit event is not passed back to the first player. The function doesn't run on the 'server ball', but when I check "get local role" on the server ball on both clients..both of them say it is a simulated proxy. Setting ownership of the server ball to "get player controller 0" on the client ball hit event didn't seem to matter either
can you override GetLifetimeReplicatedProps in a child class for a member of the parent class. if you wanted different child classes to replicate the variable in different ways
anyone know why this is happening im running this on a dedicated server and this is what it tells me even though i have resized my inventory array to the correct index
How can I get a scene capture 2d to not replicate?
"Warning: OSS: No game present to join for session (GameSession)"
hey i have an issue with widgets but its also replication kinda? so on begin play if locally controlled they spawn the hud. when you shoot someone i want to call an event on hud to show hit marker but it only works server side, i hit a key to show all players huds via print string but only the server shows a hud widget. the clients show no references. im confused why this isnt working.
anyone know what this error is and if its a problem? client starts up fine
@twin juniper HUD is client only, server nor other clients can see or access a clients HUD
so you need to do a client rpc or some other way to get the info from Server to client to update the HUD. Check the network compendium in the pinned messages
i called an event to run on owning client
im confused
where is the event?
so when hit, the server calls a function to do damage, inside that function it calls a BPinterface event to send a message to the player who shot the bullet to play a sound and show hit marker
yes but where is the run on owning client event?
well it was being called instead of the bp interface event but then even that didnt work so i tried bp interface, which also didnt work so its kinda still the bp interface right now
oh in the player character
one sec ill take screens
either that or we can jump in support voice and you can stream?
ill stream
Im currently Thinking for a better solution for replicating my actors look at direction for a coop top down game and would like to get some input.
@lean hornet That's likely fine for blueprint. Shorts would be a better representation of a single axis like that but that's C++ only. One personal quip is the timer though. Not everyone runs a game at 100 fps and it's also likely that network stuff isn't going to run that fast. That'd be better set at like 10-30 times a second. You'll end up with someone running the game at 50 FPS, and running two RPCs every tick more or less, which would make that half as efficient as just running it on tick.
aaaah allright technicallly i could get the delta time and use that as the input for the timer @kindred widget right ?
Well get delta time and multiply it by 2 it wont need updateing every frame.
I think it highly depends on what you need this for. If it's gameplay related, I'd try to make it as fair as possible by limiting it to like 30 times a second. That way someone on bad hardware running at 30fps, doesn't have a severe disadvantage over someone at 120fps who would have a four times more responsive cursor. Also depends on game. Like ProjectZomboid for instance, player uses mouse in a similar manner as you for facing, but the character rotates slowly, which means that super fast updating is fairly pointless.
If it's something like a simple visual pointer to show facing, Who knows. I'd still limit it, but running it more often would only have network traffic consequences.
aaah i see yeah that helps alot @kindred widget
There's a little vector math you can do also that will avoid weirdness with cursor hitting objects from the trace.
Like.. Say there's a rock under the cursor. It'd end the trace a little sooner than if it hit the ground behind the rock which leads to the character looking in a slightly different direction. If you line plane it and set the plane normal facing 0,0,1, with the plane origin at the character location, you can get where the cursor is in game space relative to the character itself rather than working around potential trace issues.
What did is make a different trace channel which is the floor and use that for player faceing. Only giving that object the trace channel.
Replication question: should replicated actors have the same name on the server and client for things to replicate correctly? I have some issues with GameplayAttributeSets not replicating correctly and thus, an actor dying to early on the clients but living (as expected) on the server, since it has remaining health.
I noticed that the Hit actor (the one being damaged) is called CHR_Footcoil_C_0 on Client 1 but CHR_Footcoil_C_4 on Server. Is this a symptom of an issue?
@lean hornet If you're ever curious about the math version. Just lets you not have to upkeep the level design of worrying about collision channels.
It already doesn't.
Will definitly write that down @kindred widget Thank you for all this information!
Only thing would be to keep a ref of the pc otherwise there would be alot of casts which create overhead
@lean hornet Not entirely true. Casts don't really cost anything. There is a validity check in the cast that costs a bit, but it takes literally a half a million of them before you'll even seen a small framerate dip in a single frame. Non validity check casting is the same as using the pointer without it, you can use them a million times in the same function and there won't be any performance difference. Casting only ever costs really on memory. Casting to something, or even just having a pointer to it as a variable will make sure that the class being pointed to or being cast to is loaded before the class with the cast or pointer in it is loaded. In this specific case, PlayerController already always is loaded. So nearzero performance cost in the end.
I seee~ Thank you. I got that part thaught wrong then. Like many things i think xD. Thank you for clearing things up.
It's a common mistake from a lot of general learning with Unreal. You'll see people complaining about casting a lot because it's just a repeated issue. In smaller projects, you won't see an issue with casting to everything. Won't matter if everything in the game is currently loaded. With larger projects, you have to make sure you only ever have what you currently need loaded. You don't want to have a game with 20 levels, and half of level 17 loaded while playing level 1 because something in level 1 casts to something that eventually casts to half of level 17, sort of situation.
hi! so i have question, i have this event running on server, but when i play , Get hold gun is returning null on clients
in offline mode its working properly
on listen server mode, only server can see gun
Hope someone can help me , is there a easy way to check is the given Controller a local created Controller? In case of using spitscreen etc
or should i use my custom boolean ?
what's the good solution for AI movement prediction over the network including pathfinding?
So if two players join each other (seperate clients) and both of their characters have scene capture 2d components they wont overwrite each other's capture?
(Both using the same render target)
SceneCaptures are assets
Or rather the RenderTargets
Each is local and only usable once
You can't render two different things onto one.
If you test in the Editor, you might be using one single process and so your two clients use the same asset
If you actually start the game twice, it should work
So if two characters in the level gave the scene capture component it wont the character that isnt the client's wont mess with the render target?
So long as they are seperate instances of the game?
They don't replicate. Local Coop you'd need multiple RenderTargets. Online they won't override.
Okay I think i understand now.
Thank you! I really appreciate it
I'm having here a problem with outlining via PP.
Currently i wanna make all interactable objects highlightable if a player looks at it, but when i do it with this code here
void AGenericPickup::SetHighlight(bool NewState)
{
if(!M_PickupMesh) return;
M_PickupMesh->SetRenderCustomDepth( NewState );
M_PickupMesh->SetCustomDepthStencilValue( NewState ? 2 : 0 );
}
It will get highlighted for everyone, and not only for the player who actual looks at it, any idea ? ๐
I've tried already some stuff with the LocalRole, and it seems like all connected players will call this method too with this role ROLE_SimulatedProxy + 1x the server with ROLE_Authority as i think
So I packaged my project and launched it twice and both are using the same scene capture and both see the same thing
Can't comment on this. I've done this before without problems. Could be a coding bug.
I dont know what it could be. The player characters are spawned in. all have the scene capture 2d component all set to the "minimap" rendertarget but for some reason all client's see the last spawned character's scene capture
We also don't have that issue
all have the scene capture 2d component [...] character's scene capture
i think thats your problem, if you have multiple render captures, they are overriding each other, its not that they are replicated, its that you have multiple on the same local game
@terse prawn
How would I approach removing the unnecessary render targets? I tried telling the client to check if it was their character and currently controlled pawn and if not remove the scene capture but that dosnt seem to work
I am trying to make a simple multiplayer game with a listen server. Each player has one light they can turn on or off, but when playing only the hosts light is replicated for some reason. Every other players light is always off. The light is replicated but I am new to multiplayer and this is my first multiplayer game.
That is in the character blueprint
The Client has to tell the server to update the light for clients to see it.
Kinda wonder how this is meant
Like i'd assume it would also be identical on client and server, or can you dynamically add new tags from client/server ?
well it says as the name says
without that, it replicates the tag by FName (12 bits), by using index, its only uint16 (4bits)
so you get 3 tags per 1 tag in replication
typedef uint16 FGameplayTagNetIndex;
check FGameplayTag::NetSerialize_Packed
and you will see
Ye, i got that, but i'm not quite sure about the identical part.
I can't really imagine a case where it wouldn't be identical
If I have an actor with replicate movement related properties checked, and I attach it to another actor that is replicated, is the attached actor constantly sending its world location or is only its location relative to parent replicated?
Like if I attach actor B to actor a, and move after a around, is after B constantly replicating its location or is the system smart enough to realize that it's location is always constant relative to its attached parent?
Hi all, I am trying to setup players sitting on a throne. I have a TP project and have a throne my players can interact with. Currently when they interact with it I have a โsimpleMoveToโ node replicated so they walk up to the front of the throne, I just canโt work out how to make them turn around and sit down. I have all anims for it, just not sure where to go from here. If anyone has the time to walk me through the process, or give me a rough guide that would be amazing!!! Feel free to DM me if you would like to help me and thanks! I love being part of such an awesome community!!! ๐
[Help] Im trying to host a listen server on steam.. I've forwarded the port 27015 like the steam docs say to.. and then my game loads up as a standalone and then uses advanced sessions and then open level
when i open level.. do i need to put other stuff than just ?listen
@worldly raft how is that a Multiplayer issue?
i can connect on my local network but when anyone outside tries to connect the games dont show up.. im assuming its a port forwarding issue but i set that up.. so maybe im not doing something right in the open level function?
@meager spade sorry, thought multiplayer channel would be a place to discuss replication code... what would be a better channel to ask my question?
you never asked about replication i mean you kinda did
movement component sorta takes care of that for ya
but the basic thing like turning them around etc, seems like it's not really multiplayer
is it working in a standalone?
are the characters turning when you use single player?
@strong vapor havenโt gotten that far yet ๐คฆโโ๏ธ not sure where to start hence asking for help ๐ฉ but if Iโm in the wrong channel I can move question to diff channel
@worldly raft do they turn around and sit down in single player? you can change back and forth in the Play dropdown
if you dont nkow how to even make it work in single player then ya its probably the wrong channel.. go to blueprint maybe.. or animation even
you wanna give some kinda MoveTo command in the Ai behavior tree.. and then a RotateTowards.. and then multicast an anim montage being played in the character script.. if you dont know what that means.. look into blueprint RPC's (remove procedure calls)
also for any and all multiplayer beginners stuff take a good look at THIS http://cedric-neukirchen.net/Downloads/Compendium/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf
(Remote Procedure Calls)****
@strong vapor thank you for the info. I will se where this takes me ๐
Hello there, is there a way I can make the movements happen on the clients themselves (and actually WORK) instead of the physics being done on the server and then the client viewing that? Thanks
Hey i've a weird problem . i try to give the ability to open a menu when the player is in the trigger box it work when the host is alone. but if someone join the game the host have to be in the box and then the client can open the menu (the host can't) and vice versa if the client enter in the area the host can open the menu
@pliant kernel i dont think you're gonna be able to create a widget from that actor
i think thats your problem im not sure... the client doesnt have ownership over the actor it just overlapped on
overlaps should run on client and server
you need to gate IsLocallyControlled
and only create and show widget locally
but we use the AHUD class to manager these types of widgets
Okay i will try that
Hi everyone! Does the Steam Voice Chat has some kind of event that can be accessed when another player's voice is received?
does replicate notify and replicate variable replicated to simulate proxy client? if not, how can I replicate variable to simulated proxy client?
I mean in C++
@meager spade Just tried and nothing append anymore with isLocallyControlled, i have trouble to understand why is behaving like this. It seem to think i'm the other player
Maybe something is wrong with the way how i try i get my player controller ? i still a beginner i use ue4 for like 1 week and i don't understand everything correctly
someone how how to fix this play rate is to fast but is never set to play fast ? on client(18ms) and i still have no idea why is doing this and i had this in dev build
Hey guys
Im new to unreal and working on a multiplayer game, but I have some control related issues
0 votes and 1 comment so far on Reddit
๐ this is my exact problem
Hey guys, How would i go about doing this, it was a question asked on the forum but nobody had answered.
https://answers.unrealengine.com/questions/592908/mobile-multiplayer-joining-through-ip-or-a-code.html
@ancient bramble this is something your OSS should facilitate to achieve.
Whenever a player or listen server creates session, he creates the invite code and adds the invite code as an attribute for that session... So client searches for session via means of attribute..
So you need to choose the right OSS which supports custom attributes for a session
And search session for a attribute
im currently using Advanced Session plugin to create and join sessions to
so using that is it possible to achieve this?
With advanced session plugin, it's not possible.
Advanced session is only the client side implementation, it doesn't have any backend.
EOS will do the trick for you.
More accurately, advanced session is only a Blueprint interface for the engine's system for online stores, and the only built-in store that has online matchmaking is Steam
Yes agree
Does somebody know how to block opportunity to connect for session which has been already started?
@midnight karma there is OSS function called start session, so its common usecase is that match has started and joining is now prohibited.
This start session might be subject to OSS provider support.
Is there a free plugin that will do the job?
A plugin cannot do matchmaking, for matchmaking requires online servers accessible from anywhere that process requests from clients
Steam has such servers, so do other game stores
EOS is one such store backend
If your store doesn't offer one, you can either implement your own service, which is rather easy but needs your own servers, or you can try using EOS
EOS is free too, though it's an external service from Epic that you will now depend on
^
Personally I would strongly suggest your own service, you basically need a simple server in Python that stores HTTP requests from client saying "hi, need a match" every 5s when they are in matchmaking
Every time a client hasn't ping in 10s you remove it from the list
And then when you reach N players in the list, you tell all of them the server IP
It's quite simple
You just need your own server for that
I feel like you should always add that it's only simple if you have the programming knowledge.
Because it's not quite simple for everyone :D
Or else spin Nakama@ancient bramble
It's a full package, you can add code in javascript and extend features
Atleast javascript is easy I assume
yeah the thing is, we have a simple system using vaREST to do stuff like login and signup, within the game and we are stuck on the matchmaking part, ie after the players login, they join a lobby, which shows thier friends and everthing. when he hits play, it should check if he has entered a lobby code and if he has, he should join that lobby of players(or something of that sort), or he should matchmake with only him in the lobby
Ohhh why not fork Nakama , it has auth system and everything else which you might need
ok thanks for the help!
Are GameMode assets not able to be touched by clients? I am making an intro scene, but noticed that the dedicated server is the only one able to call BeginPlay in my blueprint.
GameMode does not exist on clients at all.
= use GameState
Ah, kk
Hmmm, despite migrating everything to a Gamestate
It seems that only the dedicated server calls BeginPlay
Not sure if this is meant for #plugin-dev or here.
How is it possible to get multiple unique Oculus users logged in at the same time, using a single machine and in PIE? I have test users setup but there can only be on Oculus App opened at a time, and surely UE isn't tracking which one is opened, either. PIE with multiple players results in OSS thinking that they are the same player (the admin of the Oculus app manager)
Hi peeps,
is it possible to replicate a UGameInstanceSubsystem
@dire tusk theoritically possible as UGameInstanceSubsystem is an UObject but you should not do that.
I have an event dispatcher system.
It contains a collection and whomever is listening processes the event.
I wasn't sure how to queue an event and EVERYONE collect it in their event dispatcher system.
I saw some people create multicast functions but also see people stating avoid using it since there's better options to do similar things but I'm still studying on UE4 networking so still looking
a GI subsystem? nah. a world subsystem maybe
at least with a world subsystem you could create a proxy actor or something at runtime
Why do my non replicated actors count toward the "network actors" count in stat net ?
is that normal or a symptom
need a bit more information than that, because I wouldn't consider it normal
I have a few hundreds actors in my scene with this code
I attach an RMC componenent to them
RMC?
There isnt much else in the scene aside from main character, and even then, the number of replicated actors is few hundreds
RuntimeMeshComponent
Is there a way to list the name of replicated actors btw?
Code to initialise it is just this
I never set anything to replicate, this is client authoritative
As you can see for yourself there's nothing in my scene (except the 200 actors that are the terrain) and yet the number of replicated actors is 200
You said actor, is there a Blueprint for it ?
It's C++ based
straight C++
@brazen sluice its the number of net addressable actors
which is all actors from the level included
NumActorChannels is how many replicated actors you have
okay makes sense thanks you
I'm having here a hard time again on how to destroy actors properly.
I have the class AGenericPickup : public APickup_Base
Where APickup_Base provides this here
UFUNCTION(Server, Reliable)
void Server_DestroyActor();
void Server_DestroyActor_Implementation(){ Destroy(); }
The class AGenericPickup has a method TakeItem(T* Player)
Where it will call Server_DestroyActor();
But the Server_DestroyActor() wont get called at all if a player(client side) tries to take the item.
It will be called if the player(server side) tries to take the item.
The AGenericPickup instance was spawned from the server.
So i really don't get it to work so that clients are able to pick it up and destroy the actor
So this is a classic case of "non-owning clients cannot RPC to server"
You need the picking-up process to go through an RPC of the pawn/character or playercontroller
In that case i think i know what i should try
Is there anything special you need to do in order to replicate the Owner of an actor?
I'm spawning a projectile and none of the clients are getting the owner and instigator from the spawn params
The owner should be replicated.
(The actor, not the variable)
Let me trying fixing a warning from the "owner" it was being set to replicates with SetReplicates(true); in the constructor
If both the object in question and its owner actor replicate, then the owner will be replicated
Unless maybe the owner is not relevant - though I'm unsure of that
if the owner is not relevant or static (loaded from package)
the owner won't exist on client
which means you can't resolve the valid NetGUID that you have
same goes for the instiagator
both the owner and instigator as members are replicated under the hood
I set the owner of the "projectile" to be the character it was spawning from before it was the item. Still no juice
Sounds like the character is not relevant on client
Is there a way to determine that - I can see the character running around on the client
Could someone explain to me why my listen server is rotating faster than the clients? Got this issue with all the movement (but it's implemented in the same way so that's not surprising). I'm working with a base Pawn class. I'm starting to understand how replication works, but not quite there yet ;). Tried some other things as well (MC instead of repNotify, using the component replication).
Can anyone point me to a concise reference on advanced replication optimization? Covering subjects like NetSerialize, FFast?
@normal violet Is the tick rate the same?
can i check that? I currently still testing on new editor windows so I assume they all have the same tickrate
why not set the repnotify directly?rep notify is calling from both server and client..the custom event server one is unnessarry
Your problem isnโt replication, you made an amusing mistake adding.
You have two different nodes , one replicated, one not, where the rotation goes up by adding hull rotation to the new change
So the second node is changing an already-changed value
Variabalize the value from the add node so youโre only running that calculation once
Is UWorld::GetFirstPlayerController() guaranteed to return the actual first one - hosting player in a listen server context ?
it will return the local player controller (eg for listen server it would be the hosting player, for a client it would be the client player)
Cool, thanks
Btw - I ended up fixing it by not relying on the owner at all on the clients
repNotify from client doesn't seem to work. I do not see the rotation on either the server nor other clients
This seems to work, now let me just grasp my head around it ๐
The tick function is suposed to run both on the server and the client right?
it can be on or off for either one independently
but by default they should both be on right?
ye , im gonna do that see if i can figure this out
so my event queue is living in a UGameInstanceSubsystem.
Since calling GetGameInstance()->GetSubsystem<>
Is returning the same game instance sub system to either player.
I assumed the broadcasted message would reach both players but seems thats not the case?
@dire tusk There is only two ways to make sure that all players receive something, and that is to replicate it or RPC it.
is there a more elegant way to call an rpc with a client vector without having to pass it in the param every time u call the RPC?
What's wrong with passing it through? What is the RPC for? If you need the vector when the RPC reaches the other machine, it has to be sent through.
theres nothign wrong with it, the code is just gonna look a bit ugly thats all
i have a function "shoot" that then calls a server version of "shoot"(RPC), the first one handles client stuff like sound and animations and the second spawns the actual bullet in the server
and i do that for quite a few abilities diferent characters have
now i am adding a bit of code to improve game feel and i requires the server to know where the player is looking at the time of spawning the bullet
so if im gonna pass that info for like 10 or so rpc's its gonna be a bit ugly
thats all
and i was wondering if theres a better way to do it
Is it possible to create virtual RPC's in c++?
it is possible to create a virtual _Implementation function for an RPC
@limber gyro i have weapons that shoot multiple projectiles and weapons that can penetrate their targets
i just pack all the hits from one shot, along with all relevant info into 1 RPC
ye but i cant do that because its multiple character with multiple abilities that run whenever the player feels like
so i am stuck with writing a bunch of repeated code
i guess
for shotguns n stuff im doing all the bullets in the same rpc too
depending on accuracy you need and what type of camera you're using btw
server might have a fair idea where you are looking at
as that is updated under the hood via ServerUpdateCamera
and accessible via APlayerController::GetPlayerViewPoint (not 100% on function name)
ive tested that, server is off by quit ea lot unfortunately and that isnt even taking into account latency the player 100% has to pass that info or the game feel is gonna be off
i am doing a raycast from the player camera so if the server is off by say 1 degree it has the potential for the raycast to hit the wrong spot
we have an isometric camera
so we send the mouse projection vector to the server via unreliable RPC
u dont need it for gameplay?
don't need what?
since its sent so often
umm
any resending would arrive after a next normal update
so making it reliable is pointless
thats good ot know
are you sending it every frame? if yes why?
unreliable works like UDP i assume
not every, but close
is there any reason why you cant send it only when nescessary?
are u like displaying the other palyers cameras in a minimap?
depending on what firing mode you're in
other machines need that vector to infer your rotation
if you're firing , it kinda defines where you're aiming at
and if the mouse is moving, or the player is moving
the vector is changing
which is... all the time
LOL
Anyone know a sufficient way to replicate events that run on a timer? Iโm Iโve tried to replicate timer events from server to client with a multicast but Iโll get infinite loop errors when doing so
Any point in the right direction would be appreciat
multicasts run on server too
if they end up calling the multicast that called them...
can u be a bit more specific?
Sure lemme get on my pc and Iโll give a example
and what game mode client side would receive it?
it has to have a connecton right
well you could call it in the game state
doing a for in all the players
to what, a non replicated actor that client doesn't have?
besides, spooky never mentioned game mode
i think ive done somethign similar
thats true
to be fair the question is a bit vague
he called the multicast from that same multicast
Iโm trying to replicate a helicopter that currently runs on timer based events works on server but clients donโt receive anything
ur just trying to replicate the movement?
The movement is based upon setting the actor rotation through variables
if its a player controled thing u should probably stick a movement component in there
Yes You can possess it and control it but itโs a pawn not a character
well it probably should be a character
pawn can have movement components, but you're getting off point sonicphi
And it would not be helicopter like if it was a character because of how Iโm moving it
am i? i think most people just dont know what tools to use and most problems steam from there
that is true, but you did go for the movement like a bull after a red flag
LOL
and there is nothing to indicate movement is a problem here, yet
movement components have stuff for flying i think
so if he just stuck it in there it would probably replicate on its own
basically my issue was the timer based events would through infinite loops
without much issues
thats why im wondering if there is another way besides multicast
no prediction, but there is such a thing as FlyingMovementComponent
multicast can do it
its not responsible for your infinite loop
mistake you made using it is
how come when i only run on server the infinite loops are gone
but when multicasting it throws me that
we can only tell that by looking at your code
that just tells you the error is in client's handling of the MC
unless im calling a multicast from a multicast that would probably explain it
if that helicopter can be controled by the players ur gonna need to give it a movement component regardless i think, if its jsut a thing that flies once in a while on a timer i would do it maybe with a "get all actors of class" and call a client rpc (not sure if this works never tried it lol)
is using a reliable client - server RPC for inventory item pickup event a valid use for reliable RPC?
depending on where you put it
which would totaly suck fro ma game design perspective
typically pickup item itself is a bad place for it
cool, I heard some stuff about avoiding reliable, but that seems more appropriate than handling a fail
you avoid reliable when multicasting something cosmetic
or when you are sending RPCs so often that reliable wouldn't help
well u can avoid realiable for anything cosmetic really
yeah, the server then calls unreliable RPC for the particle and sound
it just depends on how much u worry about network optimisation
all movement components RPCs are unrelable
but they are called like every frame right? or close to that
by the time client figures out he would need to resend a reliable RPC
it would already had send a more recent one
so reliable makes no sense here
i think a good rule of thumb is if it is something that affects gameplay and "game feel" u can call reliable on it, unless u are talking about stuff that gets updated every frame or very very often like position
anything being sent every 0,1 or so seconds or more often - unreliable
ofc there is caveats to this but
if it doesn't meet above rule - everything gameplay critical - reliable
and anything else - unreliable
yeah, for certain events I want the client to at least get ack of event processed by server, only place I'm using them
theres always exceptions, if you were building an app that needed to comunicate with a something in orbit every frame with a packet loss of 90% you could in theory call reliable on an every frame rpc xD
and waiting few ms is accceptable
but ye what zlo said is right unless ur doing something extremely weird haha
just a few reliable RPCs on Tick would overwhelm the reliable buffer
mostly the concern is making sure it's not also spammable, more gameplay concern
oh thats interesting to know
yeah, like I have ability to drop and pickup items, I prob need to check for spam
or troll could overflow buffer
im always impressed by how much zlo knows about unreal
i have no idea how u dont work for epic man
if a player needs to give an input
things like that I'm thinking about more now
its unlikely it can overwhelm the buffer
it would need like 300 commands per second
yeah, just slowing the event triggering would be enough
it's something that needs real testing, but knowing the basics is a good start
don't overcomplicate your life thinking about stuff you probably won't need to consider even in the optimization pass
for starters, ability to pickup and drop items would be nice to have ๐
@winged badger just out of curiosity do u know that much stuff about other areas of game dev like game design and directing or is it just unreal code?
well looking at this as one optimization pass, I want to hit a few things that are low hanging
not even close, i could probably pass for a junior game designer
LOL
I seem to be getting much more benefit from optimising my anim bps right now though
thought I'd look at some networking at same timee
how do u even quantify game design skills, i find that a bunch of rules that u apply to a genre dont apply to others
its very hard to grasp
It's an absolutely massive field for sure. The things I have learned doing this...
it is also not easy to focus on designing and developing a system in code
My day job is easy by comparison, I've always done this as a hobby, but the skills have be quite transferable.
ive learned tons studying blizzard games
and keep track of game deisgn considerations at the same time
Game designer as a title feels game specific. Someone maybe good with a top down game but suck on a fps game...
i struggle a lot with this, i feel like i just cant keep evrything in my head at all times
you can't
ye it is a bit, most lessons from an FPS dont translate into a platformer
#industry-chat lol
i think fingers is bad after 5 goblins
Third time lucky
i dont wanna keep on with the offtopic but i just wanna say this one last thing that i found out recently about fps game design which absolutely blew my mind
projectiles dont hit walls that you are right next too
and while it would look natural for them to do so, it would feel terrible in game
They don't they insta explode lol
well they are not suposed to insta explode
If you are in about rockets ?
any kind of projectile
Oh I know in most games rockets just insta explode without spawning a projectile at all
use procedural pose blend and disable fire
but thats bad game design haha
before that stage even, much better
the player always expects to hit the cross hair
i ve lost quite a bit of time studying overwatch because of this, how they do it, its very very interesting
Its does a line trace and causes the same projectile damage there
No point wasting time spawning a rocket to travel one foot lol
i dont know the exact algorithm used, but the way i did it was to make a raycast and make the projectile switch colision when he reaches the raycast point
this isnt perfect but its a very good aproximation of what blizzard and apex legends did
the colision ignores only static stuff
for players its always on
but for example if u have a projectile coming from your left side from the tip of your weapon
and that weapon is close to a wall
it wont hit the wall
because while the projectile doesnt reach the point of the raycast it ignores static meshes
it will do some cliping in some extreme cases but the game feel is going to be 100x better
honestly ive lost more time on this little feature than i should've xD
but a game is either good or bad
depending on how it feels
I do my projectiles as piecewise line traces. So if the velocity is high enough or impact is close enough, it is effectively a hitscan.
Quick question, variables local to animation BP. Can they be replicated in the same way as they would be in a character BP? I am wondering because from what i see in this pic, the server is getting the clients rotation variable, but the clients are not. (Rotation variable and function is local to AnimationBP)
spent a few hours today going through CharacterMovementComponent source in 4.26 with the new FCharacterNetworkMoveData struct. i'm trying to avoid hard coding every different type of movement, so i was going to write a system where my Custom Movement Mode just ticks an external object derived from UCustomMovement (class I made), based on a TSubclassOf variable. I'm wondering how to add a TSubclassOf variable to FCharacterNetworkMoveData, as it doesn't seem to be serialized correctly
There's nothing special about UE4, jsut buy cloud servers, load them up, profit? If you have to ask the question, probably don't target a dedicated server type of project.
Unless you're super careful that's a recipe for a bill with 2 commas in it. But I like DigitalOcean. You'll have to be suffering from success tho.
Start with making a game worth having automated server deployments. If it's your first game, don't do it. Just make a project that can be community or listen server hosted.
Valheim and GMod and TF2 are all huge games and don't or didn't start with automated servers.
If you're looking for auto-scaling systems then none of the "basic" cloud offerings will do that, it's something you build yourself on top.
For services that already exist, you want to look specifically at amazon gamelift, gamesparks, or azure playfab
Dont use Gamesparks.
Unreal also has nothing to do with the hosting as was already mentioned. You can use any service that lets you run your own executable.
I can't speak for any of the services, though that's the first time I've seen someone jump on gamesparks that quickly lol
look into them yourself
they have their own pricing and one is amazon, one is microsoft
Gamesparks will be discontinued. Also its trash lol
good to know
I only have experience with playfab myself, I just knew gamesparks exist(ed?)
???
Thats got nothing to do with your Service you use.
How well optimized your game will ultimately help determine your usage costs.
Pricing between different Services is on you to determine as well.
Since every project is completely different
With different requirements, theres no way to make comparisons.
pricing/performance is also not easy to compare and something you'd have to do yourself. Every cloud provider runs their stuff differently and on different hardware.
but both basically let you use most standard Azure/AWS VMs
CCU is an entirely abstract term.
Same thing.
All depends on your game.
And how it performs
playfab has pricing that's partially based on MAU but it's unrelated to server pricing
that stuff is just for the non-multiplayer-server stuff
ie player data storage and other services you don't necessarily need
No, we cant.
no, because it depends on your requirements...
there is no flat pricing
it entirely depends on what VM sizes you use
how many
You have to do the research based on your knowledge of your game, how its built and what usage it will incur.
etc
That means my actors sends 810 bytes each? (no replicated actors rather than my zombies on the level, and one player character)
stat net on console
731 is almost 1kb and it looks huge
Not sure, probably on each server update
Default system should be like that
only properties that change will replicate
also, you sure you aren't reading that stat wrong? That's the maximum that was sent for that stat
it's not saying every single one sent that much
Min is also 652, isnt that huge too?
depends, did it send the initial replication data once and then never send anything again?
because I doubt it'd track 0
or do a bunch of properties always change at the same time?
there's no indication of how often that data is being sent
so you have no way to tell whether that's bad
USTRUCT()
struct FFRZombieMovementState
{
GENERATED_BODY()
UPROPERTY()
FVector_NetQuantize100 Location;
UPROPERTY()
FQuat Rotation;
/*
* On engine source code velocity used with NetQuantize10 instead of 100 (CMC)
* No idea why but it looks OK?
*/
UPROPERTY()
FVector_NetQuantize10 Velocity;
};
This is changing on 45 zombie actor instances with 66 netupdatefrequency
changes were too frequent on both max and min values
read the pricing pages...
search "amazon bandwidth pricing" (or azure bandwidth pricing or whatever)
ingress is usually free, as is transfer within the datacenter (and sometimes between datacenters in the same zone). What costs money is egress (download) from your servers to players.
both the gamelift and playfab pages list the basic egress pricing
and both vary by region
I'm not overly familiar with the stat net display but that specific stat might be total per frame - i.e. it's not one actor sending 800 bytes, it's all actors in a single frame
that seems to be supported by the usage of STAT_NumReplicatedActorBytes - it's only reset to 0 once per ServerReplicateActors call and is incremented from there, not set
You're right, I just decreased my zombie count to half and it looks like its nearly half of the old value
Thanks
sure... if it's actually doing that every frame
pretty sure that stat counter doesn't reset every frame - it's showing the min/max for all time
Values are constantly changing something like per 0.4 seconds
more or less
its not per frame probably
also it depends on your netupdatefrequency settings of actor
on top of my earlier question, there apparently exists a struct called FCharacterMoveResponseData which is presumably contained by FCharacterMoveResponseDataContainer. I found FCharacterMoveResponseDataContainer easily enough, but the struct it contains is just an FClientAdjustment, and I don't see FCharacterMoveResponseData anywhere at all. anyone know what this is?
Hello, I have a character that replicates, and I'm adding physics on it, but the problem is that whatever is being applied on the server character, about x10 of physics forces is being applied on the client character and I have no idea why. I would really appreciate if anybody is able to help. Thanks.
I have a landing animation that is played when entering a landing state, that only plays on the server and the client controlling the pawn. I thought all animations in the state machine is replicated?
What makes you think that?
The variables and events that drive the animation blueprint and montages need to replicate, not the animBP itself.
So usually all the events and variables are replicated in other actors like the character itself
Ok I will look into this some more
how would i go about creating an OSS inside unreal, is there any guide?
Create a plugin for it
For example OnlineSubsystemIOS in source is a plugin for an OSS
Actually all OSS are so check any of these out
is it possible for VaREST to recieve requests and process them?
like for eg, a normal server send a request to the game, is it possible to get that request inside the engine?
What you need is either web socket or http/2 protocol.. VaREST is just a blueprint wrapper above http module of engine. If the engine http module is http/2 supported then you should be able to do that.
I already gave you a product name Nakama, it uses gRPC where server can send events to clients.
And gRPC is actually http/2 protocol
Beleive me Nakama is very wonderful product.. if you are ignoring it only because you are finding it hard to understand or don't know golang.. then please dedicate some time to understand it. You won't regret trying out Nakama.
the thing is we are testing stuff and we are a small indie company
so we dont have a lot of money to spend atm
we already started implementation of Authentication and stuff to our main build and its pretty hard to revert to another plugin
Nakama is free if you host your self... Create one account on AWS, one year free of cost development
it showed me pricing and stuff
There's a cloud product that you might have seen, I made the same mistake
Yes and if you want to become their enterprise customer then u will have to pay.. else you can host yourself..
hmm thanks let me look into it
Remember Nakama team do release the latest code for every one either enterprise or free customer
What do you mean??
I didn't understand
Go is server side language it has nothing to do with client side language
And by the way Ken Thomson was part of team who developed go.. so go is not small time language
Is this how you should do it ?
UFUNCTION(Server, Reliable)
virtual void Server_Interact(class APlayerCharacter* Interactor);
virtual void Server_Interact_Implementation(class APlayerCharacter* Interactor);
Note that this is inside of an interface class which is why i'm getting forced to mark Server_Interact also as virtual
Oh, that seems really problematic for me then
To get around it you would likely just declare a pure virtual like CallServerInteract or something, and whatever implements the interface would handle that
But to be honest, it seems backwards to me - I would move the networking portion of interaction to the character, something like Server_Interact(UObject* Target)
That's a more resilient setup IMO, otherwise you have to duplicate networking logic wherever you use the interface which in a sense defeats the purpose of using the interface at all
Alright, i'll try to move the logic then to the player class ๐
Hi, does someone know how to use ClientTravel? Cause iยดm executing the "clienttravel /Game/Maps/MyMap" command and log print "Unknown command"
ClientTravel isn't callable from console but LocalTravel is the console command which will call it internally.
It will only work if you are currently playing as Standalone though.
I.e. not a server or currently joined to a server
though I believe the open command will do whatever
So if i call open level it will work for local travel?
Iยดm trying to travel to a map when iยดm currently in a session
Hi guys
I'm profiling my multiplayer game, and i see a lot of RepRootMotion calls, way more than anything else, have you guys had this problem before ?
When you set something on replicated, does that mean both the server and owning client can modify the value and have it propagated? Or only the server?
@brazen sluice only server
Ah thanks, is there a way to make it editable by the client other than RPC every update ?
no
I don't seem to find the issue, i have been profiling with network profiler and with unreal insights but i'm not sure what to do about it
you should relly grab cedric's compendium and give it a couple of reads
@tawny mason and why did you decide that is a problem?
my clients are getting saturated and i have setup the dormancy for my objects and such
the only ones i can't seem to optimize more is my AI, they move around and animate with root motion, and those 2 calls are the heaviest, from what i see on my profile
that is CMC
RepRootMotion, replicatedMovement and RepAnimMontageInfo are the ones called the most, with a big difference
replicating root motion
whats your considered actor count? listen or dedicated serveR?
that shouldn't cause significant network load
other actors i have don't do much more than replicate movement and send the odd RPC
most have netfrequency set to 10 or lower
AI characters have it set to 16
seemed as low as i could go without getting artifacts
This is the bytes | count profile i get on a 3000 frames profile
Could it be my moves are not getting combined ?
3000 frames 51kB,,,, that is not a whole lot
yeah i thought so too, but it does seem to get saturated
this is the biggest hitter by far as well
not because of this
ok so i might be looking in the wrong place
there are ways to clog the network other then bandwidth
most notable one time for server to evaluate actors for replication
which is capped
dropping lots of reliables maybe?
or hammering with unreliables even..
Calling unreliable RPC's very often can have a pretty negative effect too. I think people sometimes think it's okay because they know they'll be "dropped", but they can still saturate you before that happens
The "Dual" portion is interesting
the next contender is ServerMoveNoBase
how many replicated Actors do you have on the level?
and also, did you profile it in PIE?
i profiled in PIE and in a debug build
similar results
with stat net it says 1,700 actors aprox on the num actors and num network actors says 238
the weird thing is, if i clamp fps to 30 on all clients and the server it stabilizes
i tried to clamp network tick rate with
MaxNetTickRate=30 NetServerMaxTickRate=30 LanServerMaxTickRate=30 NetClientTicksPerSecond=30
how can i evaluate this ? i guess this could also be the reason
insights can profile that
also
just a few actors with stupidly high net priority are enough to destroy the network
our designer once "accidentally" put net priority 100 on trash mobs
when there were 20ish of them around, nothing else would replicate properly
ok i will check that, could you point me to some information source about insights usage ? i have been using it for some over the top profiling, but i'm not sure i would know where to check for the info you mention
i saw this video showcase about the insights profiler and i read a bunch of documentation but i haven't seen anything that tells me i'm overbooking the server time as you say
Could you elaborate on this ? sorry for imposing
It might be nothing to worry about, but just means you have unacked moves that are being resent
But to be honest, that's likely anyway if you're saturated and dropping packets a lot
ok ty for the info. If you have any information source for this kind of knowledge, other than the source code comments i mean, i would appreciate it.
How can i move a client to a new map without disconnecting it from server to do some functionality and come back to server map??
@golden nest you can't really move them to another map, since it would disconnect you from the server
@tawny mason our biggest network modifications were cutting down the number of replicated actors
never had a problem with bandwidth, even with 8 players and 150 AI running around
on listen server
ok, so is the, (sorry for repeating myself) 1,700 actors aprox on the num actors and num network actors says 238 a lot ?
our actor count is fairly dense but i did not think it was a lot
we had 33k actors, all Networked according to Stat Net, and 1300 of them replicated
when we started fixing it up
Are you sure? Itยดs a common thing to do, a client that can travel around maps :C
If the server is not moving you, you will disconnect
and if the server moves you, it will be moving everyone, research ServerTravel
@winged badger did you opt for some sort of centralized actor handling the other actors replication ? I guess i could try and setup something like that
we moved most of simpler actors to non-replicated, using network manager actors with fastarrays to do their replication for them
https://docs.unrealengine.com/en-US/InteractiveExperiences/Networking/Travelling/index.html
Look, APlayerController::ClientTravel "If called from a server, will instruct the particular client to travel to the new map (But stay connected to the current server)"
An overview of how travelling works in multiplayer.
But i donยดt know how to do it
yes, thats what ServerTravel calls on Clients
when server moves everyone to new map
"If called from a server, will instruct the particular client to travel to the new map (But stay connected to the current server)" <- as i said earlier, this will move everyone not just you
you want a private level for a client, stream one in just for that client
@winged badger thanks for the help, i will think about that and check what i can do ๐ I will be back thoe ๐
@tawny mason with the load you described
network should be completely fine
if it happened to me, i would go checking if one of the non-programmers played with reliable RPCs
and wired a few on Tick, 5-10 or so is enough to break everything
ok, thanks for the advice i will check our blueprints just in case ๐
never trust anything in blueprints ๐
but i guess the profiler would tell me right ?
Ok, but what if i want the client to move to itยดs private map, do some functionality, and connects back to the server with some information form the private map? I would need to store the data to save game and load it when it reconnects?
odds are you don't even need a private map
I donยดt want other clients to see what iยดm doing while iยดm doing it haha
So i can run clientside functionality without anyone seeing it? But server wonยดt let me do it, right?
So i have no choice to RPC it to server
Correct me if iยดm wrong
you're wrong
hahaha
server can't stop you from doing anything locally
it can just verify if what you sent it via RPC is sane
and say no if it isn't
So if i call "Spawn actor" Client side, it will spawn only in my client?
I thought server wonยดt let me spawn anything
it will let you spawn it just fine, you never even ask it if you can spawn it
it won't be replicated, and others can't ever see it or know anything about it
which is in most cases undesireable
note that client side spawned actor will return true if you check for authority role on it client side
But, for example, bullets are spawn clientside
So, there are exceptions
haha
Iยดm trying to enable clients to operate a certain machine at the same time
So, i thought clientside logic would work
what do u think?
itยดs there another way?
@winged badger and what if i donยดt replicate movement? The client starts running crazy ๐ซ
To many questions..
the client can spawn anything it wants, anything on the client is after all spawned by the client. It's only sometimes that that spawning is triggered by code executed from incoming server packets for the sake of synchrony
And why if i set Replicate Movement to false client starts moving really fast?
I don't know, probably because the built in movement replication is doing its job synchronizing a slower player from the server, and for some reason the client's version is faster
Ok, i will keep trying to do this things, thank u all for ur knowledge
@winged badger any chance you know about the push model replication ?
I know this is kinda a repost from #blueprint , but I want to move this topic to the right channel.
Having a bit of trouble with networking. I have a 1st person and 3rd person guns that need to have a loadout (set of attachments) applied to them. GI is the game instance, where the loadout is stored. "Dummy Gun" is the 3rd person gun.
but the loadouts dont seem to be replicating (right is server, left is client)
it just seems to copy whatever the current player is using
What could be causing calling JoinSession after succesfull session search on c++ to not travel the client to the session map?
When using blueprint nodes it works
I know I can see
It's all wrong tho
Why is your gi holding the load out?
Gi only exists locally
because I store it from when it is selected in the main menu
The youngest gunloadout then send a rpc
What's to say gunloadout property will best set on clients ?
What is going to happen first? Property replication or rpc ?
On phone sorry for typo
lol
Then you send not the youngest
idk what those are lol
Well why you messing with multiplayer without knowing what a rpc and property replication means ?
i am new to multiplayer stuff
๐ฟ
maybie its something I know but dont know the name of
There is a pinned pdf on it read it and then come back too much to explain
Gist is you have a replication race issue
Your rpc is arriving before the property
Also only server can set replicated properties
oh
Your client needs to do a server rpc with its loadout
Set this as the value then your property needs to be repnotify and in the new onrep function set the weapon.
ill read up on remote procedure calls
ye
So read what I put and do it. Should be really simple:)
I explained all the steps
But get cederics compendium from pinned and read it. Doing this stuff without understanding basics will be painful
ok, so rpc's are just those replicated events
So server rpc from client to set loadout property with clients loadout. Make that property repnotify and in onrep set the weapon.
What happens if I set my actors net update frequency to 20 and then put some RPC in tick? If someone plays at 60hz it's still only going to get called 20 times?
think it works now, thanks for all the help!
that makes sense, the client should wait for the replicated variable to change before applying it
oh yea
thats redundant
@meager fable no
net update frequency != RPC
that is when the actor replicates its properties
RPC's fire off as soon as they are called.
Oh okay, guess I`ll put it on a timer then, thanks
I had a question about replication, I am doing a sphere trace that converts a static mesh to an actor.
why would you want to do that?
It's because I am using Voxel plugin which spawns the foliage as meshes which I need to convert to actors to make them interactable
you don't really, just needs a manager and ISMC
making random foliage into full replicated actors because a player decided to pick an apple is not really feasible from the networking perspective
Hi guys, I'm having some problems with network sync. I used to custom events, one for the server (serversmoothrotationYaw) and one for the clients (clientssmoothRotationYaw), the server event runs on the server and it's replicated, while the clients events it's multicast and replicated. I call the server event on the event tick, but the rotation is replicated on only on the server. (the server event is connected with the clients with an execute node). The clients rotation yaw event only manage the rotation of the capsule component while aiming.
Can you help me?
I'll post some screenshot of the blueprints.
Hey guys, is it possible to authenticate a user( in Nakama) using username and password
its an OSS
Anyone experienced with Replication and explain why the tree only goes away on the hosts side
Did you create two events? One for server and one for clients?
the server should be server only and replicated, while the clients one should be multicast and replicated
I am only using 1 event, I'm pretty new to replication so I have no clue how to start
heys guys, I've asked here before but I still couldn't get this to work... I have a replicated pawn and a character, that work fine on their own, but when I try to walk on top of that replicated pawn with my character, it's incredibly jittery
any ideas on how I can fix this?
Hi everyone, I'm using ServerTravel rather than SeamlessTravel when changing maps on my server. If the server has a password, the player can supply the password to the server through the URL they use to connect (assuming they have entered it in the server browser). The problem I have is that if an admin sets a password on the server mid-game, then the next map change results in everyone on the server being booted off since they don't have the password set
To resolve this, I want the server to maintain a list of authorised players, so if you're already on the server then you don't need a password during map change
I plan to do this by maintaining a list of unique references to players within the Game Instance
I had a question: Is the FUniqueNetIdRepl passed during InitNewPlayer consistent for each player, or would it be regenerated during a ServerTravel?
i.e. can I maintain an array of FUniqueNetIdRepl to identify players who don't need a password to connect, or would each client get a new FUniqueNetIdRepl value when travelling?
its generated on connection
i think server travel is a new connection, so the ID likely changes
but you would need to check that
Anyone ever seen an event node that refused to replicate to server (Set to "Run on Server") and ran on client instead? That was fun trying to narrow down the problem... Just had to recreate the event and it worked fine -_-
i don't have anything setup to check yet
Sure it was the event and not an ownership issue?
100%.
strange, then again i do hardly any RPC's in Blueprint
could have been a slightly corrupt bp
Again, just recreated the node in the exact same place, hooked up the call the exact same way, worked just fine. Really weird XD
@meager spade hmm bugger, will need to think of something else then. I cant get seamless travel to work, the clients don't travel with the server
Guys, please tell me how to access the cheat manager from the client? Or it can be accessable from the server only? I have it not valid on the client(
server only
@meager spade ok, thx
Is there a delegate that fires on the server/host for when a client successfully joins a session?
or do I just RPC after joining lol
Can someone suggest how to properly replicate grabbing objects in VR?
I grab the cube and move it around on my client, but it stays stationary on the other clients. Although the character itself is normally replicated.
I have set Replicates and Replicate Movement true in the cube replication parameters. And also in StaticMeshComponent Replicates it is also true
@waxen quartz depends what you need it for
there are a few places in the engine you could hook int
o
basically to show a player joined as early as possible, not a big deal
to whom?
you mean like game mode functions like GenericPlayerInitialization and HandleStartingNewPlayer?
to the host
those are fine
PlayerState will register with the GameState as well
but not immediately if you delay BeginPlay
right I forgot about that
got it thanks
both login and post seamless travel paths lead into handlestartingnewplayer
pretty much immediately
and PS registration will be delayed if you don't start a match
there's HandleStartingNewPlayer_Implementation in the game mode and regular HandleStartingNewPlayer in the game state, do both of those get fired after seamless travel?
oh wait you're right my bad
Is there a callback/delegate for when it registers or is it just added to the PlayerArray?
I'm guessing I override AddPlayerState and fire my own delegate in there?
that works
note that won't be as soon as for clients, but it will be as soon as its practical[
makes sense, thank you
So I attach my player to a boat. Then use the player's forward and turn axis to control it. How would I do that? I am thinking call a server rpc from the player and pass axis to the boat BP.
I only got it working via interface but it won't replicate
If you want to do it Grand theft Auto style, just possess the boat and then whatever controls are implemented in the boat will do boat things
I don't want that since I still want to use the upperbody for fishing and shooting
In that case have a boat reference variable on your character. When you go to add movement input, check if that reference is valid or not. if it's valid, send the input to the boat. If it's not, use it in the character. Then you enter an exit boat mode by setting and nulling that reference
Then you can have it set up so when you press the interact button, you get all boats within a radius and select one to be your boat, play the getting in boat animation, and then set the reference
I got the boat working but not in multiplayer. How would it look like if I replicate it?
The same way, just do all the setting of references on the server. and that case, setting the boat throttle would be something like w goes to a boat event which calls an RPC which sets the throttle value
So I have the boat ref in my player BP. Should I control the boat from player bP or use server RPC or interface? Currently I'm using interface to talk to the boat from player bp. But eon't work in multi.
Your player has to own an actor to call rpcs on it, so maybe just call the RPC in your character and then have it make the interface call
Or set the boat actors owner to the player
quick question does anyone know if I need to make different HUDS for different players, I would have to make the hud in the player controller correct not the the player blueprint ?
Do you want the different characters to have different uis or not? It really all depends. Some things are going to be different but maybe none of them will be
If you're making evolve, then yes, everybody's going to have a different ui. If you're making dota, then no
@summer tide Either way there are 2 jumps that need to be made. Client to server, and character/PlayerController to boat.
So In my char BP i have server rpc calling the interface message. THen boat BP the interface event moves the boat. Does it sound right.
@summer tide ya that looks right but I would set up input to operate on a boat ref
Ref valid, send to boat, otherwise walk
In boat BP i have this but won't work. https://gyazo.com/d9614a871f07972ce8915bbe83d700ab
For some reason the server RPC won't call the interface
Well you need to debug and see what the problem lies. The server probably doesn't know what to call the interface on
I said it before, set the boat reference on the server, and replicate it out.
Or you can sit in the client and send it to the server through an rpc, either way. the server and client both need to know what boat you're talking about
Hi! anyone here knows how to adjust the OnlineSubsystemSteam voice chat volume to make it louder?
Is there anything which would stop me from writing some kind of custom interface class which allows virtual RPC methods ?
Need a bit of help again with replicating impact effects. It shouldnt be as complicated as last time.
Hi ๐๐ป
so my problem is that you can only see the impact effects on the server, not the client
Do I need to do anything unique to get SteamAchievements to work besides: https://forums.unrealengine.com/community/community-content-tools-and-tutorials/26348-tutorial-steam-achievements ?
This is the place to show, share, and link to your stuff!
I have a premium steam account (paid $99) and I'm not sure if that is equivalent to the definition of greenlighting as people have talked about here and if I can only test it on the Spacewar app id
Would this here be bad practice ?
void APlayerCharacter::SetInteractableObject(AActor* InteractableObject)
{
if(HasAuthority())
{
M_InteractableActor = InteractableObject;
}
else if(GetLocalRole() == ROLE_AutonomousProxy)
{
Server_SetInteractableObject(InteractableObject);
M_InteractableActor = InteractableObject; //<-- to also set it on the client
}
}
void APlayerCharacter::Server_SetInteractableObject_Implementation(AActor* InteractableObject)
{
if(HasAuthority())
SetInteractableObject(InteractableObject);
}
Can someone help me with replication, here's an example of something I'm struggling with...https://www.youtube.com/watch?v=RoUDWXUesxU
Iโm stumbling upon a dedicated server issue where I want clients to host there own session and join together in lobby via peer to peer and then the host tells everyone to join the dedicated server thatโs hosting the actual in game gamemode my issue is Iโm currently not using a online subsystem and I cant pay for steam for a little bit how would I go about this?
I donโt even know if thatโs possible but hosting the dedicated server in the lobby will provide me no way to actually tell who is host or not
@vague fractal why the runarounds?
don't need authority check in server RPC implementation
and server RPC called from server is just a normal function
so why not just call it as one?
I've saw this in a video, but i also noticed that there was always the authority role inside of it.
That's why i asked if it even makes sense, but i never got an answer, until now ๐
you are just obfuscating your code there
everyone just calls the server RPC
and server RPC sets the member
also that naming convention looks a little weird, prefixing the variables with m, f and so on
its painfully obvious its a member, it doesn't need the prefix
also that naming convention looks a little weird, prefixing the variables with m, f and so on
its painfully obvious its a member, it doesn't need the prefix
Ye, it is obvious, but this allows my IDE to show me all custom made things which i really prefer in an heavy OOP API.
and server RPC called from server is just a normal function
so why not just call it as one?
I'm not quite sure what you mean by that ๐
I'm sadly still too dumb for multiplayer stuff or more like networking in general. Don't even have 1 month into it >_>
I've probably made a lot of dumb things by now, but so far as i can tell it's working ๐
not for long if you continue to obfuscate the code
you have a ServerFunction and SetFunction
and both call each other
that is pretty terrible
So should i rather just call the ServerFunction with the logic ?