#multiplayer
1 messages Β· Page 453 of 1
The general premise is that if you own the actor and call a server RPC, it should go through
how do i make it so that it doesn't auto posses pawns when entering a level
If the pawn is in the world already there's an option to disable auto possession, otherwise there are options in the pawn BP
OR you can just not spawn a pawn by default (have the pawn to spawn in the GM as null)
Then manually spawn and possess one
ah ok
Question: it seems that bug that makes client movement appear choppy when being viewed from the perspective of the server on a listen server is still quite prevalent. The only way I was able to get it to run smoothly from all perspectives is send an RPC with a single location vector and rotator 100 times a second.
For a 2 player co-op game with not a whole lot more going on, is this in any way a reasonable thing to do? When I send an RPC say 10 times a second and smoothly interp, it is still choppy from the perspective of the server (even though in a dedicated server it's not)
Is it still a trivial amount of data being sent compared to games with hundreds of bullets, rockets and projectiles with larger player counts?
This is the bug in question: https://issues.unrealengine.com/issue/UE-32005
Can't you just get the frame rate and only send it that often? And cap it at 100 if it's higher?
that could reduce lag of already laggy players, and if you have 100+ fram rate it shouldn't be a problem
Yeah that is possible it's just frustrating that it works fine at lower update rates on dedicated server
Found this though: https://www.reddit.com/r/unrealengine/comments/a0n455/listen_server_host_sees_clients_jittering_fix/
8 votes and 3 comments so far on Reddit
Is it common to increase the bandwidth limits in general for a listen server game?
@grizzled stirrup still broken and was reported by others Epic didn't moved a finger
as they don't use Listen servers
is a problem related only with the pawns but nobody found a solution I think
with the character movement component
That reddit post has an interesting bool in the character that can be set to false
it might be difficult to properly fix the issue with the default char movement chopping on listen servers
I'm going to check it ot
out*
I'm not even using the CMC to replicate though
Just to move locally
then it's an unrelated issue
So only when Replicate Movement = true is it an issue?
It's strange though because when playing dedicated server it's smooth
tell me if you find a solition then
replication doesn't affect what the listen server sees
I will!
@fleet raven It appears to limit the anim update rate as well as position
Even though I'm setting position on tick
Interpolating between updates
It's percieved to a player that the other players are lagging or running at a low fps
Even though they see the server silky smooth
wait so are you using a character at all or is it something entirely custom
Yeah character
I'm just having the client be authorative over movement and therefore sending his own movement upadates
So I want others to smoothly blend his position
makes sense
Instead, they see a very choppy update unless it's a dedicated server
So something to do with the listen server is causing some kind of lag / jitter
what exactly is the setup here, how are you sending the movement from the client to the server and then to other clients?
are you seeing choppy movement when playing as the listen server or when observing another client as a client
The clients are sending an RPC (what should be only 10 times a second) that contains position and rotation. The server then sets its proxy of each client to interpolate towards that position / rotation on tick
And I'm only seeing choppy movement when a client looks at another client or a server looks at a client
Clients see server smooth as butter
If I increase the RPC amount (location update rate) then it's smooth all around
But I really don't think 100 rpcs as second is a good idea
Though it might just work since it's only 2 player co - op
And I'm sure there's bandwidth to spare compared to other games that have 1000x more going on
I'm not sure what causes your issue but sending 100 (unreliable) rpcs is no issue at all with 2 players
Oh phew
Yeah definitely unreliable
It just needs to appear not laggy
It's very distracting to see players glitch around
I think even 50 RPCs a second can still look smooth
Thank you very much, I feel a bit more reassured that it's ok in this specific case to go a bit wild with RPCs
though
if you have 2 players and are using a listen server
a "client looking at another client" situation is not even a thing
Well I'm testing for 4, but yeah just wanted to include that detail when troubleshooting
I might move to 4 if the 100 RPC thing isn't an issue
Will profile bandwidth and learn some good limits
there isn't really a general "good limit", it depends on the connections your players have
Yeah which means I'd have to target the lower end to ensure everyone can play- basically a number that most connections would support
some will have absolute garbage 0.1mbit/s, while some will have no problem barraging the server with 1gbit/s upload
I just have to profile how much exactly my 100 RPCs a second are adding in terms of bandwidth and scale appropriately
Just out of curiosity, how many RPCs a second would a game like Fortnite or Unreal Tournament typically send per player to the server?
Very ballpark but those games position actually matters (and of course it's dedicated)
don't know, but UT is available on github, so you could look at what bandwidth limits they have set
Thanks I'll check it
Appreciate the help, feeling confident that at least I can sidestep the choppy movement issue
2 rules: does the player feel it's smooth and does it work without oversaturation? If so then it's fine (bad practices allowed in this case) π
Can someone please explain why this logic is not working? Steam overlay appears but I can't join session on the other PC with different steam account.
when opening the level
use the Run command node
and do open levelName?listen
see if that makes any difference
I've had problems with the open level node in the past
or that's actually probably not your problem
so what error do you get?
the screen on the joining PC just gets black and nothing happens
try what I said
ok thx
Good monring! I was wondering, how a client can leave a session to play in local?
Go back to the MainMenu and Destroy your session.
Pretty sure not without modifying the engine
I mean
Technically you could just cut off the connection
But the game usually kicks you back into the main menu then
yeah that's not a thing by default
you'd be missing a lot of things like the game mode required to continue playing by yourself
make sense
thanks !
what is weird, is that when I move the client to the main menu, it carries all the stuff from the lobby, like characters, controllers, etc...
nd the server does not destroy de placyer controler
no no, my error I think, sorry
I checked with βget server nameβ it finds the right session, however nothing happens afterwards
do you get the session succes message you set up?
also, what OnlineSubsystem default platform are you set to? It needs to be set to steam
It is
The message on successfully joining session is set but does not appear on screen
im trying to change the material on a mesh of a character blueprint from the GameMode on the server. Im doing it through a multicast event in the GameMode but it is not changing the visible material. The characters are registering that they have that material on but it cannot be seen.
how would you do this? Change a character's mesh material from GameMode
You'll want the call the material changing function on the client, not on the server
so call a run on client event from the gamemode?
should work
You need a reference to the actor and call a function on the actor that is rep to all clients.
Won't work - gamemode doesn't exist on clients
And the client doesn't own it either
You can call it on the character however, from said gamemode
see last comment
i tried calling a multicast function on the character and that didnt work
Why would you not just set a rep'd var on the character BTW
And change the material via that?
Good call
Multicast / RPC is all well and good until somebody joins late, or until an actor isn't relevant anymore
Setting a characters material is stateful, so should really be driven by a rep'd var
RPC's are for one-time things
what kind of variable, a material interface?
I assume there's a fixed list of materials they can use, so just an int/byte would be enough to identify one
yep that's the way!
I have a problem where client 2 doesnt call a function on the server at all and only calls it when it is client 1. Anyone sure why?
best guess, because you're using GetPlayerController[0] in combination with a dedicated server
for what it's worth, I almost never use RPCs
especially multicast RPCs
only for things I am comfortable if they are lost (like one off vfx events)
i just never use reliable multicasts
Hi so anyone here have develop mmo style server architecture
I wanna know more bout it i already no bout tcp and udp
Is there more for it
I wont use spatialos since it havent been updated yet since fwbruary
I know its a good tools but many people that i know doesnt recommend it
but in general, MMO recommendations around here go like: if you're not a large studio - just don't
I have a team on 10 people atm and we use mmo starter kit
We already done the environment (60%) in just 5 months
And currently we doesnt have networking programmer/engineer
that is more then very problematic
basically, doing networking after the fact is awful
and if you start improvising network, at one point when you hire a network engineer he/she will have to rewrite everything you did
Hmm we just in early dev
Hmm this is gonna be a major problem tho
But do anyone know how the server achitecture build
I did both of those things in the past - networking a non-networked game and networking a game that was networked by BP programmers with only casual familiarity with unreal networking
Currently we only do gameplay stuff
and neither was pretty
I wanna ask if this approach is okay
Can i use ue4 for the graphical fedelity of it and hire a networking progranmer for the networking
Or i for now use the ue4 now
unreal replication system is pretty solid
so what you need imo is a network engineer familiar with unreal networking
i did not work on projects with MMO scope though
Ouh so far we havent done any networking stuff and only gameplay for now
it is a multiplayer game, you won't get far with gameplay without networking it ^^
Yeah i know and wendo some replicated stuff here and there but things getting hard recently since we dont have any networking programmer
That's why i asked here how the mmo server architecture developed to maybe solve some of the problem and get better understanding of it
iirc SpatialOS is pretty solid for something of that scope, but i have no personal experience with SpatialOS
its major feature is using unreal networking across multiple dedicated servers
I did know that
unfortunately, i don't recall anyone talking about a serious MMO project here
in last... 2 years
Unfortunately if anyone asked questions bout mmo they always immediately shot down
Thats why we see less and less questions of it
To be fair, most of those were "Hi i started learning Unreal in my spare time 2 months ago and i want to make a MMO for my first game"
Yeah that usually the case but i saw a few people/studio that have experience and wanna know the tools and tips for making mmo but what i always saw they always grt laugh at and only a few that willing to help them
My team currently have 4 people that actually worked on an mmo before
And a few days ago they asked me if we gonna hire networking guy soon since from here on out they gonna be a crucial people
People who know networking well and hang around here are also more likely to get involved when asked a specific question by someone who at least sounds like a programmer
But for something as general as what you just asked...
If i were you i'd find out what MMOs were made on Unreal recently, then hunt down the network programmers that worked on them, and hire a couple of them for a few hour consult
After you hire a network engineer of your own, since you do need him/her to listen in on those conversations at very least
As for recently what i know is bless tera
And i probably asked people in planetside2
You won't find enough people doing MMOs here to get more then 1-2 perspectives, and even that only if you're lucky
And compared to the project cost for a MMO, hiring a few programmers for 2-3 hour consult to tell you what general approach they used in the past, how that turned out, what would they had done better in retrospect and such... the cost of that is insignificant
and potential savings from not walking into a dead end are huge
Currently im willing to put my own money on this genre and wanna make it better again with non of this p2w stuff
Also for the last question what kind of networking programmer/engineer should i loof for?
Someone who knows unreal networking well and is comfortable doing it in c++
While you can network a game with BP only, c++ has access to a lot of options that are just not exposed to BP
And there more?sorry if i asked too many questions
im just chilling before bed, so i don't mind
Ouh
How do you guys handle montage/ability-animation replication?
I haven't done much on it, but I've just been multicasting it. And inside of the multicast, I play the montage locally.
we play out montages locally, but we often have a hook in client side simulation we can trigger it from
basically if an action that triggers the montage happens on clients already, there is no point in doing the multicast
Just found this guy's set up. It sounds pretty good.
https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/95543-what-s-the-best-way-to-implement-smooth-lagless-animation-replication?123134-What-s-the-Best-Way-to-Implement-Smooth-Lagless-Animation-Replication=
Create a Blueprint struct to hold a montage and its relevant info (Play rate, section etc).
Add this as a variable to your character that replicates via a rep notify.
On the client, make sure the rep notifier for the variable plays the montage using the replicated information.
On the server, ensure you fill in this replicated montage variable when you play an animation and call ForceNetUpdate.
Build powerful visual scripts without code.
it has one drawback
if you log in or run into netrelevancy range
the other players characters will play the montages you were not relevant for
so you need to account for that as well
Shouldn't that be pretty easy to check for? Just if montage section == currently playing montage section.
lets say i am out of net relevancy when your montage plays
i run towards you
and suddenly you become relevant
i get your replicated variable update
and OnRep triggers that montage
i have no other information, as a client
You could replicate the position of the montage.
you can replicate a timestamp
and if current time is greater then the timestamp + length not play it at all
Yeah, that would be better.
and if its not play it from whatever offset for elapsed time is appropriate
Really sounds pretty good.
Been awhile since I've looked into the MP side of origin rebaseing to go past the set size. https://www.youtube.com/watch?v=G0WHhNQpf9I Something like this workable in the recent updates? I have a MP driving game I'm working on and would like to go past the set limit size and hopefully do areas upward of 25 miles
Anybody done painting system that works in multiplayer? My current system is that we create static mesh instance with every Tick when drawing. There might be few hundred instsnces in one drawing.. I dont know how to replicate the datastream to others
And if somebody comes joining the game later on, how would I replicate array that big in once
@plain flume you can't replicate it that way
Hi guys, I was already talking about this with @summer nova in #gameplay-ai .
Are there any benchmarks as to how many AActors/ACharacters can be replicated in a non-AAA setting? reading stuff like this:
https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/95495-network-replication-cost-and-relevancy
makes me pretty hopeful that replicating a maximum of 60 AActors/ACharacters in an RTS game is pretty feasible. what about characters that have an AIController?
Build powerful visual scripts without code.
not relevant benchmark becvouse stuff isnt getting modified
I don't think I'll ever reach the point of making a game public, though. But would that amount of replication require huge budgets?
oh yeah I forgot about that.
I also think physics is not necessary in my game
do AActors have client side prediction for making movement smooth?
is that even necessary in an rts?
Only Characters do @north swan
With the CharacterMovementComponent
NavMovementComponent & PawnMovementComponent don't
As for whether it's necessary... If you're building a multiplayer game, you probably want the movement to feel responsive, right?
i.e. not feeling a delay whenever trying to move units around the map
yeah I surely do.
what number of replicated ACharacters is feasible? is 30-50 too high? with most of them having not many replicated variables.
i know the answer is relative to my budget, let's just assume I'm not rich π
I mean, Fortnite has 100 of 'em
I guess I'll just try. another quick thing: I don't need an AIController to move ACharacters on a NavMesh, or do I?
I honestly don't know what's the smartest way to control units in an RTS... Mmmh
If you want hundreds of Units like in Starcraft
then I can't imagine it working well with hundreds of Characters
I think it'll be around 50 units max at a time, which would happen rarely
Total on the map? Or per player
total
Then should be fine. As for how to control them... Not sure. Imagining a lot of custom client-side prediction needed built-in.
Hello guys! I am brand new to the unreal and a have a problem when trying to create a hud via the GameState class, engine is crashing on start if i start project with dedicated server, and works fine otherwise. I believe that this is due to the unreal trying to create a hud on the dedicated server, when there is no player controller, but i cant understand how to fix it. I tried to make the ApplyHUD function executed on the client via UFUNCTION, but this did not help. Can someone help me to figure this out?
the GameMode calls GenericPlayerInitialization() from both PostLogin() and HandleSeamlessTravel(), which calls ClientInitializeHUD(), which in turn creates a HUD
@unique basalt#123 theres lots of ways to check for dedicated server but try adding if (UKistmetSystemLibrary::IsDedicatedServer(GetWorld()) { return; } to the start of the function
HUD as in AHUD derived class, local only, which is usually used to manage widgets that can be also called HUD
so you are recreating something that works out of the box, pretty much
Okay, i did it that way because i thought that there is some deep meaning behind using the GameState instead of a HUD class, but i guess that the guide was simply outdated : )
HUD class can by default access its controller, the controller's possessed pawn and the playerstate associated with that controller
@graceful cave And thank you too, that did fix the problem
So is there any difference between using a HUD class or a GameState, since i already recreated the thing that is already exists in the HUD class?
HUD is convenient, you don't have to worry about replication, as its created locally, one per PC, and is not replicated, same as widgets themselves
Okay, then i'll transfer that to the hud, better now than when there will be a web of code
Thanks again!
you don't have to create it either, just need to set HUD class variable on the GameMode
Even better then
you do need to create your custom HUD class ofc, but you don't have to worry about instantiating it
Yeah, i see that
its convenient for 2 more reasons - it can access your controller and pawn and its good for encapsulating the UI related logic, instead of cluttering somewhere else
Well, i dodged a bullet then, thanks to you : )
I thought about something according to your advise about using a HUD class. If there is any HUD parameters that should be shown only if some requirements are met, wouldnt it be much easier to cheat, since HUD class existing only on client and you cant properly check anything about it using server?
Take a radiation as an example - character class should always know if there is one, but you should not be able to know this as a player without the device
My brain is stuck on this. Do Client functions not work on the PlayerController? My parameter is there on the server function, but gone on the Client function. Parameter input became null.
I don't understand.
I have a bit of a noob question - for Replication (and thus Multiplayer) to work, do I need to have the action I want replicated on the player character or pawn itself, or is it ok to have the action I want replicated be in a separate item blueprint?
What I'm trying to do is get a door to be opened and closed by the client and the server. However, the blueprint that lets the door swing either way 90 degrees is the door itself (OnOverlap > Enabled Input > Interact with door function > swing 90 degrees)
The door is its own object, so you'd want to replicate that to all the clients. The action for the door to open or close would be a server function. @fossil sentinel
Hi @tropic fjord , thanks for responding!
The thing is I have the door itself set to replicate, and the functions (they are actually events) set to multicast. The problem is, the server can open, go through, and close the door - the client can open the door (the mesh and door moves), but cannot go through the door unless it's open on the server side.
So what I think is happening is that the client is not sending the message to the server to open the door. Not sure how to do that if multicast is not working. Any ideas - anyone? π
i have a problem. when i use the advanced session plugin plus the steam subplugin. and i try to create a new session, and join, it wont work. if i create a new lobby, it shows me both strings, when it should failed and suecess. im using the version 4.22
Perhaps you can show the function you're using to Open the door? @fossil sentinel Multicast should work, but just a Server function would make more sense in this case.
And Events are all (Delegate) Functions. Just a funny name Epic gave them for some reason.
who do you mean?
Can't help you with your question @crisp vortex, sorry, know close to zero about the Steam Plugin..
Maybe someone else can, tho π
it's okay. π
Thanks @tropic fjord - This is what I have. Like I said the server can't see the client opening the doors, but the client can see the server opening the doors.
I hope it's ok to post pics here
Not seeing any pic π¦
Top is what the server calls, bottom is just a link to that
Sorry there it is π
hello, maybe someone knows how to do a dedicated server with c ++, Iβm interested in creating a session and connecting to it, I canβt figure it out in what place I need to create it and how I already have a dedicated server, but when you connect to it, it gives an error (LogOnline: Warning: OSS: No game present to join for session (GameSession))
@dusky willow there's this resource I found that mentions that - but it's quite high level (for a noob like me anyways) - maybe it can help you? :D
@fossil sentinel I can not open
This link is probably due to firewall in my country.
lol thanks Narendur π
@fossil sentinel Have you tried simply making DoorInteract a Server function (not Multicast) and calling it on Interact?
@tropic fjord - doesn't work - this is what I'm getting. In the game itself, the client can't open the door now. Weird...
Thanks for the file, but the problem is that I still do not understand where to create all this, where and at what point you need to create a session - for example
Hi, quick question. It is possible to not destroy the pawn of a controller when the player disconnects from the session?
is there a tutorial for network sync?
I have a level blueprint that is supposed to start 2 fires at certain locations, but for some reason it is creating 4. Can anyone help? This is dedicated server environment.
This should only be called once due to the above and the start locations are picked:
and that is super simple
So it gets a random number, assigns to start locations like it should, but when I play my game it is picking the start locations and spawning an invisible fire on the server
and then on the client the visible fire appears at a different set of start locations picked
Adding switch has authority might have done it, though I thought I remember someone telling me level blueprints run on the server anyways
so I didn't realize I might need this
What does UGameplayStatics::GetRealTimeSeconds do during a demo replay that is rewound backwards?
I know it says it doesn't include time dilation, but does it go backwards during a replay rewind or ever onwards?
Can anyone help me out here with a multiplayer door?
What I'm trying to do is get a door to be opened and closed by the client and the server. However, the blueprint that lets the door swing either way 90 degrees is the door itself (OnOverlap > Enabled Input > Interact with door function > swing 90 degrees)
The thing is I have the door itself set to replicate, and the events set to multicast. The problem is, the server can open, go through, and close the door, while the client can open the door (the mesh and door moves), but cannot go through the door unless it's open on the server side.
So what I think is happening is that the client is not sending the message to the server to open the door. Not sure how to do that if multicast is not working. Any ideas - anyone? π
I really think I'm missing something so simple
This is what I have, but doesn't seem to work
Use rep notify function instead
Client door interact needs to be run on server not multicast
And the server never takes actions so remove that switch auth
And use client door interact
Hey @raven holly - thank you so much for your pointers!
I implemented what you said (I hope I did a good job) and now the client can at least see what is closed and what is open - however now the client can't open or close doors himself!
@raven holly this is what I have - any further legendary advice?? π
Ok change door open to a repnotify varaible
Inside the repnotify function put in the if and rotation stuff
Then change your multicast door interact to none
And remove the rotation stuff from that event, but leave the setting of variable
... uhhh ok hang on you've lost me a little (sorry I'm new at this!) - let me know if I've understood this correctly...
- So you'd like me to set Open Door Rotation and Close Door Rotation as RepNotify Variables
- Which RepNotify function are you talking about here? Should I create a function for OpenDoor and CloseDoor, and then set them to RepNotify?
- Change the DoorInteract function to replicate to none?
4.Remove the rotation stuff from this function, because they'll be in the new function of OpenDoor?
Did I understand that correctly, @raven holly ?
So change isclosed to a repnotify instead of just replicated
It will then create a function which you can see in the function list
Turn off replication on your closed and open rotations
You dont need it
Unless you change those rotations preset values at runtime
Ok, got it - so inside the new On Rep Is Closed? function you want me to put in the rotation stuff and the branch?
Having trouble getting my game to work on a dedicated server, everything works fine when testing in the editor, but when when I package it the player spawns at a random playerstart and can't move.
The player is meant to possess a pawn and a menu should show up, but none of that seems to be happening.
Also it works fine when a player hosts the server
This is the blueprint that spawns the player, its in the gamemode and is called from event_postlogin:
would you want to execute a node like Disable Input on the server, or does it matter? Im still trying to figure what should be server ran vs. letting client do it
I still wonder how I can get an Invisibility Ability working on Splitscreen.
The other 3 Players don't see a copy of you but the exact same mesh. So changing a Material will also hide it for the Player itself.
OwnerOnlySee doesn't seem to work (probably same reason?) even though I read that others made it work with that.
Every Pawn has an owner properly set (spawned through UE4 itself), but it still doesn't do anything toggling that boolean.
So apparently, the OwnerOnlySee thing works for Splitscreen too, at least in a new project (same Engine version).
Now to find out how 2(!) nodes can not work mine
isn't that mesh the very same instance in splitscreen?
Yeah
But it seems to work
Test project
Without the boolean
Hm, however in the actual project they both go invisbile
Means some third person is the owner.
(β―Β°β‘Β°οΌβ―οΈ΅ β»ββ»
its good to catch failed ownership chains early
That's all I do though
These are also the only Owner calls
So I'm not undoing that somewhere
yeah, there is no scenario in which that can fail
the mesh is in the CDO?
oh, is the camera owned by the controller as well?
Ehm should be
Actually no
The Camera isn't even replicated
It's an additional actor
Which for splitscreen should not matter I guess
it has to update render state per camera, not per controller
I set the Owner on the Camera now too, but didn't change much
:/
But you might be right
With a camera on the pawn (not extra actor) it works
Now to find out why
The extra camera actor is a ChildActor
Or actually
It's not
Making it a child actor is also not working
I can't find how bOnlyOwnerSee is used
All it does it setting the Render Start to Dirty
but I can't find where exactly the check it when deciding if it should render the component
primitivesceneproxy
is where it checks
by checking the owners list and the viewactor
Then I see the problem
The ViewActor is the CameraActor
Which is not an owner
It is owned by the PC, but that doesn't matter then
Stupid actually
They should check the ViewActor owner
And see if that is in there too
you can add it !
As long as that doesn't require engine changes that is
that it does.
Cause I don't want to introduce a custom engine to this project as of right now
i think you can add the camera's owner as an owner to the owners list though
i vaguely remember doing something like this before in the past
I have a weird networking problem. Would be glad if someone could help out: If I spawn an AI Character on the listen server (using SpawnActorFromClass), I get choppy/jittery movement on the client when it moves.
I don't get this problem if I'm playing on a dedicated server.
However, if I just place them in the scene and play, the movement on the client is smooth and I'm not facing any issues. Could someone help me understand where I could be going wrong? Thanks
Yeah, I guess this only works for Splitscreen then
Which is fine
For network I would most likely use IsNetRelevant anyway
I guess the only other thing I can do is set the viewTarget to the Pawn or PC
And modify the view via the CameraManger
To show what I want
How to show the connected clients via console command in listen server?
Anyone knows?
what is difference between calling event from Authority and calling RPC same event?
how i understand, that's the same? or im mistaking?
Calling from Authority is when the server calls the action. Calling RPC is the client telling the server to call the action (if I understand it correctly)
Anyone ever experience the editor locking after about 1 minute when testing at least two players/clients on one machine?
no
support for steam dedicated servers from blueprints is a thing in 4.22 or not?
When sending a vector via an RPC very frequently to the server, to greatly reduce the amount of bytes sent, is all you have to do in order to achieve that use an FVector_NetQuantize instead of a regular FVector?
yes
Thanks!
@twin juniper Sessions still require either C++ or the advanced sessions plugin
Dedicated servers still require a source build of the engine
Dunno about the rest
i have steam dedicated servers from blueprints using Uworks plugin
so i'll stick to that
Are steam dedicated servers free or do they just handle the connection from the party?
Probably not free, you'd have to rent instances right?
"steam dedicated" means dedicated server that uses Steam for sessions
Valve does not host
Ah
I'll stick to listen in my case I think
Since it's literally free regardless of the players
yes, it's basically just a list of ip addresses
Listen is 100% the way to go if you're an indie
Yep it's fantastic
Dedi is too costly and complex
not really
No need to do any extra work to maintain anything
Make a game once and it can support 2 or 2590812759 players
Yup
you can easily host them on google cloud, really easy to setup
and its trail is free, so no costs involved
Still way more involved than a simple listen server
Yeah if you think about how convenient it is for an indie to ship on steam- they just need to make sure the party and session works and then it's infinitely scalable
No extra server binaries, setup, maintenance etc
i was hoping i could move Uworks out of the picture
with the new release
but i guess not yet
what is it that keeps convincing people they need dedicated servers
persistent characters?
Well for PvP it's definitely the standard now but you just can't compete with the big dawgs in terms of that
Dedi is doable but adds a huge lot of setup, security, maintenance, running custom builds, not to mention running costs in the long term ; and you only benefit from dedicated if you're doing a competitive game, or a MMO, both of them terrible ideas for indies.
Fully agreed Stranger
It probably takes 50% of your time and budget JUST to get dedis working correctly if you have a small team
That time could be spent making your game better and on listen servers for free
i'm a single developer with no c++ knowledge
and i didn't have that much problems with setting up dedicated servers
on google cloud + uworks
TBH
All steam has to do with listen is say hey you host and these people are clients right? It just is the middle man for the initial setup? It's so damn efficient that everyone hosts their own games π
@twin juniper It's easy enough to set up one or two dedis, but try managing them for a live game
And handling problems, updates etc
It gets very complicated
Yeah, problems come later on. How and when do you update ? How do you prevent cheating ? How do you handle backups of your world ? Etc
Anyway, not here to diss on dedicated
What happens if 500 servers in a region start giving bad performance
And yeah definitely not
agree
IT's just out of the hands of a small indie
For someone like Epic it's perfect
And of course in the perfect world every game would have dedis for max quality
But listen is definitely good enough in many cases
That's not even true - if you're doing a coop game with no matchmaking that you play with Steam friends, dedis are 100% a waste of time
Yeah you are definitely right
Co op is a great example of where listen shines
Super efficient and infinitely scalable
i just needed a persistent character aspect of it... no way around it but dedicated servers
Yeah for stuff like that you can't really do much
Listen is great for session based games that don't need to stick around when you shut them down
One question about listen server bandwidth. Doing some tests with a friend, we hit the 10,000 byte limit very quickly
With a few actors running around
Is this common and is it common to lift the .ini limits to something more lenient in general?
When lifted we got a great experience again with nothing being dropped
Is that 10,000 bytes the amount of data sent per SECOND?
That would be a very small amount
Yeah it seems to be- which seems very tiny for modern connections
That's the default in UE4
I'll assume that it's fine to bump it up (while testing of course), but I'd imagine many connections can support more than 10KB /s
just change the limit
I set it so high it's effectively disabled - there is no point artificially limiting the bandwidth with player hosted servers
@fleet raven Great thank you
So in the case of a listen server host, if he or the client hits their connection limit, they'll just send less packets naturally?
and it won't matter that there isn't a limit from UE4's side?
I don't actually know whether it will block or drop packets when you saturate your bandwidth, but it seems to have the same effect as hitting the limit in unreal (unreliable rpcs not delivered)
That's perfectly fine
As long as the reliable ones still come through first even when saturated
Thanks a lot
is there a tutorial how to sync multiplayer?
Sync?
@slim holly Hello
Previously I asked here this question, but needed to leave computer. Anybody could point me to right direction how to replicate a painting system? Here is the last message:
"Anybody done painting system that works in multiplayer? My current system is that we create static mesh instance with every Tick when drawing. There might be few hundred instsnces in one drawing.. I dont know how to replicate the datastream to others
And if somebody comes joining the game later on, how would I replicate array that big in once"
Hey guys. is this tutorial series for a multiplayer game, a good start to learn multiplayer coding for UE4.21 or 4.22?
https://www.youtube.com/watch?v=abmzWUWxy1U&list=PLZlv_N0_O1gYqSlbGQVKsRg6fpxWndZqZ
I was thinking of doing a dedicated server with gameplay abilities. but more i look into the multiplayer aspect of the engine more i'm begining to feel lost and don't know where to start. I've checked some dedicated server tutorials but they all have a working game already made. Here i'm not sure if i need server calls programmed into my game or not.
TL;DR: I'd like to know what would be the best way to start making a MP game? I could really use some pointers.
In this video we take a look at the finished project and step through each of the features that will be covered in this series. We show our functional Main M...
@rose spear find the networking compendium, link is pinned on this channel
@winged badger looked trough it but i don't understand, if i want to have a dedicated server: do i need to code it myself? or does unreal create it for me if i just untick the checkbox when pressing play (not a temporary one)? If i have to make it. do i just make the .cs file (like in most tutorials) ? if so where does the logic for the server come from (making a map, char select etc...) its a bit all over the place for me atm. i think i'll just focus on creating a normal netowked (listen server) kind of game and then maybe transfer it to dedicated server.
@winged badger ty for the reply
well, starting to make a game at a point where you are as lost as you are now will almost certainly result in starting over once you gain more insight
so i wouldn't even worry about dedicated servers or not, just experiment and get some grasp of networking first
That's the right approach - make something you like - then worry about dedicated.
https://wiki.unrealengine.com/Dedicated_Server_Guide_(Windows_%26_Linux) Thats the guide on how to build it - but again, its just adding headache to go that route to start with.
i think i'll just try to recreate the whole Unreal networking tutorial with as much c++ mixed in as possible and then try to get dedicated servers
@hallow turtle thanks
How should I set these new macros when working on version 4.22?
Is there any example of it? I really can't find it
I believe this is the easiest thing ever. And yet I have been trying to find an answer for this for the past 5 days or so
I'm not on 4.22... but it sounds like you would just add GlobalDefinitions.Add("UE4_PROJECT_STEAMSHIPPINGID=1234567"); to your Target.cs file like it suggests?
Thanks @warped island! I did not know that was the right way to do it. Do you know if I also need to add any of these definitions do my Game ...Server.Target.cs file?
Hmm, I'm afraid I don't... But I doubt it would hurt to define all of those for all of your targets. You could look through the source to see where those defines are used to verify, I bet it's only once or twice for each of them.
I'll try that! thanks again!
im having troubles doing replication for the flight animation blueprint from the marketplace i thought it would work the way i did my replication but its weird all the animations replicate but the client doesnt fly higher then waist level and flys very slow while the server does everything normal?
I just wanted to ask since I don't know loads about mp but from what I do know it seems very intimidating; is it even worth trying? is it just guaranteed to be super complicated and stressful every time?
do you generally have to be like really skilled to set it up
I have this code which spawns a fire actor at a location on level start, which then spreads as the game progresses.
The fire appears invisible to the clients even though I have the actor replicating
From what I remember being told as long as I have the root actor replicating the particle components should replicate
Settings for the component
if I take out the switch has authority the fire appears in an area visible to the client (it got a new start location)
but in a separate location you still see that blank area of trees clearing out. So I know the server side fire is there
just unlocked in the vault (from GDC 2017):
https://www.gdcvault.com/play/1024010/Replicating-Chaos-Vehicle-Replication-in
https://www.gdcvault.com/play/1024035/Deterministic-vs-Replicated-AI-Building
https://www.gdcvault.com/play/1024041/Networking-Scripted-Weapons-and-Abilities
Accurate peer-to-peer replication of game objects in a highly chaotic physical simulation is essentially an unsolvable problem. This session will explore the techniques used in 'Watch Dogs 2' to replicate vehicle trajectories, compensate for...
This lecture will showcase the AI technologies that were developed in 'For Honor'. This lecture will cover how, on one side, the team at Ubisoft created a believable large scale battlefield on the backbone of a distributed peer-to-peer...
'Overwatch' uses a proprietary visual scripting language called Statescript to execute the high-level state machines used throughout the game, including the logic driving hero weapons and abilities. This talk describes the features of the language...
@fierce birch Networking Scripted Weapons and Abilities in 'Overwatch' sounds like GAS made properly π€
does anyone know or use a custom console to display the server output log
I have a custom console installed, but it seems to launch with the windows cmd.exe regardless (even when its set to override)
Hi!
Is there a way to connect to a server without travelling to its map? I just need to exchange sporadic data with the server, and I don't wan't to lose my current level as my game is mainly a local one (server is only used for few data)
@sick edge use beacons
What is this (i'm searching on google at the same time)
Why is the score var in player state also read only and how to access it through blueprints? Not a lot fof ionformation π
Let's say I have a case where:
- I spawn an actor in BeginPlay (
GetWorld()->SpawnActor<...>) on both server and clients, from an object. - Somewhere I do an authority check, and if false, I invoke a function on the spawned actor.
- The function that is called on the spawned object only ever returns true for HasAuthority(), even though it was called by someone who did not have authority. This is confusing to me.
Any ideas?
If the client spawns it, he has authority. I'm pretty sure.
@worthy perch But doesn't HasAuthority always indicate that the object is owned by the server?
Authority just checks if(Role == ROLE_Authority)
And ROLE_Authority is /** Authoritative control over the actor. */
An Authority check on a non-replicated Actor is most likely pointless.
You should rather check if you are the Server or not.
if(GetWorld()->GetNetMode() != NM_Client)
{
// Server
}
else
{
// Client
}
@rain coral
Aha! Thanks =]
hi guys, do u have the issue that level actor references are gone after servertravel
its not the same level actor after travel
ye but in my level blueprint i use the level reference, i thought these will be auto set again on server travel
after server travel only valid references in level BP will be the ones loaded from the package
u know the ref when u right click, basically my level bp no longer works after server travel
:/
and ones you set "manually" afterwards
cus now i dont know how to refer to level actors from level bp anymore
Hey guys, I need help on understanding the proper way to replicate NPCs in Blueprint. I'm adding it to an existing project. Should I let the events happen on Server and replicate the Animation only?
since they get messed up after server travel
@past gate replicated actor will be spawned on all clients as well, and it will run independently, for the most part
its BeginPlay, Tick, Collisions, etc...all run locally
basically this issue, some say 4.20 still has it
yes this is seamless travel
i don't use a level blueprint for anything other then holding some information about the level, so its easily accessible from anywhere
you BP only @keen thorn ?
i use C++ with BP, i need to interact with trigger boxes in my level
but once servertravel the ref to trigger box in level bp no longer works
My problem is, in the ABP, there are a few random choices to vary the animations of the NPC via a random Integers picking from animation arrays. Should replicating the integers be enough?
im trying to fetch them by tags... but doesnt seem to work well
AMyCustomLevelActor* UStaticLibrary::GetLevelActor(const UObject* WorldContextObject)
{
UWorld* world = WorldContextObject ? WorldContextObject->GetWorld() : nullptr;
return world ? Cast<AMyCustomLevelActor>(world->GetLevelScriptActor()) : nullptr;
}
//static BPCallable function
can just add that to your c++, put a breakpoint in it and call it
see whats going on in Locals
provided your references are in c++
as far as i know, the level, along with all its packaged references should be loaded from scratch when you ServerTravel, Seamless or not
@past gate do you even care if cosmetic animations are perfectly synced?
yes I do
ok
it would be enough, proobably best to trigger then from OnRep functions
but you can't replicate then inside the animation blueprint
oh yeah? because the ABP itself isn't set to replicate?
UAnimInstance isn't supported for networking, and it would take some c++ work to force it to replicate, which i strongly reocmmend against
@winged badger yes me 2, this is why i think its bug. seems like others have same issue as well following my link
okay, I'm gonna try to go through the actor graph then
@rough hollyios, are the object names the same ones as when you first load the level?
yes all are same, its a very simple level bp
sorry Mad, made typo and it pinged you
aha ok
i mean
is it TriggerVolume_BP-C_1 on the first load and TriggerVolume_BP_C_2 on the second?
you can just printstring it from BP
from object reference
GetDisplayName node gets added automatically
print the name from the object itself
on BeginPlay
with seamless travel you don't have the outliner and the editor, so yeah
meh
i will do a hack to quick fix this for now
gotta deliver today
its just weird the ref dont auto work
:/
ATriggerVolume* GetTriggerVolume(UWorld* World)
{
for (TActorIterator<ATriggerVolume> It(World); It; ++It)
{
if (It->ActorHasTag(TEXT("MyTriggerTag"))
{
return *It;
}
}
return nullptr;
}
fallback option
Any tips for things to check for why the server function doesn't get called? The code in the screenshot runs, but the breakpoint in the actual implementation never runs.
I'm just guessing, but maybe int can't be sent?
Like it has to be one of the UE versions of int.
I've sent int plenty times in other cases, that's no problem
In this case the object is spawned on server only and replicated to clients. Clients call a function on it which then calls a server function, and it doesn't get to the server version.
Clients have to have ownership of the actor, doesn't it?
either from a playercontrroller, or from a possessed pawn
Or any other actor that is owned by the client
You specify the owner when you spawn the actor
That owner needs to be chained somewhere with the PC
So you can have PC->Actor1->Actor2->..->ActorN->NewActor
And it would work.
@thin stratus Is the SetOwner function the one to use for this?
So in the case where a server spawns the object and replicates it, it should set the owner to be the server version of the PlayerController?
In BPs there is an Owner Pin on the SpawnActor node
In C++ the same thing is hidden in the ActorSpawnParameters
You can, afterwards, change/set the Owner via the SetOwner function
Everything has to happen on the Server
And yes you need to use the Server version of the Clients Actor
Alright, thanks, will try.
EDIT: Yes this works =)
Hi guys. I have a server set up using steam onlinesubsystem in cpp.
I am able to get to the same map.
Problem is, when I connect at the client end, 2 vehicles spawn simultaneously (presuming the client and the server) whereas I can see the client joining from where I hosted
why is that and how can I fix this?
How do you use ActorSpawnParameters if you use SpawnActorDeferred?
does anyone know off the top of their head a good resource for the replication graph stuff?
I would like to write my own replication graph in place of the spacial partitioning graph
basically, the game i'm working on has "groups" of people that need to get all events related to that group, but they are not grouped by their positions in the world
I don't spawn the actor. I have a default pawn class in the game mode I set @worthy perch
Sorry, wasn't talking about your thing.
oops. My bad
@worthy perch I think SpawnActorDeferred uses them under the hood.
Oh, yeah, it does.
Hey guys, I'm completely new to multiplayer and struggling to understand what goes where. For example if my game has a pool of resources that is shared between players, is that something I create, store, update and distribute to clients from GameState or GameMode? My current understanding would tell me that's something for the GameState to handle.
Another scenario would be something like rounds or phases of a round - seems like something that the GameMode should govern (since it would classify as the 'rules' of the game) but at the same time something that the GameState tracks (since at the end of the day it's an int that needs to be available to clients)?
GameMode only exists on the Server
See the GameMode as the primary class to handle game logic in that is server authoritive
And the GameState as a primary class to pass information about the game logic around.
E.g. the GameMode has a Timer to end the match (as well as the logic to do so).
The GameState would only get the Timer Length and replicate this very time to the player
Sometimes the line between GameMode and GameState gets a bit blurry though
If you just want to store resources between players (e.g. a shared $β¬ value or wood, gold, stone, etc.) you can place it into the GameState and let the Server adjust it. (keeping in mind that the clients can't call RPCs on the GameState).
@celest geyser
OK, so in my concrete case, I have a deck of cards that all players draw from. If I understand you correctly, I create the deck in the GameMode, shuffle it there, then pass the shuffled deck as a 'ShuffledDeck' variable to the GameState. Clients are then able to access the 'ShuffledDeck' variable on the GameState to draw a card from it.
But simultaneously, they would have to tell the GameMode that they are drawing a card (removing it from the 'DeckArray'), and then the GameMode would have to update the 'ShuffledDeck' var on the GameState. Does that sound correct?
Yeah that's one way you can do it.
You'll probably find yourself refactoring that quite a bit again and again.
Also please be aware that any interaction with the GameMode has to go through an RPC-able class first.
Well from Clients to GameMode at least
E.g. Client calls ServerRPC on PlayerController and then can tell the GameMode something
Also depends if the Player needs to know the deck
Or if their own hand is enough
Cause the Server will place the card from Deck into Hand
Hey all, does anyone know of any common reason a client to server function won't fire off?
I've set up this blueprint to run very similarly to a more simpler blueprint that works, but this one won't even fire off the function that tells the server to multicast for some reason, despite the "remote pin" from Switch Has Authority firing off to order the 'executes on server' function.
I'm pretty new at this, so I'm expecting to see something very simple that I'm missing. The blueprint default is set to replicate tho π
This is what I am working with
Main reason a ServerRPC isn't firing: Client isn't owning the Actor.
@thin stratus
You're referring to the dropdown which determines where a function is executed, correct? As in Run on Owning Client, Run on Server?
Players only need to know their hand, which would then be stored in PlayerPawn (?)
Like I said, completely new to this, so apologies for the noob questions, just trying to figure out how I need to think about these problems π
And by the name of your Actor "Fortify Window", this is just spawned into the world and the Client is probably really not owning it. @fossil sentinel
@celest geyser PlayerState
Did you actually see my Compendium pinned to the channel?
Cause i kinda think you didn't :D
@thin stratus I'll check that out thanks! BTW OH WOW - you're the guy who wrote that! Thanks for the amazing resource!
@thin stratus I've been reading through it, but I don't have a programming background so it takes some time to understand π Thanks for taking the time to answer though, it really helps my understanding with concrete example π
For a replicated emote that other players would see, would that be done by a rep notify int that'd switch on int in the repnotify function to play an anim montage corresponding with the emote index?
That's one way
@ivory portal Would you do it in a cleaner / more elegant way?
Very curious about how it'd be setup
Is there anyway to send additional state to the server via a CMC move? This wiki does a server rpc (ServerSetMoveDirection). But that is still causing desync in my case. Caused by a race condition between the move and that rpc
https://wiki.unrealengine.com/index.php?title=Authoritative_Networked_Character_Movement
In my case I am trying to send a pointer to the character being meleed from the client to server so they stay in sync
Can someone tell me how to use the "update session" node from the AdvancedSessionsPlugin? Using the add or modify extra settings node doesn't seem to work.
Does the node only work from a dedicated host? That is the only reason I can think of why it doesn't work when playing with a listen host
I have a bowling game i'm trying to create - its comprised of an alley that has child actors (the pins - set to bReplicates = true in their own blueprint). They simulate physics - and the simulation seems to be replicating fine when a ball strikes them and knocks them over.
My problem however is resetting the pins back to their spots when a frame is done..... I cant seem to do this unless i set the static mesh (inside the pin script) to replicated - which opens up a whole other bag of problems - IE: Pins arent in their respective locations that they are when i place them in the parent (alley) script....
ALLEY SETUP (Actor set to replicate - CHildActors are NOT) :
https://puu.sh/DcgiN/09a48ac525.png
PIN SETUP (Actor set to replicate - SMesh is NOT at this point):
https://puu.sh/Dcgju/5c02338e3c.png
RESET CODE (Piggy backed off of a RepNotify variable setting):
https://puu.sh/Dcgk4/0f5df65c18.png
Now it is not required to recompile the engine to set the Steam Product Name and similars, you just have to add the following lines on the target.cs files
[Unreal Engine 5]
if ((Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Linux) || (Target.Platform == UnrealTargetPlatform.Mac))
{
GlobalDefinitions.Add("UE_PROJECT_STEAMPRODUCTNAME=\"My Product Name\"");
GlobalDefinitions.Add("UE_PROJECT_STEAMGAMEDIR=\"My Game Dir\"");
GlobalDefinitions.Add("UE_PROJECT_STEAMGAMEDESC=\"My Game Desc\"");
GlobalDefinitions.Add("UE_PROJECT_STEAMSHIPPINGID=480");
}
In Unreal Engine 4, you have to rename UE_PROJECT_ to UE4_PROJECT_.
hi all, im trying to understand why actor references from within level bp becomes null once a server travel occurs
the refs refer directly to placed actors in the level
im currently using workaround to get all actors of certain tag or name due to the issue :/
has anyone found a fix for the bug where servers stop working after a few days?
Fantastic, just edited a bit the message so it's in context
Can anyone help me figure out why my level blueprint is spawning 2 sets of actors instead of 1 here?
so it creates a fire at those 2 locations, but then the code executes again client side. I thought level blueprints were not replicated
with 2 new start locations
I expect to see it start at 2 locations like this
but an invisible fire starts at another 2 locations
and the trees remove properly from the invisible fire, but not the visible fire. Which tree removal is done server side
This gets me down to 1 spawned, invisible fire deleting trees: Which is 95% there.
I have the fire actor set to replicate, but I can not see it
oh snap
it is replicating
maybe the actor doesn't keep the particle's bounds and I need to adjust those within the actor
well I don't know what is causing it yet
fixed it!
for TDM where would one typically have the Scoreboard and how do you update it? Im trying to cast to the scoreboard UI from the GameState but it wont let me run an event on the client. Its like forcing everything to run on the server and obviously the server and UI's dont like each other. What is the location structure for a scoreboard and updating it on all the clients?
score board should be a local widget
pulling info from gamestate
you should not be sending stuff from the game state to the widget
widget should only ever pull stuff out
gamestate will be replicated
so everytime someone gets a kill, the gamestate gets told, and that replicates the new values. the widget just pulls from the gamestate, i prefer event driven, ie the gamestate fires a delegate via a onrep which updates the UI or you just update the UI when its loaded, and bind, as long as your collapse the widget after to save performance
ok the on rep makes sense. But for example. The only way to know a player logged in is from the game mode OnPostLogin. Im trying to figure out how to use that event to add a new line for that player on the scoreboard UI. The wierd thing is. Even setting events in the gamestate to run on client get overriden and are still being ran on the server
anyone know? Been working on this literally all day with basically 0 progress π
@slender yarrow What do you mean "settings events in the gamestate..gets overriden"?
like any event i set to run on client in the gamestate or gamemode will not run on the client. I literally have an event set to run on client in the gamestate and its only outputting on the server
So your events that are set to RunOnOwningClient are not being called on the client?
Or multicast is not running?
RunOnOwning client isnt working in gamestate
I've not tried that but it makes sense. I don't think a single client owns the gamestate
Isn't this something all clients need?
well im just having a hell of a time trying to get a scoreboard on the clients to be updated when i new player logs in
which can only be initiated from the gamemode
and im getting lost between all the different states/modes and the client and server
I don't have it open to know the best way but using a multicast event should work instead
This should push to every client
youre right. been over thinking it maybe. ill try
Are you replicating info other than just the event firing?
well realistically i need to send a struct as well
the player info for the line being added
If you need info to make it down AND be accessible from newly joining clients you should use a repNotify variable
i did. and it was semi working. I just have 2 players joining the server and only 1 was being added to the scoreboard
was trying to debug it
so i have the on rep going. But the variable im using to trigger it is only reporting the last number on the clients. But the server number are correct. What could cause this?
@limber mortar Bogadu: Can anyone help me figure out why my level blueprint is spawning 2 sets of actors instead of 1 here?
add an authority check, so clients aren't also making fires.
I did, but then I had a replication problem
which I fixed
So that was 50% of the solution
Thanks for the reply, I actually worked on it a few days and that was the first
At one point I was told by a mod to take out a lot of the switch has authority and networking (Run on Server, Multicast, etc Functions) because the level blueprint isn't replicated
being a new UE4 dev I might've took the advice too far
I'm so close to launching my alpha testing I can smell it π
got vehicle and character skins applying
mm
I'l put something in the released area within a couple weeks
I'm kind of amazed there is no easy way to do real time multiplayer for iOS. And if there is there is very little documentation, tutorials, or answers on the internet.
heyas. having issues with sounds. the problem is things like jump. you want it to be instant for the character (fps), but replicated for everyone else. i'm trying things like this, using audio components on the character, but haven't hit the right solution. still struggling with replication. the rules seem to change all over the place.
ill probably try thisf or now: https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/1419513-replicating-multicast-sounds-with-lag
So I've come to a bridge that I can't seem to pass. Probably a very simple solution but I can't seem to find it. The problem is I'm attempting to play a
Hopefully my last question of the night. I have this actor that works and replicates, and I can see it on the clients when it is spawned on the server
I tried to create a decal in the process but it wasn't visible. I put the decal node in the remote branch, attempted a multicast function, and other things, but I don't see a decal no matter which material I use
am I missing something silly?
it is on a dedicated server environment
Man the googles says what I found earlier, try multi cast
this decal works for another actor but not here
I just want a black spot on the ground π
the decal isnt replicated so multicast is the right direction
have you tested to see if the multicast is firing at all on all clients
just setup a print node
I'll put one before the spawn
I see the print string
but not the decal
here is me flying towards it
does a spawned decal have a default cull distance?
if the print works then there must be some issue with the actual placing of the decal on the clients. If your actors move, the location might not match on client and server
OH
try making the decal huge or something to see if it's just placing in the wrong spot on clients maybe?
I SEE IT
I just needed to make it reliable
you rock
I want it to be a burnt ground, so now that I can see them I just need bigger decals and black ones
but all those red circlers are where a fire burnt
small victories! A custm event to handle sound replication that gives the clients an instant sound without repeating it when the after sending it to the server for multicasting. PHEW
for sounds initated from character
I have a unorthodox vehicle floating using my hover component and moving using forces applied to the static mesh after calculation based on a few parameters. How can I convert this behaviour to a synchronized multiplayer? I already have steam subsystem set up
@flint plaza You'll need to implement a classic prediction./rollback/replay multiplayer code
Your hover movement needs to be deterministic (no engine physics)
This course covers the topic very well, get it when it's at $15 : https://www.udemy.com/unrealmultiplayer/
I am 3/4 into this course. So far so good. Not yet understood how to do what I'm trying to do though
Which part don't you understand yet ?
How can I synchronize movement of all clients and the server of my custom vehicle
The "Krazy Karts" part of the course covers a multiplayer movement component
Okay. I am almost at the point of starting that section. Thanks
Good morning!
I'm using a .sav savegame object to store some character customization data (mostly colors and integers within). Is it possible to replicate this object from server to client? It doesn't seem to arrive at the client. I'm wondering if it's overkill and if I should rather keep a struct with those properties separate and refactor some of the code to copy data into the struct and use that for replication instead?
@rain coral Load the save into a struct, replicate / RPC the struct π
π
Simplest way to go here, and you can easily optimize with netquantize vectors etc
I guess a relevant question would be generally the cost of replicating 'objects' like actors? I have some cases here and there where actor references are passed from server to client, and wondering a bit how that works. Does it take a huge lump and churn it through the pipe or is it able to send only the crucial info in order to have the client reconstruct the object on their own..?
Whats the proper way to replicate root motion? Currently I'm using root motion with Play montage when player dodges(just a short dash). Works fine on hosting client but others get rubberbanded and dont move. Is there a built in way like character movement works for root motion or should I just ask for server to let me dodge?
@rain coral Basically references are replicated as pointers
@cinder quartz Your movement component needs to be disabled while you do root motion, I guess
Look into the CMC code to check for something like that
Thanks, ill check it out
@bitter oriole But the pointers wouldn't point to the same memory on server and client though?
No, it will point to the replicated object
If it's not replicated, I guess it will be nullptr
Hmm ok I think I understand
hey guys, do you know a good (up to date) place where I could learn a lot about unreal multiplayer please (not just the basics) ?
Scroll up a bit where I linked a very nice course
ok thanks
just asking is it normal for the packaged project not having the steam interface after setting up the subsystem
hello guys i have a question
how do i get 2 different version of an actor on the server side and client side
i have an actor where is stuff saved that the server realy doesnt need how like 2d textures
whats the best approche?
StaticData shouldn't be saved in an Actor though.
A DataTable for example makes a lot more sense.
Either way, if you spawn an non-replicated actor on the client, you got your solution.
@wet tangle Depends.
Did you package for Shipping or Dev?
so i use the construct script to get the data from the datatable in the actor ?
i try to avoid using the construct script im gonna spawn alot of these actors looking up all this data is probably performance costly
Hey all I'm doing something weird in my multiplayer architecture ... Is this normal?? Basically I have an actor blueprint called 'unit' and it's the base of any unit in the game, NPC or player. I realized that giving each unit an Owner that's a Player Controller (that's built in natively to actors) IS NOT sufficient to keep track of which 'player' controls that unit. Why ??? Well...
Because the engine uses that native Owner variable to control how data replicates and so if I want a unit to belong to a player but actually be 'network-owned' by the server for rep purposes, I need an extra variable of course. One called 'player instance' or something, like an alternative player owner variable on each unit. My own custom struct.
Adding fuel to thr fire, I need there to be a 'neutral player' and it seems impossible to create a new player controller that isn't actually connected to a client. Further reinforcing the idea that I need a second variable for tracking unit Ownership by a player
So now my units have an Owner (only for network and possession purposes basically) and a PlayerOwner which is literally just a custom struct, used for all the game logic (to tell who is allied or enemy , what the player name is, etc)
This approach seems messy so I wonder if I'm doing this right
whats preventing you from using only OwnerPrivate, why would you try to use a PlayerController to possess a "neutral pawn" ?
and the "team ID" falls fairly naturally inside a PlayerState derived class
Well I'm not using a player controller to Possess a neutral pawn, only to 'own' it . So that the PC has a team ID in it and I can use it to compare to for AI realising if something is Ally or enemy
I tried to make a neutral PC though with Create Player and it returned null π
Fundamentally my two big issues are 1) How can I create a PlayerController for the 'neutral' player so it can own certain actors, NPCs for my custom logic purposes (have a teamID etc) and 2) If i have an actor that is 'owned' by a client player, how can I make the server have absolute authority of it in terms of the network replication? (some sort of ROLE setting, ..? )
create a PlayerController
You don't create PlayerControllers by hand.
I don't get this part:
I realized that giving each unit an Owner that's a Player Controller (that's built in natively to actors) IS NOT sufficient to keep track of which 'player' controls that unit. Why ??? Well...
Because the engine uses that native Owner variable to control how data replicates and so if I want a unit to belong to a player but actually be 'network-owned' by the server for rep purposes,```
Why would having the PlayerController as Owner stop you from the normal replication process?
Also what is a "Neutral" player?
An AI?
@ebon bramble
Also CreatePlayer is for Splitscreen Players
Oh it is? Okay here's the deeper dilemma. It seems like a common thing .. I'm spawning NPC units and they need to each get a TeamID
And they need a player-owner-name of 'Neuteal Hostile' somehow so that when they kill a player, the chat log will show 'X killed by neutral hostile'.
So in my personal opinion, since my PC class already has a name variable and a team ID variable, it makes the most sense to spin up a new PC for 'neutral hostile' and make that own the NPC actors. However I am indeed seeing that it's not really possible based on how the engine wants each PC to have a network-related client
So what do I do π
(in my mind I'm thinking about starcraft/warcraft games where you can have 'players' that are NPCs like neutral passive and neutral hostile'. )
The problem is you storing PlayerRelated data in the PC
It belongs into the PlayerState
AIControllers would own Neutral AI pawns
Also having the PC owner of an actor be a client means the client is the authority of it's location and rotation... Not good
Ooo
Also not true
PC owner doesn't have anything to do with Location and Rotation authority
In UE4, the Server has the Authority at all times.
At least over replicated actors that is
Oh. Interesting okay hmm I think I just had something wrong with a role then because here's how I came to that false conclusion lol:
PlayerController, as well as AIController, represent one single player.
Either Bot or not.
PlayerState holds information, such as Name, TeamID
Or even "bIsABot"
TeamID is the only one of the three you have to add yourself.
Having a PlayerController as Owner if a Spawned Actor is very much wanted, to be able to call RPCs over it.
AI Controllers only exist on the Server, so they don't matter anyway.
The only thing you need is setting "bWantsPlayerState" in a C++ Parent of your AIController
Ooohh that's super helpful
Cause that is, afaik, not exposed to bps
hi, quick question. when a player joins the server, for a fraction of a second the camera is at 0, 0, 0 and then it teleports to where it should be. how do we fix this? itβs not a pleasant sight
With hiding it behind a loading screen
You are a godsend
a proper fix would be cool as our setup isnβt a normal 2d interface
and that time isnβt constant. it sometimes is longer and sometimes itβs shorter
You can try to hide it via the CameraManager
But in general, the 0,0,0 is the PlayerController
Sitting there
yeah
And the time that it takes to snap to your pawn
is the time it takes for the Pawn to spawn and replicate
So the time between that, you can't have the camera at the pawn
You can force it to look at the moon, stars, floor, wall, middle of your map etc.
But you will have a different location
Than when you possess
The only way to more or less fake it, is knowing where the pawn will spawn
And hardcode that location
- camera offset
we know where the pawn will teleport
we teleport it to that location as fast as possible
Then make a custom PlayerCameraManager
Set that in your PlayerController
(it's a dropdown in the settings of it)
And override teh BlueprintUpdateCamera function
Check if the Controller has a pawn
and if not, set it to that wanted location
Otherwise don't do anything
alright thank you so much for this info. iβll pass it to the guy responsible with this stuff
How do I correctly set ownership to a possessed pawn? The pawn is the default character, everything works fine before possessing this actor here, but if I possess the inital pawn again, things like "replicate to owner only" or "create widget" don't work anymore, it appears as if the players controller isn't the owner of the inital pawn anymore
Does anyone know why spectator rotation updates would be a few frames behind location updates?
@ruby meteor Just calling SetOwner is fine
But you can't call RPCs on a non-client owned actor
Maybe that's your problem :P
Is there a way to isolate for instance a sound made by server player in a listen server game? Iβm trying to get a sound replication system happening which includes instant local sounds for clients alongside multicasted sounds that exclude the calling client. That all works, but the jump sound called by client seems to be sneaking past βis server - true, so I canβt avoid doubling up on jump sounds for the client player. Thanks!
IsLocallyControlled
Or IsLocalPlayerController
To filter the local players @gusty lily
Is "IsDedicatedServer -> False" then "SwitchHasAuthority" where only Remote should play the sound.
And then further filter via the stuff I just posted.
thanks eXi. I'll have a play with those
This must be a common question but I can't find anything: why do I get warning like this when running standalone server in the editor? LogOnlineSession: Warning: OSS: No game present to join for session (GameSession)
I'm wondering if it might be related to other problems I'm having π
i thought the editor was not capable of anything more than a lan connection? not too sure tho. it can't use subsystems? not exactly sure but that might be a place to start
Editor does not have OSS, yes.
The warning is harmless
Well, it tells you there is no online support
What network conditions do you guys use to simulate an average connection?
We have pktlagvariance but that is for continuously unsteady connections. Most real connections are steady with rare large spikes
I'm not there yet but people use clumsy for that.
Yeah, I have that too. But it seems to be lacking an option for spikes too
Unless it is throttle
I guess it could be that
Throttle, block traffic for a given time frame, then send them in a single batch.
I just test with 200ms ping myself (round time trip, so PktLag 100) with lots of variability and I figure things should still always work fine, with movement rollbacks of course
TBH, even running local netplay on two machines result in many interesting cases
Right, we always end up with different real world results tho
Because it is hard to simulate a realistic network with the options we have
I actually develop with a fixed 100 ping that's hardcoded in my project settings so when it works, I know it's not a complete joke
But yeah I haven't been into real-world testing yet.
Right, yeah that is a good way to develop
I figure when I get playable builds, I will get some friends to actually play, once a week or something
Just to confirm all works well in real-life
i have an slightly defective wireless network card, its awesome for testing hostile conditions π
I also keep an old Surface tablet that can run games at 10fps over Wi-Fi as a listen server, great for worst-case.
it downloads just fine, but its upload is about 20% effective, packet loss for everyone
a spike thing would be a nice addition to the latency simulation we already have in unreal
you can actually manually simulate a spike since 4.22 (?)
net.pktlossburst or something like this
New: Added new "net pktlossburst=x" debug console command. It will drop incoming and outgoing packets for the next x milliseconds and is particularly useful with the "setbind" command to debug issues that only occur under packet loss.
Nice
also helps to set PIE to always use 200ms latency with some variance and loss
Yo @thin stratus thanks for the help you are right I'm refactoring my code so I use PlayerState for all my player data and they can either be linked to an CustomAiController or a CustomPlayerController . Perfect! I realized something tho, the bWantsPlayerState bool is actually exposed in blueprints in 4.20 and higher π€
So it's even easier
What do you think about a php master server?
Is there a way to check whether a game exists and an IP address?
hey i just encountered this weird bug where my clients movement is lagging and i really dont know why its doing that https://youtu.be/MsKqbTVJNT8
and everytime the char crouches it should get launch forward
where can i find more resources on replication drivers and graphs? i'd like to make a custom replication graph that is not based on spatial partitioning
I watched the unreal engine feature highlight about it, and found this: https://docs.unrealengine.com/en-US/Engine/Networking/ReplicationGraph
it would be nice to have some more details around maybe the driver or something. the video talked a lot about the grid based graph and fortnite, and that documentation is too high level
hey does anyone here know how to run multiple steam dedicated servers on the same linux machine at once? i've tried changing the server port and queryport, as suggested by the last reply on this thread: https://answers.unrealengine.com/questions/787258/how-can-i-run-multiple-instances-of-steam-dedicate.html, but it's not working nevermind. seems the order of the flags matters. -port -queryport doesn't work, where as -queryport -port works. nevermind 2. now it works both ways. probably was just a network fuckup.
@rare gyro how did you fix it?
but when im thinking of it i didnt set a custom movement velocity im just setting the max walk speed variable and when crouched im launching my character forward (Current velocity * LaunchForce)
ah thanks a lot!
I have an issue with replication on a Character BP. All players that are clients can see eachothers name, gender and gear slots. However, the problems lies with the clients not being able to see the server's name, gender and gear slots. I can't really see what I'm doing wrong here
I tried both and both of them dont have any overlays and it doesnt seem that it can find the steam subsystem
it only works for standalone
@fleet viper I just upgraded to 4.22 and suddenly I'm getting that movement lag issue, didnt happen in 4.21.2 so it might be a bug
let me know if you fix it
I'm actually getting massive desync issues since I upgraded to 4.22. Ping is low like 7-10, but insane skipping/hitching for clients
I have no idea how to figure out why, since my 4.21 version is identical but not having this issue. Where do I start for tracking this down?
First thing: Try to recreate the issue in an empty project.
Cause that rules out two things: Is it your code, did it happen through upgrading OR is it an engine bug?
If you can't reproduce it, chances are high you have a bug and it only now visualized.
okay, ill work on that for a bit. might take awhile since im pretty far in development though but maybe something broke in the conversion to the new engine
For a multimap game where the host can choose the game to create, is it possible to use blueprint to search and find what is the map used in games that are currently being hosted so that you can choose which type of game to join?
As far as I know, you need a plugin to achieve that. With the current engine bp is not possible (not sure anyway)
You should be able to use the online subsystem to advertise which map is hosted
SessionSettings->Set(SETTING_MAPNAME, FString("NewMap"), EOnlineDataAdvertisementType::ViaOnlineService);
NewMap here would be GetWorld()->LevelName or something
Advanced Sessions plugin probably does it
@upper raptor This might even work in BP right now π
Alright I will check it out!
I was wondering, with the Advance Session plugin, the OnSessionAccepted event it is fired if I use the steam overlay to Invite a friend? (right now I think it has not fired but it could be because I do not have the game in the steam workshop, so maybe cannot recognize it ?)
@potent prairie did you ever change any of the client rate settings under Engine/Config?
that caused that same issue for me when upgrading before
easy to skip over those folders when upgrading since its not under source
@graceful cave Okay Ill check that out because I get the same problem with default thirdpersonchar and basic controller i setup in a default project
which is a relief knowing its not my char/controller scripts
the client rate settings are the same from what I see.
its like the server updates clients every 1500ms is what it feels like
feels like the client has insane ping
all im doing is pressing left, right, left, right
im not actually running off the screen at all
its just updating so slowly to the clients
I want to do a UI that shows the health of the other players. Whats the best way of doing this? I was thinking of getting the players array from the gamemode
but then how do i tell each player's ui bindings which icon is for which player
because gamemode is only on the server
@thin stratus im reading your guide and i know that GameMode is not replicated to the clients, its server only. But it has the Players array ofall connected players that is replicated. So how do you access that replicated variable from the client if the gamemode doesn't exist?
exist on the client*
oh shit
you're right, i'm dumb
its an array of player states
not player controllers
I have the bug in this video https://youtu.be/QKC9PWe-NV8
It's related to replication of something
as you can see halfway through I click the play menu (it doesn't show sorry) and when I de-select dedicated server the bug disappears
what should I look into to solve this?
maybe I am executing some code just serverwise while it should be executed on both client and server?
the length of the PlayerState's PlayerArray is always 1 no matter how many players i connect
@clear copper do you mean GameState?