#multiplayer
1 messages · Page 177 of 1
How exactly are you spawning this UFO?
By Playing as server
So UFO is set to replicate and the Server is the one spawning it?
wait ..Can you tell how to set to replicate?
I think its default in case of manequin
In case of UFO which I've created separately we need to set replication right?
ACharacter is but I wasn't sure about APawn. In constructor I think bSetRepliacte() or something. Can also search it in the details of BP just to see
okay thx
Did u manage to get working?
I've tried to change blueprint class settings but did'nt get desirable result
movement is not replicating in case of client side
Because it's multicasting the possessed event on a character blueprint. If that character exists on other clients, they would receive the multicast, anyone but the possessing player controller or the server would end up getting an invalid reference from "Get Controller" which then gets fed into the cast, so then the cast fails, delays until next tick, tries to get the controller again which isn't valid so the cast fails, delays until next tick and tries to get the controller again... etc.
So it ends up becoming an extra "tick"
Ah I didn't think it would keep trying to get the controller that's why I was confused aha. Thanks!
since no movement component gonna have to replicate movement yourself.
Just on tick set transform with a server rpc
hey there
so im having a weird issue
im firing a event inside a macro that event is fired just once but it gets processed as if it was fired 2 times
here is a video that explains it more
anyidea why is that ?
hey, it happens in a packeged game. I also claim that it wasn't always like this, but I'm not 100% sure.
tried to fire it from the ABP but still the same thing
Wow I am going to have a stroke I have to be misunderstanding something.
So right now I call, SendSessionInviteToFriend() and I get notification/invite on steam. Now when/where/how is the FOnSessionInviteReceived delegate sent out? I have it bound to function but it has never actually run.
Does just receiving the invite not mean that this delegate will fire, is there more to it?
The Steam Online Subsystem may not necessarily implement it.
Read from here:
#online-subsystems message
@sinful tree Good evening. This message is a request for help addressed to experienced developers working with Unreal Engine. I am currently working on a multiplayer soccer game (similar to Rocket League). I’ve developed the multiplayer aspect using the Steam plugin and some YouTube tutorials, but I’m facing challenges because I’m trying to do something different from what I see in those tutorials.
The issue I’m encountering is that I want to organize players who join the game into teams. One idea that came to mind is to create a variable within the Extra Settings that serves as a counter for each team. Another idea was to create an array of Player Controllers for each team. However, I’m unsure how to modify variables within the Extra Settings once the session has already been created.
I would appreciate hearing about your approach to solving this problem and, if possible, any blueprints, videos, audios, or links that could help not only with this specific issue but also with the broader scope of the project.
Hello, someone can Help with a problem? I have a 2 player environment and need to use a widget menu to teleport the client player to another floor, but doesn't work.
It briefly disappear but remain in the same floor and position.
I even tried to replicate with custom event, thinking that would need this, but same result.
Here are the screenshot of the focused parts:
Help is appreciated
I may return the help with 3d graphic knowledge
😦
Simple question. Should I actually have different BP_PlayerController for when player is in for example Lobby, and then assign different PlayerController when it's in the Game? So like I have already 2 game modes, and these game modes also should have different player controllers basically? What I'm thinking about is, where do I put Widget / User Interface for the player when it's yet in the lobby? I mean where do I create Widget? PlayerInstance maybe? (I don't have that created/overwritten yet)
or do I create different AHUD?
I personally create widgets on the controller
and then you have different player controllers depending on level?
or do you have 1 and you just switch based on level or something like that?
One for main menu and one for in game
makes sense
Controller is the owner of pawn so when you do widget stuff use owning client rpc
Lovely, thank you!
Last question before I go to watch, I'm not sure what I did but after clicking button Host Session, it doesn't want to open the level.
and this is widget
Not sure I use create session and join session nodes
ohh wait... so I clicked Host Session on the 2nd window and it worked
Ok, I will watch video before I ask more questions. thank you for your time!
hope it will clear up some things 😄
for multiplayer is there a way to retrieve the HUD stored in my GameModeBase, I know GetAuthGameMode won't work. Is there a better way to handle this?
Why are you storing hud on gamemode?
legacy code really, someone told me to put it there when the project was still single player
In multiplayer the game mode only exists on the server
You want to store on the controller
👨🏫 My Patreon link:
https://www.patreon.com/kekdot
Download Project Files | Premium Tutorials | Courses
💦 Get our Game on Steam | Kekdot Center:
https://store.steampowered.com/app/1487180/Kekdot_Center/
🧑🏻🚀Support us on our 💲Patreon for awesome benefits: https://www.patreon.com/kekdot
In this video we talk about the Unreal Engine Multi...
fair enough, I've been putting off this project because I know it will cause a landslide of issues 😅 I guess I'm feeling brave finally
Widgets only exist locally for each client.
makes sense, and all the data gets pushed out to them I suppose
this is where it was, I was following along with Stephen's multiplayer course and he's putting it in the game mode
I may have misinterpreted what you meant I thought you were creating a widget on the game mode and saving the variable there
I personally don't use the hud class
So ignore what i said then lol
but the HUD class is kinda nice for widget management, it's spawned by the player controller
hi
what would be the best way to rotate target towards target ?
timelining with rpc
or ?
Hi fellow Unreal devs,
In my game, I have a breathability for each room that can vary from 0 to 1.
Below 0.8 the player can’t run.
Below 0.3 the player begins suffocating.
Breathability can vary up and down depending on various external factors such as a fire.
Since maps can’t be replicated, I provided each room with a unique ID from 0 to X and made an array of floats containing the breathability of every room ordered by said ID called displayedRoomsBreathability.
This will allow players to check breathability of a room at any given time without delay.
The server possess a more complex and more frequently updated structure (which encompasses rooms interconnexions among other things).
That structure is used to update displayedRoomsBreathability once every second, which automatically replicates to the clients.
It is also used to call CL_SetPlayerBreathabilityState on a player's character. Leading to slow / impending death / reset whenever a player’s room breathability state changes.
Does it seems to you to be a « correct way » to proceed ?
Thanks by advance. Always learning. 🙂
Tick-> interpolate towards target
@dark edge hm using a normal event tic
Do regular events always fire on server first?
@dark edgedo you have a sample of that i could see :/ ? i remeber someone said that a while ago also but i never solved it
what do you even mean by "regular events"
non-RPC events don't have networking so it being the server or client is pretty irrelevant
Yeap you are right. I just checked what is really going on there. Basically I have multicasted event from server. This event contains two events E1 and E2. E1 is multicast (if server) reliable, E2 is regular. Since first multicast is from server its immediately multicasts E1. Is it it true that on client reliable event E1 will be executed first and only then E2?
Basically client wait before E2 for execution of multicasted E1 on it?
sorry for this long video but im having an issue and i really need help
im stuck in the same spot for over a month and i can't figure it out
im willing to pay for the help if that will be needed
i can join a voice chat and share my screen for a better view of what is going on and to see how the code works
i really do appreciate any help
im in the Public Boole voice channel if anyone have time to assist
Depends;
Reliable are reliable, they will be processed in order, that is true for all RELIABLE requests. the RPCs will be sent again if no confirmation of it arriving was made, (packet loss). It always going to go through at some point, but before other RELIABLE requests.
Unreliable though, are not reliable, your unreliable request could end up being called before your reliable request even though you sent your reliable request first. It's not always going to happen, but it could if you're experiencing packet loss, they might even end up being processed by the server in the same frame (though rare and unexpected behavior). Just assume that an Unreliable call can happen anytime before or after a reliable request, even if the reliable was technically call before.
i get "Unable to build while Live Coding is active. Exit the editor and game, or press Ctrl+Alt+F11 if iterating on code in the editor or game" when packaging servers
nothing in task manager
Thanks for the answer. I understand this but I still not sure about the ordering. If multicasted reliable event is called after a HasAuthority branch or even in separate server rpc. The client will wait for its execution?
A bit hard to wrap my head around but here goes. Calling a client RPC from server should not have any expectations about what is "first", you are essentially queuing an event to be called and that gets to the client in an unspecified amount of time, it doesn't wait
A multicast will be called locally instantaneously first
@lost inlet does server keeps track of sequence though?
disabling live coding does brings up the same issue, ue never fails to amaze me
Why would you ever disable it
Packaging where? The editor?
dedicated servers
You should have no expectations about receive order
from my tests the client enters event do some stuff before this switch then reliable event is executed on it and then client go further the switch, in this case print string. But still not sure if it constant behaviour
I said where not what
yes in the unreal editor
how do I do either one of those
Google, UFE = UnrealFrontend
BuildCookRun is how a build server would do it. It's commandline
aight thanks, i'll check it out
@lost inlet
so it's just a coincidence?
Is your MainEventMulticast reliable in this instance?
no
In that case SomeOtherStuff could be called before
It's kinda hard without seeing it, y'know
Also how do you test multiplayer?
play as client, network emulation set to average sort of thing?
play as listen server
I just checked with main event reliable the other stuff is executed before the second reliable multicast
Effectively see it like this, if you have 3 server calls; ReliableA, ReliableB, Unreliable called in the code in this order, here are the different possibilities the server could receive it;
Unreliable ReliableA ReliableB
ReliableA Unreliable ReliableB
ReliableA ReliableB Unreliable
ReliableA ReliableB PktLoss
Reliable calls will always be ordered and arrive at destination, but this might create latency
Unreliable can arrive at anytime in any order.. and sometimes not arrive at all
I see thanks. I have one more question. What is the use case of unreliable functions? From what I read they used for cosmetics stuff but from its description it may not arrive so the sound or some niagara system just wont spawn? For me it doesn't make sense
one thing to note with listen server mode is that the FIRST "client" will be the host. client RPCs (in the context of anything they own) and multicasts will not use networking for that player
Ok So I'm a newbie at multiplayer ue 5 I have some doubts like how to do some c++ stuff and also blueprints
I would ask the opposite if I were you, What is the use of Reliable, ideally you want to stay away from Reliable as much as possible, otherwise you'll create lag. Imagine 10 000requests made by players on the server all telling the server that theirs needs to go first before the remaining can process
Where to store data of inventory of player in game save instance or gas
And a good exemple of Reliable that comes to mind would be player trading items, because imagine you make it unreliable so one has his packetloss and not the other, so one get his items but not the other, that would be awkward
I am confused in fact that they may not arrive and there is no intermediately option to arrive but without saving order. Currently the use case that I see that If I have some one off FX like explosion then I probably should use reliable but when I spawn a lot of regular FX I use unreliable
FX are unimportant period. if it doesn't make it through... well shit happens, don't jam your Reliable queue for cosmetics
of course, it really depends on the scenario
May I also ask about client RPC? I was a little bit confused with this table https://dev.epicgames.com/documentation/en-us/unreal-engine/remote-procedure-calls-in-unreal-engine?application_version=5.3#clientrpc. From my understanding client rpc mostly used to execute on the Owner (or just I use them for that) and that's the first row case? It says Owning connection: Owning connection which basically says that if server is the client that owns actor then it's executed on it? However in reality if server calls client rpc the event executed on owning client even if server isn't this client.
At this point there's so many factors to take into consideration that no one can really help you decide what should be and shouldn't be reliable. Depends on your game, server budget if any, how many requests the server will have to process per seconds, how many players in the game, how many replicated variables at all times, host bandwidth etc..
What was the question exactly? The owning connection is just the player that has ownership of a particular actor. When a player is controlling a pawn, they're the owner of it
If you are a listen server host, then any client RPCs will just be instantenously be called locally, no networking
(on stuff you own)
If there's a client RPC and it's a remote player, then the implementation won't be called
It'll be called on that remote client instead
If client rpc called on the server its executes on the owning client if it exist? If so why then in the table specified that client rpc called on owning client if the server is the owning client only
Well if a player doesn't own an actor, then client RPCs aren't going to do anything
And I'm not entirely sure what you're trying to say
From the table if client rpc called on any non server client it executes on this client
yes? and that doesn't use networking
and if it is executed on server then it will send event to the owning client or if the server is owning client it executed just on it?
yes
I am just confused with this statement Owning Connection: Owning Client. Because in other two tables there is just a Owning Connection: Client in this cell. And its sounds like if the owner is the owner client then execute on owner client and not just if the owner is the client then execute on owner.
Hello, a question, when my AI makes a parry, I want to execute a montage to the player to whom it made a parry, for this I have to access the player through the controller, right?
tried this but still have same error
so you have the editor completely closed and are using UFE?
you'll get the live coding message if LiveCodingConsole.exe or UnrealEditor.exe is running
any help ? please😢
it's ALL BP too
oh my
I think the tl;dr is it's a double up of a multicast? I'm not sure
Explain what you're trying to do, how you're going about it, and what doesn't appear to be working
@orchid eagle
not all of it also i can share my screen to show the issue
simply im making a combat system and im trying to add a collision so i can apply damage to the other actors
the thing is the collision event fires only once but it gets processed as if it was fired 2 times
also i tried to run it on server the whole collision event but i see that of this 2 times it get processed one is on server and the second one is on client
this doen't happen when i play as listen server only when i play as client
The fact that your bug only happens on the cleints and not on the server tells me that your issue might be coming from an event that is declared as multicast when it shouldn't
This is a question not really about unreal's way of doing something.
A while ago there was something called Spatial OS, that was going to (never did) going to release a sdk/gdk/plugin for unreal engine. It aimed to spread the world across multiple servers so you could build worlds with 1000's+ of players. They could all see and interact with each other. I see star citizen is building something like that called server meshing / replication.
Anyone know of any links to information explaining how something like that could work?
You mean under the hood?
well in broad strokes would be fine
i have an idea how something like that could work
but never really found details on how it did work
here's an idea on how it can work
https://www.youtube.com/watch?v=LTopxLqh5wE&ab_channel=SpaceTomato
The biggest hurdle to Star Citizen's success is currently in public testing, and as server meshing progresses the stability, scale, and depth of Star Citizen will increase. But how does server meshing work? And what makes it different from other implementations?
Server Cap Update: https://youtu.be/1XXKkLjK4Vc
Exclusive videos every month: http...
I guess I want something with a bit more detail then that 🙂
please someone good in multiplayer replication could help me solve this issue?
well ain't this some weirdly cropped screenshots, but first thing's first: widgets do not and cannot replicate
so how can I authorize a teleport actor
from a blueprint?
for client
cause doesn't work
for server does
well obviously it works for the server because they have full authority
to send anything to the server to a client it has to be through an actor the client owns
that could be their pawn, player controller, or a custom actor that they own
as well as a component on an actor they own
anyone know how to replicate custom movement component between client and server
I've made my own movement controls and I want to replicate
do you have replicate movement checked on the character?
can I show you demo if you can join vc?
sure join an empty one ill hop in
anyone able to help me with this, I restarted PC and still nothing
quick question, does add mapping context (client only node) cause nodes past it to also being client only?
Is it me or command PktIncomingLoss doesn't seem to work properly?
Net PktIncomingLoss=100
I only breifly glanced at it aha but I just wanna make sure first. HasValidPawn is returning true right?
Whats your contorller BeginPlay() look like?
sending inputs as RPC's like that wont work if you're using the character movement controller
get rid of the RPC and it should work
the movement controller will handle sending the inputs to the server and replicating them
Hey guys. I have recently been making all my variables and important events/functions server-sided for my mmorpg game and it got me thinking. My question for you guys is, what makes dedicated server games hack-able such as popular fps games. You hear about aimbots and other type of hacks for server-sided games, how is that possible? Are they accidently giving clients too much control?
as in not enough "Switch Has Authority" node equivalents
ah well then you've got a second problem before you will hit that one lol
This is a massive and broad subject but to give you an answer, no they don't. Let's take aim bot in FPS which one of the easiest to grasp;
In multiplayer, whenever a character enters my range, I am made aware of that character position right? I mean, I need to know where this player stands so that I can shoot at him. Simple. Now that means that the player character position has to be stored locally on my PC, there's no way around that, the server communicates to me where he is and my GPU renders his character. Once again simple. Now, since I have my world position, but also have that player character world position in my RAM, how easy is it do you think to call the function that moves my gun around in the game when I mouse the mouse, after calculating the difference between my position and his position so that I can aim directly at his head? It's relatively, very easy to do
Ok so aimbots cant really be stopped because its using information that the client HAS to know?
Well nothing is foolproof, but you can do stuff to prevent and make it harder to cheat. For example with the location. Before giving damage, check if the location the client said the hit was is close to the servers location. That way the client at least can’t move the players locally. But preventing aimbot is hard because as anarcx said, the client has the location of other players in the memory and can just adjust its aim to match the other players location
There's plenty of ways for devs to detect someone cheating and stop them. Like I said, It's a very broad subject. But reverse engineering and creating those cheats is a pain in the ass. But someone that wants it bad enough will find a way to do it. People that want it bad enough typically have something to gain out of it, for example, money
Thanks for the help everyone.
I spent a good 15-20 minutes typing up the question I'd ask and vetting the different areas, which led me to learn the thing that was probably blocking me.
Which is just y'all rubber ducked my problem without me actually saying anything, but I still give credit to the audience in those cases.
Nice i appreciate the info guys. I'm just trying to wrap my head around ways to make hacking very hard like we see in WoW. I feel like no one has ever really hacked that game effectively and i want something like that
You would be very wrong to think that nobody ever hacked WoW x)
haha oh dang i didnt know that
it seems like a game that is super safe when it comes to that
Bots that teleport between gathering sources, Players building an invisible tunnel in WSG to move the flag from one base to another, one shotting bosses, duplicate items... It was a lot easier back then then it is now I'll give you that, but its because everytime one of those cheats were discovered and exploited, the devs made it harder to exploit... anyway 🙃
interesting and good to know ty!
You have no idea how many times I've started typing questions on this discord only to end up answering myself. 😛
anyone messed with mover yet?
I'm testing my networking with the PIE network simulation is there a way to make a debug method run on the server/client instantly
no
Curious what's going here with my UI. So currently I have a user widget for my matchmaking UI setup in my multiplayer subsystem. It's created and the owner is set to the opening player controller. Now when I travel to level?Listen, if I go to open the menu again, the widget exists but I cannot see it unless I call MenuWidget->AddToViewport() again. Why exactly is this? (PController persist?)
Yes, why
How are you traveling?
PC only persists on SeamlessTravel and only if it's the same class
Ahhhh ok
if you call a client rpc from a client, is that the same thing as if it was a normal function?
Not necessarily. Depending on the actor its called on, it may not execute on the client. Owned actor? it should be fine. Unowned actor? I think you get a warning indicating there was no owning connection.
I think it is a unowned actor.
Its for like a interaction/inventory system. When you go to an item and look at it, the interact window spawns and it calls a client RPC.
Oh actually if it is unowned it gets called on the client
https://cedric-neukirchen.net/docs/multiplayer-compendium/remote-procedure-calls/
The chart shows RPC invoked from a client for a unowned actor will be ran on the client
i ninja edited the server to client
yea
Hello guys, I'm doing a combo of melee attacks, the only time I'm emptying the array with the targets' hits is when they finish the hit animation, but I realized that if they don't finish it, the array is never cleaned And if I make it clean in addition to when it is finished, when it is interrupted in a single pass it gives me many hits, do you have any idea what I can do? thank you
I'm trying to replicate a TArray of objects any time an element of the array is updated. So far I was able to get the OnRep to fire when a value of the array is updated by using REPNOTIFY_Always where it seems to try replicating an array of correct size, but filled with NULL instead of anything it actually contains. Is there something I may be doing incorrectly or is this just not a viable approach?
You were right, I didn't have the plugin activated so worked in packaged but not editor haha
Sounds like the objects in the array aren’t set to replicate
Base UObjects won’t replicate without extra work
Ok hm that's likely the issue then. Out of curiosity can they be sent via RPC more easily?
I dunno about UObjects but structs can be as long as they are USTRUCT and the variables you want to replicate have a UPROPERTY macro
i tried really much with everything i know and every possible way i can
but still i can't seem to find why is that happening
here is another video with the issue
yeah this is how it should work. a client character has a local copy on their machine and one on the server (and one on every other clients machine)
if it should only run on the local character you need to do a branch with "is locally controlled"
i kinda get it but at this point i tried every possible way but still can't get it to work
i would really appreciate any help i can get in voice chat and stream incase someone want's to see better the code and test with me
and im willing to pay for help if needed
its running on the local character afaik that AttackCollision that should be running on server gets processed as if it was fired 2 times which the problem why is that even happening
youre doing a multicast and playing the animation correct?
yep
multicast is telling every copy of that character to play the animation which is probably what you want
but youre using a notify within the animation montage i assume which would trigger on client and server copies because both are playing the animation?
oh i see your mistake
you're using has authority
both the owning client and server would have authority IIRC
you want "is server" node
and use that in a branch
hmm nope, i checked only server
ohh!
you've set the event to run on server, so the owning client is making a RPC to the server, you're essentially running it as the server and sending a message from the client to the server to run it again
both events in that case would have authority because theyre both the server
Switch has authority fires true if your the server in a server context, are the host in a listen server, or if your the client in standalone no 🧐
UObjects don't replicate at all by default, so even if you try to pass a UObject reference that hasn't been set up to replicate through an RPC, the reference will not be valid on the other side.
No. It tells you whether you have authority. Which for a non-replicated actor even a client would.
yes

which is usually more important/definitely more common.
You can check the netmode to see if you're on the server, but that's less common to need.
Gotcha ok makes sense
netmode is more per-world in a sense
(per-connection but generally you have one connection per game world in my guess)
the fix didn't has anything to do with the events actually
i had to change the visibility based anim tick option in the mesh to always tick pose and refresh bones
Hey if I have steam sessions plugin I cannot join from steam others dedicated home ade servers any idea'?
Has anybody worked with the UNetworkPhysicsComponent? It is mentioned in the Networked Physics Overview (https://dev.epicgames.com/documentation/en-us/unreal-engine/networked-physics-overview) and I found it in the engine source code, but there is very little documentation on how to use it.
how to set game paused multiplayer and why the node doesnt work
Well the concept of that doesn’t make a whole lotta sense 😂
Why?
The GameplayStatics call doesn't network. If you're in BP only you can try using the Console Command node and do "Pause".
yes
i'll likely post an article soon
im not sure how it works in blueprints but in c++ the server needs to add playercontrollers to a list of allowed players to pause the game through the GameMode class
https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/GameFramework/AGameModeBase/SetPause?application_version=5.3
You don't really need to care about the GameMode for the call unless you need to change the pausing implementation. The calls to pause all exist on the player controller, which is all you need to care about for a client.
Sounds good. Until you post your article, can you tell me, what are the basic steps to integrate/use it?
@thin stratussorry went bed lol, what was your approach to implement crouching?
I didn't do the ground movement. Mostly worked on Swimming and Ladder Climbing.
What parts are you wondering about exactly for crouching?
Hello, I have read a lot of topics about IsSpatiallyLoaded (WorldPartition) checkbox, but still cannot get the point.
In my multiplayer game, actors does not loads if IsSpatiallyLoaded active, I need to deactivate it.
Is it correct?
Pretty sure we just have a stance in the walking mode for the different options, such as Crouching. And then we alter the capsule size in Sim Tick as well as in one function that gets called for SimProxies which I forgot how it's called
does anyone have any experience using Firebase as data storage for say, player profiles? really just curious if there's something i will run into later that might be an issue. essetnially just creating a seperate database for player profiles and certain info that i need to store that will be used in multiple differetn games/levels
@thin stratus you using physics or prediction?
I'm encountering an unusual bug in Unreal Engine 5.4.0 where IsLocallyControlled() is returning true for both local and remote players.
Additionally, when I log the output, all clients are labeled as 'client 0'
Has anyone else experienced this issue?
Non Physics, FixedTick
I think Firebase is generally limited in some ways
Like not being able to run queries on more than one field etc
@crisp shard we use CouchBase
do you have an exmaple on you you manipulate the capsule on tick? im currently experimenting on this for something like bipedal or legged character
*not the size per say but capsule shape.. didnt figure out that part yet
- or is stuff related with capsule must be done on simulation? m confuse really on where to use some of mover stuff
looks like actors with IsSpatiallyLoaded (WorldPartition) checkbox, does not loaded at the server side.. maybe anybody know why?
my understanding if i want to implement sprinting:
make a sprinting mode-> make a moverdatastruct to store the data like bissprinting or bispressed-> in produce input i think, get the resul -> in finalize frame, store the input from auxstate -> i think at this point i have maybe to use the datas tore, in this exmaple bissprinting to start sprinting(this maybe be wrong as i never get it to work at this stage)
i think this setup is from moverexamplecharacter i think what i have in my project
Hey if I have steam sessions plugin I cannot join from steam others dedicated home ade servers any idea'? The plugin added to game build
So, if I'm trying to create a global game state machine for a tennis sports game.
Is AGameStateBase the actual state machine itself?
Or are those individual states I can add to the state machine?
Whats the interaction between that and GameMode?
Gamemode
Is server side only
While game state is client and server instanced
Guess what then vuddy
Everything relevant to the simulation should happen in SimTick
You can code the StateMachine into the GameState (don't use Base fwiw). Or make generic reusable one and use it in the GameState
So, GameState is the State Machine itself
And sorry, I'm coming at this from Godot / Unity experience
So, I tend to make state's GameObjects the machine parents etc
GameState is just a class that can be used to track the state of the game
GameState is not a StateMachine
Goottcchhaa
And trying to apply Unity and Godot logic to UE will make things confusing
Try to forget that stuff and learn UE from a blank state
Ye, that's been a goal of mine 😅
You can read my Compendium. It has some explanations about the different framework classes
It's pinned to this channel
UE has a bunch of pre defined classes that are relevant and important to learn and use (especially for multiplayer)
Ye I've been learning that overtime
So, given a tennis game. I want to have global game states like say SERVE, VOLLEY, SCORE etc. What kind of design should I look into with Unreal for something like that?
Assuming its an online multiplayer game.
I'm not so good with tennis. Are those just values?
Are any of those per player? Or per match?
Just states the game would be in. SERVE one of the players has the ball and is about to launch it out.
VOLLEY the ball is bouncing back and forth between players
SCORE the ball landed and the score counter is changed
You can write your own state machine as e.g. a replicated component and plug that into the GameState
And have that go through the states. States can just be GameplayTags
hey ive got this bugg where my player in game indicator Widgets only gets spawned on the server not the clients
sorry for the spam just wanna be clear*
do you recommend? im looking for a place to store profile data that will essentially be the place for long term use in multiple games. i'd love if it had a plugint hat i could use w it too if it has one
also what does multiple queries mean?
backend server.. that's what I thought
This variable is not needed. You have a Players Array on the gamestate that is a locally managed list of playerstates. When a playerstate joins the game the Begin Play fires on clients, when they leave, its endplay fires. These events can be used to trigger UI changes.
i think this is something i need to use or at the least understand
would using firebase for a player profile storage across multiple games be efficient?
can you afford them?
nots ure what you mean
@sinful tree yeah thanks for info i found my misstake it was related to that image
well a server is not free
yea i mean that part i understadn lol
Greetings
Client is crushing when I trying to load level instance.
Im working on dungeon generator, and every room is a level with few prop variations.
When I load PV (prop variation) level that was a part of spawned room, client is crushing.
But if I will delete all sublevels from room level, everything works fine
WTF?
We cant load level instance that is the part of another level?(
Hi that's a great idea except the node does not work, only if I input it directly into the console, do I have to set a specific player?
You must have started game dev last week, really useless comment but thanks for your input.
Yes it absolutely does
Just pause the game, no further info required.
Pause the game.
Just pause it.
I think I have been detailed enough
Thanks for your input once again.
Useless as always.
Alrighty
Get out
You did not try to help.
No point deleting shit now
You've been reported
Yeah keep deleting
🤷♂️ I tested this and it seems to work fine in Listenserver 2 players. Calls it only on the client's controller. Pauses the game.
I found the issue in the end, sorry, the node does work 🙂
It was something else in my game that wasn't
you might not believe me, but i was writing a reply all this time https://vorixo.github.io/devtricks/phys-prediction-use/
Hi, I'm going to start testing some things using a dedicated server setup to people who are a little less tech savvy. I'm curious what methods you guys use to distribute your client build? I think getting non-devs to set up TortoiseSVN to get the latest patch is out of the question.
Steam mostly. 🤷♂️
Hmmm, even pre-release? It's in alpha stages at the moment.
We have an alpha version and a release version. Alpha testers just get keys to the alpha version to download and play like the normal game except that it's the debug builds. Which is nice because it lets you also test deployment and such, less surprises there.
Awesome. Thank you for the input. I will look into that. It was between Github private repo and Google drive until you gave me that idea. Appreciate it.
Hi all, I'm in need of some help.. so I'm working on a top down shooter game , where when entering buildings the roof will change material so can look inside.. but.. for multiplayer this isn't what it needs, since 1 player enters building and roof material will be transparent for all... What's the best way of handling such a thing, so it's only transparent material for players that actually trigger the collision box ? Any suggestions
Hmm 🤔 could it be that this thing has replicate by default? Or maybe my definition wasn't clear.. So i have CPP class that detect if user enters the box collision around the house , if so, all materials of roof and top floors are changed to transparent material
Hey guys! Newbie to multiplayer here. I'm implementing a FPS and I'm stuck on understanding client-side prediction and server-side rewind (just like in Valorant https://youtu.be/GO6MIboHDiY?si=KJysOJaUJpk7f4uV&t=828). During my studies on client-side prediciton, I've come to know that the client should be ahead of server so when a prediction comes, the server simulates it and sends back the response so client can replay the state and check if they agree. However, in order to server-side rewind be possible, the server needs to be ahead of clients, right? So server can check a client event on its past states through the rewind. Thus, if I were to implement, let's say, a gun firing: In my mind, I should use client-side prediction to avoid the client waiting for server to register the fire event and let it predict the hit, the VFX, sound, etc.. However, I also think that I should use server-side rewind for responsive play due to a better hit registration. My question is: Does this make sense? Should I (and how) use both techiniques? Or should I only use one of them throughout my game?
if your changing materials in PIE, it will change for everyone
test in standalone
@thin stratus i don't get why mover is broken in network mode
works fine in standalone, but as a client, im just hovering in air
Yes, currently it's hard changing the actual materials of the meshes to a transparent one.. any other suggestions on how I should handle this to be able and keep it for local players only?
No need full guide just a hint into the right direction of where to look for
That didn't really ring a bell for me 😅 just update the applied material 😅
you create a MID and update the material properties
Thanks 🙏🏼 will dive into the MID to fix this
MID
@carmine field
Thanks for the guidance ☺️
Much appreciated
When I equip a weapon with a sight on it, I calculate the sight transform location offset from the camera so that when I aim, it appears in the middle of the screen. I have it setup so that I can support multiple attached sights and keep an array of these offsets. I also keep track of the current sight index.
When testing on a 2 client, 1 dedicated server I run into an issue. If I am on client 1 and I aim, it works on client 1. However when client 2 looks at client 1 while client 1 is aiming it is messed up. I know this is a replication issue however I am not quite sure what needs replicated in this scenario.
Stab in the dark to help walking through it. You would need to replicate the offset transform and the method setting that offset.
If it’s referencing just a transform, then you might be able to just do a replicated variable with that transform
Question... If I'm running single player and a "server" isn't running, "run on client" doesn't actually execute does it?
Like if I want to use RPCs to make sure my player UI(settings, etc) only runs client side... if I haven't started a server yet (if i want to copy my multiplayer code into single player because that's easier than making 2 versions) then it won't run?
I'm seeing the text "...To Owning Client (if server)" implying if it's not a server, that function will not work right?
Don't mark RPCs for things to indicate that it is going to run on client, only mark events RPCs for things that you actually need to communicate to or from the server.
That said, Client RPCs should still work in single player to have the local player execute them.
Even in a single player game, the game can be considered "the server".
One reason I brought this up is that a while ago I created a very basic settings menu, and decided to be clever and store an instance of the widget to pass to other blueprints. When I run on single player, or stand alone this works fine. The moment I ran a listen server, the game freaks out saying the server can't store instances of client widets or something. (I forget the exact context of the error) So, I started learning how in a server there's a client player controller, and a server player controller. Just printing "hello world" on event begin play prints several times if you have 3 players. So, I found the node "is local player controller" which seemed to fix the issue. It felt weird though... I can't remember why I just decided to stop storing widgets in variables. Anyway, I learned about how you can have a custom event setup to "run on owning client" and that made me curious again, if that would allow me to avoid the error where a listen server freaks out about having an instance of a user widget stored in a variable.
It makes me wonder how many other things I should probably switch over to running only on the client side... no idea how many other things are running twice without me knowing.
Nothing is crashing yet.
I toyed around with unreal engine off and on for half a year, but only really started getting serious about 2 months ago. I've pretty much being doing tutorials and making various projects for 2 months straight. So... I'm still fairly new.. but no 100%
very very comfortable with blueprint nodes, starting to dabble in c++, have steam multipalyer fully working to connect players, settings menu all setup
so now I'm taking time to really learn about replication, rpcs, multicasting, rep notify... etc
it will become important... very quickly 😅
Yea that's not what the point of RPCs are. They're a means to communicate to and from the server.
You can have the client do things automatically without the server telling it to do it, like creating the UI.
For example, "Begin Play" on say the PlayerController - this will execute on the server (as the server creates it) and then it can also run on the client as it gets replicated to them, but not to any other clients. Checking if locally controlled on Begin Play for the PlayerController ensures that your code would only execute on the machine that is actually in control of that player controller and would be the one you want maybe some UI created on.
How does unreal engine know not to setup my UI on the server and only on my client? For example, if I'm not running a listen server, but 2 clients connecting to a dedicated server. It seemed to run just fine and not bug out.
But I never explicitly told it "run this ui create widget ONLY on the client"
I just ... put it off begin play, but begin play runs twice
and yet... my ui only is created once
Depends on where you called to create it. Guaranteed if it was on begin play of the palyercontroller while running as client you got an error message in the log.
Begin Play of the HUD class? That's local only to begin with 🙂
all error/warning messages pop up when you close the game, i usually only run PIE windows, so I can see them. Running stand alone I don't always see the logs pop up
In my player controller class, off to the left is the "event begin play" event. What you are seeing on the screen... how does unreal engine know to only run this on my client? Or does it run it on the server too? I don't have any logic checking if "is local player contorller" and I get no errors or warnings.
What I'm getting at is how do I know when it's necesarry to use "is local player controller" to prevent errors, vs just knowing unreal engine is ok with it running on client and server
also, how I'm playing is running 2 PIE windows in stand alone mode, then creating a server, and having the client connect to the other one through UI actions
@sinful tree also really appreciate your time, I see you are typing quite a lot, I thank you for helping me to understand this stuff lol
It depends on the event and where the code is running to determine that.
There's a few issues:
- Multiplayer means you can have a single instance of an object that exists on both the server and client, otherwise known as an object being "replicated" wherein the server is the authority of that actor and changes are replicated from the server to the client(s).
- Some replicated objects are not replicated to all clients (Like the PlayerController).
- Not all replicated objects exist on all clients at all times - Almost any replicated object can also stop existing on clients if they are outside of net relevancy. PlayerState is marked as Always Relevant, so it should always exist on all clients so long as it exists on the server.
- Some Objects are not replicated to any clients (GameMode for example).
- Objects can be spawned client side and would not exist on the server, even when marked as replicated. Widgets are a good example of this.
- Dedicated servers don't have a viewport and normally have "widget" classes stripped from their builds to make them lighter weight - so you can't create and add widgets on dedicated srevers.
So this then means:
Some events can fire on...
- a single client.
- only the server.
- on multiple clients.
- multiple clients and the server but not necessarily all of them.
- all clients and the server
- on a single client and the server.
So you basically need to program your code in such a way that you know for certain that your functions will only be called exactly where you need them to run. Some events have indicators to mark out if it's cosmetic (ie. not client only, but not on dedicated servers) or authority only (note it's not server only, as clients can have authority on actors they spawn). Any other event, you need to check whether something is locally controlled, whether the machine has authority, if its the server or not. etc.
Unfortunately, most of the time it comes with experience to know where and when thing are executing.
You use "is locally controlled" only on the player controller or on the pawn to know whether or not it is being controlled by the current machine running the code.
You use "Has Authority" to know if the current machine running the code was the one who spawned the object.
You have given me a great deal to think about, I'm actually going to copy that message and put it into my google docs as I do with other notes lmfao
One thing I did recently was add a variable to the player state called "host_id" ... the setup works the way I wanted it because I have it replicated properly... but the whole reason I did that was so the first player on the server fills the "host_id" variable with their unique ID, and that value replicated to all clients. Then... in the pause menu, the button that reads "disconnect" reads "end session" for the host so they know disconnecting will kick everyone else. I run a check to see if the host_id matches the current player Id. There was a far better way to do that by using multiplayer widgets and showing a different widget for the host... the server should be the one that keeps track of the host id... not each player.
It works... but you can see how I can sometimes go down a different rabbit hole XD
Is there a regionalizer tool that makes it possible to determine which continent/region the player's ip is in for multiplayer matchmaking? i.e. US-West/EU-West? Trying to setup GameLift matchmaking.
Question here, I am totally hopeless haha
I am making really good headway on a multiplayer game. Things are going really well but I am having mouse input issues specifically on Listen server Clients (host is fine).
Essentially, my game is a 3D side scroller, and players can use their mouse to turn left/right, as well as to aim up and down.
The problem is that clients need to have a mouse input actively pressed for them to be able to aim.
The host doesn't have this issue, and doesn't need to hold down the mouse button to aim, and can aim freely as intended.
What baffles me with this, is the fact that in-editor, standalone, new PIE window etc, everything works fine. The issue very specifically seems to only exist for clients on Steam builds.
Does anyone have any thoughts as to why this might be happening or where I should look?
Cheers
What is the safest method to get player controller at the listen server, and at another thread?
UGameInstance::GetFirstLocalPlayerController()
uobjects (especial actors) arent thread safe so there is no "safe" way in that context, nothing will stop GC happening
not that its likely to happen but its worth saying
I don't need to edit it, just get a pointer and compare it with other pointer
How does unreal distinguish between connected clients from the same ip? I mean, at the low level. Because if it sends data, it has to send it via some port and to some ip. If 2 controllers connect from the same ip, then in theory it should send same data to both of them, but in practice its not happening
thats not what thread safe means
means its just not safe on another thread, for any use case not just assignments
each instance will have their own port
While you establish a connection to a specific port on the server, the engine will negotiate a random port number to continue communications with. First image shows PIE server starting on port 17777. First client on 61783 and second client on 59426
Understandable, thanks @opal pulsar @sinful tree
Do you have the same issue in the examples?
Thanks a lot! I only just read the article and it cleared up a lot of confusion about how to use the NetworkPhysicsComponent. I will try to understand the sample code you provided and then see how I can use thr component in my own project.
yes
That's strange. Maybe wrong NPP Config settings?
Hi guys! can someone help me with a Spectator system after death and Respawn? with this code, the problem is that the one who dies last after being revived cannot move, I don’t have much experience and I tried everything I could and nothing worked, can you help with this please? If necessary, I can send you any screenshots if it helps
haha as you saw ur question wasnt easy to answer with just a couple of lines
gl with it and happy coding!
Yeah thats what I thought tbh 😄 But its good to have some sample code to refer to now.
If I have 2 players and 1 BP_Unit base. How do I make each player see red decal under unit? Like I kinda know how to make it, but what is the best place? PlayerController with cast to unit? Anyone can give any hint?
Nvm, I finally got it! 😄
Am I handling Client Mouse input wrong somehow??
Essentially, my game is a 3D side scroller, and players can use their mouse to turn left/right, as well as to aim up and down.
The problem is that clients need to have a mouse input actively pressed for them to be able to aim.
The host doesn't have this issue, and doesn't need to hold down the mouse button to aim, and can aim freely as intended.
What baffles me with this, is the fact that in-editor, standalone, new PIE window etc, everything works fine. The issue very specifically seems to only exist for clients on Steam builds.
Does anyone have any thoughts as to why this might be happening or where I should look?
Cheers
That's a very hard question to answer without seeing the implementation.
How do you make a Party ID or Party code that other players can use to join your party. I already created an ID generator once the player clickes the create party button, but I can't make it so other players can join the party using this party ID. Here is all my code.
partyinfocomponent: https://dpaste.org/cHRXa
menu widget cpp:
void UMenu::PartyIDTextboxButtonCommited(const FText& Text, ETextCommit::Type CommitMethod) {
FString PartyIDString = PartyIDTextbox->GetText().ToString();
AttemptedPartyID = UKismetStringLibrary::Conv_StringToInt(PartyIDString);
PartyIDTextbox->SetVisibility(ESlateVisibility::Collapsed);
GEngine->AddOnScreenDebugMessage(-1, 50.0F, FColor::Yellow, "Actual " + UKismetStringLibrary::Conv_IntToString(PartyID));
GEngine->AddOnScreenDebugMessage(-1, 50.0F, FColor::Yellow, "Attempted " + UKismetStringLibrary::Conv_IntToString(AttemptedPartyID));
}
How can i add Hierachical static mesh instances On Client? i use a linetrace on server to get some random points in box, and svae the impact transforms.
than i want to use these transforms for adding the instances but if i play as client a cant see all of the instances some of them areent shown but on server all instances ar there as expected
i have added a debug Node that show the Transform array on server has always a valid length(last number of string) but on client mostly not always its 0
for the Transform i use a Replicated Struct of a static mesh and a transform
Having a slight issue where my replicated object cannot return values inside it when the client interacts. I thought since the actor was replicated this would work but apparantly not. Does anyone know of methods to have touch events work for online multiplayer? Im currently having some code fire off inside the interacted objects and that is where the connection seems to break.
Did this link replace the old PDF? Is it just the net doc now?
Are you trying to ServerRPC from the interacted actor?
no, im not sure how, but you've given me a direction to go to, so ill look it up now, thank you
Yeah, the PDF is no longer available. I thought about generating a PDF from the page, but I haven't had a minute to even try to think about how to do that for months now.
Sounds good. Appreciate the effort! It's been awhile since I've delved into multiplayer, were there any significant changes made when you converted it to the site that 5.x introduced?
It's not a good direction. 😄 I was asking because that sounds like the common pitfall of clients interacting with actors they don't own not working.
Not really. The basics remain the same.
gotcha
the object is replicated, which I thought would be enough for interaction but im obviously still not fully understanding replication
meh, why bother? it's much easier as a webpage
A lot of people actually told me that they liked using the PDF offline.
Epic in the early days also wanted a printable version.
I would also probably just leave it a website fwiw.
Read the Ownership part of the Compendium a few times and play around with it in the Engine
thank you, I will do that now.
What are the instances a client RPC might be executed server-side? I'm getting a weird bug that makes it a thing
@mystic estuary Top level, right column.
Brilliant, I forgot about it, thank you
@pallid mesa I have a quick question about your blog post. Do I have to use the RigidHandle to apply forces etc, or can I also use the BodyInstance? I am really new to Chaos, thats why I am not sure. My current setup just uses PrimitiveComponents. Thanks in advance!
you gotta use the rigid handle if you want to to apply forces async
Alright thank you. Another thing: In your post you do not keep track of any state. In my case however I am building a kart racing game similar to mario kart with the Space Dust Racing suspension physics. I therefor have variables such as CurrentBoostCharge etc. Would these be things that go into the state?
yeap! In fact ur lucky cuz chaos modular vehicle has boosting, so you can look there to see how they are doing
funny that you mention that, my other monolithic vehicle from the same repo is based off space dust :D
Okay I might look into that, thanks for the tip!
Yeah it is basically the only good video about how to do an arcady physics vehicle. Another one i found was for VeryVeryValet (in Unity but the same principles apply). That one was more complicated and also not what I wanted for my game but also very well done.
btw i added to my vehicle sample some other neat additions, like stabilization, sticky wheels or predictive landing, take a look in case you want to add that to your game, might be handy (although its not replicated)
Another thing: I am working with booleans (is acceleration/breaking pressed?). I hope that when they are pressed for longer intervals, they get replicated properly. Otherwise i may have to resort to using integer counters as you did for jumping.
i recommend you to do it based on input streams like the chaos vehicle does
my jumping solution is a bit iffy hahaha, its what i could think of without breaking my neck with input buffers
I already took a look at it and I may take some inspiration in the future. My main problem at the moment is getting the multiplayer physics part working correctly for my prototype. When that works correctly I may implement more advanced handling mechanics.
perfect! step by step
What do you mean with input streams? I though for each physics frame the client applies physics based on their inputs and then gives these inputs to the server to also apply physics. Then correction happens if both are too much out of sync
well by input stream i meant.. probably what ur doing already. I thought u were doing ur brake with a counter haha (as a one-frame event)
At the moment I am doing it just with a boolean (is right trigger pressed or not). Mainly so you are able to hold a drift.
What do you mean by resetting it on the client?
the issue i mention with the jump in the post 😅
Ah now i get it 😄
@pallid mesa Thanks a lot for your help regarding all this!
:> anytime
@pallid mesa One more thing 😄 : Currently the wheels for the vehicle suspension are SceneComponents attached to a BoxCollider on the Pawn (the Box Collider is the root component). I then do line traces from the SceneComponents down to the ground (depending on the angle of the BoxCollider). Can I use the same approach with the MovementComponent, or do I need a different approach?
you do need to have ur movement historic record in an actor component
the unetworkphysicscomponent enforces u to do it that way
So I cannot use a SceneComponent for the Start of the "Suspension"? Can I still use a BoxCollider for the collision?
you can use scene component for the start of the suspension, but you need to wrap your movement state/input in an actor component
so you can do some composition, as long as u fulfill the requirements ordered by unetworkphysicscomponent
Okay so I could have my pawn with the box collider and scene components and then pass them to the movement component during construction as references? Or can I give them to the movement component itsself ?(probably not i guess)
whatever you feel more comfortable doin
Alright i will just try to get the system working and then worry about that later 😄
@pallid mesa I got my old code working (barely), but the physics are now very different. When I spawn the suspension does not really balance itsself out and then either after driving forward a bit, or just by itsself the vehicle rolls. I only try one client in PIE so I should be fine regarding the erratical movement you desribed in your post.
thats very likely because the substepping settings
take a look in the physics settings of your project and adjust them to your needs
I took the same settings you had in your post. I sadly do not know what settings I should tweak based on my needs 😅
Yeah with a timestamp of 1/120 it seems to be better. Thanks for the tip!
1/120 is a lot LOL
u often would like to keep that value bigger
its performance sensitive
I will try different values but I know it could be too much 😄
my vehicle was tweaked to work at 60 fps
and it worked fantastically on physx substepping
when i rewrote it at chaos i had to tune it down quite drastically
and i had pretty much to re-tweak all variables
I think 60 is more reasonable. Thanks for all your help!
I need to redo a subsystem that was previously a UGameInstanceSubystem for handling inventory but now I need this once per player, would ULocalPlayerSubsystem be a reasonable object for the task? Assuming all the correct variables are replicated and RPCs set up?
LocalPlayerSubsystem is only created on the machine that has the ULocalPlayer and doesn't have replication available, but you could build a replicated object that feeds them the data they need. Otherwise, yes, it is a subsystem instanced per player on the local machine.
ok, hmm. this might need a significant rework then. I am passing in a container from the player AddItem(TArray<FItemSlot>& _container, ... which as far as I understand will always have a unique ID. Maybe a better approach would be to just write a server side thing that process these requests? Sorry, I have a whopping 2 days of replication experience so far 😅
then again this might bottle neck like crazy 🤷♂️
Typically inventories are done VIA Component.
Then you can give it to almost any actor.
you know, I had a really good reason for making this a subsystem a year ago, (over a component) really don't remember that reason now
think I was having some lifetime issues but I'll give it another look
Hey. I’m trying to figure out the best way to destroy client sessions when the host quits and destroys the server session. Currently when this happens the clients that were disconnect can’t join new games because they are still in a session. As a workaround I delete the session on construction of my main menu widget - which feels a bit hacky. Is there a way to iterate over all the connected clients and destroy their sessions too when the host quits? Thanks
This is on my UI, I get why the Player Controller is 0 (as it is a client's screenshot) but not the player state. Shouldn't the player state be incremented due to the number of players in the game being more than 1?
If I press the same button on my listen server pkayer, I get the exact same IDsfor the Player State
I’ve had this same issue. Have you tried getting each player controller from the server when joining? Then the server can use a while loop that runs a client-side leave-session event for each controller in the array
And there’s an event for when the server is closing
Thanks! I’m using blueprints and couldn’t figure out how to get each player controller from the server but I’ll do some research. Thanks for putting me on the right track
GetAllActorsOfClass.
Oh! And I just target my controller class? Awesome!
You also need to handle when the server loses connection, not just when the server decides to quit (ie. game crashed or alt-f4's or network dies).
I think the GameInstance has an event for network errors and you should be able to destroy the session on that as well.
You could also indirectly go through the PlayerArray in the GameState. PlayerState's owner is an AController of some kind, player or AI. But for APlayerController, they will only ever belong to players and they're killed off immediately on player's disconnecting, so.
That’s a really good point thanks. I’ll test it out
Awesome!
Thank you all so much for the help! Truly appreciated 🙏
@nimble heath Look for ReturnToMainMenuHost from GameMode actually. This seems to be BP exposed for a host leaving the game back to main menu.
This is odd. Disconnect already seems handled?
UWorld::TickNetClient should broadcast it. It should end up at UEngine::HandleDisconnect
Is it possible to make so that an OnRep is fired even if the property didn't change its value?
Use DOREPLIFETIME_CONDITION_NOTIFY(Class, Property, COND_None, REPNOTIFY_Always); or somesort of it
Guys, kind new to multiplayer here, I have a character look movement that uses AddControllerYawInput(). If I want to the server to also execute camera rotation, so when I execute line traces from the camera, the camera have its rotation in sync with client, how do I do this? Calling AddControllerYawInput() on server seems really odd.
I believe it is already replicated. There is GetBaseAimRotation() that I think can give you the value you need.
Oh yeah I absolutely forgot about that one, thank you
Hmmm right, it does seems like it. Just so I know tho, what is happening here? I call AddControllerYawInput() on client, but how does unreal update the server version? Isn't it trusting client?
Well, you kind of need to trust what the client is telling you its rotating itself to. How would the server know otherwise?
It's like trusting a client to press a button
That's not to say that you coulnd't lock their aim rotation either.
In term of what is happening in the background, I'm not actually sure. In the APawn class it eventually sets a RotationInput value which is used in UpdateRotation() on tick which then sets the control rotation.
Hmmm, Makes sense
I set NetEmulation.PktLag 1000 here, and by logging the GetBaseAimRotation I can see that server does take 1s to update to new rotation. Is this a case to use client-side prediction?
Or should the client-side prediction be on the weapon firing instead? This make more sense to me
Predicting client's control rotation seems too fine-grained
You can't reproduce a client's rotation on the server with any kind of accuracy without the client simply telling the server what rotation it had at that point.
The server pretty much has no choice but to accept the direction a client is looking. And separate from normal control rotation, any kind of traces initiated by a client really need to send a rotation alongside the trace because there's no guarantee the usual control rotation update will happen at the same time.
That makes a lot of sense
Just to be sure, can I just call on client:
PawnOwner->AddControllerYawInput(InputValueAs2DVector.X);
PawnOwner->AddControllerPitchInput(InputValueAs2DVector.Y);
and there is no need to worry here with manual replication or client-side prediction (on controll rotation-wise)?
I'm just scared to only do this and later finding out that should be something more complex
you don't need anything more complex
Cool 😄 thanks both of you!!!
Just so I know, does the same apply for AddMovementInput?
Can we use EOS for free using c++?
I plan on using this. it has a free opensource version. https://eik.betide.studio/
👋
@keen dune does "Client" print at all?
Nope
(the widget isn't connected)
does beginplay gets called?
Where are these nodes?
GameMode
GsmeMode only exists on server
do it in the HUD
?
Nah, let's start from PC first. Hud only exists on the Client. And it's an extra class to deal with
well, is that wrong?
Create the widget in the PC, pass in itself as the outer/owner. Then store the result in a variable on the PC
@keen dune do this first
I thing a proper understanding of multiplayer concepts is needed first lol
learn more first
trust me bro
I guess I have to create my own PC, can't browse to it it seems
Yeah. It's usually one of the first things you create in a new project lol
that's AAA level, not mine
You're evil tank
You can as well do it in the character and make it even more easier.
All depends on preference

So in multiplayer c++, I understand that I should literally use HasAuthority() everywhere, right?
OnPossessionPawnChanged? Cause I'm not seeing OnPossessed
Nope. If you do multiplayer right, you'd rarely use it
if it's on both server and client
Maybe? I'm not sure the exact function. But should be that
what's the difference between GetWorld()->IsNetMode(NM_Client) == false and HasAuthority() ?
Look for just Possess
Already done? That was fast

Nah, don't beat your self up. Just a lack of information
Unreal wants you to work a specific way it seems and I'm just learning on the fly. 😎
Lmaooo
@dull lance Nah fam, lecture me
Yeah you don't
I like getting it done right
this would have save you the day
https://dev.epicgames.com/documentation/en-us/unreal-engine/gameplay-framework-quick-reference-in-unreal-engine?application_version=5.3
You'd have created the widget earlier, possibly on begin play. Then just bind the widget on Possess
Tank, can I dm you? (for networking private questions)
Yeah, that's true
what books should I read to understand networking 100%?
The One and only network compedium
ccan you link these?
That’s the neat part of computers you won’t . Cause it will just change in 6 months 😂
This compendium is meant to give you a good start into multiplayer programming for Unreal Engine.
no but actual networking
And other pinned messages
Was trying to be optimistic XD
Iris only matters if it lets me make my BP only mmo
I mean networking is a broad term. You could look at CCNA videos but that’s like networks.
can you link it?
canj you link it?
YouTube network chuck. Some pretty good videos to get your feet wet
I want to undertand server meshing too
I'll implement mine
😆
How's them Star Citizen folks coming along. They just dropped off the radar
Stonks
Gotta milk that cow
Noob question….there are?? For server meshing???
I doubt it's true server meshing. That shits hard af
Well sure I watched the star citizen video and my brain about exploded
Meh, I came up with a similar design when doing independent research.
concept makes sense to me, and I really wanna get into it
I don't find it, tank
It's cool and all and they have the manpower to implement it. But it's basically just syncing a bunch of sql databases
It tbh for the idea I wanna try I think shard would be more than sufficient
Communicating between different databases.
Ah ok
what's sql databases ?
Each database represents a world. Then there's a master server that handles moving entities between worlds when they cross the boundary. Another server(or the same) handles sending some data from multiple databases to the client depending on proximity and network relevance
Gross. Jokes aside it’s a language for talking to databases.
Go to our sponsor https://betterhelp.com/levelcapgaming for 10% off your first month of therapy. Thank you to BetterHelp for Sponsoring this video.
Star Citizen just tested Server Meshing and 800 player servers, which is one of the game's biggest milestones ever...
Don't get me wrong, it's crazy impressive tech. And it's a huge feat for them to implement it. But I think it's not at novel as they made it out to be. Nobody else just gave enough of a shit to actually sit down and do it
Huh for some reason I thought it was something else. It’s not merely sending data directly to the server?
Again I haven’t looked enough into it
More super high level
Not really.
Nah, very very easy to understand
Yeah, the main thing is that the game simulation is moved from a master server to multiple smaller servers. So the load is split.
All the master server is doing is handling communication and data transfer
I see ok 🤔
Dual Universe also has a similar system, but with dynamic scaling based on player count.
Star citizen has fixed server counts with each server responsible for a certain section of the world
Gotcha ok
SC is trying to implement dynamic scaling, but with new server instances based on "rooms" instead of player count.
So basically when a player enters a room, it spawns a server for that room, when there are no players, it despawns the server.
I just don't like that they use fancy buzzwords for basic shit. Their persistent inventory and worlds bs, is just moving the data storage to sql databases and storing objects transforms as well.
And the entire community was praising it like the second coming of world of warcraft
I can do the same thing with flecs. Just serialise the entire world, lmao
well i think that’s just what a lot in the tech side do. Use fancy words to sound smarter
Like photosynthesizing your game instance 😂
Precisely 😂
You mean to tell me you don't?
I WOULD NEVER. Often. Try not too….
When they were describing the persistent inventory, I was remarking to myself that I accidentally implemented the same thing for myself when I moved my inventory system to use an ECS
I serialise everything, including object transforms and all the runtime data that's needed.
😂
Out of curiosity, can unreal have the player play locally on a simulated server on build?
i.e. Keeping code relatively the same between Singleplayer and Multiplayer. @chrome quest
Otherwise I'd probably need to do some sort of check if I'm running on a server and store that locally I think.
I wasn't sure if "Is Server" is used for P2P as well.
How to create a dedicated server?
This is a well documented process and easily accessible through a quick search online.
You just can't do it in a multiplayer game. You can't have the same code for single player and multiplayer. That's why we always say its better you start your game as multiplayer of you're ever doing to do multiplayer.
But, your multiplayer code works as normal if you run in single player. For the most part
So, code as multiplayer. Then you can use it as multiplayer and single player
👍
but the trick is that multiplayer is way harder than singleplayer..
Yep. For obvious reasons
Trial by fire baby
Try writing a data request system by hand because you can't replicate your entire inventory system database.
Nah just check the box what could possibly go wrong!!! 😂
Then you use a DSL because you can't write a function for every single data combination
Oof.
if (IsSingleplayer())
{
SetIsMultiplayer(true);
}
Boom easy
@chrome quest Btw the reason I bring it up is because
In Standalone you are Authority
And when it comes to HasAuthority checks
I was thinking about whats used to determine if you are in a single-player session.
Since in multiplayer, you're remote
Unless P2P I believe
Why do you want to distinguish that?
There's not a case where I would?
Why do you need to know if you are SP or MP?
What does that information help you with?
There are situations but it's pretty rare. And you use the netmode for that, not authority.
And even in those situations you generally want to know whether you're a dedicated server or not to avoid purely visual stuff that a DS doesn't need to run.
Hmm... can't think of it really. If you're in SP, just treat the game like a listen server. And a listen server is one that is also a player.
So, the hud thingy and all, you also run it on the server. If it's a dedicated server, it'll get ignored anyways.
Ah
Obviously, make sure to check your references are valid or you'll get a crash
I've noticed that everything (mostly) in C++ can be made in BP, is that also the case for movement prediction for multiplayer purposes?
I mean for that stuff you usually check IsLocallyControlled or related.
so it's not authority or netmode.
As with everything yes probably. But just cause you can do it doesn’t mean you should
You have far less control in BP.
Nope. Most things in C++ can't be done in BP, that's why C++ is used just as much, if not more than BP
Complicated things like that should remain in C++
C++ being faster anyways it should be used more.
After getting used to the engine in BP
👍
It should be used for what it's meant for. Same with BP
:question: Should I use Blueprints or C++?
Use whatever is comfortable. But seriously: use either one, or both. It depends on the scope of the project and the size of your team. Check out this guide from Moth Doctor to learn more.
My opinion is BP is more power to the artist and designers, C++ being used to create the systems that drive the game and made to allow input/configuration.
I recommend the popular video called BP vs C++
i.e. Quest System in C++, creating the data configuration and a few other things managed in BP
Lets not get to far offtopic here.
Yep. Back in #programmer-hangout if you wanna continue
hi can anyone help me why my cast is failed and how i can fix it
The instigator controller from "self" may be null. Check what it is.
This is based weapon
So i am using a player character and spawn weapon then apply damage in the base weapon
But what actually is the instigator controller you're feeding into the apply damage node?
Like print out its display name.
See what it actually is, make sure it's not null
Hello. I have problem when I try to join on session in editor. The engine crash with some TSharedPtr problem that i don't understand
But is it actually null? If it is null, then that's likely not what you want to feed in to the instigator as it may not have been set on "Self" when spawning this actor.
It's telling you that an assertion failed of IsValid on line 48 of your MultiplayerGameInstance.cpp file.
That usually means that you're attempting to access something that isn't valid at the time that this function is being called, and the only object you appear to be accessing is "SessionSearch".
How do you actually set a value into your "SessionSearch" pointer?
Is there a way to switch from standalone to listen server without realoading the map? Something like Minecraft's "open to lan"
In PIE?
in packaged game
Typically you will just run the game as if it was a Listen Server anyway and only generate a Session when you want people to connect.
By session, you mean like normal/advanced sessions, or are there some special kind of sessions just for the listen server?
They are the same
ok, thanks
@sinful tree Im continuing to debug my problem and i see that Session search is invalid for some reason 😦
is the game instance the same object which get joinserver called on ? pay attention to this when setting breakpoint in joinserver and there
at least they're making an effort!
Okay - ForceNetRelevant is basically just a ForceNetUpdate wrapper with 1 distinction; If its remote role is ROLE_None that means its not set to replicate so it will enable replication for that actor before calling ForceNetUpdate.
@violet sentinel Can be when i create the session is not registred on the session result? Because Session result it's every time NULL
if they're two different gameinstance objects it is possible. thus i mentioned to pay attention to this address
@violet sentinel what is this?
look at variables panel when debugging and not the tooltips
@violet sentinel you are right. this is MultiplayerGameInstance_0 on create session and MultiplayerGameInstance_1 on find :/
what happen?
you run a server and a client? so you get 2 GI
createsession running on server GI_0 is correct
join and onfindsessioncomplete should happen on client so GI_1
ok so it's correct. But didn't find any session
your joinserver call for happens on server instance , sets field
your onfindsessionscomplete happens on client instance, reads field and sees null because it was never set
Hey everyone,
I have a TMap that I need to replicate (store / inventory that is a list of resources type and qty for a RTS)
I know we can't so I'm trying to change the way I'm doing it
Before:
I was having a struct with the TMap and I was replicating the struct.
Now I'm trying to find a good solution for DX and also for the networking.
I tried having a Struct with two TArray but I can't have helper functions in the struct so the DX is not the best and I need to make the functions in a BPFunctionLib(addresources, delResource, basically just redo map helpers)
I tried creating a DataAsset with two TArray(Key and Values) and all the helpers functions but every actor is sharing the same data and I want Blueprint to have its own store.
I want to try with a AInfo or AActor but it means that I need to instanciate it, does not look like the best for DX.
My current IDEA is doing an actor component with the two TArray, so I can have all the helper function I want.
Let me know if you are having any resources for that / good idea for best practices.
@violet sentinel the problem should be the widget?
do you have a lot of different resources?
data asset is for read-only data. if you need an object to store data - inherit uobject and replicate it.
actor component would be a nice thing as you can have all resources logic aggregated in single place and attach it to whoever will hold the resources (like playerstate or gamestate)
Is there a better way to check if code should be run at listen server by a local player than checking if controller is local controller?
For now not a lot but probably 20 max.
UObject does not support replication today if I remember well
verify how you acquire SessionInterface
You can if you add that uobject to be replicated through an actors channel, its how components work with replication - Just incase you wanted it https://dev.epicgames.com/documentation/en-us/unreal-engine/replicated-subobjects-in-unreal-engine
New to using AWS Gamelift... I've managed to deploy my fleet and have succesfully started a gamesession. What is the intended way to connect to the server? Currently I am manually passing ip:port as commandline arguments, but that wouldn't work with a release build?
Thanks
You will do much the same, you would query gamelift to get the ip and port then run that in the game. Now how you are going to do that is going to depend on the kinda of game your after. You could use matchmaking to pick which fleet and session you want, then return that in your game.
There are a few plugins on the marketplace that expose the API into blueprints to aid this workflow. Keep in mind best practice is to never store access keys on anything client side. Best way would be either an API, cognito (AWS user pool) and authenticating users/requests, or a combination of both
Once you have that information in either c++ or blueprints you can just do an open level call with the ip:port info
@violet sentinel if i use the original BP create session node and try to find session with my find session on C++ it's work. So i suppose the problem is on create the session but i don't undestand the problem 😦
@worthy oak thanks! alright so i found these tutorials for setting up Aws Lambda + API.
I guess that is the way to go? I.e. there's no automagical api in the Gamelift plugin already
Welcome to Building Games on AWS, an AWS Game Tech YouTube series where we teach you how to use AWS to build games! Building Games on AWS will cover a variety of topics, including analytics for games, AI/ML for games, hosting game servers, game engine integration, and more.
This second series will be about integrating Amazon GameLift with Unrea...
That would be the way I would do it and tie it to some kinda of authentication
Ideally you don’t want players to query gamelift directly with the exception being a matchmaking request
yeh they have cognito users as part of their tutorial series
cool cool
Thanks! Then I know I am not missing something obvious and it's not a crazy way of doing it 🙂
Yeah of course! 😄 best of luck!
i was about to ask a question that i did not even consider for a second it would have something to do with a multiplayer problem, then, i added an rpc and it solved.
my advice from what i learned on this experience, is that if you have a multiplayer problem, add an rpc, 8/10 times it will solve your issue
the other 2 its because you forgot to check the replication box ya dummy
Just be aware of the cost and try to implement things with that in mind and try group functionality or even get it for free sometimes with OnReps
thx is there any other free option for blueprint?
I'm not aware of any. I think that's the selling point of all the premium ones.
ohk, btw what would happen if I use steam subsystem and don't release my game on steam?
Just use the interface and that way you can configure different subsystems. I am not to the point where i have done much with the online subsystem stuff though.
okay
Anybody that knows how i should implement the HUD for a local multiplayer join screen?
Something like the image?
How can i make certain parts of the HUDonly react to a certain connected controller?
I Suspect each player controller will have some sort of FSlateUser?
If so how can i access that an build arround that?
Anyone using Mover and its Transitions?
I'm a bit lost on how to clean up the State left behind by the previous MoverMode, if I don't have a freaking OutputState to work with.
When creating Widgets you can usually supply a Controller in the CreateWidget node.
That should set up most of the underlying code to only route that user to that widget.
Hey everyone,
I was wondering if someone could point me in the right direction with this issue.
I have a variable "JoinedChannel" that is replicated using OnRep in the PlayerState. When a player joins a channel this value is properly replicated and every client knows in which Channel a player is.
Now I am currently trying to implement Player-Visibility depending on the JoinedChannel. So when two players are in the same channel, they should be able to see each other, if they are in different channels, they should not be able to see each other.
I was trying to invoke my method that handles that Player-Visibility in that OnRep_JoinedChannel function. For that I got the OwningPlayerController of the PlayerState and invoked UpdatePlayerVisibility(). Well this doesn't work for all clients because this OnRep function is, as far as I understand it, invoked on the PlayerState-Copy other clients have. But I basically want to invoke this method on all remaining PlayerController.
So I was wondering what the best course of action would be. Should I use a Multicast to invoke this on all clients? Or maybe invoke a ServerRPC from the owning client (ROLE_AutonomousProxy) that invokes this UpdatePlayerVisibility? Or a completely different approach?
IsNetRelevantFor might be better?
Keep in mind that Players in the same room, even if in different "Channels", will have Collision enabled on Server-side
So they might still run into invisible people if your characters can collide.
Even if you use IsNetRelevantFor and fully stop the replication of them (which is probably better), they will still cause corrections if ran into on the server.
Good point, I'll have a look into that, thanks!
For my understanding: Regarding the Server-side collision on a dedicated server: NetRelevantFor returns false if IsHidden is true and collision of the rootcomp is disabled. If I do this only on the client side, the server would still register the collisions and this would lead to the client having mismatched locations, which the server then has to correct, which leads to rubberbanding/teleportations?
If so, how could I prevent this?
@thin stratus Hello , I wanted to let you know the network prediction plugin fork has all critical features completed. the last 2 submits contains all changes to both NPP and mover in separate commits with comments detailing the change list.
Features Added :
- Smoothing
- Client Time Dilation To Remove high input buffering
- Bandwidth usage optimization
- replay support
https://www.youtube.com/watch?v=g8_JyUdrOLs
https://github.com/TrueKaizoku/UnrealEngineNPP/tree/5.4-With-NPP-Features
In This Video , I Cover The Network Prediction Plugin for unreal engine with a brief explanation. Talk about its missing features and showing the result of implementing said features.
These changes are available for everyone to use. you just need to be part of epic organization on github. to access it.
Becoming Part of Epic Organization On Git...
can you tell me the use case? what you mean by "clean up the State " ?
So I have a general Transition to start Swimming. This simply checks the ImmersionDepth.
Now a child of that is used to Transition from climbing a Ladder to Swimming, cause we want some more control over it.
When climbing a Ladder, we set the Player to ignore the Ladder Collision while moving, as well as set the current Ladder Actor in the SyncState.
When performing any kind of transition off of the Ladder from inside the MovementMode, we clear the Ladder on the SyncState and reenable the Ladder Collision while moving.
On top we also broadcast that we stopped climbing the Ladder.
That can happen by reaching bottom or top of the Ladder, or by reaching the floor, as well as manually jumping off via SpaceBar.
I sadly can't clean up the SyncState of the Ladder Climbing properly when using a Transition, cause I have no access to the OutputState.
I'm considering adding it to "DoTrigger", cause I don't see why not.
Awesome (: thanks a lot!
NetRelevantFor is Server-side only. Server stops replicating the Actor to the specific Client.
There are many reasons for that and you can override it per actor to add your own.
How you resolve that the Actors still can collide on the Server? No clue. Disable the collision on them in general I guess? Figure something out where they have different profiles or so? Probably difficult with limited amount of CollisionObjectTypes.
you can't not have the sync state anymore? like ziplining does it? the ladder movement mode adds its own sync state to the output when it tick. and copies from the input before modifying it. if you are not in that movement mode that sync state will be gone. this does mean you'll have to check for ladder actor in the movement mode tick when you first enter it from a transition because it will be null. you can enable and disable collision in transitions i suppose.
And Yes, The output should probably be a part of the transition do trigger. logically transitions triggering should be able to effect the state. it's a change i would like to see too.
Transitioning onto the Ladder is a bit different
There is a Transition (Mover) that sets some Blackboard Struct with information.
Then goes into Ladder MovementMode. That MovementMode then checks if the TransitionInfo is set on the Blackboard and transitions. At the end of the transition it sets the Pending Ladder on the SyncState.
So that should be fine.
I guess the SyncState of the Ladder MovementMode cleans itself up like you said.
Then I would only need to grab the current ladder from the StartState and remove it from the IgnoreWhenMoving list.
Alright, thanks for the replies!
That MovementMode then checks if the TransitionInfo is set on the Blackboard and transitions.
That said, I would have loved a way to actually tick the Transitions.
Feels a bit half-done atm.
that would work yes. if there's no ladder state , there shouldn't be any ladders ignoring movement
I still have to actively clear that, but that's fine. I can do that via the Params that I have available in the Transition.
transition do tick. you mean effecting the state i guess
Where do they tick?
They call Evaluate and if that returns a valid name they call Trigger once.
Yeah but that doesn't single out the transition
I want to say "This Transition is Active" and then only tick that until it returns "Done" and then move to the next Mode.
Cause currently I have to handle the Transition over Time onto the Ladder in the Climbing MovementMode
sometimes it's simpler to not use transition with some modes. like in this case. would be a lot simpler to check if you should exit in the tick of the movement mode, and clean up then set next movement to what you want.
Yeah I do that for almost all cases, but Ladder -> Water
I could move that too, but at that point I could just not use Transitions in general
i found transition most useful as global transition from multiple modes to a certain one. they are not useful for 1 to 1 . from specific to another specific mode. that can just be in the mode tick.
A lot of transitions on our end are specific with some general shared part
Will see how this developes. Still exploring the best ways to use mover.
Do trigger should have output state though
I assume for the Ladder State I want to disable the CopyFromPrevState part
Doesn't on our end. Maybe outdated?
that's what layered moves are for
It's not really a move. it's a fixed animation sort of from current to a specific point on the ladder
It's fine atm. I just tick it in the MovementMode. Probably won't change
WELL, then I need to manually add the Ladder OutputSyncState I guess
Not sure that's nicer
Ah, something for tomorrow. I worked enough on Mover for today sigh
okay so i should basicly get all the connected controllers and make that ammount of join Widgets
i meant it should. but it doesn't.
Sounds reasonable. You can also set the Owner after the fact I think, but not sure how well that calls into the Widget stack
I think so too
for ladder , i would have an entry transition this transition checks for entering ladder conditions and if they are met, it gets mover component and queue layered mode of type move to ladder location (child of move to) for example. you can fill in target location and duration and queue it.
mover will start this layered move which in its evaluate you check if it's time for it to end when its duration passes this frame , you can propose ladder movement mode in the layered move. which would trigger the movement mode that doesn't need to have a persistent state at all and can be just like ziplining mode. it adds its own state to output and copies from input if it finds it in input. if doesn't find it in input means it's first frame of mode. all exit rules of the ladder are checked and performed within ladder mode tick.
How do I stop the current MovementMode from generating a ProposedMove ontop of the TransitionLayeredMove?
I will see tomorrow if I can move it. It's already working, so I rather focus on the broken stuff first.
if the layered move is override, it will override all movement modes proposed move
hmmm does not work : (, Even if i create my widgets with a different owner all of my controllers are able to press those buttons
can I use steam subsystem for my mobile game
cause I've heard that games using steam subsystem are only allowed to be launched in steam
When i press stand alone the steam didn't pop up and when i package it shows this warning is it because i set my ini wrong?
When developing a game that has both a single player story mode and a multiplayer mode, will writing the code for multiplayer create problems in terms of single player development?
I gatta start implementing the subsystem today, can somebody answer it for me?
Is Steam on Mobile?
If the answer is no - then you have your answer.
Steam only deals with Steam.
Idk what you're trying to do, but if it is network stuff - use a different service, like #epic-online-services
There is even this https://github.com/betidestudio/EOSIntegrationKit that you can use. Nice & free.
yeah I just need to create and join sessions, nothing else but if steam doesn't allow this then I think EOS would greate choice.
Yeah I know about this but I am trying to do it with c++ to make game faster.
Thanx buddy
Sanity check - can you replicate a non-replicated actor reference if it's loaded from the map on server and client?
@surreal fox Steam is "Desktop" only (if we ignore stuff like SteamDeck and what not). If you need Mobile either use the matching Mobile OS if it has Lobbies/Rooms/Sessions, or use EOS and auth with the Phone on EOS.
ohk I got the answer, I was preferring it cause it has many tutorial on yt but no problem. Thank you
Yeah it’ll be its path the first time and then after it will be assigned a NetGUID so further attempts to address it will be cheaper, assuming I understood your question
Yeah kind of, just wanted to see if I could just replicated the actor reference instead of the path
if it works, cool
Guys what is best system or easiest system to make Level (xp) system in multiplayer game, progress in missions and stuff like this ?
maybe in future some skins or achievements
You're asking for big system on Discord. All of these are different things. And there is no "best".
$5, best I can do
- Try to do it
- Realize you've done it badly
- goto 1
brah
Does anyone know how to set the window tick rate? When my window is unfocused in standalone mode the FPS drops. Already tried unchecking Use Less CPU in background.
Another "hard" question, if you wanted make game and have game on steam or epic maybe multiple platforms would you use EOS for multiplayer or rather something else like playfab?
using the "play montage and wait" node in from a server initiated gameplay ability when the "Anim Root Motion Translation Scale" is set to 1.0 everything looks great, but when it is set to a lower value (eg. 0.5), the owning client of the player whose character is playing the montage has a lot of jitter during the movement as though it is being correctly by the server (other players viewing that player have no jitter). Is there a way to make the "Anim Root Motion Translation Scale" property replicate smoothly so that there is no jitter on the owning client? Its wierd that the problem only occurs when the "Anim Root Motion Translation Scale" is not 1 and the jitter is worse the further from 1 that value is.
The root motion in the animation is very simple, so i can work around the issue by disabling root motion in the animation and then using apply root motion constant force and everything works, but it would be nice if i could have the translation scale property just work, I've used that property on a different ability that is client initiated and it worked fine.
hm this is run on player controller
but its not working on the client side,
i though if i play it on "owning client" it would work on the clients also :O?
What event is it from?
And it doesn't work on the client running it? O.o
nope
It is running on that client though? The input event?
yupp
oh wait
my bad
it works i just set what audio on the server
but dident replicate
however im getting access none on the "set current music being played" on client side
this is on a component on the player.. ??
:/ ?
Hi! So i have a problem. I'm trying to connect to my friend (locally) and the friend is in a map called "FirstPersonMap" and it looks like its trying to connect me to the main menu of the other machine? I'm very confused so any help would be greatly appreciated. When I click the join button nothing happens and I get this in my log
[2024.05.06-20.05.26:875][983]LogGameMode: Display: Match State Changed from InProgress to LeavingMap
[2024.05.06-20.05.26:875][983]LogGameState: Match State Changed from InProgress to LeavingMap
[2024.05.06-20.05.26:875][983]LogGlobalStatus: UEngine::Browse Started Browse: "192.168.1.12/Game/FirstPerson/Maps/MainMenu"
[2024.05.06-20.05.26:875][983]LogNet: Browse: 192.168.1.12/Game/FirstPerson/Maps/MainMenu```
Hello, I have a Pointdamage event that my AI receives when my character hits it, there I pass my character's Controller, I would like that when my AI makes a parry, my character executes a montage, I have to execute this on the side from the server and through the controller of the character that does the damage, right?
https://www.youtube.com/watch?v=-i65hG3eh0I Just watched this, didn't help with my problem but maybe will help with yours
How to replicate animation montages from Behavior Tree Tasks (only existing on the server) to all clients.
Footage is from my current project: https://twitter.com/TheBornlessGame.
Email me on my channel if you want to work together
==========================================================
Popular UE4 Products:
🛍️ Endless Random World Tut...
But I don't need my AI to do the setup, the character who does the damage has to do it
this is the parry event
Well it's an incredibly broad question but for non-competitive low player count games, listen servers are going to be fine
well "listen server" is more correct than p2p since it's not really p2p, but yes the host player will be authority and know the entire game state
that's why I said non-competitive
since for competitive, the host always has an advantage
yes, they know everything. they're the server
including deleting everything
They are more expensive than running Listen Servers yes.
Are Listen Servers even expensive? Aren't they free?
Yes
Thats a common approach.
With EOS you can also do normal Match Making based on whatever criteria you like.
Deep Rock Galactic is a good recent example of a nice way to do Listen Servers.
Its simple, effective.
Exactly how you described it.
However they provide a Server Browser as well
To which you can then join public sessions.
You will typically just join on friends though.
yes but you would need access to those platforms
There is A LOT you need to consider for crossplay. But you should learn how to walk before you can run
Forget crossplay, just build a good game that works on your initial target platform.
and that was the short answer
lmao (me 2.0)
as long as you don't have cross-buy, now that's a nightmare
what's that?
Use Unreal, use EOS. Thats about as good a preparation you can do without thinking about it as you go.
it allows you to use your purchased mtx across different platforms linked with the same account
thankfully I did have to try and implement that, but Sony is very strict about it
I have an idea for how I want to structure some of my multiplayer client-server communication behaviors and would like second opinions.
Each client creates a Replicated Actor. This means they will be replicated on the server, but not each client. Other clients don't need to know about them.
The clients will need data from the server.
Clients would ideally specify individual string or int Ids. This triggers OnReplicated calls on the Server.
The server would then put data onto the replicated actor for the clients.
When the clients get updated data, they do OnRep calls and act on the new data
Could I do that with a single actor?
Is that a reasonable pattern? Or is there a better better to do this?
Use the PlayerController?
that really is just reinventing the player controller with extra steps
As you have described it, thats exactly how the PlayerController is setup, it is only available to the Server and the Client that owns it.
"Each client creates a Replicated Actor" though that part wouldn't work
Relevant context I forgot to include: This would be a plugin for handling a niche behavior.
Can there be multiple player controllers for the client-server relationship?
delightfully vague. the player controller can have components
so that's one approach
you can spawn your own actor that is only relevant to a single player if you really needed to
Sounds like a component would work best here as suggested by sswires.
Okay, so dev has their normal PlayerController.
Part of plugin setup attaches MyPluginComponent to it, then use the normal procedures for PlayerController.
Haven't dived into that yet. Was thinking about RPC vs Replication vs REST (since the server will be doing REST stuff to get external data from a web resource)
I appreciate the help!
what's REST?
Please review the Network Compendium linked in the pinned messages here. You really need to read and understand it.
REST (representational state transfer) is a software architectural style that was created to guide the design and development of the architecture for the World Wide Web. REST defines a set of constraints for how the architecture of a distributed, Internet-scale hypermedia system, such as the Web, should behave. The REST architectural style empha...
Primary way a lot of web technologies talk to each other. Not really useful for games since it is stateless and games are inherently full of tons of state.
Cedric's ones? They've been really helpful overall!
Been reading through those but didn't dive into PlayerController since it didn't seem on the surface like what was relevant for my needs.
It looked more focused on control-input rather than data-case input. I didn't expect I could piggyback through it.
Read the entire thing 3 times, how can you know what is or isnt relevant if you have no idea how they work?
Read it, understand it. Then judge what you think is relevant.
Then come back here to be shown how to do it 😛
Experience and knowledge on these things takes time to accumulate.
It doesnt happen overnight.
You will get there.
Hi everyone, I'm new to Unreal multiplayer but not to programming....I'm hoping someone could help me with an issue around animation variables not being triggered on the proxy client of a listen server. I've been doing due diligence searching here & elsewhere and I see that there are some idiosyncrasies around the animation tick with listen-servers, is this related? Thank you for your time.
AnimBP doesn't replicate. Replicate through the Pawn and read from it.
also your animation ticking may only occur while in view with default settings
Yes. In this case I'm using a rep notify in my character blueprint, set on the server, and responding in the notify function by locally setting the animation bp variable. Debug shows the rep notify comes through fine for all concerned, but the proxy client on the listen-server does not respond to the local triggering of the anim bp variable.
right, I was reading about that. In my test level all the client characters are in clear sight of each other.
BP onreps are called whenever a value is set, C++ on the other hand is different and has certain rules you may need to look up
the server does not replicate to itself
and replication is one way (server to clients)
yes, I did see that little gotcha with c++ vs bp, I am using blueprints at the moment and am seeing the replication notify come through on the client proxy and hit the logic that sets the local animation blueprint variable, but for some reason it doesn't trigger the animation state change.
oh, in that case you may need to try debugging the anim bp
you might find that some of your animation bp isn't actually storing the data you expect, you should be able to select the running instance with the anim bp open
not a multiplayer question per se
yes it could come down to a pure animation issue. What confuses me though is the other clients, that is the non-listen server client windows in the editor, see the animation play out fine.
Hi Cedric, I surely can. Let me preface that by explaining what I'm seeing in the editor:
I open 3 player windows, 1 x listen-server + 2 x clients. On the listen server I kill a client proxy, which should trigger a death animation. I see the death animation play out on the 2 x clients, but not the listen-server.
The death animation is set up as an animation state triggered with a bool in the abp.
I'm working in blueprints.
My logic is as follows: player death is handled on the server, which sets a rep notify bool. In the rep notify function I access the local abp & set the animation bool. My expectation, which is backed up by debugging, is that the rep notify is received by all. However for whatever reason the animation bool is not being set on the server proxy client.
It could be a pure animation issue, but as I say, the animation plays out fine on the clients. I was wondering if it's some listen-server idiosyncrasy
the left hand screenie is server code, Set Dead is called from server logic
the right hand screenie is the rep notify
I think you need to get the rep notify bool and do a not boolean when you set the repnotify variable. As I understand it doesn't fire unless the value has changed
I'm guessing it has changed so nevermind
the issue doesn't appear to be the rep notify - that works fine. However the client proxy on the listen-server's abp is not responding to the setting of the animation variable. I guess I'm not necessarily asking about rep notify, but rather is there any known issues with animation state triggering on a listen-server client proxy
@native warren One thing aside, you should get the Boolean inside the AnimBP
Or at least use a Delegate
But that's besides the point
Did you debug print the Boolean in the AnimBP
Did you check the AnimGraph of the Server Instance of that client ?
well interestingly here's some debug:
where I am checking if both client & server (on the listen-server) are getting the rep notify & hitting the anim bp calling logic
and they appear to be
it's messy I'm sorry, but gist of it is I'm responding with debug to the setting of the abp boolean in the abp event graph here, according to the authority of the owning actor, and it seems to show only the client is being set.
by this do you mean I should check the character bool in the anim bp tick and set the anim bool internally rather than setting the anim bool externally in the character bp? I can change that np.