#multiplayer

1 messages Β· Page 111 of 1

hollow ridge
#

Now idea lol

sinful tree
#

Why are you even doing a multicast?

#

What is focused actor set to to begin with?

hollow ridge
#

I've a trace system and thats connected to the actor as child and If I look at something (lets say a platform in this example) I press E and want to get the parent from my actor. My actor at this situation is the collision sphere child from that platform.

#

and behind that interact functions is a simple move component to xyz

#

That "InteractionArea" would be the FocusedActor

sinful tree
#

Normally when interacting you do something like:
1 Player Side) Player Pressess Input > Does some tracing to find an actor > If finds a valid actor > Sends a Run On Server event passing along reference to the actor you want to interact with (Add an Actor Reference as an Input to the event).
2 Server Side) Run On Server Event > Validates player should be able to interact (player within range checks, not dead, etc.) > Calls Interaction Interface on the Actor
3 Server Side) Interaction Implementation on Actor > Does whatever is required for this actor to be interacted with, set any replicated values, trigger any other events or functions, destroy itself, call a multicast if required, or do whatever else you need it to do when it is interacted with

hollow ridge
#

Hmm, I guess I've to search then and try to figure that out. New topic for me x)
Thank you a lot! I'll try to refacture a lil bit and see how it goes

half umbra
#

@dark edge yes?

oak pond
#

does unreal have a weird thing with spawning actors in a for loop? I have a shotgun type weapon which uses a for loop to spawn multiple projectile actors, but in multiplayer, the for loop just spawns 2? Ive used a print to check it and its showing me the for loop is working fine but theyre just not spawning

#

actually, those are only on the server, and just 2 for each client. but this is on a multicast, and the for loop isnt replicated, just the event that spawns

thorny citrus
#

Hello, I'm curently trying to setup a dedicated server for lyrastartergame following these two tutoriasl https://www.youtube.com/watch?v=bw4zDuH3v54, https://www.youtube.com/watch?v=_7TQynJ_TrQI'm . I'm currently on 00:48 on this tutorial: https://www.youtube.com/watch?v=bw4zDuH3v54. However after I set my startup project to UE5 and clicked on the windows debugger, it starts building but its been building forever. I'm hitting my 10th hour without it finishing. This is the 2nd attempt this has happened. Does anyone have any ideas? I need help πŸ˜… - or if anyone knows how to setup a dedicated server for lyra in general, It would be greatly appreciated if someone explained that to me.

Video should get you a working lyra project setup as a dedicated server.

The clients need to run the packaged Game and then use the console command to connect or the blueprint command to connect to the public ipv4 / ipv6 of the pc thats running the packaged Server.

β–Ά Play video

Video should get you a working lyra project setup as a dedicated server.

The clients need to run the packaged Game and then use the console command to connect or the blueprint command to connect to the public ipv4 / ipv6 of the pc thats running the packaged Server.

β–Ά Play video
oak pond
#

guess Ill wait until tomorrow

sinful tree
# oak pond does unreal have a weird thing with spawning actors in a for loop? I have a shot...

You're going about this all wrong. There should be no real reason for:
A) A client to tell the server to spawn weapons.
B) A client looping to tell the server repeatedly how many weapons should be spawned.
C) A client to tell the server what position to spawn them in.
D) Having each client spawn a copy of the weapon.

The server should be able to spawn weapons on its own without a client RPC, unless of course your client is "Dropping" a shotgun, but that still shouldn't be a direct thing that a client should be able to call.

The server should likely determine the rotation to spawn the shotguns rather than the client being able to arbitrarily tell the server the rotation.

If you do want your client to be able to tell the server to spawn a shotgun, that's fine, but you shouldn't be looping the RPC. Instead, put the loop on the server so the server can do it and if you want the client to be able to tell the server an amount, include an input on the RPC to include a desired number. It's probably not spawning all of them because you're overflowing the network, as you're looping 16 times, then running a multicast 16 times.

If your ShotGun is a replicated actor, you would only need to spawn it on the server, so you wouldn't require to even call a multicast to spawn them, just spawn them on the server, and they'll replicate as they are able to clients.

oak pond
#

its not... weapons

#

I just called it shotgun for convenience these are just projectiles

sinful tree
#

Oh sorry I see, it's the projectiles...

oak pond
#

yeah I didnt realise I made it look that way

sinful tree
#

Even still, not the right way... Client shoots > Server determines rotation > Server Spawns Projectiles

oak pond
#

thats one of the things I tried

#

yeah, just checked again and changing it to a server event makes no difference

sinful tree
#

At the very least, you wouldn't want to multicast the spawning of the projectiles, nor should you be sending an RPC in a loop to the server, one RPC to the server should suffice for triggering an activation.

oak pond
#

so if the rpc isnt in a loop how is it randomising each spawn rotation without being different on each client?

#

also it just wont let me spawn actors from the server

sinful tree
#

You do the loop to spawn on the server. You don't need to loop on the client to tell the server to shoot them individually
Are your projectiles marked as replicated?

oak pond
#

which part? it does replicate the two that fire completely fine

#

and with a different weapon type it was all fine

sinful tree
#

An actor being marked as replicated is not the same thing as sending RPCs.

#

A replicated actor means you can spawn it on the server and a copy will then appear on relevant clients.

#

What you are doing is telling each client to spawn their own actors which would not be considered replicated as they weren't spawned by the server itself.

oak pond
#

oooohh man I didnt even realise that, yeah I was sure it should have worked on server

#

thanks yeah I can do it without the multicast now

#

this oddly seems to have fixed the for loop thing but now only two of them have collision (nvm, one event was still multicast and setting to server makes none have collision)

sinful tree
#

I'd still move the loop to be on the server, there's no reason your client should have to tell the server to RPC each bullet for a shotgun as it's more of a burst type effect. I know there are people who do an RPC per bullet fired with automatic weapons, but that's because there is usually a slight delay between each shot.

oak pond
#

collision is done with a sphere trace on tick, so that shouldnt need any extra replication should it?

oak pond
#

didnt have replicates ticked on the actor itself

sinful tree
#

Nice.... As for the sphere trace on tick, that's not really necessary - you could just add a sphere collider and detect the overlap or hit when it happens.

oak pond
#

no because theres bullet penetration stuff

sinful tree
#

Ah ok

#

otherwise, you just need to make sure the collision is happening on the server using Has Authority

#

ie. Tick > Has Authority > Sphere Trace

oak pond
#

oh hang on, the projectiles are stopping when colliding, but shaking around and fighting over where they should be, just seems to be a desync then, need to replicate one of the scripts I made there

#

well, now collision works but sometimes a bit too late so it goes into walls slightly, but thanks for the help anyway that loop was the main problem

wooden falcon
#

I’m have a pcvr multiplayer game I want to have on quest, I normally built server and client through the windows platform but now that I use the android platform how does it work for the server? Do I build it through android?

quaint roost
#

is net cull broken in editor? i set it to a low value (10k). I walked out of range of another player, the actor dissapeared but when i walked back the actor did not get recreated

sinful tree
#

Basically need to be on top of it in order for it to become relevant.

quaint roost
#

i see, how did you get 3.16?

sinful tree
#

Default is 225000000.0 which translates to 15000 units

#

Square Root of 10000 = 3.16

#

err

#

100 sorry wtf

#

Must've had something else in the calculator when I started typing XD

frigid needle
#

hey guy's if i want to know more about the AWS gamelift then which chanel is good for asking question

quaint roost
#

hmm 100, let me try further

sinful tree
#

None really as this server doesn't really handle AWS support.

frigid needle
#

oh okay then if i ask some of question here then it's small chance to get answer right

#

but still it's multiplayer channel so expect to get some answer i guess

sinful tree
#

Yep. AWS Gamelift is a separate service that's not specifically tied to Unreal Engine itself. If you're trying to integrate it with Unreal, then you'd probably want #cpp if you're having trouble with getting it coded. If it's a plugin you're using that you're trying to use, then you'd probably want to hit up the developer and check if they have their own Discord or support channels as people here may only have limited knowledge of that plugin. Otherwise, you can ask, but yeah, might not get a great answer :/

frigid needle
quaint roost
#

For future searchers: if you think net cull distance works weird (actor not getting recreated when going back into cull distance), it's because it operates off your camera location, not player actor

thin stratus
#

Yop to be more precise it works based on your view location. Doesn't need to be a "camera"

#

A lot of stuff actually does. E.g. there are nodes that calculate AOE Screenshake based on camera internally. Shows UEs ties to first person shooters.

errant glade
#

Is anyone knows the best course of dedicated server?

hybrid pecan
#

on a listening server is there a way to let the host client spawn a actor without it being replicated to everyone else on the network?

#

The fact I'm struggling to find info on this is odd, I'm sure tons of people have tried to perform something clientside on a host client?

dark parcel
hybrid pecan
dark parcel
hybrid pecan
#

but I'm also using the same actor to replicate across all clients for other situations

dark parcel
#

well you said earlier you don'tw ant it to be replicated

hybrid pecan
#

not in that scenario no, I think doing this though fixes it

#

or it appears to fix it

dark parcel
#

I think that;'s kinda unreliable. If you add delay it will actually spawn the Actor in all clients regardless

hybrid pecan
#

if I add a delay it just spawns in its set location

#

but since its following the users cursor it disappears because thats not replicated to other clients even on the host client oddly.
I mean ideally would not to replicate it on the client period but this seems to be a work around till I can find a better solution. I think running the server as a separate process on the host PC would be the ultimate solution but the most complicated

upbeat geyser
#

Just question to understand, does the server need to know that client pressed on key to look around to change pawn yaw rotation?

ivory dagger
upbeat geyser
ivory dagger
upbeat geyser
half umbra
#

how can i get player name correctly?

#

server normally get name

#

but for client is None

#

with delay works

#

but how can i do it without delay

half umbra
#

ok, so Client has Controller and Server has controller, so 2 games == 3 controllers

#

Client Controller is first when player join to server?

#

and second Controller for this client is on server

chrome bay
#

So the characters' controller will only be valid if it's a local controller. The Player State will only be valid if it's replicated + the controller has replicated it's reference to it.

#

Clients don't receive other players' controllers nor the servers' controller

#

Characters already have a reference to the controlling player state, so you can just get that. Unfortunately, since this is Blueprint you have no idea when it'll become valid.

half umbra
#

thanks

pseudo merlin
#

whats best practice for clients shooting projectiles that use projectile movement component? sending a rpc to server to spawn causes a noticible delay on seeing projectile spawn on client, I could spawn projectile on client then send RPC for server to spawn on other clients, but projectiles get replicated to all clients so shooting client would see 2.

faint parcel
#

What is the simplest delegate/event-based way of allowing a UserWidget blueprint to subscribe to changes (add, remove, change of items) of a UActorComponent subclass's FFastArraySerializer class?
I'm ending up with a lot of delegate code and I'm wondering if there is a common way.

What I'm trying out: the UActorComponent has some kind of delegate or event exposed that the UserWidget blueprint can subscribe to. The UActorComponent then itself listens to changes in the FFastArraySerializer subclass.

winged badger
#

you can inject the component as Owner into the FastArray, then broadcast directly from its callback functions

#

just don't do it in a constructor, and just a non UPROP TWeakObjectPtr<UYourComponent> Owner;

wooden falcon
#

Will an adroid build work on windows server? If I build the client on android and the server on windows, will that work?

ocean dust
#

Hello, all. I still have not found a good solution for my previous issue of Load Level Instance not replicating and therefor stopping my procedural map generation from working for remote clients. Does anyone have an insight into some other ideas on this topic? Thanks!

worthy wasp
#

MP AI Perception - i'm having a LICK of a time getting this TeamId to set right... wondering if someone sees something i'm not:

1: I spawn AIPawn (getWorld()->SpawnActor()...)
2: I set new pawns Team appropriately (see below ETeam enum)
3: AIController::OnPossess SetGenericTeamId((uint8)MyPawn->Team);

This TeamID is ALWAYS 255 when its going through perception phases.... I"ve even gone as far as setting the TeamId to Replicated - thinking it was an MP Replication issue (shotgun attempt at best...) but i didnt expect that to even work in the first place..... What am I doing wrong? The MyPawn->Team is a value of 1 when it hits that function (3 above) but the UINT8 cast is setting it to 255 :/

UENUM(BlueprintType)
enum class ETeam : uint8
{
    Defenders UMETA(DisplayName = "Defenders"),
    Attackers UMETA(DisplayName = "Attackers")    
};
thin stratus
#

And the getter?

worthy wasp
thin stratus
#

Oh?

#

And you override it with your own teamid variable or?

worthy wasp
#

FGenericTeamId TeamId is set to PRIVATE in AIController.h

All readings i've done they make their own FGenericTeamId in Protected scope in their extended AIController class -w hich i've done...

#

doesnt this conflict?

#

same name -
FGenericTeamId TeamId;

thin stratus
#

I guess? Why do you need it to be custom

#

If the ai controller has it

#

Pretty sure they expose it via the interface?

worthy wasp
# thin stratus Pretty sure they expose it via the interface?

they expose the function publically - not the variiable TeamID

But i'm also questioning if i need to even override this GetGenericTeamId() - i'm not doing anything in it.... i'm going to remove that to see if that makes the difference.....

AIController.h

    //----------------------------------------------------------------------//
    // IGenericTeamAgentInterface
    //----------------------------------------------------------------------//
private:
    FGenericTeamId TeamID;
public:
    virtual void SetGenericTeamId(const FGenericTeamId& NewTeamID) override;
    virtual FGenericTeamId GetGenericTeamId() const override { return TeamID; }```
#

yah this compiles...

#

all readings i've done say that you need to override GetGenericTeamId() as part of the interface -

#

doesnt look to be a required override tho

thin stratus
#

It is if you put that into any other class I guess

#

E.g. a character

worthy wasp
#

i get it!

#

ok

#

that makes more sense - cuz the parent already had it

thin stratus
#

Since the AI controller isn't replicated most peeps probably have the variable a second time in the character or so

#

Would need to override the setter in both classes though to keep them in sync

worthy wasp
#

This solved the 255 issue - thanks for helping me think out the box πŸ™‚

stoic lake
#

Hey, I'm working on creating a voice chat system. How can I disable voicechat for a specific player? Meaning that they cannot hear other players?

#

I'm using the built in VOIP system

#

For context: this is for a walkie talkie system. I want players who do not have a walkie talkie in their inventory to be able to receive walkie talkie sounds, only proximity chat

thin stratus
#

But that aside, I'm not sure atm you can do that. The default VOIP system has this Mute functionality I think

#

But that mutes one player for all others

#

Not other way round

stoic lake
stoic lake
knotty briar
#

I see thanks for the answer, it’s better for me to ask instead of search online for an answer that I was looking for but wouldn’t work. I will be developing a mixture in that case using the existing cmc system but for vehicles

#

Like remake the system

hollow flicker
#

Hello, I am currently trying out the multiplayer stuff on the FirstPersonTemplate. Net mode is set to Listen server with two players.
In the FirstPersonBP, I create a widget on Event BeginPlay, promote it to a variable and set it to viewport (its my HUD).
Now, at one point in the game, im using RPC to call an event on all players which changes their HUD (and therefore accesses the saved hud variable in FirstPersonBP).
If my client fires this event, the HUD changes fine on his side. But when it comes to accessing the servers HUD variable, I get an error because it is apparently "None", even though I did set it after BeginPlay and wouldnt know why it is now None?

Can somebody help me with that and explain whats going on?

daring gorge
#

hello, should the functions triggering safe variables in custom cmc be replicated?

dark edge
hollow flicker
dark edge
#

RPC on

hollow flicker
#

What do u mean

dark edge
#

From the RPC to wherever you do the stuff you do

hollow flicker
#

Alright

#

The CallFP event gets called from a button press in the HUD

#

The Print String is already giving me that the variable used to store the widget is None, which later results in an error as described

hollow flicker
#

So client presses button in his HUD and fires CallFP

#

All the screenshots are from FirstPersonBP

#

This is how the HUD variable is set on BeginPlay, also in FirstPersonBP

dark edge
#

Win Shift S

dark edge
#

you only want to do that on the local copy of the actor

#

IsLocallyControlled

hollow flicker
#

This is whats before, just template stuff after BeginPlay

dark edge
#

you don't want to do any of that on any copy of the pawn besides the locally controlled one

hollow flicker
#

I put a branch after BeginPlay and checked IsLocallyControlled, but error remains (server hud var is None)

glacial thicket
#

Hi everyone, I am new to Unreal Engine, I would like to know how I can notify the server that I am managing an object. I'd be happy to have any information which can help me.

sinful tree
#

You probably want to make your paddles there pawns that your player controller then possesses.

fathom aspen
#

BeginPlay of Pawn is cursed to get the PlayerController at

hollow flicker
#

I dont really know what you mean, could you explain a bit more in detail?

fathom aspen
#

Use OnRecieveControllerChanged instead of BeginPlay for this

#

Literally what the comment their says

#

It's prolly not yours

#

I falsely assumed it was, but it feels weird that it's there when it's actually BeginPlay

hollow flicker
fathom aspen
#

Yeah so it's on Epic

#

They did the comment part, but left the implementation cursed πŸ˜„

hybrid pecan
#

Using SetReplicates seems to be a workaround to run stuff clientside as a server host

hollow flicker
fathom aspen
#

I'm not sure what you did

#

I'm not sure what error you are referring to

hollow flicker
#

I replaced BeginPlay by OnReceiveControllerChanged

fathom aspen
#

With no IsLocallyControlled?

hollow flicker
hollow flicker
fathom aspen
#

The widget should be valid if you create it and associate with a local player controller

#

Nothing really fancy

hybrid pecan
#

Its so odd how I cannot find documentation, are listen servers not popular or something?

hollow flicker
#

It seems like after my client spawns, the servers widget variable gets set to None

fathom aspen
#

Well documentation in general is scarce, nothing exclusive to listen-servers

#

But since you asked, it's not of Epic's interest either

hybrid pecan
#

yeah trying to figure out how to run things only on the client when the host is the client isn't easy, I think I found a work around but I don't think its a great work around

fathom aspen
#

Sounds like you're referring to the Remote pin in SwitchHasAuthority macro and wondering why it doesn't fire on listen-server player at all

#

I mean yeah it shouldn't

#

You instead use IsLocallyControlled, IsLocalController

#

And a bunch of similar functions

hybrid pecan
#

who are you talking to

fathom aspen
#

You

hybrid pecan
#

how would checking if locally controlled help?

fathom aspen
#

Help in what sense?

hybrid pecan
#

being able to run stuff on the host client without it replicating to all other clients?

dark edge
hybrid pecan
fathom aspen
#

Well they don't really know what they are asking for

#

Another sad day for the science of question asking

dark edge
#

What are you actually trying to do here

hybrid pecan
#

I'm trying to spawn a actor but locally on each client so they are clientside

fathom aspen
#

Don't replicate the actor just to begin with

dark edge
#

yeah just have the actor not be replicated

fathom aspen
#

And spawn it after the check mentioned earlier

hybrid pecan
#

I'll give that a go

dark edge
#

Or you can have it be replicated but not actually replicate anything. What's the game mechanic?

hybrid pecan
#

Being able to place a actor down but when you select a actor a ghosted version of that follows your mouse, doing what yall said seems to work though

supple cypress
#

What's the best way to check that all clients have connected and have finished spawning pawns after seamless travel? I want to set something up in GameMode to know when to start the match.

hollow flicker
sinful tree
# hollow flicker Does someone know more about why that might happen?

There are lots of reasons why that could potentially happen. You could show more code as to how you're handling the creation of the widgets and when you're accessing it that it shows None, preferably showing the initiating event that leads up to it too.

Begin Play fires on clients and server, so if you're creating widgets there, the server and client could potentially be creating the widget when you may only want it for whoever the owner is of that controller or character, or whatever class it is you're using to create that widget.

If you're attempting to access the widget of a client on the server, or vice versa, that's not possible as widgets do not replicate.

hollow flicker
# sinful tree There are lots of reasons why that could potentially happen. You could show mor...

I showed all of the relevant code already in screenshots above. I do want the widget on client and server, so I suppose BeginPlay creating it for each is fine too?

Do you mean I am unable to access other widgets except my own through the server? So an RPC Multicast to, lets say, change a text on the widget for every player, would not work? How could I still ensure that if my client does something, the widget of my server changes aswell? (As the widget of the client is doing fine)

sinful tree
# hollow flicker I showed all of the relevant code already in screenshots above. I do want the wi...

Creating on begin play of a character is bad unless you have an IsLocallyControlled check before doing it, otherwise everyone is creating it and if it is just your HUD, you should only be creating it once.
The other problem is that if you're running a multicast on a character, then you're referencing the HUD created for that particular character but since you (hopefully) only created the HUD for the one local player character, you wouldn't necessarily have created a reference to the HUD on the character you're calling the multicast on.

hollow flicker
#

And this missing reference might explain why it gives me "None"?

#

It does seem like even tho my server does have his hud reference, the client seems to think it is None. But idk

sinful tree
#

Probably. Each character is its own instance of your blueprint. If you create a widget on a specific instance, only that one instance will have reference to that specific widget.
If you create it on every instance of your character, then you'll have several instances of that widget, each referenced on the character it was created on.

#

So the HUD you'd create on Character1 would be different from Character2

#

So calling a multicast to do something with the HUD reference on Character1 means you're trying to access the HUD created on Character1.

hollow flicker
#

I thought itd work like this: the code after the Multicast event will be executed on each players instance seperately, and therefore use their own HUD reference variable as created at BeginPlay

sinful tree
#

And it doesn't work that way. When you call a multicast, you're telling everyone to execute something on that particular instance.

hollow flicker
#

Okay, thank you. Now, how else could I achieve this? Basically, client pushes a button, and his aswell as the servers HUD change

sinful tree
#

That is difficult to do when the HUD is in the character as you don't really have a good reference to the local HUD. You can easily get a reference to anything stored on the current player, but to get your own local HUD from a player character, you'd have to do something like, Get Player Controller 0 > Get Controlled Pawn > Cast to your Character Class > Get your HUD reference and do stuff.... It's messy.

This means: Don't store your UI on the character. There is a "HUD Class" that you can set in your Game Mode that gives you an actor that is instanced locally for each player. You can create your own HUD Class, and have the logic in there to create and add the UI to the viewport. You can access your HUD using "Get HUD" anywhere but you still need access to the owning Player Controller, but then you can cast it to your custom HUD class and do what you want to the widgets it has created, but that's still not all that great as you could instead have your widgets read and listen for things rather than trying to push changes into your widgets.

#

Need a widget to display a player name?
Have an event dispatcher on PlayerState that you call during OnRep of the player name. Have your widget bind to that event dispatcher to read the PlayerName. How does the widget know which PlayerState? You create the widget when a PlayerState joins the game, which you can use the Begin Play of the PlayerState to determine when a player has joined - create an event dispatcher on Begin Play of the PlayerState, have your HUD listen to that event dispatcher, and when you hear it, you can create the widget.

hollow flicker
#

So rather create the HUD in the HUD class and save a variable there? And whenever you need it, get the HUD, the variable, and do stuff?

sinful tree
#

That would work better, yes, but again, ideally you're not forcing the data into the widgets - the widgets just listen for the data to come in.

sinful tree
#

The benefit is that you're no longer trying to reference the HUD that you've stored on a particular character.

hollow flicker
sinful tree
#

I'm talking about a HUD Class.

hollow flicker
#

Oh okay

sinful tree
#

So within the HUD Class, you'd create your actual HUD Widget.

hollow flicker
#

Yep just got confused with the terminology for a moment lol

sinful tree
#

Unreal should change the name to "Widget Manager" class πŸ˜›

hollow flicker
#

Why is networking so hard

sinful tree
#

It's more having to understand Object Oriented Programming and realizing that those objects can exist in more than one place.

hollow flicker
#

Out of all the programming ive ever done, networking was the weirdest stuff to me

#

It often went wrong when the code looked totally fine

sinful tree
#

Doing something on a particular Object means that object. Not on others that are like that object. If you want all the other actors of that particular object type, then you have to reference them and ask them to do it too.

Networking adds the additional headache of understanding who is in control of the object, and on which instance of the game you're calling the instruction on.

hollow flicker
#

Its like you do stuff but it gets received totally differently and i dont know why

hollow flicker
sinful tree
#

Sockets is basically the same thing.
Server is started.
Server sets up timer to only stay active for the next hour.
Server starts waiting for connections.
Client connects to server.
Server stores reference to the client object that joined in an array and sends a heartbeat every so many seconds if nothing is received to know if the client is still connected.
Client sends instructions. Server receives, does what instructed, sends back response to the client object that sent the instruction.
Client receives response back about status of instruction.
Server detects client hasn't send anything in 20 seconds, heartbeat sent.
Client receives heartbeat and notifies server it's still alive.
Server receives heartbeat from client.
29 minutes (and many heartbeats) later....
Client forcefully disconnects.
Some seconds later...
Server sends heartbeat, client object is no longer valid > Server removes client object from array.
30 minutes later...
Server timer is up! Server gets reference to all connected client objects, loops through them and tells them goodbye, disconnecting them.
Server process shut down.

hollow flicker
sinful tree
#

That's thanks to latency mostly. What my computer sees isn't what the server may see whether we're 5ms or we're 300ms latency away from each other.

#

The server is always in the future compared to my computer.

sudden condor
#

Best way to say "hey everyone, possess this specific camera actor in the level" in blueprints? I want all my players to enter the match into a short preround where they can see the map. I was thinking each PlayerController possesses it during Begin Play, but I am unsure of the best way to tell the PC what to possess. If hardcoding the camera actor ref into the PC is an option, that should work fine.

loud cove
#

what's best practice to distinguish between a simulated proxy and an autonomous proxy, e.g. when adding components to my pawn that will only ever be active/visible for the autonomous proxy?

latent heart
#

You can't really have multiple players possess a single actor (especially if it's just an actor and not a pawn!) You could set it as their player controller camera manager's view target, though, or something.

loud cove
#

i can have the same exact class for both, simulated and autonomous proxies, and just disable/hide some components at runtime when the pawn isn't locally controlled. but is this the way to go?

sudden condor
latent heart
#

You could even add the local-only components dynamically on begin play if it's locally controlled.

loud cove
latent heart
#

Or add them via the player controller when you acknowledge possession?

sinful tree
loud cove
latent heart
#

You're posessing things in the level already? Rather than spawning new pawns?

loud cove
loud cove
latent heart
#

Ah. Yeah.

loud cove
#

and those cameras and the cockpit isn't active/visible for pawns that are not locally controlled

latent heart
#

Not sure about best practices, tbh.

#

It seems just like a very advanced version of player vs arms mesh, though.

loud cove
#

i will organize my code a little bit and address this even by putting comments // locally controlled stuff here: ... to reduce the cognitive load. I wouldn't mind having stuff in two distinct classes - but that is not strictly necessary, either.

sudden condor
#

The new learner experience of looking back at your code from even just a week ago:

#

I spawn my players with a for loop, during which I give them a killfeed widget, and I store all the widgets in an array, that I iterate over whenever I broadcast a kill event....

scarlet temple
#

HIII^^ any one know of any good guides to set up multiplayer with google play services? been looking but i cant find anything

wooden falcon
#

Hey, I’m building my dedicated server on windows and my client with android. Does that work? Or how do you get the server for an android build? Anyone knows?

hoary spear
sinful tree
#

Maybe I should've said my computer is always in the past compared to the server? That way it doesn't break causality!

hoary spear
#

Indeed x)

#

What's the common way of doing server logic if not dedicated server ?

#

seems the server doesnt get onRep's

#

(which makes sense, but ruins the setup )

#

i keep on adding stuff like this to 'fix' it but it feels rather dirty

if (GetOwningActor()->GetNetMode() != NM_Client)
{
    SkillPointsChanged.Broadcast(GetAvailableSkillPoints());
}
sinful tree
hoary spear
#

Still feels kinda dirty, but cleaner than what i got today i guess

delicate igloo
#

What is the absolute first thing I should learn when getting started with multiplayer?

ivory dagger
#

gives a good overview about the framework

delicate igloo
#

Thank you so much

#

When should I start thinking about multiplayer?

#

Seems like something I should consider integrating early

#

Or is that wishful thinking

ivory dagger
#

i consider myself a beginner too so dont take my advice as the absolute word, but i learned BP programming for about 18 months before jumping into MP

delicate igloo
#

Did you come from a coding background?

ivory dagger
#

no, started with unreal BPs

delicate igloo
#

Okay I’ve only been in unreal for a few weeks haha

ivory dagger
#

maybe try to make a few games by yourself to practice, then start MP.

#

https://www.youtube.com/playlist?list=PLzykqv-wgIQXompUswD5iHllUHxGY7w0q
i followed this playlist, it gives a introduction about how to use what you learn here https://cedric-neukirchen.net/docs/category/multiplayer-network-compendium in an actual game

This compendium is meant to give you a good start into multiplayer programming for Unreal Engine.

delicate igloo
#

I made a 2D open world game onetime in html5/typescript and adding multiplayer after the fact was the most annoying thing I did

ivory dagger
#

its ok that way too but u might have hard time understanding some concepts

untold rose
#

Is it a good idea to have interaction line traces to happen on both the client and server?

#

That did cross my mind. Is there any reason why a line trace on a server wouldn't hit anything but does on the client? I currently have a line trace that happens on both the client and the server but the server side doesn't actually hit anything except for the controlled character (listen server).

The line trace itself it pretty standard.

#

Yea, i think i've just figured it out. The line trace goes from the camera but I don't believe its rotation gets updated so it never actually hits what the client is looking at.

#

@whole grove thanks for the help, I just had get the forward vector of the control rotation instead of the camera itself. (as this is what the camera uses)

#

The line trace is running just server side now as well and all seems to be working as intended.

twilit radish
#

Can't even comment on why those plugins are awful without the message getting removed πŸ˜”

urban palm
#

@twilit radishyou are free to share your opinion, the removed messages were about a behind the scene request from someone to get an illegal copy of the plugin, which is obviously against the #rules

twilit radish
woven basin
twilit radish
#

All fine lol. It's not an issue in the first place I just wanted to say those plugins are often massive security leaks haha.

#

Those MySQL connectors to Unreal / BP plugins yeah.

#

There are multiple. Not sure which one it was πŸ˜›

hollow flicker
#

Hello, in my FirstPersonBP, I am calling an event through an event dispatcher. This is replicated via RPC Multicast.

In my Level Blueprint, I am binding that event dispatcher on BeginPlay to a custom event. This custom event then gets called appropiately.

Now, when the client calls that event, it all works (e.g. Meshes in the level change), but it only works on his side. How could I replicate this, so that my server will also see the changes and be affected by them (so that their level changes aswell).

(Net mode is Listen Server with two players, using the First Person Template project)

twilit radish
hollow flicker
#

In the FirstPersonBP, when the event gets called, it first goes to a "Run as server", and then to a Multicast which calls the events in the Level BP

#

I believe I might have to do some similar replication in the Level BP, but I am really not sure how?

twilit radish
#

Have you tried checking where it exactly doesn't work any more? E.g. printing messages attaching a debugger?

#

If the multicast is inside the actual level blueprint it self then it isn't going to work yeah.

hollow flicker
#

Events binded in Level BP, seems to be replicating fine

#

Events being called in FirstPersonBP, also seems to be replicating fine

#

The actual events now in Level BP, only executed on client (not replicating)

chrome quest
#

Do people still do stuff in the level bp?

#

Fair point

hollow flicker
twilit radish
hollow flicker
chrome quest
#

Game mode, game state, find all actors of class, anything but the level bp

twilit radish
#

Use any other actor that is actually replicated. The GameState for example. If this is being used on a specific actor have that actor do the change.

#

Also this in specific does not seem like something you want to do with a multicast. This seems to be "state" you're changing with them. If a new players joins they will not have the correct state of whatever the light is in πŸ™‚

chrome quest
#

What you want is OnRep_

#

Where's that link for onrep vs RPCs?

twilit radish
#

uhh..

#

Which one? The article Vori made?

chrome quest
#

Yeah, that one

twilit radish
hollow flicker
oak pond
#

when testing enemy ai in multiplayer, how do I know its like - actually working? currently ais can see and target both players with no desync, but like is that just coincidence? does it just happen to work because or do I need to see if theres any problems Im not sure how to even check

#

and also when shooting at enemies with projectiles, they take damage on both clients, but sometimes only on one if it happened too fast or something, so I would set up replication for the damage events but that seems wrong too because it already kinda works

#

but Im not sure what I need to do since the projectiles are replicated, but enemies dont always take damage on both clients, but I imagine replicating it could cause it to happen twice or something

#

oh good start, its already unplayable on the "Bad" preset, cant even jump and stuff even though thats just regular replicated events

#

good point I didnt think about replicating the actual hit in the projectile

#

I mean Ive been doing this for years

#

should I really though lol, seems like every time I do this its as if Im a begineer

#

but should I expect it to be playable on the bad preset?

#

Ive never worked with ai specifically in multiplayer

#

yeah with my other project I was prioritising the clients gameplay and then just doing all the replication separately, but I know this would be horrible for any kinda pvp

#

but that was custom movement too, with default charactermovement component it seems you cant take any shortcuts like that even if you wanted to

#

man I hate doing this

#

on Average you can play pretty much fine but lag behind a lot for the other player, even though this is mostly default movement stuff

#

at least it doesnt seem to completely fall apart

#

this is one thing that never seems to get easier jim

woven basin
#

With Rider, if I launch my game in Debug (so the debugger is attached), I can obviously stop on breakpoints etc if I play the game in the editor.

And if I launch a second player from within the editor I can also stop on debug points when it is "run under one process = true". But obviously I really want to test it as seperate process. So I change "run under one process = false".

This spins up another process, and in rider I select "attach to process" and select the new second client. Rider says Debugger attached to process 6752 - Debugger detached - so it seems like it should work.

But the breakpoints are not working.

What am I missing?

Is there a better way to debug clients and listen servers as seperate process?

quartz iris
#

How could I make it so player 1 spawns in a specific location, as well as player 2 doing the same but in a different location?

oak pond
#

just place playerstarts robert

quartz iris
chrome bay
#

Add a tag to them, and override ChoosePlayerStart in your gamemode to use specific ones with a given tag

quartz iris
chrome bay
#

No. Override ChoosePlayerStart in the gamemode, and search for a player start with a specific tag.

#

E.g. "Player_1", "Player_2" etc.

#

Not 100% sure ChoosePlayerStart is exposed to BP but it might be

quartz iris
#

I don't think this is it

#

I already have my default pawn class set

#

I'm just looking for a way to spawn a certain player in a certain player start

#

Is it not this?

hollow flicker
# hollow flicker Okay, thank you all very much! Gonna get to work now

Now I got the following problem: Through an RPC Multicast in my FirstPersonBP, the event is being called on my GameState. This event gets executed properly for both client and server, and involves deleting an actor. The actor is deleted for both players, but at the end, im getting an error in my GameState, saying it accessed None trying to delete the actor (that has already been deleted for both players?). Does someone know what might be going on?

woven basin
#

You wouldnt RPC multicast a delete.

You get the server to delete the object, and the object itself is is replicated, so the server will tell the client to delete it via replication

quartz iris
thin stratus
#

@grand kestrel I just noticed that the Movement Comp example doesn't really have a proper MoveContainer example or?

#

Neither ServerResponse nor ClientMoveData

fathom aspen
latent heart
#

The one useful thing for the thing that should never be used.

twilit radish
#

Why. Just why.

fathom aspen
#

Haha, yeah it's just w/e

#

I was never able to find an answer on to why it needs to replicate, but it's missing all the elements an actor needs to be replicated

#

I bet it was always like this since 4.0

twilit radish
#

It's not even an actor though. The level Blueprint "self" is an ULevel.

fathom aspen
#

Nah it's an actor

#

AScriptLevelActor I guess

twilit radish
#

πŸ€”

#

I mean I guess that does make more sense now that I think about it.

#

But still. Whyyyy

#

πŸ˜‚

fathom aspen
#

My only theory is that it was used for scrubbing in UT and they had some replication code that they needed to carry over to the DemoNetDriver

#

But that's just theory

twilit radish
#

A game theory! See you next time.

#

Alright sorry had to do it πŸ˜†

#

But yeah.. Even then I still wouldn't use it. It's just an awful way of doing things lol.

fathom aspen
#

I argued if I could turn off replication on it, but it could break things, and I'm not ready for it

thin stratus
#

I just the LevelBlueprint once

#

And for that I extended it in C++

#

And that was because the Game had different settings per Level

#

So I placed the Settings in the LevelBP

#

It worked and kinda made sense

#

But that's all I ever needed it for, aside from debugging

#

And you might be able to just use WorldSettings anyway

#

But I think I didn't know about that back then

fathom aspen
#

Either that or accessing specific level actors for w/e reason or some level sequence stuff

#

But yeah I find it rare to need to use it

twilit radish
woven basin
#

This is a particuarly awesome feature. I was just testing it out now, works brilliantly

thin stratus
#

If I start a RootMotion Montage in the CMC, while making sure Server and Client have the same Transform, should that cause corrections o.o

hollow flicker
#

Hello, how does connecting and all that stuff work with Listen Server? If I press play now, it just spawns me and my client in, but how would I do things like, setting up a menu where you see servers or can create one, and then spawn, and another person can see that server, connect, spawn aswell? Does anyone have resources on that?

elder lynx
#

Hi, Does anyone know about if we want to run a timer that is synced between both client and server what will be the best way to do it and that way should be cheat proof also?

sudden condor
thin stratus
#

Without an #online-subsystems you can only connect directly to a known IP and the host has to open ports.

hollow flicker
elder lynx
thin stratus
#

Not really, google is honestly your friend here

upper lily
#

session search result is always empty. anyone have any fix?

UE 5.2 / STEAM

sessionSettings->bUsesPresence = true;
sessionSettings->bUseLobbiesIfAvailable = true;

Both lines already there.
Able to create sessions but when trying to find sessions it is always returning 0 ( Checked in debug and as well as build using debug write on screen )
Image
SCARBLAZ β€” Today at 9:26 PM
am testing on 2 different laptops, different steam accounts but on same internet network. idk if this is helpful

#

can anyone help?

hollow flicker
thin stratus
# hollow flicker That would be enough. Do you know some resources or guides regarding that?

You can host a game with the OpenLevel node and passing ?listen in the options. (if a Player should be able to host) or you need to build the Engine from Source (gitHub) to build a standalone DedicatedServer for your game.
If you have the IP and the Port is opened properly, you can either use the console (for debugging) or in BPs use "ExecuteConsoleCommand", where the Command is open <ip:port> , e.g. open 127.0.0.1:7777

sudden condor
tawny talon
#

Hey nice ppl, i have a question about multicast and rep notify, not quite sure if i should post it here or not, so I'll describe my question fast and if it should not be here i would delete the post.
It's about the rep notify and multicast event related to the networking example regarding the treasure chest.

https://docs.unrealengine.com/4.27/en-US/Resources/ContentExamples/Networking/2_4/

So based on this explanation, multicast event would be used to play effect, while the rep notify variable will be used to make the chest stay at an opening state.
This is all good. But in my scenario, there is a rather complicated "chest open animation". What i would like to have is:

  1. When the player first opens the chest, play the effect and this complicate animation;
  2. When the player comes back (become relevant), make the chest "open" immediately without the complicated animation.

It seems logical to extend the multicast event to play both the animation and the effect. Yet since the rep notify happens as well (almost at the same time when the multicast event happens), this rep notify would somehow force the chest to stay open, which seems conflicting with the multicast event where it wants to slowly open the chest.

Is there any good way to work around this conflict?

An overview of the Network Features example level, example 2.4: Network Relevancy (Part 4 - Combination Solution).

magic furnace
#

once it finishes

#

you onrep that it is open

#

otherwise you have conflicting code

#

so first the multicast happens, the chest opens

#

to keep it open forever, you set some variable that is onrep to open

tawny talon
#

Make sense

magic furnace
#

but first you wait for the animation to finish

upper lily
thin stratus
#

You can make that a bit more complicated by skipping the OnRep result if it means the Chest is open while you are playing the open anim

#

Cause it might just replicate faster back and the anim is suddenly skipped

magic furnace
#

a lot of lazy devs would just keep it an onrep lol

#

since honestly, you load in, all the chests in your relevancy range open

#

but it happens while loading, which is how a lot of games just don't care and leave it like that

thin stratus
#

If you walk out and into relevancy range, you'd notice it though

magic furnace
#

depends

#

usually it's high enough that well, you don't really care

#

example: not really networked but in baldurs gate 3 this happens

#

it plays the animation still

#

right as u load the last save

tawny talon
#

Yes. The actual case for me is that my chest is not really a chest, but a collapsing rock where i kinda want to let the playdr watch the animation in the first run, but don't play it again when next time the player approaching

soft cape
#

Does anyone have suggestions on why OpenLevel works for Host but not the Clients? Clients most of the time just timeout, so I'm thinking that the host needs to do something before the clients are notified to load level.

thin stratus
#

And what are you trying to achieve

magic furnace
#

Hey I've noticed that on my dedicated server in the session settings my build ID is 0?

#

doesn't this correspond to the project version?

soft cape
#

Pulling the other party members into the level as well

latent heart
#

Why create 2 types of session?

#

Surely a party is just a session that hasn't progressed to a lobby?

soft cape
#

Yeah I'm not too sure about that. Most of the code I'm working with isn't mine

magic furnace
#

great chance to correct that idea and just have everybody join 1 session

latent heart
#

I guess it could make sense if there's the option for randoms to join your lobby, like CoD or whatever.

soft cape
thin stratus
#

That's a pretty involved thing

#

MainMenu Parties, like OW, CoD, CS, FN, etc. are done with BEACONS in UE

#

Which require C++ unless something changed

#

They are lightweight connections that don't actually join a level

#

They use PartySessions (which are different from GameSessions in theory)

#

And if you use something like Steam, you can't actually be in both at once, so you also have to manage recreating the Party afterwards etc.

#

If you don't want to deal with that, you'd only have the option to actually connect to a Level (e.g. a Lobby) and then SERVER TRAVEL (seamless!) to the Gameplay Level

#

OpenLevel isn't used anymore after connecting unless you want to disconnect.

#

Server needs to call ServerTravel <mapname> to take clients with it

hollow flicker
#

Hello, in my GameMode, on PostLogin, I am casting to the GameState and run an event. This event on the GameState checks if two players are connected, and then does stuff. This functionality is only happening on the server though, and not replicated to the client. Why is that the case, and how could I still achieve the desired functionality? I suppose it doesnt really work because the GameMode only exists on the server? But I would need PostLogin to check the amount of players whenever a new player joins, or are there alternatives?

bronze glade
#

Hey everyone! How do I enable seamless travel in PIE? I need to use PIE for a plugin I am testing with multiplayer. I see this warning:
LogGameMode: Warning: ProcessServerTravel: Seamless travel is disabled in PIE, set net.AllowPIESeamlessTravel=1 to enable.

But when I enter it, I get a warning that 'set command cannot be used in editor' so is there just nothing I can do?

sudden condor
dark edge
sudden condor
#

This travel works, but "copy properties" isn't being called in the PlayerState. I got this indirectly from a guide so I feel like it should be able to work.

bronze glade
sudden condor
bronze glade
dark edge
dark edge
#

not much slower than PIE

sinful tree
#

You can even launch your game from a shortcut that does something similar without packaging.
Target:

D:\UE_5.2\Engine\Binaries\Win64\UnrealEditor.exe "path to your uproject file here" levelnamehere -game -log

Start in:

D:\UE_5.2\Engine\Binaries\Win64

Change the path to Unreal based on where you installed it.

bronze glade
#

Okay I'll try and figure out how to do it with standalone. Thank you all!

dark edge
hollow flicker
sinful tree
#

You are correct in that GameMode only exists on the server, so when PostLogin is called, only the server is executing all the following code.
The alternative is to have your GameState function be called as a multicast - the only trouble here is if you're using playerstates at all then there's no guarantee that the playerstate of the joining player has been replicated when you receive the multicast.

sudden condor
#

When switching levels, at what point can I be assured that this call will yield a non-null value in the PlayerController?

sinful tree
#

Whenever that Camera Actor is created. If it's something placed in the level, then it should be accessible immediately. If it's something that is spawned, then it should be when it gets spawned, unless it is replicated in which case then when it begins play on a client.

sudden condor
hollow flicker
sudden condor
twilit radish
sinful tree
sinful tree
sudden condor
sinful tree
sudden condor
dark edge
#

PlayerController exists on server and owning client

sudden condor
sinful tree
dark edge
sudden condor
#

dangit

sudden condor
sinful tree
hollow flicker
#

Besides always checking the playercount on PostLogin (or maybe OnPossess), how could I make sure that a certain event does not fire on BeginPlay (when the first player joins), but waits for the second one?

sudden condor
sinful tree
#

The server can set an OnRep as adriel said which should probably be in the gamestate, that onrep can then drive the logic on clients.

#

It can be a simple bool, "PlayerLimitReached" -> Set true -> OnRep fires -> Things happen

hollow flicker
sinful tree
#

Lots of pins in this channel that go over it.
It's a means for a variable to call a function when it receives a new value, usually when a replicated value gets received.
You can mark a variable as OnRep by setting its replication setting to RepNotify - doing so will automatically create a function in the class that will be called when the value changes.
You can put whatever logic you'd like in the OnRep function, including doing anything based on the new value of the variable.
This also lets you drive stateful logic, meaning you can set the value before the client knows about the actor that contains it, but when the client finally does know about the actor, they'll receive the replicated variable and the OnRep will fire, causing the logic required to execute when received.

Just like standard replicated variables, you need to set the variable on the server if you want all clients to receive the new value.

hollow flicker
#

Thank you very much, its working now :)

candid mulch
#

I have an rpc set up that plays a anim montage but there are constant desyncs that happen

#

this was from a dash root motion montage

#

is this fixable???

haughty estuary
#

First time trying out multiplayer but having trouble playing my test level. When I set the net mode to play as client (expecting a dedicated server to start up) then I get an error message pop up Couldn't Launch PIE Client If I try running in listen server mode it launches as expected when there is only one instance but If I try playing with two clients I get the same error message. Anyone have any ideas what this could be?

hollow flicker
#

Hello, is there any way to be able to host a game on my PC so that another client can connect to it/join me, without me having to forward ports? I am sadly unable to do so, therefore I would somehow want to circumvent it. When I did some networking in Python, I used to host a server via ngrok. Is there anything similar I can do here?

dark edge
sinful tree
# haughty estuary First time trying out multiplayer but having trouble playing my test level. When...

This is likely the bit of code that is throwing up that message, and it's from the GameInstance.

        if (EditorEngine->Browse(*WorldContext, FURL(&BaseURL, *URLString, (ETravelType)TRAVEL_Absolute), Error) == EBrowseReturnVal::Pending)
        {
            EditorEngine->TransitionType = ETransitionType::WaitingToConnect;
        }
        else
        {
            return FGameInstancePIEResult::Failure(FText::Format(NSLOCTEXT("UnrealEd", "Error_CouldntLaunchPIEClient", "Couldn't Launch PIE Client: {0}"), FText::FromString(Error)));
        }

The if statement sounds like the engine is attempting to travel, but its failing.
Have you tried restarting the engine and your computer? Make sure there isn't any VPN stuff interfering?

haughty estuary
# sinful tree This is likely the bit of code that is throwing up that message, and it's from t...

Thanks @Datura, I've tried restarting the engine and double checked VPN is not running but still got the same error message. I've managed to get a bit further by disabling the Run under one process multiplayer option in the editor preferences. I can run in listen server mode with more than 1 client but it takes forever to load the second client, not sure what's stopping both clients from running in the same UE process πŸ€”

sudden condor
#

@sinful tree To elaborate from earlier, here's how I find my camera in the world. I can confirm that if I place a one-tick delay before the "get actor" it works perfectly. Might just end up doing it that way if there's no simple solution. Idk why yours works but not mine.

hollow flicker
sinful tree
# sudden condor <@218956378654507008> To elaborate from earlier, here's how I find my camera in ...

No reason to pass "Get Game Mode" here. You can just call "Get Game Mode" in the controller.
You're also doing this a bit oddly as you're crossing whether you're wanting to know if its the server with the remote activation, so then a local playerstate could potentially be calling "Initialize Tank Player" when you maybe don't intend for them to be doing so?

I can't really comment more on the setting of your camera variable there - You'd need to show more of Initialize Tank Player function seeing as you're potentially setting that variable on both server and owning client.

sudden condor
sinful tree
#

You can call Get Game Mode anywhere. A player controller isn't a client. It's an actor. That actor can exist on the server and the client.

#

GameMode is also an actor, but it can only exist on the server, so if you attempt to Get Game Mode while running on the client, it will always return null.

sudden condor
#

Yeah I just thought it would be easier to pass it in and avoid any ambiguity

sinful tree
#

There's 0 reason to pass it. If anything it'll probably confuse others as you're indicating that there could be some Game Mode requirement to the function, but then you're also calling that function on a client in which the game mode cannot exist.

sudden condor
sinful tree
#

And here's part of the problem...

#

You're calling this on a client, Game Mode will always be none.
So if Game Mode is none (which it will be on a client), the cast fails. The cast fails, you're not properly getting your actor variable set on the client if you're attempting to access the variable on a client.

oak pond
#

I have some hud effects for when my players hit an enemy, but how do I reference back to that hud in multiplayer? when spawning the bullet projectiles, I got the instigator and set that as the player who fired, and got the hud from there, but its invalid in multiplayer

sudden condor
#

So do you think it'll resolve if I run on server

sinful tree
#

Game Mode only exists on the server.
You are calling the "Initailize Tank Player" event on both the server and the client.
Only the server has a valid object it is passing into the cast, so only on the server it succeeds.

grand kestrel
sinful tree
#

Red Line = Server execution path
Blue Line = Client execution path

sudden condor
sinful tree
#

Your issue your saying is the variable is set to none.

#

It's not being set to begin with.

#

Only on the server is it being set.

sudden condor
#

It is set if I delay it one tick, like I said

sudden condor
haughty estuary
#

πŸ€” Created a brand new blank project, changed nothing and straight away got listen server mode running with 1 host 2 clients no problem so there must be something wrong in my project.

sinful tree
oak pond
sudden condor
#

Not passing in the GM makes binding the killfeed event kinda ugly though. Oh well.

oak pond
#

yeah thats what I did

sudden condor
oak pond
#

cast to thirdpersoncharacter from instigator, got the hud from that, but its invalid in multiplayer

#

I said that

sinful tree
sudden condor
sudden condor
sudden condor
oak pond
#

...that is a good point

sudden condor
#

It's basically the same mistake I'm making right now lol

sinful tree
# oak pond cast to thirdpersoncharacter from instigator, got the hud from that, but its inv...

So I guess you're trying to make like a hit indicator to signify that the bullet the player shot hit an actual target?
You'd pass the character that shot the bullet as the instigator on the bullet like you said you're doing.
Create a "Run On Owning Client" event in your character - I'll name it "TargetHit"
On Hit In Bullet, cast the instigator to your character class > call TargetHit > Have that grab your HUD and make it display what you want.

haughty estuary
#

Fixed πŸ€¦β€β™‚οΈ No idea what was going on, ended up deleting all built files leaving just the Content, Source and Config folders then copied over the newly generated uproject file to my existing project (I disabled quite a few plugins in my project). Worked as expected after that, not sure which of the two was the problem (disabled a required plugin or bad binary/cached data.

oak pond
#

this even should have nothing to do with multiplayer I dont get it

sudden condor
oak pond
#

not in multiplayer

sudden condor
#

Can I see how you're grabbing it

oak pond
#

just in begin play

#

and the hud itself functions completely fine

sudden condor
sinful tree
#

When talking about the HUD in that document, WizardCell is talking specifically about the HUD class.

#

Creating a widget and calling it HUD and adding it to viewport on beginplay of PlayerController is fine, but you should make sure it's only being created on the owning client playercontroller.

sudden condor
sudden condor
# oak pond just in begin play

Using a HUD is useful though because it compartmentalizes all the graphics code into one place where you don't have to see it all the time.

#

and it's only run when/where needed

oak pond
#

I never even knew that was a different thing

#

how does this make any sense anway, its literally adding the hud reference to viewport, so it clearly cant be invalid

sudden condor
oak pond
#

yeah I tried that, it just gives me the name of it as Id expect

sudden condor
oak pond
#

ah, not there

#

just empty

dark edge
oak pond
#

none of the rest is to do with the hud its other begin play events

sudden condor
dark edge
#

Just show it, I bet it'll show the problem

sudden condor
#

seconded

dark edge
#

or show where you're getting the invalid ref rather if not there

#

Show
Event -> ??? -> Set HUD
Event -> ??? -> where it shits the bed trying to get HUD

oak pond
#

yeah its specifically on an event that just calls an event on the hud

dark edge
#

I'm betting it's some event that is running everywhere but the HUD is only valid on owning client

oak pond
#

literally just this, but its called from replicated bullet actors. the event still goes through fine though, but just invalid hud

dark edge
#

So that event is called on all machines?

oak pond
#

only to the player that fired the bullet

sudden condor
oak pond
#

I did that, same thing

sudden condor
#

dang well I'm out of ideas

dark edge
#

If you print the value of HUD how many prints do you get

oak pond
#

just one "server: " which is why Im wondering if its because its called from serverside bullets

sinful tree
dark edge
sudden condor
sinful tree
dark edge
#

idk i just click the gif icon here --------------------------------------------------------------------------------------------------------------------------------------------------v

#

only valid if you're on a tiny monitor

sudden condor
#

(removed because I found it annoying)

#

eyyy there it is

sinful tree
oak pond
#

I cant see any real differences with mine

dark edge
#

Since you have the server printing then you obviously aren't doing something right since it should only be running on owning client

sinful tree
oak pond
#

I did

dark edge
#

you can do clientside hits if you want

Bullet:
Hit -> LocalPawn = Instigator? -> yup -> tell it to show some stuff on HUD

sudden condor
dark edge
#

We really need to see the entire code flow to get an idea of wtf is going on, this is like trying to fix a car looking through a straw.

sinful tree
# oak pond I did

My guess would be that you're calling a "Run On Owning Client" event within the bullet itself rather than on the Character that shot the bullet.

oak pond
#

nope

#

the bullet gets a reference to the player to call its event, but the bullet itself is like serverside or something because I think it has to be

sinful tree
#

To call what event?

oak pond
#

that one in the player

sinful tree
#

This one?

oak pond
#

yeah

sinful tree
#

You've marked that event as "Run On Client"?

oak pond
#

doesnt make a difference but yeah

sinful tree
#

It does make a difference if what you're trying to do is replicate something from the server to the client.

#

Without it, the server is likely executing it, in which case the HUD is probably invalid.

oak pond
#

no but Im saying it still fails and does the same thing

#

I dont even know how

#

wait I changed something in the bullet itself which may have fixed it

#

weird, I still cant entirely tell why its like this but

#

I put it into another run on owning client event on the bullets but I dont know how thats working because who is the owning client in this situation?

sudden condor
#

I believe

oak pond
#

weird, because that was already happening on every players screen

open crane
#

What’s a good intro tutorial to multiplayer

dark edge
open crane
open crane
plucky prawn
#

Stop being rude

candid mulch
#

like to replicate it

open crane
#

Oh

open crane
thin stratus
#

I'm not even sure if the repo uses ResponseData to correct the Stamina on sprint or how it was done again. Would need to check. I think all examples use the compressed flags which is the easy version haha

candid mulch
#

it teaches you server and client stuff idk

open crane
#

Bad replication = bad game

woven basin
#

do you find an answer to this?

woven basin
#

did you ever solve this?

upper lily
#

can any one help me figure out this problem?

#
stable bluff
#

hello, im moving my actor on client and i want that change to be on server and on client as well. if i use run on server event the location change only happens of server, and if i just call the func obviously the server doesnt get anything. i looked at multicast but it says i need to run it from the server

#

is the only way to do it just calling the fucntion 2 times, on server and on client?

sinful tree
#

Assuming the actor was spawned by the server or placed in the map.

stable bluff
#

this?

sinful tree
#

Yep. The location then needs to be set on the server, and it should change for clients as well.

pearl bear
#

How can I replicate FGameplayTagContainer

#

in C++

chrome bay
#

Mark it replicated. Nothing to it

#

Note by default it can only replicate 64 explicit tags max.

#

If you have larger containers, you need to change the default in UGameplayTagsSettings

pearl bear
#

@chrome bay My data asset is on my asset browser, I am just passing it as a argument of the method

chrome bay
#

yeh kk. That should also replicate fine

#

TL;DR anything you store as an asset in the content browser is resolvable for replication, so any of those should send via network without problems

#

Going back to your first message in the extremely busy CPP channel, one benefit you might get from the map of tag->anim sequences is tags will probably replicate using fewer bits than a net GUID, so you might get some small benefit doing that.

#

But you have to opt-in to that behaviour in the gameplay tags project settings (enable fast replication or something).

#

Should really be on by default, but for whatever reason it's not

#

But really, my only point was that UObject refs are cheap to send - so if the issue was an optimisation one, DW about it too much

pearl bear
#

@chrome bay it worked, thanks a lot

fathom aspen
whole tree
#

how and where to learn Unreal Engine?

chrome bay
#

Talk about subtle details

twilit radish
#

Jambax saving Wizard without realising it πŸ˜„

twilit radish
# whole tree how and where to learn Unreal Engine?

If you want to get started with multiplayer in specific take a look at the pinned messages. There are some great resources in there. If wanting to learn Unreal in general I wouldn't start with multiplayer.

tight meadow
#

if an actor has bunch of replicated variables and RPC's but the actor itself is set to Not replicated, are those variable still going to replicate and RPC are gonna tax performance?

nocturne quail
#

what is bad if someone is using AActor as data for inventory items and C++ UStructs for BP Datatables in multiplayer game?

stoic lake
#

Hey for some reason the hello print string on the multicast only gets fired on the server when the "UpdateChat" gets called on the server, however it does get called on both the client and server when the "UpdateChat" is called from a client

chrome bay
stoic lake
chrome bay
# stoic lake this is all on the playercontroller btw

Multicast doesn't make sense on Player Controller. PC's are only replicated to their owning client. BTW AGameMode::Broadcast() exists for messages, but isn't exposed to BP by default. A tiny bit of C++ would allow you to expose it.

tight meadow
tight meadow
dark edge
nocturne quail
thin stratus
#

Which is kinda the fault of the person who coded that framework

chrome bay
#

If anything I'd expect the opposite

nocturne quail
#

eg: if our jump logic is only running from the server to clients on multicast and not listening for if locally controlled, pressing jump key will crash the editor

#

and honestly I like this Idea, the mp game should only work on multiplayer

chrome bay
#

That's not a good idea. What if you're making a game with online + offline play?

#

I'd fully expect single-player game to crash a lot of attempted in MP, but not the other way around

nocturne quail
#

I will build offline version seperately

chrome bay
#

But you can't if they are the same game

nocturne quail
#

from scratch

chrome bay
#

Just make the MP code not crash, it's far simpler.

#

If anything MP code should be less likely to crash because it's stricter

nocturne quail
#

combination of single/mp game is a good idea, but it will make the code bigger and stressful

thin stratus
#

@chrome bay I wouldn't argue, That's lost energy :P

chrome bay
#

Yeah, TL;DR, disagree

half umbra
#

hi

#

i try spawn Niagara from Actor on the map for everyone

#

when the player collide with the actor then it should spawn niagara but it doesn't, it only happens on the server which is weird because the code is run on the server then multicast but as i printed what happens after multicast is just a print string is on the server

#

someone can help?

#

i not spawning actor

#

i spawning niagara system

#

in actor

nocturne quail
half umbra
#

when i check Reliable

runic vapor
#

hey guys can someone help me make a easy kill count?

half umbra
#

then is ok

#

but this is only niagara system

#

i don't want reliable

runic vapor
nocturne quail
#

int32 killcount;

runic vapor
#

oh ok

nocturne quail
#

and you can show that variable data on the screen in a widget if you want

runic vapor
#

okok

sudden plinth
#

Matt aspland has got some good YouTube videos on ue4

half umbra
#

but when overlaping actor, then run this only on server

#

i want run this for everyone

#

but multicast don;t run for everyone

#

so why not replicated this system

haughty estuary
#

Hi all, when I place a replicated actor in the world at edit time (not spawned at runtime), is the server or the client the owner of that actor?

half umbra
#

this is projectile

#

projectile is REPLICATED

#

Movement also is replicated

#

someone can tell my why Print String is only on server

#

?

#

if i set multicast to Reliable

#

then is ok

#

but it should work for everyone anyway

#

without Reliable checked

nocturne quail
haughty estuary
#

It may be easier if I explain what I'm currently trying to do. I have a simple level with 3 replicated actors, the actor has a cube component that when clicked simply toggles a replicated boolean on the actor (rep notify). In the on_rep callback I'm updating a property of the cubes dynamic material (toggling brightness on/off). When I click on one of these cubes from the host I can see the cube brightness toggle on both the host and clients but when I click on one of these cubes on a client I only see the brightness toggle on that client. Do I need to bring in an RPC for this to work?

half umbra
#

all is call on server side

half umbra
#

server call to multicast event

nocturne quail
half umbra
#

i seee

tardy fossil
#

all actors are default owned by server so clients can't change any replicated info on them

half umbra
#

i run on server

nocturne quail
#

call server on overlap function and server will call multicast

tardy fossil
#

oh sorry i was responding to @haughty estuary

haughty estuary
# tardy fossil oh sorry i was responding to <@341229152654852098>

This is the current result with just a simple replicated boolean and toggling the material param in the on rep callback. I've tried a messing with a few variations of setting up an rpc but couldn't seem to get desired behaviour. Any tips on the flow to make this work from both sides? (both server and clients should be able to toggle the same cubes)

nocturne quail
nocturne quail
dark edge
nocturne quail
#

on-rep a state bool will be the best choice

tardy fossil
dark edge
tardy fossil
#

im pretty sure clients can call server RPC's on stuff they dont own

#

its client RPC's that need that

clear island
#

so make it reliable if you want to make sure it always works

dark edge
#

go try it

#

The RPC has to route through an owned actor. After it's on the server the logic can do anything since it's in the serverside version of the actor the RPC got called through.

#

PlayerController/Pawn:
Input -> Run on Server Event
Run on Server Event -> change the replicated variable

Cube:
Onrep -> do the thing

tardy fossil
#

oh i guess i missed that since i only call RPC's on things i own lol

nocturne quail
normal crypt
#

Hi. I have a question about time dilation. How should I replicate it? It seems like the rate of replication is lowered on the clients when I slow the game down. It makes movement very hitchy. While I slow the game down, I accelerate the players so that they move at normal speed. I also manually set the right dilation on the world and all players on all clients.

haughty estuary
#

Sorry, got dragged into a call. I believe @dark edge is right, I did some debugging earlier with different RPC methods and the cube actor would never execute the server rpc (unless it was the host). The RPC has to route through an owned actor. After it's on the server the logic can do anything since it's in the serverside version of the actor the RPC got called through. this feels like it's going to be the solution I just need to figure out where/how to call that server rpc (there's no pawn available so I'll test it out on the controller first and see if I get anywhere)

half umbra
#

Actor should be destroyed always from Server?

dark parcel
half umbra
#

if Actor was be destroyd on server then client still have copy?

tardy fossil
haughty estuary
#

@dark parcel yes, that would mean the hosting client can click the cube and it would run the rpc (on his machine since he's running the server), however from the client that isn't hosting they don't own the actor so the server rpc will not be executed. I'm just trying to change it a little now so that the click event in the cube gets an object owned by the current client (controller) and calling a server rpc from there passing the clicked cube actor along. I'll also try doing the same from game state, I think that feels like a better place for this rather than controller but could be wrong πŸ€”

dark parcel
#

You probably don't want to do stuff from the client outside the pawn and controller. It will open ways to cheat

dark parcel
half umbra
#

ok, is it normal that sometimes niagara shows up and sometimes not? always shows up on the server

dark parcel
#

you probably didn't spawn copies for the client

#

sfx should be local to each client

dark edge
#

from whatever event triggers the thing all the way to the bit where you spawn the niagara system

shrewd ginkgo
#

I make a name system for lobby but I want to see players name in game if I bring the crosshair on other players name how can I do it

half umbra
#

this is Actor

#

if hit player then spawn niagara

#

for everyone

#

if server

#

do important logic

dark edge
#

In what case do you want it to spawn the system and on which screens?

#

What mechanic are you actually trying to implement here.

half umbra
#

I want it to spawn in everyone

dark edge
#

You want the particle to spawn attached to which pawns on which machines?

half umbra
#

attached to Players

#

Instigator is a player who initiated the hit

dark edge
#

You want to see the XP on the instigator's pawn only or on everyone's pawn?

half umbra
#

or instigator pawn

#

but

#

everyone see this

dark edge
#

Make a multicast event GainedXP in your pawn class

#

have THAT show the particles

#

When the hit happens:
Hit -> Authority? -> yes -> call Instigator.GainedXP -> do other server-only stuff

half umbra
#

I thought about it too, but sometimes what I showed in the picture shouldn't work?

dark edge
#

What you showed in the picture is all sorts of fucky

half umbra
#

xd

#

ok, and multicast on actors that the client doesn't own then doesn't make sense

#

yes?

dark edge
#

Here's what your code is literally doing:
Hit happened -> check if you hit the instigator (?????) -> cast the hit actor to Character (you already know it is because it's also the instigator) -> spawn a particle system -> authority switch for some reason -> run on server RPC for some reason (you already know you're on the server version from the authority switch) -> unalive self

dark edge
#

only server can call multicast

dark edge
#

In fact you'll want 2 events:
GrantXP (this is just a normal event)
OnXPGain(multicast)

Anything:
??????????? -> Has Authority? -> call GrantXP on some character(passing in the amount of XP granted)

Character:
GrantXP -> do xp logic -> call OnXPGain(multicast)
OnXPGain -> do the visuals and sound etc

haughty estuary
#

Thanks for the feedback everyone, it works as expected though I'm going to keep experimenting some more, not entirely sure it's the best/correct way yet but it does what I set out to achieve so that's a win 🀘

dark edge
#

PC should talk to cube

haughty estuary
#

This was the final result. The part I was struggling with was getting the cube actor to call the server rpc but the hint from @dark edge The RPC has to route through an owned actor. was key to getting this first multiplayer test working!

dark edge
#

So that's just to use the ActorOnClicked event

#

not the worst but also not great, you could also do it from the perspective of the PC

#

PC:
Input -> figure out stuff (which cube if any, etc) -> call run on server event
run on server event -> ??? -> end up with something changing the bool

Cube:
Onrep_bool -> change stuff

#

If you have a bunch of stuff, not just these cubes, I'd probably start it from the PC

haughty estuary
#

I'll have a look a changing it up a bit, I went down this route just because I could quickly handle the clicks on the cube without figuring out how to detect clicks of the light cubes directly from the PC yet but if that's a better approach I will certainly look into it

dark edge
#

It's better if there's a lot more clickable stuff

haughty estuary
#

from a perf/mem point of view? Having one click handler setup on the PC rather than a click handler per light cube? or for other reasons?

dark edge
#

Yeah the click handler

#

instead of object telling pc it got clicked
pc making that call

#

then the objects can just be dumb actors with a few onreps and thats it

#

Now i wonder if you can manually call that onclicked event

#

that might be something worth doing, but it all depends

hollow flicker
#

Is there any way of hosting a multiplayer game as a listen server, when I cannot port forward on my own wifi? Ive heard about doing a NAT punchthrough but couldnt find any resources on it.

haughty estuary
#

Ooo, just discovered the set of functions for detecting what was clicked GetHitResultsUnderCursor[by|for]XXXX this could be handy from the PC within a mouse click handler!

dark edge
#

why can't you port forward?

haughty estuary
# dark edge Now i wonder if you can manually call that onclicked event

I feel if I'm moving the click handling into the PC then I'll likely remove the click event handler from the light cube completely, kinda makes sense now I'm talking about it with you, maybe later an AI controller pawn might touch a cube to light it up so it makes sense for the ai controller/pawn to just call toggle power or something on the light cube rather than imitate a click πŸ™‚

hollow flicker
hollow flicker
dark edge
#

Your options are pretty much forward the port or use Steam or EOS or your own code

#

You could also spin up a dedicated server somewhere but that's about as complicated

dark edge
#

your buddy can host if he can port forward

half umbra
#

can you explain me why multicast doesn't do print string for all?

dark edge
# half umbra

I would multicast in the character, not in whatever this is

hollow flicker
dark edge
#

is the actor replicated?

half umbra
#

yes

#

actor replicated

half umbra
clear island
half umbra
#

what I showed in the image is in Actor graph

half umbra
clear island
#

use reliable then

half umbra
#

nope

half umbra
#

reliable is not for visual effects

dark edge
#

motherfucker you already thumbsupped my explanation lmao

clear island
#

so you either use reliable RPC or replicated variables

#

choose

dark edge
#

yes but it'll usually go through unless the pipe is clogged, you don't want to prioritize cosmetics over actual gameplay-important stuff

#

not a big deal if a particle doesn't spawn or is late

clear island
#

yep

dark edge
#

I can't really think of a use case for a reliable multicast but I'm sure there might be one

clear island
#

for fast paced combat games it is preferable to replicated variables imo

#

(if its stateless stuff ofc)

#

using too many replicated variables also has its issues

haughty estuary
#

@dark edge Does this make more sense? There's now no click event handling on the light cube, all it knows how to do is toggle a replicated boolean which in turn updates the material when changed. The PC now handles clicks and if clicking on a light cube will call a server rpc on the PC which simply calls the toggle power event on the clicked light cube. I understand I could get interfaces involved here too so that PC isn't coupled to light cube. It certainly feels to be a better approach (rather than light cube knowing about clicks)

dark edge
#

You might want an interface eventually but yeah that's good

hollow flicker
haughty estuary
dark edge
#

You really have bit off a big old chunk

thin stratus
#

There isn't really any Multiplayer specific things with EnhancedInput

#

Maybe only that you should add Context etc. locally

#

But that's not IE specific :P

dark parcel
#

https://forums.unrealengine.com/t/listen-server-clients-animations-are-jittery-laggy/689493

Is there a fix to this problem? Like we can replicate it in any template

Epic Developer Community Forums

Host of Listen Server sees low fps clients’ animations incredibly laggy/jittery. I’m using default UE’s Character with Character Movement Component. Clients see everything just fine. I’ve seen a lot of post about this issue but little to none solutions, atleast none that would work. Does anybody have solution for this?

thin stratus
#

There was once, but I don't know how to do that anymore with recent CMC changes

dark parcel
#

When playing as listen server, other player animation looked raw. But Clients see each other fine

thin stratus
#

You would need to override PossessedBy in C++ and skip the ACharacter call

#

And then make sure the CMC isn't ticking the pose

#

But that doesn't seem to be that easy cause the CMC part got more complex

dark parcel
#

Hmmm

thin stratus
#

At least from the looks of it

dark parcel
#

Maybe dedicated server is the only solution

thin stratus
#

Dedicated vs Listen is not a matter of jittery animations Β―_(ツ)_/Β―

dark parcel
#

or dive deep into CMC for the sake of listen server

#

i will see what where fate bring me

dark parcel
#

no jitter what so ever

oak pond
#

has anyone heard of players camera rotation getting reset when another player joins? I cant tell if its something Ive somehow caused or something else

dark parcel
#

only Server see other animation "raw"

#

So if everyone play as client, it's a happy world

thin stratus
#

Well that's mainly cause you put the code into the wrong places

#

You could do BeginPlay if you lock it to IsLocalPlayerController

#

Or you put it into SetupInputComponet?

#

Lots of places. PossessedBy is Server only

#

So that fails the local player part, yus

oak pond
thin stratus
oak pond
#

I dont even know what Ive done this time, Ill have to look

dark parcel
thin stratus
#

Yop

dark parcel
#

thanks, will look into it

thin stratus
#

ACharacter possessedBy sets that bool that stop the server from ticking

#

iirc

#

Well ticking the pose

#

But I don't know about the tick pose anymore

#

That was one place before

dark parcel
#

@thin stratus bOnlyAllowAutonomousTickPose=false Do you mean this tho?

thin stratus
#

now it's different

#

Yeah

dark parcel
#

Because that doesn't really fix the problem. The animation will run as twice as fast

#

it's like depending on tick

thin stratus
#

Yeah cause you have the CMC Tick the pose :P

dark parcel
#

OHhhh

#

ok so I am probably missing that step

#

gonna SS this so I can remember

#

Thanks

#

am i gonna get into trouble for disabling pose tick on CMC?

thin stratus
#

Probably not

#

I'm pretty sure we shipped The Ascent with that

#

I mean

#

Originally it was one line that called TickPose

#

That was easy to fix

#

Now it's called in multiple places

dark parcel
#

🫠

thin stratus
#

And has its own weird function

#

I tried disabling that yesterday for something else and that was breaking stuff

#

Specifically for RootMotion, but still shite

dark parcel
#

Someone was saying to toggle it depending if root motion is playing or not

#

but that reddit post have since gone

thin stratus
#

Never got anything good from Reddit haha

#

Seems to be only good for placing pixels lately

#

But yeah, you'll have to play a round with it

dark parcel
#

πŸͺ¦

thin stratus
#

And probably see what the different TickPose calls are for

#

Makes no sense to remove somethign wtihout understanding it

oak pond
#

oh man I cant stand how things are always different for the host of a server man

#

how do you even generally fix that

simple bough
#

hi can anyone guide me how to use multi user edit in ue 5?

thin stratus
#

Buy your clients good PCs

oak pond
#

no like the way events work differently based on how theyre set up

thin stratus
simple bough
thin stratus
#

With docs I meant documentation

#

Documentation of Multi-User Editing

#

Not that you share the documents

#

:P

simple bough
thin stratus
#

There should be a getting started guide

simple bough
oak pond
thin stratus
#

Not sure I follow

oak pond
#

you know when you start a listen server and the other guy joins, events work different for host and client

hollow eagle
#

As a general thing? No they do not.

thin stratus
#

I mean there are some rules, but despite that, things work quite similar

oak pond
#

then how have I even accidentally caused that

thin stratus
#

No clue. You probably did something somewhere that is wrong

#

As stupid as it sounds, no clue how we would know what you did wrong

#

You will have to start debugging

oak pond
#

yeah Ive definitely done plenty wrong but Im kinda trying to ask about the general setup of this kinda thing because I thought that just happens

thin stratus
#

Camera Rotation, if you didn't do anything else, is probably following ControlRotation

oak pond
#

I fixed that, I dont mean that now

#

its several things, one being only the host can take damage (from enemies and other players) so not sure what needs changing in the bullet projectiles because enemies take damage in the same way and that replicates

thin stratus
#

You usually deal damage on the Server side and have a Replicated (or even RepNotify) HealthVariable

#

+- some local prediction if needed, but in it's most naive form that's it

#

Projectile Overlaps Target, ensure SwitchHasAuthority, call Damage interface, or whatever you use, on the Overlapped Actor

#

Isn't really rocket science

oak pond
#

ah, maybe Im just overthinking it, the actual damage event specific to the player wasnt multicast, must have been confused because of how Ive been working on the enemies recently which are server based

brisk fulcrum
#

How can i change level to all player

gleaming kite
#

Is there a delegate I can bind to for when an actor becomes net relevant (Either through first join or entering its net relevancy range)?

gleaming kite
#

Or actually better yet, can I make a rep notify only replicate/fire when its parent actor becomes net relevant?

gleaming kite
# dark edge Begin play

oh sweet, i didnt know it gets fired again when it becomes net relevant, that makes sense, thanks!

dark edge
#

Repnotify should do that already too, test that

#

I'm not 100% on it but I think the repnotifies should fire

gleaming kite
#

well i want it to only fire when becoming relevant and not after

#

ill just use begin play and make the var only replicate

sinful tree
#

If it's blueprint only, I think the RepNotifies will only fire if the value is different than what the default is, so depending, it may or may not fire when returning to relevancy.
Begin Play is the way to go to know if an actor is relevant.

brisk fulcrum
valid bough
#

Can someone please point me to the right direction on how to connect 2 clients together using the steam subsystem? I set up the SDK and what not, which the documentation for that is severely out of date.

#

Supposedly Steam OnlineSubsystem is broken in 5.0+ gotta use advancedSessionsPlugin?

mystic estuary
#

Does anyone know whether it's possible to know what was the previous map the game has taken place on?

mystic estuary
#

Sadge, I thought that there is some other way. All right then πŸ˜„

sinful tree
haughty estuary
#

Just reading through this document https://docs.unrealengine.com/4.26/en-US/InteractiveExperiences/Networking/Blueprints/ trying to make more sense of what sort of logic belongs on game mode and game state. This document had an interesting description for the game mode which I've not come across before (usually game mode is described simply as the rules/flow for the game) but in this doc it mentions a game rule about rocket launchers only and goes on to mention when randomly spawning weapons around the map on the server that this rule should be respected, would that mean in this scenario the game mode is responsible for spawning the weapons OR just that some actor owned by the server will ask the game mode about this rule to determine which weapon to spawn? Most game mode classes I've seen are quite slim, used for nothing more than just assigning default framework classes mostly.

sinful tree
soft cape
#

I am currently trying to get a host to pull in my party into a "Lobby" map. The host creates a session, then OpenLevel() and then calls a ServerTravel(). This works sometimes, but occassionally the client that travels get connection timed out. I notice the logs on the client-side don't really match up with the hosts'.

(Host Opening Lobby)

[2023.08.24-20.36.41:013][ 37]LogEOS: Verbose: CreateSession: Successfully created session 'Default'
[2023.08.24-20.36.41:057][ 37]LogNet: Browse: /Game/Maps/Lobby?listen
[2023.08.24-20.36.41:057][ 37]LogLoad: LoadMap: /Game/Maps/Lobby?listen

(Client Joining (Timedout))

[2023.08.24-20.36.41:377][454]LogEOS: Verbose: JoinSession: Successfully joined session 'Default'
[2023.08.24-20.36.41:378][454]LogNet: Browse: <ip-address>/Game/Maps/Launcher
[2023.08.24-20.37.01:409][757]LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = ConnectionTimeout, ErrorString = UNetConnection::Tick: Connection TIMED OUT. Closing connection.. 

I assume things aren't working because the map is not updated on the client side

haughty estuary
# sinful tree By default the game mode is responsible mostly for handling joining and spawning...

What about when it comes to processing rules such as win conditions. If we take team deathmatch as an example, that game mode may have a configurable value for team kills required to win, every time a player is killed the server would update the game state to +1 on a team scores, then is it the responsibility of the game state to check team score >= kills required or does the game state ask the game mode to do that check so that it can transition to the next state if a team has won? πŸ€”

sinful tree
#

That value could also just be stored in the gamestate directly by having the game mode setting in there in the first place when it knows.