#multiplayer
1 messages Β· Page 406 of 1
@vocal dagger When you get the BeaconPlayerState propogated to the Client Beacon, you can set Server's Handshake complete with the client connecting to the host beacon.
It is then ok to start sending/receiving voice data, so you can "unmute" the player controller and use the voice delegate to receive/send voice data
oh dang youre doing VOIP @ the ClientBeacon system? We implemented this but moreso for a UI-Party system (SteamParty plugin for study).... didnt think to do VOIP at this point.
Hey guys, i'm newbie at multiplayer but i was thinking about making a little project that supports it (player hosted multiplayer).
If i'm not wrong, these are the "high level" stuff i should consider.
-UE4 supports server hosting by a player, i think the shooter example is a good starting point.
-But i need some way of matchmaking, i could use a service like Gamesparks for that.
So, i think i could add cheap multiplayer support without the need of paying high amount of $$ for a server, letting the players host the server themselves and using a cloud service only for things like matchmaking, player ranks, etc. I'm not entirely sure if this is possible, i hope you guys can tell me if i'm wrong.
"E:\UnrealEngineSource\Unreal Engine" does not exist when packaging dedicated server???
@frozen fog Why not make a dedicated server or just host sessions using the advanced sessions plugin?
Hi, thanks for the answer! I don't want to host a server myself because that would be a little expensive. I just want to let players host multiplayer rooms, very few people for each host (3-4 players). I'm not sure if letting players host the game is viable (i know it would probably be laggy). I will check the plugin you mentioned, thanks for the info.
@frozen fog Dedicated servers are laggier if not set up correctly. Well, I told you, download the advanced sessions plugin. It is free, free for commercial use as well and watch this tutorial: https://www.youtube.com/playlist?list=PLrudBLqLfaTT4QJZUW3tc_H7l6BlL0RKd
@distant wave hi
yep some people are reporting that it works and some are not. i really can't even offer tech advice on the steam setup honestly. mine is not working at present. all that works for me is joining a pure dedicated server using ipnetdriver
my game is on steam, people are able to download and run it from steam. but when they join the server, i just have a UMG button that people press. that button says "join dedicated server" i hard coded the dedicated server IP into the exec console command: open x.x.x.x there.
hmm
that's all i can tell you.
honestly i might even have to start flushing my ded server binary every 2 days
sometimes i cant even connect if the ded server binary has been up for more than 2 days lol
it lags out
but i DO get a connection.
and i join into the game.
that works.
I will try to do something
I will do a new project
make ded server for it
test it
just use source control, save a version of your proj in sourcetree or something like that, and try to fall back. might be quicker. or you can do a new project. whatever.
whereare you hosting the ded server?
I want to do a fresh project so I can see if something is wrong with my project
In germany
using zap hosting
but I live in Romania though
didnt worok?
didnt
well you gotta set it up right lol
I did
yes
so the instance started?
ok.. and of course you uploaded your ded server..
and firewall
yes
it appears in steam master list
I can join it
I cannot find it
I join it via open steam.Server Unique ID
to get the unique id of the server I just print it in OnlineSessionAsyncServerSteam.cpp
in inbound, and anywhere in outbound
I only did 27015 and 7777
as sebatnik showed
and I looked it up only 27015 and 7777
are needed
i guess i just dont really understand your need for your game to be on the steam list. if you put it on a hosted ip, people can just join it via clicking join game.
your game gets promoted by steam when its on steam
not from being on the server list
Idk I just want it to show up xDD
yes
i got it to work as sebatnik's video on local.. it didnt't work for me yet on dedicated.
my game shows up in steam list.
i ended up just having problems with steam authentication
and fell back to ipnetdriver
as you might have to do as well
if you change your code to not use steam, you can maybe just use a test bed, and then later hire someone to write in the steam code.
that or you would have to do a ton of research and figure it out. it's time consuming and "blewh" π
im more of a designer anyway
the steam code to join the server would be in the find session advanced, as well as your server browser list widget in your game
so you can either extend ur ui with a CPP parent class to do it or do it entirely in BP
i believe find sessions advanced extends the steam api calls without needing CPP, right?
advaned sessions does that
sebatnik used that advanced sessions thing - with the dedicated server flag enabeld.
yep
and allow join via presence false
he didnt show the allow join via presence set to false
but it needs to be set to false
do you wanna do a team viewer tomorrow?
i never changed that flag in mine
maybe if im on
i have a ton of singleplayer stuff to do
well I switched it to false when I saw it isnt working with it set to true
wana see something im working on real quick? i can paste a vid in h ere
so..
hold on a sec
after all the time you siphoned from me i wana force u to watch it lol
brb making it
and jk u didnt siphon time π that was other people
i got completely spammed by people for ded server help for the last month or two lol. it was a rumor that got around taht i was a ded server guy π
yes i know. sorry i was a bit dismissive to you when you asked.
i was just spammed by everyone.
I totally understood
there ya go. basically what im working on now. i got AI done, and i am adding in the meshes into the game for my campaign.
i may make it coop multiplayer at some pt too. can be fun.
do you have any demo stuff of your game working in multi?
@twin juniper Wow dude that is awesome?
I am talking on my phone rn and game is really alpha
DM me it later if u can. i would love to see.
if im on yea
This way I can show u everything
might not be on though. i have to do shopping and my ex's is coming to town lol
lol
my ex's possibly a bad person in a way, but that's okay
sheβs a bad girl?
a little pushy at times, but that's not too big of a deal. it's okay.
lol
anyway maybe DM me later ok?
oh yea, sheβs a bad girl? πππ
i gotta get this singleplayer stuff done lol. and no comment π
ok
Later I will probally be sleeping
cuz it is late here
When I see you online Iβm gonna spam you AF
@twin juniper
alright
Thanks man
welcome
and also You have a very very good game there
good job
maybe some time we can work together who knows?
So im currently running into a issues wich shouldnt be a issue but it is... so i want to display players name over the head but i cant wrap my head around the simples stuff right now aparently what am i doing wrong ?
You're running a multicast from a client
See how it says (if server)? It means it only works if its run on server
@lean hornet
Well i tried it before with run on server wich diddnt work either well (everybody had the servers name)
I can do more complex stuff but when it comes to this stuff i cant get anything done @icy nacelle
You need to make one more custom event
So begin play -> Run on server -> multicast -> set text
Also I'd recomend reading Cedrics Compendium to get an understanding of how to do stuff like this
@lean hornet
so i dont need a rep notify at all (i already did) its just i still have problems with simple stuff i can make full games but when it comes to simple cosmetics wich require networking im helpless
You could do a rep-notify, but as far as I can see, you're using it wrong
just set it as replicated
Okay understood
Also if you're making a multiplayer game then theres a lot more to it than just cosmetics being replicated.
If you're taking the rep notify route then I'd also do this differently
I got it tho thank you max .
np
I could explain it a little further, the differences between multicasting and rep notify, but its best you just read the compendium π
you dont have to it was just me being stupid xD
Thats fine man - multiplayer networks arent easy. I'd still really recommend reading the compendium!
Glad you figured it out though.
@icy nacelle I already did like i said before it helped me massivly with setting up the whole game i just sometimes struggel with a few things due to my brain.
@lean hornet I do want to point out that there is a PlayerName Variable in the PlayerState already.
That is already replicated properly
So you only need to grab the PlayerState.
Your 3D widget is on your Character, so you only have to pass the widget the Character reference and after that you can get a pointer to the player state from that
No multicasts or whatever needed
@thin stratus thank you so much I totally forgot about the player state.
I just tried to implement networking into 4.20 Prev 5 and I keep getting this error: 'bool UWARUGameInstance::HostSession(TSharedPtr<const FUniqueNetId,0>,FName,bool,bool,int32)': cannot convert argument 1 from 'FUniqueNetIdRepl' to 'TSharedPtr<const FUniqueNetId,0>'
I tried the same thing in 4.19.2 and it worked so it must be something with 4.20
see the function
I did
First thing I thought is that I should change FUniqueNetId to FUniqueNetIdRepl but then I got a different error
No it's not that since that is the name in cedric_eXi documentation also I changed it to FUniqueNetIdRepl same error cannot convert argument 1 from 'FUniqueNetIdRepl' to 'TSharedPtr<const FUniqueNetIdRepl,0>'
So i kinda have ran into a odd issue where after clicking the button to join a session it takes sometimes up to 6 secounds to start joining a session .Any idea why thats happening ?
Hey guys I am getting a error which I am not able to figure out can you help me?
49>D:\UnrealSource\UnrealEngine\Engine\Plugins\Online\OnlineSubsystemUtils\Source\OnlineSubsystemUtils\Public\OnlineSubsystemUtils.h(166): error C4130: '==': logical operation on address of string constant
49>D:\UnrealSource\UnrealEngine\Engine\Plugins\Online\OnlineSubsystemUtils\Source\OnlineSubsystemUtils\Public\OnlineSubsystemUtils.h(166): error C2227: left of '->GetSessionInterface' must point to class/struct/union/generic type
49>D:\UnrealSource\UnrealEngine\Engine\Plugins\Online\OnlineSubsystemUtils\Source\OnlineSubsystemUtils\Public\OnlineSubsystemUtils.h(166): note: type is 'const char [5]'```
@desert dagger What are you trying to accomplish?
Also did you change those files?
Apparently, there is only one line with errors
Did you modify it?
@desert dagger Can you copy paste line 166 in OnlineSubsystemUtils.h, please?
I mean copy paste it here on Discord.
@distant wave I fixed it. We had macro named OSS and Unreal used variable named OSS internally. Renaming Macro fixed it.
Hello. Any idea why in a new map, what I just created I'm getting these glitch? https://i.gyazo.com/eb3761adfee08725584130c996633862.gif
@dusty halo please explain in detail
@umbral adder Nothing much to explain. I press play (dedicted server with 2 players) and these glitch appear. For some reason in World Outline it delete second player and show it again. As you can see from BP_SurvivalCharachter2 it have went to charachter 14, 15... and it keeps doing that. In my old map I don't see these kind of thing.
u deleted the pawn in game?
No
ue4 do it by it self, but actual charachter don't disapear from game
Will make another gif in a sec
@umbral adder I don't do nothing, they just stand there
Still stuck with these
whose world is the outliner showing?
If Everything works with a Dedicated Server, it will work with a ListenServer
Is this statement true?
false
Do you have an example?
mainly has to do with how to handle the Authority switches
for example if you have a thing that should only run on the client and you do Role < ROLE_Authority to call a server function
it would work on a dedicated server, all remote clients but not on on the ListenServer
if you need your game to work on DedicatedServer and as ListenServer, you have to do some extra checks there
IsLocallyControlled for example
I don't really know where to put this but how come my game isn't properly packaging?
It's my first try at doing a multiplayer sort of thing
I just installed it and it's not showing that anymore which is good @worthy wasp
However
There's still some stuff there :(
I added a steam plugin if that might cause any issues
why are you trying to package 32bit?
and lastly - your goign to havve to debug your log file - the packager is finding something... not spitting out the error in the UE4 log window - but putting it into the log file.
You'll want to search for BlueprintCompileError i believe - if you find none...search the log for "error" and find what its spitting out... it literally could be anything - static mesh, lighting, etc.
as for your steam - if you can SHIFT+TAB in the STANDALONE playtest.... you're steam is operating fine.
SHIFT+TAB should bring up the Steam Overlay
again - this can ONLY be done in standalone or packaged game (obviously you cant package)
Anyone has faced these issue? https://answers.unrealengine.com/questions/806342/automatically-delete-actor.html
Basically it deletes second player when there is big gap between 2 players
how do I use functions like DeprojectScreenToWorld and GetHitResultAtScreenPosition on the sever side ?
it seems they all use ULocalPlayer which is not valid on server side! I even don't know whether screen size and things like projection matrix are available on server side or not
I am builing a RTS game and want to send mouse position and do selection and ... on server to prevent cheating π
btw whats the difference between standalone build and client build! can't I use standalone shipping build for my client?
What would be the best way to store the bought skins / items / cosmetic items in a database for a game @thin stratus
@thin stratus Any idea about my problem?
Define big gap
How big is that?
You are most likely running out of relevant distance
@thin stratus yes like store it in an int or what?
easy to check if NetRelevance is responsible, just check AlwaysRelevant
and if it is the culprit, this behavior will stop
how do I execute a NetMuticast RPC on every client ?
by calling it server side
You call it from a server on a replicated actor that exist on everyonr
you should really read the Cedric's compendium
its pinned on this channel
then ask here when you get stuck
@umbral adder That is up to
thats the point I don't have any actor ! I want it to be on player controller
PlayerController cant have Multicasting
could I run the RPC on GameState instead?
If you want to reach all PlayerControllers, either save them in an array when the player connects and then loop over thr array and call CLIENT rpcs
Or use a Multicast in the GameState and then get the PC and call a normal function on it
GetGameMode->GetNumPlayers->For(0 to NumPlayers -1) GetPlayerController(index)
is relatively easy way to fetch them all from BP
Theses are local players
its from GameMode, not GameInstance
E.g. Your ListenServer plays splitscreen online
They have their own backend with people who learned how to do it
We cant answer this for you
Read up on databases
And think about how you want and need to store the skins
@thin stratus thanks I guess GameState is good choice π
@thin stratus Not too big. If I scale cube 40x40x2 and one player stands in one corner and other player stands in other corner in diagonal from other, then it do that.
what does serialization do to int and float parameters of a RPC function ? it get compressed or not? though I think float can't be compressed
how to get projection matrix of player on server?
@thin stratus sry
yes with umg how would i create a widget that gets created on cursor position and which dynamically update's height
How to properly replicate set actor rotation?
same results (not replicating correctly) with multicast/run on server function and without them. It replicates normal when i use switch has authority but then client have problems with controls...
problem
For anyone using AWS GameLift, do you know anything about this? (error during VS compile)
With most shooters, and both HitScan and Projectile based guns, when the Client fires, does he send a Server RPC with his aim info, and then Server spawns/does the calculations using that aim info? Or do clients just tell the Server to fire and Server uses its own Camera rotation/Controller rotation state for that client?
Iβm basically trying to decipher the steps between client shooting, and server shooting, and what information is passed off between the two
you probably don't want to expose to direction to client
but to keep it input based
because in relative timeline, aim rotation and shooting have the same latency delay and are driven by same visual feedback
and depending the game design, you may have to do a hit confirmation on server side based on movement history
Anyone here used GameLift?
Kinda, why
I've been using Advanced Sessions Plugin and I'm able to create and join servers through steam
However it hasn't been taking inputs from the players after it's connected
Does anyone know why that might be happening?
is it possible to get the server's tickrate (as the server) from BP?
if not, how can i get it in c++?
by that i mean configured tickrate set with NetServerMaxTickRate
not based on world delta seconds
@thin stratus Just curious how their recurring billing works out from someone that has managed it. The pricing is not that straight forward on their page.
I finally got everything to compile (4.19) for GameLift but I can't enable the plugin π€
When I try, it says I have to restart UE for changes to take effect but when it starts back up, the plugin is still disabled.
added it to your build.cs ?
worked ty
AGameMode::Logout should be called when a client crashes right?
@twin juniper Cant help you with that. Only set the Service up for clients. Never used it myself so never had to pay
https://streamable.com/9tyoq its not that noticeable on the video (its extremely annoying ingame) but client1's pawn is moving choppy as its seen on listen-server window(bottom), like its trying to snap back to previous position each frame. when i launch it with dedicated server flag, both clients look choppy to each other. im not doing any advanced stuff, its just add movement input. what should i look into?
so moving meshes to inherited character's class mesh made it smoother. BUT there is still a bouncing-like effect https://streamable.com/98cuo
@thin stratus how do i connect to a beacon host with steam?
basically i want the connection string or the URL
@modern gyro Did you test some netsettings to see how bad it is with high ping and package loss?
Cause the ListenServer seeing the client laggy might really just be the bug you posted
anybody know what type of variable is this?
or is this a custom made one?
@me please
I've never worked with beacons, sorry.
ok np
@thin stratus just tested default third person template and it has exact same bouncing effect(u need to set skeletal mesh empty and add cube to it so its easier to notice), i assume im not only one experiencing this but for some reason i can't google any good solution
hey guys
if I wanted to make a small matchmaking master server for a game that matches player based on ping and level for example then starts a server instance
any idea what framework would be easy to use to communicate with unreal and how I can I send and receive data between that external server and an unreal client instance?
web server + http requests is by far the easiest way
@full bane web server as in a normal server maybe a C# server with Json?
you have to think how to interface from UE4
and is it reliable? I don't want anything super fancy but I want something that is not too slow or not secure
and HTTP request is by far the easiest to get going without any hassle
so whatever can answer to http requests will do on the backend
otherwise you are looking for a plugin or low level socket communicaiton
gotcha thank you
@uncut pivot socket.io that JavaScript framwork? so I have to use it with socket programming in unreal right?
just an a side note, sockets are usually more solid
yeah i believe fortnite uses xmpp
so if you are looking for something scaleable, then xmpp probably gets you further than http request solutions does
the project i work on uses socketio
with a node js back end
we use node for scalability
xmpp is already a module in the engine
we had to use a plugin for socket io
and its had issues
so maybe try xmpp
why did you use socketio in your project tho? just for the Node.js backend?
i can't really disclose that
thats under nda
basically we dont want to use it anymore
for unreal yes
if epic is using it
its probably best
following what epic does is never a bad idea
I won't say never haha
but true they keep the stuff they use updated in the engine
what do you recommend to use it for in a small moba like game?
can you write node
not really
you know c++ though right?
python could work
essentially you want something that can scale
and youd prolly want to use gamelift
for your servers and such
yeah thought of that
it's easier
but we are not thinking on that scale
pretty much just doing a prototype to test if this could work
that's why I was looking for something simple that can be scales later
something I can run of a home PC with linux etc
thank you that was a lot of help
btw can I use steam onlinesubsystem with that or no?
since it has stuff like a friendlist, secure connection, a store and others already implemented
yeah you should
we also updated the steamworks stuff in our fork of the engine
you might want to do that too
I will see that too thanks
what do you recommend to use steam for? I want to save on time and effort so I want to use it for everything possible
I need help with replicating pawn movement in my game
The server pawn can move perfectly fine and the client can see it
However when the client tries to move it's not detected at all :(
What should I do?
so if im making a bp where some things are replicated to all, but some are only for the owning client... is it easier to just make a branch right at the start of the event, 1 goes to client, 1 is replicated? or is it more of a... bunch of switches where needed (im really bad with this)
@elder crypt Let the Client tell the Server that he wants to move the pawn
In addition to moving it on the Client
How would I go about doing that?
By calling a ServerRPC alongside your normal code
Which executes the Movement code agian on the server
@steady briar If you need some things only on the owning client
Then mark these properties as owning client
There are Replication Conditions for variables
Other than that, if you need fucntions to only execute on Client or so, then using the SwitchHasAuthority and a LocallyController + Branch right at the start is the easiest way
well in this case im testing with particle effects. i want some to be only for the person who overlaps, then another that all see. im getting really stuck on it
Pass the Velocity through Event @elder crypt
i do have the particles activate/deactivate in a function though, so im not sure if im doing anything right
@steady briar Overlaps aren't really replication
They happen on all instances of the actor
no the overlap doesnt have to be replicated
I know, that's not what I said
YOu are aware that an actor, replicated or not, can exist on all players, right?
sure
So if you place a block in the scene, non replicated, it exists on Server, Client 1 and Client 2
Now the PlayerCHaracter does so too
If the PlayerCharacter of Client1 runs into the block
the copies on server and client 2 also run into the block
It's less replication and more the point that theses class instances, on each player, run into the overlap
So your overlap is getting called everywhere and if you want to limit it to the local player who overlaps you need to check if the actor that overlaps is the local player
So if your Character runs into the Block, you check INSIDE of the Block, on Overlap Begin, if the OTHER ACTOR is EQUAL the GetPlayerCharacter0
That will only be true for the local
basically i have a pickup. i want one effect to play for the player who triggers it and another effect for everyone to see
Yeah I just told you how you do that
ya i got the local part that seems easy
but i cant get the particle to play for all clients
if i do an overlap check and do the GetPlayerCharacter0 and stuff, it seems like anything i try to do after that point only goes to that person, which doesnt make sense to me
The Branch you have
Where you plug in "Equal(OtherActor, GetPlayerCharacter0)"
The TRUE exec is the local player.
The FALSE exec is everyone else
@steady briar
hey man thanks so much @thin stratus :) It's working just fine
np
that i did not know. ive been looking at it as a comparison like... well, true false. not thinking of false as things that failed the check
clearly im not a programmer
It takes time :P
You always need to see multiplayer as a world that is duplicated for each player
If there is a room with 3 players
That rooms exsts 3 times
While each player has their own pawn and sees a duplicate puppet of the others
so the TRUE on that branch would show to the overlapping client, the FALSE would show to everyone else?
It should yes
Cause if ClientA's PlayerCharacter runs in it
Calling it CharA
Then "GetPlayerCharacter0"
Will only return CharA on ClientA
For ClientB and ClientC it will return CharB and CharC
effectively failing the check
ok that.... seems to work. damn
broke something completely different but....... whatever ill figure that out over a month
ok so... overall the lesson here is that if u do a check, the True only applies to that person. right? at least close? <_<
whats the difference between IsLocallyControlled() and just checking ROLE_AutomousProxy vs ROLE_SimulatedProxy?
@steady briar That specific check, yeah
good enough for me for now, thanks
is a RepNotify variable checkable the same way as a non replicated variable?
nvm figured it out, IsLocallyControlled will return true as long as you have a playercontroller controlling that pawn. This can exist in any ROLE state.
or more specifically if we were ROLE_Authority, we could still be IsLocallyControlled, which would break our logic if we were just checking for ROLE_AutomousProxy
@steady briar Checkable?
basically checking the local overlap with the repnotify bool if the object has been used
You can use that variable the same way as a non-replicated one
if i add prints after, itll say used or unused, but it doesnt seem to matter
RepNotify only makes sure that the OnRep_VariableName function gets called when the client (and in BPs the Server too) receive the updated value
do players nearby at the time of the switch get updated? or is it only when they enter the range of the update
Replicated Variables update when the Viewer is relevant
In most cases that is when being in a certain range
If you aren't in that range, then you don't get the update.
If you later come into that range, you receive the update
right, so it also applies if ur standing next to it when it happens
Players joining later (or reconnecting) also receive the update
Yes
That counts for Replicated and RepNotify variables
RepNotify just has the nice function as addition
ya im unsure how to actually test that function but thats for another day. currently trying to figure out a couple more issues. one of them is that the check always seems to be true even when it is Used (shouldnt activate)
im sure its something im doing stupidly
The Function just calls when the value changes
If SomeBoolean is true and the Server changes it to false, then it takes a few ms (or longer if lagging) for the value to be false on the client.
So you can't blindly assume that after the Server set the value, that it's instantly on the client
So if you want to call a function on the client that needs that boolean to be properly changed on teh client (even when lagging), you run into the problem of not knowing when the variable is actually replicated
That's what the RepNotify function does for you
It calls when the FALSE (or whatever other value your variable can take) value arrives over the net at the client (and server in BPs)
is there something that would stop the client from getting a repnotify variable?
If relevant, then no
But that counts for replicated variables in general
as said, RepNotify only calls the function in addition
That's all
my brain hurts a bit. thanks for the info, ive already got a few things working that ive been stuck on. plenty to go though
no biggie
oh before i go i guess multiplayer is the right place (ive read a lot of people saying its only when testing dedicated server)
the issue seems to have nothing to do with the size of the volume
anyone know why they dont consider this an issue worth fixing?
is there a way to optimize spawning a lot of actors at the same time, specifically on the server?
it causes a tiny hitch at the moment
can you check your project configs and ensure the async loading check boxes are setup properly? we found in the past that this is basically not meant to be turned off anymore
yep, enable that top check box. We've played with this when we were faced with extremely challenging async loader thread issues with navitization and found it a bit unstable to disable the async loading thread.
you may have disabled it purposefully though
yes, unfortunately it will be a long rebuild
since that affects UPackages and most of core
π
I know I've already asked this but has anybody got any idea why the "create player" node would not create a second split screen? I'm trying to learn by looking at an example project that is setup for online but the usual method i use for creating players and setting up a split screen game isn't working. Yes, split screen is enabled in the project setting and also "spawn pawn" is ticked on the node, i've also checked in the level blueprint and checked for any extra camera functions that have been added. The funny thing is, is works as it should if i launch it as a standalone game π
Hi people! I started to study networking. I got the first problem. In template project "ThirdPerson", in blueprint "ThirdPersonCharacter" I added node: make HighRes screenshot. But the screenshot is made on all clients and server. How to make screenshot to yourself?
@weary saffron Are you testing that in the Editor?
Cause that might just be cause of that
Im trying to get a list of all connected players but when i call GameState->PlayerArray its always empty (im calling it in my game state constructor). I also tried using the game mode but that only works on the server
@thin stratus Yes. It's important?
Hello
I am wanting to check if a game server is online based off UDP
I'm needing a string to send, and a string to expect, anyone know what the IPdriver sends/expects?
Also what encoding does UE use in the Ipdriver?
isn't that what beacons are used for?
there might be a more basic ping/pong though, not sure if that's easily accessible
Hello
When using Advanced Sessions plugin
if I get Current Players
it will always return 0
@distant wave steam?
yes but nvm I talked to mordentral and he said there is steam auth problem and steam auth will be implemented in 4.20
correct
Steam Authentication has been added! Games can now add a packet handler component that interfaces with the Steam authentication APIs, allowing them to advertise their servers properly, handle VAC/publisher bans, and provide better validation of clients.
Networking
@strong breach Constructor is way too early
The PlayerStates add themself into the array
That can take a few ms
@weary saffron Yeah it might be cause of the editor counting as a single process?
Any insight on how to replicate a Ball's movement? Looking at the 'Rolling Template'
@thin stratus Ok, I will try to pack the project and check out the editor.
Is it possible to replicate particle systems so that 2 games see the same ones? How should that be handled?
How would I go about making a tab menu that shows the names of players on my game?
Like the steam names
@tired sinew Well you can spawn them on everyone via a Multicast (if called from the Server)
@elder crypt You can use the PlayerArray of the GameState
That has PlayerStates in it
Which have the PlayerName
I've been trying to use that but I'm struggling with putting the information on a widget
It's been giving visual errors or not showing the name at all
wait nah I got it
Thanks man :)
I just used a "foreachloop"
has anyone tried to do multiplayer such that the clients shot is always valid? for instance, the client shoots where the player appears on his machine, then server validates the damage by rewinding?
i know the character movement component has saved moves, so is such a thing possible? how would you go about validating the shot? any ideas?
or is this generally considered something thats not feasible without writing a lot of your own custom netcode
@dull stream You're saying give the client authority? Sounds like you want the client to do all the work on their machine, then tell the server what they did
@calm hound Essentially yes, the client is responsible for determining its aim direction and the location in which the projectile is fired
and when the projectile collides with the enemy, client side
the projectile notifies server it hit the player
server then rewinds the player that was hit to ensure that its a valid hit and no cheating occurred
I mean, you'd be really opening yourself up to cheating to do it that way
its still rewinding the player to confirm the hit is valid
the amount of information the server would need to predict cheating would be the same as just doing it
the rewind prevents cheating
right
but I'm saying, if you're going to make the server rewind and do all the calculations anyways
why not just have the server do it in the first place?
for responsiveness client side. if the client shoots and hits a player it seems very responsive
Is this a competitive game or cooperative?
yeah its competitive
Competitive games that do it this way open themselves up to lag switching
the client throttles their data-packets using various software/hardware, and they dupe the server
ah right
the client gets the hit regardless, and then the server is told it works, and because of the latency the server has to assume it's correct because the updates of position are all off
What I'd recommend
is do it on the server, and have the client simulate it. And simply perform corrections to the client's version if it needs to
If the client tries to lag switch, the server holds authority. And is restricting their updates anyways
thats actually the way Im doing it currently, although the corrections client side arent fully implemented yet. I was kinda exploring alternatives while Im still setting things up
Yeah, unfortunately for competitive games you open yourself up to major cheats that way. Co-op it'd be fine, who cares if some one cheats really
but if you wanted to explore the idea, what you'd have to do is basically in an interval, send updates of where the player is ot the server
Basically just let the server decide
Ive heard that overwatch has a system similar to what i described, where the players shot is usually valid and they do a rewind to check. But theres probably some validation to prevent high lag abuse
And simulate it locally too
and the server would then say "He was here, now he's here. He can only travenl 500ft in that amount of time, but he traveled 3 miles. kick him, he was cheating"
but, the problem then comes down to aim bots
if the client does all the work, you can't predict that they aimed themselves or a computer hack did it for them and got an auto lock to the head
its hard to think about all the ways people can cheat heh
That's why people love to cheat. They like to try and beat the system
When it comes down to it
you don't want to risk accidently banning/kicking your players that are just really good, but not cheating
right
So predicting if a player has a high DPI and just is very keen to accurate movement and good shots versus an aim bot? Hard to say. That's why you try to give the server all the authority when it comes to that
The core issue with competitive multiplayer on PC is that you can't really prevent cheats, you can only dedicate half the dev time to security, client-side anti-cheat, great dedicated servers, a report system, replay system
CS:GO does all of that and gets mostly decently cheat-free
Yup
I guess as an indie dev I can only worry so much about that sort of thing. Cheaters will cheat, I probably dont have the time or skill to really have a system as locked down as CSGO or overwatch
so do what i can and move on
best bet is to just put up a lot of barricades to make it last a few weeks π
heh
most games are like anti-virus. They just wait till some thing comes up, then patch it
It's hard to predict what people will do.
As an indie, the best is to not make a competitive game
Probably won't be able to stop the influx of cheaters
I prefer single player games, but Im hesitant because of all the art that is necessary for single player games
i suppose there are certain types of games that could avoid large amount of art creation, but eh
As an indie, MP is a tough sell
Competitive is a no-go because of cheaters, and because you're unlikely to ever have the required player counts for an active community
Cooperative boils down to enhanced single player with all the complexity of MP
maybe I should just do a cooperative rofl. I dunno, something to think about for sure.
either way, Im learning things so at least theres that
Competitive is very hard to pull off as an indie unless you've got serious financial backing
You need to be very good at multiplayer code with a robust server, you need to pay for dedis, and you need a huge marketing campaign
competitive multiplayer is hard mode from every side you can look at it
although there are some neural network cheat detection things on the way
thats crazy
they might be able to do some heavy lifting in the future
Neural anticheat only works if you've got millions of players, dedicated servers, a report system with active players
Valve did a presentation at GDC this year
It works really well if you're Valve and you're working on CS;GO
I know, that thing has 99% ban rate for aim bot
wow
using only the report feature and then let overwatch ban people
you could extend this to wallhack with some heuristics
Thing is, it only really works if you've done everything before that - great architecture, involved community, huge volume.
By the way their AI anticheat isn't better than humans, it's just way faster, and trains based on existing humans doing report triage
well, you don't have the guys that report everyone better than them messing up data
but 99% report to ban ratio seems legit
You do have them
really, they didn't changed anything on the report system
They just trained an AI to detect report situations
I know, I watched the talk
π
So basically what yall are saying is I need to implement a neural network cheat detection system
and you could easily train it to spot other hacks than aim bot based on mouse movement, I think neural network based anti cheat solutions could go a long way in the future
No, really not @dull stream
π
That's only a relevant option when you have 50 million players like CS:GO does
Right now if you're working with a small team and if you're not super experienced in game dev, I think the best course is to avoid multiplayer, and especially competitive multiplayer
Im by myself! π
Im not sure if I would call myself SUPER experienced, but i have worked at a pretty big studio for a year
Im out of a job though unfortunately since it was contract
That's a bummer
I think MP is viable when you've got the basic concepts right
Competitive, well, I don't want to go into that myself, I think it's a nightmare
maybe competitive is too strong of a word
I just want a fun, multiplayer, player vs player game
its not like i would expect people to be playing it at gaming conventions and their to be big tournaments or anything
but yeah, i dunno if even that is feasible though. guess it just depends. I probably do need some single player component.
or cooperative
Competitive is PVP, yeah
I think PVE is a fairly good middle ground because you've got much less incentive to cheat
If you can't make other players rage, if you can't kill them, then cheating becomes kind of a non issue
yeah true, but i do worry about art creation when it comes to PvE. with PvP players can be satisfied with a couple well designed maps
PvE you gotta have more art, you gotta have artificial intelligence, gotta have incentives to actually fight against the environment (lots of rewards and character progression). The latter can be downplayed a bit with competitive imo.
theres a different set of hurdles to overcome for PvE or single player
which is more difficult? I dont really know. I guess single player and PvE is easier if you have the right game idea.
And the scope is kept reasonable.
@dull stream I think it's very dependent on your game. Though right idea, decent execution with little content can still work in PVE
I often think about Besiege or Portal, games that have decent replayability & length with very little art
ah, yeah those are good examples
Hello
How do I remove network lag from my game? It doesnβt occur in PIE when checking 2 players and checking dedicated server.
It only occurs when I actually join my dedicated server.
I used network profiler. I donβt understand what it says lol
I need HELP
in PIE you can simulate lag with console commands
Are variables within a character separate during multiplayer?
For example, I have a character blueprint that has a "putts" variable and it goes up each time the player hits the ball
If I had two instances of the character (multiplayer) would it keep the putts separate?
Anyone using GameLift?
I've been playing around with it and there seems to be two instances of the same variable
How come that's happening?
(It's the green)
nah sorry xd
does anyone know how to create a party session in cpp?
@thin stratus You right! Problem solved. Thank you!
I'm taking my first attempt at a networked multiplayer game and I've been banging my head on this problem for too long -
Chess - I have a GameBoard AActor that spawns all the game pieces (APawns). The board holds the list of pieces as a TArray<GamePieceBase*>.
I have the tried putting the code to actually move the pieces everywhere and the best I can get is to have the player that happens to be the server have their movement replicated to the other player. Currently I have the movement code in the GameMode but somehow when it hits the code the list of all pieces alternates between all 32 pieces or empty.
I was under the impression that game mode only ran for the server, but somehow it looks like it's running for both clients?
It only exists on the server
If you try to get it on the client you will access a nullpointer
I'm trying to wrap my head around what I'm seeing then - This array should be unchanging
You might be accessing the gamemode wrong
If the call comes from a client you need to make sure to server rpc in a client owned actor first
Heh, I don't even know enough to try to ask what that means haha - it isn't in a call from the client though - it's just a timer loop inside the gamemode itself.
Did you read my compendium?
Ah that's you!? nice
You really want read about ownership and rpcs again then
ok thanks!
Furthermore we would need to see your code to see whats wrong
@thin stratus i have hear that there is a difference between gamesession and party session
is it true?
More or less
Depends on the service you are using
But in generell they are just different names
I gotta say though - between your compendium and Looman's calss on Udemy I've made it much much further than I expected to get in a week
Thanks for putting that out there
Glad it helps
is OnRep_MyPropertyName called on dedicated server ?
I read somewere it gets called but I only get client side OnRep
I'll step in for cedric and link his compendium haha
Somewhere around pages 53 to 57 I see some stuff about the OnRep
http://cedric-neukirchen.net/Downloads/Compendium/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf
OnRep is always called only on client.
Yup
WOOHOO!!! After multiple long nights I have replicated movement for the first time! Thanks @thin stratus That was exactly the section I needed to look at again
That is not true though :D
The OnRep stuff
OnRep calls on the Server when doing BP stuff
In C++ it does not call on the Server
Leaving you to call it yourself
@thin stratus u r right. I tested it :|
another damn question. I Spawn an actor on the Server side with Owner but on the client side Owner is null
void ARTSTestGamePlayerController::ServerOnClick_Implementation(FVector_NetQuantize traceStart, FVector_NetQuantize traceEnd)
{
FActorSpawnParameters asp;
asp.Owner = this;
auto pMeshActor = pWorld->SpawnActor<ARTSTestRepActor>(..., asp);
}
hey hey, any good multiplayer tutorials that would be up to date?
thank you Stranger
what should we set as owner with Actor->SetOwner() ? Pawn or PlayerController
That's very much up to you depending on the game
Do you want the object removed when the pawn is killed ?
I think it differs a lot. because I used PlayerController and now the actor has valid owner on the client which has the specified PlayerController but others have null Owner
I think its because each player only has its own player controller
Well, you can use the Owner for references of course
And use the Pawn as owner if it's owned by the PC
To have an easier way of accessing it.
But nothing keeps you from just passing the Pawn ref anyway
I usually tend to only use the Pawn as an Owner if the Actor I spawn is actually only relevant to the Pawn's lifetime
Like a weapon
Actors that might survive the Pawn should get the PC
As Stranger pointed out
What would you reccomend a event tick using a tinterp to get a physics actor from a to b or a Lerp using a custom event wih a timeline ?
am i doing something emmensly wrong here it seems that it works worse now then when i had it hooked up to the event tick
(timeline is set to 0.4sec from 0-1)
I got into trouble again. My pawn inherits from APawn and I change its position with AddActorLocalOffset on server side but the point is position is replicated to clients other than myself LOL
bIsMoveing π
@dull stream There are tons of lower end cooperative games that are great. Killing Floor was nothing more than AI that went from point A to point B, got close enough? Swipe attack. Then they varried it by changing the attack and walk speeds, swapped some animations. Red Nation is a very simple top-down wave based game people loved, it was one map, and maybe 5 low-res character models. Magicka, although a bigger budget indie game, with a lot of content packed in, isn't that complex of a game either
People like to have fun, give them something easy to pickup, and give them a reason to play usually you don't need tons of content.
It's possible. But also, you gotta remember. You need to have fun making it as much as they have fun playing it
If you are trying to make a game just to sell, you need to work for a big company. Because without all the publisher money and research to help you sell, you're going to have to have something just really really fun to help be spread by word of mouth. So don't worry about pleasing the masses, worry about pleasing yourself
yeah, i think thats all good advice. really i think i should focus less on making extremely robust systems unless im doing a plugin
im not a team of engineers, just one person heh
The thing is though, you're doing it solo and you're worried about art. So you're trying to do competitive. How are you suppose to balance a competitive game by yourself?
I know a good amount of devs locally, its just that I was waiting until I had good foundation first.
as far as the art stuff goes
There are always going to be drawbacks to what you wanna make. So if you have something you genuinely want, and enjoy to make, because it's fun. You tend to think of ways around those challenges, be it art or cheating, or just accept it for what it is. But can come out with a solid game, and still maybe make a few bucks
ya
Best advice I ever got, was "Just get it in there"
Don't worry about complex systems, get some cubes for walls, a cylinder for a player model, and debug lines for weapon traces and be able to shoot each other
don't try and make a map full of art, and a character model, and then a weapon with animations and effects before you have gameplay
don't even try and make a perfect weapon system first. Just take the quickest route to be able to get the core game play in. And then refine over and over again
I have reasonably solid gameplay to start with, and i can host a server and play with people. Its just a matter of polishing it and adding more content really. But honestly might post pone the whole thing, I came across some devs with a project thats supposedly near finished, so jumping on to help them push it out
so most of the conversation from the other day isnt a high concern anymore. things changed out of no where heh. But I'll probably come back to it because I think the game could do well
Yeah, honestly. Most productive thing to do is enjoy yourself
if you're curious I could send you a vid in dm
see what you think about it, what might work well as a finished game
I mean I always like seeing what people are working on
im curious what you think might be best direction to take it
G'afternoon folks
hey every i havequick question im learning how to create a multilayer game all is good , just when i try do add object that can pick up by the player the other players cant see the player picking them they didn't even move from there place when seen form the other player instance ? is there is any tutorial how to fix this thnxx
@stone badge you'll want to do an RPC event as Server then an RPC event as Multicast to do those actions if you want everyone to see them
i am trying to pass the character reference from a client to another via gamemode. So when a client connect to the gamemode, he passes his character reference to the gamemode, where it is stored. When a new client joins the game, the gamemode gives the reference from the other to player to the second one., etc etc. The problem is that the second client sees the reference as invalid, cuz is not yet created in his instance of the game. Any idea how to work around this?
ahhhh niceee thxx @proper olive
@pearl plank not yet created? create it! or if it's not "yet" created, try a delay...
not sure what your setup is
delay does not work
the reference is invalid cuz is not yet created in the new client instance of the game, is valid for the other client
are you passing a controller or a character? controllers don't replicate from client to client
a character
so you have an array of them on the game mode?
is it set to replicate? the array or the variable or what have you
no, is the gamemode...
how many players in your game?
doesnt matter
is it limited or unlimited?
like is it "a 2-player game" or is it like, multiplayer whatever it can handle?
k well anyway, I have a problem concerning AI in multiplayer if anybody has a sec
basically I've managed to unpossess the pawn, spawn default ai controller, use AIMoveTo and get a success/fail, destroy ai controller, and repossess using a saved reference of the controller/pawn
BUT..... a few seconds later, on Clients, I suddenly get no valid owner and crazy dispossession bug
works fine for server... I'm doing most of the operation as server RPCs
and it does work fine on Clients, everything is dandy, I can repossess just fine
but a few seconds after running around again, it gets dispossessed out of nowhere, and I'm not seeing any debug exec lines on my BPs
or dis-owned?
I think destroying AI controller is somehow destroying the player controller? I was using it to cancel any leftover AI behavior tho
no that wasn't it :/
throwing Set Owner up with a saved reference to the player state as an actor object isn't stopping it from happening either
Destroying actors is something that should be multicasted or is it enough if it happens on the server?
self-answer: enough on the server
*if Actor is replicated
Well the Multicast wouldn't work then either
But just so you get the idea
@glacial lotus
@thin stratus Thanks
Will APawn::IsPlayerControlled return true if the function is called on a client?
if i have a custom event that is set to not replicate or run on owning client, why does every client and server still see it?
"See"?
It depends on what is calling your CustomEvent
And if you mean the Print String message, then that's normal in PIE
So any idea why my client and server are having weird possession issues when I unpossess on a Server RPC from client? The controller still operators on the character but only on the client's side - on the server's side, the character goes flying off at whatever velocity it's at when this happens, and this only happens like several seconds after I switch to AI controller, whether or not I switch back
controller still operates* I can still do input events and get controlled pawn
Well Possess events etc. take time to replicate
and it's frozen in place on client side
Are you maybe experiencing that?
it goes - save controller / pawn reference on pawn / controller, then unpossess, spawn default controller.... later on I reposess but even if I cut off everything at this point, the camera suddenly freezes and the character breaks a few seconds later
this is what someone told me to do to set player controller, because by default i guess it doesnt like to
I've put set owner to the controller every which way
doesn't seem to make a difference
detection sphere isnt important to the server, its for visual feedback for the individual, but the server and clients 1 and 2 print it when it is set
the funny thing is, Ican do a whole move-to event, it completes successfully, then I re-take control with my player and everything is moving fine
but then 5 seconds later freezes
and when it's frozen, I can still do a input event that destroys controlled pawn and respawns saved pawn, and it totally cleans it up
so I mean theoretically I COULD just destroy/respawn but that seems wasteful
@steady briar BeginPlay calls on every instance of course
is there a better way? and it seems like its wasteful to send that info to everyone when it only matters to the individual
What are you doing there anyway
A Pawn, when being spawned, belongs to no one
So you can't know who the individual is who owns it
Also ownership has to be set via Server
well someone a while back helped me with this to set the player controller
What
You simply possess the Pawn from ServerSide
That already does everything you need
That results in the Pawn being owned by the Controller
As well as things like "GetController" to return the PlayerController of the Player (on owning client and server)
And that part
if you only need that on XY, then limit the BP call
If it needs to be set via the Server, then use SwitchHasAuthority
If you need it to happen on the owning client, then BeginPlay is wrong
Then you need to use the Possessed Event and perform a ClientRPC there
basically it is just a stat like any other (health or whatever)
it will be adjusted by other stats later on, so i guess the server just needs to calculate and set it to avoid exploiting it
so should i just delete that mess about the player controller?
I would
And if it's a stat, then move it to the PlayerState
And set it to replicate
Well, PlayerState if it's really just a stat
If it's relevant for the Character, then leave it in it
In when you set it just make sure it's on the Server
e.g. Switch has Authority
hmm...
where is the default playerstate? it cant browse to it. i made a new bp based off it but no idea what it should look like
ok if something is for the character and not playerstate, event beginplay is bad to initialize stuff?
Why is it that when I launch from character blueprint I get smooth normal behavior and when I launch from the main editor page my client teleports all over the place? What's the difference?
Hi, I need to get local HUD on the clients that are connected to dedicated server
void UMyActorComponent::BeginPlay()
{
Super::BeginPlay();
if (GetWorld() != nullptr)
{
for (FConstPlayerControllerIterator Iterator = GetWorld()->GetPlayerControllerIterator(); Iterator; ++Iterator)
{
APlayerController* PlayerController = Iterator->Get();
AMyHUD* MyHUD = Cast<AMyHUD>(PlayerController->GetHUD());
if (MyHUD != nullptr)
{
//Do stuff
}
}
}
}
how to do that correctly? I want to do that from an Actor
atm this does not work on the clients, HUDs are NULL it seems
Do you guys package your game builds while the project & engine are built with the 'Development Server' solution config?
I'm getting package errors regarding WMF Media Player when I use VS 2017 and I try to package the game with the Dev Server config
@unique thunder The Engine needs to be Editor, not Server
And the Project needs both and then packaged for Dev. After that you have to grab the Server binaries from the Server Build and put it into the Binaries Folder of the Package
You might also want to look into the frontend
@twin juniper HUDs are local, they dont exist on the Server
In your function instead or directly accessing the HUD, you need to perform a ClientRPC on the Controller first.
Also make sure to limit the BeginPlay call to the Server
@thin stratus Can I build the server files without building the engine under Development Editor using commands? I found something like that, just not sure if I need the right config built and then re-built as editor for working
The engine should stay as dev editor
Great, thank you
Hey, new to Unreal, and coming over from Unity.
Been playing with networking in Unreal for a while now, and have a PlayerController that can possess 3 different pawns (they handle input differently, so I take the input in my PC and send the data to the pawns).
When I run in single player, all 3 pawns are there, and disabled, and when I possess one, it becomes active and the old one disables.
When I turn on networking (I've setup all of the RPCs to possess on the server) only the possessed pawn is replicated.
However, when I possess a new pawn, the old pawn stays active for a while (about 2-3 seconds) before being destroyed on the client. Is this normal, or am I doing something really stupid?
^ I'm having similar issues, not the same problem, but when I switch from player control to AI control, a few seconds later the pawn does all sorts of weird stuff, moving around jittery and receiving input from controller but no movement
but only on client-side. Server works fine. Are you spawning default controllers for the pawns when you unpossess them, @late violet ?
No, just using "Possess(m_otherPawn)"
I got to run out of the office now but will be around tomorrow
And can anyone help elucidate me on UMG usage in multiplayer? It seems like nothing wants to replicate when passed through a UMG window, but UMG windows are like 90% of user-interaction so what's the best method for say passing an actor reference so I can trigger events on it from the UMG blueprint?
does anyone know if multicast event will work beyond net cull distance?
I mean if a far player will receive it
@proper olive UMG should not deal with anything replication
You need to build your UI as a persistent, player-owned thing that looks at gameplay objects and responds appropriately
@cold sparrow there's a bug where when you multicast a variable, it gets set temporarily (like 2 or 3 seconds) on everybody even beyond net cull distance before being voided out
makes my overhead chat visible across the map π
@bitter oriole but how am I supposed to look at gameplay objects and act on them if they're not replicated?
Gameplay objects (actors) are the one to be replicated
I'm doing things like making entire events on the pawn with saved variables just to accomplish the most basic tasks
Not your UI
right but what about when I save a variable to the UMG
and then try to pass that variable to something else
yes, I need to make sure that RPC is called even beyond net cull distance
like an actor reference
Well, your UI will have to store some data - but data that is relevant to other players ? I don't think so
so like when I talk to an NPC, I can't just have the widget tell that NPC to play an animation based on your response, I have to tell the owning player to get a saved reference to that NPC and play it from there
somewhere on the pawn or whatever, will make keeping track of various NPCs talking a pain
If you want the NPC to animate remotely on other clients based on what you're doing, then yeah, that animation state should be replicated on the NPC, and the NPC will need to store a reference to the player it's talking to - something like that
But you don't want the UI doing that
I would advise keeping UI dumb, and stateless
lol there's so many little things like that like "oh well I see why most games don't do a FPS/Third person switch, it's a pain in the ass" π
Ideally I want NPCs to be persistent in the world so I'll have to keep track of it like "currently talking to NPC"
but to make a complex scenario with scripted NPCs and dialog choices....
it's almost like I'd be better off using overlap volumes to choose your dialog π
"walk over to the rebels to give a speech, walk over to the guards to ... uuhh, give a different speech" etc
or maybe like input events for number keys so you can just trigger responses straight from the controller and skip UMG buttons all-together
er altho then idk how I'd do the actor reference, whatever. Any other cool ideas?
you should be able to pass information to NPC from UMG, like you select a button and NPC does something
and all other clients see it
in order to pass it to the NPC, I need a reference to the NPC
you already have it
and any replicated references on UMG to server owned characters come through as invalid
I have to save the reference on the player character basically
right, you call function on your character, you character will call function on the server, the server will execute event on NPC. where will you get NPC's reference - you already have it on your client.
Unreal does not pass references, like pointers. Instead it passes GUIDs, all cleints will have the same guids if they were created by the server and replicated.
so, you do have a reference to your NPC on your client.
then in your NPC you call multicast to all clients to play this or that animation, set variables, etc.
right that's what I was saying, gotta store the reference on the player pawn which is kind of annoying. Can I at least access that variable from the UMG if I set it on the pawn ahead of time? Maybe that's the step I'm missing that makes it all make sense
you can resolve it: get player controller - get controlled pawn - cast to your character
so the replicated references can be accessed from the UMG, you just have to store them elsewhere
I'll try it out as soon as I fix my diving animation π
so functionality like pressing a button to do something/open a door or something... that should be in player controller? i currently have it in the character so that might be wrong <_<
Is there anyone have knowledge about UReplicationDriver class?
you do not really need to place anything game logic related to the player controller.
@echo geode i have been reading it's code but it's very new so I doubt anyone has any hands on experience with it
@steady briar , you place all that logic into your character and pass it to the server to do actions.
@gleaming vector What do you understand from the code? A graph that consists of actor replication with UNetConnection objects?
well, it lets you control who sees what and how often things are replicated
atleast the ReplicationDriver does that
the Graph is an implementation of it that builds a workable graph to quickly determine if an actor is relevant
and how to replicate it
I haven't really gotten beyond that high level understanding
i dont know how they walk through the graph, or anything about it's topology or rules
I activated the plugin. Still have no idea how to use it.
oh, you just change a config somewhere
the header for ReplicationDriver should have an example
it's well commented
I still have no idea how to use it.
@gleaming vector Probaly it is not related with changing player's Server/Client model
Is there any mechanism that every player behave like a server?
I did some experiments for RPC: RPCs are being called regardless of net culling settings.
it has nothing to do with changing the server/client model, no
what this does is it allows you to change the way the server decides how to replicate objects to clients
it's like one step above NetDriver, which does the socket layer
but it's below NetworkChannels, which are what emits replication state
Yeah, its server-only. I think i have no chance to behave a client and server tasks. Thanks for information @gleaming vector
nah, the server/client authority model is baked into every part of the design of the engine
that would be a ... project ... to change
I've been looking everywhere for answers to this but I haven't really found any
I have a vague understanding of how the player array works but does anyone know exactly what it is?
Also is there a way to access the playerstate and add varaibles to it?
Thanks!
What do you want to know?
It's an array of PlayerStates
PlayerState is available from the PlayerController
And from possessed pawns
@thin stratus Sorry for the late reply. I was wondering how I could add new playerstates that could be accessed from the player array
I want to do the same thing shown in the picture but instead of "player name" have my own variable, such as the player's score
You create a bp with PlayerState as parent class
You can then set that class in your own GameMode class
In the class defaults
Similar to a character for example
@elder crypt
So I'd create the variable inside of the playerstate blueprint that I created, correct?
and I just set it as the player state class
Yeah you can create your own variable in the PlayerState
and with my understanding it'd be already replicated to all players, right?
My issue is that I want one player hit a golf ball and have it be shown on the scoreboard
I have the variable be "putts" But I'm not sure how I'd call for it in the scoreboard
I'm not sure how I'd call for the variable, I suppose
That's where I'm mainly confused
The image above is what I use for getting the names, and that works perfectly fine
anyway to check if the code is being executed on client or server if the actor is not replicated?
In Blueprint, there is the HasAuthority, which has Remote or Local
Oh good point, there is the "Is Server" but I'm not sure what that will return in this case
oh true didnt remember that node
Currently I'm using play sound at set location. In multiplayer other players can hear me as if I was next to them while I'm on the other side of the map. Anyone know how to fix this?
You're not like.. using Get Player Character (0) or something weird like that?