#multiplayer
1 messages ยท Page 550 of 1
no no
because the print should only happen when you posses the character
no.
send a screenshot of your gamemode BP
@foggy idol send this
because the blueprint for the controller and HUD are exactly like mine
So the name is " ". so its blank. currently the SERVER sees the nameplate as blank.
the client sees "???" which is the default text.
So the server is displaying the info but not the saved info.
but the client is getting nothing.
only defaults for the client
in the HUD blueprint Instead of trying to load info try just setting the name to something
i want to see if its the game mode or not
lemme try using my setup with a text render component
damn
can i set this up in a separate project and send it to you
because mine works fine and i dont get whats going on in yours
@swift cargo
Hello everyone, how can I make a Solo, Duo and Squad system?
hey in c++ i have a function that runs on the client and i have it working in tick but not at all in begin overlap? please help im so lost i really need it to work in begine overlap
any pointers to what this means?
LogNet: Warning: UIpNetDriver::ProcessRemoteFunction: No owning connection for actor Cube_146. Function GrabObject_Server will not be processed.
Does anyone has a good way of making a networked moving platform? Currently my solution works fine in some situations, but if the player has high ping, things fall apart when the platform moves quickly/changes direction or the player jumps. (using Character and CharacterMovementComponent)
@pulsar maple try smooth sync plugin?
Would anyone here have any suggestions/recommendations for a guide to follow for setting up a Dedicated Server with Steam?
I plan to first set it up from home with my Static IP, and later move it to AWS.
why not start with aws? you can use gamelift local
I thought it would be added complexity
gamelift is pretty simple
they have some good plugins that help a lot also. but even without its not bad
i have not used it with steam but it shouldnt matter. gamelift basically just helps with getting your clients to the server, matchmaking and stuff like that
Is game lift expensive?
its owned by amazon so no more than aws in itself
you will want to ue linux server for cheapest cost
Only reason I want to use steam is that I currently have my listen server setup working through that, but i would ultimately like to end up using AWS and EOS.
With dedicated servers.
im using dedicated now with gamelift/aws for my vr sniper game
you can still use the steam subsystem
hmm.. i guess i should try it. thanks for the tip. Any implementation guide / plugin you recommend?
ill link the plugin. Aws has their own but its only c++. If you want a blueprint solution, ill link the plugin. https://www.unrealengine.com/marketplace/en-US/product/361e3eed7f2d4862a0cb7c8f042e613b
looks like they went up on the price. When i bought it it was like 60 bucks
they put a lot of work into it though. it works well
They also have a ton of documentation and tutorials
If you want to look into a microsoft solution, they have a playfab plugin which is kinda like the AWS/Gamelift
ok, yeah i had been looking at that before but never pulled the trigger.
i havent had any problems with it
wow, ok.
I think i will get this one, since i'll need to do some DB stuff in the future.. probably use dynamo db
yeah nothing in game changes you just using it to find your server
If i have an offline lobby that the player travels to a server level, where a different pawn gets spawned, will playerstate variables from the offline lobby be the same in the server map?
they will if they are copied via CopyProperties override
but that woks only for server/host
anyone know where and how unique net ID is generated in UE4? ๐
been digging through engine code with a shovel but still can't find it ๐
would anyone know what this warning refers to: LogNetPackageMap: Warning: FNetGUIDCache::SupportsObject RuntimeAudioSource "..." NOT supported?
How do I use the smooth sync plugin to replicate camera rotation ?
@verbal gust its probably a named component created on BeginPlay
Yeup it's an AudioComponent that i create on BeginPlay but I don't know what this warning means, could you spare a few minutes if you know?
its warning its not net addressable
meaning i shouldn't do replication with AudioComponent?
if it was replicated, you wouldn't get the warning
the pointer to it cannot be resolved over network
okay thank you
there is no use-case i can think of to replicate the audio component
also, if it was on CDO, you would not get the warning
there is no use-case i can think of to replicate the audio component
@winged badger I should be more clear, it's more the playback controls I am trying to replicate so that the audio file is played "globally" when a client presses the "play button". AND I just happened to find this warning. Anyways thanks
the actor you would send the RPC through can find its own Audio Component
it doesn't have to be replicated for that
you just can't send the pointer to the audio component as a RPC parameter, is all
(unless its on CDO or replicated)
Thanks for the help Zlo, got it
ok, im not rlly sure how to explain. but: when i walk around on the map server side. the enemy ai hits me. it works fine however when i move in the map as clients. hits dont get registered... as i move in as server towards the client beeing hit. the hits start beeing "detected"' anyone knows what this can be?
Hello everyone,
1- I can noticed that I only get saturation on my Listen Server when the FPS is above 120. Is there any way to limit the actual FPS of the server replication and processing without affecting the FPS of the "client"?
2- What are the red flags on the Network Profiler that can allow me to see the saturation?
@gusty slate
MaxNetTickRate=60
NetServerMaxTickRate=60
LanServerMaxTickRate=60
NetClientTicksPerSecond=60
bClampListenServerTickRates=true```
Thank you Jambax ๐
I am still trying to understand why exactly limiting the FPS is getting rid of my saturation. Because I tried to use timers at 0.05s for example for my function that sends my data for the server for replication
I would have thought that timer would "simulate" a reduction in workload per frame
Is there any way to disable the replication of attachment?
Well you can check the Network Profiler to see what RPC's are being sent and how often.
If replicated properties are changing quickly too, the Server will be trying to send those out at the actors NetUpdateFrequency.
This is why the default frequency of 100 is so stupid.
Not that that will have any effect on RPC's.
The Character Movement sends RPC's each tick, but it does a lot of work to try and compress them together and send less often.
I am trying to implement Physics Movement and I am using those Timers to not have it send movement data at each tick
But at 3+ players even though the RPC and Property size was small (imo small MP experience) it was getting saturated
I still need to learn how replication works so that I can optimize but the best case scenario principle in my mind is to set it up so it doesn't send movement data if the changes aren't important enough + it only care about the latest data sent or should I say received
But thanks for the pointers @chrome bay I'm in that starting phase where even diagnosing the issue is difficult :p
Hello, I have several questions about sessions, I think this will be long so thanks in advance for reading / helping.
I'm making a multiplayer game on which i want to be able to create and join sessions, for this I created a menu that has two buttons "Host" and "Join" which interact with functions on the GameInstance. Host creates a session and on success opens a map with listen as option, join button searches for sessions and joins the first one it finds.
Host works kind of fine, returns success and opens the level, the only issue it has is that it prints LogOnlineSession: Warning: OSS: No game present to leave for session (GameSession) which I'm not sure what it is and I cant find any significant answer in google.
The big problem comes with join, when i press join it prints LogOnline: Warning: OSS: Failed to send discovery broadcast SE_NO_ERROR and doesn't do anything else, pressing the button more times just prints LogOnlineSession: Warning: OSS: Ignoring game search request while one is pending. The error is sent when searching for sessions as the search sessions pin that gets called afterwards is "OnFailure".
Any ideas on what might that be and how to fix it? I read that it might be something that only happens on the editor but I made a build and it still didn't connect, also I saw videos of people trying this on editor and it worked for them.
Finally, once several players are connected to a session how do I open a level and make all of them travel to that level? Does open level work or do I have to do something different?
Thanks for reading and for the help!
Tl;Dr: Find sessions sends a SE_NO_ERROR when called, what is this?
is there an easy way to have a split screen in the editor when testing for MP?
@gusty slate in my experience, a couple of character movement components at a high frame rate (like 200+) practically sent out enough data to cause saturation. I settled on capping the game frame rate to 250 (for 240hz screens) and I increased my game's bandwidth limits. I don't know if there's any other way around it
I think seeing that my replication code is simple and has none of the features to optimize like the Character Movement I'm going to experiment with capping the tick rate of the server. The game will have a max of 10 players, at a max
I don't think I'm running into bandwidth limits but I don't have a lot of experience with this yet to judge that. I'm currently comparing net profiling between 240 fps and 120 fps to understand how the improvements come from
3 Standalone clients, left t.maxfps 240 right is 120
I don't understand why the lower FPS one is more stable even though I can see that the RPC count is nearly the same and packet sizes got a tiny bit bigger ๐ค
This stopped working randomly.
Its just a button to join off of an ip but it doesnt join, it fails. i have a server browser that works but this doesn't.
The ip is saved, its just the joining part that fails
Quick question about blueprint networking. How can I check if a session has expired or not? (After FindSession and before JoinSession) because session result won't dynamically update
@wicked brook The SmoothSync plugin would work great for making the moving platform itself move smoothly, but the character is the problem here. Replacing CharacterMovementComponent's replication with smoothSync would cause other problems
on a listen server, is this how one would run a function only on the client? its just a trace for UI stuff, server doesnt need to know it
its on the player controller if that one node didnt make that obvious o_O
guys is really the linux dedicated game server will be cheap consernant the host cost compared by the windows dedicated game server?
@steady briar everything that isn't replicated is only run on the client so just make a custom even and dont replicate it
Hey, I have this issue where the client doesn't know how to handle position of another player (Host) on a moving vehicle (Boat). I have the boat on Pre-Physics and then Player Characters as Post Physics currently. On land the positions and rotations all work normally as expected. Any idea where I should begun looking at this issue? The Host sees everything fine, but that's pretty much expected
@nimble patrol I'm working on something similar, it is not an easy problem to solve ๐
@nimble patrol : when the boat moving your client character shake like that?
No, the client/host are both fine standing on the boat, but the clients see other players shaking like that when standing on the boat.
ah ok so something with the replication i think not ok..when on the boat the characters standing just or walking around too?
and the boat is replicated?
for me i have a car not boat but i don't have your issue when players use it so i will try to help you by looking to my reference
when on the boat the characters standing just or walking around too?
Just standing, though all players are able to walk around the boat without issues, it's only the visual representation of other players that looks wrong. The Boat is replicated yes
you have command for players standing on top of the boat or just simply jump to it?
Yea just jumping on it or spawning on it currently
you try turn off the movement of the boat and see if still the players shake like that?
the movement of the boat i mean the vibration
if that fix the issue so you have problem possible with the physics movement replication
That prevents the shaking of the characters. So its def. tied to the movement of the ship
replicate movement cheked and you call the event on server?
@nimble patrol last time i saw that kind of jitter client and server did not have the same movement mode in CMC
Yea I'm going to do a pass on all my replication settings, I think my issue is that my boat isn't being replicated properly at the moment
that isn't in replication settings tho
this looks like one is using navmeshwalking and other physicswalking
result being the 30 or so units on Z axis difference in what they see as resting position
ergo, the vertical jitter
They are both using the exact same Player Character, Since this isn't AI controlled wouldn't it always be using Physics walking?
There is a thing about moving platforms auto moving characters iirc
The character is considered moving if the platform does. Last I knew anyway.
Zlo is probably way more experienced here but.
How do I call a Variable from client to dedicated server, I have the variable inside of game instance and then the GameMode calling it to set it, When I do Open Level and it loads everything into my database correctly including the right GameMode. but once the dedicated server is involved it just set it to the default value of the Variable
It works on sending the variable if I click listen server and then open the map directly without the IP travel. But once I do an IP travel it just sends a 0 to my database
any reason why a client on a listen server isnt able to do an interface message to an actor, but the server's character can?
it can just fine
but your interface does nothing in simulation
so you need to send an RPC that calls the interface
even if its just for UI stuff?
just trying to make a widget turn on and off, but it seems to be ineffective on the client
no RPC for UI stuff, you just made a mistake somewhere
The first image works, the seconds doesn't, the Pitch of the Transform for some reason doesn't replicate when playing on dedicated server, when playing on listen server it replicates fine.
This is used for the aim offset
Hey guys, i have an issue with Joining a server in the editor. it can join off search result but it can't join off Open (IP) command. anyone know what i mean?
Games are joinable through search results in the Advanced sessions. But a simple console command like Open 127.0.0.1 Wont work.
Also when packaged the game crashes when trying to host a game.
Following solutions online just corrupted my project. i spent 4 days in 8-12 hour sessions.
Time to kill myself.
u didnt back anything up?
most ppl here have been dead inside for years
i have a version that has very minimal changes.
i just can't connect to anything for shit.
everything is fine in the editor, but not in the packaged game.
when switching to the advanced nodes it CRASHES the packaged game when starting a hosted game.
ive only gottan LAN multiplayer to work =/
people said to create a C++ object class and name it something random and it would solve it, when doing that it BROKE the fucking project
all i want is for online to work for my friends. i dont know what im doing wrong and getting someone to help me is impossible.
i spend way to much time for everything to just die.
functions randomly stop working, packages versions of the game act differently.
its all just so random with no clear path to understanding.
ive spent a few days trying to figure something out and no luck whatsoever. it happens o_O
thats why theres 2 types of games. shittily put together copy/paste template games or games that take absolutely forever to come out, even when u saw seemingly good gameplay for it years ago.
Did you try to join without having to package by adding command line to your uproject? It could maybe help to test what is wrong
You just have to create batch file
For gameplay programmers writing C++ code.
This methods concerns dedicated server
I didn't work so much with listen/hosted server
can I use the CMC RequestPathMove / RequestDirectMove on server, instead of the normal client predicted flow?
in multiplayer, on a Character that is possessed by a client and has "Autonomous Proxy" net role
in some cases, i want to skip prediction and just do some server-controlled movement. specifically, for pathfinding to a target in range (so root motion isn't useful)
maybe i should just be using the Pawn instead of Character?
i was able to get some movement working by disabling acceleration, but on the client it just looks like repeated server corrections, its not smooth at all. perhaps i am really just abusing the CMC at this point but I would love to have the option to predict movement sometimes, just not all the time.
isn't it & to separate args?
Is it normal for "on post login" to run before "begin play" on the game mode on the host in a listen server?
@shrewd tinsel it's formatted as ?Key=Value
I was just surprised. I thought begin play should run first as I thought the level is created before a player controller can be spawned.
The match doesn't start until at least one player is present by default
BeginPlay() is only called if the GameMode has called "Start Match"
Honestly not sure about that. I delayed start in multiple projects and I think I often had BeginPlay calls happening
Oh sorry it's Start Play not Start Match
Ah
Hi guys, do you guys know why a session find attempt with steam could say Server failed to respond ? i have tried on 2 different PC on the same network and on different networks.
how do i show widget right after player logs on to server? right now it only works if i put a delay node
Hiya everyone, After packaging my project the multiplayer stopped working. i'm using advanced sessions and steam plugins, the package doesn't even use steam but the editor standalone does use steam. any ideas? even just something to look into because im dead in the water at this point.
im asking player controller to show widget from gamemode
on player log on
@swift cargo what exactly doesnt work
Joining a hosted sever that is on listen.
it works in editor. but not in the packaged gme.
standalone?
standalone option in the play of the editor.
project settings
yeas
sometimes i had to re-add it somehow
``
[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
[OnlineSubsystem]
DefaultPlatformService=Steam
[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480
[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"
``
looks ok
this is the line i added.
tried deleting saved/intermediate etc, regenerating visual cpp files?
joining from an IP console command IN editor stopped working too
how do i regenerate visual cpp files?
where is this located? are you saying just delete saved/intermediate files and regenerating could help it?
i dont have binaries
u can delete these folders but backup maybe
i backed it up
why dont i have the binaries folder in any of my projects?
@shrewd tinsel
cuz its blueprint only on ur project
right
thats not an issue for what im trying to accomplish right?
client server type multiplayer
so generating visual studio files is not for you
??
Ok ill try
its insane how i scripted a blueprint like 4 days ago and it always worked until yesterday.
i changed NOTHING about it.
the most consistent and easiest thing.
when u will find the issue you will say 'oh i see now'
i tried both
my own ip, local host.
the ONLY way for me currently to join games in editor is to use my server browser thing i made.
it finds the game and adds a child widget to a vertical box.
and joins the sessions from a button on it.
@shrewd tinsel Packaging now, deleted saved and intermediate before opening.
@shrewd tinsel after packaging its the exact same issue.
steam doesn't work in package either.
When you press TAB to see player lists during hosting it gets your name, it crashes when you do so.
how do i show widget right after player logs on to server? right now it only works if i put a delay node
@shrewd tinsel was this directed to my question or to another?
Hello,
Is there any command to check the current server tick rate?
it was a question generally, but irrelevant now
i have a question
how come i cant damage the player running on server?
server can deal damage, but clients cant
im running ReceiveDamageOnServer on the servers version of the pawn right?
is it a ownership issue?
When you set up an OnRep function like so void OnRep_CurrentHealth(float PreviousCurrentHealth); when you manually call that OnRep function elsewhere for the Server to call it for example, it still expects an argument
How do you get that previous value to pass in? It does it automatically for clients if you aren't calling the OnRep function yourself
Might just be easier to store a local value elsewhere rather than needing to store a sever only previous local value to pass in whenever calling the OnRep function on the server
any guide on creating a p2p based network game? i want to create a co-op game and one of the players will be the host for the session. i've followed the network series using steam but thats not what i intend to do
one of the players will be the host
then its not p2p
just sayin cuz u wont find the correct documentation if you try searching for that
oh, i see. so that would mean that the game has a dedicated server, and that server happens to be 1 of the players, right?
yeah but when one player is the server its called Listen server
p2p is when no one is actually a server
this is my first time doing anything multiplayer so everything is kinda new to me
i've read a bit and i think i'll try to set up a listen server. do you have anything that might help me in any way? or just a general tip?
appreciate the help btw
Hello everyone, I have a question regarding movement I hope someone can help me with. I am working on movement like climbing. I put the character into Flying mode. As they move along the surface, I am calling MoveUpdatedComponent(...) on the MoveComponent to adjust their position and change their rotation. At the end when they climb up, I play a networked root motion montage, and then set the characters rotation to 0 out Roll and Pitch. What seems to happen is this works, then the next frame the client gets the server network message and puts the rotation back to what it was (because it received it from the server it seems).
Wondering, is there a better way to handle this type of movement? Would implementing this into FSavedMoves make more sense? Any help is appreciated thank you!
Didn't I read in here sometime long ago that if you enable one of the sessions subsystems/use steam that you can no longer direct connect to IP or something weird? (Reading Chase's messages lol
)
Does anyone have experience with custom Literal Session Properties? Im adding a literal string but we're unable to find it / filter by it when using Find Sessions (via Advanced Sessions)
I got my control rotation to replicate to the server. Does anyone know why it does not replicate to other clients?
I would think that clients would be aware of each others control rotation
@small marsh you need to do set actor rotation again after attaching to actor like this:
@long cradle This is the wrong tab to post that, but either way it just means UE4 can't find an asset you are using possibly because you have moved / deleted it / failed to save it
My question :>
We are running into some issues with our virtualized dedicated servers, the problem I am sure is an authentication issue, the server has no access to a steam account, and is not running a steam client, but this means it won't initialize the server API, we are aware of an anonymous sign in method but unsure where and how to implement this with unreal engine 4, any advice would be very helpful!
Itโs okay I was just following a tutorial, I had to reset the computer soon after I posted that anyway cuz half the files on the computer got Thanos snapped
@swift cargo if steam is enabled, then you cant join using raw ip adresses anymore, only through steam id :/
@final thicket do you mind pinging me when you are free? I'm debugging a very similar solution and we might be able to pool together what we have tried
how do i know if steam is working in a packaged project? i dont get the overlay or anything
i can't get it to get an overlay.
if it doesnt show up, try launching through steam
@supple vapor is a packaged game with NO steam be able to have a client server multiplayer?
i dont know if like, its crashing because it can't find a connection and its broke or what
the PIE player in the editor is what i've been using for connecting to people, it works with server browser stuff but not with IP joinging
and the PIE thing doesn't let steam work
im so UNBELEIVABLY LOST
same u sound like me last week
ive been making some progress but its still horrible
best thing u can do is -> search steam in the side bar in this discord channel
you'll find lots of ppl with your exact question and some solutions
trouble is they make some features work but break other features ๐ฉ
i spent so much time on this project and i have no clue where to start.
i just want basic multiplayer with my friends to test the game, to test if i should even keep going.
this is a sign
at this point, i think ive to start messing around with engine code and force it to do what i want
doesnt really seem like there is a complete solution
steam purposefully blocked off a lot of features to force devs to ONLY use steam and not allow cross play
with other platforms
hey guys how i can spawn a character actor only on server and owner client? i dont want to spawn also other clients.
Only Revelant to owner is means that?
@bronze arch oh wow, you're the person who posted the prelogin steam code ๐
im literally using that to solve my incompatible net uiid prob now
ehh well, the reference is correct on the server. but it doesnt work somehow
glads it helped 
by controller i meant to use controller as 'owner'
for the relevant to owner
since controllers are only server and owning client
by default
so technically anything spawned with controller as owner
should only replicate to that client
now i removed that only revelant to owner, still doesnt work what the
still there have 1 lenght mean added one reference to look at character
its set on gamemode default pawn class rn
doing sessions in c++, whats the correct way to add extra settings? as seen in Sessions->Settings
Should you mark essentially every property in the PlayerState as transient or does it not really matter?
UPROPERTY(Replicated, Transient) TotalKills;
I notice in the UT code they don't really do it at all in the PlayerState even though most of these kinds of properties theoretically should be transient
So I guess it doesn't matter if you do it or not really
Just a sanity check question i think i already know the answer to:
If you set a replicated variable in BP but the value is the same, will UE4 replicate those variables out to clients, wasting bandwidth on replicating a var that hasnt changed?
hi I'm wondering how do I setup a player counter on a menu that will affect the actual number of players in game??
@grizzled stirrup only properties that you want to be filled with zero at load time should be marked as transient.
That being said, if the default is zero anywhere then its fine. its mainly just to ensure values set for testing in editor aren't accidentally packaged out as the defaults
@distant talon as far as i'm aware, unreal only replicates a value that has changed. thought it may be sent in hte initial replication packet
@lost juniper GameState->PlayerArray.Num() will get you the total number of players
or Get Game State->Player Array->Length in blueprint
@wise depot Thanks how would I go about setting that value?
you don't set it, its automatically updated
i think i misunderstood what you were asking for
when you say "player counter" what do you mean?
@wise depot Got it thanks! So as good practice even if the default values are 0, for any value that will only be set at runtime such as CurrentScore / CurrentHealth / CurrentUpgrades / RedTeamScore / CurrentTime etc.
It would be a good idea to mark those as Transient ?
not health, unless you want it to start at zero, but current score sure
anything that is transient will become zero when its packaged out and loaded in.
But sets CurrentHealth
ah ok, yeah in that case then that makes sense
Cool thanks I'll do it just as good practice then
So I have a slider on my main menu
I want that value to set the number of players in the game (it's a fighting game).
oh i see, in that case you want to click on the slider in the widget editor and on the details panel on the right hand side right at the bottom should be a abutton called "Value Changed" or something like that with a green button with a + in it, click that and it'll create an event in the event graph for when the slider changes value, you can use this event to then feed the value into whatever you like
So actually i did that step already. I just really don't know what I'm supposed to do now ๐
looking at your names, you want to go
Get Game Mode-> Cast to BP_Battle_GameMode then pull off the little blue pin and use Set Player Count
or number of players or whatever it was called
Something like this?
yeah, then that'll set your value in your game mode to use however you are using it
if you want to update the text you need to set hte text box to be a variable and then call SetText on it inside that same event and se thte text to the value of the slider
you need to cast your GetGameMode to the right game mode
which is BP_Battle_GameMode
instead of "Cast to GameMode"
i would suggest watching some tutorial videos on getting started with unreal and blueprints, also some on unreals multiplayer
Ok thanks any recommendations?
not really but there are plenty out there on youtube
https://www.youtube.com/results?search_query=getting+started+unreal+engine+4+blueprints
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
I have a "run on owning client" on my player controller that isn't being run on the owning client. Scenario:
While testing, I need the player controller to set a "player name" string variable on begin play for that player. Later I'll be building a parser system to pass this information on as part of the Join "?options" later on. For testing purposes now though, I just need it to give up a name so I have something to look at on some menus.
The problem is when the game mode builds the player card after the player joins, begin play has not run on the player controller and the string isn't set. My idea was to have the game mode make a call to the player controller and force it to set the name so that's it's available. The Player controller has an RPC that sets the string in the player state, replicated. That part is no problem it works fine, it's just delayed.
However, when the server makes the call to the player controller and has a "run on owning client", it's not really running on the owning client. It's still reporting the controller as the hosts controller, and not the clients controller.
however, immediately after this I have an "is server" and that Is server is reporting "true" when it should be returning false as it should be running on the client's controller
The call to the controller is being made from the "onpost login" and pulled off the controller variable there. There is no confusion that this is the client's controller. The host is well logged in and setup at that point
I've put in a breakpoint and it's attempting to make this call on controller_c_1 which is the client's controller so it is attempting to call this on the correct controller.
The only thing that works, which is really hacky, is to add a looping .1 second delay before creating the player card. Check the player's name length and if's not greater than 0, loop 0.1 second and check it again. There is a slight delay until the player controller sets the name in the player state, but once it does, it creates the card with a name. Oddly the server seems to get the card right away, but on the client's side (this is a MP waiting area where connected players can gather and push "ready" before starting) there was a noticeable delay before the card showed up.
Anyone know how to change steam ports or even disable the steam networking?
I know you can do
[URL] Port:7777
But it changes it on my server too, I need at least separated ports away from the same port or just disable steam networking.
I disabled the SteamNetDriver but then I will end up just getting a Net Driver error
for a player controller, if i do "Is Local Player Controller" and branch off true and run a function, should that work the same for clients and the host/server?
@steady briar Yes, as far as I know that will only run once on the player who owns that controller
its odd because i get different results on the host/server vs clients. hmm...
start with print statements and break points see what its' reporting\
it works the same except it simple does not do interface messages
it executes stuff after them, but the interface functions never print so i dont think theyre running at all
Remember if it's running on your client, it's not making server calls
does interface have to be run on server? and either way, if it works for the host then its obviously not filtering out the server correctly
if you're doing a listen server, your host is the server
yes i know...
it's hard to know, but likely yes, your interfaces would need to run on the server if they're supposed to be setting values or doing things that need to be replicated or seen by others.
just making a widget visible or hidden for the person looking at it. shouldnt require the server
and either way, if im using Is Local Player Controller, even on the host shouldnt that just be local?
In that case, no. It should not need to be replicated or run through the server.
that's the hosts copy of the player controller yes.
so im just not sure why it works for the host but not other clients
if its filtering out the server anyway, host should be the same as a client
is this running on begin play or what?
no
How are you calling this event?
ive tried numerous ways. i was doing BeginPlay -> then branch off of Is Local Player Controller and set a timer that looped the function
ive also just set it to keyboard buttons with the same result
if you run on begin play and use "local controller" then the code that follows should run only on the local player controller. Add a print statement immediately after it and see what happens
ive put prints everywhere but what do u mean immediately after it
after i set the timer or immediately after the local controller branch or immediately after the button press function
the function returns a value on host and client just fine
it just doesnt call the interface on the client
like this.
Make sure you're only seeing a print on the clients
and the host isn't also printing for each controller
If something isn't working, start at the beginning and make sure everything is behaving as expected at each step
if i only set it to 1 player it says Hello. if i set it to 2, i get 2 Hello and 1 Bye
and who does it say is printing each statement?
server is hello and bye, client is hello
but if its just the 1 player, server says hello
ah yes, if I recall begin play doesn't inherently run on client actors.
I do remember having a similar issue on another project, I'll see if I can remember which it was and how I solved it
https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/78074-event-begin-play-and-multiplayer check that thread in the meantime it has some information on it
Build powerful visual scripts without code.
well if i use an input it doesnt seem to work either. everything off of beginplay "works", like the timer does start and fires the function every loop and it does get a result... it just isnt running the interface messages inside the function (or outside but i moved them cuz it didnt work anyway)
hey guys i wanna ask how do u guys usually do ping system where it shows your ping?
rn im looking at this https://github.com/DescendentStudios/PingPlugin as a solution but im not so sure
Where exactly do I find the game session? I'm using the advanced session plugin. It just creates a session, there is no reference to it. It looks like AGameSession has some built in features, like "kick player", but I can't figure out how to get a reference to it to cast to it.
when spinning up a dedicated server the only port i should have to forward is 7777 tcp/udp right?
nah just one
can connect fine locally but friend outside of network has issues, just double checking my firewall rules
Then yea you should be fine opening that port you could even change the port if you wanted inside of the engine file
[URL]
Port=8474
perfect, thank you!
If you are wanting to open multiple servers, Aka server instances you would want to range the ports say 7777:8000 it will open all the ports in that range (On your router)
oh interesting, good to know
๐
Is it possible to host a server on my machine then have someone connect remotely via the cmd? I'm assuming all that's required for that is both players/connectee's having a built version of the project (and the IP, port etc)
(in the same way you'd connect on a lan network, except using external ips)
@queen quiver Yes thats typically all you need.
Your Router may need to port forward 7777
Thank you Matt, that is much appreciated ๐
When client tries to executes "run on server" replication on custom event it doesn't execute
They probably don't own the actor you're calling it on.
@karmic briar you can get ping from the Player State
@somber glade GameSession is stored in the Game Mode
@chrome bay Thanks, I had to use c++ to get it, it's not retrievable via blueprint in any useful way
How do you authenticate a steam dedicated server?
Without just downloading steam and logging on?
has anybody else experienced massive vehicle movement jitter when applying steer? forward/backward movement is always fluent, but steering requires cranking up net update freq to very large values
when I change the owner (owning connection) of an actor on the server to some client, is that client now automatically able to call client->server RPCs?
it is
if the top owner is that client's PC
@dry turret search the discord conversations for it, i remember an example being posted
thanks @winged badger
Modifying the character rotation has a different outcome on the client than the server
I call this code from an anim notify. It is supposed to rotate the character. It works on the server, turning the player 90 degrees. But on the client, it only turns the player around 45 degrees
Unchecking replicate movement fixes the problem. However, I need replicate movement enabled
GetCharacterMovement()->FlushServerMoves(); before setting the actor rotation also fixes the issue on the client but causes the rotation to not happen on the server
It looks to me like the server rotation is trying to override the clients. Is there a way around this?
I would just not rotate the character
rotate the mesh instead
Rotating the actual character via an anim notify is never going to work well with networking
And yes the server rotation does override the clients' rotation, it does that each time you get a network update.
Interesting. I'l give rotating the mesh a shot and see what happens
@chrome bay I just implemented that. The issue now is that the server straight up doesn't rotate CLIENT characters when replicate movement is on. However, the client rotates perfectly fine and the server's character rotates fine on the client
I'm not really sure what you're trying to do tbh, but if you need to rotate the mesh, do it locally only
I am making a turn in place system
The Server won't rotate the mesh, it only replicates movement for the capsule.
So if you want to rotate the mesh relative to the capsule you need to handle it locally
It also gets more complicated because the character movement system smooths the mesh itself too.
Also, animations won't stay in sync between server and clients anyway, so it'll probably look weird if the Server tries to do it
i am having trouble connecting to a unreal server via LAN. works fine with an old galaxy s7, but my pixel can't join or host a session. any ideas what could be the problem?
@chrome bay Is there any way to replicate control rotation without replicate movement ticked?
I always have performance problems using RPCs. Although, I could do it if necessary
@lucid vault ControllerRotation? You can simply use a replicated variable, probably best unreliable and use that
I ended up just using replicate movement but I created my own replicated CharacteRrotation variable that get's set via RPC unreliable. This keeps the turn in place system in sync @chrome bay
And in tick I just set actor rotation to CharacterRotation
@lucid vault don't use Advanced Locomotions TIP
(that is what i think that is, looks familiar)
idea behind TIP is to always allow the capsule to rotate, but counter rotate the root bone in the animation BP. basically, capsule rotates normally, but the mesh is counter rotated to stay straight, till X distance passes, then you bring the root bone back into alignment.
I am just starting to test multiplayer with my friend, however I am running on linux and he's running on windows.
When we build we have issues connecting, and I noticed this warning:
LogPlayLevel: Warning: [2020.06.23-15.11.23:592][502]LogOnlineSession: Warning: STEAM: Removed incompatible build: ServerBuildUniqueId = 0x00c89141, GetBuildUniqueId() = 0x00000000
Is this because I am building on linx and he's building his version on windows?
Do we need to build on a single machine and somehow use Unreal's redistribution system?
(Or is this just an error somewhere else in the project)
builds have to match
ie they have to be built on the same pc with the same compiler
should be, i saw guides somewhere for building linux on windows
not sure linux to windows tho
Cool, thanks again]
@meager spade It is ALS 3. I simply converted it to c++ and removed a lot of the unnecessary net code. I have seen that same style of TIP that you have talked about. I might give that a shot if I run into more issues with my current set up
@lucid vault does ALS3 work on 4.25?
Yep
Is your TIP accurately replicated?
its the same way TIP works on Fortnite
and most games
ofc it is ๐
would not have mentioned it otherwise
Lol true
Plan for multiplayer early
If there is a possibility that your project might need multiplayer features at any time, you should build all of your gameplay with multiplayer in mind from the start of the project.
Setting up networked games for multiplayer.
Just start development on a dedicated serer with a single player
Also @meager spade That looks pretty good
Hey guys, so I've been trying to overwrite GetBaseAimRotation() to include replicating the pawn's yaw value. I basically replicated the steps used for RemoteViewPitch, but the yaw doesn't replicate. So what's the best way to replicate yaw for aim offsets?
Hey guys I'm trying to repicate a 3D widget, I read a forum thread where they advice to use single process, and I had a question about that, what does single process mean and how does affect things in multiplayer ?
Apparently rep notifies can get called before begin play
problem is I use begin play to initialize references to other actors
what's the best function I can use where other actors will be valid, but is guaranteed to be called before any replication notifications?
@lucid vault hey just wondering what is the pros/cons of switching to ALS3 (from 4)?
Do I just lose mantling (but get networking out of the box)
@wheat magnet yes, i do set actor rotation again, but but I come across some kind of lag. I set the rotation, but after 0.5 seconds it becomes in the wrong position. I think this is due to attachemnts replication
@gilded vapor I'm not too familiar with ALS 4. I decided to with 3 simply because it was already working replicated. I'm sure that ALS 4 is a better system, although I'm not sure about it's current replication state
ALS4 Doesn't have any support for replication, though there are forks of it that added support for it
My other issue is that adding overlays/new states seems kinda tedious (you have to add a bunch of things for a single state)
Is als3 still just as difficult?
I'm pretty sure ALS 4 has a much better system for overlays
Are the blueprint nodes 'create session' and 'join session' supposed to work such that I can hand off my (packaged) project to a friend, run the same project and they should be able to connect to a session I'm hosting?
(with no additional setup outside of the game)
can you expand on discovery? I'm aware of port forwarding but I'm not exactly sure how these nodes are supposed to work in terms of identifying the hosted server
Mm, fair. Is there a node, or set of nodes I could use to allow users to enter an IP address to connect to?
Yeah, I was hoping those nodes represented that some sort of 'default' subsystem that already existed in the engine but I guess that was just wishful thinking :\
Awesome, will do. Thank you very much for that. If all else fails I've gotten connecting via cmd to work quite well so I can use that for testing purposes, but yeah. Dreading learning about what I might have to use for shipping a real game with multiplayer ๐
Woah! There's an execute console command node! That's actually great. Thanks again Lorash ^.^
Hello, thanks in advance if you read and answer this! I am looking to hide the healthbars and nameplates for enemies that are not in my line of sight
but I can't find any information on how to do it, can anyone help?
Hey, I need some help with websockets. In constructor my own class inherited by AActor I have:
webSocketModule = &FWebSocketsModule::Get();```
Why in BeginPlay *webSocketModule* is nullptr?
```TSharedRef<IWebSocket> iWebSocket = webSocketModule->CreateWebSocket("ws//localhost:8080");
webSocket = &iWebSocket.Get();
webSocket->Connect();
webSocket->Send("Hello from ue4");```
@short temple Not really a multiplayer question but you can either maybe use the EQS or have a sphere collider that adds characters to an array on overlap and line trace to all the characters in range on a timer.
Greetings, can anyone explain how possess works?
I need a possess event on client. Found a solution where user suggest to override Restart. But i dont understand how it work on client if no possession happens?
@dawn summit in your controller you can override 'Acknowledge Possession'
this is called client-side when controller successfully possesses pawn
thank you
What dedicated server solutions should I be looking into for UE4 for potential use in my projects?
Currently I'm intending to look into: Steamworks SDK, Amazon (can't remember they name but saw it recommended), OpenWorld Server.
I'm wondering if Epic Games has their own that in some way may be required for publishing on the epic games store, or if there are any others that integrate well with UE4
(Also mostly looking for persistent connections that are easy to integrate databases into or have their own in-built database systems, as of right now)
@supple vapor hm...
/** Returns true if input should be frozen (whether UnFreeze timer is active) */
virtual void AcknowledgePossession(class APawn* P);
but it returns void...Epic
when calling multicast RPCs, will UE4 use AActor::IsNetRelevantFor() when choosing who to network to, or will it forcefully send the multicast RPC out to everyone?
Unreliable doesn't care for relevancy iirc
or the other way round
but one of them doesn't
unreliable RPCs dont but reliable RPCs do or vice versa? why would there be a difference as far as actor relevancy goes? 
my client portal works but as soon as i enter it snaps back to where i tried entering it
on my server its portals works fine
@dawn summit you can make a 'BlueprintImplementable' event that gets called inside acknowledge possession
then in bp, implement the event
i do all my widget work like this ๐
yep, i just found that like 5 minutes ago =)))
Does anyone know how to disable replicate movement during runtime on character?
Doing so causes the player to move rapidly fast for some reason
I call a server function that disables ReplicateMovement and I also disable it on the client. Then the player shoots off at 5x his speed
So I found my problem it's the error check that corrects my position
how would i go about correcting this
how do i allow the position is be altered
I can uncheck error correction but then my client goes out of sync
Figured it out just need to make a rpc for the client to set location
(server data)
does anyone know how to turn off/increase the network timeout period if debugging a client?
Hello all!
Could someone tell me when it's best to use RPC and when to use OnRep?
Which would be the best practices?
Thanks! ๐
Can anyone please explain me how to make Party System? I am using amazon aws for matchmaking
@cursive mortar RPCs are usually for one-off messages or when order matters, while OnRep() is when values change a lot and the only state that matters is the latest one
also OnRep / Variable rep make it so a late joiner will have the correct state. If you "sync" a part of the world state through a RPC, it will be a problem for a late joiner or disconnection/reconnection
@twin juniper Thanks a lot! ๐ For movement replication, should I use OnRep()?
Currently I use AddMovementInput(LocationDeltaToMove); When I use Dedicated Server, with Separate Processes, everything is fine in the Editor. When I launch separate server externally, and connect with a client, the movement is jitterish and I also get "CreateSavedMove: Hit limit of 96 saved moves (timing out or very bad ping?)"
@glad wharf Thank you a lot! ๐
For now, all the effects work correctly, attacking and rotation are replicated instantly and smooth, but I can not get the movement component to work.
PS: I am using the standard MCM
is it a bad idea to have a replicated property that gets updated every frame in Tick? If the property is constantly changing, does this mean that the engine will send a network update every frame?
do i need to forward ports for my session to be found?
@shrewd tinsel if it's hosted on a computer behind a router yes
@versed bear It will try to send an update every network frame for that object yes
At the same time though, updating replicated properties every tick makes little sense because tick rate is variable, and clients won't receive them all anyway
Heya! I noticed server world time seconds isn't predicted, so it only updates on replication, which again isn't very precise
to predict it, would it be enough to add the latency on its replication and delta time on tick?
It's pretty inaccurate anyway tbh, but in theory yeah, you can add your ping * 0.5 to it.
But that assumes ping is the same in both directions though too.
Which it probs isn't, when you account for processing time etc.
I didnt think this was the case but it unfortunately turned out to be true that every time you set a variable in BP it is queued for replication even if the variable hasnt changed... Easy test is to set a replicated variable on tick with repnotify and a print. it just goes constantly... kind of annoying waste of bandwidth
strange, I thought the RepNotify behavior was to trigger only on change... (and to be honest, basic replication too)
@cursive mortar for movement it seems like you are already using the character movement component, it uses RPCs
@cursive mortar might be a case of you oversaturating the network with messages, but I'm not sure
or firewall issue
@distant talon That's not the case
The Server will only replicated a variable if it thinks the client has a different value.
Blueprint is stupid, because RepNotify in BP isn't really a RepNotify
It's more of a "this value was modified" callback.
But if you are changing a variable everytick, and the actors' NetUpdateFrequency is 100, then it will try to replicate those changes at 100Hz
But changing replicated vars on tick is silly anyway
There should be very few cases where you need to do that
So it only applies to repnotify in bp?
That makes more sense. thanks... still weird though
I dont have many repnotifies so i can put extra checks on them (in bp)
@twin juniper The thing is that everything else is working correctly except the Movement. I also could connect with external IP, display all effects in real-time, or the rotation of the character. "CreateSavedMove: Hit limit of 96 saved moves (timing out or very bad ping?)" appears only when moving the character through MCM. It never appears when doing anything else. Thanks a lot once again!!! ๐
if i use steam online subsystem, i dont have to forward ports to make a server right?
@cursive mortar not sure why, AddMovementInput() should work just fine, we use it without any problems
@cursive mortar not sure why, AddMovementInput() should work just fine, we use it without any problems
@twin juniper I also can not explain this. I've seen others using it and it is working. It is the only thing I use on the MCM. Maybe a custom MCM would be the anser, to store the steps and clear them, I dunno...
MCM = CharacterMovementComponent?
๐
It is really disturbing that it works so well with 3-4 players in the editor, and not when hosting with the *.bat file
Thank you again for the help! ๐ I will investigate this issue more. ๐ At least I have a lead
RepNotifies in CPP are triggered, but in CPP they actually behave the way they are supposed to
I.e, they are triggered on a client, when it actually receives a server update
To this day I have no idea why Epic made the behaviour different on both ends
Gamemode Pre-login-> If there is an error message, it rejects the login attempt. I assume that that error message gets kicked back to the client somewhere. Does anyone know which function on the client receives that error message?
HandleNetworkError I think, it's a bit lower-level
UGameInstance::HandleNetworkErrorthis one? That's fine. I can work in c++
handle netowrk error just seems to have a "Enetworkfailure"
pre-login uses a string virtual void PreLogin ( const FString & Options, const FString & Address, const FUniqueNetIdRepl & UniqueId, FString & ErrorMessage )
Accept or reject a player attempting to join the server. Fails login if you set the ErrorMessage to a non-empty string. basically I'm working on a ban system for peer to peer multiplayer. The ban works, but the client just gets dumped back to main menu. I'd like to check if it's being dumped for being banned and then display something on the client.
if that errormessage isn't sent back to the client somehow then I'll have to work out another way to notify them
Also is the "FUniqueNetIdRepl" for each player unique every time they restart the game? Using "getnetconnection" you can get the playerID of a connected player, but it looks like that changes, since saving it to a file and loading it on another play through no longer creates a match. But maybe that's only in PIE.
If you use a subsystem then it would be unique per user account
I've seen some people here talking about using FSockets, can anyone explain what kind of usecases do sockets have that you'd need to work with them, where RPCs and replicated properties weren't enough?
E.g. for Steam that would be the SteamID of the user
There are a lot of usecases for it, generally when you don't want to be in the same level as the other to send data.
Maybe you want to send data from an IPad Project to a Windows Project or things like that.
Oh, different world instances communicating with each other?
(2 different projects)
Ohh
Yeah whatever you need. I mean that's just one example
Gotcha, thanks
I am conflicted between sending lots of small RPCs to sending one big RPC every X time
as far as net bandwidth is concerned, it makes sense that sending one big RPC every X time would be easier right?
Since I'd imagine every RPC contains some header information which adds to the packet size
(the differences I'm talking about is: say sending 7 floats each in lots (around 75) packets, to sending say, 7*75 = 525 floats every packet)
i am reading about multiplayer and often times i see people have booleans for either use lan or use internet
what does lan mean in this case?
i know lan means local area network, so does that mean a lan server will only find clients using the same connection?
yes @faint pawn
so if i am trying to debug a multiplayer project on only 1 machine, i should only be searching for lan sessions?
@serene meadow
but sessions that are not in lan can detect connections from the same network
what's the simplest way to create small scale multiplayer?
so that means i dont need to implement lan sessions at all
yes, lan sessions are for example, if you want to limit the connections to ONLY the same connection, but you can use non-lan connections for that anyways
so it really depends if you want that sort of thing
how do I sync the bullet count in a replicated shotgun reload. I am confused
Hello, I have some issues with using JoinSession functionality. Flow goes like this:
1). Client player finds and joins a session, triggers fade out and loading screen widgets;
2). Server player gets the message about new player joining and sees new pawn being spawned;
3). At the same time Client's loading screen is interrupted and he starts seeing the world from newly spawned pawn's camera, although he doesn't have control yet
4). ~5 seconds later Client gets following messages: BeginPlay from the map, BeginPlay from his own pawn, fade in widget kicks in and he gains control.
Problem is number 3, is there any way to avoid that and have loading screen widget playing until client's pawn is fully spawned and controlable by the client? Thanks in advance for any help, I'm really in a pickle with this one.
At the same time though, updating replicated properties every tick makes little sense because tick rate is variable, and clients won't receive them all anyway
@chrome bay hey thanks for the reply. How would you suggest doing it other than in tick? For example I'm trying to make an attack where the longer you hold down a button the bigger the damage multiplier (right now I have the damage multiplier increase inside tick every frame).
Well, damage should all be handled Server-Side - so only the Server needs to know what that value really is.
Clients can just estimate it
I see, that sounds fair enough, thanks. I guess now I need to figure out a good way to estimate it on the other clients.
Do the other clients need to know about that multiplier?
What I would do is just replicate a single bool which determines if they are or aren't "charging". When it updates to true, store the current world time and count up from there.
May need to use a small counter to get it working more reliably, similar to a flash/burst counter for weps
You probably want to tell the server when the player starts charging, but have the client actually send the damage multiplier through. If it's within a given tolerance, accept clients, if not, take the servers' value.
Since it'll feel pretty laggy for the player too otherwise.
MP iz hard
Great suggestions! I'll try implementing it and see if it works for me
Guys, I have a spare computer and I want to use it as a server to run pixel streaming instance of my game and stream online. but the problem is my internet (and mostly any internet in Netherlands) won't allow port forwarding so the ports are closed. any one knows some viable solutions to work around it that is reliable ?
otherwise I have to pay shit loads to AWS
This event, which is ran from server to client. Still goes on server, even if it's client proxy character that should run it
Any clue?
@young jacinth "won't allow port forwarding" wait, are you telling that in Netherlands you can't get Public IP?
@woeful ferry dedicated server?
@dawn summit Listen server
listen server is a client too
I worked it out by doing another run on owning client before running this event
yes
I know
@woeful ferry you know how replication works?
you emit an event, if it's replicated it will be called on other machines as well
but...you call it on this machine
I do know, but I don't think you understand my problem
maybe, it's hard to tell what's going on from a single node
Olsson the owning client of the character is where that will be executed
this node runs on any machine, and only replicated if it runs on server
not the proxy on other clients
This event is ran by the server, and I wanted the last event to fire on the owning client character. Even when the remote character got called to, it was still running on server. It was fixed by putting another owning client event before
Didn't work to directly fire that event on the character, because it still kept running on server
and not the remote character
yes, that's what I was wondering, if it's something like you can't call OC events like I used to
the OC call is getting executed on current class
but the other one, you were trying to call it from the PlayerCharacter
Yes, so that is what I'm wondering. It's a OC call on the player character, shouldn't it fire on the remote character then?
Why do I need another OC?
I wanted to use GameState as the class which holds static data available to all clients. But, proxy clients can't get a reference to it in the first couple seconds after BeginPlay
How can I deal with this? I don't want static data functions and variables to be present in each Controller or Pawn, I want it to be centralized somewhere
@dawn summit At least as far as I've seen in most of the ISPs. It's mostly carrier-grade-nat
which means my public IP is different than the one it says in router's status
@young jacinth i see, that is "gray" ip how it's called here...yep, the only way to host the game for you is to use hole punching service, like steam, or eos (afaik it does it), or host server somewhere else
Is it possible that my PlayerController or PlayerState objects are not successfully removed from GameServer? I'm trying to pass my playerController to the server with an RPC and whenever I try to use the variable I get "Attempted to access BP.... via property PlayerStateServer, but BP.... is pending kill" warning when I try to connect my gameserver for the second time. Is it possible to get old player controller or state with GetPlayerController node?
How can I get the NetGUID of a certain actor
I don't care If I need to get my hands dirty with a little C++
@chrome bay do you know how I can do this?
UNetDriver::GetGUIDForActor
GUID's are unique for every client - just bear that in mind
I know
They may also change periodically as the actor enters/leaves relevancy etc etc.
Hello Unreal Engine people! Me and my team are using Playfab and Azure to host our dedicated servers and we are running into issues in the steam implementation. Is anyone familiar with this problem? Please DM me! I need some professional consultation!
Our questions are. Why would the SDK fail to initialize on a dedicated server? or Why would the UE4 online steam subsystem fail to initialize its steam API?
With a dedicated server, when the game ends, whats the right way to close the connection to the clients without triggering an ENetworkFailure::ConnectionLost?
@sage bone APlayerController::ClientReturnToMainMenuWithTextReason check that function out.
@thin stratus I just did some debug printing and it looks like every time you start PIE with more than 1 player, it generates random digits after the name of the machine. So if your machine is called "office" the ID becomes office-12873129837219837129837 but the next time you restart that string of numbers isn't the same. So I can't really test that ban method in PIE. On the shipping build it'll be based on the steam ID of the player.
Does this errormessage: virtual void PreLogin ( const FString & Options, const FString & Address, const FUniqueNetIdRepl & UniqueId, FString & ErrorMessage ) get passed to virtual void HandleNetworkFailure ( UWorld * World, UNetDriver * NetDriver, ENetworkFailure::Type FailureType, const FString & ErrorString ) if you put an error message in there and reject the connection?
@somber glade Cant remember if its that one specifically.
But it does get passed to an Event in the GameInstance.
Which is potentially that same delegate.
You would have to double check.
It maybe HandleTravelFailure
As i said, cant remember...
I know the blueprint one "event network error" doesn't. It just returns an enum and no string of error message. Thanks, i'll look at those and test them and see if one of them prints the error message
yes the error message gets sent to the client and returned there
What's the option to set split screen?
Follow up question if anyone happens to know, how about the messages from this: virtual bool KickPlayer ( APlayerController * KickedPlayer, const FText & KickReason ) Any idea where that gets passed to? I have a message set as "You have been kicked" And that does not get passed through Handlenetworkfailure. I've got that bound and printing and I'm getting server join failure messages that I've sent for people who have been banned or if the server is full, but not kick and ban messages when they're actually kicked or banned Just Client 2: Connection Error: Your connection to the host has been lost. Type: Connection Lost
based on this print node
why i cant get playerstate on client from bot except the from the first one that was spawned? if i spawn all bots in one for loop, all playerstates are reachable on clients
Well, PlayerStates take time to replicate. You won't get them all immediately.
How are you trying to get them?
i fire projectile, check pawns playerstate and send it to server from attackers playerstate on gamemode
theres plenty of time to get all stuff to replicate
You can't get the GameMode on a client?
The Game Mode is only available to the Server.
show the code
damage works, only for the bot that was first spawned
or if bots were spawned at the same time
It's odd design to involve the player state with damage
Is bWantsPlayerState true in the AI controller class?
yes
And they are spawned by the Server, not spawned by the Client?
And where are you calling that function from?
projectile
The projectile is also spawned by the Server but owned by the client who fired it?
its spawned by the client and only exists on client pc
yeah
So where are you getting the 'Victim' from?
overlapped actor>get playerstate
And is it valid on the client before you send it?
hmm, IDK then. Something else is going wrong somewhere.
thanks for confirming
im at least less lost
how would you spawn a bot in multiplayer game?
just spawn ai from class right?
Just SpawnActor would be enough.
and then make it an AI?
In theory all you need to do is spawn an AI controller, that has bWantsPlayerState checked
maybe its a bug
I doubt it, works fine here
Are you even sure that the overlapped actor is what you think it is?
First get the AI controllers to print out their player state to the screen
Then you can at least know for sure that they don't have one.
i checked again, now 2 of 4 bots didnt have playerstates
its a replication issue i suppose
server spawns them with playerstates
Do they have player states on the Server?
Right so they should be replicating eventually
maybe its like not 'reliable' somewhere
actor replication is definitely reliable
But I still think they just aren't coming through until later.
im so confused as to how to properly use the steam SDK
every guide i find has something conflicting with the other
@chrome bay you're right, it starts replicating after some time
maybe im choking network somehow?
Could be yeah, actors just take a bit of time to rep
You'll only know for sure by using the network profiler
or network insights if you're on 4.25
i am. noice
@twin juniper What you trying to do?
thank you
i just want to start using the steam SDK from the bottom floor with my game, even trying to figure out how to enable it and such is confusing
youre not talking about advanced sessions for steam right?
Yeah the Steam SDK is pretty huge so gotta be specific
If all you want is just networked games through steam, everything you need is wrapped up in the online subsystem bundled in UE4
And the "sessions" stuff.
is the online subsystem stuff accessible in blueprints?
Yep. There's an example project on the Epic Launcher called 'Multiplayer Shootout'
u can get name avatar friends n stuff via bp
Should just be a case of setting up some config vars to have it working with steam.
yeah i've tried setting up some config vars but i don't get any steam presence
did multiplayer shootout use advanced sessions plugin?
tis weird
Nah, Multiplayer Shootout is an Epic template so they don't use third-party stuff.
oh so its not steam
where do i even find the multiplayer shootout template?
Breaking down the Blueprint Multiplayer Showcase and how it was constructed.
Launcher -> Unreal Engine -> Learn
@twin juniper what you trying to do?
a more comprehensive multiplayer sample is ShooterGame, but it's C++ only.
at the current moment i just want to make sure i can line up with steam
weird, can't find multilpayer shootout anywhere
am i just blind? i see nothing with the name or the icon
Huh wtf. They actually removed it
I have no idea why but loads of shit is missing from the launcher
They've removed loads of stuff wtf.
@shrewd tinsel still, i'm stuck on the part of even setting my game up for steam
like uploading it to steam?
nah just getting my project to have a steam presence
access players nickname and stuff?
so i drag both of these inside my plugins folder or what @shrewd tinsel ?
nvm figured it out!
yeah
and then u have a bunch of steam nodes
also u have to put config into defaultengine.ini
like this?
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
[OnlineSubsystem]
DefaultPlatformService=Steam
[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480
[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"```
like, how can i tell if it's working?
Run the game in standalone while Steam is running.
If you get the overlay, it's hooked up
yeah i tried that and nothing came from it
hm
weird weird weird
๐ค
any ideas?
No clue, should be all you need
Just make sure you're running standalone
PIE doesn't work
did you enabled the related OnlineSubsystems plugins?
I'm having an issue with actor replication. I have some "TownActors" placed in my map that within the game state, adds "Units" to them every second. Every town works great except for one. I am setting their owners after the player states PawnPrivate value is set. I can see that the Owner is set for all of the TownActors.
oh in the binaries folder?
Yup so Binaries/Win64 is where I pop mine
Just a txt file named "steam_appid.txt" with the number 480 in it
Yeah that looks right
Oh wait
hm?
not the engine folder, the game folder
Did you add all the stuff above to the defaultengine.ini of your project or the engine? Should all be at project level
project
Yeah that's the right folder
alright will try in a bit, thank ya
np - hopefully it fixes it
I wonder if my issue could be because I'm not calling SetOwner from an RPC?
But is definitely getting called from server.
Just tried it in an RPC, no luck. ๐ฆ
Figured it out! bAlwaysRelevant needed to be true
Hello everyone,
I wanted to use GameState as the class which holds static data available to all clients. But, proxy clients can't get a reference to it in the first couple seconds after BeginPlay, as I want to have certain things initialized in BeingPlay/Possessed whatever, but proxies still don't get GameState fast enough
How can I deal with this? I don't want static data functions and variables to be present in each Controller or Pawn, I want it to be centralized somewhere, so that even Widgets can access it and other classes
ugh still aint working
You're trying to add steam Nathan?
yeah
In packaged or standalone?
i mean right now im just trying to get it to work like in the project
playing standalone isnt working
eeeee
You need the steam subsystem enabled, then add those settings above in the Config/DefaultEngine.ini, then execute in Standalone and have Steam open
i did all of that
You don't get steam executed inside? and no ingame overlay with Shift+Tab?
correctt
And steam is open?
yep
what version are you using? if in 4.25 standalone wont work, you have to go to your .uproject file, right click it and press launch game
1 second
then do what i said there and see if it works
ruh roh
i broke somethin
oh what the
i thought i fixed the redirects
i renamed that level
wack
Interesting, why doesn't steam work in standalone anymore in 4.25?
thank you very much @serene meadow
@twin juniper np
Interesting, why doesn't steam work in standalone anymore in 4.25?
@gusty slate i don't know, i had to wait days until it actually became a thing in the forums and someone say how to get it working
I used to test in Standalone all the time, current project though i always test in packaged so I didn't notice
possible bug?
Maybe it has to do with the new Modules system of UE after 4.24
possible bug?
@twin juniper nope, they would've fixed it in the hotfix
in C++
I feel like doing initialization in BeingPlay or Possess which requires other actors or GameState is not going to work. The game takes time to create all these actors and the character can't access them
Yeah it won't be reliable
You have no idea what order actors will replicate in
I tend to have a static delegate that I broadcast from the GameState BeginPlay() function. Any actor that needs it can check if the game state is currently available, or if not it can bind to that delegate and respond when it is
E.g.:
{
AGameState* GameState = GetWorld()->GetGameState();
if (GameState)
{
Init();
}
else
{
AMyGameState::OnAvailable.AddDynamic(this, &Init);
}
}```
@twin juniper @serene meadow - https://issues.unrealengine.com/issue/UE-92985
That explains it...
how annoying
I think that's the most reliable way of doing it Jambax. Even working with DataTables for static data, I like to have functions and variables to process the data and that has to go somewhere
I don't think it's a bug, but a side-effect of some other change they made
What I mean is - I would definitely consider it a bug, but it looks like it was intentional so I don't know if Epic classes it as one
@chrome bay Where do you usually store static data? For example Character Type -> Name/Icon/etc
I see, I usually like using enums and TMaps, do you not find DataTables constricting in data fetching?
Not at all, depends what you're doing. Enums I personalyl find more restricting because if you want to extend them you have to hop into code
Tables being keyed by FName makes life easy
@chrome bay about the GameState, it will be null on client before replication? I thought it would just be there, but with default values.
@glad wharf nope, will be null
oh that's very good to know, thanks! ๐
Yeah, you can see it in the function description Lnaej
Thanks Jambax, I'll have another look at DataTables
did not know that, that's key information. Seems logical indeed if they are spawned by the server. Thanks again ๐
Enums do offer dropdowns though ๐ ๐ค
well you get a drop-down list if you use the FDataTableRowHandle
is there any way to access the actor currently in charge of replication within my struct's NetSerialize override without keeping the actor reference inside the struct?
negative
Yeah, would be nice if you could, reflection might let you reach the properties owner potentially, but it probably won't be that simple
my interest was sending arbitrary executable structs to abstract network communication
especially useful for client->server communication
the idea was that each of those structs would have a Run() command, and would be enveloped within a handle struct that - as you directed me to FGameplayEffectContext - would treat the data struct polymorphically during serialization
This is a thing I have done
the problem was that I needed SOMETHING to do allocation https://cdn.discordapp.com/attachments/463651604974010368/725481725483941919/unknown.png
The only way I was able to do it, was to send the UScriptStruct* as a member
how many byes is that?
Depends as it will serialize to a NetGUID
so 4?
4 or 8... I think the latter
argh, that is not negligible 
Have a look also at FGameplayAbilityTargetDataHandle::NetSerialize()
what do they do there?
Very similar to what you want to do, but they have a special global class that adds the UScriptStruct* type to a global manager, which then maps it to a byte
So there is an upper limit on how many data types you can send, but after initial serialization they are smaller.
neat, I was thinking of doing that, but somehow I found it would be just, more straight forward to skip polymorphism entirely
which as a very unfortunate consequence means code duplication
yeah, polymorphism is UE networking's worst nightmare
do you still think that a lot of small RPC packets is generally better than one large RPC packet, as far as bandwidth is considered?
Hmm not sure. I mean UE is geared more towards sending small packets often
rather than huge chunks of data
what makes it geared towards that?
well there are hard limitations for example, TArray has a maximum network serialization size, so there's always an upper cap
hmmm
reliable RPC's also block all execution of subsequent reliables' until they are received
but on the flipside, unreliable is unreliable.
just have to pick your poison
Trouble is you can make something super-generic but it's nearly always suffers in performance as a result. Sometimes it's just easier to specialise
yeah, generifying vs specializing was my last 14 days' last dilemma
Not that i listen to my own advice, this is the latest result of the most over-engineered chat system in history:
noice
But yeah probably performant enough for chat, but not something more critical
i think im defaulting to specializing, and copy pasting code
it also feels easier to write, however less to manage
but hey, if its REALLY REALLY good code, I may not need to manage it all that much! :D:
I did that for my vehicle movement. Just create some base types with the core functionality, then let the specific types override what they need
tbh if you're sticking purely to CPP, it's a lot easier
It's when you want to try and expose stuff to BP in a friendly way where the real chaos sinks in