#multiplayer
1 messages Β· Page 158 of 1
Orrrrrrrr just learn how to use it and save yourself a lot of time
https://www.youtube.com/watch?v=17D4SzewYZ0 - this video goes over the saved moves aspect of CMC
Which is what trips everyone up
Or if you want, you can buy the GMC plugin ($350)
I hear good things about that
why is it neccessary to completely write our own reconciliation if its supposed to already work
You're not completely writing your own reconciliation though?
to quote the section in the video "create custom cmc"
and create a class to hold snapshots
aka rollback
then handle how the snapshots are applied, aka reconciliation
but the cmc should already handle both
Well - you have multiple solutions presented to you
i just find it absurd the solution here is to just not use cmc
Thats...not though?
writing my own movement prediction, which is what that video is doing, means not using the builet in prediction with cmc
gmc is a completely different custom component
these two solutions are avoiding the actual default network implementation of cmc
Then don't do multiplayer. I don't know what to tell you.
i guess i expected more of ue's default network solution
@ashen plume I feel like you might have gotten confused. What about the CMC is not working as you expected?
The CMC is Networked
It is predicted
It does authoritative corrections
creating a character bp from menu, adding in standard documentation movement bp nodes, setting network emulation to two clients, under average condition, the rubber banding and correction is unplayable
Do you get the same results if you just start up a brand new Third Person Template project?
blank project
I didnt ask if it was a blank project.
I asked, if you were to setup, from the Launcher, a brand new Third Person Template project, do you get the same results if you play that instead?
Open a Third Person Template project, set the network emulation to Average, play with 2 Clients. Does it also rubber band?
let me grab the third person template quick
where do you find the third person template?
After you start the Engine from the Launcher
It should be in the various options.
Unless you opted not to include the Templates in your Engine install.
no i opted out of samples
You can have the included by going to the Engine options in the Launcher and changing the install to include them.
It will download them for you
the options menu forced an update so ill have to wait
Well yeah, its got to download the Templates
If you can play normally in the Third Person Template, and the setup there operates as you would expect. Then the issues will be with how you have setup your blank project.
is there a log or series of a breakdown of the third person template in the meantime?
I doubt it, the Templates are all extremely simple in their setup.
If you cant understand the Templates, you probably shouldnt be starting with a multiplayer project.
ive been doing multiplayer in other engines, which had basic low level implementation, my issue is having so much pre-made its cumbersome to figure out what is and isnt implemented
Unreal is one of the smoothest development environments for making multiplayer games IMO.
You can choose to ignore a lot of the "pre-made" stuff if you want.
Mover 2.0 π
the rest of the replication system, remote roles, authority, and the replication modes are all pretty slick, and a lot more organized than what im used to
@fossil spoke third person template performs marginally better, many jumps still get rolled back, and experiences awful rubber-banding
What are your specs?
Unreal isnt for potatoes FYI
If you are seeing the same issues with an unmodified Third Person Template project then I dont know what to tell you.
Sounds like you have a very underpowered machine.
i wouldnt consider my machine particularly modern, but im not experiencing framerate issues with a 1070 and i7-6700
π€·
Also, the network emulator presets are pretty worse case scenario
Average is an understatement
i would hardly call 60 latency worse case
is there footage somewhere of the third person sample running at various tiers of network emulation?
What are the defaults? Keep in mind setting 60 there doesn't mean 60 ping
More like 60 up then 60 down
yes, i'd rather not find out how bad it is on the bad setting, with everyone, of two clients
mind you that the lyra sample seems fine
but again most of lyra is custom
how do you enable the corrections visualizer?
p.netshowcorrections 1
This π
Also Lyra's movement is basically stock CMC lol
Just some adjusted properties and of course their locomotion setup with some gas stuff over the top, but the movement has nothing special going on
most of what i gleaned of lyra was that their hero character was a dervied class of character, with a couple of custom components, each in c++
is there a breakdown i can read somewhere?
There will be breakdowns but I can't recommend anything specific, I went through Lyra in-depth basically from it's day of release so never had the need. Give it a Google
Has anyone managed to open their ports and host a session where players outside can join the server? I am currently troubleshooting this and it doesnt seem to work, I have opened the port but still my friend cannot join with the correct IP
i'll give it another go, I had looked through it some but wanted to avoid any prediction rewrites, which I assumed they were doing by needing to write it in c++
It's a worthy resource to learn from, just a bit large
to be fair, im out of choices, and the performance of the third person template on my machine isnt going to cut it
Are you looking at building a competitive shooter?
Epic uses the same CMC and Character that exists with the Engine in Fortnite.
If its good enough for Fortnite its good enough for 95% of other Unreal games
Network emulation is arguably never ideal to use as a test bench.
Its great at showing you if your game state completely breaks down unrecoverably in certain scenarios. But as long as it recovers, you are golden. Thats about all its useful for.
Isn't there some kind of exception with this. They have to be doing a whole lot of optimization techniques in the background right? CMC is always my biggest problem. Feels like no matter how I modify the settings it eats all of the budget
It's gotten so bad that I've just decided to make my own component to replicate movement for non essential characters
Sure there are optimizations you can make but they involve disabling/removing features or reducing fidelity etc etc.
Those choices are really game specific. So without knowing whats required, no one can make any recommendations
That is generally a smart choice that any developer should make. You want to prioritize things differently depending on their importance to gameplay
Just assuming CMC can handle and be used everywhere without consequence is foolish.
Ah, glad to hear π«‘
One thing I noticed, that you might want to be aware of, is if you use distance matching and variable emulation values (eg. min 70 ping, 90 max ping) then simulated proxies get quite jittery because it messes with their predicted distances lol
So if your sim proxies look janky as heck and you're using distance matching, check your emulation settings
Those emulation settings don't seem to update latency once in a while but constantly which causes the issue (or rather, the non-issue)
@grand kestrel Interesting to know
If i spawn an actor by the owning client, switch on authority will be authority even if its not replicated and is spawned by client?
Mehn now I can die in peace Ave finally seen you chat... Always wondered how your so greatly mysteriousπ
The client has authority over the actor it spawned yes
Why not just spawn it and have it print the result tho π
Hey guys please I have been search for a very broad range information material about multiplayer framework in unreal engine like explain the "why" of everything like why overlaps are meant to be called on sever etc any leads,?
Your question doesn't make any sense. Can you rephrase it, please?
Hello. I've created a gliding system for a flying character. The problem is that, when the FPS is very low, the server throws you to the other side of the map. How can I solve this?
Thank you
it may be possible to subtick some of the logic to improve accuracy with large time spans
this is how most movement components work already in-engine
And account for deltaTime in general?
Unless i missed that
Hm... that would make it slower/seldomer. not faster
yeah, I can't tell what this is actually doing
DisableGlide() -> Glide() seems strange to me
Essentially in multiplayer games you want the server to say what is real and valid, otherwise clients can do whatever they want in terms of cheating
That's just for avoiding gliding again (only after 0.6 s)
The AddForce on server, on very low FPS (10 for ex) it throwing me away over the entire map. Capped at 60 FPS, it's working as expected
Hi is there a distance if my player is far away where it's not loading the map (on client) when it's loaded on server using level streaming ?
also, you dont want the client to tell the server how fast they can glide (unless you wanna cheat)
How do I get event anydamage to fire on the server in a character class that has no player controller?
The event will be fired even if there's no PC, what do you mean? As long as you deal any valid damage using the appropriate functions on the server, it'll be called
Apologies, I'm still trying to understand how this works, but the descriptor/label/alt text for the Event AnyDamage node says "Authoority Only. This event only fires on the server.", I took that to mean it wouldn't fire unless executed by an authority.
At the core of things I'm trying to figure out why clients aren't able to damage the actor I'm trying to damage but the listen server is. I've added print strings to the anydamage event, and it's not firing when a client hits it, but is when the server hits it, even though I have the event for calling the "Apply Damage" node set to "run on server" on damaging actor.
At the core of things I'm trying to figure out why clients aren't able to damage the actor I'm trying to damage but the listen server is.
Damaging actors is only possible server-side. If a client wants to damage anything, it must tell the server about its intention. Ultimately the server will decide whether the client can actually damage the thing it's asking.
AnyDamage will be called server-side only as well, hence "Authority Only". If you want to notify clients about the damage, you'll need to create some custom means. However, usually people keep track of the health: anytime it changes, it means that the actor was damaged (or healed).
"Damaging actors is only possible server-side. If a client wants to damage anything, it must tell the server about its intention. Ultimately the server will decide whether the client can actually damage the thing it's asking."
That's what I was assuming, but I have an event that runs on the server that the damaging actor calls to call the Apply Damage node, so I'd assume that would mean the server is calling that event (unless I need to call that event on a class that's on the server, such as the player controller, perhaps I should try that π€)
(To quote something you can highlight it with your mouse, and press the quotes sign)
Ah, thank you π
If you call ApplyDamage server-side with valid arguments, the OnAnyDamage will be called
"Valid arguments" means damage != 0, i.e. it can be either positive or negative
I needed to call it on the playercontroller (or some other actor that has authority). Makes sense π
Now I just need to figure out how to do that without casting π€¦ββοΈ
(To clarify, since I mentioned that the actor had no player controller at the start, I'm trying to create a player with a player character who can damage an NPC, who I'm assuming doesn't need a player controller. Granted I'm not sure how NPCs without player controllers are going to be able to execute replicated events, but one step at a time)
Server has authority over any actor in the game
So you can call the ApplyDamage using any actor server-side, and it'll work
In my case when I was trying to call ApplyDamage on the PlayerCharacter, it was not being called unless I was playing as the listen server. When I moved it to the PlayerController and called it with a cast with the same inputs it can now be called by the client and the listenserver. In both cases I was using a custom event set to "Run on Server" π΅βπ«
Can you show your damage related setup for the PlayerCharacter?
Sure, gimme a moment to gather the screenshots π
I have re-tested to make sure, and the before setup still isn't working, the "now" setup is
In the first screenshot HitActor will be always None when it's the client attacking. The server doesn't have that HitResult because it didn't run any trace
Ah. So if I start the custom event from before the trace it should work?
You have to pass the hit actor in the event so that the server knows what you want to damage
You are correct, I am big dumb. Thank you very much π
You're welcome
Yes yes surely .... So is there Na list of all this? Things that are to be real?
After reviewing with fresh eyes, I managed to get the results needed thanks to the advice and combined knowledge of you guys. I need to clean up this and adapt, but it's a start.
Just wanted to say thanks to @mystic estuary @dark edge @sinful tree for reviewing and taking the time to answer.
No, its at the devs discretion... do you want client to be able to modify their own health, location, inventory, score, currency, etc.
No atall ....
You a compendium I can read
From your messages looks like you're just looking for networking resources. There's a lot of good ones in the pinned messages like this compendium and video: https://cedric-neukirchen.net/docs/category/multiplayer-network-compendium
https://www.youtube.com/watch?v=JOJP0CvpB8w
Yes yes alot of it please
Yeah just scroll through pinned messages to find them all
Why when I press P on the client to see the value of the element at index 0 of "ActiveAbilities", it doesn't get called ? Why please ?
A RepNotify variable set multiple times by the server in the same frame will still only be rep'ed once, right ?
Yeah. Happens at end of the frame.
So... would GAS juice this up somehow?
Im getting multiple updates in a frame
In a LiFo order
if i'm working on replication using cpp do i give questions here or in the cpp channel
here if it's mostly about the networking side of it
Hi, im making a sewer system where the player interacts with it, it displays a map and the player clicks on the sewer they want to go too
When the player first interacts with the sewer it'll play a timeline that opens it, then when they click on their desired sewer from the widget it'll open that one, delay for a couple seconds and then teleport the player over to their desired sewer, it then closes both the current and desired sewers
Almost everything is working fine however the closing sound effect isn't heard for the client player who is travelling, when the last CloseSewer is called on the Desired Sewer, they don't hear the closing sound played but the server player does, any ideas why and how to fix it? adding another delay will make it play the sound for the client but I know that's not the correct fix
Why the multicasts if you're already repnotifying on IsOpen?
Do I not need to do that? the rep notify is just setting the open or closed locations for relevancy
I would instead:
OnRep_IsOpen -> call event OpenUpdated
OpenUpdated -> play sound -> play timeline
That wont play the timeline and sound again for someone who becomes relevant later tho would it?
Is PostRepNotifies() called when everything is replicated on client side?
From the naming I guess it fires once when everything is replicated on client side
I'm thinking of overriding it to call a custom BeginPlay for a replicated UObject
Do USTRUCT properties need to be marked as UPROPERTY to be replicated, if the struct is used as a replicated variable in a component/actor? If so do the properties inside the struct need to be marked as Replicated for them to be replicated or only marked as UPROPERTY?
You don't need to mark the properties in a struct as Replicated, If the struct is replicated and you don't want to replicate a specific property you add "NotReplicated" specifier to it afaik
Not sure about the rest tho
Called after rep notifies are fired yes
Can be called multiple times though (any time something got replicated from the server)

Does need to be UPROPERTY yes
Replicated doesn't exist for struct properties
Only NotReplicated if you want them to not be replicated
thank you for the answers
Oh, Is there a function or delegate to use that fire once?
is the UObject a subobject
Yes
well, yes it is im dumb
it has to be
it's not a component right, just a pure UObject?
Yep
have your UObject implement IInterface_ActorSubobject
override virtual void OnCreatedFromReplication();
use that as your "BeginPlay()"
keep it mind that may be called before the outer actor has begun play (probably, not sure, sounds like a reasonable assumption)
Oh great, Thanks alot!
Keep in mind this will be called on clients in multiplayer only
Not on dedicated servers, listen servers or standalone
Great to know!, Thanks again!
o7
So, I fixed the duplicate session showing up on the server list, but now everytime i click on Join session in the widget, The "Server Joined" print string will be visible, but it won't open the listen level, it will just stay on the menu, any idea why? (Currently using SteamAPPID 480)
I'm not sure how your set up is but are you creating a session for the player when they first load up or do they have to press a button to create their session? if they're already in a session it needs to be destroyed before joining a new session, add a destroy session node before the join session node then plug in the join session node off both on success and on failure
Also ideally that code shouldn't be inside of the widget class
Also, are you using any specific plugin?
What engine version do you use
5.3.2
Was working till this morning, perfectly fine
5.3.2 should be fine, since it was working i was able to connect both of my pc's
Testing with 2 differents pc and 2 different steam account
This is the game mode handling the post login, but i recon that wont get fired since im not joining the level at all
Ill check the hotfix anyway, might be the reason stopped working(?)
The hotfix would be adding this in the defaultengine.ini
[ConsoleVariables]
net.CurrentHandshakeVersion=2
net.MinHandshakeVersion=2
i'll test it out soon! Thanks both
Yup it works, thanks @solar stirrup was just the hotfix issue :S
o7
Hey, if there's data on the game mode that I want on the client, what's the best way to get it? I have GM-specific data, like "game mode name" (e.g. "Team Deathmatch," "Capture the Flag," etc.), and I want to get it on the client to display it in their UI. But the game mode only exists on the server. What would be the best way to retrieve it?
put it in GameState
or have that gamemode use a specific gamestate
What if I put the GM data in a static data asset, and then have the game state retrieve that data asset when the game starts so it has a persistent reference to it that can be retrieved by the other clients?
I mean sure, why not just have the Gamestate class BE that data asset?
score and flags etc are state of the game, might as well keep that energy going
Well there's a lot of static gamemode-specific data that I feel is better suited to being compartmentalized into a static data asset, like which UI elements are created, which global gameplay abilities are applied, etc.
Runtime data like that is all in the game state, but the "rules" of the game (like starting lives) is in the game mode
Hey guys, I have tried few stuff and made few research, but I havent found the answer. How do I "Open" a level just for 1 player? I have 2 players enjoying 1 level, but then... they want to go to another level. But just 1 player, not all of them, how to?
Is it an online multiplayer game?
yes
Use seamless travelling, not the absolute one
If you know which player wants to travel, you can just call your "Open Level" code on that player's instance of the game. Whenever you call code in multiplayer games, it will only execute on the instance of the game that its being called on. So if you just add a check to ensure that the code only gets called for a specific player's game, then it only gets called on that game, if that makes sense. If you have the actual client, you could just send them an RPC too, though that might not be necessary if everything is replicated correctly.
but, by doing it, I will try that and the seamless travel.
I was trying this, it worked, but it takes every actor in the level even with a "Specific player" correctly placed.
Hmm, sorry, I don't really know how this system works. I've only ever used UWorld::ServerTravel and APlayerController:ClientTravel in C++. I'm not sure how it works in BP
I can do this on C, no problem. So, you can make a object call the player controller and then, server travel and it works for that player only?
You can't use server travel in this case, because then the server opens the level. Since everyone is connected to the server, it will disconnect everyone and re-connect them to the new level so they stay with the server. If you want just one player to travel, you'll need to call ClientTravel for the player you want to travel. Since the PC only exists on the server and local client, you can call it on either one without worrying about the other players traveling.
I will try that, thanks
Hi! I made a teleporter that should change the player's position when overlapping with a collision box, everything works fine but only for the server, when client tries to TP, it teleports the server, can someone help me, please?
I played with replication earlier but it doesn't seem to work, I'm probably doing something wrong
You wanna avoid using any getter that takes in a player index for multiplayer, your get player pawn will only ever get the player at the index of 0 which is likely your sever player
Oooh right, I immidiately thought about it when I read your mention about the player index
So do you know what should I use to make it work?
will cast to a bp_thirdpersoncharacter work?
(I don't think it's even possible)
Your events are not replicated as far as I can see.
As for player controllers;
Each client will have only that client's specific controller.
The server will have all player controllers on it.
A good alternative depending on what you're doing is to query for PlayerState instead, as well as GameState for certain things
GameMode is also not replicated if I remember.
what class is dimension 1, 2 and 3 events in?
gamemode
Okay something is about to work but it looks like this: (I've added replication)
When client attempts to teleport, it only teleports him for 1 milisecond then goes back to the spot he tried to teleport from :/
It works for the server
But it still teleports the server when client tries to do it
is having full server authority that important even for games that are meant to be played really only with friends (non competitive)? or is it fine leaving some stuff up to the clients?
im mainly talking about movement here
Okay everything finally works! I just did the whole thing in the teleporter's actor class and used the Other Actor node as a target
thought so, thanks
If I wanted to save a players stats (like level, xp, etc.) and I don't want this data stored locally, do I need to have an online database/cloud save in order to do so? Or can I save all of this without leaving unreal engine
Doing it in a database is the better route, generally.
But you can get away with using UE's save system on the dedicated server. And you want them to have unique stats per server.
Thank you for the help! It's really difficult to find resources online about server authority saving in a multiplayer game. Would you happen to know of any resources that go into that kind of thing? If not all good!
Nope. Just experience.
I'm getting a weird drifting issue on Simulated Proxies. Creating a custom movement mode with network prediction. Looks fine on the server, and owning client, but other clients see the moving client as shaky, and if the player stops turning, the Simulated Proxies see that client drift off of their location.
Network Prediction?
is this for player character movement?
if your using network prediction, i would suggest looking at 5.4's Mover 2.0
unless you mean network prediction with the CMC which is a different thing
CMC
Here's the 2 clients.
Ok nvm. I did the thing where after being stuck on the issue for an hour and then posting, I suddenly know what the issue is.
I didn't replicate an FVector to the simulated proxy. So it was trying to move the player to 0,0,0
It's fixed now. Sorry about that.
I'm learning Unreal right now, and I want to make sure I'm doing stuff right from the start. I have a simple control script in my PlayerController. If I want to have a server authoritative setup with all the benefeits of UEs networking, should I keep the AddInputVector(s) inside the PlayerController code or in the Character code?
I don't think it matters where you put it as long as you are passing the correct references
ofcourse, movement specific logic should go in the character
The only inputs that should be in the controller are inputs that are not related to any specific pawn
Okay so I have problem I can't sort out. I have a car actor BP in a world partitioned level. When playing as the client, when I get outside a certain range of where the client spawned in the car will just unload without any prompting at 32k units. But if I go on foot the client character won't. The car doesn't unload and works fine if the server does the same thing.
Setting "Is spatially loaded" to false fixes the issue, but it keeps the car always loaded in which doesn't seem like a good thing. Anyone have any idea how to fix this that doesn't require the car actor to always be loaded?
I also tried setting the relevancy to the owner, always relevant, etc. and none of that fixed it either
Alright I have fixed the issue for realsies this time. I just have to spawn in the car after the level is loaded rather than placing the car in the world. I don't know if that's best practice but I'll take it.
Has anyone toyed around with the Network Prediction Plugin beyond the Mock stuff and Mover? Specifically with having two Simulations (e.g. Mover + Some Ability System) work together?
Is Unreals Bandwidth limit being 10K pretty average? I'm wondering what a good target to aim for is for a Multiplayer game. I can't seem to find any info on it online.
The limits on bandwidth set in the .inis is very conservative.
Average internet connections are very capable.
These days
You would likely hit CPU bottlenecks before being drastically impacted by bandwidth limits.
So focus on reducing CPU usage instead of worrying to much about bandwidth
can anyone tell me why this is happening when i possess the boat from client?, i run the possession on a server event too and i tried all different classess to call it from aswell, the boat doesnt do this if i play as the listen server but when i play as the client and possess it does this/ its also possession because only if i possess this happens otherwise even attaching doesnt cause an issue.(im using smooth sync to replicate the physics)
Hey, how can i load/ unload a map only for 1 client using level streaming ? π
You sure you call Possess on the server?
An probably no one can really tell you, cause no one knows your code
i do a line trace on the player character that calls an interface on server event, the event then communicates with whatever to possess it.
ive tried to call the possess function from that bp, from the player bp, from the game mode and from the controller but no one work
i am pretty sure actually
The ServerRPC must happen in the Character or a Client-owned Actor fwiw
Where you call Possess afterwards doesn't matter
Speed is fine for Singleplayer, or 1 client. But for each Client the rotation speed gets faster. With 4 total clients their speed is insane.
How do I stop this?
so the actual possession and seating of the character on the vehicle is on a server rpc thats just spawned and there in the world, whilst the interface message thats sent is in the characrer class which is client owned., again im pretty sure ive tried it all the way arouds yet i cant seem to get it work properly
Well, again, ServerRPC has to happen on a Client Owned Actor
Otherwise it's dropped
im pretty sure i did that
also is there a way to check if its dropped?
Think your log should say that you tried to call a ServerRPC on something that has no owning connection
hello, im trying to simply have a player Possess another pawn when they interact with it, but there's something odd going on
the Event Interact fires correctly, but the Run On Server event doesnt run at all, and im not sure why
it runs if i do the same on the listen server, but on clients it just doesnt start
could it be because the client does not own the pawn in question (the one it wants to possess)? if so, what could i do? is it possible to transfer ownership?
should i just call the RoS directly from an owned actor instead?
ok imma look for this, thanks a lot!
same issue
almost same
Thanks for the info. When testing recently, I noticed I was hitting the 10k cap, and we were experiences a good bit of Client Corrections.
Do you have a ballpark idea of what I could raise the Max to?
Same for you, you can't call the RPC on the Pawn you want to possess
The RPC has to be called in a ClientOwned Actor
Typical is to call the RPC in the current Character and then do the Trace -> Interface
yeah, figured it out lol, thanks!
Hey y'all I am running into some issues with seamless travel, in that my character pawn is not persisting from one level to another. It is being despawned and respawned I believe. Anybody know how I can correct this?
While you could in theory, via C++, persist it, it's usually more common that it's supposed to not persist
SeamlessTravel doesn't persist much. The only thing you get is a chance to move data between PlayerStates and PlayerControllers, and in theory to persist things manually if really needed.
I see, and I appreciate the response! Do you know how I might set up my character pawn to persist?
In C++, in your PlayerController, you can provide the Pawn in the SeamlessTravelActorList
But again, it's highly likely you simply don't want to do that and rather spawn it from scratch
Any other reference that Character has to things in the old level will break
And stuff that might usually initialize by that pawn spawning will also fail
You are usually better of only saving the data that the Pawn needs
And if I am only saving the data that the pawn needs, I would manage that in the PlayerState?
You could, yeah
Or in the Playercontroller
GameMode should have a function that calls and provides old and new PlayerController
OnSwapPlayerControllers or so
Like for instance I have a variable on my character pawn called "hasJetpack" so it sounds like this and other variables like this should exist on the PlayerState or PlayerController. Is that right?
There are more ways, you can also save the data before traveling and load it afterwards again
There is a message pinned to this channel
That offers some ideas
"Persistent Data Compendium"
Ah yeah I have looked at that a bit
Hypothetically, if I were to move that "hasJetpack" variable to my PlayerState, that would automatically persist through the seamless travel?
Not automatically
You would need to use CopyProperties in the PlayerState to move it over
I've seen references to that as well, is CopyProperties the only event I need to implement? Or is there something akin to "PasteProperties"
Only in theory
If we ignore reconnectors
Which use that other event
Which name I forogt
OverrideWith or so
Okay, so I assume CopyProperties will be fired at the beginning of seamless travel, and then the OverrideWith is fired at the end of seamless travel?
No
CopyProperties is called after the SeamlessTravel is done.
OverrideWith is when someone reconnects and you have inactive playerStates for disconnected players
Hi! When we call "SetOwner()" on an actor, from reading the source code, it seems it gets replicated to clients right? So it would be correct to only call this function from the server, I assume
Yes, you are also only supposed to call it from the Server in theory
excellent, thatΒ΄s what it seemed like, thank you π
I really appreciate the help. Do you know of a resource that would help set up copyproperties in bp?
It's just a function you use. Read my Compendium fwiw, but in theory, that doesn't need documentation much
Hey everybody! I'm playing around with UE 5.3 and I noticed strange behavior when using standard first person player controller (based off the first person template) and character -> physics colliders. Can somebody point me in a right direction on how to fix it? Is it even doable with the standard character controller or will I have to replace it with some physics based solution?
Those branches are just plain box colliders and the character is a default capsule, visible mesh is non-colliding.
@solid fjord ??
Hey there, i have a pretty basic question that's been stumping me for hours now..
I have an actor in the scene, it has an inventory component.
Goal is to update widgets of the inventory properly, i got it working so that each player can interact with it, set itself as owner and move it around. When the other player then comes and interacts with it it can see the changes just fine. Issue is when two players are looking at the inventory widget (grid w/ slots, etc.) at the same time..
Any ideas or pointers in the right direction would be very helpful!
whats up?
I solved it by having the inventory (like chest) always owned by the server, all inventory manipulations are done via the server side event and I have set the "RepNotify" on my array with inventory contents which is fired on all clients when it changes @solid fjord
ohh that might be a good idea, i'll give that a shot. thanks!
No problem, works great on my project but I'm a UE newbie so maybe somebody has better solutions π
This is going to seem silly and very stupid but i for some reason cant tell the client the server has set an array element or set members of an array element without doing this.
The array is replicated what am i doing wrong gand how stupid am i
Well, I do the same
Seems that you need to actually touch the variable itself, not just its contents for the notify to trigger
And make sure that your actor actually has set "Is Replicated" to true, I've lost few hours on that when I initially implemented that lol
Thing is though even if i tell the sever to set the array like that it just doesn't tell the client
Yeah replication is set to replicated
i just tried with rep notify it doesn't really do anything. Also wouldn't it just be the same as having that extra function is you had to use notify to call it
In my case I need the notify, so I can re-draw UI after the data is received, also it was useful to just print debug info when the data was received
makes sense i should probably use the notify
It just calls the function after it already updated the variable, so if the replication is not working it probably won't change anything but I found it helpful for debugging
Yeah using the notify does make sense now. Maybe the player shouldn't really have access to the inventory except when using it in the ui to drag n drop. so i might use the notify to update the ui with the new invnetory using a interface
They can still read from it tho like normally
No need for an interface
I assume the inventory is already some sort of component anyways ?
Yeah using a custom bp component
I use the common ui activaable widget stacker so i find it easier to set the current one as a variable and then just use the interface to update the ui
So they'd read from it normally, RPC for an attempted move through their owning PC , and get On_Rep for the actual change
Id let the On_Rep just trigger a local event dispatcher but if interfaces suit you then go for it
I'm glad you mentioned the event dispatchers since that's exactly how I did it for my system π
Interfaces only make sense if you dont know which class you are talking to*
In this case its always gonna be a player through the UI
Hey everyone, I'm trying to develop an Local Multiplayer Monopoly game for my portfolio, is it okay to ask here for some advice or tutorial reference ?
thanks for the answer !
[2024-03-02T19:02:08.698Z]LogOutputDevice: Error: Widget [Action_Select] does not have a parent activatable widget at any level - cannot register standard binding to action [Legacy_DT_PMM_InputAction_Input_Select]. UserWidget parent(s): CharacterSelection, WB_AvalonHUDManager_C_0
Hello I am trying to fix the above error but I don't know how to configure the parent widget
You should use #umg for this
oh i am going mad π i thought i click umg π
Hi! What would be the best way to replicate a UDataAssetreference? We spawn our actors from them so it's a concrete case in which it would be useful, otherwise we need to replicate a lot of data that is already contained in the data asset. Basically I only want to make the data asset network addressable, not really interested in replicating it's inner data at all since it is constant through the game.
A replicated UPROPERTY of a data asset pointer should work just fine
And yes, it's replicated as a path to the asset
Hey guys I am trying to spawn an actor (loot) on a listen-server that is replicated to owner only. The owner of this spawned loot is a player controller, this makes it so the spawned loot is only visible to the client with that controller. However, the spawned loot is always visible to the host player as well. Any tips on how I could make it so the host player cannot see this spawned loot?
Well the host player is always going to know about the actor, they're the server after all. You'll need some clientside method of hiding for the host player
is there a way to check if the controller is Host or Client?
Well you said the player controller owns it, so you can get the owner. IsLocalPlayerController is helpful here
Clients don't know about other player controllers, but obviously the host will
That entirely depends on your games needs. You want it as low as you can get away with.
ohh excellent then!
thank you!!
HEY! I get the result of the advanced session (to create a server list) and 'Get max players' works, but 'Get current players' does not. What could be the reason for this? (It always returns '1')
edit: solved by adding Extra settings etc. etc.. life is beautfiul aq π
I need to create a server event with inputs, so I can call it from other places (server sided).
If I create an RPC with inputs but don't call it from the client, could the client using a cheat call it by any mean and cheat in the game ?
Is there a known way to change the cap? I've seen a few different posts online from various years.
Any client->server RPC you have in the game a cheat could arbitrarily call or modify calls to
I know that but my question is about creating an RPC (so a server event with inputs) and never call it directly from the client but rather directly from the server, so is it possible for a client to cheat with that or not ?
why is it even an RPC then
isn't RPC = Server Event ?
the initialism is self-describing, remote procedure call
if you want to call a function on the server from another function on the server, just call the function. no networking required
so the way I'm doing it is having a server event being called by another event from the server, is that good ?
yeah, completely pointless
Because you're already on the server
just use a normal ass function
"ass" function ?
Ini files
normal-ass if you want to be pedantic about punctuation
Its easy to google
normal-ass ? pedantic ? I'm even more confused
it's weird you don't know these words
but fine, I won't say ass
just use a normal function or event
because I never used these words π And also english isn't my first language π
UFUNCTION(server,...) and UFUNCTION(client, ...) and their BP equivilents are only useful for networking
Is there a method to not accept a player joigning the game midgame if he was not in a list of PlayerControllers that was set in the beginning of the game ?
I want this to avoid accepting new players but still allow players that were there in the beginning of the game if they get disconnected to come back in the game without any problem.
You can refuse connections in AGameModeBase::PreLogin or AGameModeBase::Login
I'm not sure to understand as I'm using Blueprint, how to do that through blueprint please ?
You need C++ from memory
I could be wrong with UE5
I dont use it at the moment.
You could use PostLogin in your GameMode in Blueprints and destroy the Controller (or send an RPC to tell the to leave). Would need to keep track of UniqueNetId to know who should be there and who shouldn't.
I can tell you though that the majority of this kind of stuff, if done right, needs C++
Blueprint won't bring you far, so you should somewhat get used to the thought that you gotta learn C++ if you want to ship a multiplayer title
If you are making any serious multiplayer game it wont be done purely in BP
"Won't" and probably "can't".
π€· lol
I'm trying to create an Among Us type game, so even isn't possible with Blueprint only ?
Maybe?
Some of the Gameplay, probably.
You will hit walls every once in a while
The "Deny Connection" stuff being one.
networking is one of the things that is 100x more painful in BP
and then there's stuff you literally can't do
You could probably get a bunch of plugins together that expose what you need. But honestly, you need to learn and use C++. It will make your life easier
It's kinda weird that there's no node to deny the connection of a new player or at least a node to kick a player π€
I can explain you why that is
Blueprints were never meant to develop a full game.
They were meant as an extension for C++, to empower Designers to create smaller scripts.
They grew a lot, because Epic noticed that people use them a lot more than they thought.
But ultimately, a really really really big part of UE is not available in Blueprints
And won't ever be.
why ?
And you find that multiplayer related stuff is missign a lot more
Because there are no plans to expose more. And a lot of stuff simply can't b e exposed, because there is no logical counterpart to it for BPs
If you want to realy know why, you gotta ask whoever is responsible for this on Epic Games' end
Blueprints is and will always be a designer visual scripting language, that has a lot of power, but also a lot of limitations.
I don't have the privilege to have Epic Games friends, so that means I will never get an answer to that question, and to me it's kinda stupid as it would help alot of people. And I think one of their goal should be to expose as much stuff as possible to blueprint so people can do most of game (multiplayer games included) into blueprint only.
We are 8 years or so in
This won't happen
You can do a lot, but you gotta live with the fact that you need C++ for more complex stuff
The issue is there are no good unreal c++ tutorial showing how to do stuff properly
There are honestly also no good Blueprint tutorials either
But we all made it work (:
There are very very few (if any) games of a scale epic generally cares about that would have use for blueprint-only multiplayer functionality of the level you're talking about. It's really as simple as that - it's not the intended workflow, therefore it isn't something they're going to care about.
Blueprint isn't intended to be what you create everything in - just because you can doesn't mean you should, and time spent enabling a sub-par workflow is time that could have been spent on actual improvements to the engine.
There are a few annoying omissions in terms of general replication functionality that would be good to have, but exposing everything (or nearly everything) would just be a waste of time for something that still wouldn't be used by the majority of shipping games.
True, but to me Blueprint feels more fixable as visual scripting is easily understandable compared to C++ where you (I guess) need to handle stuff like memory, optimizations, etc... while in Blueprint alot of that stuff is handled for us BTS.
You don't need to handle Memory in C++ either
Unless you really start using native C++, which you usually don't
And "handle stuff like optimization" is also not true. You can write more optimize code in C++ than in BPs, but that's optionally
As long as you stay within the confines of UE's framework, C++ in UE feels like a worse version of C# π
I fully understand if you like BPs more than learning C++
That's what I felt when I tried it
But that won't change anything about what UE requires you to use when making more complex Multiplayer Games.
This is a good thing though. Because you're really not dealing with the frustrating parts of C++ per se
Do you define an "Among Us" like game as part of "complex Multiplayer Games" ?
Just about any multiplayer game is inherently complex.
There are varying degrees of complexity, but there is no "simple" implementation of multiplayer.
Parts of it, maybe not. Interacting with some Consoles or so can be done in BPs just fine.
Killing someone and reporting it, too. The Gameplay part probably works just fine.
But Session Management and possibly the Voice Stuff might be more tricky
argh
The UI part, the voting of people etc. can also be done in BPs fwiw
Well, then I will start doing all the major BP part, and come here asking 1000 questions about the c++ part π₯²
Like, you can get away with a lot
But you will eventually hit a wall
Or hack it really badly
The Denying of Connections is one of those things. You only have access to PostLogin in BPs. Not PreLogin or Login. When PostLogin calls, you already have a connected player. Which is a bit weird if you then forcefully disconnect them, cause they will already have loaded the map.
I'm actually glad Epic didn't go the route of exposing literally everything. I can't imagine what evils designers would get up to
I really don't think it is possible to expose "everything"
I think they should expose some stuff where they exposed other parts of
Such as PreLogin and Login fwiw
But NetSerializers, generally Templated stuff, anything that has Struct Shared Ptrs, and what not
There is so much stuff that I wouldn't even know how that should work in BPs
well seeing as BP structs barely work as it is, it's probably best they didn't try and make a BP parallel
I would like some Quality of Life updates though
- OnRep callbacks from C++ Properties, such as Instigator, Owner, Controller, PlayerState, Pawn
- Callbacks for different Actor Stages, such as PostInitProperties etc.
- Some better way to create MatchStates in BPs, cause that is interely C++
- Setters and Getters for useful Actor/Pawn/Character/Controller/etc. stuff that has supported types and are just missing
- Maybe SeamlessTravelList support
There is a lot that was originally not exposed cause Epic thought Designers would break stuff. But by now there is so much stuff that can break, and I also don't get why one would limit functionality over user-faults
I realized the other day that there isn't a delegate that fires off when a PS is added/removed from the PlayerArray in the gamestate. I think that could be useful personally. So I have one myself and I use that to handle some UI stuff.
Yeah the PlayerArray is also a strange piece of art.
At least the add/removal methods are virtual
the lack of delegates for the player state being valid on the client is a real piss boiler
I've had to implement it manually for each project
Like they constantly add new cool features, such as MVVM, new Style Sets, StateTree, and what not. Stuff that needs new Editors, UI, Types, Icons. One would think there would be some room for adding simple exposed functions
It took so long to get a proper Controller callback in Pawns for Clients
That's pretty much what I am using that delegate for.
Why can't I control my spawned character on the
- Client 0 instance when I'm in Netmode : Client
and - on the Server when I'm on Netmode : Listen Server ?
I have a Widget that shows up in world when a player is in the area, the problem is other players are able to see it, i need it to be visible to induvidual persons.
That's because on every client's machine, a player is overlapping with this. You need to filter for only the local player.
Cast other actor to pawn, get controller, check if it is locally controlled - this is one way to do it.
how do i check if its locally controlled?
It's a method on the controller
Yup. Also wanna check if the controller is valid as well.
Like this?
Run it - see what happens
Wow that worked... okay thanks amma now try to figure out why xD
because it does essentially what i told you in #umg
only executes the piece of code on the client that is overlapping
on the server and all other clients the branch condition will be false
I've been bamboozled
nah i told them to ask here what the best practice for UE multiplayer is
I've not been bamboozled
as i suggested to check for server authority and only show the widget if it's false
which might work, too?
Hi, is it possible to force the replication of a value that doesn't change ?
anyone please ? βοΈ
No. Because Client B would run that code as well and they're not authority of this overlapping thing
makes sense, just hopped in here because i was curious what the solution is π thanks
Why would you? If it hasn't changed, clients already have it
So am guessing i can use this logic for any other thing that needs to be run locally?
It's one way, yes.
Because it changed too fast A > B > A
There are situations where the HasAuth check works as well. But running something on a specific client, you typically want to check their Net Role, to be AutonomousProxy pretty much. Which is something that the is local controller checks.
Then it did change. In which case, replcated properties only send out the value at the end of the frame. So if it did A > B > A in one frame, the server doesn't register it as changing for replication reasons. There might be a way to do it otherwise, but I can't recall
Well i can flip a bit to force the update but i guess there is something more clean :p
In c++ you can set a replicated value to always trigger the onrep update vs the default update only if changed?
That's not the same thing. By the end of the frame, the server will see that the value is still A, even though it went A > B > A. So it still shouldn't replicate in the server's eyes
OnRep being triggered is only something client side anyway
And that's what you're talking about
hello guys! im trying to use an event dispatcher in a multiplayer game to activate a timeline inside an actor for a little animation, the problem is that in the actor i know the movement is replicated, because another timeline on the begin play replicates the movement just fine across clients, but when i try to do it with a bind event using the event dispatcher, the code works on the client that uses the animation, but not on the server or the other client
here are the bps
and here the code inside the actor that is supposed to do the movement across clients
i tried a bunch of stuff, like the thing on the unreal documentation where i would put a custom function to call it on server and then call that on the client, but it hasent work like other things i have completed with that method, and i dont know if im using the event dispatcher badly
if anyone needs more context or info, you can ping or dm me np, ill use the time needed to explain it correctly
Hey there, i have a question about ownership,
i have an actor in my scene on which i set the owner to the server in the beginplay like this:
SetOwner(GetWorld()->GetFirstPlayerController());
I then call a function on an actor component on that actor, and depending on whether it's the server or the client, the owners authority changes, even though it prints out the same owner.
Logs in function:
UE_LOG(LogTemp, Warning, TEXT("COMP OWNER: %s"), *GetOwner()->GetName());
UE_LOG(LogTemp, Warning, TEXT("COMP OWNER AUTH: %s"), (GetOwner()->HasAuthority() ? TEXT("YES") : TEXT("NO")));
if (GetOwner()->GetOwner()) {
UE_LOG(LogTemp, Warning, TEXT("COMP OWNERS OWNER: %s"), *GetOwner()->GetOwner()->GetName());
UE_LOG(LogTemp, Warning, TEXT("COMP OWNERS OWNER AUTH: %s"), (GetOwner()->GetOwner()->HasAuthority() ? TEXT("YES") : TEXT("NO")));
}
output log in game:
SERVER
LogTemp: Warning: COMP OWNER: BP_Container_C_1
LogTemp: Warning: COMP OWNER AUTH: YES
LogTemp: Warning: COMP OWNERS OWNER: BP_Core_PlayerController_C_0
LogTemp: Warning: COMP OWNERS OWNER AUTH: YES
CLIENT
LogTemp: Warning: COMP OWNER: BP_Container_C_1
LogTemp: Warning: COMP OWNER AUTH: NO
LogTemp: Warning: COMP OWNERS OWNER: BP_Core_PlayerController_C_0
LogTemp: Warning: COMP OWNERS OWNER AUTH: NO
Any ideas or hints would be super helpful!
Delegates are executed "locally"
Anyone please ? βοΈ π
Id think that should work but breakpoint it ?
Does it all execute ?
Isnt there already functions for respawning player
Where do you want me to breakpoint it ?
When first joigning with the first player (so the host) it prints this but I can't move the character
What do you mean by your last sentence ? π€
When joining with the client it prints this
In neither case can you move the pawn?
No, on the client I can move the pawn but not on the server / host player
Currently I'm testing with "Play as Client". Should I rather test with Standalone or Listen Server ?
Listen server is probably equivalent to standalone
Wheres the logic that prints the ability stuff?
Ability beginplay
Tried that same issue but I have 1 extra issue printed when the host creates a game instance to join (Play as Listen Server)
Something fundamentally flawed
So whats the consensus on networking chaos? Send the initial destruction values and hope for the best?
Like the destruction trigger and whatever inital forces, and then just use it for non gameplay integral things?
What would be the best way to replicate character switching? I have an interface that messages from a Widget Blueprint, to the GameMode. Then Multicast an unposses, spawn actor, posses... Works for singleplayer, but doesn't like to work when I run two clients. Anyone know the best practice?
Widget cant talk to server / gamemode
Oh
Gamemode doesnt exist on the client
It only works on the owning client/host because it IS the server
Nonono
π
Gamemode is fine for spawning a new char
You must talk through a replicated, client owned actor
The most obvious choise being PlayerController
Fair enough, so from widget to controller, then to gamemode?
Yes
Controller does the rpc
To server
(in this case, if the only change is the skeletal mesh, i would ofcourse just change the skeletal mesh)
Fyi the Multicast is also redundant
A ROS should do?
You only need to call Unposses on the server
Same with possess and same with spawning the actor, cause it's presumably marked as replicated
I just wanna say - getting grappling to look good over the network is total butt. (Like character grappling, not a grapple hook).
You mean a char grabbing another?
Yeah
Yeah we dropped that shit in that one moba I worked on
Too many bugs too cause epic does too much behind the scenes
I π«‘ the devs who have to get those wrestling games working online
So only have a ROS in the gamemode for unposses? Then do the character change in the controller or keep that in the gamemode?
You have one Server RPC in the Controller
That then tells the Game Mode to unpossess, spawn, possess
You'd figure it wouldn't be so bad, considering Gears of War had it.
Heck, even Fortnite allows you to carry people if I recall
It probably isn't but we need it predicted
And grabbing predicted was working
Dropping was often not
I need it for my zombie grabs
About to go the classic style and "oh, you're slow when you're getting attacked; screw actually grabbing you" route π€£
You mean a Grab + Bite
Or literally grabbing and pulling away until someone helps you
Grab + Bite + chance for player to do a self-defense move during grapple
Right I mean that's a tad different
So just like this?
For that stuff you usually need to ensure the player is in a special movement mode or fwiw none
And then you simply play two montages
Yeah, that's what I'm doing
And ensure both are in the same place for the montage
But it always looks like crum π
It's probably how I'm handling onreps and passing data around to be honest
Just throwin' stuff at the wall at the moment.
looks alright
I mean it looks fine but it's still pretty shite
You use way too many interfaces
^
You know your controllers, characters and games modes classes
There is no need for interfaces
people love them interfaces in general
You only use interfaces if you need a variety of actors that don't share a parent class to react to a common function call
Which is very specific and rare
Interaction could be one, but even there components are superor β’οΈ
All interface calls in your screenshot are wrong and redundant
And the second wrong thing is the RPC to the Client to inform about the new character
I've been more of a fan of components-as-interfaces to be honest. Not only do interfaces suck to deal with in C++, but components can hold state. Which can be useful in some cases.
That RPC is in no way gonna arrive at a point where the client also has the new character
exactly !
If you want to react to this you will need to use proper callbacks
and components can contain code and predefined functionality
Components weren't so nice for this a few versions ago
By now you can override the component class in child BPs
so whoever you slap the interaction component on, they hold interactive state, they show some widget indication, and the provide delegates to listen to etc
That wasn't a thing before
You recommend just keeping that on the PC, right after the message is made?
OnRep is life
Changing the character is a stateful change. So you want it in an OnRep. That way if anyone ever drops and returns or new people join or enter back into relevancy range, they get the correct value.
Which is usually done in c++ for this specific thing cause Blueprints is lacking the build in OnReps. At least some of them
The Client RPC is also wrong cause you don't know when the character will exist on the client after spawning it
lol this is why I am here. What is the best way for this to be done?
It's like telling your son to drive to the grandparents and you then randomly choose a time to call the grandparents and tell them to say hi to your son. You have no clue when he arrives.
Better is to have something tell you when he arrives, which are OnReps
I call my parents OnReps
I'm not to familiar with OnRep lol
It gets called on the client when the variable is updated on the server and succesfully replicated to the client
Finished replicating
I see. Would there be something else I need to do after I spawn and posses the character?
I think the clients controller already calls OnPossess event tho?
This is what's in my PC.
Ye, I see it
I believe that's called on the client aswell when a new char is spawned and possessed
should be fairly reliable
Doesn't look like it after a quick look
It's called only on server
During the Possess process
But you can bind to OnPossessedPawnChanged
Oh thats the one !
That gets fired off when the OnRep of Pawn is received
Perfect @merry pebble ^
Perfecto. Thank you all. I appreciate the feedback and the assistance π
Looks like it'll also fire on server
Blueprints has "OnControllerChangedEvent" in the Pawn itself too fwiw
It#s a bit backwards but could work
Yop
This process is so spaghettified - just find something that works-ish
Please read the Network Compendium then
hello, maybe stupid idea of the data, i was wondering if i could replicate
UPROPERTY(EditAnywhere)
FDataTableRowHandle DataTableRowRef;
If you aren't familar with that, then you probably don't know a lot more
was that for me?
No
it seems you can replicate, but i bet there is a gotcha somewhere
No
It's less of a gotcha with references like that in my experience
DataTableRowHandles consist of a DataTable Asset and an FName for the Row
Both of those should allow replication
One is just an asset path
The other just an fname
that is what i saw
its just that it solved my problem doing player to player trading
and could be too good to be true
You should be able to replicate it just fine
Partly multiplayer related but not directly (its only an issue because of MP) ;
How does one usually init the animBP that relies on the PlayerState being ready?
I dislike my current ugly delay untill....
Guess i could leave it to null untill the controller is changed....
I hide my character until the posses is acknowldeged
could use a state machine and only go into the main state when playerstate != null.. or maybe time to rethink your anim bp so it doesn't grab info from something else, and the data it needs is pushed to the anim instance
Hello once again, I have a monitor that I want only 1 player to be able to use at a time.
i tried using branches with replicable values and custom events to run on server, but i am just missing the main way.
Simple explanation
whenever player gets close and CAN press the interact key, i want it to check if someone is already using it.
But then something else must know about the animBP , and rely on that exact animBP
I prefer fetching (espesially with the async thread going on)
Your Interaction Event is missing a pin that passes through the interactionInstigator
If you add that and specify that on the caller side, you can save the current interactionInstagotr on that thing you are interacting with
And check if it's valid to deny further interaction
What is a InteractionInstigator?
so something like this ? i have never used or seen that node
That's entirely not what i said :D
Your Interface Function
"Interaction"
Needs to pass something along that identifies the person who interacts
so in the interface, i need to pass something that identifies the person... which is?
Yeah, there you can pass in "self", given this is in the character
The only thing I wonder is, how are you gonna do this in Multiplayer if you only interact locally?
Would a simple Custom event ( run on server) fix this issue ?
You'd need to use a ServerRPC before doing the whole Interaction Loop thing
But yes
is the best you can network for chaos is basically the initial destruction cause?
Y the censorship π
Secret sauce is secret
Are you also doing the " only 1 player can interact at one time "
if so, how does the logic look like after the invoking player input?
The interaction logic happend on server machine anyway
So u can easily nullified the interaction that happend after the first one
If that's Ur intention
Picture a door. Player will do server rpc. Then server will start opening the door. Any interaction when the door is being opened can just be ignored
Well my intention is to make a actor usable only per person ( 1 at a time )
but i don't yet quite understand the proper setup
I think knowing which code should run on client and which should run on server would be enough to wrap your head around it
Im still working on that in my case as i need it to work with a dialogue plugin aswell
Replicating the interaction to everyone, while reacting to secondary interactions with refusal
well the way I see it working is have something simple like a branch
where it would just check if someone is already using it, but currently i just don't know how to do that, as all i been told is keywords of stuff i never done.
a.k.a i never saw the logic before therefor idk how the logic should work (look)
my interactable is told when someone interacts, and can store that info (with repnotify)
I helped you with save/load system before. My suggestion is do single player first π
Not trying to brush you off but trying my best to give the most helpful advice I can give
Multiplayer is many times harder imo
I know multiplayer is much harder, I saw many comments, and videos on that topic, but before I didn't have much of an idea of what I was making.
but this time I have a clear goal as I made a semi-complete Game concept document, with which i know what i want to achieve, and the only thing stopping me is Blueprints xD
but yeah i am watching many tutorials, and experimenting with stuff, and its working, just sometimes i get stuck at a "simple" problem like this one.
Blueprints is already a huge limitation for multiplayer to begin with. It will suffice for interaction only based game or turn based game but it won't be enough for shooter game or games that must address lag
don't let me stop what you want to do, but might help to know what the bar is before starting a multiplayer project
Meant to be more like a "phasmo / lethal company / devour " type game ( same genre but different )
Can anybody tell me why my linetrace isnt replicating between clients?
One client always see it as straight lines to same direction
Only server can see correct lines
while clients cant see any correct line except theirs
These kind of games can be made using BPs only, but using C++ would facilitate the process a lot
What if I want my character to sprint? π π
You can make it BPs, but the transition might be laggy depending on ping and packet loss
afaik the only way is to change the bit flag in the CMC which requires C++
any other implementation isn't proper or straight don't work
Sprint can mean "increase the max speed", it can be enough for some people
You can do a server RPC that would do a multicast that would tell that certain player is sprinting, i.e. change its max walk speed to a higher value
It might be seamless with Mover 2.0. I haven't looked into it, but apparently it's going to improve the overall system
Even 60 ms would be unpleasant X_X.
seamless for BPs*
Have you tried that?
Yeah
used to follow multipalyer BP tutorials from youtube
all of them are scam imo
only one that works for me is delgoodie tutorial
The BP tutorials just show that it "works" but when one test it with real latency, even a little delay like 10 ms, it straight just broken
Rubber banding
It's not really broken, it's laggy, that's all
I think at most might get away with delay only
I know that it's unpleasent, but that's what you get by using things the way they were not intended to
Yeah, that's what I mean. in many cases just straight not playable, I don't find it acceptable to have my gun fire 1 second after clicking the mouse
So should I stop making a 50 player pvp game with blueprints π€¨
We are not saying that you must use 100% C++. We are saying that certain things would benefit a lot by using it
Depends on what your game wants to do movement wise
BPs are still a vital part of the development, the only issue is that some features should be done in C++ because BPs don't support everything
Blueprints do not (currently) have access to the functions required to make custom predicted movement "perfect"
At least until Mover comes out stable enough apparently
Which important features should be done in C++?
if you are using CMC, you should deffinitly work with how it is intended to be used
Ideally everything. BPs are good for prototyping and quick iteration, but quickly become a mess especially if you also work with C++
At least a majority of your game should be C++ with Blueprints on top to make it easy to tweak in editor, but no gameplay code should be in Blueprints
Usually things that are fundamental. For instance, inventory, movement, equipment, save system, and such. High-end features should be done in BPs though
I guess using full blueprints also messes with the general game performance right?
Really depends on what you're doing
There's a few games made only using Blueprints that run fine
Don't think about performance unless it's an issue. Don't optimize things that don't need it
a multiplayer fps game with walking, crouching and opening doors being only mechanics
I guess it wont be that bad with blueprints?
Sounds simple enough
From your profile I see that you're making a backrooms game. I guess the majority can be made in BPs easily. If the movement will be done in it as well, it'll be fine, but a bit laggy. Doors can be done in BPs seamlessly really, no C++ is required to get same results
The problem is Im not making a simple walking simulator, so things get mess too early
Like firing mechanic, which is a mess
Shooting isn't simple for beginners like me
What client sees and the server sees isn't the same
Depends what kind of shooting it is really
This supposed to be a firing bullet mechanic
If you're making a esports fps like CS or Valorant then yeah no, Blueprints won't be able to "easily" do that kind of shooting
ooof
If you don't need esports level of verification, you can add some leniency and Blueprints can probably do it fine
Essentially you should organize things better. Use functions and different event graphs, and you'll be fine
how would you do it in blueprint? just say yes to client?
context is verifying hit
I didn't say zero verification hah
Im also a unorganized person in irl so I guess habits cary over from there
I'd just check the hit is "plausible"
Cheaters are gonna cheat, just don't give them a big red "kill everyone anywhere" button
They're making a backrooms game. I guess cheaters don't really matter. The game is intended to be played with friends, isn't it?
well no, its supposed to be something like scp:sl
So its pvp against lots of other people
SCP: SL's movement is utterly bad, Unreal's default is already miles better heh
I would have easier time if I was making a simple co op walking simulator...
So congrats on having that going at least
It's more of an arcade game so you don't need esports level of accuracy
co-op puzzle game would be totally walk in the park with bp only imo
compared to shooting
And in Blueprints you're not gonna get rewind and all going
At least not without ripping your hair out in the process
which what shooting game needs π
I did that before so trying to doing a pvp shooter was a big jump for me, at least I know what actually Im doing this time, unlike before
Arcade pvp game? Don't bother, just do some sanity checks to ensure the shot could've probably been done and accept it
My shooting mechanics are interestingly working too good
But Im having problems with simpler things
Replicating is too annoying
You'll get better at it over time
Like my line trace code is replicating on soldiers gun line traces, but same code dont replicate when I use that on monster
Making a multiplayer game is a lot more complicated than a singleplayer game, it's to be expected
I heard ue5 is the easisest engine
to make multiplayer
They say unity is much harder
I dont want to imagine
Unity has basically no multiplayer solution
You'd have to roll a third party one yourself
Or write your own
I dont get why indie developers doing multiplayer games on unity, like they are always having some major base issues that cant be solved
In the end you choose the engine that fits your project's requirements.
Can I also ask if you can see any problems in this code?
I cant make it replicate to clients.
why do u have to do the line trace on every client tho?
You don't want to do your linetrace on the server
You do it on the player that wants to shoot, then have them send the result to the server
The server checks the hit is plausible, then accepts it or not.
hmm, I will try that now. Its working on my gun codes tho, thats why Im confused
Now client cant even see line traces of each other(server cant see their traces as well), and they still see server line traces wrong.
Clients shouldn't see traces of others anyway
I mean debug mode
Yeah that's really not going to work
this is a good base to start with
Shouldnt I do that?
If I dont do that, how other clients will detect it hit somebody?
If line trace hit to somebody, its applies damage
Other clients don't need to know that though
Damage should be applied on the server
Health should be a replicated property, the server is the authority
but
Before I came here
I got this answer, and it fixed my issue
about my line trace bullets
Well uh
Didnt that supposed way?
If I hit somebody with my linetrace, I will apply the damage
Servers applies damage -> health is replicated to clients as a replicated property
But other clients doesn't need to run the line trace or apply the damage
Clients dont apply damage, that's bad
so should I run it on server?
then server replicate the health to clients
one way I seen how people do it is send time stamp to server with the simulation from client machine. The server then rewind and play the simulation on it's machine to validate the hit
I dont really get it...
at least running line trace only on server looks like fixed the replication problem, I guess
What does even the trace do? Check if it hit something?
Client and server don't see the same thing, it all depend on delay
client may hit something on his world but when the server does the same trace, it doesn't necessarily end up the same. Always add lag when testing MP
easy mode is probably to just check the line trace hit on client and server just say yes. You can add some validation if you want but I don't know enough on what to add
Gun line trace for players check for bullet traces, than apply damage if hit
Line trace for monster check for hit in short range, and if it hit to a human class, playing an eating animation while applying full health damage to person
You are doing the line trace on server
Lets say u shoot something
but u have 1 second delay
So in your screen you may hit something
but in the server, the hit is invalid because the target already moved by X unit in 1 second
Also if u shoot using Server RPC if u have 1 second delay, ur gun start shooting 1 second after you press left click
How bad that lag can be? My game isnt very script heavy so I dont think It will have that much delay but
Im not sure
imo action packged game without client prediction, server rewinding, reconciliation cannot produce a suitable result for me
but I may be wrong
just can't see how it can be tackled without them
For shooting game? pretty bad, even 15 ms won't be good imo. If my tool is bp only, I will stick with puzzle walking game
Network latency
but the smarter people say otherwise here
The issue is ping not performance of your game
so maybe im wrong
Game is kind of found footage camera low fov while guns have incredible recoil so I dont think anybody would care about competitive low delay aspects, but yeah I can imagine it would be bad with delay
You don't want pixel perfect verification on the server
The client says it hit a player, the server verifies it could've been possible
In Blueprints you're not getting rewind
So in this case don't run server rpc for your line trace
just do it locally
Well it's probably better to check ping too
getting killed by laggy player sucks
like u already went to another room but suddenly drop dead
but how can I send data to server if I do it locally?
You can just send a server RPC saying a hit is done on X player
can't help you on the verification part
my idea of verification is sending time stamp to server and let server simulate the data to the past and see if the hit is possible
I didnt understand this
Isnt run on server is already server rpc
sure but the line trace can be done locally
if hit something then run server RPC saying I hit something
oh you mean after I make line trace, it should send a run on server event, right?
if u do the line trace on server and u have delay (everyone have delay obviously, the question is how much)
then in ur screen sum1 might be in your crosshair
when the RPC reached the server and the server line trace, it's not gonna hit anything
if u shooting static target then sure it will hit
The moment they start moving, Line Trace on server is deffinitly not gonna work
Here, doing line trace locally than sending server event to apply damage
But damage isnt applying
dont cross pin like that
you can pass in the actor that is hit thru the RPC
understand that everyone is running their own instance of the game
this is basically what u are doing on server machine
i dont even know if it gonna run the line trace node
never done something wrong like this
yeah I will also check for them
whats the problem with red parts tho?
is valid checking for if it actually hit something
lets say I am the host
u are the client machine
that LineTrace node was done in your machine
I know nothing about it
so when u pass in data that was never run in my machine, most likely it will just be null
Remember this, the only way for Client to COMMUNICATE with server is thru Server RPC
so I need to pass everything to server about linetrace, except linetracing action itself, right?
so u want to pass any data to the server thru function argument
w/e data u want to send to the server, send it thru function argument
easy mode atm is just to allow cheaters and just be a yes man to client
I will let my players create their anticheat, instead of working 5x more on multiplayer and delivering a half made game
lol
yeah but at least decrease them
but there is a standard
in this case, it's not even about cheating
because a player with 300 ms, can u shoot u in their machine.
Then u walk away to another room thingking you are safe
but suddenly u got killed by the laggy player
It would be suck
I am trying to make everything work rn, If I had more time after actually finishing the game, I can probably come back to fix this issues.
Even making it barely work is an achievement for me rn
don't limit your self with BP π
if they don't know C++, they can't do anything but BPs
true
My only regret is I didn't study C++ earlier
still in learncpp.com but I can already do what I couldn't do in bp
Loading Screen, Editor Tool, etc
You can make some editor tools in BPs though
As for loading screen, there are plugins for that, you are not forced to do C++ yourself
I had to do something specific
I only know some basic things in C++, Its too scaring for me to let these shiny nodes go and work on text...
Grab all material in a folder and change it's static bool param and other settings
not sure if that's possible in bp
static bool?
for materials
But you are able to change material parameters in BPs
Materials are pretty high level really, so they must support that
maybe there's a way but I don't know where
im not talking about diving into a material and changing the param
I have to set hundreds of materials at once
Yeah not that
it's the Material Asset it self
so i got my self a tool that pick a folder
and it will auto change all the material param in editor (the .uassets)
wdym by that
Uh, I'm not sure whether that will be affected with these functions π€
You cant, as they are runtime ones
Changing the switch requires recompilation of shaders
yup

