#multiplayer
1 messages · Page 624 of 1
Without seamless, copyproperties doesn't work
or just looping the playerarray and server-travelling each
I don't have a travel map yet and it works anyway :P
Oh, nonono
Server does a servertravel
Clients automatically follow
(This won't work on PIE, you need to test standalone)
Servertravel doesn't work in editor
Server does a servertravel
Where is that firing from? Just a custom event on the server?
As long as server does it, yeah.
I have a system where gamemode waits for all playerstates to be marked as ready
But you can have a server that doesn't care and just travels 🤣
Interesting
I'm heavily in development mode at the moment, could I use the above (but use something like OpenLevel) - mainly so I can get access to the PIE
I might just need to experiment 🙂
I managed to test with "play as standalone" and one listenserver. Couldn't get my dedicated to run servertravel even when using the standalone play.
It might need a full build to try that :(
hmm - ok - thanks for the details. Good to know it's possible!
I have a client function from the game mode; it doesn't seem to work, is a game-mode client function possible?
gamemode is server only, so you can not do any rpcs from it
so if I have an actor on the game mode and this actor has replicated properties, how should I get the reference of these dealers passed to the player states?
that actor should be replicated
and you can not use client/server rpc unless its owned by an owning connection
PlayerState.LinkWithDealers.AddUniqueDynamic(DealerPtr, &ADealer::LinkToPlayerState);
was called from the game mode as a client function (which I know you said wont' work due to no RPC)
multicast rpc does not require an owning connection but the actor must be replicated
oh, so NetMulticast from the gameMode will allow
PlayerState.LinkWithDealers.AddUniqueDynamic(DealerPtr, &ADealer::LinkToPlayerState);
something like that to work?
i would not do that
i would have the gamemode call a client rpc on the playercontroller
basically use the playercontroller to do the rpcs between client/server
but i am really not sure what your binding there, no context
so i can't give much more info
so
GameMode->PlayerController
then pass
GameMode::DealerPtr to PlayerController::DealerPtr
so the PlayerController can see DealerPtr replicated data such as TotalPot
is that correct?
also, is switching the PlayerController here with the PlayerState doable or is there something special with the PlayerController?
playerstate can work
your rpcs will need to be on anything owned by an owning connection, like pawn, controller, playerstate
GameState can do multicast but not server/client rpc
Getting this error when client tries to enter a dedicated server:
Error: Couldn't find file for package /Script/MyGameServer requested by async loading code. NameToLoad: /Script/MyGameServer
Error: Found 1 dependent packages...
Error: /Game/Blueprints/Game/BP_MyOnlineGameMode
we recently moved MyOnlineGameMode from our MyGame module to MyGameServer module, since GameModes only exist on the server.
But does this error mean the GameMode is needed on the client side as well?
Overview of the Game Mode and Game State
Game mode class is still needed on the client
It’s not replicated to remote roles so clients can’t access it, but it stores default values for spawning controllers and pawns etc. that the client needs to know about
i see, thanks for the info!
Hey guys!
In my mobile multiplayer project on dedicated server we have a pool of maps which loops one after one every few minutes, but servertravel is a pain in ass.
Sometimes it drops while switching, sometimes clients don't gets their pawns and so on, while if I debug it (build client, run debug server on PC) it doesn't suffer any of problems. Also I always get LogOnlineSession: Warning: OSS: No game present to join for session (GameSession) warnings.
Do you recommend to start using Sessions? And what is most safe way to servertravel with high ping?
Do you have seamless travel enabled ?
Yep
That's certainly weird
Sessions likely won't help it, it's a useful thing but it doesn't interfere with travel
Btw, if you want different maps have same game mode but different var in it (f.e. Default pawn, custom match time var and so on) what is the proper way to do this? Map begin play with has authority is OK ?
And if I have this issues on build, how would you recommend to catch them? I tried server debug, but it gives nothing, either as logs.
When we use network profiler it seems like there is a spike around begin play where we cast the core types (like GetPlayerController and then cast to BP_MyPlayerController, same for player state, game state, character etc.). Are replicated actors and variables do replicate each time upon casting them from their base class? Or just for the first time? Or thinking that spike is from the cast is a wrong assumption?
Casts have nothing to do with multiplayer or network
Casts constitute no activity of any kind, they're just a hint to the engine that the object you're manipulating is not just of class Parent, but also of class Child, so that it allows (after checking) use of the Child methods
BeginPlay is however roughly when all of the actors start replicating
And if I'm not mistaking is casting to a BP type kind of costly, but I don't remember the exact reason, I think it had smth to do with loading the asset or smth like that.
Casting in BP won't cost anything as a pure cast. Pretty much the same thing as C++ casting. The normal BP cast has a validity check that costs a bit but it takes a quarter million of them on the same function to start hurting anything. Not specific to casting alone but the engine will load up anything that something casts to or has hard pointers to before it will load up the original object though.
Yeah casting isn't expensive, but a design that relies on casting everywhere instead of interfaces or components will get expensive pretty quick if you go too wild with it
Casting isn't expensive generally and especially not network intensive
Hey guys, my character currently has two meshes, one for the server and one for the client and now i need to spawn a grenade and attach it to the character. If so do i need to create two meshes for the grenade too and then attach them to the corresponding character meshes?
anyone can explain me what is difference between dedicated and listen server?
This page from the Unreal documentation has a detailed explanation: https://docs.unrealengine.com/en-US/InteractiveExperiences/Networking/Overview/#fundamentalnetworkingconcepts 😄
Setting up networked games for multiplayer.
But simply put, a listen server is a client and a server in one which accepts connections from other players and a dedicated server is a separate process running often on it's own physical server (but can in theory run everywhere as long as everything on that PC / physical server is supported by Unreal).
Both have advantages and disadvantages, so I would really recommend reading the link I just send to know which one seems right for your case 🙂
@twilit radish i need your help
With?
i created a dedicated server in unreal from source, and it is running on amazon fine
but the issue is that i want be to able to matchmake two players, so they can play multiplayer each other
kind of room join ( only one player vs other player ), so only two players can play together
right now when i try to open level with "open <server ip>" command, any one can join
I haven't done anything like this my self, but in theory it seems to me like you'll need to authenticate users through some way and reserve a server for those 2 players and only allow those 2 players to join. I'm not actually sure if Unreal has a system for this, or maybe even that Amazon has something for this. So it will probably be better if someone else gives an answer to that 😅
question : does one server handle multiple sessions?
so when new player login, i can join sessions for separate players ( two players )
@wheat magnet the conventional way of using Unreal's dedicated server is to host one session and when players join that session and match is complete then that server is disposed.
It is purely game requirement how much player they want for a match.
You said you want max 2 players for one match , this kind of stuff is ideal to handle at OSS level.
For dedicated servers if I have to pay by hours usually the company like aws and playfab will make it once u use apart of that hour it takes the full hours so I just reset the server and put it back in the queue pool in a sense
to not waste hours
tho once it hits like 5 hours
I turn off the server
@eternal canyon what I do is I execute a script post match.. which destroys the current dedicated server instance and starts new dedicated server...
on the same machine?
Yes
ah
This way I don't have to worry about garbage collection, resetting values etc
true
there should be solution for that, i want to throw players into available rooms, when two players are in same room, i want to start game between two players
One physical server can handle multiple game instances - but a software server in the Unreal sense can only ever handle one game at a time.
yea
Hello, can I use RepNotify with a CPP networked parameter?
If I store a pawn class on the PlayerState that only gets set by the server is there a way for players to hack it and change the class?
yes but no.
you can hack it and change it but when the server realizes it tells you that you are wrong and he hates you
Do I have to set up anything for the server to realize that the client changed their PlayerState's info?
that is what it is for, yes
the server will never know the player changed the info. The server just knows the truth and doesn't care what the player thinks or does 😛
I thought PlayerStates were owned by the client so I'm just confused how the server would know this was a change that wasn't supposed to happen
ReplicatedUsing=
I thought PlayerStates were owned by the client so I'm just confused how the server would know this was a change that wasn't supposed to happen
owned yes, however the truth source is your server. Being owned means that any RPC on that state can be called by the owning player. If you have an RPC so your server sets the value to whatever the client says, then your clients can lie and have the server store the wrong value but the problem there is the design
even if the client owns something, changing a replicated variable of that something wont change the value on the server
only the server can change values. If a client needs to change something it asks the server to run an procedure to change it. Those procedures are the RPC
Oh, that answers a lot of questions I've had in general about networking in UE. Thanks a million!

So as long as I don't have an RPC to set the variable (which I don't) things'll be hunky dory?
"should be" yeep.
"Should" scares me. What could go wrong then?
Mainly what could go wrong that I could prevent?
For some reason it's not called. I'm changing the variable on the server, but it's not called on client. I'll investigate, thanks for the confirmation that I've to use ReplicatedUsing.
Gotta use GetLifetimeReplicatedProperties
Say, pick 2 commercial games made with unreal engine: Spellbreak and Valorant. Spellbreak uses easy anti cheat. Valorant uses a rootkit that clamps your entire system called vanguard.
if there is a way to code your game to be unhackable, anticheats wouldn't exist 🤣
Fair enough lol. That's a cool video, though, I'll look into it!
Thanks for all the help
assume that every single data your user sents is fucked up and meant to destroy your server. Code from there 😛
That tracks :p
Alright, what's the deal with bits in NetSerialize functions in the engine ? Some of them just chain NetSerialize() calls, some of them use SerializeBits and do weird bitfield checks.
so i followed this turorial from making a local server https://www.youtube.com/watch?v=zNUxzl8Dcb4&t=1129s&ab_channel=Flopperam and everything is going great. its built and runing but when i try connecting from another network or pc it just doesnt work, when i try on my pc that the severs runing it work's. The port 7777 is open on my router i opened another port for another game so its open correctly Plz help
How to build Unreal Engine from Source: https://youtu.be/MRJUWC90aJM
In this video, we go over how to set up and package a dedicated server for your Unreal Engine project. Dedicated servers are becoming a popular alternative to other game server options such as listen servers and peer-to-peer for multiplayer games. Dedicated servers provide man...
Thanks for sharing @frank birch
Can a GameMode with a Dedicated Server, load a player's inventory?
I can set the Inventory Array on the server but its not propagating to the client
Game modes are on the server only, so you need smth else to replicate it, like the player state, player controller or player character
Could i post an example?
Can you?
lol that was bad wording!
Basically my GameMode has it so when a Player Joins i want to give them there inventory they have saved from database.
The LoadItems will eventually make calls to database but for now its hard coded
Im trying to add those items to my player.
And with the way its setup, the server has the correct Inventory by the client does not
My LoadItems Function is not a UFUNCTION(Server) defined, and i cant figure out if that needs to be.
But would make no sense in my mind if GameMode is Server Only why would i need to Server RPC
Is the component replicated?
The Inventory Component yes.
So you call set replicated true
Yup
And in the Controller BP i have that has the playerInventory it shows up as replicated there as well
If I go to the Inventory Component and call ServerAddItem, Both Client and Server will have the same Value
So Really Im just trying to figure out what needs to be changed?
huh?
Begin play
BeginPlay for What?
Is your bug
In The Game Mode?
No, the inventory
Going to assume calling that Init Function in BeginPlay is causing it, or this a side thing
Yep
You receive the initial bunch with the correct data and then override it on the client again
Hold on....
Can i even call .Init in a constructor i thought that caused an error x.x
On a tarray? You can call that anywhere question is if you need that since you replace it anyway
I kindve need it to give my TArray a Max Size thats about
Not on the client since you replicate the full array anyway
I would then have to change the code slightly to just Add the items to the inventory then.
If im understanding what you are getting at
Well you can init the size but either check you are on the server or check that it is empty otherwise
So just one last question
You are saying if i initialize it on the server, it doesnt also have to be initialized on the client
The entire array will replicate from Server to client as its set to Replicated?
Yep
Interesting
Replication is very interesting especially if it comes to custom replication, you can do very cool stuff with it ^^
But you should use more references in your code, you do lots of copies
Possible what did you change^^
At construction time there is no owner and now role
Your inventory is most likely empty
Well before I had owner role and role
i have it without the if statement and still samething
Yeah
Then it has serialized the array size as 0 and will load that most likely
Well Controller is a BP based off the Controller C++ class i amde
Whats the fix to that?
Either init it in your data or do it at some point after load.
Everytime i make changes to my Inventory my Controller likes too lose its REFERENCE apparently
this was in my controller BP
and Player Inventory just said none
After i made Changes in the C++ code
had to reparent it
That looks not healthy
How so?
Do you compile with an opened editor?
Yeah
...
and Im pretty HotReload fucks me everytime
Delete the Blueprint close the editor, build and create a new Blueprint. Never never never use hot reload
Is there a way to turn off Hot Reload?
Cause what if i need to like make changes to a blueprint?
i have to restart the entire Editor?
No, you have to restart the editor if you need to compile code
Knowledge to not use it ^^
I feel like a fucking idiot atm
No what you feel is that you learned smth
Im just struggling i want to build a multiplayer game, and im trying to integrate some stuff, just Unreal's Networking thing is something im not even a novice at
Well, I m also working on a Multi-player game ^^ it's funny, and since the engine is open source I can digg threw the code :P
Well, learn to use a debugger, start using code search ^^
Cause like i can build mostly anything on Single Player Game, like an inventory without any multiplayer etc, just an example. but the moment i have to replicate shit
i die
What do you mean by Code Search?
Well replicating a single struct is easy, arrays with simple data as well, for more complex data you need to find a solution
I've gone digging through Files before etc just unsure what you mean specifically..
There is a plugin for VS that is named code search, but it's hard to find, it's from Google if I'm not mistaking. Basically a string search over all files but in fast
That sounds like it costs money
I don't mean smth in specific but if you need smth, search for it ^^
It doesn't
I've also come to learn that understanding the context is hella important
can anyone help me
i want to create multiple sessions in dedicated multiplayer, what is the solution to do that
https://chromium.github.io/vs-chromium/
This thing
for example i want to start sessions only one player vs one
or one server hosting multiple sessions
like one player vs other player
in multiplayer
so when new user came, user can search for available rooms, each room can only handle two players in multiplayer
yes one server hosting multiple sessions
so one server can handle multiple sessions, because i want to create rooms, and join rooms
On the same map?
yes
right now i'm using this command "open <server ip>"
but the issue is that more than two clients join same level
this is not i want, i want to start separate multiplayer between two players teams
why does it matter if you have multiple servers
why cant you just do everything on one server
from the point of view of the players, they dont need to know the server is handling multiple "rooms"
for example two players is playing on room 1, and other two players is playing on room number two
if you dont expose that information to them
yeah I mean it sounds like you are conflating your idea of "rooms' with servers and sessions
the answer is potentially complicated involving a load balancer to spin up additional copies of your server executable bound to different ports.
Generally this is managed thru a service like Playfab or Gamelift
I think it would be more clean to just spawn several servers. Otherwise you need to check that you don't replicate all actors to all clients.
how i can spawn severel several servers?
just design a graph where every actor in a "room" only gets replicated to that room
I mean it really depends, g33k360 to properly answer your question we would need more context
like what is your game concept, whats the elevator pitch
the game is based on card game
ok
so you have like multiple rooms with 1 card game going on with numerous players joining and leaving
i want to only matchmake between two players
yeah that sounds like its a little beyond the multiplayer functionality built into unreal
so if there are four players, there would be two rooms
you would need to probably build some software infra to handle that
likely you would treat each "room" as a separate instance of the game
and manage the client connections on a higher level
like someone said above, a load balancer managing client connections
you may even want to built the matchmaking outside of the game
how i can make that system
i need a solution to do that
my server already runs on amazon
dedicated server
is there anyway to create and run multiple instance of servers?
kind of sounds like you want numerous ec2 isntances running dedicated servers
and write something to connect clients to the server they need to be in based on your matchmaking logic
Im not like a super expert on mp in unreal but from my experience you cant open multiple instances of a map on 1 server
has anyone every done that?
from my experience everyone who connects to a server gets moved to the map when you open it
yes this is the issue, i want to run separate session between two players, so they won't conflict
yeah I dont believe unreal supports that out of the box, someone correct me if im wrrong
each session would need its own dedicated server
the way I would do it is have like a matchmaking map, a lobby map, and a card game map
lets say you have 2 dedicated servers running separate instances of the card game
i found this solution, but how i can do that
but when i try to use different port than 7777, it won't work
you have clients open the game, load into the matchmaking map, that connects to some service in aws that you figure out which dedicated server that client should connect to
that service returns the ip of the ec2 instance you want to connect to
the client receives it, connects
loads into the lobby map, or directly into the game map
depending if it started
oh ok if that actually works, that sounds way easier
definitely do that first lol
but when i try to use different port than 7777, it won't work
I come from a software dev background so I immediately jump to service oriented architecture lol
when they are saying running server instancer on different port
when unreal runs its server it runs on some default port
might be 7777
you would want to presumably run each server process on a unique port
on 1 ec2 instance
unreal default port is 7777, but why they are saying to run new server instance with different port?
its basically the same as what I was describing above
except instead of connecting to new boxes with new ip's
you connect to 1 box with different porrts
you would launch multiple dedicated server processes on 1 box
how i can launch multiple dedicated server processes on 1 box
you still need a service to tell clients what port to connect to though, thats like outside the unreal loop at that point
i dont know, Ive never done it
do you run some bash script or something
to start the server
yes
You can do that through the command line
ok, you would need to run that script multiple times presumably, parameterized with ports
"F:\ry\UE_4.25\Engine\Binaries\Win64\UE4Editor.exe" "%CD%\my.uproject" 127.0.0.1 -game -ResX=800 -ResY=600 -WinX=0 -WinY=20 -log -nosteam -Windowed
this is the bash script that run client
I mean the default format for a port is something like 127.0.0.1:7777
maybe you can define the ports up front?
never tried it
how i can run server instance on different port, also from where i can get ec2 ip?
you probably want an elastic ip
if youre doing this
i dont know how far along your development you are
can someone help plz tag if you think you can
you could wrap your had around kubernetes and use agones 😛
lol can you unreal in a docker container?
thats pretty baller
well you can compile the server for linux, so
because I don't touch this and a teammate of mine has set this up
I just know, we use a docker container, with agones and then have this in kubernetes. The end 😛
kind of, plan some sort of a small scale mmo, so for not that many ppl as you would have in a normal mmo
and since we do this fully in our spare time and don't plan to make it commercial at all ppl will need to host it on their servers and thus we are looking into a simple way to deploy it 😛
my server runs on amazon remote computer
so the issue is that how i can run new server instance on server from client?
i found solution to run multiple sessions, but now issue is that how i can run new server instance from client
because i can't manually go to amazon each time and run server.exe with different port
Well you need a service where the clients login an this service sends them the address to connect to
can you give me an example
Well and of course this service needs to start and manage the server instances
Well a rest api for example
the server instance looks like this
This is not the instance
i mean when i run the shortcut file, it run new server instance
Well yes
with different port argument
Now you need a service that automates this
is there any example to do that, how i can communicate from client.exe to amazon server to run that shortcut file
Websocket, rest api, just a socket, there are several solutions, and not that easy to explain, you ll need to do some research
i already websockets working
does websockets solve this solution? if yes then how, i can emit some functions
yes i have websockets API working already in my project
Websocket are just a way to communicate with your service
what kind of service, can you give an example
What you now need is the server side that actually has the logic of spawning your servers
can i spawn a new server form client?
No
so how i can spawn server instance, i already have websockets
also can explain how websockets may useful?
Start researching on this topic, or focus on having one server for two players first of all and get your game run. I'm just on my phone and can't go in much detail nor have I enough exp to do so. I can tell you that you need some program that needs to run on your server that can then start game servers and you need to communicate with it somehow
great, so i think running server instance on different ports can solve this problem
...
the next issue is that how i can check on which ports are players avaialble
Well your service needs to communicate with the game servers
for example four players run game, and then they player 1 vs 1 with two servers, and if one player left from first server instance, how new players can check if there is one player is waiting for lobby
You need a match making service
from where i can get match making service, or can you give an idea how i can build matchmaker from scratch
... I already did. Find a protocol to communicate with it, then it can communicate with the servers and distribute the players
You're asking for something incredibly non-trivial. No one is going to sit here and walk you through writing a full services stack for a multiplayer game. If you don't have the experience to write it yourself, go look at gamelift/playfab/gamesparks/etc but still understand none of it is going to be "simple".
@marble gazelle you helped me alot, thank you very much, i will try to implement these things
Sure, good luck ^^
😬
How does the shared quest system work?
Let's say I've a quest system that works but for individual player.
you run it on server, only thing a client needs to have is updated objective text and have the quest markers
@wheat magnet I read your game requirements, if I understood correctly your game is card game and there is only one actual actors or characters involved during the GamePlay...
So I mean you should actually use one dedicated server to host atleast 200-300 players.. it's only a online multiplayer card game.
There isn't any character movement replication.. you will only be sending server authorized card moves..
For rooms they aren't physical actor rooms in the level, rooms are just logical representation... Just get the logical value of room from server and decorate at client side..
And one more important thing.. don't lock your cloud to AWS... explore DigitalOcean or Linode.
AWS is costly and complicated for no reason
Hi, I have some trouble replicating a variable set in the possessedBy function in a Pawn, any idea or advice ?
To explain, I have a squadController wich is server only and I created a phantom class of it to be replciated on clients, handling usefull information for my HUD. This variable is set in the possessedBy function of my Pawn (which is serverOnly) and I'm wondering how to properly replicate it.
What is the proper way to persist playerstate variables through a seamless travel (in BP)? I tried wiring up the CopyProperties event and setting the variables, but it doesn't seem like the values actually persisted. Do i need to do something once loaded into the destination level?
Thats exactly what i'm doing. Hmm Okay I will look into it some more. Thanks a bunch for the info
Effectively you need to use OverrideWith once reconnected on the new server
Not sure about the seamless travel
okay thanks
Check the seamless travel section, maybe it could be even easier with the seamless travel 🤔
yeah I am using seamless travel
Okay, quick question regarding best multiplayer practices
So, I have a game which for some pawns instantiates a per-player instance of an actor
(Effectively, each player gets an instanced version of it)
Since the actor is instanced, is it better to have those pawns owned by their respective players, or better to still only have the user's primary pawn be owned, and have it interact via RPCs on the pawn?
It’s probably best to set the owner to the player controller
I have a problem i hope you can help:
I created an Actor subclass and gave it a repnotify variable which is an array of booleans.
The repnotify function runs when I setw/notify the array, but only runs on the server. The client does not run the repnotify, but I need it to.
Did you make sure to set Replicates to true in the class?
Is there any way to run lightweight clients for server stress test?
-nullrhi isn't good enough
What do you mean not good enough?
How to make clients see other client's listen server across the internet ?
Sessions
Yeah I already did that but how we do it online
For example I got the host and join functions working in lan
But how we do it online and get list of available listen servers online ?
Oh ok
Steam, GOG, etc
So If I use epic online servers in the backend , it will work automatically online ?
No need for extra programming ?
If you use Epic Online Services as your online subsystem to create sessions, then players will be able to discover them online
@bitter oriole thank you very much , I didn't know it is that easy
Hey, i have a question: Is it possible to make a client hosted shooter in Unreal Engine?
as in listen server?
yes
its only very susceptible to cheats
so better not be competative
Okay...is there any Tutorials for Listen sever multiplayer games?
its largely the same as dedicated server
only the server also has aplayer on it
so some checks are a little different
Okay, thanks
Anyone know if theres some sort of "invisible to me" type node in ue4? I have a basic third person body to represent my character to other players but I dont want the third person mesh to be visible to my first person body cause the camera clips into the mesh
i have a server but i can only connect to it on my PC when my friend try's from another network it won't connect
so for joining different rooms for different players from one single dedicated server, is this is a good idea to run multiple instance of server on single computer?
the main idea is to run multiple sessions or match between different players
I'm testing multiplayer on my home PC and have an acceptable framerate which I hope to optimise some more at a later date. This is a 1-4 player game (4 strict max) and I intend it to be hosted remote multiplayer (one player hosting). What difference to the framerate, if any, could I expect if all four players were on different corners of the world (worst case scenario)?
That is a difficult question to answer without knowing your game and plans. Clients likely wouldn't suffer with more players. The server player would at least need to simulate stuff for the clients where they are. This is one reason games like ARK limit clients to an area around the listenserver player when not playing on a dedicated server. ARK really isn't a good example for optimization though. You're in the non standard territory of multiplayer though. That's very project specific.
@twin juniper Worst case scenario : the game-thread frame time will be 4x higher
Realistically, maybe twice
The game thread time is not the slowest thread usually, though
hmm ok thank you.
@wheat magnet it is really bad to run one dedicated server for a card game with max 2 players. So please rethink and redesign your approach.
If your dad is Bill gates, then you can definitely host any number of dedicated servers.
I have an entirely unrelated question too, if anyone is kind enough to answer. I'm spawning a particle system in game and want it to have a variable, nonlinear trajectory. My obvious way to do this would be to make a character class with a replicated particle system as a component, but that seems a bit odd, is that really what 'character' is for? Feels a bit weird
If it has trajectory then you need ProjectileComponent
I don't care about the physics too much, it's basically a moving cloud
Alternatively, just subclass the component and put it there with a tick override that moves it. Going to be slightly less costly than a full actor and extra component per cloud.
Does ParticleSystemComponent supposed to be replicated?
I thought replicating move on tick was very bad except with CMC, it has been this way with me anyway
That's how everything moves, if it moves. Even physics is updated on tick.
That's why physics doesn't replicate well. Smallest change in numbers can cause things to math out differently. So the only way to replicate movement and keep it accurate is to do the best you can with local simulation but also have the server replicate the actual location for authority and find a way to blend the local simulation and the authoritative location to make it seem less hitchy.
@twin juniper However. As @bitter oriole pointed out to me, stuff like that probably won't get directly replicated. I was asking for thoughts about how I'd make similar sail-able waves from Valheim and I feel dumb for not considering it before hand, but more or less use the ServerTime that is already replicated and a seed of sorts to locally place clouds in the same place on all clients and move them with that seed, spawn, remove them, etc. It'll mean that all clients are doing the exact same thing locally with only one float replicated.
(Do note that the built-in replicated server time sucks somewhat, but yes)
@vivid seal yes the actor class is set to Replicate
@summer jolt find Aphix's discord channel and YouTube videos. He is figuring out Epic Online Services.
@vivid seal the actor class is not a subclass of Playercontroller if that matters
so weirdly whenever i connect a new user to my server, all users get the Register / Log widget again... can someone help me out there?
it's in the Playerpawn
@jaunty tartan So when the player Pawn Spawns. It spawns one on every machine. Once per machine. Beginplay will run locally whenever it is spawned. So if you have three players all with pawns, Beginplay will run for a total of 9 times, 3 on each machine, one time on each machine for each instance. So effectively what you're doing right now is saying that every time this class is instantiated(spawned), tell the local controller to create a widget. Two better places to handle this is either the AHUD class, or PlayerController. But if you do it in the PlayerController, also check behind branch that IsLocalController.
oh okay, thanks! I will try it now 🙂
Yes the islocallycontrolled node is very helpful :)
does it matter wich one i use? i get Is local Player controller and is local controller
Some controllers are not player controllers (like AI). So I think that is why it has the general version and the player specific version.
If you already got the controller, it has a node called isLocallyControlled on it, too.
hmm cant find that note :I
Which one?
IsLocallyControlled is for Pawns.
All it does is gets the pawn's controller and asks if that controller is a local controller.
For instance, these are the same thing.
oh okay, but i moved the logic to the player controller now and i'm asking there if it is a local player controller
That'll work in the controller. Both IsLocalController and IsLocalPlayerController will return the same thing if you call it on a player controller. Like MightyEnigma said, that distinction is mostly for AI.
to get data/write data from/for the Server for the Login and register i cast to the game instance, is that right?
and from the Gameinstance to the Save?
That depends on your setup. If you're handling savegame stuff in the GameInstance, sure.
so for the login, i cast to the Gameinstance and use a custom event with (Replicated to Server) from there, i cast to the Save and check wheter the String equals another string. Then i cast to the Player controller with Replicated to Owning Client. There i cast to my widget again
is it kinda right?
GameInstance doesn't replicate, you'll want to do the RPC in the controller, then get the server's GameInstance.
On a side note, try not to think of casting as "getting" something. Not sure how well you know how casting works, but it'll confuse you later if you think about it like that.
hmmm okay, yeah i do not know ue4 that well i guess 😄
Okay, thanks ! 🙂
Can you recommend me some Documentation about that?
about that getting data from the server and writing it
So, when you get something. Either via something like a line trace, or GetPlayerController, or GetGameInstance, or OverlapEvents. That sort of thing, they all return a blue pointer in blueprint. All this pointer is, is a tiny variable that points to a location in memory where an object is. The pointer returned is usually a base type. Take GameInstance for example. You've clearly created a subclass of GameInstance. As in you have a GameInstance class that inherits from the default GameInstance. When you GetGameInstance, it returns a small pointer that sort of acts like a key to the actual object, except it is of the default GameInstance type. So this pointer cannot access all of the stuff you have done in your subclass. So you have to change that pointer type to the subclass type by casting it. You've already gotten the pointer with GetGameInstance, now you're just modifying it. After the cast, it will be valid if the object that it points to is of the correctly casted type. If it's the wrong type, or non existent, the cast will fail.
You do this because of the way functions are written, think of having to have multiple game instances for example(bad example, but go with it). Say you had four. Would you rather write four GetGameInstance1, GetGameInstance2, GetGameInstance3, GetGameInstance4, functions, or simply call GetGameInstance->CastToCorrectGameInstanceYouExpectToUse
Game instance was a bad example for that. Line traces are a better example, because they return actor and component references. And a lot of times you're tracing to hit specific things. Interfaces come into this discussion somewhere and are also important, but just making the point that casting is just a way to modify something you've already retrieved, not how you actually get it.
could you possibly do me something like an example of getting data from the server back to the user widget how asked for the data? and of writing it if possible
@jaunty tartan I usually dont worry about which widget asked for the data. I just create event dispatchers on the class that has the data, then bind the desired widget's custom events to handle those dispatchers. Then anything bound to the dispatchers gets the data. You just have to use repnotify or an RPC to Call the event dispatcher so it gets from the server to the client
I have an issue where I get stutter when aiming vertically. When using aim offset and then replicating the pitch variable. I got stutter on the aiming character but other players saw it as smooth. Any ideas why? (CotnrolRot var is rpelicated but skips owner)
Is there a convenient interface function we can call on an Unreal server to our ping latency to it, from a "server browsing" situation where we are not already connected?
@young spoke What you're doing is already replicated. Use GetBaseAimRotation instead of replicating the control rotation manually, should work. Not fully sure about the stutter.
@vivid seal what else can i check on besides whether it is replicating the actor and its array of booleans?
so weirdly my login isnt working.... Im going from the login button to the Playercontroller, from there to the Gameinstance (Server replicated) and then back to my playercontroller with the playercontroller id...
It looks like UEngine::TravelURL, when it changes, is how the actual implementation of client traveling happens in the engine Tick function... though I can't find where the Tick function lives to see how it actually happens. Is it really just equivalent to the open command?
@peak star is this in cpp or bp
PossessedBy(AController* NewController)
is not running on Client, right?
Breakpoint does not look like executing on clients
@peak sentinel Clients are unaware of Controllers outside of their own - only the server is able to see controllers in general
Hi, trying to replicate an attribute set in possessedBy to client but it just don't work.
void ASoldierPlayer::PossessedBy(AController* _newController)
{
Super::PossessedBy(_newController);
FTransform LocationTemp{ {0.f, -1000.f, 0.f}, {0.f,0.f,0.f} };
SquadManager = GetWorld()->SpawnActorDeferred<AAISquadManager>(AISquadManagerClass, LocationTemp, nullptr, nullptr, ESpawnActorCollisionHandlingMethod::AlwaysSpawn);
if (SquadManager) {
SquadManager->FinishSpawning(LocationTemp);
SquadManager->Init(GetTeam(), this);
Cast<USquadLeaderGameInstance>(GetGameInstance())->ListAISquadManagers.Add(SquadManager);
SquadInfo = GetWorld()->SpawnActor<AInfoSquadManager>();
if (SquadInfo) {
SquadManager->SetSquadInfo(SquadInfo);
SquadInfo->ForceNetUpdate();
}
}
}
The attribute I'm trying to replicate is SquadInfo, SquadManager in other hand is a server-only attribute.
The specifier replicated(and the setup in GetLifetimeReplicatedProps) is not enough to see it on client side.
Any idea ?
So what's SquadInfo ?
Ah, AInfoSquadManager
Is it marked as replicated in AInfoSquadManager ?
yup
AInfoSquadmanager has the purpose to mimic some properties of the AISquadManager on the client for the HUD.
So it's modified on the server by AISquadManager and supposedly replicated when do so.
Weird, not sure what can go wrong here
I'm asking myself the same question for days.
I take it you have confirmed the obvious, that SquadInfo lives on server, does not on client, that PossessedBy is called
That SquadInfo has no particular rep condition, that AInfoSquadManager is replicated...
yep, evrything working nice on server
ASoldierPlayer is replicated too, right ?
yep
can see it on client-side
The only problem i see is the fact that the attribute is set in a serverOnly function (possessedBy), but I'm pretty sure it don't prevent the attribute from being replicated.
Variables are only replicated server to client, so no
Check that SquadInfo is never overwritten
And i'd triple check - using logs in BeginPlay for example - that no AInfoSquadManager instance ever lives on client
On client the attribute is simply never replicated, but live perfectly in server
The attribute being never replicated is one thing, the object itself existing is another
Am I that dumb that I forget I need to initialize the pointer on client-side in order to replicate it properly ?
No initialization should be needed for a replicated variable
I'm just saying, maybe the object is replicated successfully, but the pointer itself is not
gotta check it.
The most obvious possibility here is that the full actor does not replicate for some obscure reason
Now i'm thinking about it, I'm also storing the pointer on the SquadManager(serverOnly Actor), can it prevent the object from being replicated ?
No
This is a bad thing because now I have litteraly no idea what's going on...
Does the actor exist on the client
testing right now
Nope
i'm realizing that the value of the pointer is modified in another class of the one that marked it as replicated, I think it might be the source of my problem.
It might
Not resolving my problem. Gonna see this later, thx for helping.
@vivid seal blueprints
About non-seamless traveling: I read by searching this channel's history that we're supposed to be able to travel in the editor by opening multiple Standalones and then doing the "host listen server on one and join localhost on the other" trick. However when I do this, the ServerTravel method only moves the server and not the clients, who eventually time out and browse to default.
Here are the standalone logs for both client and server. Can anyone help me understand what I'm doing wrong? If it helps to diagnose, I did not use the OnlineSubsystem to initially create the server and connect to it. Instead, I did open <map>?listen and then open <ip and port>?name=<name> to connect. Is ServerTravel incompatible with it this way? And if so, would I need to call open again manually to reconnect, but only after the map transitions?
Maybe I labelled client and server wrong actually, I can't tell
The top one says "isServer=No" so maybe the issue is that it's doing that connect thing 4 seconds before the map actually changes.
Why do I realize these things only after I spend so much time typing them out for other people to read? I always make myself look stupid
Pretty sure SeamlessTravel in Editor just simply doesnt work.
There's a property I only want to replicate once when an actor becomes relevant (and never again, unless they lose and regain relevancy), how can this be done?
Is that what COND_InitialOnly is for?
it is
@vivid seal hmm.i think my mistake is further back: when I make a server RPC from that Actor, I get the error:
No owning connection for actor MyActor. function ServerFlipSwitch will not be processed.
How to understand a late joiner?
Thanks btw, forgot to reply. I moved my function to PlayerController's beginplay.
Sadly I've gotten the same results by building the package and running them in two windows, with one listening and the other connecting to 127.0.0.1:7777
Only the Server actually travels
Here are the same logs but using a packaged build. Timestamp 23:14:45 is when the server called the ServerTravel method.
It seems like the client never receives the instruction to travel... but the ServerTravel method is suppoesd to get all connected clients and tell them to travel as well!
I want to use the OnlinesubsystemNull to manage sessions and find sessions but I don't see the opportunity for me to override where it looks for sessions, and my AGameSession subclass doesn't seem to get called, so I can't register a session on my service. I'm trying not to use the Steam subsystem but I feel like it should be easier than this.
ListenServer wont call USkeletalMeshComponent::TickPose on the mesh for any character it isn't locally controlling. How to fix / what to use instead? @jade orbit to the rescue?
Edit: Oh it gets called its just... being reset or something... the mesh is jittering instead when I basically make it rotate in place. And it occurs even in TickComponent.
If I put the dealer class into the game-state, could a hacker change the size of the total pot on the dealer by calling
GameState->Dealer->TotalPot = 100000000;
or would that not work?
@grand kestrel it's called as part of character movement component
When it gets an update from the client it ticks the mesh, the idea being to keep animation stuff in sync as best as pos
Also because root motion IIRC
No this is an issue that only occurs on a listen server looking at another player and not under any other circumstances
I just tired GameState->Dealer->TotalPot = 100000000; on a client and it had no effect, so I guess even though there is no RPC with the game state (as far as I know) you can't (as a client) just arbitrarily change values.
void UMySkeletalMeshComponent::TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
AddLocalRotation(FRotator(0.f, 300.f * DeltaTime, 0.f));
}
Left is listen server, right is client
Note the jitter on the left if the frame rate isn't obscuring it
TL;DR listen server can't rotate a client mesh that isn't it's own
And has years upon years of threads with frustrated users regarding other issues with listen server and permanently backlogged bugs
But ultimately, I need it to at least do this
So its the network smoothing, disabling it completely means it works
I fixed it. UCharacterMovementComponent::OnRegister() forces it to exponential if its linear, but only linear works
else if (NetMode == NM_ListenServer)
{
// Linear smoothing works on listen servers, but makes a lot less sense under the typical high update rate.
if (NetworkSmoothingMode == ENetworkSmoothingMode::Linear)
{
NetworkSmoothingMode = ENetworkSmoothingMode::Exponential;
}
}
does anyone know how to set up steamworks sdk for multiplayer? in the correct version? the docs say Steam[Current Version] but i don't see the current version there
i feel like its a silly question but i don't wanna break anything
that's a sick dance game
hi guys , is that a way to stop server correct client movement for a period then switch back to normal, as I want the client capsule not affected by server position for a period of time
I tried to set replciate movement to false, but it will affect the animation, I am not sure why the animation pause when replicate movement is false
can 'inactive' player controller have ViewTarget ?
I ma writing FP spectator , when player dies I destroy his pawn and set killer pawn as view target
but it dosen't wok 🤔
GameFrame sucks
😿
Are there benefits for providing the option to host a game as Listen Server? It seems to me that it just more work to implement the support for Listen Server. If a Player wishes to host a server, they can just start a dedicated server instance instead right?
is there a way to print to the Serverlog?
@twin juniper thx for your input. It makes sense that it is more user friendly
Hi everyone, how i can find those replication settings for gameplaydebugger replicator and worldsetting replication?
I have a weird problem where, when I use play in viewport with listen client, the game kinda act like the "fake dedicated server" is spawning half a player pawn, that is not initialised but still tick
Does the ServerTravel have a dependency on the OnlineSubsystem in order to work and just silently fails if the Join Session API wasn't used to connect the client in the first place?
No
Though if you do use sessions to create the server, you need them for everything
Hello there! I'm stumped with my project at the moment. I've used the advanced session plugin and implemented a basic UI to search for running sessions and join.
It works like a charm in UE, but if I build the project and try it on two machines I can't find the host (both machines in the same network). I'm very new to UE so I'm probably doing something really stupid I don't know yet. If anyone can point me to a good tutorial or take a look I'd really appreciate it.
@fallen pasture what online subsystem are you using? if its steam and your using the space war dev ID then its region locked and you have to switch your steam download region to the same one in your steam account settings
See that's where I'm confused. Do I need to use steam for that? Even for LAN connections?
Of course I want to have connections over the internet in the end
Does GetWorld()->GetTimeSeconds() retrieve the time when the server finished loading the map or when it starts loading it?
Will check that tonight, thanks 👍
well what online subsystem are you using @fallen pasture if your not using a online subsystem like steam for example or some other online subsystem then its not gonna connect no matter what
It should use steam as I had that as default in the config file but the steam overlay doesn't work.
And if I can find the server when I run the project from UE how does it connect? Using some internal system?
because your probably playing as a listen server in the editor and that is not hosted by the online subsystem
Oh so it totally circumvents that 😬
are you sure you have the steam online subsystem plugin enabled in your projects plugin settings @fallen pasture
I'll check that again next. So i need to get the steam overlay to show when I start, right?
yes if it does not show up then steam online subsystem is not enabled @fallen pasture
Thank you for the quick response and sorry for the total noob questions 🙈
all G i remember first starting with steam and the overlay not showing up took some trial and error but i got it working
Is there an attribute set remove delegate?
Or any alternative ways to know if an attribute set is removed from an ASC
{
AFOF_OutpostTestPlayerController* PC = Cast<AFOF_OutpostTestPlayerController>(
GetNetOwningPlayer()->GetPlayerController(GetWorld()));
if (PC == nullptr)
{
checkNoEntry();
return;
}
PC->DebugWidget->UpdateRedTeamScore(RedTeamScore);
}
Is there a way to get the PlayerController that owns the local GameState?
my code isn't working
there is the #gameplay-ability-system channel
mybad. thought i was there 😅
If I'm just running some blueprint function on the client inside an actor, would "get player controller" always return the player controller of the player using that client?
And do I need to run that function as 'Remote' in the actor to avoid the server doing it as well, or is that unnecessary?
the first player controller on the client with one local player is always that client's networked controller
but it depends if you're calling APawn::Controller or the global get player controller
the pawn's controller is set on possession
I was just doing this
yeah that'll work
So that'll just grab the client's controller 🙂
yeah, whether you need to check for authority depends on the caller
if you can reach that function from a path that runs on the server then you'll need to separate any client only logic with the authority check like you said
Would there be any harm in adding that in even if I'm unsure at this stage?
I'll probably do it to be safe then 😄
what is the proper way to force clients to disconnect from a dedicated server when the game ends?
And yeah, makes it clear from the start
Ahh, one issue @graceful loom, if I'm testing without multiplayer in the editor, it won't run 😛
Assuming that's because I am the server and client in this state
or if you're the listen server I think
listenserver is authority but won't report true to the isDedicatedServer check 🤔
Yikes, yeah I just use event tick while testing things, then usually break it out into a function when I have some way of calling it
@rancid cave GameMode->GameSession->UnregisterPlayer
not sure if it is exposed to blueprints though
if not just destroy all player controllers
Maybe the RemovePlayer node? https://docs.unrealengine.com/en-US/BlueprintAPI/Game/RemovePlayer/index.html
Remove Player
@empty axle I don't think it is exposed.
@frank birch That looks promising. Going to try that now
Hi everyone, how can i find those replication settings for gameplaydebugger replicator and worldsetting replication?
(edit- removed question) And of course just like clockwork, as soon as I post here and click a few random buttons all of a sudden it starts working. No idea what I did differently. Maybe someone from Epic is watching this channel and messing with me for fun.
What would happen if a client with bUseSteamNetworking=true is connecting to a server with bUseSteamNetworking=false? Would it fail to connect?
is there a way to get the local player controller of the client/player from the local Game State
GetGameInstance()->GetFirstLocalPlayerController()
GS has nothing to do with controllers
Hey so I’m trying to add a collectible system that is shared between multiple players but I’m having trouble figuring out how to store an integer representing the number of collectibles the player has that both the host player and client player can access
Right now they store separately between both players but ideally I’d like to have both players have the number of collectibles update when only one player grabs one
Thanks, I'm not familiar with GameInstance nor GameState (although I did check the API to see what it had)
that's a perfect case for player state
you just need to make sure you do the update on the server and all clients will see it
Well I tried before to have just the integer on the game mode and then send the number back over to the player controller but for some reason after doing that, only the host player ever got updates (honestly I’m probably doing it wrong though)
the game mode is not replicated to any client and the player controller is replicated only to its owner
that would work if you're iterating all of the player controllers manually and setting each of them
but there's no point, just move the variable to the player state
How might one do that?
by subclassing APlayerState and setting the property Player State Class on the game mode
If they want it shared between everyone then it's GameState not PlayerState though
oh if it's like a common pool
I just assumed track it separately and do that logic later
Wait but so how do I use those to save the number? And how do I retrieve that number again?
how are you doing it in the game mode?
Well I’m not currently but that’s how I tried to do it but it didn’t work, when I was doing it though I had an event in the game mode sending the integer number back to the player controller and another event that I had in the player controller that told the game mode to update the integer to a new number whenever a collectible was picked up and I thought that would make the number the same for everyone but instead it just broke it for the client but not for the host
All of that code is dismantled now but I can send screenshots of all the relevant blueprints for how I have it set up now without trying to use the same number for all the players
There’s multiple so it might take a second to send them all
This is for the actual collectible itself
A few notes
- If the Actor exists on everyone (including Server), then the Overlap is usually called on everyone (including Server).
This is inside of the player controller
Okay so
First, you don't need the RPC
You need to handle an overlap as if it calls on everyone and single it out properly.
That's what SwitchHasAuthority is for
DestroyActor and your counting event should only run on Authority
This is in the hud
Playing the sound can stay like that
Yeah that is also bad
Widgets can't have RPCs
They aren't networked. They should only get data from networked actors/components/object, not be one
The easiest setup for you would be:
- When Overlapping, add a Sequence. First Then0 plays the sound. After that Then1 should go into a SwitchHasAuthority node, which is followed by a normal (non-rpc) AddGems event and DestroyActor.
- AddGems should then get the GAMESTATE (not GameMode, not controller).
- GameState should then have an integer variable that you set to replicate or even RepNotify (if you want to update your UI).
- You increment the GameState integer and in the RepNotify function of its int variable, you can access the local PlayerController, get your HUD and update the UI.
OK I’ll try that real quick and get back to you in a second when I’m done (it might take a little more than a second though since my brain is quite simple)
When you say non-RPC that means I should have replicates set to not replicated correct?
I meant the CustomEvent you called ServerAddGems
That doesn't need to be an RPC in my setup
The Actor replicating depends on you needing it to replicate or not
how do I know weather it’s on or off also I’m a little confused at what RPC even means since I’m still super fresh to the engine. I understand the rest of it though, just still confused about that one thing even after I looked it up in the documentation
Read my compendium then
It's written so none of us have to re-explain this stuff over and over again to beginners :D
Repinned it so it's at the top
OK thank you I will!
This should also answers other questions and would have lead you to use the GameState anyway etc.
So read it fully if possible, and maybe even more than once
Hello, i have a question, i want to make a FPS game, how can I make other players see my character but I can't see myself in first person, just my hands and weapon?
Uuuusually (there are other solutions I guess) you have two meshes. One for ThirdPerson and one for FirstPerson. On the MeshComponents you have booleans called "OwnerOnlySee" and "OwnerNoSee". Owner being the local player. That should do the trick.
OK I understand what they are now (also really well written compendium btw) but I do have a question: i’ve been marking like pretty much every replicated event as reliable and the compendium says not to do that. What are the actual downsides of marking them all is reliable? (sorry if it says it and I just didn’t see it)
Marking everything reliable will for one fill up the reliable buffer of the engine, which at some point will cry about it and iirc discard everything that comes after "full".
And the other thing is that having everything reliable kinda makes stuff unreliable again.
But it depends on what "pretty much every RPC" is. You 100% DON'T want to do that for an RPC that is called on tick. No one cares if an RPC of frame 1 out of 60 per second is dropped.
Reliable is mostly for events that are called once every while and that 100% need to arrive.
As soon as you do things in that RPC that aren't important, you don't want it to be reliable.
E.g. spawning an effect with a multicast is not really important.
OK, thank you for explaining that to me! I feel like I would’ve been pretty confused if I ran into any problems with that later. Also I try to avoid tick events anyway as to not cause performance problems so that’s good
onpossess client and server, acknowledgepossession client only?
I'm looking at syncing the 4.26 water plugin across a few clients. From what I gather I need to sync seed and time. The server's time can be grabbed from GetServerWorldTimeSeconds but I can't quite find where the plugin is grabbing time from. Am I missing something obvious?
Anybody uses gamelift? My build using windows server runs normally, but using linuxserver it failed to activate..
Previously I don't face any problem in building linux server, it activate normally
All right so I tried to do what you told me the best that I could and it’s not working so I’m probably just doing something stupid but anyway let me send some screenshots
The gem itself
The Target is wrong
You can use the "OtherActor" pin and cast to your character class before you do any of this
So before the Sequence
Just to make sure only that one triggers this
Your Gems variable, in the GameState, should be set to RepNotify
That automatically creates a function in your functions tab called OnRep_Gems
In there you can do the GetPlayerController->UpdateUI stuff
Also don't mark your UI Event as RPC please
@thin stratus OK so I believe I’ve done it correctly but I’m still confused on what you want me to do with the character class and the other actor and I’m still not quite sure how to update the UI especially with my old UI code in the player controller gone but I’m just gonna send some screenshots real quick just so you can verify that this is correct other than the stuff I’m confused about
This last one is just gonna be my unchanged hud
Okay
So it's two different things
The Character Class and OtherActor pin is to make sure that the Overlap is really only be triggered by that
Between the BeginOverlap and the Sequence, simply cast the OtherActor reference to your Character Class.
It will fail for all others.
The other point being: Where to call the UI Update Event?
Again, since your Gems variable is marked as RepNotify, you should have a new function in your functions list called OnRep_Gems. You can also get there by double clicking the Set w/ Notify Gems node. In there you can do the GetPlayerController0 -> Cast -> updateGems.
@twin juniper
I copy projectile predictive system from unreal tournament, and it works, but only when one of players is server, if i use it on dedicated server, projectile not replicated to anyone, only exist on server and locally, but if "play on client" it actually works perfectly and replicated to all clients. What possibly can cause this problem?
Still kind of having a bit of trouble (sorry and thank you for your patience btw) i’m in the function and I’m still not quite sure what to do to actually store the amount of gems and update the ui to say that amount, I think I might need a little more hand holding on this one
Also this warning
Almost sure this is a me misunderstanding problem
@twin juniper Well you are casting your Controller to the HUD
That can't work
Cast the Controller to your custom Controller
And call the Update Gems function on it
Or whatever it was called
cl_updateGames_UI
But don't make that an RPC either
The OnRep already calls on everyone
And the value you want to pass along is just the Gems variable
Yeah I knew that as soon as I saw the warning but was confused because to me that sounds like what you wanted me to do, but yeah let me just fix this real quick
@thin stratus OK so it seems the character class thing is having problems (probably also my fault) but I am in need of help again
I’ll just send a screenshot of what I have
None of the print strings are even firing so I assume it’s a problem with how I did the character class
Also I’m probably just dumb btw
The cast is wrong
My bad for saying "class" I guess
Just cast the OtherActor directly
And make sure to use your character and not controller as type
@twin juniper
Well it just works if i uncheck run under one process \
@thin stratus OK so now I am having a problem that I believe I know why it’s being caused and how to fix it but I don’t know how to do what I think I need to do:
basically the game state I have all the code running through is a custom one and isn’t set as my game state class in game mode in the world settings because I couldn’t figure out how to actually open the default game state, so I created my own custom one but when I had it set as the game state class in my world settings I lost all of my controls and couldn’t move my camera or walk or anything, so I just decided to use the default one and put all my codes in the custom one and just see if it worked that way and I’m pretty sure it isn’t because of that. So I’d like to either learn how to open the default one or how I can make the glitch I was having not happen if you’re possibly able to
You can't put it into the Default one
That's the Parent Class and that would be editing C++ source code
You need to use your own
Together with your own GameMode
Both being either the BASE version or the one without the BASE at the end (no mixing)
And then you also have to set your custom PlayerController and Character classes in the GameMode
Then you can set the GameMode as the default one via the Maps&Modes section in the Project Settings
Well I have a custom player controller class and I’m pretty sure the game mode is custom but I’m not quite sure what you mean and does this mean it’s erase everything time?
@thin stratus
Is it not possible to replicate AI montages?
I tried to Multicast it, didn't work. So I did the old RPC Cast method, also didn't work.
No, please try to find a tutorial. Setting your own classes is the very basics of using this engine. You'll find tons of tutorials for this
@twin juniper it is possible to replicate montages, and its not important if its AI or not
you're not even trying to replicate a montage, as those RPCs have no Payload, but just a command to play it, btw
@winged badger I was originally under the impression that AI's Automatically ran off Server so all I would need to do is Multicast. If this is not the case, do you know the recommended action?
but as you mentioned it being an AI, it probably has no business having a server RPC in it
As of now, only the server can see the AI's Montage
as long as that multicast runs, and the montage reference is good
I got it working now! the whole system works perfectly! I just had to reparent my game state class to the base. Thanks for all the help and sorry for asking so many beginner questions!
it should run the montage on all
@winged badger so it ran outside of the macro...
Aren't macro's just collapsed nodes???
using a macro or not is irrelevant, unless it has a bug in it
best to limit the macros to flow control though
when you want multiple named outputs
@winged badger I see, there's definitely an issue somewhere. The montage won't even replicate at the same time as the server. Maybe this has to do with rootmotion lock?
Oh and I’ll make sure to read the rest of the compendium later! @thin stratus
Got it to work by the way. Seems like Unreal 4.26 doesn't like to connect to steam in the editor, but if I run the build or the project from explorer it works 👌
Yeah they changed the way Standalone works in 4.26 so it doesn't launch with Steam. Pretty frustrating
Hey guys!
I'm thinking about CI for my MP project.
I use AWS to host dedicated servers and now project builds on server itself, which is not too efficient. I want to build on my local server and get builded version on other servers. Any hints how to do this? Maybe someone already done implementing CI for multiple dedicated servers.
I have done this exact thing. I have a local machine hosting 2x VMs. One linux VM hosting TeamCity CI, and a Windows Server VM which is my build machine.
The windows server runs many jobs, one of them is to produce a Linux dedicated server build via cross compilation.
Once the package is made it is gzipped up and uploaded to s3.
Then I use Packer to create an AMI for the dedicated server.
I also have CI jobs which spin up AWS instances using the latest AMI created in the previous step.
I originally followed a blog post describing how to use Terraform for server deployment, which worked, but I'm a hacker and I didn't understand it enough to make changes.
So I deleted that and now I have a Python script which reads a server config file and spins up/destroys instances as required. Uses the AWS sdk directly.
Wow, that sounds a bit too complicated, but cool.
yeah it took me about 3 months to reach this stage
I would recommend TeamCity for CI - I have used Jenkins extensively in the past, but TeamCity has been an absolute breeze so far
getting basic package building via TC will not take too long
might be best to pop into #automation for further advice on this topic
Can TC force remote linux machine to do stuff? Like download a project, run commands and so on
Is it dangerous/unadviced to save all the playercontrollers on the gamestate? (This allows other players to see everyones controller however they shouldn't be able to use them since they don't own them, right?)
You wouldn't be able to see them anyway client-side, they won't replicate
If you want quick access to all existing player controllers you can use:
for (FConstPlayerControllerIterator Iterator = GetWorld()->GetPlayerControllerIterator(); Iterator; ++Iterator)
huh, neat. I realized my array is missnamed and it's actually an array of player states but only the player states that are players (not expectators) 😅
and to get all my controllers (serverside) I get all the states and find the owner
(I am a blueprint boi)
Well PlayerStates you can already get from the game state, they're held in PlayerArray (those you can get client/server side)
The only important thing is that array is maintained locally so they won't have the same order
yes, but they are there even if they have no pawn/spectator pawn. I keep track of the "actually playing" states.
Oh right sure, I think you can get Pawn from PlayerState now though too
It's called PawnPrivate because of course it is.. but it's there
Oh it's also not replicated so that looks positively useless 😄
In 4.25 at least
Still don't really know why that exists but there ya go
Oh nvm, it's set by the pawn
🤣 🎢
When are playercontroller created? If a player has 4 xbox gamepads connected to his computer, does he get 4 controllers just because? 
Nah. You have to add player's manually for more local players. Other input devices will just register on the default input component if not.
right, but I can't know how many "xbox gamepads" (or any kind of devices) are before creating controllers and failing 
This is better than just checking on the Tick, right?
(checks that all players are ready before servertravel)
need your help
i have a dedicated server running on my server computer, and i want to run command script from client computer to the server computer computer
the goal is to run the separate server instance with different port from client side
anyone have any experience with the Oculus subsystem?
I'm trying to list my friends off using the same method you would use for Steam - ReadFriendsList and GetFriendsList but I'm getting 0 friends to show up on my friends list when I have one according to the Oculus software you have to run to activate the headset
And they recently revamped their developer dashboard in which you have to request access to certain APIs (like friends, identity, leaderboard, etc.) and I supposedly have access to them (got setup automatically)
question : does blueprint and C++ code execute on dedicated server build?
Yes it does
@wheat magnet Please don't post the same question in multiple channels
@jolly siren great thanks
@wheat magnet your dedicated server is a executable binary which contains code.. that code can be either blueprint or c++
the issue is that i want to run .bat script from client to server
the server and client isn't at same computer
because i'm using amazon computer, where my dedicated server runs
Why you want to do this ?
That screams to me "security issue" 
i want to run separate server instance
Ok, do one this .. place that bat file along with server build at aws
because i want to run multiple dedicated server sessions
i want to run separate server instance with different ports
I want to know why client needs bat file??
the client will run that .bat file on amazon computer
Then
and amazon computer runs the .bat file with new port parameter
No you are doing it wrong
i want to run multiple sessions of multiplayer
like join or create room
1 vs 1 player in one room
On AWS if you launch multiple dedicated servers.. the servers automatically starts on different ports
You don't need to touch ports
for example "open 145.42.56.45"
but when a new client came and they execute that command, they will be join the same room
the concept and idea is to run separate multiplayer sessions
No No No No, this is not how it's done
can you explain how i can do this in better way, i found this solution, but can you suggest me a good solution
Since you mentioned .bat file means you are using windows server???
yes
sessions and server browser is the easiest way to properly set it up
but unreal engine does'nt support multiple sessions on singer server
Ideally the AWS computer (EC2) , you configure it in such a way that when it boots up it launches your dedicated server.... Means you set some kind of script to run after boot.
Start multiple server instances
that why i found this solution, which is to run separate server instance for each two players with different ports
He is working on online multiplayer card game and spinning dedicated server is over kill
yes, and that's i need a solution to run .bat file from client to amazon computer, how i can do this without connecting to server, i already have server ip
i have access to server by using server ip
so if i'm in other country, how i can communicate from client game build to amazon computer ( where my server build is running )
You need OSS
what mean by oss
is there any tutorial, or any article for that
and which feature of EOS should i use for that?
The epic online services are in early stage.. and it's unreal plugin is in development phase
Auth and sessions
What happens is when your unreal dedicated server runs.. it tells the OSS that hey I m server and this is my ip.. and when client does session search via OSS.. OSS returns the available server
Don't feel bad, but I think you are very new and don't have much experience.. so why don't you start with NULL OSS and try to build things locally
When you play with NULL OSS , you will definitely get a good understanding of multiplayer architecture.
NULL works within the same LAN
we are working with dedicated server, also i want to run multiple sessions from single server like there are total 4 players on server, but there are two rooms/sessions where two each players playing separate
did ever play Asphalt 8 multiplayer
where 8 payers join and they play
NULL OSS will full fill your above requirement, if the players are connected to same network.
And server hosted on same network too
we want to run the game on WAN ( over internet )
And it's a good starting point
I m afraid that your understanding of multiplayer architecture is very little, first you need to get good grip on system first
yes i already work on local multiplayer games by sessions finding system, but the system i'm going to implement now is a realtime multiplayer cards game, where users can join and find rooms and they play together
also find session, create sessions node only work with single session at same time, so it won't work with multiple session
that's why i was running multiple server instance with different ports, so each server instance represent one session
Are you planning to run one unreal dedicated server for every pair of players???
yes, like 2 players are playing in one room, other two players are playing in other room, and so on
i found all solutions, the only thing is remaining is to run .bat or command to the server computer from client
Don't you think it is wasting the compute power. A dedicated server can do much more than that... And you aren't event using 1% power of dedicated server
Your one dedicated is having 2 players and only replicating card moves..
Am I right or not?
but what should happen if two players is already playing game on server and then when new two players run the game, they should be play multiplayer together
so that will be two teams ( but totally running on different sessions )
Basically your game is not a true realtime game.. rather it's turn based game.. and there are many service providers which provides turn based features
can you suggest, but the main issue right now is to run the command from client to server computer, how i can communicate to server computer if i already have server ip
If you have ip, then you can connect to dedicated server via beacons
And beacons are c++ only
so it mean i can communicate from unreal client to server
Yes you can.
But whatever you are doing is not recommended
If it works and you are convinced then go for it
Beacons was developed for Paragon and I believe it is being used in fortnite too.
Inside engine , you can find some production ready beacons example.
where i can find exact examples for Beacon
is this is actor or should i search in unreal folder
yes i found the Beacon actor
which one should i select and what to do next
Turns out I just needed to add the other person to my organization as well
and now it works
Hi everyone, how can i find those replication settings for gameplaydebugger replicator and worldsetting replication? 
Really no one knows? wow
thought someone didnt see, or wasnt good time to asking but...
this might be more interesting if no one know about this
But the waste percent isnt small for 100+ match instances
Only two of this left to be set
yikes
@bronze arch I'm not even sure what your question is tbh
Total.
My question is update frequency
It ticks while nothing to send
So 2 bytes total and you're concerned ?
2 bytes but still tick.
That will be waste cpu resource at 100 more instances. Thats why i wanna set lower that update frequencies
Even 34 tick per seconds isnt small
Ticking is unrelated to networking entirely
If it ticks, it ticks
It doesn't matter whether there is networking or not
NetUpdateFrequency is a member of AActor
and AWorldSettings derives from AActor
?
Dunno. I cant find any actor two like that
I mean you're asking where the frequency setting is and it's on AActor isn't it?
also there is net.UseAdaptiveNetUpdateFrequency
Also none of this is even relevant
If no replicated property is changed it'll only replicate once
Which it does here
For 5 bytes
Im not talking of network side. Im talking about server side this will run 34 times perseconds. This may usage %1-2 for one instance idk. But at the 100 more instance you can imagine of the usage.
You have no idea how many tens of thousands of objects tick
You are looking at one
I assumed you profiled it and found an issue
I ve already decreased game thread usage to 2.0 ms. Im doing my best by line
If i would set those, i may get 1.98 who knows. Thats why i want to research this but i see no one know
This is a network profiler - it does not show ticking, it shows the bandwidth used. For CPU performance you need the CPU profiler.
This is literally entirely unrelated to CPU performance
I'd say it makes sense to control update frequency when you know what it needs to be, but don't pull your hair out over it
I done with cpu profiler. Disabled everything that how i get 2 ms on cpu time. Now im gonna with network ticking. I dont see any info network ticks on cpu profiler
There is no such thing as network ticking
UCLASS()
class HEXTACTICS_API AMyWorldSettings : public AWorldSettings
{
GENERATED_BODY()
public:
AMyWorldSettings() { NetUpdateFrequency = 1.f; }
};
this compiles
This is entirely pointless too
It does nothing
There is no such thing as network ticks
Actors don't randomly update themselves over the network
I'll try this thank you
🤦
@bitter oriole what is the column "Update Hz" reporting?
I'm done here, I'll just block both of you and let you profile imaginary stuff
???
So then character moves send magically 0hz?
Lol okay
have a cigarette or something this is coming out of nowhere
Giving random code to people that does absolutely nothing is not helpful
It's the opposite of helpful
maybe answer my question or explain generally instead of saying the same thing over and over again
And if you think this does something, you have no business giving multiplayer advice
Actors don't randomly update themselves over the network
If there is nothing to update, there is nothing to update
murphy — Today at 12:51 PM
@bitter oriole what is the column "Update Hz" reporting?
I have never used that tool before, so I have no idea, and it doesn't matter
he asked how to set the update frequency on an actor I think I answered that question
whether he needs to is a different question
You answered with something that will do nothing
Since there is nothing to update on this class
will it change the value reported in the column Update Hz?