#multiplayer
1 messages ยท Page 73 of 1
What's the use case specifically for having a TCP connection though? It's quite the rabbit hole to do NAT punch through and you'll also need relay servers as a fallback because punch through does not always succeed. Not to forget that you're now dealing directly with hosting servers for all that stuff... Quite the hassle in the end.
This is not P2P, this is a listen server.
If they are letting players host a server then it is either by spinning up a dedicated host elsewhere (like AWS) or using something like NAT punchthrough or relay servers with a lsten server.
In the game I use actors that have procedural meshes and I want to send the data to build the procedural mesh to the clients on loading screen.
And I think this is too much data for udp to handle reliably.
Frankly you are not going to find a solution to players hosting any sort of socket server without dealing with NAT punchthrough or relays. So pick your poison - at least for relays steam provides a free service for that but it requires that you use their networking.
There are services for NAT punchthrough as well but it doesn't work for everyone regardless.
Unreal has steam socket support out of the box - https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Networking/HowTo/SteamSockets/
Though I believe the plugin is specifically around replacing the default netdriver with a steam netdriver (which is only used for the normal unreal replication system) - it doesn't do anything for spinning up an arbitrary TCP socket server. For that you probably need to use the steam networking libraries yourself - https://partner.steamgames.com/doc/features/multiplayer/steamdatagramrelay
What kind of procedural meshes are we even talking about? Is this a procedural landscape? One character? Entire worlds full of different objects?
Because quite frankly I don't see how a separate TCP connection is relevant here. If anything it makes it a million times more difficult and doesn't really fix much if you ask me. Unreal is very much capable of reliably sending data. If it's too much split it up.
The trees in a survival game are procedural meshes, so the player can cut them however they want and all that.
So it's gonna be just more and more of them over time.
procedural meshes sure but no sane survival game is sending the entire mesh...
if you cut down a tree you don't replicate the two halves in their entirety to everyone, you just send where the cut happened.
Well, by proc mesh data I kinda meant that.
I send all the data that needs to reproduce the proc mesh.
But over time that'll be a lot as well.
Yes but you don't have to send it all at once
How do I know how frequently should I send it tho using unreal's udp?
I mean I'm not sure how it's handled deep in the source code.
A common solution would be to check how much space is left in the reliable buffer every frame and send it in small chunks until you hit a threshold (you don't want to fill the buffer - that'd block other reliable RPCs from sending)
You don't use raw UDP
Regardless of splitting it up or not this is likely going to be a mess in the end. What if a player cuts up 5000 trees and a new player joins? You can't possibly send over all that data in a session. Whether you dedicated an entire connection TCP, UDP or what not.
Sure you can. Just gotta chunk it up and send it, ideally with prioritization.
There's some point at which things will probably "break" but that's indeed not a problem with the protocol
that's just the limits of what you can realistically accomplish
That's what I was suggesting before yes. But that really does not require a separate connection ๐
right
and it's not like clients always need the full state of the world anyway
it's not like when you load into a minecraft world the server sends you literally the entire thing, it only sends information about what's immediately around you
If a player cuts down 5000 trees, chances are those trees aren't all going to be in the same 100 feet square. As siliex said, prioritise the ones closest to the client and maybe only 100 of those trees are even relevant where they spawn.
One tree will have around 2500 bytes of data at max to reproduce the proc mesh.
do you think this is a fine size?
It was an example of why a separate TCP connection doesn't matter. You'll need to be smart about it a different way such as indeed splitting up the data. Prioritizing it etc. or what not. That's what I was trying to say with that ๐
2.5kb per tree is silly. You don't need that much data to generate a tree.
yeah this sounds like you're still sending the entire mesh or something
optimize down what you actually need to send, then see if you need to chunk things up.
Actually you're right mb. it's around 250.
You can, realistically, generate billions and billions of unique trees with a single 32bit integer.
250 bytes is nothing
(that's 4 bytes)
You could even have a pregenerated (or generated on startup) list of 100 trees and just re-use those meshes. That'd probably speed up your rendering too.
Then you'd only need a single byte.
Players can cut into the tree anywhere and cut them any size, so this would be quite difficult, wouldn't it?
How many cuts before it falls down?
it's not yet a stable number but around 7 maybe
Or is "you could have 100 cuts in different places and it'd be okay"
So realistically, you need 2 bytes per cut (one for height and one for rotation)
And you can adjust the trees which are hit on a per-tree basis.
wait I haven't thought as height and rotation
I saved the cut loc with with FVector location and FRotator rotation.
Why?
Now that you say this, it might be possible with that.
hmm.. good question
uint8 (1 byte) gives you a granularity of 256. If your tree is 10m high, that's a granularity of 4cm and about 1.4 degrees.
I don't think anyone will complain about that. ๐
Oh I actually know.
Because of the depth I was just using a vector for loc so it's exact. We couldn't really send only the height, because linetrace is quite problematic with proc meshes.
You could even (locally) adjust the roll of the cuts randomly by a few degrees to make it look prettier.
But I might do a calculation for a depth and then only send height depth and rot
Well 3 bytes isn't so big.
wait 3 bytes?
The point is, over the network, size matters. Sending 32bit floats (or 64bit floats) is very bad for something teh size of a tree.
height, rotation, depth.
64bit floats represent the solar system, not a tree.
(64 float can represent the solar system on a cm scale out to Saturn or something like that)
Going back to the random trees for a moment, do you know why I said 4 bytes (32bit int) can represent billions of trees?
well, I guess cause a 32bit int has that much value, so it can represent billions of trees.
I mean like combination no?
Alright cool, thanks for this guys, I'll rethink the whole system with this knowledge.
This helped me a lot
No - it's because random number generators aren't random.
You can set a known seed value (your 32bit int) and then get the same numbers out of it every time.
So you can generate a random tree on your server with the seed value 1 and get the same return on the client with that same seed value of 1.
So you only need to tell the client what the seed is and they can generate your tree.
Ye if each tree is generated based on a deterministic random algorithm then a single number gets you the entire base mesh, so you only need to send that + modifications to it after it was generated (which are ideally in a super packed format).
Even sending cuts - you don't need the precision of a full FVector. Even a netquantized vector is probably overkill - you could send a super well packed format based on like circular coordinates or something - a few bits for height relative to the base of the tree, a few bits for rotation around the tree, a few bits for angle of the cut.
Ideally when making the cut in the first place you quantize everything to those values so that the server's exact representation of the mesh matches what you send.
I was thinking that, but I'm not sure you can compact it all into 2 bytes. Probably 3 is enough for everything.
It's something you'd have to play with to see what the minimum for good results is.
Even a 32 bit int for a seed could be way overkill - realistically how many variations of trees do you need ๐
32 bit int as a seed for an entire world would be fine, but then you shouldn't need more seeds for each thing inside the world since they'd just be generated from the initial seed.
Hehe. True.
Okay I kinda understand it, but not fully. So a random seed represents a tree, but how does this work in practice, I mean how would the system work?
As long as your tree has a unique way of identifying itself, you're good. Tree #352 has to be the same everywhere.
That's integral to how your tree is generated, Edmm.
How do you generate it?
I have a "cut mesh" and I basically do a boolean to calculate the mesh that has cut into it.
Using the MeshOps plugin on marketplace.
yeah, it's a static mesh turned into proc mesh.
I think we've been operating under the impression that all your trees are unique.
oh, no they aren't
oh so you don't even need to know an initial seed. Maybe an id for the tree type if there are multiple initial meshes.
only the scale is different
Yeah. I'd go with a range of different meshes. Nobody likes the same tree everywhere.
Even if it's only 4-5, it will make it feel more alive.
And don't forget random rotations.
They do this in blood bowl 3 with blood - there's just a single blood decal that they rotate in 1 of 4 directions. It looks horrible.
I mean yeah I have different trees, but it works with the same system. the foliage has an id and when we interact with it, we spawn the proc mesh based on that id.
Ah okay. Fantastic!
So basically you can ignore everything we said about randomness and seeds.
๐ ๐
At least I learnt about new things lol
I can see where you'd be getting confused, though! Heh
How can I test my multiplayer steam game with 2 different accounts at same pc?
I need to bug check but I cant find anybody so I need to do it alone but steam isnt allowing 2 account at same time so Im stuck
You cannot - steam doesn't allow it.
You can test without steam, but if you need to test specifically with multiple steam accounts then you'll need two PCs or a VM and a beefy PC.
Well, I need to test multiplayer features, but Im using steam connection system so I cant host a server from one editor and join from another
You can test basic multiplayer without using steam. If you want to test steam features specifically then my answer doesn't change.
Again, steam doesn't allow sign-in to multiple accounts at the same time.
So I cant join a server hosted by my other editor, as Im using advanced steam sessions
If they're not Online Subsystem features, just test by connecting manually with a console command.
You can, you just do it without using a steam session.
furthermore you don't even need two editor instances (nor should you use two)
you can test multiplayer PIE, or just run two separate standalone instances.
Anyways, the thing I was trying to test is, sometimes when people join a server, they and their screens are stuttering too much while walking. or doing anything
This isnt happen everytime and everybody
Sometimes its just unplayable stuttering and sometimes its good, is this caused by some network problem?
The thing I mean by stuttering, its like server dont accept their movement and forcing they to stop everytime
Trying to spawn a fireball for when my player casts a spell. But if im playing as the client it keeps spawning 2 fireballs, one from the server, and one from the client. How can i make it so it will only spawn 1? If im playing as the host it works fine. only doubles up as the client
You need to restrict the anim notify event flow to the server only.
I forget the exact node.
Well, the issue is, both the client and the server are playing the animation and they're both calling server_castspell.
So it's happening twice.
yeah thats right
just trying to find a solution. i also need to know which client is casting it so it ignores collision on them, thats why im trying to pass through the owner
So put some sort of check in so only the server can cast the spell. If it cna't happen in the anim bp, put it in the cast spell method.
Make it not a server function at all (the client doesn't need to tell the server...)
And add a check.
just discovered the IsServer node, all working well not. Thanks mate
Np
is there something that only a client spawns but a server wouldnt? if i use IsServer as false, then the host cant spawn it, but it works perfect for every other client. If i have it as IsServer True, then i cant get the owning actor to check if the fireball hits itself and does nothing, or if it hits another player
Thats what im currently using, so if its not the server, it will pass on the owning actor that i can check collision against
Local Visual effects. Sounds.
Like you fireball would be a bad candidate because it probably has to travel and hit something.
But let's say you have a hand glow particle effect or something, you'd probably just add that on the client.
yeah, my first time working all this out. My current setup is that anim notify triggers, calls an event and passes on the player who triggered it. That then calls a server event to spawn an actor and set the owner. Then when that projectile spawns, on collision it casts to the bp_thirdpersonplayer and checks if thats == to the owner, if so, ignore it. if not, damage the player
then that projectile actor has all the logic for sounds / vfx / impact etc
I created a blueprint for my GameInstance and assigned it to be the default GameInstance Class in my project settings.
The problem is, when I run a dedicatyed server , I get this message complaining that it can't find my blueprint
Can anyone help me resolve this error ?
Any idea why this only works for the host? For the client it gets the wrong location for the spell mesh
yeah, that ac spell system is, and also the spell mesh itself is
I'd need to see more of your blueprint to figure out what's wreont
wrong
show us an image of your detaisl panel for the Spell mesh
can you post a pic of the details panel for the AC Spell System
on this part, i want it to spawn the spell from server only. and it passes through the character object reference into instigator the pawn reference, and from that im trying to cast to my bp_thirdperson to access the spell mesh through that
i need it to pass through the client whos calling the function. But if i set is server to false, it will only work for clients. and if i dont have it, then it spawns the spell twice, once for server, once for host
long story short, i just need a way for it to fire that anim notify once. It will if im the host, it will fire twice if im the client. If i try use that IsServer, i run into all these other issues
Finally fixed it. Just made it set a bool so it wont fire twice
Hey boys!
Every 0,3 seconds I run a small trace in front of the player to see if it should lower the weapon. This is done on owning client only.
Problem is that the "lower weapon" bool needs to be set on multicast for the other clients to see the animation that changes too, right?
So do I need to change the entire trace event to multicast? Is there a better way of doing this?
@subtle peak I think u do it on each clients localy, no need for replication,
But the "lower weapon" animation does not show on the other clients. Its connected to the anim-bp
set by the bool
That's because I assume it's a replicated variable right? A client can not set this directly. Only the server can use replicated variables. The way to do this would be to RPC up to the server to change said variable. But I would be curious if it's really needed to network this at all. Would there be any problem with just having clients locally check them selves if a different client needs to lower their weapon? ๐
If all it does is play an animation to lower a weapon when there's something in front of them I think a networking layer is not needed.
Ahaa! Thanks! But if its not networked, then the other players would see each others guns clipping through walls, no?
Just an fyi, you can't multicast from a client. You would need to tell the server and then the server multicasts it.
Imagine it like this: Say you have 2 players. One player looks at the other walking in to wall. Both locally do your linetrace to see if it needs to lower the weapon. The player walks into the wall and soon enough both will locally say "This person walked into the wall. Lets lower the weapon"
Or simply uses regular replication.
But, yeah, this is purely cosmetic, right? Do it locally per client.
Still think that replication is completely unnecessary here though. This can very easily be solved by just locally doing a linetrace for characters.
Agree. Just wanted to make sure they knew about client and multicast!
Thanks guys!
on collsion, how can i check if the thing i have hit is a player or not?
i feel like it might be a lot of casts then. For every object inside its collision it will cast to see if its a player, or if its another projectile, because i want it to ignore projectiles
That's fine.
Casting is free.
It's only when you cast to classes with hard linked assets that you get a problem.
And APawn, specifically, has none. That's why I suggested it.
Additionally, any cast to a c++ class is just free regardless because they are all loaded automatically anyway.
Another thing while the experts are here:
My grenades has a 50% chance of going through walls, or the ground. This only happens in multiplayer. Its using projectile movement.
Any clue why this is?
https://gyazo.com/a8473daecb54f7be317810fda89dded9
gif above
That appears closer to a 100% chance.
yeah it does whats its supposed to, rolls around for three seconds and explodes
Honestly not sure then. ๐ฆ
I tried messing with these settings, but didnt seem to help much
For reference here's it working, but the clip above was recorded straight after, no changes.
https://gyazo.com/fdb1cff769dc0552fdd15ac4a26eea75
So its fine to run casts like that?
and they will expand for each type of enemy i want the spell to attach to. thats just making sure it isnt another projectile. And checking if its a player to attach the burning effect to them
you can even see the second grenade in that clip colliding with the wall but falling through the ground on second impact
I would avoid casting to other BPs if you can. It hard links the classes together.
does it matter that this projectile actor gets destroyed about 10 seconds after hitting?
does that get rid of the hard link?
No. Simply having a reference to the other BP anywhere in the graph hard links them together. It doesn't have to be a cast. Any reference.
hmm, what would be my best solution then? i want the projectile to make sure it doesnt hit another projectile. and i want to check if it hits a player or enemy?
all my enemies / projectiles are set up with a master actor, then i make child bp's of them
Are projectiles based on pawn?
the pawn requests for the server to spawn them, and the player that wanted to spawn it is set as the instigator
But the projectiles themselves aren't pawns?
no just actors
So do what I suggest earlier and try casting to pawn. Or even Character (if all your guys are based on Character).
but what about checking if theyre an enemy, or other projectiles etc...
casting to pawn is working, so that saves a bit there
but yeah im going to have all the other stuff to check as well
An easy way would be to check if it has a player state. AI don't have one by default. Or try GetPlayerController on the pawn. AIs don't have a player controller.
Depends if you mean "enemy" or "ai".
my enemies are of a character actually
the enemy ran into me while i was on fire and the fire jumped to them xD
Human controlled?
ai
Single player game then? Then just check if they have a player controller. No player controller = not you.
multiplayer
i set them up a long time ago and didnt get into them much. from what i remember i made a character bp, then attached an ai to them, and use behavior tree to control them all
ill deal with them at a later stage haha
I would use player states for team info, though, rather than character.
just more after a solution to not have to cast to, check if player, check if enemy, check if tree, check if any other object i want to attach my fireballs to, it could become a decent size list and will kill performance
Use an interface?
Try checking if it hits a projectile -> ignore. If it gets an actor, cast to the interface. If that fails, it's hit a wall or something. If it's true, it will be something important.
rogey ill look into interfaces, thanks for the help, appreciate it!
Interfaces also avoid linking classes together!
Thats okay, but it is a bit limiting
depending on what you want to do it might be totally okay
Until I learn interfaces. I'll check the tag for player / enemy / tree to check the tag before I bother doing any casts. Just to help it a little bit to get by for now
๐ฆพ good luck learning!
Hi everyone. So I'm feeling a lot more comfortable with understanding unreal's networking and replication after binging tutorials for hours, and I have some basic examples set up. My only issue though is that I'm struggling to find a way to replicate physics. In one of my examples I have a balloon tied to a weight, any client can walk into the balloon or weight and push them around. The issue is that the balloons quickly become out of sync so I tried replacing the base class of the actor as a Static Mesh Actor and setting Static Mesh Replicate Movement to true which does work but only for the root of the blueprint. If I have a more complex blueprint such as my balloon which has 2 static meshes and a constraint how can I replicate physics?
There is no real surefire way to fix physics in networking. If you want an easy quick and unoptimized way, just replicate the object's Linear, and Rotation velocity, it's location, and rotation every so often, and have the client set their stuff to that. It kinda mostly works as client will simulate a few frames between replications and most corrections aren't heavily noticed. But it costs a lot of data. Not wise to do for a lot of objects, and needs a system in place to disable this so that it won't continue replicating on non moving objects.
Thanks for the reply. That does seem like a shame because the game I'm making is a VR game that includes a lot of physic based interactable items and constraints play a big role in these interactions
the level will load first but there's no guarantee on the order that actors are received or initialized.
I'm curious, what exactly happens if you join a player's session but don't client travel. What actually changes on the client and the server? I sort of know but I'd have to investigate more, just wondering if you guys already knew. Like does the client get the gamestate/playerstates if they don't travel, since they already have existing versions of those classes on whatever level they are in.
Reason is I'm doing a lobby system and I'm wondering if I need to client travel and reload the whole menu level or just send across what's needed
Hello i have a problem when i possess a character from listen server, the client works fine but i can't move, rotate etc on the listen server
if i set default pawn to none and i possess after it don't work for listen server
but if i set a default pawn and possess after it works
I just found
i was adding the mapping context in beginplay, so before possessing, so controller was null
hey guys, I'm currently experiencing an issue when attempting to test mp in PIE: If I select 3 players and then launch as listen server or as a client, it launches 1 pie window and then 2 standalone. Only the first window launches as PIE, while the rest are standalone for whatever reason. Is this a known issue? I don't think my settings are incorrect, but who knows lol
i'm on 5.1.1 and am using the default build if that helps
If you're expecting three PIE windows, you need to enable the run under one process setting.
How do you guys like to change max speed? I've seen some friends do it differently so I wanna know how you guys do it:) -- while ingame
Hi there, i have a question about replication in blueprints that should be somewhat simple, i'm working on a top down prototype where the mouse position controls the character orientation, but i don't know how to replicate it properly, this is my current setup on the PlayerController and CharacterBP and a small clip demonstrating what happens:
Input like mouse position and key inputs are usually executed locally until you've sent the input to the server.
So the basic way of doing that would be on tick send a Run On Server event and pass through the vector from this node (add a property to the event).
Once you're running on the server, you can do your calculation to determine the rotation.
Once you have the rotation, you should set it in a replicated variable set with notify (OnRep).
You then would use the OnRep function to actually modify the rotation (which I think you're doing already).
You will likely find better help in the #gameplay-ability-system channel
How does unreal send RPCs underhood? Via Websockets? Or some other protocol?
custom udp
Hi guys a bit of a dilemma here.
basically I have a bunch of hives, each can contain dozens of larva actors.
Players can enter hives, what actually happens is a teleport to a place off the map.
I only want players to know about the state of all the larva actors in a hive, once they are in the hive. This information needs to be accurate. However, I can't replicate all the information from all the hives because it is too costly.
- What is the best way to 'store' information about a set of actors, in such a way that I can replicate this information at will to a particular player? ('At will' meaning, when a player enters the hive, I want the state of the actors in the hive to be replicated to them)
- I will not be using dedicated server. If one player therefore doubles as server, would 'storing' all this information on server be just as costly for the host player as it is for all players in the situation I'm trying to avoid?
- You don't - you use network relevance: https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Networking/Actors/Relevancy/
- If one player is acting as a listen server then they need to know about everything going on. Unless you want to purposefully break the authoritativeness of the server, but unreal's networking isn't really designed around that.
I noticed certain properties on my larva actors were not replicated past a certain distance (the physical location of the hives is very far away) so they are culled by the net relevance
Which was problematic but checking always relevant for all the actors gets costly very quickly
Which is why you use replication graph or iris.
And the net relevance seems inconsistent, like some properties were more likely to replicate than others
yes and some logic would fire and some wouldn't
An actor that isn't relevant doesn't exist on a client at all.
If you aren't designing around that then you would be correct, but you'd also be misusing relevance.
Hmm, looks like I might need to store the actors as data and load them up when I teleport
there is also a bit of a difference between how net static actors behave with relevancy vs ones spawned at runtime
net static actor just won't send any data until its relevant again, but remains on the level while not relevant
dynamically spawned actors are destroyed when not relevant
I did a simple coin pickup program that generates a random number for coins and wondering what I should do next
Borrowing money from each other ๐ค
Good idea
When passing in session search params, why does it say they are integer but they are actually FName?
/** 8 user defined integer params to be used when filtering searches for sessions */
#define SETTING_CUSTOMSEARCHINT1 FName(TEXT("CUSTOMSEARCHINT1"))
Might just be outdated docs. Wouldnโt be the first time ๐
Unless those specific FNames somehow gets resolved to an integer(?)
Is there a way to implement voice chat to my game that is hosted directed on the dedicated server? I do not want to use some sort of cloud system
Are there any packages that support it?
can we run console command on server only by specifing the cheatmanagerclass on player controler ?
How can I replicate my camera's look at rotation when it's not attached to my player's Head bone? Using full body, and as such I dont want the camera attached to the mesh.
Here's what the clients see - the camera's rotation is not replicated. The component is set to replicate.
hi im trying to do some basic multiplayer stuff and trying to learn
how would this look if it were a 4 player game ?
Replace GetPlayerController with GetController
Is this a pawn?
Considering it has input it has to be a pawn (or character) I'm pretty sure. But you can just use the "Get Controller" node and cast it to a player controller.
Wizard also mentions it inside his article: https://wizardcell.com/unreal/multiplayer-tips-and-tricks/#2-beware-of-getplayerxxx0-static-functions
It also lists some of the other C++ methods or BP nodes to use.
I wanna fire projectiles towards the center of the screen from any position, and as of right now the player can fire projectiles upwards and down based on their camera, but the camera does not replicate. I read somewhere that it's only set to each player controller, but is there a way to replicate it? ๐ค
@twilit radish@steady cape ah thanks but im my case this works even for multiplayer :/ how is that possible with get player index 0 :o?
is it the local index or ๐ฎ ?
or is it based on ip or somethng
It works...until it doesn't
You don't need to replicate the camera if your projectile is replicated. The projectile goes in whatever direction you tell it to and if it's replicated everyone else sees it going in the right direction as well.
True, the issue isn't projectile related, but more so the camera rotation, as I'm spawning the projectile with a location and rotation, rotation being the player's camera
You don't need the camera for that, I have to check again but you can use the rotation of the controller I believe which matches what the camera rotation would be.
Something that the server owns.
That worked perfectly. Lol, been looking at this issue for two hours now ๐ Gods, truly appreciated hahaha
It happens! Trust me I've wasted so much time looking at issues, this discord is always helpful.
Absolutely ๐
Camera's in multiplayer are a bit weird in general. The rotation still indeed gets send to the server but doesn't get applied to the camera unless you do it your self. But not sure if it really matters honestly. It definitely shouldn't be changed any more at this point though ๐
In before everything falls apart xD
My players spawn randomly between the available spawn points - how can I ensure that they don't spawn on the same spawn point? ๐ค
Oh, yeah, I forgot about it. Player controllers only exist on server and the client who owns that controller. Thus, the only result you can get clientside from GetPlayerControllerFromIndex is controller that player owns
Considering input events (Tab, for instance) are always clientside, you can use that node
But, in that context, it's a bad practice, as it's misleading to whomever reading the code and will break if you try to reuse this code on server
This approach is better
The gamemode has an event you can override somewhere to pick the spawn location for a player. If you override it then you can determine your self what spawn point to pick. You could for example do this based on distance to other players.
Hmm okay. Yeah I want players to spawn grouped up together, it's a dungeon crawler, so I just need to see if it's overlapped or something I guess
Player controller index numbers are useful when making a game with split-screen multiplayer such as Mario Kart.
Hey, thanks for the answer, i think i'm already doing most of this, but how would i pass the server even through the vector from that node?
You'd select the event and add an input to it of type Vector.
So it should end up looking something like this:
the result is the same though
That set is not necessary. The value the client has needs to be passed to the server which the RPC is doing.
ah, right
it shouldn't prevent from working though, right?
i don't get why the two players look at the same mouse cursor on their instances
That's something in your OnRep of Look At Rotation.
Is there anything else setting look at direction or calling the Look At interface?
no, not that i remember of
i think the only things messing with this look at function are those two bits that i showed, in characterBP and in the PlayerController
@graceful flame true
There is definitely something else going on that isn't present in the screenshots you've shared. I have set it up the exact same way on an empty project and only one character rotates at a time when you move over to their particular screen.
Perhaps there's something on tick of the character? You appear to be reusing the look at rotation in one of your earlier screenshots for something too (the purple line goes off screen).
Let me take a closer look
the value of the lookat rotation (puple line) is just used on the actor rotation of an animation montage
this is very curious, because i have noticed that all characters were looking at the same mouse in their respective screens since my first multiplayer test, when i wasn't even trying to replicate this feature for multiplayer yet
@sinful tree did you set it up inside the PlayerController and CharacterBP too?
i don't know if that matters or not
i'm gonna redo everything just like on your screenshot
You don't need to - you already have it.
What does your tick event look like on your character?
im back, im not using the tick event for anything on the character
@thin stratus no need to respond since I know you're on vacation, but I was able to fix it. It's an engine bug in their implementation. I had to override a few things and you can end up using no velocity with just the projectile movement replicating to adjust the actor's location locally while the mesh lags behind it smoothly.
Of course if you were to give the projectile velocity, I think the interp would eventually reach the proper location, will have to test.
@sinful tree i found what's making all players to look at the mouse
apparently it's my Rotate in Place function, inside the Char ABP
with this unplugged they no longer try to look at the mouse like that
Yep, setting the velocity, the mesh eventually catches the collision nicely.
is it normal when a static mesh actor is set to become hidden in game via a repnotify any child mesh components to still remain visible ?
how do I know a Actor is staticaly placed ? (loaded from level)
bNetStartup seems to be false if bNetLoadOnClient is false
No. At least SetActorHiddenInGame hides all components by default
@fathom aspen tested RF_WasLoaded, it works fine now
bNetStartup is not right
it has diffrent meaning
IsNetStartup doesn't only check for bNetStartup
It literally checks if the actor was loaded from level and is replicated
Can someone remind optimal strategy for replicating a character's pitch (hands and head) to other clients, should I just Runonserver a non reliable event setting a replicated variable?
@fathom aspen when you possess another pawn and repnotify is received main actor mesh is hidden correctly but any other static mesh components that are attached to that component are still visible, i tried adding get all children to be hidden also in the notify and visibility but they are still visible which is weird
Debug, find out what's going on in there
It's replicated already if you use the CMC? See SetRemoteViewPitch for reference
forgot to mention that new possessed pawn is not a child of the pawn with the repnotify but main actor mesh does become hidden
Might be a VR application(?). Not sure why you need to otherwise replicate hands ๐
To determine weapon pitch for remote clients
It is not replicated by CMC
Nevermind what I linked was wrong.
@fathom aspen seems the static mesh components need to have replication enabled so they become hidden when actor is set to hidden in game via a rep notify ...
I built a dedicated server, added it to my project, packaged both game and server and everything went smoothly. Set it up so that thereโs a lobby where you can join the server by clicking a button thatโs set as open map (127.0.0.1) (I also tried with my public ip) but it wonโt work. I will start the server, open the game and click the button but nothing will happen and no messages whatsoever in the server log. I also set a string after the โopen mapโ and the string will print but nothing else works. Any help? I also tied to disable firewall but no luck
@weak tinsel no port ? defaults are 7777 and 17777 for pie, you should try open 127.0.0.1:7777 or 127.0.0.1:17777
Let me try immediately
still not working...
this is the log of the server
Hi, I'm starting to look into all the guides, tutorials and documentation but one off question id just eager to know is whether multiplayer can be made to use TCP if it's using UDP, sorry if it's a dumb question.
Unreal's built in networking systems are UDP. I'm not sure why you'd ever want to use TCP with them.
If you want to implement a fully custom socket server you can (and it can be TCP or whatever you want) but that's not leveraging any of the multiplayer systems unreal provides.
Clarification, I just need the other client to check and each check and~~ repeat ~~ confirm the received message, I just heard UDP is sort of clients just listen if they get the packets or not it won't matter, but my project is more critical and things shouldn't be lost or corrupt or incomplete.
UDP alone may be like that but unreal's networking provides guarantees on top of it.
Yeah thanks for the insight, I watched the whole official in-depth on MP a year ago, about replication, and some other youtube videos, and seems like a lot of it is built-in, but I sort of have to know the behavior and limitations ahead of time so I can better know what direction to go with my project, ... for starters whether I would have to go C++ and not just blueprints, etc.
Unreal's networking works in blueprint (with some limitations), and it's not two separate systems between BP and C++.
You're also digging into the wrong things if you're asking about UDP vs TCP.
If I can manually add in code that tells clients to confirm received packets by still using default systems and protocols then I guess it could work out. On the other hand, this is actually speculation for now, perhaps things would work just fine.
You're thinking way too low level.
Read the link I sent. Unreal's networking is way higher level and you should not be thinking in terms of packets.
I could perhaps create a general limit if ping/jitter is over 50 ms for even 1 second then everything stops until that client returns below threshold, for example, and avoid issues with UDP that way.
Unreal has its own protocol on top of UDP. You do not send "packets" out, you replicate variables or send RPCs which may or may not be reliable depending on the RPC itself.
It's sort of a mission critical type of project where you just can't lose even 1/4 of a second, there is potential it could totally affect the outcome, for example if 2 people speak and one says "This is unconfirmed" ... and there's a network issue in the very moment the person says "un" and it turns the sentence to "this is confirmed" ...
Err, you can't make that kind of guarantee.
You can guarantee that RPCs will be received eventually (or the client gets disconnected) but it is physically impossible to make any sort of latency guarantee for any specific bit of functionality.
Even with a completely custom networking layer you cannot guarantee that anything will be received in any specific amount of time. It's just not how networking works.
If you're talking about implementing deterministic lockstep networking then you're still thinking about things at way too low of a level. The transport for which things get sent/received is almost irrelevant to the complexity of deterministic calculations themselves.
Oh, aha, now it's not actually time sensetive in the sense that it has to arrive on a specific time for any or all clients, eventually works too, but until every client has the thing what it should, the "gameplay" in this case shouldn't continue and everyone would just have to wait, but it's not particularly fast-paced project with huge amounts of physics and graphics activity, fairly low on that.
In which case you're still thinking way too low level.
Confirming that someone received something is trivial, and not thought of in terms of packets on unreal's framework.
Again, read the link. Unreal's networking is entirely built on variable replication and RPCs.
If client 1 sends signal AB, all other clients must have AB and once they do, for extra confirmatio, the should have to report they really have AB back, and then gameplay can continue. In this kind of project, speed isn't a problem so if things go slower it's fine, it just has to be as exact as it can. But this kind of stuff doesn't necessairly need to be done on the low level, it could literally be done by implementing it into "gameplay" and let other clients manually do it, for larger and occasional game events things, but ofcourse not for things that happens hundreds of times a second. I guess I'll do some more reading and then asking again, I realize I also need to properly state my questions. It's possible I may not yet know how to actually explain what I'm exactly meaning.
That's called deterministic lockstep.
But I'd stop for a moment - if you're thinking about doing full P2P where clients can talk to other clients then you're in fully custom networking territory.
Unreal's built in networking is server-client only. While it's theoretically possible to implement a P2P netdriver it's not something you should do without quite a bit of experience.
Aha, but dedicated server too?
Sorry if I'm mixing a bunch of things, EOS is something else right?
EOS has nothing to do with networking
Right right.
and a dedicated server implies client-server, yes
I was about to say "client send to server" ... but I thought it was P2P, but I see now in the docs, it's server-client
This architecture doesn't negatively affect the project I think. It's actually better to have a dedicated and authoritative server in such case, but I can't think of a particular reason right now, although I feel it.
There's a mention of voice, does it go through this same system, ... the doc you gave me didn't say much but it felt so, just want to be sure.
Trying to get the gamestate on the client in a PIE 2 player listen server
In a world subsystem OnWorldBeginPlay
It's a nullptr... too early?
I must be missing something
fwiw the goal was to just figure out the kind of game the world is
could probably go the playerstate route instead...
PlayerState as GameState aren't guaranteed to exist on your client OnWorldBeginPlay, you shall need to wait
Actually GameState should have replicated by the time the World begins play on clients
Not for UWorld::BeginPlay()
UWorld::BeginPlay() tells GameMode, which tells GameState
Actor BeginPlay() means the GameState has been received though
I see, so there's kind of a race between GameState replicating (instigated by World's BeginPlay server-side) and World's BeginPlay getting called client-side
And yeah most prolly World's BeginPlay will be called before GameState has replicated
Hey guys how can i get my IP adress ? im just trying to display it on a widget
is there a premade function for it or ?
If I'm using EOS (Epic online services) for matchmaking and voice chat, will players in my game have to have an epic games account and log into it?
Generally, yes. EOS is the same as Steam. You can't use Steam services without a steam account. However on that note, you should never really consider that as "Using EOS for matchmaking" or "Using Steam for Matchmaking". You should make things more generic and let your OnlineSubsystems handle themselves based on where the user bought the game.
anyone got idea why 5.1 still kick player immediately if use world partition for dedicated server. is that any way to work around ?
The thing is, I would like to implement EOS on a VR game and I wouldn't want the users to have to log into anything once they are already inside. (plus, the game isn't really sold on the epic store)
I found this setting that allows me to disable "User required", if I disable that do they still have to own Epic account?
Also I found a video where the maker declared that it is not required as far as I understand
https://youtu.be/Fd9m4cG2hnU?t=1574 (clicking will bring you to the exact moment)
Unreal Engine 5 Epic Online Services - Set Up EOS for Your Multiplayer Game
Set up Epic Online Services for your multiplayer game!
Epic Online Services Dev Portal:
https://dev.epicgames.com
EOS Documentation:
https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/Online/EOS/
Multiplayer Plugin:
https://github.com/DruidMech/Multipla...
Hello all. It's wrong to create this logic on the character to call a elevator?
i have problem to put the logic direcly on a button that call the elevator. I have try to just call the console button and check the authority but something fail
I have this setup for changing the animation state when changing weapons but how to replicate it? replicating the variable doesn't seem to change anything. The server sees all clients change but the clients themselves keep stuck in the first animation state
You don't replicate the AnimBP variable. AnimBP does not replicate. The character itself needs a property that replicates, and the AnimBP locally gets that property to update itself.
Oh got it, so instead of setting this variable inside the animbp I can just set it from the character and call it in the animbp
thanks!
https://forums.unrealengine.com/t/dedicated-server-and-world-partitioning-missinglevelpackage/602938 this issue was said fixed, but still not work more many people in 5.1.1
I am packaging a dedicated server with a map that uses world partitioning. Thereโs an entry map that connects to the server, and when I start a client from that entry map from the editor, in โStandalone Gameโ mode, I get kicked out immediately after connecting, with the following messages in the server log: LogPlayerController: Warning: ServerU...
No, they don't. You would just have to provide your own account. EOS is separated into different services. Matchmaking and account are not tied together if I recall correctly. The EOS SDK site explains all this.
Thanks
Hey folks, a question.
I have accidentally discovered a weird behavior of multicast rpcs (specifically, reliable ones).
I have the following setup:
- 2 players, Listen Server and Client.
- Server player controls Character 1, Client player controls Character 2
- Characters are replicated normally.
- Characters have a component on them, which is set to be NOT replicated
- Said component has 2 multicast RPCs, one unreliable and one reliable
Expected behavior part:
server player calls unreliable multicast on their character (character 1) component. That multicast doesn't get delivered to the client player's simulated proxy version of the character 1. All good, since the component is not replicated.
Weird behavior part:
Server player calls a reliable RPC on their character (character 1) component. And that RPC gets delivered to the client player simulated proxy version of the character 1. That is unexpected, because, as I said, the component that implements these multicasts is not replicated.
Is it a bug, or am I just missing something about how the replication system handles the RPCs under the hood?
Found it accidentally, forgot to set the component to replicate, but still was receiving part of the multicasts (reliable ones)
yeah, this is something I saw after trawling around for a bit
I'm kind of new to actual multiplayer code so I'm flailing around a fair bit trying to figure out when to expect things to be stable
Never is the answer.
Latency about to ruin everyone's day once again ๐ฅฒ
RPCs use Actors channel directly, component doesnt need to be replicated to use them
But why then the behavior is different for reliable and unreliable RPCs?
Unreliable MC is the only RPC that also takes relevancy into account, but id still exoect both to work
Well in my setup characters had default relevancy settings, and they were like 2m (200 uu) from each other, so that could be taken out of equation
If youre using c++ you can look at UActorComponent::CallRemoteFunction
Unreliable MC might be an exception here
Buf you can freely send any other RPC from a non replicated component
huh, interesting, didn't know that. It's seems to be kinda contradictory to the whole concept of being not replicated ๐
i've stumbled on this in UE 5.1 btw. So may be something have changed there.
Its not
Was always like that
Components redirect their RPCs to their actor
Unreliable MCs can get expensive, and are generally not gameplay critical
So they have some optimizations added
Hi team!, any clue why in multiplayer test with vehicle starter the clients replicate nice but a little jumps
well i guess i'll tinker around the rep driver code with some breakpoints, and figure out what's causing this difference ๐
Hey, I am trying to figure out how seamless travel works in UE 5.1, but nothing worked so far. Any tutorials?
Was it even changed since UE 4?
I saw some folks were having issues with it when World Partitioning was in play, but if you are not using it, i think UE4 guides should get you up and running no problem
A lot of things are still the same from UE4 -> UE5 yeah. Don't think anything changed if you're not doing anything special.
Can anyone give me some feedback on what to look for regarding vehicle assets in multiplayer? It seems some vehicle assets are replicated but not well (lacking various special parts like server side prediction?) Iโd love to get good cars going for dedicated servers, but am finding it hard to k own what asset to invest it
In*
I don't know if I'd trust any asset on the marketplace for this. Vehicles are a PITA to handle networked. Not going to trust someone who is charging like $20
Thanks. Any tips for me on ways to approach it or keywords if things to learn about? Iโd be fine to pay a premium for the best product of someone can recommend.
Nope. I just know it's a PITA. Just seeing the results of all of the people who have attempted it over the years, not to mention AAA fights it as well.
Hmmmm. Any idea whatโs so challenging with it? Any thoughts on best AAA success to study?
Rocket League and Halo Reach have really good talks about prediction
Very nice thanks!
whats the size limit for replicated properties?
for example if I have a replicated FString
is there some network limit to how long that can be?
Is there a default way to tell if it is the first time a player has spawned in?
Guessing I need to keep track of that myself somehow
long strings take ofc more bandwidth, the limit depends on your bunchsize config
yes when you initially spawn the controller for your pawn
subsequent respawns will call reset, at least it is that way if you are using gamemodebase spawning method
where do I see this "bunchsize config" ?
DefaultEngine.ini I think, iirc the var is called MaxBunchSize
And defaults to 64K i think ๐ค
but you can change it, although not recommended
if you exceed the buchsize your bunch will be dropped
it doesnt split it for ya, if thats your question
it just drops it
Which function is that? I see โRestartPlayer()โ but that doesnโt spawn the controller just the Pawn
Isnโt โRestartPlayer()โ called every time, including on the first time?
only the first spawn will spawn the controller
yes restartplayer gets called every time
but what spawns the controller before calling restartplayer isnt
Right, so with function spawn the controller?
dunno right now i dont have the engine in front of me
but it is there
in AGameModeBase iirc
Ah ok, Iโll look for it. Thanks
npnp
Depends on the type of vehicle
Rocket league vehicles are basically like Characters in most other games
but vehicles are hard as hell because they're unpredictable, fast, and often physics driven
So, I realize I've left this a bit, but did you get much further with your implementation? I just spent some time faffing around with mine and I have something that appears to be working great, what issues/problems were you running into?
I've gotten a bit sidetracked on that, been implementing a movement component for my ships, instead of using physics. Player can still walk inside them and it all works fine so far.
Ahh, alrighty, I'm using full physics, I don't have the willpower to fake collisions for my ships ๐คฃ
haha, it's a bit of a pain point yeah, but I wanted reliable client side prediction with minimal server corrrections
I know the NPP seems to have a client side predicted physics implementation, but I haven't been able to get it to work
I'd like to have client-side prediction, I'm just running with server-side physics simulation and clients are using snapshot interp, I know it's not a perfect way to test, but with 250ms of PktLag in the editor (NetEmulation.PktLag 250), It's felt solid enough for my needs
thanks! Can you elaborate? Like car vs bike helicopter
Maybe you can try to get the npp working, it has a "MockPhysicsSimulation/Component" that is supposed to sync chaos physics, but I couldn't get it to work
Last time I checked, the NPP plugin was dropped and heavily unfinished, hence why I didn't look at it, might investigate it at a later date if my current impl turns out to be hot garbage
That too but I mostly meant simulator vs arcadey
#instructions #rules
this isn't the place to solicit work
Like you would anywhere else, to make sure it's replicated
Ah I gotcha. If I was fine to go super arcade'y, would that make things easier?
I'm not worrid to much about acuracy, just thinking on a big map a character needs to get around!
Just to be clear, the Game Instance itself isn't replicated, so any replicated variables you may be setting on the server in there won't appear on clients, and RPCs will not function as one would expect.
For an actor to be replicated, it needs to be spawned by the server and the Replicates boolean on the actor needs to be set to true. Spawning a replicated actor can be done in the Game Instance, but again, if it's not running on the server, the actor will not be spawned by the server and replicated to others.
Hey ya'll - what would be the best method for implementing chatrooms in a multiplayer game? Structs that store the chatroom name and player controllers that are in each one? Any suggestions would be appreciated. Thank you!
How would I go about optimizing for an open world survival game on map with about 50 players, similar to the game rust.
You need to be more specific, there could be hundreds of things causing your game to underperform.
I can link you to several optimization guides and general networking information if you'd like
Right now I tested the game on a 5k by 5k map with around 20 players there is building etc. but the server starts to lag after 20+ players. checking the memory usage on the vps it's barely being used to capacity
The doesn't really tell me anything. Are you using a marketplace asset for your game? If so then you'll probably need to make lots and lots of changes
Marketplace asset templates usually have a mountain of issues
Evening everyone.
If youre using survival game kit then I will pray for you
Are there any reasons to use an Actor for player associated stuff rather than an ActorComponent on the PlayerController or PlayerState?
I've used components and subsystems that use a work-brewed networking uobject, but haven't used actors for stuff like this. I'm trying to think of reasons why an actor would be preferable than a component.
I believe back in the day fortnite used separate actors to change replication settings for certain variables... I don't think they do that anymore though because you can change component replication settings in c++
I haven't heard any other reason someone else would make a separate actor. Unless that separate actor needed to store information for multiple players
I was using an actor to try it out and it quickly became apparent it was more work than if I was using a component.
Thought I'd see if I was missing something before I switched it over.
I'm using player state for the first time. :D
Nothing I've worked on has needed to persist between maps that is unique per player.
Can clients technically run functions marked as server locally?
AKA do my server functions need to have a HasAuthority() check?
sure?
err
unless you write code manually calling the _Implementation then nothing is going to call those functions on an actor that doesn't have authority
could someone modify the game to call those functions? Sure. I'm not sure why you'd care about someone ruining their own experience though.
Was running through a mental exercise of combating cheating. Wasn't sure if a check was needed
the worst someone could do is call that function on their own client. Which, if your networking is properly designed, could do no more than have them ruin their own experience
and a HasAuthority check wouldn't do anything, they could just... remove the check.
If a client modifying data can break the game then the solution is not further client checks that can be simply removed, the solution is to not accept invalid data on the server.
Right, makes sense
Thanks for the insight
And not to be super dense...
But clients can call client marked functions by design, yes?
Or are client-marked functions only meant to be called by the server?
a client can call a client function, yes
but in general if a function exists and isn't explicitly compiled out then a user can do literally anything they want with it. A server doesn't have to accept what they do if they try to send invalid ata, but you have no control over what happens on a user's machine.
and even if a function is compiled out a user can modify memory however they want
Right I just know client-marked functions are intended for the server to call to then rep to the client
Didn't know if designing the client to call them too was frowned upon
๐ค in which situations can it happen that a server spawns a replicated actor and clients which connected before or after spawning this actor won't get it? let's assume that the actor is always relevant
It might have been short lived and been destroyed immediately
I never found out the exact cause but I was doing something in a world subsystem trying to spawn a manager actor.
I think the references were not set right or something but the actor never replicated
Make sure you verify that you arent forgetting to call Super on BeginPlay for example
I was pulling the spawn class from the GameMode which only exists on the server. I assumed replication would automatically broadcast to the client but it didn't work
well the tricky part is that the actor is spawned in UGameInstance::StartPlayInEditorGameInstance for reasons I am not 100% aware of and since it is spawned by the world (which I am not sure about if it's 100% ready for usage at this point) and not destroyed by something, then it shouldn't really be destroyed. Also this actor feels itself quite well on lister server, it just seems it never gets to the connected clients.
I think the references were not set right or something but the actor never replicated
Hmm, I don't have any replicated UPROPERTY for this actor at this point. I am trying to get this actor via UGameplayStatics::GetActorOfClass, but now when you said it I am questioning myself if world's actor list is replicated at all ๐ค
If I may proffer my humble opinion, the entire setup doesn't sound right at all. You don't want to be manipulating actors in the GI. Certainly not that early.
Also, I'm not sure how GetActorOfClass works but if it's anything like TObjectIterator, I wouldn't be calling it too often
yeah dude I agree with you this looks sceptical to say the least. But again, I didn't put this logic in the game instance, I just need to make the actor replicated
I'll try to store somewhere replicated pointer to this actor, will see if that helps
Good luck. If you know what exactly caused the issue, I'd be interested
GetActorOfClass is just a TActorIterator that returns the first result in the bucket for that class. Costs basically nothing when used on a class with only a couple instances, or one instance.
Oh alright. Sounds good
So I have a problem(?) and would appreciate some insight.
I have a some data in a world subsystem that is only on the server. The data can not be replicated. Think a TMap.
Clients need to retrieve only a small part of that data once in a while so I don't think I need to replicate everything anyways.
At the moment, I'm using a somewhat complicated method of asking for that data from the server using RPCs on the player controller. Then some delegates since there is a slight delay between requesting the data and when it's received.
Just a mess of things.
It works, somewhat, but I don't think it's great on performance and it's just so complicated.
Does anyone know any methods for sending data like that without replication?
For example if you want to retrieve a value from a TMap on the server and you have the key, how would you do it?
Probably just ServerRPC->ClientRPC.
Which is what I'm doing. But since there's a delay between actually calling the RPC and seeing the results, I use a delegate to broadcast the data in the client RPC.
The player controller doesn't even need the data I'm only using it since it's the most convenient class that exists on both server and client.
Does the data change often on the server?
I guess that's the only way. Just need to find a way to simplify stuff.
I'd still appreciate more ideas
Yes, but there's no predetermined frequency
How large is it in general?
I can't tell. It's an ecs world.
Wondering about a replicated actor spawned for that subsystem that any client could get globally and pull the data from it when they need. Would ensure instant data for them.
The data itself is not an unreal type so I can't replicate without custom serialization. Which I have no idea how to do for it
Wait, how are you RPCing it then?
Think of it like a TMap. The keys and values are unreal types but the map itself can't be replicated
So, I just rpc the keys and values back and forth
Can someone send me a link for seamless travel tutorial please? The stuff I found didnโt work.
when making a squad system that requires player info to be displayed on clients in a widget where should i store the info, game state or game mode ?
playerstate
playerinfo is bound to player, so you store it in playerstate
Is it bad that mines stored on the player? ๐
prompted me to just text, my stats reset when i die... rip. guessing ill have to send them to the playerstate before i die. Then retrieve it on respawn
im too far in xD
by player you mean pawn I think
its my first project, and im a few months in. Ill end up breaking a whole heap of stuff if i try change it now
good luck
ill just pass it over and back ๐ save myself a few weeks of pulling my hair out
Hey there, we are running into an issue with my team using the animX marketplace asset and trying to replicate it to the clients, the movement in the world is properly working as well as the IK, but the whole animation of the animals only works on the server.
We've tried enabling replication (the asset wasnt created with multiplayer in mind) to a lot of the variables, aswell as firing their initialisation from server to clients via multi cast with no luck.
Any lead on where to look, what information to provide to give more insight ?
I will add that a lot of these animations use root motion and was wondering if that is the source of the problem, although disabling root motion on the locomotion blend spaces still yielded no results. Thanks !
There is a persistent data compendium in the pins that goes over it
Has anyone implemented a CMC driven movement ability that moves to a given location and works well with packet loss?
these both are for same purpose?
if (GetNetMode() != NM_DedicatedServer)
if (!GetOwner()->HasAuthority())
No. I think authority will be true on a client-owned actor, such as a player controller or pawn. I honestly can't remember, though.
Also netmode could be listen server or standalone too.
You wanna check dedicated server when dealing with A/VFX.
You want to check != client when looking for servers.
thank you for your precious time explaining this
Authority is true on the server OR for a client spawned non-replicated actor OR standalone.
Oh never mind then.
I find HasAuthority very often to be awkward to use though. I mostly use other checks.
Maybe I'm thinking of role?
autonomous vs the other one
Man it's been ages since I did any mp.
With roles you have a remote and local role. So kind of depends.
Ah simulated that's the word I was looking for.
Either way, the 2 things aren't equal because !authority isn't the same as !dedi server
Anyone have insight on Epic's progress with updating the standard CMC e.g. with Iris or other projects?
I'm trying to convince myself not to buy the General Movement Component from the marketplace and instead wait for Epic to update CMC.
Realistically I am going to have a max of ~5 players in any multiplayer session. And in terms of movement the only somewhat exotic movement types would be dodge/roll, perhaps vaulting/hoisting, sprinting and maybe sliding.
Of course, lots of root motion too, from skills.
Don't hold your breath for Epic
Do what you need to do to get your project moving now
Aye but my game is years away from completion heh
There is no guarantee that they're even going to touch CMC
And for 5 people...CMC should be fine.
I already have rolling replicating fine almost
So I figure yeah should be doable with CMC
But GMC looks so good
I'll just wait for it to go on sale
void AArmaCharacter::ServerBeginInteract_Implementation()
{
BeginInteract();
}
Error C2447 '{': missing function header (old-style formal list?)
what does this error means?
I don't think I've ever seen it go on sale.
Someone yesterday mentioned the saw it half price once upon a time heh
I'm assuming you mean Pawn.
The STATE of the PLAYER is that they are in a Alpha Squad. So store it in PlayerState.
If it was some sort of design where the pawn was in the squad but not the player (idk how that'd work), then storing on pawn would be OK.
Our dear friend @fathom aspen reviewed it
(Server on the left, client on the right) Thanks again, as always you're all so helpful. Zero responses and my original question was removed with zero feedback, all while people chat about random game bullshit instead of helping anyone else. Great resource here.
I really wanna buy it but my game is so far away from being finished... if I go down the road of CMC and then decide to swap to GMC I wonder how much rework that is.
My character is currently a combination of player character and player state using GSC (GAS Companion)
Hmm
But in terms of character movement I've not spent a great deal of time, so I think most of the work I've done with GAS can just be moved over to a GMC character.
I may have to do some coding to get GSC working with GMC though
@fathom aspen Wait - does this mean it doesn't work on consoles? Are they using any windows specific APIs or something? Or just not tested?
would be weird to use win specific apis for a networking plugin, right?
but who knows
It would be. But hey - I don't have the plugin
same
heh thanks for reminding me why I didn't buy GMC last time I had my finger on the trigger
I really want this game to run on consoles
Well - it depends on if they mean development platforms
yeah I am pretty sure it means the build won't compile for e.g. PS5
but yeah that's kinda ambiguous
I do all of my playtesting with a PS5 controller in PIE right now
That's a TIL ๐ฑ
But I guess just not tested 
But hey GMC v2 is coming some time soonโข๏ธ 
I just want another component in my arsenal to complain about
Not the GMC boi
Going back and looking at the way they have the framework set up, is quite nice to be honest
I love that I can just use the MRC version for a lightweight version
@fathom aspen did you test that it worked with pathfinding and all that fun stuff?
I used to strafe jump with the best of them back in my Quake days
Right, and I have some doubts that the author worked on source engine ๐ต๏ธ
๐ญ
Hence why my review is monetized
2 tests if you find the time:
- See if they do work
- See if they are lighter weight than the the CMC's navigation stuff
I'd imagine they would be, if you're not using the OMC
How well does GMC run with moderate amount of latency and packet loss? Say 60min, 110max and 3% loss.
Apparently - insanely good
People have tested with 200-300 ping, still seemingly flawless
Really well from the lone youtube video I've watched on it in the game Slappy or w/ever lol
sure but packetloss is the real killer
Hit the GMC with the right preset and you're good
They got presets for the type of game you're working on
The video that Mythic is talking about, they tested it in bad conditions, which is excess of 3% loss. Still completely unnoticeable for them
Does the ORC inherit from the base movement component of UE? @fathom aspen
I believe so, otherwise things won't be compatible
If it does - then I'd imagine navigation stuff just worksโข๏ธ
If code was at my fingertips I could check
I believe base movement component inherits from NavMovement
Are you guys aware of a less expensive option that would be enough for a Dark Souls 3 / Elden Ring level of multiplayer? Just use CMC?
Just use CMC
CMC should almost work in all scenarios
Aye, thanks. I'll stick with it.
I kinda bought it for the fun tbh
If you look up Reid's Channel, he explains how to implement sprinting and wall running networked, properly.
Yeah I saw that. A little bit of C++ but nothing huge from what I watched.
If you actually sit down and understand what he explains, you can take these same concepts and apply it to w/e you want to do
That was the video with bitflags?
I don't remember.
Wall running though yeah that must've been it
It's in pins iirc
I just remember him actually covering how CMC actually works under the hood when it comes to corrections and what not.
Ah thx
And then implementing custom stuff to be compliant.
my game is not competitive (insofar as any Soulsborne is competitive) so I'm leaning more toward client experience than prevention of movement hacks
couch time with friends, taking down big bads
Do actor components replicate variables less often than actors? I had a value that changed on actor tick and it was replicating to clients smoothly. I switched it over to a component and now the OnRep is only called... something like 3x a second?
Oh. Player controller defaults to 100/sec and player state to 1/sec.
Actor Components are replicated at the same time of their owner actor iirc
so they depend on it
Hey there, this far I've been using two clients to test my game, but after testing it in "listen server mode" I see the respawning of players is messed up.
Again works fine with two clients.
Now when the server is killed it respawns on the client, and the server is just stuck in the old camera without a new pawn. Any clue why this is happening?
Does any of this depend on OnRep calls? Because those won't get called on a listen server, so you'd have to check for that and call it manually.
Not sure what OnRep calls are, so I havent used them I think
To clarify, OnRep doesn't get called on the server that's changing the replicated variable.
My guess is its something to do with getPlayerController? Whats the difference between this in listen server and two clients?
If you're using a call that gets the player controller by index, the server will have 2 and the clients will only have 1
Clients only have a player controller for themselves, not for anyone else.
Yeah, I suppose thats the problem then. What should I use instad of getPlayerController by index?
Or to ask differently, should getPlayerController by index not be used for online multiplayer?
To clarify - OnRep only doesn't get called on the server in C++. It still will in BP.
how and where location and rotation is replicated to autonomous proxy ?
I used Teleport() or SetActorLocationAndRotation() but I feel like its not sending rotation
Where is the best place to place the money system to buy weapons, for example, when I kill an enemy I will receive money, so that in the next round I can buy other weapons.
PlayerState maybe?
Pawn - if you want to drop money when you die
Controller - if you want it to persist throughout deaths
State - if you want others to be able to see how much money you have
thank you , well I think I will put in player controller
No that node should not be used for multiplayer. See the pinned post by WizardCell.
None of these should be used in multiplayer really.
I have some work to do then... ๐ Thank you!
yw
Not even sure I follow the question and I have GAS in my project heh
Hello, I am having a bit of a replication issue here. I have replicated properties on my Actor that are client authoritative and thus I don't want to replicate to the owner. Replicating to the owner would cause the replication updates to mess with the local calculations and cause bad things to happen. Ideally I would like to use a replication condition: COND_SkipOwnerOrInitialOnly, but that doesn't exist. So currently I am using COND_SkipOwner and not setting the owner initially so that those properties get replicated down. Not setting ownership has been problematic though (RPC's won't work and there's no way to tell if locally controlled). I want to set the owner and still have properties replicate initially. I tried initially sending a reliable client RPC to set those parameters on begin play, which with some work does function. However, the RPC doesn't seem to be part of the initial actor replication bunch and causes those properties to not be set on BeginPlay. This is problematic as there's already functionality expecting it to be valid at that time. My other option is to create either duplicate properties set to COND_InitialOnly or a custom struct that would replicate the properties initially and reflect that onto the real properties OnRep - this seems to be the better approach. Has anybody else encountered this issue and is there a better way this issue could be solved?
What kind of actor is this?
Well there's multiple classes dealing with this same kind of issue but one example is a magazine actor (closest Unreal class type is AStaticMeshActor). It has an ammo property that's set to COND_SkipOwner but I'd like ammo to be replicated with the actor if it it's initial value is different than the default value
You want ammo to be client authoritative?
Yes, with how things currently are
I strongly encourage you to not do that as that means a client can modify things to give themselves infinite ammo.
And is that information that other clients need to see?
I realize this isn't addressing your initial question, but I'm still thinking about it.
Yes, the server tracks ammo as well per shot
The thing is, this is not ideal, I know that. There are other examples of things like this as well, not just ammo. It would be ideal for me, in the meantime, to have a way to replicate that property initially with the Actor
I'm trying to think of examples of something that should be client authoritative and shared with other clients.
The magazine reference is client authoritative too. It's set locally and notifies the server
Magazine reference on the firearm
All of this should be server authoritative. But ignoring that...
You could have a struct of initial state for owner that's COND_InitialOnly, COND_OwnerOnly.
RPC is another way, but as you mentioned, timing between RPC and Replication is not the same.
This is a VR game and it feels super nasty to have to wait for the server to authenticate inserting a magazine into a firearm. There will be a noticeable delay. I can do it locally then notify the server but at that point there's seemingly no reason to have it replicate to the owner. Except initially which is the issue I'm having
This is why locally predicted exists.
Yeah, that was what I was thinking. Feels like a waste having duplicated members but whatever
That said, it's possible VR changes the problem space.
I don't have experience with VR.
I'm not sure if it's quite the same as locally predicted as the local player would be the one which would have to initiate the mag insertion out of necessity. The replicated controller positions wouldn't be accurate enough for server-side checking or anything like that.
oh, is this gun/magazine/etc actual models you're moving around because the player is holding them?
Yeah, I should have made that more clear haha
Not an animation or anything
Separate Actors
The issue is that guns will often spawn a magazine when "holstered" (ready to be fired). With COND_SkipOwner though, the magazine reference won't replicate to the owner when I only want it to be done initially.
Currently there's no owner set to mitigate this but it's a bad hack and causes other issues
I could use COND_None but I'm wondering if there's another way
Would be nice if COND_SkipOwnerOrInitialOnly existed
(They've got COND_InitialOnlyOrOwner but not the other one :/)
Adding another condition would require engine modifications and I would rather not do that
What do you mean guns will spawn a magazine?
On BeginPlay of the Firearm, if it's holstered and there's ammo, I will spawn a magazine and set that as the firearm's magazine reference. Since magazines are replicated actors, I need to spawn them on the server, so I have no choice but to have it replicate the reference down. There's existing code expecting the magazine reference to be correct on BeginPlay so I would rather not send a reliable client RPC or something like that
the magazine gets created one time per firearm?
what is the data that's client auth and changing?
Not necessarily, sometimes they spawn with a magazine if it's part of your loadout. Finding a magazine in the map doesn't necessarily means it spawns with a magazine however
position?
The magazine actor reference in the firearm
There's others like this, that's just one example
that doesn't sound like the client needs to do anything with it
Clients need a reference to the magazine so if they pick up the firearm it's magazine reference is valid
sure
If the magazine is set to COND_OwnerOnly (which is used to be), then they have to wait for the magazine reference to replicate down before they're able to fire
but server spawns it, tells everyone it exists
what else do you need to do?
I need to have that magazine reference on the Firearm replicate down to the owner of the firearm
which is not possible with COND_SkipOwner. This is the only situation in which the owner needs the magazine replicated down to the owner. Won't happen again after the Firearm Actor has been created
why would it need to happen for anyone else later?
Because the magazine can be swapped out with another
Which is initiated by the owner and notifies the server and replicates to other clients
the round trip time is unacceptable for swapping a magazine?
Huh?
ping
Oh for the local player, yes
I've only ever done fully server authoritative stuff, so trying to think about how to not do that seems weird.
Yeah...
Have you mapped this out in a simple flow diagram?
In VR usually things need to be initiated locally
That always helps me, usually I am trying to make things more complicated than they need to be.
What's the issue with the client setting it, telling the server, and then the server replicating it back down to the owning client?
shouldn't do much since it's already set
Otherwise you'd grab a slide or a charging handle and wait a quarter of a second before gripping which feels bad. Especially with higher ping. Just one example.
Yea but as he said, locally predicted, server gets the info eventually and lets it happen
No weird animation delays
In theory you'd only get weird glitching if the network was way slow or the client was trying shenanagins
Well that works fine. What doesn't work fine is in a scenario where you'd want to spawn firearm with a magazine on the server, but the magazine reference on the firearm gets replicated to all clients EXCEPT the owner.
Because the magazine property has it's replication condition to COND_SkipOwner. It replicates to all clients EXCEPT the owner because it's intended to be locally simulated
yeah I don't get it either. server should be the authority and to stop perception of lag you need prediction. does VR somehow make this impossible?
Which works fine in all instances except the one I just mentioned. The way I've got around this is by not initially setting ownership until the firearm was grabbed which allowed properties to be replicated to the owner but this has not been ideal.
I don't see how VR makes one iota of difference tbh. It's just a different way of viewing and inputting
I'm suggesting you don't do that and send it to everyone. What's wrong with doing that?
There's also COND_Custom but I can't seem to find any examples of implementing SetCustomIsActiveOverride
oh, there's an example right in the docs
It's not necessarily wrong. I was just wondering if there's a way I could have something like COND_InitialOnlyOrSkipOwner. Similarly to how there's a replication condition COND_InitialOnlyOrOwner. It's just unecessary to have to replicate it to the owner when the owner is the one initiating all of the actions.
SetCustomIsActiveOverride I don't believe has anything to do with replication conditions. That's just whether the property should replicate or not
If custom condition value changes a lot, this can slow things down.
I'm trying to implement multiplayer co-op in my UE5 project with Steam SDK, does anyone know of good resources for doing this? I've been looking around and the best one I've found is a YT tutorial for UE4.1 and uses features that are now gone.
sounds like it can change
I still think prediction is the answer.
I'm not sure why it wouldn't work, but again, no experience with VR>
seems to be called over and over in my project
Well the issue isn't that it wouldn't work, it's just seemingly unnecessary to have properties replicate to the owner when I only want it initially, as the owner is the one setting those values before notifying the server (there's nothing to predict here, the properties are client authoritative out of necessity). But there likely isn't any elegant solution to this issue without setting the condition to COND_None and just allowing the properties to replicate extra
.
It's just a shame is all.
custom seems like it would do what you want
You sure?
no
I've never used it.
But it looks like you can change whether it replicates or not at any point.
Fairly certain that's used in PreReplication to enable / disable replication on a property
Look at the macro DOREPLIFETIME_ACTIVE_OVERRIDE
Well yes, but you can't tell it to not replicate to specific clients
Just shuts on / off replication using the same replication condition
So I couldn't initially have it on for the owner then off
ah, interesting
it does seem to indicate you lose the granularity that the other conditions give you
I don't believe there's any way to just replicate to specific clients without a replication condition from an Actor (atleast not without a lot of work). Would be nice though
anyone here know of a good tutorial for a multiplayer same level restart and player reset?
Mine restarts the host, but drops the other players.
Blueprint:
The red circle is the gamer timer has ended section and the match is over>
I still like my initial only struct
Yeah, that's what I'm leaning towards
Doesn't mention replication unfortunately: https://docs.unrealengine.com/4.26/en-US/SharingAndReleasing/XRDevelopment/VR/DevelopVR/ContentSetup/
Ammo is another issue currently dealing with. The existing code uses COND_SkipOwner as well so it has the same issues as with the magazine reference. What is the predicted version of this? Just COND_None?
anyone in #virtual-reality have thoughts?
Because with no condition it clobbers with the local ammo count
I've mostly only used prediction with rollback with GAS.
Yeah, I've used GAS before
does ammo count need to be client auth?
Would be better off that way
There's UI for ammo and if it decremented with ping it would look strange
But with no condition the ammo count jumps up and down because of the server replciation
There's server-side checking and ammo is synchronized from OnFire RPCs so there is no desyncing issues
Seems ideal to me. Not sure
could use RPCs for all updates
all updates?
any that need to work this way
looks like that's what these people did: https://heliosinteractive.com/project-artemis-ue4-multiplayer-vr/
Can you not communicate with the gamemode from widgets at all?
I have my "spawn player" logic in the gamemode and I want to select what unit to spawn via widget. But all the "cast to GM" fails
client
gamemode only exists on the server
But you can run custom events "On server" via widget? or not?
you'll likely want to do something like this:
- select class type in widget
- call PlayerController.ServerRequestSpawn(class type) // (RPC)
- PlayerController.ServerRequestSpawn calls GameMode.Foo()
what do you mean?
if your client is also a server, then widgets can get the game mode
clients can call RPC functions that get sent to the server, but only on actors they own, which is essentially your player controller or something the player controller owns such as: its pawn, actor components on it
what class is this in?
User Widget
the game mode does not exist on clients
^
Right, thanks
Designating function replication across the network
the server can replicate variables and call RPCs on any actor
but clients can only call RPCs on actors they own
https://docs.unrealengine.com/4.26/en-US/InteractiveExperiences/Networking/Actors/OwningConnections/
An overview of the role of the server in multiplayer.
thank you
Hello, would creating dedicated server and client have to be different project and therefore executable?
Same Project. The Engine (source build) can be output both executables
Ah, right. Thanks. Though while I will probably distribute separate (pricing difference, etc) , but if one really wanted if it could be done in same executable?
Ignore the value if the Server replicates a higher one and it hasn't reloaded.
Just make sure that if server fails to fire, you also send the correct ammo amount back to client.
You can't really avoid sending it to the owner because if something goes wrong, they could end up in an unrecoverable state
Hi! Did you find a solution about controls?I am trying to posses to a AI character at runtime, but movement input is not received by possesed pawn movement component
my current health is set to replicated. When i update it on the server side to a different number. Other clients only see it as what it originally was. Do i need to do a server then mc when i update it?
You can set the current health to be replicated
It is but they cant see it for some reason
i increase the amount in a server function
What is the replication condition for that property?
And if you updating it from an actor component, you need to set that component to be replicated
set to none at the moment. And im updating it from my player bp which is replicated
can anyone tell how to replicate custom movement and animations ? Blueprint
I want to have an array in PlayerState that stores some data which can tell if object related to this player state
The question is what is better to that data to be to for multiplayer in term of performance (replication)
Make object unique id and store in that array
Or store actual object (by reference) in that array?
Hi! I am sorry to message here, but I think I've found a bug in Unreal Engine 5.1, no one can seem to fix the problem I am facing. I'm creating a local multiplayer game for a Uni assignment, and although controllers are being made they all end up possessing player 1 (0). Can someone please help?
By using booleans in the blueprint and animation blueprint which define states, which are connected to state machines and blendspaces, which when replicated cause those movements and animations to be shown on all clients.
Need more details on your setup
I've tried every set up imaginable
๐ฅฒ
What details do you need? I'll try my best to give them
Show code is what they mean. Walkthrough how things are currently set up.
You can always override an event in the GameMode and handle the possession logic in a custom way.
Yeah I'm not very good with unreal so I'm confused with what you mean by this ๐
Take a picture of your code
Post it here
We analyze it and walkthrough it to help you debug the issue
Highly unlikely this is a bug in Unreal. Loading multiple clients in local multiplayer is pretty standard out of the box. Make a new project, don't change a thing in it, set PIE to local multiplayer (listen server) and clients to 2, press play.
It's not networking related. It's local multiplayer.
oh, gotcha, misunderstood
I have downloaded a framework and tried that, so I genuinely donโt think itโs my blueprint errors either :(:(
Word of advice - if you want help, don't ignore what people are asking for.
Iโm happy to send blue prints, which ones though? Thereโs a lot
I'll send anything I think has to do with it in my own work, and then the set up of the other project too :)?
Mainly need to see where you're possessing the pawns
This is also a thing https://unrealcommunity.wiki/local-multiplayer-tips-993f4t24
You need to show your setup code.
You can override PostLogin or HandleStartingNewPlayer in the GameMode to create custom logic on how you are possessing players
I think this has just told me my problem
==Player 0 = Keyboard, Player 1 = Gamepad (C++)== By default, the first controller always maps to player 0. The keyboard also always maps to player 0. Thus, in order to control two local players you are required to have two gamepads. A common request is to allow for player 0 to use the keyboard and player 1 to use the gamepad. Unfortunately, it appears the only way this can be done at this time is via C++ code, and the simplest solution is a bit hacky. It is also worth mentioning that this solution works for Game Input, if UI input is set, then the two functions we'll override in the following will return false due to bIgnoreInput being set to true when in UI Input Mode (Haven't found a fix yet).
I'm testing with a keyboard and a game pad
Sounds like just get another gamepad and test onward yeah
Unless you really need the functionality of keyboard+gamepad for 2 players
If it's non-concurrent control (e.g. turn based) you could swap input between pawns
in other words, not control both pawns at once
Unfortunately it isnโt, ๐ฆ
then you're just handing the gamepad back and forth for example
ok, just checking
good luck ๐
I play as listen server and two players, one is fine, but the other is not. Problems are like can't see VFX, not triggering InputAction
Sounds like you have multiple issues. Replication and possessing pawn/player controller assignment.
Do you know the basics of replication?
I see many documents of replication, but still confused with UE's replication tbh. has authority, locally controlled, ga replication are just confusing
I run the multiplayer example project, but the output is not explainable to me.
Support the channel through donations. Crypto accepted!
PayPal: https://paypal.me/reidschannel?locale.x=en_US
Patreon: https://www.patreon.com/reidschannel
Bitcoin: 1JFwWHr4X6uAeoZadukzqKjzFBj3Qjy7Sk
Ethereum: 0x2B2Bc108F1Cc0fF899959dEF3226637787d8C3dE
Dogecoin: DNQ33YnhpWoTBokBNVkZP5ub8KTLkpyjpv
Join our community discord!
Discord: https://dis...
Watch all 3 of these
If i want to turn on a bulb, I need to run this on server and multicast the action. or use a variable and in client side do the things in rep_notify
is that all about this?
are those videos about this?
in the OnRep function, yes
VFX is no different. if you're not seeing it on the other clients it sounds like you aren't replicating it
I am using gameplaycue and confusing
addgameplaycuetoowner(looping) this node doesn't do the replication
Well, GAS and multiplayer are two different things really.
it says it will run on server and repliate, but still one client not seeing vfx
You may be replicating the cue but if the other clients aren't running that logic e.g. through an OnRep function, why would they ever show the VFX?
Simply replicating a variable isn't enough. The clients need to run logic associated with that variable or nothing will happen.
I play client 1 and client 1 not playing VFX, but client 2 can see VFX
I play as listen server, I don't know if client 2 is a client or it's a server
If you're in C++ a RepNotify doesn't run on the server by default IIRC
I have a theory that client 2 is not just a client but also a server, that's why he can see VFX, is this theory right?
No, in the window's title bar it will say whether it's a server or client.
When you play in editor, launch separate windows (don't play in viewport)
Look at the title bar of the window, one will say server and one says client (in a listen server setup)
yes, i am in separate windows
the title bar says netmode:server
that's useful, I don't notice the title bar. so the aforementioned client 2 is not a client, but a server and server only
right?
well, the title bar will tell you
client 1 usually the server in a listen server imo
or client 0
I mean it's ambiguous, the server shouldn't have any visuals
in a listen server mode the client and the server are the same thing
for the host client
server plus client, all server has it has and all that one client has it has.
so what kind of replication are you using?
so I have a c++ function with "BlueprintAuthorityOnly" and it doesn't work
Ah, well I'm not very well versed in native replication. Might have to ask someone else here. I can do it in BP all day.
I copied from somewhere else, but it surprisingly disable the Input action that used to work
my mistake, the ia is not working for the client no matter the c++ function
that 's weird
If I have a object inside the server that runs a function on beginplay. Would the function still run if the user joins the world at a later time?
Well clients will call BeginPlay yes
If it's a client/multicast function called from the Server, then no it won't run on clients when they join
Common to use RepNotify for this as e.g. multicasting won't store a latent value and send it to new clients, but RepNotify should send this value to new clients.
So the use case is. When the server starts. On Begin play it sets a variable called IsMorning to True (Going through Switch has Authority).
This variable is set to Repnotify.
When a client joins, would this variable be set to True or would it remain false (default value)
The variable is set to true on the servee but when you use a repnotify you need to also do logic in the OnRep function
Whatever the client would need in order to see/experience what you want it to experience from the IsMorning variable. So perhaps set that variable in the OnRep function to true is all you're going to need, if the client is using that variable in logic elsewhere. Or actually putting that logic in the OnRep function itself.
That makes sense, Ill check again. Thanks!
Hello!
I'm trying to make a multiplayer game where players control ships.
My ship is a blueprint with lots of child actors different modules and interactables.
I'm getting this warning spammed whenever I try to play as a client and I walk on my boat. What does it mean ?
ClientAdjustPosition_Implementation could not resolve the new relative movement base actor, ignoring server correction!```
Hello! How would I make it so that if a player walks upto a door and presses E on it, they would travel to a new level, however everyone else on the map would not come with them. But if someone else presses E on the door then they would join the other player on that other map.. thank you!
Is there a virtual function that is called for simulated proxy actors when they are initially replicated from server to clients?
You can cheat though, keeping multiple levels separated in one of them
Specifically for simulated proxy, no
All actors will call PostNetInit
After their initial onreps are done
well autonomous will do too. I mean when a replicated actors that was spawned on server has just arrived to AP/SP