#multiplayer

1 messages Β· Page 158 of 1

quasi tide
#

It is very functional. You can always choose not to use it if you want. Then write all the functionality you need.

#

Orrrrrrrr just learn how to use it and save yourself a lot of time

#

Which is what trips everyone up

#

Or if you want, you can buy the GMC plugin ($350)

#

I hear good things about that

ashen plume
#

why is it neccessary to completely write our own reconciliation if its supposed to already work

quasi tide
#

You're not completely writing your own reconciliation though?

ashen plume
#

to quote the section in the video "create custom cmc"

quasi tide
#

Yeah...you just inherit from it

#

Not write it from scratch

ashen plume
#

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

quasi tide
#

Well - you have multiple solutions presented to you

ashen plume
#

i just find it absurd the solution here is to just not use cmc

quasi tide
#

Thats...not though?

ashen plume
#

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

quasi tide
#

Then don't do multiplayer. I don't know what to tell you.

ashen plume
#

i guess i expected more of ue's default network solution

fossil spoke
#

@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

ashen plume
fossil spoke
fossil spoke
#

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?

ashen plume
#

let me grab the third person template quick

ashen plume
fossil spoke
#

It should be in the various options.

#

Unless you opted not to include the Templates in your Engine install.

ashen plume
#

no i opted out of samples

fossil spoke
#

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

ashen plume
fossil spoke
#

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.

ashen plume
#

is there a log or series of a breakdown of the third person template in the meantime?

fossil spoke
#

If you cant understand the Templates, you probably shouldnt be starting with a multiplayer project.

ashen plume
fossil spoke
#

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.

quasi tide
#

Mover 2.0 πŸ™

ashen plume
#

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

ashen plume
#

@fossil spoke third person template performs marginally better, many jumps still get rolled back, and experiences awful rubber-banding

fossil spoke
#

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.

ashen plume
fossil spoke
#

🀷

#

Also, the network emulator presets are pretty worse case scenario

#

Average is an understatement

ashen plume
#

i would hardly call 60 latency worse case

#

is there footage somewhere of the third person sample running at various tiers of network emulation?

fossil spoke
#

Highly doubt it

#

Ill have a look on my machine

grand kestrel
#

What are the defaults? Keep in mind setting 60 there doesn't mean 60 ping

#

More like 60 up then 60 down

ashen plume
#

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

fossil spoke
#

Seems fine to me

#

Corrections visualized. But no rubber banding

#

🀷

ashen plume
grand kestrel
#

p.netshowcorrections 1

fossil spoke
grand kestrel
#

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

ashen plume
grand kestrel
grand pelican
#

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

ashen plume
grand kestrel
#

It's a worthy resource to learn from, just a bit large

ashen plume
#

to be fair, im out of choices, and the performance of the third person template on my machine isnt going to cut it

fossil spoke
#

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.

short arrow
#

It's gotten so bad that I've just decided to make my own component to replicate movement for non essential characters

fossil spoke
#

Those choices are really game specific. So without knowing whats required, no one can make any recommendations

fossil spoke
#

Just assuming CMC can handle and be used everywhere without consequence is foolish.

short arrow
#

Ah, glad to hear 🫑

grand kestrel
#

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)

fossil spoke
#

@grand kestrel Interesting to know

stable grotto
#

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?

heady copper
grand kestrel
#

Why not just spawn it and have it print the result tho πŸ˜„

heady copper
#

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,?

mystic estuary
peak lintel
#

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

nova wasp
#

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

hoary spear
#

And account for deltaTime in general?

#

Unless i missed that

#

Hm... that would make it slower/seldomer. not faster

nova wasp
#

yeah, I can't tell what this is actually doing

hoary spear
#

DisableGlide() -> Glide() seems strange to me

velvet kettle
peak lintel
#

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

finite spindle
#

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 ?

hoary spear
queen quiver
#

How do I get event anydamage to fire on the server in a character class that has no player controller?

mystic estuary
queen quiver
#

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.

mystic estuary
# queen quiver Apologies, I'm still trying to understand how this works, but the descriptor/lab...

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).

queen quiver
#

"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 πŸ€”)

mystic estuary
#

(To quote something you can highlight it with your mouse, and press the quotes sign)

queen quiver
#

Ah, thank you πŸ™‚

mystic estuary
#

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

queen quiver
#

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)

mystic estuary
#

So you can call the ApplyDamage using any actor server-side, and it'll work

queen quiver
#

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" πŸ˜΅β€πŸ’«

mystic estuary
#

Can you show your damage related setup for the PlayerCharacter?

queen quiver
#

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

mystic estuary
queen quiver
#

Ah. So if I start the custom event from before the trace it should work?

mystic estuary
#

You have to pass the hit actor in the event so that the server knows what you want to damage

queen quiver
#

You are correct, I am big dumb. Thank you very much πŸ˜…

mystic estuary
#

You're welcome

heady copper
indigo brook
#

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.

velvet kettle
heady copper
#

You a compendium I can read

civic storm
civic storm
#

Yeah just scroll through pinned messages to find them all

vagrant grail
#

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 ?

hoary spear
#

A RepNotify variable set multiple times by the server in the same frame will still only be rep'ed once, right ?

quasi tide
#

Yeah. Happens at end of the frame.

hoary spear
#

So... would GAS juice this up somehow?

#

Im getting multiple updates in a frame

#

In a LiFo order

drowsy meteor
#

if i'm working on replication using cpp do i give questions here or in the cpp channel

dark edge
#

here if it's mostly about the networking side of it

blazing spruce
#

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

dark edge
blazing spruce
dark edge
blazing spruce
ancient adder
#

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

olive crow
#

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?

ancient adder
solar stirrup
#

<@&213101288538374145>

#

(Puppet's message)

solar stirrup
#

Can be called multiple times though (any time something got replicated from the server)

gleaming vector
solar stirrup
#

Replicated doesn't exist for struct properties

#

Only NotReplicated if you want them to not be replicated

signal lance
#

Bot isn't deleting the messages FFF

#

Oh nvm

solar stirrup
#

send the bot to android hell

#

make glados proud

olive crow
#

thank you for the answers

ancient adder
solar stirrup
#

is the UObject a subobject

ancient adder
#

Yes

solar stirrup
#

well, yes it is im dumb

#

it has to be

#

it's not a component right, just a pure UObject?

ancient adder
#

Yep

solar stirrup
#

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)

ancient adder
#

Oh great, Thanks alot!

solar stirrup
#

Keep in mind this will be called on clients in multiplayer only

#

Not on dedicated servers, listen servers or standalone

ancient adder
solar stirrup
#

o7

timber anchor
#

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)

blazing spruce
#

Also ideally that code shouldn't be inside of the widget class

solar stirrup
#

Also, are you using any specific plugin?

timber anchor
#

Im using SteamCore

#

My current logic is:

#

Find Session

#

Create session

solar stirrup
#

What engine version do you use

timber anchor
#

5.3.2

solar stirrup
timber anchor
#

Was working till this morning, perfectly fine

timber anchor
#

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

solar stirrup
#

o7

amber vale
#

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?

dark edge
#

or have that gamemode use a specific gamestate

amber vale
#

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?

dark edge
#

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

amber vale
#

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.

dark edge
#

Sure, that can work

#

Where will the score for CTF live?

amber vale
#

Runtime data like that is all in the game state, but the "rules" of the game (like starting lives) is in the game mode

mint drift
#

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?

amber vale
mint drift
mystic estuary
amber vale
#

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.

mint drift
#

I was trying this, it worked, but it takes every actor in the level even with a "Specific player" correctly placed.

amber vale
#

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

mint drift
amber vale
#

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.

mint drift
#

thinking I will try that, thanks

brittle path
#

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

blazing spruce
brittle path
#

Oooh right, I immidiately thought about it when I read your mention about the player index

brittle path
#

will cast to a bp_thirdpersoncharacter work?
(I don't think it's even possible)

warm lintel
#

GameMode is also not replicated if I remember.

blazing spruce
brittle path
#

gamemode

brittle path
#

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

snow trail
#

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

quasi tide
#

Up to you honestly

#

Co-op games are typically more lenient in this regard

brittle path
snow trail
warped oxide
#

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

quasi tide
#

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.

warped oxide
quasi tide
#

Nope. Just experience.

meager spade
#

backends like EOS/Steam, etc

#

have a way to store player stats

coral wing
#

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.

meager spade
#

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

coral wing
#

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.

olive anchor
#

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?

short arrow
#

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

warped oxide
#

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

warped oxide
#

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.

thin stratus
#

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?

mild lynx
#

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.

fossil spoke
#

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

daring gorge
#

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)

finite spindle
#

Hey, how can i load/ unload a map only for 1 client using level streaming ? πŸ™‚

thin stratus
#

An probably no one can really tell you, cause no one knows your code

daring gorge
#

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

daring gorge
thin stratus
#

The ServerRPC must happen in the Character or a Client-owned Actor fwiw

#

Where you call Possess afterwards doesn't matter

silver loom
#

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?

daring gorge
thin stratus
#

Otherwise it's dropped

daring gorge
#

also is there a way to check if its dropped?

thin stratus
#

Think your log should say that you tried to call a ServerRPC on something that has no owning connection

snow trail
#

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?

daring gorge
mild lynx
thin stratus
#

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

snow trail
storm sable
#

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?

thin stratus
#

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.

storm sable
#

I see, and I appreciate the response! Do you know how I might set up my character pawn to persist?

thin stratus
#

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

storm sable
#

And if I am only saving the data that the pawn needs, I would manage that in the PlayerState?

thin stratus
#

You could, yeah

#

Or in the Playercontroller

#

GameMode should have a function that calls and provides old and new PlayerController

#

OnSwapPlayerControllers or so

storm sable
#

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?

thin stratus
#

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"

storm sable
#

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?

thin stratus
#

Not automatically

#

You would need to use CopyProperties in the PlayerState to move it over

storm sable
#

I've seen references to that as well, is CopyProperties the only event I need to implement? Or is there something akin to "PasteProperties"

thin stratus
#

Only in theory

#

If we ignore reconnectors

#

Which use that other event

#

Which name I forogt

#

OverrideWith or so

storm sable
#

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?

thin stratus
#

No

#

CopyProperties is called after the SeamlessTravel is done.
OverrideWith is when someone reconnects and you have inactive playerStates for disconnected players

prisma snow
#

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

thin stratus
#

Yes, you are also only supposed to call it from the Server in theory

prisma snow
storm sable
thin stratus
#

It's just a function you use. Read my Compendium fwiw, but in theory, that doesn't need documentation much

novel widget
#

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.

torn portal
#

@solid fjord ??

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!

solid fjord
novel widget
solid fjord
novel widget
#

No problem, works great on my project but I'm a UE newbie so maybe somebody has better solutions πŸ˜„

tiny scaffold
#

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

novel widget
#

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

tiny scaffold
#

Thing is though even if i tell the sever to set the array like that it just doesn't tell the client

tiny scaffold
novel widget
#

Do you have it setup like this?

tiny scaffold
#

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

novel widget
#

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

tiny scaffold
#

makes sense i should probably use the notify

novel widget
#

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

tiny scaffold
#

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

hoary spear
#

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 ?

tiny scaffold
#

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

hoary spear
#

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

novel widget
#

I'm glad you mentioned the event dispatchers since that's exactly how I did it for my system πŸ˜„

hoary spear
#

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

frail pecan
#

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 !

torpid girder
#
[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

torpid girder
#

oh i am going mad πŸ™‚ i thought i click umg πŸ™‚

prisma snow
#

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.

lost inlet
#

And yes, it's replicated as a path to the asset

jovial charm
#

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?

lost inlet
jovial charm
lost inlet
#

Clients don't know about other player controllers, but obviously the host will

fossil spoke
prisma snow
woven bramble
#

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 πŸ™‚

vagrant grail
#

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 ?

mild lynx
lost inlet
vagrant grail
lost inlet
#

why is it even an RPC then

vagrant grail
lost inlet
#

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

vagrant grail
quasi tide
#

It's pointless

#

That's what sswires is saying

lost inlet
#

yeah, completely pointless

quasi tide
#

Because you're already on the server

lost inlet
#

just use a normal ass function

vagrant grail
lost inlet
#

normal-ass if you want to be pedantic about punctuation

fossil spoke
#

Its easy to google

vagrant grail
lost inlet
#

it's weird you don't know these words

#

but fine, I won't say ass

#

just use a normal function or event

vagrant grail
lost inlet
#

UFUNCTION(server,...) and UFUNCTION(client, ...) and their BP equivilents are only useful for networking

vagrant grail
#

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.

fossil spoke
vagrant grail
fossil spoke
#

I could be wrong with UE5

#

I dont use it at the moment.

thin stratus
#

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

fossil spoke
#

If you are making any serious multiplayer game it wont be done purely in BP

thin stratus
#

"Won't" and probably "can't".

fossil spoke
#

🀷 lol

vagrant grail
#

I'm trying to create an Among Us type game, so even isn't possible with Blueprint only ?

thin stratus
#

Maybe?

#

Some of the Gameplay, probably.

#

You will hit walls every once in a while

#

The "Deny Connection" stuff being one.

lost inlet
#

networking is one of the things that is 100x more painful in BP

#

and then there's stuff you literally can't do

fossil spoke
#

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

vagrant grail
#

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 πŸ€”

thin stratus
#

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.

vagrant grail
thin stratus
#

And you find that multiplayer related stuff is missign a lot more

thin stratus
# vagrant grail why ?

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.

vagrant grail
thin stratus
#

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

vagrant grail
#

The issue is there are no good unreal c++ tutorial showing how to do stuff properly

thin stratus
#

There are honestly also no good Blueprint tutorials either

#

But we all made it work (:

hollow eagle
#

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.

vagrant grail
thin stratus
#

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

quasi tide
#

As long as you stay within the confines of UE's framework, C++ in UE feels like a worse version of C# 😈

thin stratus
#

I fully understand if you like BPs more than learning C++

vagrant grail
thin stratus
#

But that won't change anything about what UE requires you to use when making more complex Multiplayer Games.

quasi tide
vagrant grail
#

Do you define an "Among Us" like game as part of "complex Multiplayer Games" ?

hollow eagle
#

Just about any multiplayer game is inherently complex.

#

There are varying degrees of complexity, but there is no "simple" implementation of multiplayer.

thin stratus
#

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

vagrant grail
#

argh

thin stratus
#

The UI part, the voting of people etc. can also be done in BPs fwiw

vagrant grail
#

Well, then I will start doing all the major BP part, and come here asking 1000 questions about the c++ part πŸ₯²

thin stratus
#

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.

lost inlet
#

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

thin stratus
#

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

lost inlet
#

well seeing as BP structs barely work as it is, it's probably best they didn't try and make a BP parallel

thin stratus
#

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

quasi tide
#

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.

thin stratus
#

Yeah the PlayerArray is also a strange piece of art.

quasi tide
#

At least the add/removal methods are virtual

lost inlet
#

I've had to implement it manually for each project

thin stratus
#

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

quasi tide
vagrant grail
#

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 ?
strange apex
#

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.

quasi tide
#

Cast other actor to pawn, get controller, check if it is locally controlled - this is one way to do it.

strange apex
#

how do i check if its locally controlled?

quasi tide
#

It's a method on the controller

quasi tide
#

Yup. Also wanna check if the controller is valid as well.

strange apex
#

Like this?

quasi tide
#

Run it - see what happens

strange apex
#

Wow that worked... okay thanks amma now try to figure out why xD

mighty acorn
#

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

quasi tide
#

I've been bamboozled

mighty acorn
#

nah i told them to ask here what the best practice for UE multiplayer is

quasi tide
#

I've not been bamboozled

mighty acorn
#

as i suggested to check for server authority and only show the widget if it's false

#

which might work, too?

elder sable
#

Hi, is it possible to force the replication of a value that doesn't change ?

vagrant grail
quasi tide
mighty acorn
#

makes sense, just hopped in here because i was curious what the solution is πŸ˜„ thanks

quasi tide
strange apex
#

So am guessing i can use this logic for any other thing that needs to be run locally?

quasi tide
#

It's one way, yes.

elder sable
quasi tide
#

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.

quasi tide
# elder sable Because it changed too fast A > B > A

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

elder sable
#

Well i can flip a bit to force the update but i guess there is something more clean :p

woven basin
quasi tide
#

OnRep being triggered is only something client side anyway

#

And that's what you're talking about

errant mulch
#

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

errant mulch
#

if anyone needs more context or info, you can ping or dm me np, ill use the time needed to explain it correctly

solid fjord
#

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!

hoary spear
vagrant grail
hoary spear
#

Id think that should work but breakpoint it ?

#

Does it all execute ?

#

Isnt there already functions for respawning player

vagrant grail
#

When joining with the client it prints this

hoary spear
#

In neither case can you move the pawn?

vagrant grail
hoary spear
#

Client 1, not standalone or listen server ?

#

In the window header

vagrant grail
hoary spear
#

Listen server is probably equivalent to standalone

#

Wheres the logic that prints the ability stuff?

#

Ability beginplay

vagrant grail
hoary spear
#

Something fundamentally flawed

vagrant grail
surreal peak
#

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?

merry pebble
#

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?

hoary spear
#

Widget cant talk to server / gamemode

merry pebble
#

Oh

hoary spear
#

Gamemode doesnt exist on the client

#

It only works on the owning client/host because it IS the server

merry pebble
#

Well then, what would be the best practice?

#

GameInstance?

hoary spear
#

Nonono

#

πŸ˜…

#

Gamemode is fine for spawning a new char

#

You must talk through a replicated, client owned actor

#

The most obvious choise being PlayerController

merry pebble
#

Fair enough, so from widget to controller, then to gamemode?

hoary spear
#

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)

thin stratus
#

Fyi the Multicast is also redundant

merry pebble
#

A ROS should do?

thin stratus
#

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

quasi tide
#

I just wanna say - getting grappling to look good over the network is total butt. (Like character grappling, not a grapple hook).

thin stratus
#

You mean a char grabbing another?

quasi tide
#

Yeah

thin stratus
#

Yeah we dropped that shit in that one moba I worked on

#

Too many bugs too cause epic does too much behind the scenes

quasi tide
#

I 🫑 the devs who have to get those wrestling games working online

merry pebble
thin stratus
#

You have one Server RPC in the Controller

#

That then tells the Game Mode to unpossess, spawn, possess

quasi tide
#

Heck, even Fortnite allows you to carry people if I recall

thin stratus
#

It probably isn't but we need it predicted

#

And grabbing predicted was working

#

Dropping was often not

quasi tide
#

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 🀣

thin stratus
#

You mean a Grab + Bite

#

Or literally grabbing and pulling away until someone helps you

quasi tide
#

Grab + Bite + chance for player to do a self-defense move during grapple

thin stratus
#

Right I mean that's a tad different

thin stratus
#

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

quasi tide
#

Yeah, that's what I'm doing

thin stratus
#

And ensure both are in the same place for the montage

quasi tide
#

But it always looks like crum 😭

thin stratus
#

Or at least matching place

#

Hm

quasi tide
#

It's probably how I'm handling onreps and passing data around to be honest

#

Just throwin' stuff at the wall at the moment.

hoary spear
thin stratus
hoary spear
#

you'd wanna use the controllers onpossess

#

for the UI update

thin stratus
#

You use way too many interfaces

hoary spear
#

^

thin stratus
#

You know your controllers, characters and games modes classes

#

There is no need for interfaces

hoary spear
#

people love them interfaces in general

thin stratus
#

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

hoary spear
#

Interaction could be one, but even there components are superor ℒ️

thin stratus
#

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

quasi tide
#

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.

thin stratus
#

That RPC is in no way gonna arrive at a point where the client also has the new character

thin stratus
#

If you want to react to this you will need to use proper callbacks

hoary spear
#

and components can contain code and predefined functionality

thin stratus
#

Components weren't so nice for this a few versions ago

#

By now you can override the component class in child BPs

hoary spear
#

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

thin stratus
#

That wasn't a thing before

merry pebble
quasi tide
#

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.

thin stratus
#

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

merry pebble
#

lol this is why I am here. What is the best way for this to be done?

thin stratus
#

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

hoary spear
#

C++

#

Im sure the grandparents would notify me, even if i asked in BP

thin stratus
#

I call my parents OnReps

merry pebble
#

I'm not to familiar with OnRep lol

hoary spear
#

It gets called on the client when the variable is updated on the server and succesfully replicated to the client

#

Finished replicating

merry pebble
#

I see. Would there be something else I need to do after I spawn and posses the character?

hoary spear
#

I think the clients controller already calls OnPossess event tho?

merry pebble
#

This is what's in my PC.

hoary spear
#

search for "Onpossess"

merry pebble
#

Ye, I see it

hoary spear
#

I believe that's called on the client aswell when a new char is spawned and possessed

#

should be fairly reliable

quasi tide
#

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

hoary spear
#

Oh thats the one !

quasi tide
#

That gets fired off when the OnRep of Pawn is received

hoary spear
#

Perfect @merry pebble ^

merry pebble
#

Perfecto. Thank you all. I appreciate the feedback and the assistance πŸ˜„

quasi tide
#

Looks like it'll also fire on server

thin stratus
#

Blueprints has "OnControllerChangedEvent" in the Pawn itself too fwiw

#

It#s a bit backwards but could work

hoary spear
#

i feel like those are fairly new ?

#

both of them ?

thin stratus
#

Yop

quasi tide
#

This process is so spaghettified - just find something that works-ish

thin stratus
torpid girder
#

hello, maybe stupid idea of the data, i was wondering if i could replicate

    UPROPERTY(EditAnywhere)
    FDataTableRowHandle DataTableRowRef;
thin stratus
#

If you aren't familar with that, then you probably don't know a lot more

torpid girder
#

was that for me?

hoary spear
#

No

torpid girder
#

it seems you can replicate, but i bet there is a gotcha somewhere

thin stratus
hoary spear
#

It's less of a gotcha with references like that in my experience

thin stratus
#

Both of those should allow replication

#

One is just an asset path

#

The other just an fname

torpid girder
#

its just that it solved my problem doing player to player trading

#

and could be too good to be true

thin stratus
#

You should be able to replicate it just fine

torpid girder
#

the code looks fine

#

sorry too big

#

well this is awesome πŸ™‚

hoary spear
#

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....

dark parcel
#

I hide my character until the posses is acknowldeged

tardy fossil
#

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

strange apex
#

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.

hoary spear
thin stratus
#

OnReps over OnReps

#

Plug some Delegates into your OnReps

hoary spear
#

I prefer fetching (espesially with the async thread going on)

thin stratus
#

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

strange apex
thin stratus
#

Whatever you use to identify who interacts

#

Character for example

strange apex
#

so something like this ? i have never used or seen that node

thin stratus
#

That's entirely not what i said :D

#

Your Interface Function

#

"Interaction"

#

Needs to pass something along that identifies the person who interacts

strange apex
#

so in the interface, i need to pass something that identifies the person... which is?

thin stratus
#

e.g. the Character that calls that event

#

Somewhere you are calling Interaction

thin stratus
#

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?

strange apex
thin stratus
#

But yes

hoary spear
#

We're doing it like this currently

#

seems ok so far

surreal peak
#

is the best you can network for chaos is basically the initial destruction cause?

dark parcel
#

Y the censorship πŸ˜…

hoary spear
strange apex
dark parcel
#

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

strange apex
dark parcel
#

I think knowing which code should run on client and which should run on server would be enough to wrap your head around it

hoary spear
#

Replicating the interaction to everyone, while reacting to secondary interactions with refusal

strange apex
#

a.k.a i never saw the logic before therefor idk how the logic should work (look)

hoary spear
#

my interactable is told when someone interacts, and can store that info (with repnotify)

dark parcel
strange apex
# dark parcel I helped you with save/load system before. My suggestion is do single player fir...

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.

dark parcel
#

don't let me stop what you want to do, but might help to know what the bar is before starting a multiplayer project

strange apex
noble sentinel
#

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

mystic estuary
dark parcel
mystic estuary
#

You can make it BPs, but the transition might be laggy depending on ping and packet loss

dark parcel
#

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

mystic estuary
#

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

dark parcel
#

Even 60 ms would be unpleasant X_X.

mystic estuary
dark parcel
#

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

mystic estuary
#

It's not really broken, it's laggy, that's all

dark parcel
#

I think at most might get away with delay only

mystic estuary
#

I know that it's unpleasent, but that's what you get by using things the way they were not intended to

dark parcel
#

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

noble sentinel
#

So should I stop making a 50 player pvp game with blueprints 🀨

mystic estuary
#

We are not saying that you must use 100% C++. We are saying that certain things would benefit a lot by using it

solar stirrup
mystic estuary
#

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

solar stirrup
#

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

noble sentinel
#

Which important features should be done in C++?

dark parcel
#

if you are using CMC, you should deffinitly work with how it is intended to be used

solar stirrup
#

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

mystic estuary
noble sentinel
#

I guess using full blueprints also messes with the general game performance right?

solar stirrup
#

Really depends on what you're doing

#

There's a few games made only using Blueprints that run fine

mystic estuary
#

Don't think about performance unless it's an issue. Don't optimize things that don't need it

noble sentinel
#

a multiplayer fps game with walking, crouching and opening doors being only mechanics

#

I guess it wont be that bad with blueprints?

solar stirrup
#

Sounds simple enough

mystic estuary
#

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

noble sentinel
#

Like firing mechanic, which is a mess

dark parcel
#

Shooting isn't simple for beginners like me

#

What client sees and the server sees isn't the same

mystic estuary
#

Depends what kind of shooting it is really

noble sentinel
#

This supposed to be a firing bullet mechanic

solar stirrup
#

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

dark parcel
#

ooof

solar stirrup
#

If you don't need esports level of verification, you can add some leniency and Blueprints can probably do it fine

mystic estuary
dark parcel
#

context is verifying hit

solar stirrup
#

I didn't say zero verification hah

noble sentinel
#

Im also a unorganized person in irl so I guess habits cary over from there

solar stirrup
#

I'd just check the hit is "plausible"

#

Cheaters are gonna cheat, just don't give them a big red "kill everyone anywhere" button

mystic estuary
#

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?

noble sentinel
#

So its pvp against lots of other people

solar stirrup
#

SCP: SL's movement is utterly bad, Unreal's default is already miles better heh

noble sentinel
#

I would have easier time if I was making a simple co op walking simulator...

solar stirrup
#

So congrats on having that going at least

#

It's more of an arcade game so you don't need esports level of accuracy

dark parcel
#

co-op puzzle game would be totally walk in the park with bp only imo

#

compared to shooting

solar stirrup
#

And in Blueprints you're not gonna get rewind and all going

#

At least not without ripping your hair out in the process

dark parcel
solar stirrup
#

Nah

#

Esports? Sure

noble sentinel
solar stirrup
#

Arcade pvp game? Don't bother, just do some sanity checks to ensure the shot could've probably been done and accept it

noble sentinel
#

My shooting mechanics are interestingly working too good

#

But Im having problems with simpler things

#

Replicating is too annoying

solar stirrup
#

You'll get better at it over time

noble sentinel
#

Like my line trace code is replicating on soldiers gun line traces, but same code dont replicate when I use that on monster

solar stirrup
#

Making a multiplayer game is a lot more complicated than a singleplayer game, it's to be expected

noble sentinel
#

to make multiplayer

#

They say unity is much harder

#

I dont want to imagine

solar stirrup
#

Unity has basically no multiplayer solution

#

You'd have to roll a third party one yourself

#

Or write your own

noble sentinel
#

I dont get why indie developers doing multiplayer games on unity, like they are always having some major base issues that cant be solved

solar stirrup
#

In the end you choose the engine that fits your project's requirements.

noble sentinel
#

Can I also ask if you can see any problems in this code?

#

I cant make it replicate to clients.

dark parcel
#

why do u have to do the line trace on every client tho?

solar stirrup
#

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.

noble sentinel
#

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.

solar stirrup
#

Clients shouldn't see traces of others anyway

noble sentinel
#

I mean debug mode

solar stirrup
#

Yeah that's really not going to work

solar stirrup
noble sentinel
#

I changed it

#

now I only multicast the line trace

solar stirrup
#

You shouldn't even multicast

#

Why do you want to send it to other clients?

noble sentinel
#

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

solar stirrup
#

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

noble sentinel
#

Before I came here

#

I got this answer, and it fixed my issue

#

about my line trace bullets

solar stirrup
#

Well uh

noble sentinel
#

Didnt that supposed way?

solar stirrup
#

No

#

That's a very bad way of doing things vaultsweat

dark parcel
#

what's the purpose of the trace on other clients?

#

they have no business

noble sentinel
solar stirrup
#

Servers applies damage -> health is replicated to clients as a replicated property

dark parcel
#

But other clients doesn't need to run the line trace or apply the damage

solar stirrup
#

Clients dont apply damage, that's bad

dark parcel
#

server decide

#

server damage

noble sentinel
#

so should I run it on server?

dark parcel
#

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

noble sentinel
#

I dont really get it...

#

at least running line trace only on server looks like fixed the replication problem, I guess

dark parcel
#

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

noble sentinel
dark parcel
#

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

noble sentinel
#

Hmm

#

That can be a problem

dark parcel
#

Also if u shoot using Server RPC if u have 1 second delay, ur gun start shooting 1 second after you press left click

noble sentinel
#

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

dark parcel
#

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

dark parcel
#

but the smarter people say otherwise here

solar stirrup
#

The issue is ping not performance of your game

dark parcel
#

so maybe im wrong

noble sentinel
solar stirrup
#

The client says it hit a player, the server verifies it could've been possible

#

In Blueprints you're not getting rewind

dark parcel
#

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

noble sentinel
dark parcel
#

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

noble sentinel
#

Isnt run on server is already server rpc

dark parcel
#

sure but the line trace can be done locally

#

if hit something then run server RPC saying I hit something

noble sentinel
#

oh you mean after I make line trace, it should send a run on server event, right?

dark parcel
#

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

noble sentinel
#

Here, doing line trace locally than sending server event to apply damage

#

But damage isnt applying

dark parcel
#

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

noble sentinel
#

You just opened my mind, I managed to fix it

dark parcel
#

this is still worrying tho

noble sentinel
#

yeah I will also check for them

noble sentinel
#

is valid checking for if it actually hit something

dark parcel
#

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

noble sentinel
#

so I need to pass everything to server about linetrace, except linetracing action itself, right?

dark parcel
#

so u want to pass any data to the server thru function argument

dark parcel
#

easy mode atm is just to allow cheaters and just be a yes man to client

noble sentinel
#

I will let my players create their anticheat, instead of working 5x more on multiplayer and delivering a half made game

#

lol

dark parcel
#

You can never get rid of cheaters

#

even AAA companies can't

noble sentinel
#

yeah but at least decrease them

dark parcel
#

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

noble sentinel
#

It would be suck

dark parcel
#

yup

#

for PVE maybe it's okay I dunnoe

#

who cares if the boss dies later

noble sentinel
#

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

dark parcel
#

don't limit your self with BP πŸ˜›

mystic estuary
#

if they don't know C++, they can't do anything but BPs

noble sentinel
#

So this is my new and clearer working code

#

thank your for help!

dark parcel
#

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

mystic estuary
#

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

dark parcel
#

I had to do something specific

noble sentinel
#

I only know some basic things in C++, Its too scaring for me to let these shiny nodes go and work on text...

dark parcel
#

Grab all material in a folder and change it's static bool param and other settings

#

not sure if that's possible in bp

mystic estuary
#

static bool?

dark parcel
#

for materials

mystic estuary
#

But you are able to change material parameters in BPs

#

Materials are pretty high level really, so they must support that

dark parcel
#

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

mystic estuary
dark parcel
#

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)

mystic estuary
hoary spear
#

Its a static switch

#

Editor only

dark parcel
#

there are hundreds more material

#

manual labour is out of question

mystic estuary
#

Uh, I'm not sure whether that will be affected with these functions πŸ€”

hoary spear
#

You cant, as they are runtime ones

#

Changing the switch requires recompilation of shaders

dark parcel
#

yup

noble sentinel
#

Im trying to make actor give different responses to different damage types

#

but other characters cant understand different damages

#

They act like I always using normal damage

#

Is this a replication problem?