#multiplayer
1 messages · Page 4 of 1
Problem is i dont have a budget or spare money to pay for these services
Well you can have lots of cheaters by using a save file to store stuff, or you can try to setup and host your own database server, or figure out how to pay for a cloud db.
Community hosted servers with non-persistent data between those servers? Save game handled on the server's end is fine.
Community hosted servers with persistent data between those servers? Forget about it. It's completely unsecure and people can manipulate any server data, including things that aren't necessarily their own unless you're going to give each player their own login to your database, but still wouldn't recommend since players could then muck up whatever data is entered into your DB.
Company hosted servers (eg. you control the servers) then you can use save games or a database, but a database would probably be better as you can then also easily create external tools to access and manipulate the data if necessary.
Thank you kindly hope to get further
So if you're making an mmo you pretty much have to host your own servers and use a database.
Unless its more like a sandbox type game (Rust, Ark Survival...etc) then you can have community hosted servers and they can track progress using save game on server but there's no data transfer between the individual servers unless you have a database like Datura said but that can open up a can of worms with new sorts of problems.
If you're making a co-op PvE or friends only type game and make it so the players host the games themselves (Listen Server), then you might as well not have a database and just use save game files locally because cheating is already trivial at that point. You could still setup a database and have secure persistent data (amount of gold) but only to find out that cheaters can still manipulate the game to "print gold" at their will.
If I want to send data from Server to Client without using Replicated variables, I have to use two RPCs right?
Basically a Client making a request to the server to retrieve data.
I would use one Server RPC that calls a Client RPC with the data as input, right?
Or is there any other method?
yup, client will have to ask, server will have to return
no other way
I have an actor that the server sets a variable on a component (replicated owner only) but on the client controlling that actor the component does not get this update. any thoughts ?
Great. I wanted to confirm is there's no other message passing system besides RPCs and Rep Vars.
I know about TCP but I'm not using that.
Thanks
@uneven chasm make sure both the actor AND the component are set to replicate
im dumb, thank you I did not have it selected in class defaults
Well I’m using websockets atm and a custom server written in Go…
I've always wondered about custom servers. How do you maintain server authoritativeness?
Obviously a custom server can't perform movement simulations the way the one from UE does
Yes this is one of the main issues. My current solution is a quick and dirty one, using collision tolerances and allowing the client to run around freely while I check the last 10 positions according to what the server has indicated. Any divergence above a threshold is “gently” corrected
But of course my game is forgiving of these issues
Not a competitive 3D shooter or anything
😅
Actually what do you mean by “movement simulations”? I noticed the top down simulation does some pathfinding
I assumed you meant physics etc
I'm using the beta plugin for network prediction on a single physics ball and I'm wondering what the best practice is for where to apply impulse to the ball - would you have the server run the impulse only, or multicast it from the server to all of the clients. When I compare the two, multicast feels just a hair more responsive
but in my brain it feels like replicating the physics without multicasting the impulse should be more responsive since the next update the clients get would be the ball's position changing, instead of having to apply an impulse locally and then wait for the ball to get hit. I guess this is wrong though due to prediction? Local clients need to know an impulse happened in order to not try to correct the difference?
repnotify function can only exist in the component the variable is in right?
Component A has variable, Component B has hud stuff I want to update. Can I create an event from a function on Component B with a target of component a ?
Could this be because the client will apply the impulse as a “single event” therefore simulating the physics locally without waiting for position data from the server to be received ever so often (every tick of the server…?)
lol I gotta learn more about how this works but I think that's close to it. I think applying it locally results in less difference when it compares. Shits confusing but working so far lmao. The beta network prediction plugin crashes for anything complex but seems to work just fine for one physics ball and a few actors to smack it around. Fun stuff!
Oh, no. The current model is for UE to run the game, character movement and other stuff. Then replicate data to the client for them to run approximate simulations of the world.
This works well because client code is a copy of server code. Dedicated server.
With a custom server, you'd have to run the world somehow. I'm just wondering how?
Like if a character moves, does your server run the movement logic. If so how does it match UE's model
i have no idea what you mean by "custom server" here
They have a Go server
if the classes rep layout doesn't match, and i mean for any class that tries to replicate
unreal net driver will boot the client out
hi, when I call SpawnDefaultController() on my pawn to enable the behavior tree, for whatever reason, repnotify with COND_OwnerOnly doesn't work. It seems that when I set SetOwner(PlayerController) it somehow collides with already existing default controller. Anyone has clue how to fix it please?
This requires a UE dedicated server right?
AIControllers do not replicate
you either use unreal networking, or you do everything yourself manually
doesn't matter what kind of server it is
Oh, I see
you can enable AIController replication, but its off by default
also note that with Condition OwnerOnly, the Owner has to be set server side for it to work, too
thanks, but how to create association between AIController and my client's controller so only actual owner of the pawn receives notifications. Imagine RTS game where AIControlled units send certain notifications only to owning player
turn on replicates and only relevant to owner
I forgot what is the debug command that shows the bounding box where "server" thinks the client is. It is used to compare the current "client" position and the actual server location. Do you know please?
and set the owner on server right after its spawned
p.ShowNetCorrections
i think
Duh... Thanks!
so replicate AIController and SetOwner() of that AIController to playercontroller?
yes, and you can turn only UseNetOwnerRelevancy
so the AIController Actor doesn't replicate to other clients at all
then it will be like PC in that scenario
thanks let me try that
Hi there! I wonder what makes more sense to do when making a multiplayer game: Check the context before each chuck of code (IsLocallyControlled(), HasAuthority()...), or instead manage to spawn each class (Actor or Component) only on the context (Server, SimulatedProxy, AutonomousProxy) that is relevant to it. I thought about maybe destroying irrelevant classes in BeginPlay according to the context. What do you think?
2nd approach has limited uses, but its also not how it was intended to work
Yes it does. Mind you it’s rather basic and based on a top down template. So I’m essence it behaves like a 2d game. I send “commands” to the server indicating what the client has done and the server performs the actions, having a representation of the same “map” as the clients + all the dynamic objects (such as other clients).
so its a pain in the arse to manage, and you really need to know what you're doing there @lime echo
Collision is done via quad tree + simple aabb
extra non scene component with the Tick off on an Actor doesn't cost anything
also, getting net addressing to work with locally spawned Actors/Component is much more involved then just having them on the CDO
I currently use the first approach, but it seems like most of the code needs to run only in one context. It'll satisfy me if you tell me that the 2nd approach is not standard. I just want to make sure I'm following the best practices.
think is
when you have a component on class default object
if the actor is net addressable, which means you can send a pointer to it owner the network
it automatically means that component is also net addressable, as it has a stable name (component name) relative to net addressable owner actor
as soon as you start spawning them, if you don't turn their replication on, that no longer applies
So it seems like the first approach is the one to go with, right?
which makes it easier, with virtually no performance difference, to just disable the component where you don't need it
instead of destroying it
Great! Thank you!
Can I have a question about movement replication and moving platforms?
When a player with large ping jumps off and on a platform with replicated, constant linear movement, I see server correction and it makes sense because the platform is at different location when client lands/jumps off.
Possible fix?
My idea is during server FSavedMove replay also roll back the platform, but that seems like a lot of work (both coding and CPU time wasted), so before wasting days on this I wanted to pick brains of the far more experienced community members.
What confuses me is that the rotation FQuat StartBaseRotation; and location of the primitive component (platform) are already included in the FSavedMove_Character so I would assume UE prediction would handle this already.
More context - To get better at networking I wanted to make Fallguys type map with moving and rotating platforms.
you are lucky as UT4 has a lift implementation you can use as an example
it deals with based movement and rollback
and yes, it is kind of coupled with the cmc
Oh lucky me! Thanks for the pointer
Right, makes sense now. Thanks for the explanation
hi guys
i want to make a online game using aws in unreal 5
but i didnt find aws sdk for unreal 5
i can only see aws sdk for 4.26
or 4.27
how to download for ue 5
dose aws skd for ue5 is there?
I am using the SDK for both 4.27 and 5.0.2/3
I wonder how many people made CMC cry so far.. We need a counter!
Yes, I am using this SDK with UE versions 4.27 and 5.0 without issues
Thanks for the UT Lift tip, but it left me more confused than before. I have read UTCharMovementReplication UTLift and UTCharacterMovement but found no extra code for base platform rollbacks (or anything similar). It uses the default "SetBase" call as in default CMC https://github.com/EpicGames/UnrealTournament/blob/3bf4b43c329ce041b4e33c9deb2ca66d78518b29/UnrealTournament/Source/UnrealTournament/Private/UTCharacterMovement.cpp#L1768
I am very likely missing something obvious, thus would you mind giving me more hints what to look for?
oh, it was a long time since I last checked... as far as I remember I believe the platforms were rollbacked for hit registration but I dont remember the details or if I even remember them correctly, I'd have to re-check
This does not seem to be related to multiplayer, but to your InputComponent, which is most likely not set in the settings.
do you know where to do this. also it says manual reset
Ensure if both of these are not null
If they are both set, it is something in your code that nulls the Input class for your actor
it was null and I am building again. ill let you know. thanks for the help
Next time I would suggest asking in the #cpp or #blueprint channels as I suspect you did not change anything in the engine source and it has nothing to do with multiplayer
i thought this channel also talking about windows server issues in multiplayer.seems i am mistaken. thanks for the heads up
is actor blueprint owned by client?
or only character blueprint owned by a client?
what mean by this statement
Actor can be owned by PlayerController, which exists on Client and Server.
so if i spawn an actor in client side, then server will spawn that.
but the owner will be server or the client who is executing that event to spawn
by default?
If you spawn an actor on client, server will do nothing.
unless i do rpc on client, right?
If you do an RPC on an actor that does not exist on the server, it will be ignored.
how an actor can't be exist on server.
If you spawn it on client, then server will not spawn it on server side.
You need to spawn actors (that you want to replicate) on server side always.
consider this example
And then if you want to allow certain client to use RPCs for that actor, you give that clients ownership of that actor.
event run on server inside player character
Yes, that is asking the server to spawn the "New Blueprint", which is different than spawning it on client.
if i make this event non rpc, then it only spawn on client
so no server and other clients can see?
yep
so it means when i run event on server, then what exactly server does
server replicate that event to all clients?
The server spawns the actor on the server side. That's all the code does.
I guess your question is how does the "New Blueprint" actor gets to clients?
That is part of replication. If the actor has Replicates enabled, it (the actor on the server) informs all clients "Hey, I am at 100, 200, 0." and clients create the actor on their end.
yes replicates set to true
And do your clients see the actor?
of course
Wonderful
that's the thing I'm trying to understand
the other question is "what is use of multicast" if server already informs to all clients with server only event?
i'm running event only on server. but server tells to all clients. however multicast do same thing?
Multicast goes from server -> all clients. Previously mentioned "Hey, I am at 100, 200, 0." is a multicast.
If you have a chest which one of the players opens, you can use multicast to inform all clients that it chest has been opened and it should play a sound.
so every event gets called on server means all clients can see that event
but that event doesn't gets called inside each client, rather it just only server event?
No, only multicasts run on all clients.
exactly. you mean server event and multicast is totally different
Yes
server event = runs only on server and other clients can see what is happening on server
multicast = run that event inside each client blueprint graph
Not exactly, server event just runs on server. It does not inform clients if not further instructed
well. that sounds like same
If you run Print("Hello") as a server event, it prints it only on server. If you run it as multicast it prints it on all clients
are replicated variables automatically inherently multicasted?
i spawned cube in client side with server rpc. other all clients also see that cube and server also see that cube
so all clients can see
Yes, because it happens like this
- You call server to spawn object
- Server spawns object on server side
- Object initializes and checks if it's replicated
- object IS replicated and informs all clients via Multicast that it spawned
Spawning it on server and replicating to clients are two separate systems/events
right now cube blueprint is set to replicated
and gets called on server
i didn't do any multicast
It did internally
If you turn the replication off, you will see it still spawns on the server, (steps 1-3) but it does not do the step 4
But it will exist on server
correct. now i tried multicast. when i spawn on client, it spawn two times
If you spawn an object using multicast, it will ask each client to spawn an object. But that object is not "the same object" from the server perspective. So if you move the cube on the server, it will not move clients because those spawned their own version of the cube.
yes that make sense. since server also spawn
So the correct way is to spawn it server and have replication turned on on the actor.
great. from where did you learned these concepts? any video references or guide to become expert
Official docs + trying it out
pinned comments- 5th comment down
ok got it. i already downloaded this book
when executing custom events with rpc, then it will necessary to pass parameters inside event? or they can be directly connected like in image
are both images have same behavior?
ok
so, once you run something on server, you can't take that execution line and not have it running on the server, right?
you'd have to sequence that before the server calling node?
only inputs passing with custom events or they inputs can be passed directly? like above two images. i thought they have different behavior
i don't know what you mean
the two images above are identicle
they will have the same effect
images are not identical. but technically they might have same effect?
are you saying they don't have the same effect?
well. that is my question
visually not identical - technically, identical
thanks for clarification
question:
so, once you run something on server, you can't take that execution line and not have it running on the server, right?
you'd have to sequence that before the server calling node?
yes
How do I replicated variables that are in a component subclass?
If the component is owned by an actor does it just use the actor channel?
can i set variables of game state from client?. or i can only read variables of game state inside client but not change them?
Only the server can change variables.
If you want to change things, ask the server.
(You can set local variables to whatever you like, they may or may not get overwritten by the server at some future point.)
Yes
What is the best way to send a bunch of 10 different float properties all together to the client on demand when the client asks through a server rpc?
Simple approach is to pack all them into a struct and send. Is there a better way to achieve this?
TArray would be pretty simple?
From struct it would be easy to access the property, I can get it through struct.name instead of array[index]
It really makes no difference which data structure you use.
I am worried about the network performance when sending these many properties all together
I mean is there a ways to make it optimized over the network? Suppose the struct have 20 properties, still the normal flow would be all fine?
20 floats is nothing
Depends how many times a second you send them over
And to how many connections
about actor replication and garbage collection: if a actor is owned by a specific PlayerController and the playercontroller does vanish (becasue of disconnect or whatever).
does it also detroy the actor it owned? or does it stay behind like a unwanted child? or does ownership just jump up the ladder?
actor without ownership should not be possible. or can it?
so i need to explicitly need to brake it down if i don't need it anymore then...
good to know 🙂 ty
on EventPossessed I spawn BP_Chat for each pawn, also setting the owner of this BP to given pawn. But when in BP_Chat an event is triggered, it says that only server's Pawn is the owner (in Standalone, in PIE it works fine, also LAN it works in Standalone too, online not). Why?
It looks like Owner reference isn't replicated to clients. On server it correctly says who is owner, but how am I supposed to call ServerRPC inside BP_Chat when owner is only set on server?
i believe the rep notify is running on server, and i can't get it to get back to the client's pc to update the UI client-side
any ideas?
Use dispatchers for updating UI
delegates
i'll give that a go
Wait, what. When you walk over a health pickup, you damage the pickup to destroy it?
Why not just Destroy() ?
no, the apply damage send an int to the character that collided with it...
So you're applying 10 damage to the player when they pick up health ?!
That's most bizarre.
Also, the red server part of your paste should be at the very top. Only the server should deal with collision with pickups.
you've missed the point
No, I'm totally not helping with what your actual problem is. I'm just giving feedback on your methodology.
the event any damage is the server event
and that event can do damage as well as heal... its just an int
Is both your health component and health variable set to replicate?
That's true, I just find it odd to do healing via a damage event!
you like to get hung up on the little things, don't you?
I do.
i don't think actor components rep...
oh wait... they do
i think that was the problem
i thought they just inherited that from the actor
you fixed it - thank you
Does anybody know how to send a rpc call from client to server in unreal ? I am able to update the clients with events or variables over replicates but cannot update the server :D
That's what a Server rpc is. Can only be called on actors the client owns.
this compiles despite giving the error, and OnRep_ItemSlots is an onrep function in parent class that is overriden. will this still be properly called?
Did you UFUNCTION() it?
oh no I did not
well yes I did in the parent but tried in child and it got rid of error but then didnt compile
Can any talented peep tell me any talented idea to make a player's talented property only replicate to his talented teammates?
Thanks for your talent in advance.
does stuff inside animbp need to be replicated
anim blueprints don't get replicated
you'll have to replicate the state of the character and use that in the anim bp
coz Anim blueprint are not talented
Keep the properties in a proxy actor that is only relevant to his teammates
@solar stirrup why does my animations still play on both server and client if animBP doesnt replicate?
shouldnt i only see it on client side?
do you want it to?
📹 Part 4 of our replication series unlocks limitless potential with Multicast and RepNotify! In this video, we dive deeper about how Unreal Engine's Actor Replication really works as well as introduce ourselves to a variable replication and how combining the power of variable replication with an event driven design can help us build a multiplaye...
idk if that's your problem but it might help
Guessing this is built in? Or is there some sort of setup
That's not how it works, everyone is fucking the animBP replicated or not. If you don't want it to tick for server then you need to set that
having a bit of jitter client side, have a pawn that has forces applied to it on tick on server side but movement replication is jittery
any way to smooth the movement?
playing as a listen server is fine though
Looks like you are missing client-side prediction, which is a bit complex topic, but you can read up on it in CMC. It is probably not going to be easy journey to understand if you have not dealt with client-side prediction before, so I wish you best of luck.
To do a proper test of your current system I would recommend adding some lag using net pktlag=200 and see how the car behaves with some non-minimal lag
You could do what PavKon said and look into client side prediction, unreal engine should be able to do a lot of the heavy lifting for you or you can just do the same calculations on the client that the server does and pray they stay in sync
Curious to get some multiplayer thoughts on best approach.
Context: I have 2 components and a hud widget
- component A manages health equipment and other related variables/bps
- component B manages all the different ways you can take damage
- hud widget with a event that updates health ui. this event takes an input of health & max health to do a % for the widget bar. Then it sets the current health / max health text getting the health values from component A
The problem:
component B sets component A sets health to the new value after damage is applied and health is replicated, owner only.
then component B calls widget event to update ui but the event updates the bar correctly as the data comes though the input correct but the text being set for current health/max health gets it from component A and is always one "attack" behind on its value.
flow is something like this weapon collision anim events (component) -> taking health (component) sets equipment (component) health variable AND calls Hud update event which gets the replicated health variable
Is the event being called to quickly for replication of the health value to happen? Its always one "hit" worth of damage behind
Your game logic shouldn't really call changes to UI directly. Use an event dispatcher in your components and call it whenever your health changes (Health should be an OnRep variable, yes? Put your call to the event dispatcher in the OnRep function) and have your UI bind to it so the UI can update itself. This gives you additional flexibility in your UI in case you want other things to happen whenever a player's health value is changed, or you decide to scrap the UI entirely.
its replicated, owner only and all the interactions are through events
What is owner only?
health variable
yea eventually just getting it working for its own hud 😄
just to make sure if i wanted it replicated for everyone else is that leaving it with no condition ?
Then it doesn't need to be set to owner only - no condition is fine.
Regardless, your Health Variable should be "Rep w/ Notify". That'll create an OnRep function that'll be called whenever the variable is replicated.
The OnRepFunction can then call the event dispatcher.
In the OnConstruct of the UI that cares about the player health, you bind to the Component's dispatcher, so you'd have to get a reference to that component within the widget.
You can also make the event dispatcher pass values as well, so if you do, then on the receiving end in the UI it can directly read the values from the dispatcher without having to get reference to and look at the variables in the component.
Later on if you're wanting to see other player health values, you'd do the same thing - get a reference to the component that contains the health of that particular player, and bind to the event dispatcher to listen to values changes in whatever UI you want to see the value.
Makes perfect sense, Ill let the component dealing damage just worry about applying the damage, add the OnRepFunction and tell it to call the ui events which should guarantee all the numbers are the same at that point
@sinful tree thank you for guiding and validating that direction 🙏
thank you! i went down a rabbit hole researching this but i found this to help
Syncs transforms Smoothly across the network.
Smooth Sync for Unreal: https://www.unrealengine.com/marketplace/smooth-sync
Discord: https://discord.com/channels/548861047117709323/685324470939811910
Forums: https://forums.unrealengine.com/unreal-engine/marketplace/1492482-smooth-sync-sync-your-transforms-smoothly-across-the-network
Support: u...
how can I set Seamless Travel depending on how I'm testing? I'm so tired of turning Seamless Travel on for testing in steam then having to turn it off when testing PIE.
so, mystery time...
why when i pickup a health pickup the listen server logs it twice, but the client logs it once?
everything works fine, but its just weird and i want to find out what it is if i can before i move on.
I load in and they both update to max fine.
the server actually loads the default color of the progress bar after it loads correctly, but I just use the same color np.
then i hit a button to take damage and 2 of them show up. Then I run over the health pickup and 2 more show up.
That's kind of the worst way to update a health bar
it seems more complicated than necessary
you have no idea what i'm doing
Can you debug it then check the call stack to see whats calling it twice
let me try that
If you can figure out where the initial trigger is coming from then you've basically solved your problem already. You can hopefully do that using the call stack or maybe even the execution trace
In what class are you creating your widget? Character? PlayerController?
@sinful tree does a repnotify function run on the server too if so and I am just updating the hud then I should switch auth remote path is my thinking
In blueprints it does. Can't use HasAuth node within a component though, you'll need some other way (maybe just an IsServer check?)
yea isserver check will work
would anyone know why this doesnt seem to be changing?
this is on an actor in the world
The actor probably isn't owned by the player that is making the call to SetSelectedArena. You probably have a warning message in your log indicating something along the lines of "no owning connection..."
To fix, replicate the selection through a player owned actor, like the player controller, then when running on server hop over to the actor.
it should now, ive made an adjustment to forward owning client -> server
its a modkit btw if that clears up some confusion lol
Is "rollback netcode" a common thing in FPS or other online games that use projectiles? I'm imagining a system where a client fires a projectile, and the client immediately sees the projectile spawn and start moving, and then when the server knows of the projectile's existence, it places the projectile to approximately where the client is currently seeing it, predicted based on latency
I don't imagine I'm the first person to have thought of that
Anyone know if that sort of thing would be hard for a beginner (in terms of online multiplayer) to implement?
Ok I have a very basic question because I am doing something wrong. Can someone show me a node setup that sets a replicated variable?
For me my clients seem to get two calls of a function. So if I increment a number by 1 they get 2 instead. I don't understand why this could be, but I'd really like to see an example of something that works, because I can't find much online.
The other thing is spawning an actor, and no matter how I try I can't seem to get that to work either
I can call a server event in order to spawn it and still it only happens for the client. I just don't get it
Jokes aside....
For replicated variables you typically only want to set them when you know you're running on the server.
So I definitely don't want to set them in a multicast then
No
When is multicast actually useful? So far it seems like every case where I try to use it is wrong
When you have some kind of event you want triggered on all clients. Like playing a sound or visual effect.
Something that is fire and forget.
So basically visual stuff, never actual gameplay
It can be gameplay oriented too, but there may be a better way of doing it.
Hey I'll be happy to cut multicasts out of my diet
It's just an event that you want triggered and all relevant clients to respond to.
Do you have any idea why I might have events that trigger twice for the client but not the server?
In other words, it's like making a "Run on Owning Client" but making all relevant clients do something.
Without seeing code I couldn't really tell you. Best guess would be that maybe you're calling something only on the clients.
It's basically just calling a server event on the player controller, which then calls a server event on an owned object
Can anyone suggest a good tutorial for multiplayer coding where the focus is scale of numbers of concurrent players to the hundreds? Think Diablo style game not battlefield if that makes sense.
If I call a server event in a player controller, which then calls an event in another actor, does that other event also need to be a server event since we would already be in one?
You can try calling SetOwner anytime after you call SpawnDefaultController though most probably this will cause issues to your NPC. If it doesn't work as intended, you probably have to spawn an actor that is owned by your PC and that each NPC pawn references and changes its values. I'm still not sure what you're trying to achieve with this though.
No. Once you're running on server or client, any non-RPC events will execute on the client or server depending on where you're running.
I doubt you'll find any. Your best bet is to explore the so called "Replication Graph"
Oh damn, thanks mate. I want to get something simple off the ground as a PoC. I got feedback that unreal eng as a server was designed completely for 3D shooters and matches (I mean it’s unreal after all) and if I wanted to break out of that mold into a persistent mmo type world I’d better look at dedicated solutions.
But educating myself a bit more I see that there are no player limits per se. So if your unreal server is simple + well done = you could handle hundreds of players.
I think I’ll continue down my track of having a custom server and use Unreal mostly as a front end + renderer and communicate via websockets initially
Oh yeah an MMO. Not many MMOs that I know that was made with UE. The only one I can remember now is Lineage 2 Revolution, which I'll wager they done too many modifications to the engine so it suits their game. Since Fortnite came to the scene, the RG was introduced and it's pure gold tbh. Though I doubt it will be enough for an MMO. Good luck, unleash your creativity!
hi guys so iam following AWS for unreal tutorials
Welcome to Building Games on AWS, an AWS Game Tech YouTube series where we teach you how to use AWS to build games! Building Games on AWS will cover a variety of topics, including analytics for games, AI/ML for games, hosting game servers, game engine integration, and more.
This second series will be about integrating Amazon GameLift with Unrea...
in this video
iam getting this error
seems like some target is not set
Dumb question, but is it normal for a multicast event to update only the clients, not the server lol? This doesn't update the server's variable when on multicast, but does when set to run-on-server with the variable set to replicate
that is a really bad way to run a timeline
you're replicating a variable that changes on Tick
and the time flows at the same rate on server and all connected clients
lol yeah when you put it that way...
guess I should run the timeline without replicating anything, then replicate the result when it stops eh?
Timeline is a full ActorComponent that does its stuff on Tick packed into a single node
you should replicate start/stop events
but they can handle the update on their own
always simulate everything you can get away with
Does a Non-Possessed Character not cause Overlaps on ServerSide? :<
I have a Character that moves forward by default (custom CMC). It works all fine if the Character is possessed, but as soon as I unpossess it, it won't trigger the Overlap on the Server anymore.
Neither Hits nor Overlaps. Guess I'm stuck trying to see where that is filtered for no reason
doing something similar lol. My hits are like 50% from the server. Haven't figured out wtf's causing it yet. Characters are possessed in my case so it's going to be me being a n00b again
Does the player state & player controller persist when a user disconnects? Suppose we want to make him reconnect, so a new player controller is spawned? and what about the playerstate?
They get deleted as far as I remember, but you can make a state copy (your FStruct) on disconnect
Playerstate too gets deleted?
I believe so
player state gets duplicated and stashed into inactiveplayer array in gamemode
I was wrong then
you can override OnDeactivated on PS to stash any additional data you need to restore player on reconnect (c++ only i think)
as the unique net guid is unique for a particular service (like Steam) the engine is able to match reconnecting player with their inactive player state
it lasts for 5 minutes before its deleted
CopyProperties can be overridden too, though it intersects with the fact that it's called for seamless travel too
Though you got Reset() in that case
copy properties is not meant for this
It is
as you are likely to need to pull some data from the pawn itself
in order to restore it properly on reconnect
copy properties can't do that
like, make it reappear on the spot it disconnected from
requires PS to know Pawns disconnect time location, which it normally doesn't
Hey, does anyone know if Unreal has a callback for when a user presses this button in the Steam overlay? 🙂
OSS has OnSessionInviteAccepted i think for that
or something very similar
OnSessionUserInviteAcceptedDelegate = FOnSessionUserInviteAcceptedDelegate::CreateUObject(this, &USolsticeOnlineSubsystem::HandleSessionUserInviteAccepted);
Thank you! 😄
Wondering why that happens? I mean CopyProperpties is called before OnDeactivated is called, so it makes more sense for CP to win over OD 😄
for copy properties to work
PS has to have all the data you need already
and for restoring disconnected players, it often doesn't
even if you had the foresight to put your inventory on the PS so it remains
you still need more
i have a FDisconnectedHeroData struct in PS
that gets populated exclusively from OnDeactivated override
Hmm... I see. I should play more with this then. I mean it's really strange that CopyPropreties is the one called inside Duplicate. If it causes issues, then we've all been misled 😦
Yeah unless, you fall in that hole, you never know it
I was also wondering how transient properties and non-uproperties do really persist. They get copied with no issues whatsoever.
I asked the guy what was his real issue though and he didn't remember 😄
He just didn't duplicate the PS, but kept the original one, which feels like counter attacking the engine, and that solved it ^^
While the experts are here, I wanted to ask about CMC client-side prediction on moving platforms.
When a client with high ping jumps up while on a moving platform, it triggers correction (both when starting the jump and upon landing).
While running on the platform it behaves correctly. I assume the correction it is due to the fact location used in saved moves is relative to the base (primitive character is standing on), so when user jumps we switch from relative to world space.
Is there any way to fix the correction when jumping on a moving platform?
My first attempt was to teleport character to the location client said it performed jump (which is unsafe) before executing PerformMovement, but that also resulted in big location delta and correction.
we either did that, or flirted with the idea, i don't remember
I think this is not what I was searching for, my bad. To clarify I want people to be able to join through this way but it doesn't work by default and I'm not sure why 😦
I thought only primitive data-types bypassed it, but I tried with more sophisticated ones, and they work too. I mean I'm expecting some gotchas there man 😛
im always expecting glitches
/**
* If true, movement will be performed even if there is no Controller for the Character owner.
* Normally without a Controller, movement will be aborted and velocity and acceleration are zeroed if the character is walking.
* Characters that are spawned without a Controller but with this flag enabled will initialize the movement mode to DefaultLandMovementMode or DefaultWaterMovementMode appropriately.
* @see DefaultLandMovementMode, DefaultWaterMovementMode
*/
UPROPERTY(Category="Character Movement (General Settings)", EditAnywhere, BlueprintReadWrite, AdvancedDisplay)
uint8 bRunPhysicsWithNoController:1;
Run PHYSICS With No Controller
Table flip material
So this is true by default then?
I mean that means turning this to false won't let the character keep walking, preventing him from going into that trigger box?
It's false by default
Yeah, I mean the char keeps moving
But doesn't trigger overlaps for server
Setting teh boolean to true makes it work
Good find! Goes and writes down notes
you'd typically do const FData&, UHT might even enforce it for an RPC
Use p.shownetcorrections 1 in console to visualize the capsule corrections. It looks jittery to me because it’s lacking animation blending.
How much simulated lag are you using?
How to get data from a player state of a disconnected player like name, team ? As I read that player state gets destroyed on disconnecting.
what is playfab platform? and what is use of that in video games?
By default it doesn't get destroyed instantly, it gets put into the "inactive" player array in the GameMode for five minutes and is then destroyed. Why would you need to access that info though?
Maybe store a copy inside of gamestate?
In the playerstate, I am storing my teammates playerstate. Suppose a player is disconnected and his pawn will remain there. If someone kills him I am broadcasting a multicast from victim playerstate with killer and victim playerstates as arguments to the multicast. where everyone locally checks if the player died was teammate by checking properties stored in the playerstate.
Since player state is always relevant so it makes sense to put all stuff there. But if a player disconnects thats a trouble.
Well technically if the player has disconnected, they are no longer a Teammate
That's fine but so long as they aren't in the match, they aren't playing and not gameplay relevant. So really that pawn should just be nuked, then you spawn a new one and reassign them as a teammate when they rejoin.
If you disconnected from an online game, it seems unfair to allow other players to kill you while you aren't playing, then rejoin and suddenly be +10 deaths or something
I think naman wants to keep the disconnected player’s name and score.
you can keep that just fine
The player state will be automatically assigned back to the same player if they rejoin within the window
Within 5 minutes?
IIRC that's the default yeah
When a player rejoin, a new controller is spawned right? So it will be assigned when we repossess the pawn?
You won't repossess the pawn, a new pawn will be created
So during the 5 mins their data is available under InactivePlayer array
And how to let the game server know that the inactive player state have to be assigned to this new player again.
How do we assign the player state again
The engine does it itself
Is it something like device id?
It uses the uniqueID of the player from whatever online service you're using
How does the engine keep track?
See AGameMode::FindInactivePlayer
Oh ok. Thanks a lot
how would i sync procedural generation onto multiplayer? Right now i have it that one client has a combination of blocks. But on the other client has a different combination of blocks. How would I make them have the same combination of blocks?
You use random variable from stream nodes in combination with a shared seed for the stream.
Depending on how big the proc gen is, you could also just make the actors that are spawned replicated.
well its not spawning actors, its destroying actors and leaving the others left over
Same thing. If marked as replicated, then it can be handled by the server and destroying them should remove from everyone else.
i have the left over actors as a variable, how would i change said variable to be replicated?
wait i think i just found it
no i didnt
Why would you need to replicate it?
If we increase the ConnectionTimeout, can we prevent the player state begin put in the inactive array?
No, there's a dedicated setting for it. You can't have them stick around forever though, or you risk the server being inundated with inactive players. Remember they still replicate even when inactive.
But what would be replicating if there's nothing changing? Is there some sort of overhead happening per tick deep within the engine somewhere?
I think at worst it would be doing relevancy checks? Thing is, you still don't want them staying around permanently as that's effectively a memory leak. As more and more players disconnect/leave the match, more and more memory will be consumed holding on to their inactive playerstates if they don't return.
Ahh, that makes sense.
Assuming the player is never disconnected, still the server is running with replicating everything the character is doing. If he is disconnected, even though he is stuck around, it is relatively better right? Taking that into account, we might consider increasing the connection timeout if I am not wrong?
That might be the case for MMO games where server is running forever. But for short session based games we might consider doing that?
You'll still run into issues. For example, someone malicious may figure out they can crash your servers by constantly joining and leaving under different accounts as the number of playerstates builds up and eats the available RAM.
We don't allow joining midway. What we want is to start the match with the prejoined players. And only if the joined players disconnect, they can reconnect. In that case it might make sense to increase timeout ?
trying to make a simple chat
I have functionality working for the local player, when they send a message, but doesnt show up on other clients.
Is it the events replication that needs to change... or am I supposed to create the chat widget somewhere else besides the players, like on a game mode or game state or something?
Basically, how do I get the message to be created on other players? Do I NEED to be connected to steam or some other server. Atm playing as client, and as listening server, return the same result.
my understanding is that player controller 0 is local player.
I'm wondering how it did show up on that client 1 screen
Probably the client who wrote the message
I mean if it was a listen server I would be ok
The custom event is on the widget, and that custom event is set to replicate.
If you want the message to show up on other clients, you need to send it to the server through an actor the client has ownership of, and then to the other clients from there
Widgets only exists on their clients, so they never replicate
Yeah that's it probably.
I do have a HUD class but that is just another widget.
Ah ok. Here it is
Widgets don't replicate. So you can't RPC
Hey Exi. Thanks for your documentation.
The doctor has came
Chat messages are usually send through the PlayerController or a replicated component on them
There is a system already in engine. ULocalMessage thingy
Which should be accessible via GetOwningPlayer in the Widget
If you supplied it when spawning the widget
You can then push that into some replicated array or so in the GameState. Or send a multicast if you don't care about chat history
+- limiting that array in size so it doesn't grow too much. Specially in blueprints
I like that idea for chat history. Save all messages to an array.
I am creating the chat widget in the HUD I mentioned. Youre saying I can create it there but need to provide this owning player with get player controller?
It would work. But it might not work as you expect sometimes, that's why he said GetOwningPlayer
See his compendium, he explains what GetPlayerController(0) returns on different configs
Changing net update frequency at runtime not working. Do we need to enable adaptive frequency update to manually change netupdatefrequency too?
so when its created I should use GetOwningPlayer instead of GetPlayerController 0. The engine just knows who the OwningPlayer is?
CreateWidget has an owner pin
Which you should usually supply
It's important to specify it
Imagine a split screen scenario
Good to make it a habit right from the start to stay relative to classes by getting them like this instead of using static getters
right. Bad habits from making lots of single player games lol. Very rigid systems.
Do i have to be using steam or eos for this to work?
No
so i am giving it (main menu) an owner on creation. Chat widget is attached as a child.
And giving the "create chat message widget" node an owner too.
the custom event is running on owning client, because we are targetting owners of the widgets so thought that was a good idea.
btw I read the compendium haha and reviewed several times.
Some stuff dooesnt stick so decided to use this chat as a way to practice and get real understanding.
here is the play settings so we're on the same page
anyone?
Widgets don't replicate.
Even if you tell them too lol!?
Yep, there's no replication supported in widgets, either RPCs or replicated variables. Dedicated servers don't even load widgets.
So a local player types and sends a message and then somehow other players have to get the message themselves
A global chat message flow would be like:
Submit Chat message > Get Player Controller > Run RPC to Server on PlayerController sending the message > Server Gets Game State > Server Runs Multicast with the message + sender data > Multicast updates UI somehow of incoming message.
Probably best to do an event dispatcher in the gamestate, then your UI can just bind to it when its constructed and receive messages automagically.
ok I will try and process/setup the steps you laid out and most likely be back haha
What is the difference between Event Handle Starting New Player and OnPostLogin? And which is better to use in a gamemode that waits for all players to connect so it can start the game? (I've also found out several forum threads complaining that one or the other doesn't work in seamless travel, don't know if it's true, but I use seamless travel)
I really appreciate this haha!
That font.
ComicNeue (Not ComicSans XD)
Still awful!
Yes the latter doesn't work for seamless. HandleStartingNewPlayer works for both seamless and hard, that's why it's preferrable
The attacker does damage to another char. hp works. the other char doesn't fall down dead, but the attacker does.
Is this a targetting problem or networking problem?
This is most probably a GetPlayerXXX(0) problem
ok i see it thanks
solved it awesome
While not bad practice, this is only required for widgets created outside of the controller, or an already owned widget. So if you're three widgets deep creating rows for an inventory that was already specified by the container that created and opened the inventory, it's not necessary to worry about. Basically as long as you specify the owner on the main widget that creates and owns the rest, you'll be fine ignoring that. Amusingly, there's no HUD check here. I wonder if I could PR that...
How do you play audio and effects for something like a weapon immediately for the player who used it while also playing the audio and effects to other connected clients without hearing / seeing them twice? The player who shoots the gun hears/sees the shot and the network delayed shot when using a multicast.
In the Multicast: Check if IsLocallyControlled? If yes skip.
I was right after all xD
I moved the audio component to be on the character firing the gun instead of the bullet and play the audio using the actor's location which I can now hear once per client because I'm checking isLocallyControled.
Yeah makes more sense for it to be on the pawn
Are you sure the PlayerState still replicates even when inactive? I'm aware of the OverrideWith non-sense but I don't think that has to do anything with this. I mean this is what I see when I look at this sane source code at least:
// AGameMode::AddInactivePlayer
// make PlayerState inactive
NewPlayerState->SetReplicates(false);
// delete after some time
NewPlayerState->SetLifeSpan(InactivePlayerStateLifeSpan);
You also probably don't need to play anything on the server in case of a dedicated server.
for multiplayer, is it best to create HUD and add to viewport within the HUD class, or should I do it in the controller?
Ive always just done it directly inside the player character but have the impression that is no good for multiplayer.
Are there any huge risks/issues with destroying/respawning actors repeatedly on servers?
It's not really a question of multiplayer as it's a question of better practices and better code management. You can go for both ways as long as you know what you're doing. Though using the HUD to create widgets is better as you've got one instance for each client which is easily accessible from the PlayerController. Also UMG code inside PC can bloat that class very quickly resulting in a less optimal class
TLDR: Use the HUD to manage your widgets
That's a very generic question. Nothing specific I can think of actually. Though that results in more cpu cycles and strain on the server
Awesome awesome, ty bro
Ok so then Im having an issue then with referencing my HUD within the player controller. Ive set it as a variable at begin play but the cast is failing. This feels super basic but no clue why it failing.
This is within the playercontroller
Have you specified that HUD class in your GameMode settings?
Ah ok BeginPlay
When does the HUD class actually get created 🤔
So BeginPlay is called on both ends. server and client
thought perhaps playercontroller begin play ran before HUD begin play had a chance to create the widget.
PostInitializeComponents
Before BeginPlay guaranteed
I added a 1s delay for the playercontroller begin play, before the casttoHUD, and still fails.
HUD is client only, so when runs on server you get that error @queen flower
Never use a delay node in multiplayer
just testing the sequence of events
Use a switch has authority with the remote pin there
Nope that's not the case. See what I wrote
So i want to store the HUD in playercontrollers begin play, after a switch HasAuthority from its remote pin?
Yes
Are you sure you are executing that breakpoint xD?
Am i also supposed to have a switchhasauth for when the hud is created?
@fathom aspen From what I can tell - HUD gets created during PostLogin.
In the GenericPlayerInitialization(NewPlayer); call
(Which should still be before begin play, I know)
yea lol that is for sure executing. the red arrow appears and I am snapped to that node when it does.
That tells the client what class to use
What is that from?
Save all, close, relaunch lol
You have HUD Main Menu set up as the HUD in your world settings?
My next blog post
ok lol
Is it better to us interface or delegate when communicating with game mode?
What works best for you?
relaunched and same issue. If youre not apposed, willing to share my screen to save time.
not in hurry lol just feel like with the amount of things that could be wrong.. might be worth going through the steps.
That seems so wasteful to do this twice. PostLogin gets called even in non-network scenarios. In there it sets the HUD as well. PostInitializeComponents will set the HUD only if is a client as well.
Shit I didn't ALT+G. Let me take a look for a sec
Hmm
/** Spawn a HUD (make sure that PlayerController always has valid HUD, even if ClientSetHUD() hasn't been called */
virtual void SpawnDefaultHUD();
In what scenario would it not be called?
PostLogin doesn't get called when seamless traveling
Ok but if it was spawned already where does it destroy the old one? Or skip spawning it?
ClientSetHUD will destroy that one
/** Set the client's class of HUD and spawns a new instance of it. If there was already a HUD active, it is destroyed. */
UFUNCTION(BlueprintCallable, Category="HUD", Reliable, Client)
void ClientSetHUD(TSubclassOf<AHUD> NewHUDClass);
I see. Why the hell it's done like that though?
dafuq if I know.
There has to be a situation that we're just not seeing.
Either way - HUD is created prior to begin play 😅
Probably for doing some mysterious stuff I haven't known yet
Wow, I have to look into that
void AGameModeBase::PostLogin(APlayerController* NewPlayer)
{
// Runs shared initialization that can happen during seamless travel as well
GenericPlayerInitialization(NewPlayer);
First comment mentions seamless travel.
Yeah because it's called inside HandleSeamlessTravelPlayer
// Initialize hud and other player details, shared with PostLogin
GenericPlayerInitialization(C);
The plot thickens I guess
I mean the comment here says it all. They want valid HUD at all times, which proves our point that it must always be valid xD
But in what situation could it not be valid 😭
except in my case lol
A question for Zlo or Jambax I guess
Guess we'll have to ask uncle Tim
So Ive moved to creating the main menu (and chat) within the controller and finally have the text appearing at least on the screen of the player that typed it.
referencing the mainmenu widget instead of the hud.
I'm pretty sure James will go insane if it seems to be another UE non-sense no one has noticed before lol
Its not unusual for it to be me that exposes this stuff lol
The only reason it stuck out to me was because I've been interested in seeing the start up process 😅
So I just got curious about when HUD actually does get created.
You made us find some time bomb 
Or wizard and I just don't know something that Jambax and Zlo will be able to clarify
Yeah good question really. That shows how fragile my blog post is 
Just to clarify, I should be creating the chat for all local players/clients, and not on the server only correct?
ah.. widgets dont replicate..
Nah - client only
That kind of makes sense as it'd seem they're likely to be local specific
It does seem you could have replicated data set up updates for each client though.
Just to cover all obvious bases, a controller is spawned for 2 players if I set the number of players to 2 correct? I dont need to manually tell something else to create a 2nd controller, for player 2, for example?
and playercontroller 0 is always local?
SpawnDefaultHUD() is called in PostInitializeComponents() by the PlayerController right before BeginPlay is fired.
Correct
If you're running on the client, yes, but it's better to try and avoid using that in multiplayer altogether.
Yeah, we've already identified this part. But GameMode also sets the default hud in PostLogin.
Widget can use OwningPlayer, HUD can use OwningPlayer, PlayerState you can get the owner which is the controller, Character/Pawn you can get the controller. Components usually would be attached to controller or the character or even the playerstate, and thus, you can get the owner of the component and from there cast to wherever necessary to get the right references. Anywhere else, you probably should be feeding in a reference to the specific controller.
any idea as to the benefits of creating the main menu within the game instance? watching a tutorial and they did it there. Not sure why.
Game instance is also created per player just like a controller?
I think the reference / object remains, rather than recreating it again.
Game Instance is unique to each running copy of the game.
ah interesting
so all players within a shared game experience... are aware of the same game instance?
So if I was playing your game, I'd have a Game Instance on my client, you'd have one on yours, and the server would have its own Game Instance as well.
ah jeez
No, it's an unshared object unaccessible to anyone but the local game (can be a client or server)
GameState is the object to use if it's something that there only needs to be one of, but it can also be shared & replicated.
so that could be ideal for creating a chat that carries between levels?
Store received chat messages in the game instance, rebuild the chat window from that list on load.
I'm not sure if the widgets will exist between level loads... Trying it out myself right now.
-- sorry back to this question, does someone have a minimal viable multiplayer example where player positions are shared over the internet that's available for download or purchase?
I'm just trying to see an example with almost everything stripped out other than that
(built a multiplayer VR game like literally from scratch in JS, never wanna do that again, lol, so am looking for something a little more plug n play in unreal)
I was told here last time that lyra is too complex to start with
I agree with that haha
https://docs.unrealengine.com/4.27/en-US/Resources/ContentExamples/Networking/ <-- like what the hell is this and where do I find it
Is it possible to set some datas from client before reaching OnClientConnected(AOnlineBeaconClient* NewClientActor, UNetConnection* ClientConnection) ?
Or data are not replicated yet ?
helpful thank you
trying to go look at the network one now and see if it's chill
good luck
I also have this one that I made a while ago. not sure atm which engine version but it was intended to be minimal, 2 players join and you see each other moving
do you know if it works with 5? and-- over the internet not a lan?
Should be over the internet. I did build and play it with friends from other homes/pcs.
you can rebuild for ue5 but I expect it to break...... would be really interested in the results.
I also have a huge splash screen of text on the default level that explains things ive come to understand about multiplayer that might have useful info there
So yeah, widgets and their data can persist through GameInstance.
thats super awesome
Any ideas ?
Just be careful with references.... Things may need to be rebound on load as the old references would be gone after a level transition.
tbh I am still having trouble with getting text to appear on the clients lol but this is good intel for future steps. I dont NEED to create the widget on the game instance just good to be aware of the benefits. so What is the different between game instance and game state? You mentioned the gamestate earlier. "Submit Chat message > Get Player Controller > Run RPC to Server on PlayerController > Server Gets Game State > Server Runs Multicast with the message > Multicast updates UI somehow of incoming message."
Game Instance isn't shown here, but it's unique and only accessible like the HUD and Widgets - only on the local copy of the game running, including on the server so no replication is available directly in it since it's only locally accessible.
Only one shared Game State exists in multiplayer that everyone can access VIA GetGameState.
Game Instance in this sense is like the application itself -> It's something that is running only on your computer, and it can store variables and objects (but not spawned actors) that are retained between levels.
GameState is a place to share information that may be common to everything and needs to be accessible to everyone but doesn't need to persist outside of the session of the game. So things like, Team Scores. Using GameState for messages makes sense to use as it's something that exists everywhere, it replicates, it has no issues with relevancy, and is easily accessible when local, so again, make an event dispatcher in your GameState that passes a message, and within your UI you just need to bind to that event dispatcher and then execute whatever you need to when that message comes through.
I'm using Owner No See on a replicated projectile and I have it spawning particles when destroyed. The problem is that the particle effect is showing twice for the owner because I'm also spawning an owner only projectile with its particles set to spawn when the projectile is destroyed as well to reduce the feeling of input lag. How can I hide the extra particle effects from the replicated projectile for the owner?
Player A shoots weapon. Projectile 1 (owner only, deals no damage) is immediately spawned. Projectile 2 (server RPC) spawns a similar looking projectile that deals damage and has Owner No See.
Player B sees the replicated projectile and particles when destroyed, but Player A (the shooter) sees the particle effects from projectile 1 (fake) and projectile 2 (real).
Lots of ways to deal with it, but the simplest is to just check if owner no see is enabled and whether the local client is the owner. If so, don't spawn the particles.
I can check for owner no see, but not sure about the other one as I'm working within a projectile BP.
Local client is the owner?
You normally can set the owner of something when spawning it.
how are the initial properties of an instanced object treated when the object is constructed treated? are the changed properties from the base object sent?
i.e. Instanced object that has an actual representative class i.e. like data asset but in raw UObject - 2 floats in instanced property no properties are changed, nothing is sent, but if a float was changed, that would be sent? And essentially all properties that are changed in instance that replicate will essentially be sent? / Basically all properties that are not the same as the parent it is instanced from = sent?
This is the Event Destroyed for the projectile.
Do I just have to make it so the fake projectile doesn't spawn particles when its destroyed?
and just live with the network lagged particle effects for the owner
LogNetPartialBunch> OutgoingBunches.Num (275) exceeds reliable threashold (4) but this would overflow the reliable buffer! Consider sending less stuff. Channel: [UActorChannel] Actor: BP_GameState_Main_C /Game/Maps/WorldLevel.WorldLevel:PersistentLevel.BP_GameState_Main_C_2147482559, Role: 3, RemoteRole: 1 [UChannel] ChIndex: 11, Closing: 0 [UNetConnection] RemoteAddr: 73.15.97.140:50483, Name: IpConnection_2147432400, Driver: GameNetDriver IpNetDriver_2147482563, IsServer: YES, PC: BP_PlayerController_Main_C_2147432396, Owner: BP_PlayerController_Main_C_2147432396, UniqueId: INVALID
This has started happening recently, I checked the GameState, and i was not able to find any reliable RPC calls, only RepNotfied strings, which has 980b data.
and also i have recently added logic for Attachment of childActor with parentActor, using RepNotifies,
i have shared a Picture of repNotified parameter.
so My question is , does having lots of RepNotified parameters active can cause this overFlow,
What do you propose should be the solution for this kind of problem ?
Hello. I have a question. On this video: https://www.youtube.com/watch?v=a_222b8K2Go&t=397s there is a comment saying "Use **smoothsync **for replication". However I can not find this setting anywhere and when I look it up online it doesn't seem to exist even. What is this person talking about? Is he just trolling or does this feature really exist? https://gyazo.com/9cfef286b29be4d3f07f38b90b33c29f
Hi again, its been a long time but Im back to doing videos. Today we will take a look on how to use the new chaos vehicles system in UE5.
Discord: https://discord.gg/PyNzH7N
It's a plugin
Ooooh ok, nvm then
Ah you know, I was looking for that. I had a feeling that would be silly. Means you can't pull info from it Client-side anyway then.
Property data is always reliable, so yes, if you have a lot of properties that are changing frequently on the gamestate that could be causing this message to show up for you.
This happens when someone new joins server, and i think as there lots of property which needs to be replicated to this new user, and because of this user will require a huge update, thats this user gets this issue.
i probably have to spend some time, to reduce number of properties.
I have another question :- lets say there is an array which is replicated, so if the size of this array is huge, it can cause the same issue right ?
Yeah I was amazed to discover this a couple of days ago. Wondering about the reason for this? Maybe GameViewportClient persists, so that's why they do?🤔
Haven't got to go deep into that just yet, but I would wager that's the case
What’s the difference between the replicated tag an an RPC?
So, basic multiplayer for like a gamejam, is it possible to use the steam online subsystem? Or does one have to pay they 100$ fee to ship a game for it to work? Or does Ue5 have some new multiplayer system? I'd assume I need to open up some ports and host the server from my machine
You can host the server directly if you have public static IP and have clients connect to your IP without the steam integration.
Yes, uint8 is the smallest amount of data you can send (as far as I know)
There's a good chance that it gets packed with other data, not sure though
Any idea how to get the time between Client Move timestamp and Server time in UCharacterMovementComponent::ServerMove_PerformMovement ?
Basically I want roll back a platform to when client performed a move, so I need to get the time to rollback by.
In most cases it would be close to the ping time (expect when the moves are combined)
I started following this tutorial, not expecting too much out of it. All I need is the simple hosting and joining functionality in mobile. But my aim is to have it work over wi-fi, not just LAN. And I need it to work with a computer hosting and a phone joining. The computer is going to be a player, but as the host it's going to fulfil a specific role.
I have it packaged and running on mobile and packaged and running on windows, but whenever I attempt to connect the two via LAN as directed in the tutorial, it fails to join (in either direction, ie: computer hosting/phone joining, or the other way around). Can someone help me figure this out and get it working? Insert Leia holographic recording pleading for help here
Link to the tutorial series here (specifically, episode 2): https://www.youtube.com/watch?v=6paDdKcSod4&list=PLmUaAZisS932QZWIkNvwI_abxs8yhGKmy&index=2
To be clear, I am only following this tutorial specifically, because I've been trying to figure this out for so long and it's driving me crazy lol
Correction on one point, out of about 100 attempts to connect (approx. 50 - computer host/phone join, and 50 - phone host/computer join) I managed to connect successfully once with the phone hosting/computer joining.
I am also trying to figure out hosting with a dedicated server setup (on a computer), but I can't figure out how to connect from a different device there either.
Problems with joining could have many causes.
- Windows firewall - ensure Windows is not preventing connection on that port
- Ensure Phone and PC is on the same network (if you are on data, you would have to go through internet and have public IP and port forwarding etc)
- Misconfigured code ( are you sure you are joining on the right IP and port?)
Things to try -
- Ensure you Phone can see your PC on the network. (Ping should do the trick)
- Ensure the port is opened
When should I use FUniqueNetId vs FUniqueNetIdRepl
FUniqueNetIdRepl is just a wrapper (that also happens to be blueprint compatible) for FUniqueNetId
Use FUniqueNetId when you can I suppose
Interesting
How to communicate with ue dedicated server from outside?
For example lets say i have a boss event that needs to be triggered. The time when boss event needs to be happening is decided outside the unreal environment. Now how do I tell the server to trigger the event.
You would have a master server that you control using say, PHP and dedicated servers would poll it periodically with HTTP requests
Is that the only way? I want to know if there are any other options available. Just like how client can call server rpc's cant we call it from external programs?
It's a very easy way
Free Web hosting, a few lines of PHP, the Unreal side is like 10 lines
I am incredibly confused why something is not working in the way I think it should.
- this is in the player controller
- if the client sends the request then update logs "hello" from server AND client
- if server sends the request, then only the the server is logging "hello"
shouldn't multicast always run on all clients and servers when called from the server ? as described here https://docs.unrealengine.com/5.0/en-US/rpcs-in-unreal-engine/
Can you describe your setup? I assume by "server" you mean a listen-server player right?
Is it a listen server or a dedicated one?
If it's a player it would make sense it would just execute it once, because the client does not have the "server" player controller
it is a listen-server player yes
What pavkon said
Multicast executes the command on each client that has the actor, But you don't share the "server" players controller with the client
If you want a player-owned thing like that to run on all clients, use the PlayerState, not PlayerController
Or GameState for Server->Client Multicast RPCs is generally a good idea.
PCs are shared only to the owning clients
thank you very much!
Difference between replicated tag and using rpc
Just one more small question :D
client widget button click -> send "button clicked event" to player state -> update all players to know that a button has been clicked in the same widget
What is in your opinion the best way to pass the "button clicked event" back to all widget ?
You could wrap the replicated functionality in an Actor, but doing through another object is fine. I would personally put it into PC, as PS is usually considered a one way street, at least in my experience
thank you @split siren :D
Replicated tag is the Epic way of doing it more efficiently than you can. A manual RPC is a way to circumvent that if you need things sent every tick or only in certain situations or on events, etc. Also RPCs work from client to server, where Replication does not.
Can i make un serverTravel from a beacon connection ?
hi there
Well hello there
is there anyway in BP to get port number ??
I am working on multiplayer project and i want to get the port number
cause I am running multiple dedicated server (session) on the same AWS server
yes
hey! what could cause all references to an rep actor client-side to not be properly set? (stored inside an array of FastArrayItem but I tested outside)
the actor is properly replicated though
@chrome bay @fathom aspen and I ran into something last night but we couldn't figure out why something was the way it was. It seems like both the GameMode & PC create a client side HUD. Can you think of a situation in which that is necessary? (PC happening in PostInitializeComponents and GameMode happening as the very first step in PostLogin)
From what we could tell after our digging, they both end up creating the HUD.
@chrome bay I have been randomly finding your answers on Answerhub while Googling issues and wanted to just thanks for posting those over the years
Destroying the previously created one in the process.
GameMode calls ClientSetHUD and PC calls SpawnDefaultHUD
That's not what my version has
🤔
{
if ( MyHUD != NULL )
{
MyHUD->Destroy();
MyHUD = NULL;
}
FActorSpawnParameters SpawnInfo;
SpawnInfo.Owner = this;
SpawnInfo.Instigator = GetInstigator();
SpawnInfo.ObjectFlags |= RF_Transient; // We never want to save HUDs into a map
MyHUD = GetWorld()->SpawnActor<AHUD>(NewHUDClass, SpawnInfo );
}```
That's it
In 5.0.3
Yeah, that's the implementation.
I'm talking about where ClientSetHUD actually gets called
Which is in the GameMode's PostLogin function. First call is to GenericPlayerInitialization
Inside there, it checks if the PC is a client and will call ClientSetHUD
Which would run this
But also in PostInitializeComponents for the PC, it will call SpawnDefaultHUD
Oh I see. Look like that just spawns an "empty" HUD class
Why I have no idea
Might be a legacy thing?
GenericPlayerInitialization is the function that does that. Either in PostLogin or HandleSeamlessTravelPlayer
So which one is the real HUD 🤔
So it's done for both hard and seamless travels
The one from ClientSetHUD
So GameMode's call
The one created during PostInitComps is just the base AHUD class, and that gets destroyed when ClientSetHUD is received
Presumably they initialize it there to some value just so GetHUD returns something, but that does seem dumb tbh
I can only assume it's legacy code
And a lot of the old legacy code is dumb
Epic sadly didn't seem to care about tidying it all up for 5.0
Yeah both points in time are called before any BeginPlay, so I'm not sure why they need that early dumb HUD
Maybe just to be safe? Even if it's the base AHUD class, there is still guaranteed to be a HUD.
OverrideWith laughing around the corner
Yeah probably some edge case they ran into while making UT
my "set input mode game only" (only runs on client) is inside a multicast. do i have to run it inside run on owning client to get the proper PC? It doesn't like any of the PCs I've given it.
yeah it seems that actor references inside a fast array item ustruct aren't updated 🤔 but I'm pretty sure on another project it worked just fine wtf
How could i get more informations to know why my game net driver is not created ? my beacon net driver is working and it's the same configuration in the engine ini so i'm out of ideas
It's a cosmetic event, meaning it doesn't run on dedicated servers. So you run it IsLocallyControlled, or IsLocalController
Anyone have their DefaultGame.ini and DefaultEngine.ini settings they used for voice chat in a released game? The default ones cause stuttering and saturation but changing them causes it to crash.
anyone have one of these made already or know where one is?
I'm having a really hard time keeping my stuff organized in my brain and its showing in my project.
Input mode is entirely client side. Server should NEVER dictate this directly. At most server should send client a state that it expects the client to be in. Then client can set itself up for that. In fact this gets even easier with CommonUI stuff. Activatable widgets can toggle this state very easily with a single C++ override.
what is that diagram? is it a website to help people keep track of their projects?
I need to know
Is it possible to use beacons in PIE ?
In split screen multiplayer, is there one "client" per player? Or is data shared?
Isn't it called on server in case of a listen-server?
As the local controller is on server, so input is handled there too
It is, but it should never be considered. This code should be network agnostic. It should act the same as a client to a dedicated, standalone, and as a listenserver.
I know, that's why I said it only runs on the local controller
Nice, thanks for the confirmation
Each player in split screen would have its own player controller.
@fathom aspenIf you want some nice input handling change. You should check out CommonUI. They have a concept of ActivatableWidgets. Basically the leaf-most activated widget determines the current control input. I'm using this right now. My first person game has a MainGameDisplay widget that is set as GameOnly basically. My other widgets are defaulted to Menu which is basically UIOnly. So when I push my inventory screen to be the leafmost activated widget, it automatically changes from game only input to ui only input. It is soooo much cleaner to use than constantly tracking that state yourself.
Could very easily use this in multiplayer by making the server tell client it needs to be in some state and client responds by simply adding a widget to screen. Boom, new control mode.
Wow, thanks for the suggestion. I tried playing around with that plugin after UE5 came to the scene, using the ContextExamples project, and I must admit that is awesome. I should give it a try once again, really thanks for the insights!
So if I get it right, widgets are like nodes, right? When you add a widget to the screen it gets added as a son node to the current node, aka, the widget active right now?
I'm not a fan of some of the widgets. I'm still using a lot of my own personal widgets for a lot of things. Text, etc. But I am using their CommonButtonBase, and ActivatableWidgets which is most of the framework.
And that current widget becomes inactive?
Yeah the two you mentioned may be the best of them all. I like the idea that you can have a centralized style for all of your widgets of the same type
Uh.. Sort of. You can put activatable widgets anywhere. So far I've personally found it best to have a single UUserWidget added to screen that contains stuff like the WidgetStack or a Switcher. For example, this widget here is AddToViewport at HUD's PostInitComponents. It's not an activatable widget, just a base UUserWidget that contains the CommonActivatableWidgetStack
This gets called in it's construct that adds my base gameplay widget. This is the one that overrides in a C++ class to set the control mode as Game
Note when you push a widget to the stack, it's activated then. So then when I say.. open an inventory. All I do is this.
Push a new widget class to the stack, It creates it if it wasn't already, adds and activates it and stops drawing the one below it.
If you wanted overlaid widgets, you could easily add multiple stacks etc.
Because inventory doesn't override that input config it defaults to Menu. So when I press "I", that inventory adds, activates, and I immediately get a shown mouse cursor and no more PlayerController/Pawn/Gameplay input.
Urgh Discord give us Bookmarks already
Amazing summary Authaer! I should check them like real soon ❤️
Also. Save this somewhere. Sanity saver.
CommonUI.DumpActivatableTree 0 1 0 0
Writes the currently activated tree to the output log. You can use it without the arguments for the full tree but using them makes it much cleaner.
I just realized I could make opening widgets an ability in GAS. Which could automatically be blocked by tags. 😮 Goodbye winding HUD framework.
Or add tags for animation states. They weren't kidding, you can use GAS for everything.
Nice! Now cannot access inventory or building screens if player has stunned, or uncontrollable tags. 😄 And they still show up and work perfectly.
What is the difference between these two methods?
void AVILECharacterBase::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
//METHOD ONE
FDoRepLifetimeParams SharedParams;
SharedParams.bIsPushBased = true;
SharedParams.Condition = COND_None;
DOREPLIFETIME_WITH_PARAMS_FAST(AVILECharacterBase, PawnData, SharedParams);
//METHOD TWO
DOREPLIFETIME(AVILECharacterBase, PawnData);
}
Or are they just a different way to writing the same thing?
You mean DOREPLIFETIME_WITH_PARAMS_FAST and DOREPLIFETIME? @nimble pike
The first is for usage with PushModel, the other is for normal replication.
Yup, that's the only difference? I was wondering because I could still use the first and set SharedParams.bIsPushBased = false;
It most likely works inplace as a regular declaration for replication as well.
But is meant for PushModel, as I believe it is in the PushModel Header anyway.
Could be wrong there though
I see, thank you
I’m making a online fps, using steam advanced sessions. Is there a way I can get a server so that can host the game over a player. Thanks
So let's say I only want an object in the world to exist on the server at start? Is that what "net load on client" is for? Would setting that to false not load it at all?
How do i send RPC only to clients i want?
For example: i dont want to send fog of war data of some team to another team - it will lead to hacks
Why this is yiddish to me?
What class this is in? Seems like you are modifying the engine
dedicated server
UNetConnection::Tick: Connection TIMED OUT. Closing connection.. Elapsed: 60.12, Real: 60.01, Good: 60.01, DriverTime: 1756.75, Threshold: 60.00, [UNetConnection]
how do I make this Connection Timeout Threshold higher?
I already put this in my [PROJECT]/Config/DefaultEngine.ini but it doesn't work, still says timeout time is 60
if I try to load in like a few times then it will work randomly so I'm sure it doesn't work cuz the timeout time (big map), so I just need to figure out how to increase the timeout time thing
Call the RPC on their PlayerController?
Only Clients and the Server have PlayerControllers.
how can I call a Server event in an actor the player does not control?
You don't. You can only call server events from actors you own
You can only call RPCs on Actors that have a NetOwningConnection.
how do I get around it then?
I can think of lots of cases where that has to happen, so how do people normally get around it?
Use a proxy, like the PlayerController?
RPC to the server what you're trying to do. So on your PlayerController or the possessed pawn, do a server rpc doing w/e it is that you want to do.
I am trying to, but it doesn't work for clients
Show code.
oh never mind I think I found it
I assume hit result under cursor does not work on server side
I had fixed it for some other stuff but must have forgotten in this case
I’m making a online fps, using steam advanced sessions. Is there a way I can get a server so that can host the game over a player. Thanks
Input is local only.
What is "host the game over a player"? You mean listen server?
Yes. Should I use a dedicated server once I publish the game
Listen Server: A player's instance of the game acts as the server, while also allowing them to play. If the player hosting leaves, everyone is booted.
Dedicated Server: A standalone instance of the game that acts as the server that has no player, so it's only acting as a means for players to connect. If all players leave, the server can still be running.
Depending on the type of game, you may not want players running their own servers, whether listen or dedicated, in which case, you would have to use dedicated servers that are hosted on your own computers / server hardware.
IDK, it's your game. Does the design call for dedicated or listen?
What you said makes little to no sense
Oh I should have read the rest of the channel
Your question makes me think you need to try a much smaller game first
I'm looking into Flopperam's Amazon GameLift tutorial series, I was directed to it a few times. I'm just wondering if anyone has gone through it and had success with it?
I found a comment on the first video that says, that the gameliftSDK only supports up to 4.25 or something and I'm using 4.27. Does anyone know if that is going to be a problem or if that is true or anything? The comment is a year old.
Also I found that there are two GameLift Plugins in the UE Marketplace, are those worth it for whatever reason? I haven't looked too much into them yet.
Guess I should be using FUniqueNetIdWrapper the most?
I am working with AWS Gamelift on my latest project, and I can confirm that the SDK works. I started with 5.0.2 but due to the many bugs I reverted to 4.27 without any issues with the SDK. I have not watched the full tutorial from Flopperam, as I built my own solution using slightly different products from AWS.
I don't think plugins are necessary, because you will need to make your AWS backend anyways, based on your specific needs/game. Basically the only communication between Gamelift and AWS is handled via the SDK, the rest needs to be custom, as you don't want your users to directly talk to Gamelift and start instances.
You need to have a layer in between with your policies that limit who can start instance, who can join, who is admin etc.
Next part is to figure out how to communicate between AWS and dedicated server outside Gamelift SDK. For example user tries to join, but he has been banned/blacklisted. How/when do you check against some database of banned users? Preferably before even contacting the game server.
Damn, this was a longer writeup, anyways GL, it will hopefully be a fun journey for you.
(And be careful with Gamelift, the cost can really add up quickly)
😑 Already hit a wall setting up in the second video lol. I'm trying to figure it out now. I think it might have to do with having VS2019 and 2022. But I'm looking forward to getting past this and making some real progress.
Thanks so much for the info! Backend stuff is intimidating for me, so I'm really hopeful I can get this to work without too many hiccups
From my experience, there will be plenty if hiccups along the way, just be resilient and you will get there. I would highly recommend starting with an easy example from AWS Gamelift before doing what Flopperam did and integrating lambdas and cognito etc.. https://www.youtube.com/watch?v=Sl_i6YIgQqg
The tutorial has about an hour compared to 20+ hours of Flopperams tutorial
Also, contact AWS support right away to get your Gamelift limits raised right away, so you start waiting the week+ for their reply
Can I ask what is your monthly AWS budget? Just out of curiosity
Right now I'm still working on getting the basics of it set up. (about 10 minutes in to Part 2). I'm running: msbuild ALL_BUILD.vcxproj /p:Configuration=Release
But still no luck. I'm going to start following the video you sent and see how that goes. I have an idea of the problem.
Right now, I don't have an AWS monthly budget set. After I can get the basic functionality of it working in some way and it looks like it will work for my project, I'll need to discuss budget with some people and figure that out
Ok so how do I create a list of current players?
I can't really use an array of FUniqueNetId pointers
What's the proper way to do this?
You can just get the all Player Controllers on the server
But I need to somehow save player id's to a list
FUniqueNetId seems to be this
But it's opaque
It's not clear if I should be using a pointer, or a ref
TSharedRef<const FUniqueNetID> usually
That's just a typedef to the same thing, but yeah.
What is the purpose of FUniqueNetIdRepl then? Sorry, it is slightly confusing to me.
To expose it to Blueprint and replicate it
Hmm so internally I should use the ref. But when I need access to the ID in BP I need to wrap it in a FUniqueNetIdRepl?
They can't because it's an abstract type
Every subsystem creates it's own concrete implementation of it, e.g. FUniqueNetIdSteam etc.
That's why they are exposed as pointers
FUniqueNetIdRepl just copies the raw byte data
Right
I was using the Steam OSS - and just going straight to the transparent type
Now I'm using EOSPlus with Steam
Which is why I'm trying to understand the opaque type better
Thanks for the info
Wonder what FOnlineAccountIdHandle. Maybe new to UE5?
So because FUniqueNetIdRef is a ref it obviously can't be null
So if it exists within a struct I've made
I'll have to pass the FUniqueNetIdRef in the constructor, right?
Actually, looks like I can't do that
Error: 'FUniqueNetId': cannot instantiate abstract class
struct FMyStruct
{
FUniqueNetIdRef SomeID;
FMyStruct(FUniqueNetIdRef Param)
{
SomeID = Param;
}
}
Figured at least passing it in would work... since it would have to be init elsewhere anyways
Have you got 2 different versions of the blueprint?
and/or c++
It's an RPC. You could be getting cross-install issues
If it's a PIE issue, then obviously not!
I am using UE5 for Multiplayer. Dedicated server is working pc connects to it but android build doesn't. Any help how i could connect it to android. My build actually notify server and log updates but android don't go inside game level
And dedicated server have weird bug my backup old version project file server works properly but later updated project file dedicated server build stucks after bringing level took ... something like this and never shows engine initialization at the end. I tested working version of server in android .. PC build connects properly and shows join succeeded but android have problem connecting
Where do you get avatars from the Online Subsystem?
Thought it would of been in FOnlineUser
No built in way
Check advanced sessions that does it
When an actor is replicated for a client for the first time (spawned), what will be called first? Its BeginPlay, or OnRep for actors who have it as a replicated property?
OnReps, PostNetInit, then BeginPlay
Thank you!
and it will have all replicated values that were set in the Tick the Actor was spawned on server
even if they were set after BeginPlay server side
Yes, except for actors, which may have not spawned yet.
it might have more, the NetBroadcastTick goes after the main Tick
and there is no guarantee Actor will be sent in the same Tick it was spawned
but you can spawn it, set some variables right after, and client is 100% going to have those values before Actor's BeginPlay on its side
as they are sent in the same packet as the instructions to spawn the Actor
Thanks! But I cannot relay on actors replicated properties to be valid on BeginPlay, right? As there is no guarantee for order of spawning.
you can as long as they are not pointers to other replicated objects
unless those objects are the subobjects of the actor in question
if Actor A has replicated pointer to replicated Actor B
there is no guarantee B has replicated yet
so valid NetGUID, but still an invalid pointer
Yes, that's what I meant. Thank you very much for your help!
Hi everyone. I have a multiplayer setup. when the player logs in, after the post login in the game mode, I change some attributes of the player mesh (blendshapes, textures) using some variables that I passed from the lobby to server pawn using the game instance. The first player looks fine, when the second player logs in, the first player sees the correct attributes of the second player, but the second player sees the default attributes of the first player, not the correct ones.
The attributes are stored in the pawn as replicated. Can anyone help?
Thanks
game instance is local to each player, and is not a good place to stash lobby data
generally, using seamless travel to transfer players from lobby to game, holding the attributes in PlayerState, and using CopyProperties in PS to copy them over to new instance
is considered the best approach here
this will also cause for Login not to be called on GameMap
and the logic from there should move to HandleStartingNewPlayer
Use FUniqueNetIdRepl
or ptr
☠️
Do I have to do something special to get an replicated array to update on the client? When I add the item to the array in blueprints it replicates but not in C++.
In my code on the server I do Array[Elem] = Item; No update on client
In bp I just do set array elem, and it gets updated on client..?
i see this, if i close my client
[2022.08.03-15.06.33:417][670]LogNet: UNetConnection::Cleanup: Closing open connection. [UNetConnection] RemoteAddr: 127.0.0.1:57006, Name: IpConnection_2147482458, Driver: GameNetDriver IpNetDriver_2147482499, IsServer: YES, PC: BP_PlayerController_C_2147482454, Owner: BP_PlayerController_C_2147482454, UniqueId: NULL:DESKTOP-7TOEQQL-6B61C3084967693DA6A6CB924E7C9ED7
[2022.08.03-15.06.33:418][670]LogNet: UNetConnection::Close: [UNetConnection] RemoteAddr: 127.0.0.1:57006, Name: IpConnection_2147482458, Driver: GameNetDriver IpNetDriver_2147482499, IsServer: YES, PC: BP_PlayerController_C_2147482454, Owner: BP_PlayerController_C_2147482454, UniqueId: NULL:DESKTOP-7TOEQQL-6B61C3084967693DA6A6CB924E7C9ED7, Channels: 24, Time: 2022.08.03-15.06.33
[2022.08.03-15.06.33:418][670]LogNet: UNetConnection::Close: CloseReason:
[2022.08.03-15.06.33:418][670]LogNet: - Result=Cleanup, ErrorContext="Cleanup"
[2022.08.03-15.06.33:419][670]LogNet: UChannel::Close: Sending CloseBunch. ChIndex == 0. Name: [UChannel] ChIndex: 0, Closing: 0 [UNetConnection] RemoteAddr: 127.0.0.1:57006, Name: IpConnection_2147482458, Driver: GameNetDriver IpNetDriver_2147482499, IsServer: YES, PC: BP_PlayerController_C_2147482454, Owner: BP_PlayerController_C_2147482454, UniqueId: NULL:DESKTOP-7TOEQQL-6B61C3084967693DA6A6CB924E7C9ED7
[2022.08.03-15.06.33:426][670]LogOnlineSession: Warning: OSS: No game present to leave for session (GameSession)
can i bind somewhere to be notified about this in game to tidy up ?
seems to be related to trying to use OnRep
C++ onrep doesn't fire automatically. You must call it yourself.
How am I suppose to call it for the clients? I thought it did on the clients but not the server.
and what I mean is the value wont replicate to client when I mark the property as OnRep
Another weird thing is I am also using UObjects and when I also add them to the array using bp, it replicates the object and all children objects without adding them to the subobject list, but if I add it to the array in C++ I have to add it to the subobject list for it to replicate (in this case it is working when marked simply as Replicated, no onrep)
OnLogout() in GameMode? It gives you a reference to the controller that's exiting the game as well.
dedicated server
UNetConnection::Tick: Connection TIMED OUT. Closing connection.. Elapsed: 60.12, Real: 60.01, Good: 60.01, DriverTime: 1756.75, Threshold: 60.00, [UNetConnection]
how do I make this Connection Timeout Threshold higher?
if I try to load in like a few times then it will work randomly so I'm sure it doesn't work cuz the timeout time (big map), so I just need to figure out how to increase the timeout time thing
I figured it out from searching the server history:
[/Script/OnlineSubsystemUtils.IpNetDriver]
InitialConnectTimeout=120.0
ConnectionTimeout=20.0
in DefaultEngine.ini
why is it after I login this gets constantly spammed in my server log and the whole server is like not responding when I try to do actions in game with my logged in client?
If we did p2p multiplayer, must we port forward?
Using advanced sessions without a subsystem
No need for port forwarding if you're using P2P
My friends and i can't connect
and we are in two different countries
He can't find my server
Is there a way to make custom launch parameters for my packaged dedicated server? Like launch a specific map, password, etc.
Like a variable that's changed by a launch parameter.
You can't use steam app id 480 to test in different countries. Have to be same.
or you can apply for your own app id
Do i have to take server / client logic into account when working with AI controllers? they are owned by the server. so i guess logic for BT and tasks etc will run on the server. I mean, is there something that i should keep in mind when working with AI controllers for a multiplayer game?
That sounds right AI tasks are server only in a multiplayer game.
@left flicker @split siren Regarding your discussion about AWS GameLift SDK there's also this official learning resource about containerization which uses Google Cloud for its demonstration but you could also swap it out for AWS. https://learn.unrealengine.com/course/3773792?r=False&ts=637951373021250593
Hello, I am creating a backend server for a game with features similar to Call of Duty Multiplayer mode (Scoreboard, loadouts, ranks etc.). I could not calculate what kind of average load I should be prepared for this server, which will be independent of the game server. For my game servers, this calculation was relatively easy. How many requests per second do I receive for an average of 3000 active players, does anyone have experience?
can anyone help me test the functionality of my game
I think you have to get a list of all the backend server interactions then estimate the average number of times a single client could trigger them plus the number of predictable backend server interactions coming from the game server (ex: post match results at end of round).
Also multiply by the number of clients in a session.
Hi, Since moving our project to UE5, running a dev or staging build on Steam, when we map change, the connection to the dedicated server times out.
In the server log it references Cookies, but when reviewing the old server logs from UE4 builds, Cookies are not mentioned.
I have not been able to find any project settings that reference Cookies.
The problem shows here in the log;
LogHandshake: SendConnectChallenge. Timestamp: 80.590992, Cookie: 097209119106218040002113224116027049149059155195076043109020
LogNet: NotifyAcceptingConnection accepted from: 76561199008011731:7777
LogHandshake: SendChallengeAck. InCookie: 109047092251092150235216063150187149154036038173047122241031
LogNet: Finding connection to update to new address: 76561199008011731:7777
LogNet: Failed to find an existing connection with a matching cookie. Restarted Handshake failed.
how would I condense a singular value in multiple array elements to be replicated to client as a single value?
i.e. Server sets replicated array last index to 99 with an integer of 0. It will sent 400 bytes. or server sets Array of object references last index is now 99, it will send 100 bytes despite them all being nullptr. (send things that can be combined as a single thing?) or at least telling client what to initially set the size as before sending the same thing for every index.
Hi guys. In my multiplayer game I have a problem that I don't know how to deal with. When a client leaves and re-enters, he sees the other players at the starting point, when they are not there. This is solved when the other players move, I suppose it is because they update the client. Is there a way that the client that enters updates all the players without the need for them to move?
Do you have net load on client?
Try with adding on your player, on "BeginPlay" the following:
Has Authority (False) -> Set location = Current location
Thanks for answer
Doing this does not return the location of the client only?
you are right, maybe do it from server RPC to owning client or just set location=location from server and wait for the rep on client
ok, i try, ty
it's weird that they are not having the location okey on netload, i would check on to why that is not happening
Does anyone in here use the Voxel Plugin?
i've been trying to figure out unreal networking, and right now i'm stumped by rpcs. i'm trying to send data through a replicated actor from client to server and vice versa, but the function seems to be executed on the calling machine
like, trying to call the client function on the server just runs it on the server, and calling the server function on the client just runs it on the client
here's how the functions are defined
@royal forge Firstly, you should be using int32 over int.
Secondly, have you made sure that the Actor is set to Replicate, you can only call RPCs on Replicated Actors.
yes
Also the Actor must have whats called a NetOwningConnection to be able to utilize RPCs.
oh so i didn't know about that part
At least for a Client to send an RPC to the Server thats the case.
A Server owned Actor can call RPCs all it likes, as long as its set to Replicate.
Check the Output Log for Warnings saying something like "XXX function was not called because no NetOwningConnection"
no such warning
it's just running the function locally
i did get this warning though: "Warning: OSS: No game present to join for session (GameSession)"
i don't know if that has any relation
it probably does though
regular
Good. Then just note about that part you didn't know about before
I know its a strange question but how can you tell that the function is being executed locally?
i'm using ue_log to log the function calls
and the log appears for the wrong function
Surely logging function calls is going to tell you it was called on the same machine since an RPC is called from one machine and executed on another. Or do you mean that you have a log inside the function
Maybe when you call an RPC on, for example, the client then the server also "calls" that function but idk