#multiplayer

1 messages Β· Page 124 of 1

hoary spear
#

Id rpc the controllers with a delayed event from gamemode to owning clients

#

Via their playercontrollers

queen escarp
#

hmm yeah once i join 1 by one with time between

#

then everytihng worked

hoary spear
#

Its just...

#

Ye

#

This is a better way

queen escarp
#

yeah but obviously id want ppl to join at the same time so i have to add somekind of delay as u said

hoary spear
#

But you need tge widget to update slow enough

#

Youknow

#

Add the delay in the client widget

#

To verify

#

At the very start

#

5 sec delay

#

Plenty of time

#

At the start of update widget

queen escarp
#

ok

#

testing

hoary spear
#

Retriggerable

queen escarp
#

why retriggerable wouldent it only be localy tho?

#

and yeah that worked

hoary spear
#

Yepp

#

Well i guess it doesnt need to be retriggerable when GameMode got that checked

#

But nice, it works

queen escarp
#

yeh ! super thanks my man

hoary spear
#

So the repNotify is called before the objects are actually replicated

queen escarp
#

struggled with this for weeks!:D

#

will make a big diff for thje project

#

yeah

#

Also

#

unrelated to this

#

something happend to my widgets each time im opening them i up they get rescaled to 1080x1920 insated of 1920x1080

#

its super annoying

#

ive tried googling what the hells going on but with no luck

hoary spear
queen escarp
#

ty

dim barn
#

I will admit I didn't read the whole convo, so I might be missing context, but using delays to solve for replication lag is not a good solution.

#

If you are able to use C++, the GameMode class has a method "ReadyToStartMatch" that you can override to have full control over when the match starts and what conditions need to be met. For example checking the amount of players that are connected and ready to play.

hoary spear
#

^

#

But it verified the problem

#

Which is a first step πŸ™‚

#

I also think its not a match but mp were players come and go..

#

Just a guess from screenshots ofc

spare verge
tardy fossil
#

use controller rotation instead of the actual camera rotation, since they wont match up on the server

halcyon totem
#

is anyone here still on unreal engine 4.27.2???

#

what are you using for the internet

#

to connect multiplayer

ruby lodge
#

Why is the On Rep Opened Roof not executing for the clients?? It's the same setup for On Rep Lights On but that one is working

#

That's literally so unlogical

#

Now i put print strings at the start of both and as you can see the client isn't calling the roof one AT ALL

#

I made an entire new variable now and set it up the same way but that didn't work either. So I guess it's not some bug with this variable

#

I also tried to execute it with the IA_VehicleLights event but same result. Client doesn't execute it

#

Also tried it without the roof nodes and just the set material ones. Didn't work either. So it was literally a one to one copy to the lights one but the roof onrep just didn't want to play

blazing spruce
ruby lodge
#

oh my bad, i thought onRep gets called when the variable is set, not only when it's value is changed

#

that fixed it

#

thanks though!

hoary spear
#

Set bool to NOT bool if thats all you do πŸ˜„

#

That will toggle it on and off

ruby lodge
#

this is getting called each time a player joins or leaves. It adds a player arrow for each player. The problem is that is local player controlled kinda only checks if it's you who joined. So when a different person joins for example my minimap gets updated (and adds 2 arrows although it shouldn't add mine) and the one who joined doesn't get arrows added on his minimap at all. Now i am asking here because i think the "Is local player controller" node is wrong

dark sandal
#

Hey i have a question I have been trying to wrap my head around for afew days now, So i want to have a way to send a request from a server event to a client that will run an event on the client sending its info about itself back to the server. The problem being im using an interface for interactions and i dont want to add every possible variable i might need in the future to this interface as it will get massively cluttered, I have tried adding a player pin and inside the server event getting the variable directly from that pin but it doesn't seem to work

dark edge
half umbra
#

if i change some variable in Client Player Controller, not from server, then this variable change on the client only? and if after while i want save this variable on server, then if i get this variable from client it will be Default Value?

#

the client will simply have its own version and server.. yes?

#

and is it possible to send a "Map" type variable from the client to the server?

quasi tide
ruby lodge
sinful tree
# ruby lodge Okay, so update on this. Gamemode apparently is not available on clients. Right ...

Not sure if you're making the Player State array yourself as GameState already has an array called PlayerArray which is automatically managed.
The best way to handle whether a player is joining is to have Begin Play of Player State signal an event dispatcher that is present on the Game State that passes along the PlayerState that started. Your UI can first read the PlayerArray from the gamestate to get all current players, and then bind to the event dispatcher to know when any new players join. Your UI would need to keep track of the association of a playerstate to whatever UI it creates so you know which UI element belongs to which PlayerState.

Same goes for those leaving the game, you'd do a second Event Dispatcher call on the GameState on EndPlay of the PlayerState, then you can look up the associated UI elements that you need to remove based on the PlayerState that is leaving.

ruby lodge
#

i think the problem is with getting the rotation of all remote players

#

for the server it's working but the client can't see the servers rotation so far

gloomy axle
#

Sorry for the bump, but we're still running into this issue after more browsing and stuff

#

I found out the server command prompt doesn't even say if players join or not, but I can tell they do because we're both in the lobby level - which is only happening via client travel after joinsession was called

gleaming crane
#

anyone? πŸ‘€

gloomy axle
#

i was looking at it before delving into sessions, but i believe it's 4.9

#

im not sure tho

sinful tree
# gleaming crane anyone? πŸ‘€

I don't know if the full functionality is working or not, but I do know that if you add the plugin to your project folder, you can compile your project and that'll make it at least load and do some things with 5.2.

gloomy axle
#

honestly those plugins cost so much

#

saw a complete matchmaking plugin for $400

sinful tree
#

Advanced Sessions is a freely distributed one.

gloomy axle
#

is it?? thought it was paid :/

sinful tree
gloomy axle
#

wow im dumb

#

Can I do a mixed solution of using that to join sessions and using mine to create them

#

gotta check that out

#

cause creating and finding sessions on mine works pretty good

sinful tree
#

Probably. All this is doing is exposing some nodes to help with creating/joining sessions, it's not really providing much else.

gloomy axle
#

yeah it's like putting a UFunction on these custom methods, then zipping it up or uploading it to a public repo

sinful tree
#

There's a 5.2.1 version on that page too πŸ™‚

gleaming crane
gloomy axle
sinful tree
#

Can always try and if it breaks, put it back πŸ˜›

gloomy axle
#

Oh I see, yeah I'm currently trying to install AdvancedSessions, ill lyk how that goes

#

yep looked like the solution built fine when using just the AdvancedSessions

#

and not steam nor blueprint examples

graceful spoke
#

Hi idk why but my prelogin function is not being called at all but my postlogin function is working just fine

#

i'm not sure what the issue is

fossil spoke
#

@graceful spoke Did you forget a call to Super::XXX somewhere?

graceful spoke
gloomy axle
#

does AdvancedSessions not have a join function?

graceful spoke
#

but i don't see my debug message pop up at all

#

only debug messages for post login and init game

fossil spoke
#

@graceful spoke What if you breakpoint and step through, see where it fails.

latent basin
#

Hey all what is the correct way to replicate this crouch system?Im running the set capsule half height event on server and it is updated through a time line

#

Im struggling to get it to replicate any help would be appreciated

sinful tree
#

The actual equipping of the weapon would likely only happen on server side, so you could spawn the actor weapon on the client and play the montage, but that would be about all you'd want to do, and if the server disagrees, you'd have the client swap back to the previous weapon or handle it however you want.

hollow eagle
#

what do you mean "how"

#

do you mean in what situations?

#

do you mean you don't know how you'd tell the client "no you're wrong"?

#

err, you don't know how to interact with the object then?

#

interfaces

#

or just a base class

#

it has to know something about them

#

there's some base set of APIs that everything in an inventory can be expected to have

#

either because they all extend a single base class or because they implement an interface

#

or multiple interfaces

sinful tree
#

Here'd be an example of what you could do...
Overlap of weapon on ground > Happens on both client and server, yea?
Overlap > Has Authority (Remote) > Check if inventory can hold the item, if so, spawn the held copy of the weapon > Attach to player's character (Other Actor would have this reference to the player character) > Play equip montage > Keep reference to previously held weapon still.
Overlap > Has Authority (Authority) > Check if Other Actor can actually pick up the object, if so, add it to their inventory, and set it as the item that is being held which then replicates to everyone else. If not, have an RPC on your inventory component like "Reset Weapon" which then switches the weapon back to the original that is still being held according to the server.

latent basin
#

Does anyone know how to replicate set capsule half height?

#

Running it on server doesnt seem to work

sinful tree
#

Buying something from a shop shouldn't be client predicted nor do I think managing an inventory should be either. There's typically no point to it as only those with higher pings would notice and at those high pings they're not going to care so much that they couldn't buy a weapon faster, nor move things around the inventory snappily, but they expose you to a huge headache of trying to correct problems caused by trying to allow client prediction of these things and could result in confusion from players if it doesn't work perfectly. Like... It would suck to think I moved something in one inventory to another, but then the server disagreed about it but I closed my inventory before it was confirmed and headed out on my adventure and all of sudden got killed, losing an expensive item I didn't intend to even bring with me.

hollow eagle
#

I hadn't read the whole thing and was thinking you were talking about using like a quickbar to swap weapons, but for picking up or buying or managing inventory you absolutely do not need prediction. You should only ever predict things that need it. Anything beyond the minimal required prediction is needlessly complex for no improvement to a game.

sinful tree
#

Of my Pickup example? Just exclude the client side portion of the overlap and use the OnRep of whatever variables you're changing to trigger the spawn & montage.

hollow eagle
#

For picking up a weapon you just have the client send an RPC that says "I want to pick this thing up" and the server does the rest.

#

At most maybe you play an animation just to acknowledge that the client pressed a button in the meantime.

stable grotto
#

if a client spams (through fast auto clicker for example) a server event that has a branch and executes nothing does it really matter?

sinful tree
obsidian kelp
#

Is there no heartbeat by default for the server?

#

If a client's ping gets too high they get disconnected but as far as I can tell the clients just keep keeping on if the server dies

thin stratus
#

Clients should disconnect and be sent back to the original level if a server dies.

swift python
#

Anybody got an idea how to freeze an actor in place (stop the animation and movement) without using CustomTimeDilation? It's creating all sort of problems when there is latency

half umbra
#

LogNetPartialBunch: Error: Attempted to send bunch exceeding max allowed size. BunchSize=71912, MaximumSize=65536

#

some tips?

half umbra
#

Is storing variables about the number of widgets a player has in PlayerState a good idea? I would like to store data such as: widget number, title, number of widgets, etc

hoary spear
half umbra
#

BP interface doesn't wokr in PlayerState?

#

maybe I'm getting player state wrong

#

?

fiery wadi
#

Can someone answer me a question please? Not sure if this should go in C++ or Multiplayer

#
//Replicate this property using the OnRep_CurrentHealth() function
UPROPERTY(ReplicatedUsing=OnRep_CurrentHealth)
int32 CurrentHealth;

//Declare the function OnRep_CurrentHealth()
UFUNCTION()
void OnRep_CurrentHealth();
---------
.CPP FILE
//Implement the OnRep_CurrentHealth method. 
void ADeeabloCharacter::OnRep_CurrentHealth()
{
    //OnHealthUpdate just checks and updates the value on the server and if the health is 0 then     player is dead. 
    OnHealthUpdate();
}

//Send the variables needed to be replicated to the replication system
 voidADeeabloCharacter::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);

    DOREPLIFETIME(ADeeabloCharacter, CurrentHealth);
    //     DOREPLIFETIME(ADeeabloCharacter, MaxHealth);}
}
/*IS THIS ABOVE FUNCTION NEEDED AS THE ONREP_CurrentHealth triggers a replication using Rep-Notify ? and DOREPLIFETIME basically means we always want to keep this property uptodate not just when we "trigger" a rep notify??*/

Am i thinking about this correctly?

half umbra
chrome bay
#

Keep in mind OnReps don't fire on the Server. You only need to replicate the value if clients want to know what it is.

half umbra
#

The user can create multiple widgets up to 1000, and each widget will have a Title, Description, Photo and ID. I store data about the widget in an array, e.g. I have an array that contains 1000 indexes, each of which has the title, description, photo and ID. Even if the variable is replicated, I will get this error: LogNetPartialBunch: Error: Attempted to send bunch exceeding max allowed size. BunchSize=114862, MaximumSize=65536
LogBlueprintUserMessages: [BP_Organizer_PC] Server: Hello

#

someone can help?

ruby lodge
#

I am trying to replicate a vehicle enter/exit system. Let's focus on entering as a driver first. The problem right now is that when the client tries to enter a car he doesn't snap to it in the first place and doesn't possess it in the second. That's what the drivers entering process looks like right now in the vehicle BP. When the server enters as a driver it gets recognized correctly and everything goes as wanted

#

That's the On Rep function here:

#

I didn't change my character bp code yet and i don't know really if anything here needs to be replicated too and if so, then what and how? I only set the "vehicle" variable to replicated

half umbra
#

someone can help?

latent basin
#

Hey all can someone help me out to replicate this crouch system? Im running on server atm and its not updating, i tried multicasting before but it seemed like the wrong way and it was way to laggy in avg network condition simulation. What other way should i try to replicate it?

#

Im running the timeline custom event on input action crouch key

chrome bay
#

If this is static data, put it in a data table or convert to data assets, replicate the array of indices into the table, or link them with gameplay tags etc. Lots of ways to do this better but without context it's hard to know.

graceful flame
half umbra
#

user can change title, description, image etc

latent basin
#

I just want a smooth looking crouch and it would be ideal if i could use the prebuilt crouch but just smooth out the camera jitter

#

Couldnt really find any info on how to smooth it out without camera lag

graceful flame
#

c++

#
Epic Developer Community Forums

Article written by Ryan B. On Paragon we initially set up some of our abilities using UAbilityTask_MoveToLocation. It was the very first movement-related ability task, and is the most basic brute-force method of getting something to move. Ability tasks are nice in that you can have a clean β€œOnStart, OnTick, OnStop” functionality occurring on Au...

latent basin
#

Thanks i just cant use c++ for the project im working on atm

#

Probably a way to do it with blueprints since its just to smooth out the camera

graceful flame
#

That pinned forum post details the inner workings of the CMC

half umbra
ruby lodge
#

so when the server enters the car the client says accessed none for the marked player controller but the server still possesses the vehicle. The client on the other hand gives the same error but on the servers side and on top of that the client does not possess the vehicle. Any ideas why?

#

this in the pawn bp of the vehicle

#

that's the character bp (the character who enters the car)

chrome bay
#

Why not make it deterministic and just tell the client how many entries there are? Again hard to suggest without much context.

half umbra
#

but I have to tell the client what the current title, description, etc. is and the client can edit it at any time

half umbra
#

the client created e.g. 100 widgets with a description and title, and the server saved it, when the server restarts I have to load this data to the clients

#

I just have to load data such as title, description, photo, 2D vector, etc. for each widget, each widget will have different values ​​and with 1000 widgets, this data is huge

dusk orchid
#

you're being very generic with your questions what exactly is this data like specifically? When the game starts is the data always the same? What exactly is this array you're replicating? It's hard to help when you're so vague

#

show some code or screenshots

chrome bay
#

Ultimately you can't replicate an array of 1,000 elements made up of arbitrary length strings (which are also arrays), refs etc. Need to trim it down somehow.

half umbra
half umbra
#

UE5 doesn't have a system designed for big data?

#

dynamic big data

dusk orchid
#

is this being done in blueprints or cpp?

half umbra
#

blueprints

dusk orchid
#

if you literally just want to subdivide an array then

create a variable for how many elements you want to send
create another variable to keep track of what the last index was sent
create a temporary array that will copy elements from your data array from LastIndex -> LastIndex+BatchSize
update LastIndex += BatchSize and send the temporary array
you'll need to check for index out of bounds

fiery wadi
frail temple
#

Question, when you Spawn Actor and that actor is a Character that is controlled by AI Controller is it normal for the Owner of that pawn to be the AI Controller even if I defined the Owner on the Spawn Actor?

half umbra
#

I would like to run OnPostLogin in GameMode after BeginPlay, I have a problem because Event OnPostLogin is called first instead of BeginPlay

#

someone can help?

#

only if Server Controller load first

sinful tree
half umbra
#

but I still need to update the widget, and the server widget is then not available

#

this makes it difficult, why is it so stupidly done that the server controller when it joins the game is before OnPostLogin, it complicates a lot

#

how do I update the HUD for the server or clients now

quasi tide
#

This doesn't make it difficult. Your lack of understanding on the process is what makes things difficult.

chrome bay
#

Client HUD should update itself, GameMode shouldn't have anything to do with it

quasi tide
#

It makes complete sense to call OnPostLogin after the login

chrome bay
#

BeginPlay() is a match-state concept anyway

#

Not that anyone really uses that legacy match state stuff anymore

quasi tide
#

So much legacy cruft 😭

half umbra
#

ok, then maybe I'm creating the SaveGameObject in the wrong place and loading it in the wrong place, maybe I should load the game save from a place other than GameMode?

obtuse loom
#

guys is it better to multicast for each player or just run it all on the server

quasi tide
#

Not enough info to answer

#

They are used for different things.

knotty cedar
#

Not sure if this is the right place to ask this, but is temporarily spawning invisible actors with multiple capsule/sphere/etc. components considered the proper way to do collision detection for complex area-of-effect traces?

serene kestrel
gloomy axle
#

Hey y'all, I'm attempting to launch a dedicated server session via a batch file:
"C:\Program Files\Epic Games\UE_5.2\Engine\Binaries\Win64\UnrealEditor.exe" "C:\Users\\Documents\Unreal Projects\ProtoPlaneFootball\missile-ball\ProtoPlaneFootball.uproject" Lobby -server -log -epicapp="Server" -options pause
For some reason, when I set the gamemode of Lobby to my ServerGameMode (a cpp class of type GameModeBase) it can't login the user. However, if I set it to a regular LobbyGameMode GameModeBase type that's not a cpp class, it registers the player? Zero clue why, im using EOS

pseudo kernel
#

Anyone have any resources to smoothing out networked character movement under adverse conditions? I have emulated network conditions set, and notice movement is really choppy, including velocity driven animations playing way slower than they should.

plush wave
#

CreationTime for an Actor is not replicated

#

Is there like a NetCreationTime?

coarse patrol
#

how to store created session name or joined session name?
i am not able to store in player state bcoz after server or client travel, the value is erased

how it is actually done?
i need session name bcoz to register player on postlogin , that is after server or client travel

woeful trout
#

Hey can someone tell me how to make a multiplayer game using ip address or p2p or something else...

dark edge
#

making a multiplayer game is not something anyone can tell you how to do.

coarse patrol
coarse patrol
#

currently i am storing in game instance
ok so its a proper way to store session name

coarse patrol
frail temple
fervent leaf
#

Hey, if i create collisions in runtime for the player and attach them to the mesh for interaction with environment. Should the collisions be added and attached only on server and not replicate them at all. Then when collider hits on another interractable collision, i just sent data with OnRep to client and do the functionality interacting? Is this correct approach as I'm not completely sure how I should handle collisions on multiplayer.

radiant grail
#

wassup

half umbra
hoary spear
#

Subdivide the array to send πŸ˜…

#

Guess you wont know when its actually sent

thin stratus
#

How do you peeps handle any form of moving meshes? I know the CMC has Based Movement, but the base sort of has to be in sync.
However what does in sync mean here, given that the local Client would need to have sort of "Authority" over the position of said platform.

That can include a simple spinning disk on which one can stand, or some sort of constantly up and down going, elevator like platform.

#

The Platform would need to have the same Transform on the Local Client and Server in Timestamp X.
However that means the Platform is ahead on the local Client, so replicating any form of Transform from Server to Client would be wrong.

chrome bay
#

In CMC at least once you're stood on a movement base the transform info becomes relative to that base, so aside from a correction when you stand on and jump off the base, all is usually well

thin stratus
#

There are two issues:

  • A rotating Platform (a spinning Disk) could be up to 180Β° offset between Server and Client. If the Client steps on it, it will suddenly appear at the other Rotation, same with when jumping off of it. That's a huge correction and kinda strange to players.
  • A moving Platform viewed by multiple players. The Client 1 jumps on it, and wants to predict this properly, it would probably mean that Client 2 sees Client 1 floating and not in sync with the Platform
#

You are right that "all is usually well", but the correction you mention can be literally teleporting you to the other side of the platform :D

chrome bay
#

My initial guess is that each individual client would need to forward-predict all bases independently to match the timeframe thier local character is operating on (ahead of server by half ping)

thin stratus
#

So, would you sync the Platform to a point where, if viewed on two players, at the same time, the Platform is 99% at the same location.
Or would you do the usual normal replication, where both clients see slightly different results based on ping?
Cause the Server will replicate to the Clients with different pings, so they could be offset

#

Sequencer for example replicates in a way that, if you for example animate a train arriving with it, and you play it replicated on a client with 10ms and one with 200ms, both see it arrive in real life time at the same time.

chrome bay
#

I'd probably try initially to sync all bases so they are in lockstep with the local CMC, so forward predicted. AFAIK that would at least solve the local player correction when jumping on/off, or make the correction less noticeable

#

Wierd that I got this far into my career without ever dealing with moving platforms

thin stratus
#

Dude, same xD

#

"Hey, we want to add rotating platforms and one of those cats that move their arm up and down and the player can jump on it."

#

And I'm like... f*ck

chrome bay
#

Though yeah I do wonder if that makes the issue for third-party clients worse, because your platform is ahead by half ping, their positions are behind by half ping

#

So big initial correction when they jump on

#

Unless.. you also forward sim all client πŸ˜„

#

ooof

#

fck knows

thin stratus
#

Yeah with higher ping that means you might see other clients somewhere totally else on the platform or maybe even in the air

#

cause SimProxies probably don't do any Based Movement

chrome bay
#

oh arse, right

thin stratus
#

So the Platform on the Server is ahead and that just replicates the location back

#

sigh

#

Hopefully the new CMC solves this lol

#

5.4 where are you

fossil sphinx
#

Does anyone know how to use the Copy Properties function inside the PlayerState class? I am trying to use it to transfer data between two different player states, I hope ive understood its function correctly. I use seamless travel with a transition map and that appears to be working correctly, the Copy Properties function is called after I travel to the new level. When I try to copy the player names collected in one player state and then store them in the other player state, the values are empty, what am I doing wrong?

thin stratus
#

That should theoretically be all you have to do.

  • Requires Seamless ServerTravel (can't be a Hard Travel)
  • CopyProperties calls after the Travel on the **Old **PlayerState, passing in the **New **PlayerState

I use this extensively in Lobbies.

fossil sphinx
#

Hi Cedric, I have read your compendium, it was very helpful in understanding the structure of the unreal engine. I should add to my question that my PlayerState classes do not match. Unless I have to implement it with one common PlayerState, I created a Parent PlayerState and then assign one child to my Lobby GM and one to my Game GM, is this possible, to use Copy Properties to sync data at the parent level and children inherit it?

#

Or perhaps this is a stupid approach and I should use one common PlayerState, I anticipate there will be far more variables in my Game PlayerState than my Lobby Playerstate which is why I went with this two playerState approach

thin stratus
#

Yeah, I also have:

  • PlayerState_Base
  • PlayerState_Game
    • PlayerState_Lobby
    • PlayerState_Gameplay
  • PlayerState_MainMenu (if needed)
fossil sphinx
#

Ok im going to sound dumb, my excuse is im new to all of this. How are you achieving this? Do I call the Copy Properties function and cast to the base parent type and then set the variable for the parent class? (which is the screenshot I posted above), because the copy properties event always returns the old child PlayerState. Do I need to also call the Copy Properties function inside the child and assign data there? Would you be able to provide an example?

thin stratus
#

Ok im going to sound dumb, my excuse is im new to all of this.
Buddy, this Server exists to help. You aren't sounding dumb. I s*cked at this originally too and I still struggle with it nowadays and will probably forever. This sh*t is difficult.
As long as you properly explain your issues, follow instructions and don't ignore suggestions, you are all good. :P

fossil sphinx
#

Thanks πŸ™‚

thin stratus
#

This is what I do in the Parent

#

But setup is a bit different though, in terms of names, cause it's a Marketplace Project

#

I don't have another example

fossil sphinx
#

ok, the overridewith is for player disconnects?

thin stratus
#

Reconnect

fossil sphinx
#

gottya

thin stratus
#

On top of that I use this in the GameMode

fossil sphinx
#

ahhh I dont have the OnSwapPlayerControllers

thin stratus
#

It's also not needed for PlayerStates

#

I have that cause I also move data between PlayerControllers

#

That's data that I need when spawning a pawn

fossil sphinx
#

ahhh ok interesting

#

makes sense

#

to transfer data between PC aswell when needed

thin stratus
#

Here specifically

#

Can probably also do that via the PlayerState fwiw

fossil sphinx
#

yes if the player is transition to a dungeon for example

#

im with you

#

I appreciate your help, I will make some modifications using your examples as reference

#

Thank you!

thin stratus
#

I also do that, but I think that can be improved by now

#

It's cause I use that OnRep to show visuals iirc

#

But that's all besides the point

#

The CopyProperties should be enough

#

For what you are doing

fossil sphinx
#

hmm, ill try it now

thin stratus
#

I assume you are testing this outside the Editor in Standalone?

fossil sphinx
#

yep

fossil sphinx
#

Turns out standalone was the issue, I had the netmode set to Standalone, the Game Mode was set to New Editor Window. When I changed the Game Mode to Standalone the data copied correctly. Thank you for your help! The example for moving data between PlayerControllers is particularly helpful for the future.

dark edge
#

It's been years since I played but I remember GarrysMod being pretty smooth with crazy movement physics

thin stratus
#

The main point is that the CMC lives in its own small world

#

Everything outside of it is lost

quasi tide
#

Mover 2.0 πŸ™

#

We need an updated CMC-like thing to complain about

thin stratus
#

If you, from the start, design your engine to have more in mind than just the CMC, then things become easier

#

Might be worth checking if UT has moving paltforms

#

But I think they mainly have overlap driven ones and jumppads

hoary spear
#

Couldnt you sync them once and just run them at fixed speed / intervals on the clients ?

#

Guess there's desync hsppening over time but in a random mp match based game how mich drift can there possibly be

#

Over say.. 60 minutes

thin stratus
#

@hoary spear It's not that easy. Server and Client theoretically need to step on the world/relative location on said mesh in the same timestamp

limber gyro
#

is there any way to test rejoin behaviour in the editor?

thin stratus
#

You should be able to leave the game in the Editor

limber gyro
#

for example, some one gets disconnected and they rejoin

thin stratus
#

Just not quitting

limber gyro
#

how would i do that?

#

say i ahve 3 screen open

thin stratus
#

Press on whatever button in your game that makes you go back to the main menu

limber gyro
#

one one screen quits

thin stratus
#

You can't close the windows in PIE

#

That closes all of them

limber gyro
#

ye

thin stratus
#

Yeah, so send one back to the main menu

limber gyro
#

it should work normaly then

#

im using sessions, does it create a session automaticly?

thin stratus
#

No

limber gyro
#

so how do i rejoin my local session?

#

is it even a session?

thin stratus
#

if in doubt with open 127.0.0.1

limber gyro
#

i will try that

#

thanks

thin stratus
#

It's not a session in that regard

#

You just gotta be careful what kind of session you mean

limber gyro
#

i have the steam stuff going

thin stratus
#

An Online Session in PIE is usually not a thing

#

Well in PIE you def don't have the Steam stuff going

limber gyro
#

ok

#

makes sense

#

so PIE steam gets ignored and it goes back to the basic ipnetdriver thing?

thin stratus
#

And if you don't start as 3 unconnected players, host and find, and then join sessions (even if SubsystemNULL in PIE) then you don't have any session

#

Yes

#

It goes back to the SubsystemNULL

#

Which uses IPNetDriver,

limber gyro
#

thanks

hoary spear
#

Or any relatively high ping really

hallow echo
#

Is any one here who have experince to make a mobile multiplayer game

#

if any any one so pls dm me

#

i want to know that it work

graceful flame
#

Just ask your specific mobile multiplayer questions in here. You probably won't find someone willing to do 1:1 DM support.

#

Unless you pay them

mint stream
#

Hey, I am running into a weird issue where it seems as though my BasePlayerState is being initialized after the player controller on the client, but on the server the BasePlayerState gets initialized before the player controller. Is this how it is supposed to work or no?

limber gyro
#

dont take my word for it tho

mint stream
mint stream
# limber gyro i am not sure but i belive it is since the player state is replicated from the s...

UE Player State Initiation

Default (GPT-3.5)

User
In unreal engine when does the player state get initialized on the client in comparison to the player controller

ChatGPT
In Unreal Engine, the initialization order of the PlayerController and PlayerState on the client side typically happens in the following sequence:

PlayerController Initialization: When a player joins the game, the PlayerController is created on the client side. This occurs during the player's connection to the game, often in response to a player logging in or connecting to a multiplayer session.

PlayerState Initialization: Once the PlayerController is created, it then replicates relevant information to the PlayerState. This information can include things like the player's name, score, and other player-specific data.

The PlayerController is responsible for managing player input and interactions, while the PlayerState holds information related to the player's identity and game-specific data.

Please note that the exact timing may depend on your specific implementation and network settings, but generally, the PlayerController is created first, and the PlayerState is initialized shortly thereafter. This allows the client to handle player-specific data and interactions in the game.

Response from GPT

limber gyro
#

so it is by design instead of latency?

mint stream
#

But seems like it should be the same for a server as well.

#

Sounds like it

#

But I think that gives me a good reason to move my input out of my player controller so that I can assign ability System specific input

limber gyro
#

isnt the input suposed to be in the character? thats what the templates give u

mint stream
#

I think I was running into issues with character specific input or something so I had moved it, but even GPT says the PlayerController is responsible for managing player input, so idk which is the correct answer

dim barn
#

@mint stream PlayerState is created by PlayerController. So it comes after. On the server everything may seem like it happens instantly. But on client side you have to wait for these UObjects to replicate.
So on client side you could override the method that PlayerController has "OnRep_PlayerState()" and only try to reach the PlayerState after this one fires.

#

Also it's worth keeping in mind that by default PlayerState has a much lower net update frequency than say PlayerController. The state will only be considered for replication like once a second. While for PlayerController this could be done 100s of times. Meaning almost every tick depending on the FPS of the game.

#

That's why you're waiting longer for it on the client side.

mint stream
# dim barn Also it's worth keeping in mind that by default PlayerState has a much lower net...

Ahhh that makes sense. You're a saint. So would you know the best location to have player input setup? Should I do it in the controller, the character or like a whole new component class that is attached to the character?
Also, your suggestion on the PlayerState worked. I added a BindAdditionalInputs and moved my ASC confirm/cancel input in there and called it in the OnRep_PlayerState !

dim barn
#

A client can only RPC to server from an Actor that he owns. Which is the PlayerController by default. However any other Actor that is owned by the PlayerController, like PlayerCharacter, will also be able to RPC. This also includes all components they both have. Basically if the highest level parent of wherever you are trying to RPC from is PlayerController - you are good to go.

#

So from that perspective it doesn't really matter if you choose to handle your inputs from PlayerController or PlayerCharacter. It's up to you. The only consideration I would make is if you plan to have multiple characters that can be controlled using the same inputs. Then it would make sense to set them up in PlayerController, so that you don't have to duplicate code in multiple characters.

limber gyro
#

Does "InitNewPlayer" get called when a player rejoins?

mint stream
dim barn
limber gyro
#

unreal actually copies the player state back

#

if u reconnect within 300 seconds

dim barn
#

But the actors that the client owned will get destroyed. It's just that unreal will keep copies temporarily. You are right tho, that in this case he would not technically be a completely "new player".

#

Although I wonder then if it uses those copies directly after the player reconnects.

#

Or creates new ones based on the data in those copies.

#

Not sure about that one.

limber gyro
#

from my logs i dont see InitNewPlayer being called thats why i am asking

dim barn
#

If it uses those copies directly then maybe it's possible that InitNewPlayer wouldn't happen. Cause it gets called right after creating the player controller. But if it doesn't need to create it, then it wouldn't call it I guess.

hoary spear
#

Base rep time for state is 100ms isnt it

limber gyro
#

im gonna test it in a few minutes

rancid wren
#

I got a question about seamless travel and the physics animation component. I get a crash after the server travel. I was wondering if it's possible to seamless travel with a physics animation component without remaking the component in the new level.

dim barn
#

It's once per second.

hoary spear
#

Damn.

dim barn
hoary spear
#

Yeah was just sure i read 10 per sec

#

Apparently i was very wrong

#

Changed mine to 30 per sec

frail temple
#

So, multiplayer is turning into more of an issue than I expected.

  • Running the game from UE with 2 separate windows, hosting + joining works fine. I can do as intended on the game and it works smoothly (This is Standalone)

Issue :
When I give a copy to my friend to test so we can play against each other, it doesn't work as intended, actors don't spawn, UI doesn't update.
How can I figure this issue out? I can't exactly package after every change, send it to him, he downloads etc.

#

I love how many issues appear/happen after packaging and moving out of the editor πŸ˜‚

limber gyro
#

the way you phrased that is very generic, ur gonna need to show some code

#

and pick 1 issue at the time

#

if ur running steam u can try and upload it there and he can patch thats the easiest to to debug with other people

frail temple
limber gyro
#

not that i am aware of

frail temple
#

I know it sounds like such a generic thing, why is it things work smoothly in the editor then when you move away from that, it doesn't work?

limber gyro
#

ur just gonna neeed to package, zip and send

frail temple
#

What we've been doing

limber gyro
#

could be a few things

#

pick one issue and show code

frail temple
#

So pretty generic, this gets called from the PlayerController once all players have joined the game, the information gets sent over and spawns the actors fine within the Editor, once out of it, it doesn't spawn.

#

So the order it goes. Players join the game, they get added into an array, once all players join, the server loops through each PC and calls Start Game

Either I've done this all wrong or who knows!?

frail temple
#

Yup

hoary spear
#

Gm doesnt replicate

frail temple
#

Yea

hoary spear
#

Its server only

#

So server rpc is wasted

frail temple
#

For which one, on the controller or the GM

#

The top image was from GM

hoary spear
#

Ye the top one

#

Interface into server rpc

#

The only way the interface event reaches the gm is if its already running on the server

#

Which makes the rpc bogus

#

Shouldnt break anything as itll simply run on server , just letting you know

frail temple
#

Ok.

hoary spear
#

Its also confusing with the interfaces

frail temple
#

I was about to say, are interfaces "No Replication"?

hoary spear
#

As its as impossible as ever to know if its a server or client event

hoary spear
quasi tide
#

Correct

hoary spear
#

If you invoke it on client it runs on client etc

#

Also. Whats calling the spawn char?

#

Is thst the playercontroller?

frail temple
#

Yea

#

That no work I guess?

#

It sends all the information to the server and then spawns the character the PC has selected and possesses it

hoary spear
#

And youre also passing replicated variables through an rpc...

hoary spear
random hazel
#

has anyone worked with networking and level sequences? we are wondering the best way to synchronize a level sequence

frail temple
hoary spear
frail temple
#

Yea.

hoary spear
#

Do you have char selection in the game ?

frail temple
#

Yup, in the lobby_gm

hoary spear
#

Beside the lobby

frail temple
#

Nope

hoary spear
#

Cool

#

So server should own that info

#

Either as start match arguments or some persistant data ..

frail temple
#

User selects what they need in the lobby and thats it. I think it's because I saved the information to the "game instance" then I get that information and call it back onto the PC once it spawns back in.

blazing sinew
#

sorry for the disturb, I'm using Advanced Session Plugin (Steam), how can I make sessions joinable with a code? I tried that but not seem to be working

hoary spear
#

Not sure whats common but storing selection in game instance on the server should work

frail temple
#

That sort of stuff I believe should be saved on Player State or something like that right?

hoary spear
#

Unless you do... seamless travel

#

Im not sure what survives then

frail temple
#

Lobby > Main Game is seamless travel. I believe it does as this event works and not OnPostLogin

abstract pike
#

Has anyone else had an issue with 5.3 suddenly causing debugger objects to network differently? I've had this issue where Iris changes isOwnerRelevant on this debugger object.

#

Disabling Iris compilation has turned out to be very difficult if not running a source version. Anyone else happen to know a simple fix?

hoary spear
#

You need a session to find first

frail temple
#

I think he means something like Amoung Us?

blazing sinew
frail temple
#

I was going to try that at one stage but decided to leave it for another day.

hoary spear
#

Never played among us

#

What does by code mean..

frail temple
# blazing sinew Yes exactly

Could you maybe find all sessions, add them to an array then when a player puts in the "code" of that lobby/game it loops through the array and joins it if found - this is probably the brute force/wrong way of doing it

hoary spear
#

Listing a set of sessions is what I did

blazing sinew
hoary spear
#

Oh

#

I see

blazing sinew
#

I was trying to use a session property for that

frail temple
hoary spear
#

So code is a session id

#

Gotcha

blazing sinew
#

Exactly

#

I tried that bp to host a session

blazing sinew
#

I can't understand why that's not working...

frail temple
#

Have you made sure that the text box isn't returning an incorrect or null input?

blazing sinew
#

let me see... I let u know asap

hoary spear
#

do you have 2 game instances running?

#

like, with two different steam accounts?

blazing sinew
hoary spear
#

you must have that

#

it's required for testing this

frail temple
frail temple
#

Or is this where all my testing is going wrong?

hoary spear
#

havn't used it in 40 years but atleast back then i wasn't able to

#

i had to package and use two different pc's with two steam accounts

blazing sinew
#

ok, so I'll try it with two different physical client tomorrow, Idk if it's working on a vm too

hoary spear
#

vm prob is fine

#

just afaik you cant run two steam accounts on one pc

#

and even if you could, you probably couldnt reliably make it select the not currenlty used one

frail temple
#

Works for me, 2 stand alone games (Both editor and packaged) with steam shut, I can join/host games

hoary spear
frail temple
#

Yup

#

Advanced Sessions

blazing sinew
#

my ue version is 5.2.1

frail temple
#

It then acts as 2 different steam accounts and it game me a way to test it without my friend haha

frail temple
#

^

hoary spear
#

otherwise you'd not be seeing the issues you are seeing πŸ˜›

frail temple
#

I have the same issue tbh

#

I just tested it, they're not spawning sweat_smile_mirrored

hoary spear
#

lol x)

frail temple
#

but they're spawning in StandAlone from the Editor

hoary spear
#

for multiplayer,

#

i never trust what i see in editor

frail temple
#

^

#

I'm going to follow that

hoary spear
#

like.. it's probably fine ? but i wont know untill i've tested it packaged

frail temple
#

First I was doing it in PIE, then I had errors when I packaged and tried to play it, then I fixed what I had to, to make it work in StandAlone Editor but now it doesn't work in Packaged

blazing sinew
#

I try packaging it, the fact is that if I join a session with a code it joins the same session the first player created but has another code

hoary spear
#

ill try converting my project to see what happens

#

came from 4.23 or smth

#

i had no clue what i was doing back then, so even if anything works.. i'll be surprised

frail temple
#

That's how I feel right now, I feel like I don't know how anything works. I think I figure it out but then I'm right back to square one, like now

hoary spear
#

well it opened up

#

damn

#

stuff is still working

#

gotta try standalone

#

doesnt work in pie

frail temple
#

You know, an issue i've come across with Find Sessions is right after it gets triggered, it will still call the "Success" pin right away. @blazing sinew

hoary spear
#

mine fails to find any sessions without steam

#

but it might be how it's configured

blazing sinew
frail temple
#

Normally it takes a few seconds (15 seconds or a little less) to find all the sessions available.

#

Yea.

hoary spear
#

im filtering sessions through my friends list aswell

frail temple
hoary spear
#

dont ask questions about the code

#

x'D

frail temple
#

Mine is no better

hoary spear
frail temple
frail temple
blazing sinew
#

or I could find all the sessions and then check for each "Results" the code, if the code = to the textbox the player joins that session

#

on completed if not joined: no sessions found

frail temple
#

Yea

#

OMG

#

I think I found the issue, maybe

blazing sinew
#

really?

frail temple
#

For my game

#

For your issue, the only way I can think of it, is the ways we both mentioned. Go through each sessions (once all sessions have been found) and check for code

hoary spear
#

so

#

you can join session by list

#

OR by entering code, to shortcut the list, right?

frail temple
#

I think he wants to skip the list

hoary spear
#

right

blazing sinew
#

yes

frail temple
#

In amoung us, the list isn't visible, its more of a "private" or exclusive invite to game

hoary spear
#

this should just filter on the correct ones tho

#

can find session find other games sessions?

#

or is it foolproofed?

frail temple
#

Find Sessions finds all game sessions of your game.

hoary spear
#

yeah but not with the filters.

#

its gonna apply that before retuning your list

#

also , this is a thing

frail temple
#

Something of an issue i've seen though, is my friend is from the UK and I'm in Turkey, we can't see each others games hosted unless one of us use a VPN. Not sure if it will be a future issue or not.

frail temple
#

@hoary spear My issue is even more confusing now πŸ˜‚
So I fixed those few things you've mentioned. It works "fine" with a small map (literally a cube to sit ontop of) for both the CL and SVR but the second I go to the larger map I've made, it works for the SVR but not the CL.

hoary spear
#

Show the code

frail temple
#

Removed the Server Call from here like you said

#

and just changed the variables from replicated to not replicated.

hoary spear
#

Not saying they cant be replicated

#

just saying them being replicated means the server should own them, and clients obide by them πŸ˜„

frail temple
#

πŸ˜‚

#

So, I'm possibly thinking that this could just be an issue with the loading time of everything? Or not really and I just have crap broken code.

blazing sinew
#

it worked for me... the only problem is that maybe when there will be more sessions it will take more time to elaborate the result

hoary spear
frail temple
hoary spear
#

But even a large list here doesnt matter

frail temple
hoary spear
#

Youtube gives better info

frail temple
#

Ok

blazing sinew
#

Idk why...

hoary spear
#

Otherwise weird there would be an extra node for get extra settings, wouldnt you think?

blazing sinew
#

yea

frail temple
#

Well, isn't extra settings a Map(Array) and the filter is a Structure(Array)? Or that wouldn't make a difference?

graceful flame
#

Wow so I finally figured out why one of my characters was rubber banding so much! It uses the default character movement component and I had RVO enabled. Why? Because it's also used as a base character class which my AI characters are derived from. They are using RVO to avoid running into one another but if you have RVO enabled on a human playable character it causes crazy amount of rubber banding even with low emulated latency. The solution was to just simply only enable RVO for the AI agents.

frail temple
# hoary spear Youtube gives better info

I feel like I wouldn't need/use RepNotify. I have most things running on the Client side such as the units they own and buildings they own. Only thing the Server really does for me is Spawning Actors and Destroying them required. Unless the video that I watched didn't give me a good enough example.

hoary spear
#

Yeah im not dure what your game is really about so onrep might not always be the right method

#

Its usefull for stateful replication

frail temple
#

RTS game, spawn units & buildings, attack each other, collect materials.

hoary spear
#

Door being open as an example

#

Something like a building state

#

Would be onrep

#

If its damaged etc

frail temple
#

Clients don't need to know how much another Client or Server has, they just need to know What units are on the field and their location

hoary spear
#

Are you doing c++?

#

Or bp only?

#

For an rts i feel the former isnt really an option

frail temple
#

bp because I'm still in the whole testing/core mechanics phase. If I can't get it feeling nice/good within another week I'm scrapping it.

hoary spear
#

C++ gives you fine grained replication control

frail temple
#

Once I know where the game is going and myself and my friend like it, then I'll transition.

hoary spear
#

Control you simply wont get in bp

frail temple
#

The issue is, I don't know UE Syntax, so the second I get into, I get lost and confused because I don't know any of the functions or calls etc. Like I should know them from using BP for so long now.

#

Plus in the past i've used C# a lot more for work programming so I get them mixed up sometimes.

hoary spear
#

Ue syntax comes sooner if you force some c++ on yourself ^^

#

Well. Atleast that worked for me

#

After 5 years of bping

#

Then it starts simple with just uprops and bp exposure

frail temple
#

Ahhh ok, I'm in the same boat as you, it's been so long but sometimes I'm like "Coding this would have been faster"

hoary spear
#

Some simple functions to get going

#

Been doing c++ for 2 years now -ish

sinful tree
#

Then all of a sudden ....

frail temple
#

It all makes sense

hoary spear
#

Im at the peak of mount stupid in c++ yet

#

I implement almost everything there

#

Which is a bad tactic

frail temple
#

I don't like C++ too because the UE live coding never works for me and I need to always reopen the editor :/ OR IS THAT NORMAL!?

hoary spear
#

I mean..

#

I got a new ryzen + rider

#

Opening editor from ide is fast

#

Recompiling is fast

#

Usually a few sec

#

Live coding usually workd inside cpp files with no new vars decleared (?)

#

.h always must be recompiled withneditor closed

frail temple
#

See, I like to add like 1 new variable and then test it πŸ˜‚
That's my issue, 1 line of code, go test it, rinse and repeat

hoary spear
#

Yeah no πŸ˜‚

#

Bp it is then

frail temple
#

Yea hahaha

#

I'm bad

hoary spear
#

Untill .. you gotta move it for perf :p

#

Or that fine grained replication control

#

Its weird tho, replication stuff

#

Its mot really all that hard

#

But maaan did i struggle to get it

#

Before i got it

frail temple
#

I know, I swear it can't be this hard but my brain just doesn't want to understand the logic behind it.

hoary spear
#

Well.. i think I got it ... just like i thought the last time

#

And the time before that

#

The project i have with advanced sessions in it

#

Is my last attempt of mp, untill now

#

So... 3 years

frail temple
#

I haven't tried MP for like 2 years.
I thought I got it then but now I think I didn't haha

hoary spear
#

Going straight for an rts then is brave πŸ˜…

frail temple
#

I told my friend if we can get the core mechanics to feel good within 2 weeks (giving it an extra week now) we can do it, if not we're skipping the MP RTS and going to a SP game

#

It really isn't too much replication on the game though, a lot of it feels more Client side than Server other than spawning and moving.

#

Which is literally the most basic replication I can think of.

hoary spear
#

But theres tons of it

#

Every unit

#

Got more than a location stat

frail temple
knotty cedar
#

Is it a better idea to use Capsule Collision components over Static Mesh components when making custom collision shapes for 3d 'hitboxes' in online multiplayer?

#

Also is adding 3d 'hitboxes' directly to actor/character BPs as components a good practice in the first place?

hoary spear
#

So replicating what.. 300 to 2000 actors (depending on players * units per player) ,

frail temple
hoary spear
#

With their loc, health, bonuses,

#

Ranges are static known to server and client , unreplicated

frail temple
#

Yea

hoary spear
#

Only the server uses it ofc

frail temple
#

But see, a lot of the game itself is Client.

hoary spear
#

Ish, anyways

hoary spear
frail temple
#

I just need this issue sorted and I'm trying to see what is different between my "Test Level" and the "Main Level"

hoary spear
#

I got a casual city builder thing

frail temple
hoary spear
#

And maaan i cant even imagine multiplayer it...

#

Theres just to much crap πŸ˜‚

frail temple
#

^ pretty much me right now

#

I'm at the tip of the iceberg not under the water yet

#

@hoary spear Thanks for your help with trying to sort stuff out too. I'll get to the bottom of this!

serene kestrel
knotty cedar
serene kestrel
limber gyro
#

i have overriden 2 functions in the playerstate class so that i can handle reconection data, the problem is altough it seems that the data is being set properly its not showing in my scoreboard widget, like its not getting updated at all, but all the logic that runs with it seems to work fine

serene kestrel
limber gyro
serene kestrel
#

What functions did you override and what are they doing?

gusty valve
#

Hello!

I am making a multiplayer shooter and my weapon projectile base class has this functionality in it so that when the projectile spawns coming out of the player character camera, it ignores it.

Works beautifully on the server player but on clients the projectile is still colliding with the player character. I'm not sure why or how but if anyone has any tips or suggestions, anything would be appreciated.

icy jetty
gusty valve
icy jetty
#

I get that

#

So just the instigator

gusty valve
#

Correct yeah

#

not the character class

icy jetty
#

But normally when you do the ignore collision on a projectile you have to do it both ways

gusty valve
#

Both ways as in?

#

like in the collision settings of the mesh?

icy jetty
#

Like try dragging from instigator and set collision response to the projectile channel to ignore, assuming you have the projectile set to a projectile channel

gusty valve
#

I guess

#

overlap would still work?

icy jetty
icy jetty
#

Sry I think I rmbr

#

For some reason I misread the target as the PMC but it’s just primitive component.

#

So add another ignore actor while moving but with reversed inputs

#

So target actor is self and the target is your instigator’s mesh

#

Or whatever collision component it has if applicable

#

@gusty valve

gusty valve
#

Any specific order?

#

like should I do player first then projectile?

#

or would they execute on the same frame

icy jetty
gusty valve
#

No luck

#

tried several combinations

#

It just feels like my character is getting shoved slightly out of the way when a projectile spawns. Like they're occupying the same space.

#

Confirmed it's only when it's projectile weapons... Line trace weapons do not move me

harsh zinc
#

Hey Everyone, so I'm getting started with Multiplayer with UE5, does anyone have any good tips, tutorials and resources? I'm planning on working with AWS or PlayFab.

icy jetty
#

Try not to connect streams behind nodes it makes things harder to read. But if you rmbr I said your target should be Self on the second one

#

You plugged in the marine base actor and its mesh instead

gusty valve
#

Oh shit

#

I thought just saying "ignore instigator" would justy take care of that

icy jetty
#

And also you have 3 nodes should be only 2 πŸ˜€

gusty valve
#

Because I was trying to ignore both my first and third person meshes

#

because I didn't know which one was blocking it

icy jetty
#

Where is this code what bp?

gusty valve
#

the projectile base class

#

BP_WeaponProjectile

icy jetty
#

Ok. And what does get instigator actually return at runtime ?

gusty valve
#

Will check

#

Instigators appear to be working correctly

icy jetty
#

Is your player character the marine base?

gusty valve
#

Yeah

icy jetty
#

Ok, and you have 2 meshes on it that both need to detect collision with incoming projectiles ?

gusty valve
#

Server message after server shoot (Server is BP_MarineBase1 according to the world outliner)

icy jetty
#

That’s fine

gusty valve
#

good point

#

first person is only owner see

icy jetty
#

Ok, so have just 2 nodes then

gusty valve
#

yeah good point

icy jetty
#

First one with target being projector mesh and actor being marine base, second one with target being the 3rd person mesh from marine base and the actor being self

#

Make sure there’s no other collision on the projectile or the marine base that can cause a block

gusty valve
#

whoops should ignore should be true

icy jetty
#

Yep

gusty valve
#

Still getting projectile pushback

#

Sad!

#

checking projectile mesh collision settings now

icy jetty
#

You said the other mesh is owner only see, but does that turn off collision for sure ? I haven’t played with that yet

gusty valve
#

it's owner no see but it also is just set to have no collision

icy jetty
#

Ok good

gusty valve
icy jetty
#

Does the projectile have simulate physics on?

gusty valve
#

No

#

Should it?

icy jetty
#

No

gusty valve
#

F

icy jetty
#

Does the capsule have collision settings I can’t rmbr

gusty valve
#

Some custom stuff but it's set to ignore projectiles

icy jetty
#

Right but does the projectile know to ignore it?

gusty valve
#

Haha that feels like a philisophical question

icy jetty
#

Actually the ignore actor should cover that

#

If the capsule is ignoring the projectile already

#

That last screenshot never loaded for me so I’ll have to take your word for it πŸ˜€

gusty valve
#

For shits and gigs I turned off all collission on the projectile and it's still doing it client side

#

this is beyond strange

icy jetty
#

Only on client side tho?

gusty valve
#

Yeah this issue has been 100% client side

icy jetty
#

Ig we’re back at the multiplayer issue, sounds like a replication problem

gusty valve
#

should the mesh be replicating as well as the base actor?

icy jetty
#

You might need to put this code in a separate event that executes on all, but not sure

#

You’re in the right channel for it tho πŸ˜…

#

Sry for taking you on a wild goose chase there, I had a similar issue but only because I hadn’t set collision ignore both ways

gusty valve
#

No I absolutely appreciate your time on this. This is easily the weirdest issue I've ever encountered with UE....

#

Feels like it shouldn't be this complicated of a fix...

gusty valve
#

It probably is however time to call it a night. Thanks for the help!

icy jetty
#

Np same here

burnt wadi
#

Hey guys, I am trying to learn about multiplayer in Unreal Engine, Right now i am learning p2p connections through steam but ultimately I would like to know how dedicated server works for UE, For that i wanted to ask is it beneficial to first learn how p2p works and start learning about dedicated servers or I should jump straight into learning about dedicated server?

coarse patrol
#

i think it doesnt matter ryt now
learn unreal engine networking framework first

burnt wadi
blazing sinew
#

hey guys, I'm using Session Advanced Steam plugin, how can I get the current session I'm in as result (something like a "Get Current Session" node)? (I would like to make "Get Extra Settings" after and get some settings I need)

#

in bp

frail temple
#

Isnt there a node for that "Current Session" or something like that? You can pull extra settings from that, I can check at the PC. @blazing sinew

#

Get session settings (I think it might be that)?

#

This is from the plugin documentation.

frail temple
#

All good, I only knew about it because I've had to use it before haha.

frail temple
#

@hoary spear So I've found the "issue" and I just need to research how to fix it now. It seems to be, once out of a certain radius from where the player spawns, the actors are no longer replicated.

hoary spear
#

Isnt that the relevancy?

frail temple
#

Would it be the Cull Distance?

hoary spear
#

But it shouldnt be from player spawn should it...

#

Erh this is an area of networking i have not yet come to πŸ˜…

frail temple
#

It should be from Viewport but it isn't

#

tbh, I thought I'd never need to worry about that stuff, I was wrong πŸ˜‚

hoary spear
#

Hopefully someone with knowledge chimes in

#

Id expect relevancy being centered from the local player tho

frail temple
#

In the meantime, I'm just changing stuff and testing, seeing what it changes etc

hoary spear
#

Not playerstart

frail temple
#

It might have to do with the camera being offset from the character.

#

So if I make the character move instead of the spring arm + camera it may fix that issue

hoary spear
#

that's what i'd expect ut i dont really know

frail temple
#

Man, feels good to wake up and find out the issue πŸ˜‚

#

Ok, so I tested the world offset change, that did not work. Changing individual actors "Net Cull Distance" to max worked.

frail temple
hoary spear
#

wild guess xD

frail temple
#

Really? haha

#

I just set it to always relevant, which is right but in the future I will have to change it when I add Fog Of War into the game and need to change when it can and cannot be seen.

final thicket
#

I was once told that size required to replicate an array was at least 16 bits + the contents of that array, is that true?
The 16 bits is all that's required to indicate the length?

hoary spear
#

if the size of the array is limited to 16 bit, then perhaps?

#

i'd expect 32 but idk πŸ˜„

#

" Arrays use int32 as the base for its index, so this constraint is the first one and is architectural "

craggy walrus
#

Does anybody know a reason why a client enhanced input component wouldnt fire events?
the setup is as follow:

  • using unreal editor built in "Number of player" to setup client and server
  • server is also playing
  • 1 client 1 server
  • they both have a simple pawn that has WASD bound on a move function
  • the input component calls moveFunc which does the move locally then send it to the server (which in term send back a position to resync)
  • moveFunc is never called on client but works fine on server.
  • the line binding the action is called twice when trying to debug, I assume it's bound both on server and client (the second one happens after a while, after the console yields the join success)
  • Client is correctly connected (server pawn is moving on client POV)
teal frost
#

Server is king.
Anything the server does will be seen and essentially be replicated to clients.
Client actions must be sent through the server to be seen by others

craggy walrus
#

I mean, replication aside, the client does not even go to the function

#
EngineForce = in.X * EnginePower;
RotationThrottle = in.Y;
DrawDebugString(GetWorld(), FVector(0, 0, 150), TEXT("DING"), this, FColor::Red, 0.5);
Server_MoveFunc(in);

this is bound to WASD, the client never gets the ding (nor breaks on the bp)

craggy walrus
#

actually no binding works on the client, I tried adding a simple space bar func to test and same drill, server can use it but the client can't

#

The client is spawned as simulated proxy

grizzled stirrup
#

If you have an empty array of a struct that is inside another replicated struct, is that empty array using up any bandwidth when the owning struct replicates down?

fathom aspen
#

Probably the fact that it's empty?
Best way to know is if u profile

limber gyro
#

@fathom aspen sorry to tag you but since your here i tought i might, i was reading your article on persistent data on reconnects and i have a few questions

#

but first let me say thank you for writing it

quasi tide
#

Woah woah woah - don't ask him about those articles. As him about Lords of the Fallen 😈

#

(I jest I jest. Friendly jabs)

fathom aspen
#

Indeed, I'm all lords now βš”οΈ

limber gyro
#

anyways i was following the article and from what i gathered u only need to override 2 functions to have persistent data between reconnects done the "engine way"

#

is this correct?

#

the functions are "CopyProperties" and "OverrideWith"

fathom aspen
#

Those are the typical ones yes

limber gyro
#

so after "OverrideWith" is called is the new data suposed to be available in the "PlayerArray"?

#

cause im not being able to get that in my score screen widget

fathom aspen
#

OverrideWith you don't use it to persist data no

#

You use it to override data after you reconnected back

#

It has an unfortunate documentation, but I explain that in the article

#

You rarely use it sort to speak

limber gyro
#

from what i understood you use "copyProperties" to store the data

#

and then when the player reconnects "OverrideWith" is called and u put the data u stored back

fathom aspen
#

No, OverrideWith you use it to override the stored data with new data that you think are relevant now

#

Say a player disconnects, and then when they are back, the teams switched sides

#

You have to update the player with this new info rather than count on the stored one

#

That's what you use OverrideWith for

limber gyro
#

oh so "CopyProperties" should be enough?

fathom aspen
#

If you look at its default implementation you would see what it overrides the player with

#

It overrides the name just in case it was changed

#

And a bunch of other nonsense stuff

#

Yes

#

You were probably overriding the player with the wrong/default score

limber gyro
#

thanks, i will check this out when i get back home

#

your article was very helpfull, please dont ever stop writing unreal stuff

fathom aspen
#

I'm hoping so, but you know life priorities...

#

Thanks tho for finding them helpful, makes me extremely happy

surreal plaza
#

I had planned on working through a c++ tutorial on matchmaking to build out my EOS front end by hand. However, it sounds like modelling it after Lyra is a better choice at this point. Am I reading that correctly?

gritty marten
#

Hi folks, I've got a question in regards to ServerTravel/OpenLevel. I am currently playing around with Creating sessions for multiplayer games and I am facing a problem where the BeginPlay of the gamemode of the level that I am loading in is not being triggered. Any ideas what might be causing it?

I am following a course where the course leader is showing how to load a new level as a listen server, but the issue is that the new level is being stuck at GameInputModeUIOnly and having the mouse cursor on. The solution to the problem according to the course is by modifying the loaded in Level Blueprint's begin play. I am not a fan of this and thought having a custom game mode would be enough to replace whatever is being done in the Level Blueprint but alas I can't get a break point to trigger in the Begin Play of the game mode.

Thanks a lot in advance!

gritty kestrel
#

Hey guys HELP ME OUT!! I am using this OSC plugin and it gives me some data at runtime. What happens once I start receiving data everything then happens in server only for example it works in standalone mode, listen server mode but it does not work in client mode. I debugged it then found out like debug msg is coming only from server and not from client how can I replicate that for client also?? for listen server everything is working fine

hoary spear
#

So a client can't and should definetly not rely on logic in a gm's beginplay

#

If its not even running on the server, thats ofcourse another braintwister

gleaming kite
#

Is it a safe approach to use the hashed transform and class name as a net addressable path for replicated actors? I know the typical approach is to use some sort of counter on a global manager but im dealing with a scenario where that isnt possible.

serene kestrel
gleaming kite
#

they wont move also, so this is fine

ruby lodge
#

So i am running this inside a run on Server event and the default value of both IsCollisionEnabled and IsCollisionEnabledLocal are set to -1. I am trying to call the onRep each time it is set to 0 but it wouldn't call it if it's value wasn't changed. That's why i am setting the variable to -1 first and inside the On Rep i have a branch that checks if it's == -1.

The problem now is that when the server runs this and then a client that it doesn't run the On Rep function for the client and I don't know why?

serene kestrel
gleaming kite
serene kestrel
#

You need some way to uniquely identify your procedural generated Actors/Objects. It seems that for you that might be your Transform+Class name combo, so when you generate the data then spawn your Actor/Object with a name that includes your Key (Hash of those two inputs as you mentioned). As long as your client and server generate the same exact object name you should be able to use it as a stable name

gleaming kite
#

ah right. When you mentioned key and name being different I thought i was missing some info NetGUIDs, misunderstanding on my part, thanks!

young spoke
#

will unreal perform the network id lookup automatically if i try to rpc a TArray<AActor*> ? if not i can just do TArray<FNetworkGUID> yeah?

serene kestrel
ruby lodge
serene kestrel
#

If you want some kind of event to ensure the client receives it, use a Reliable RPC instead

ruby lodge
#

But I need on rep for players joining later on to see the state of what happened in this on Rep logic

serene kestrel
#

When players join later, when BeginPlay is called on the actor, they will have whatever the initial state of the values were on the Server, so just check it there

ruby lodge
serene kestrel
#

which value, one of your values is replicated (the one with the on rep)

ruby lodge
#

It's also not only about joining. It's about when it gets relevant to a player like they get closer to the scenery

#

So they would have already executed their begin play long before that

ruby lodge
serene kestrel
#

Replication (specifically on rep) is not going to handle that case for you, maybe explain what it is you're trying to accomplish at a high level, then I could provide some advice on how to go about doing that

ruby lodge
#

Oh boy I have a whole folder prepared with Screenshots of my code and a vid of what it looks like rn in game

#

Sent it to some friends

#

But if you want I can share it with you too, If you would give it a try

#

It's about the replication of a vehicle entering and exiting system

serene kestrel
#

Okay, what is the problem you're trying to solve specifically with this collision replicated value?

ruby lodge
#

when the player enters their collision should be disabled, they should be attached to a socket of the car mesh and their state should change to a driving state which should trigger a driving or passenger animation in the anim bp.

This here is all my code and a in-game test regarding the replication of a vehicle enter/exit system. I would appreciate any help ❀️

#

take a look

#

I have been trying now for days and days

#

Please i would love any advice if you have an idea

serene kestrel
#

The Scene components should already support replicating their attachments so you just need to attach it on the Server and the client should receive that. I don't recall if the same is true for the collision right now, but in the case you can just use replication to set the collision off when the OnRep happens, or check it on Begin Play and disable it (when Actors become relevant to a client, they get spawned on that client so you can just check in Begin Play in that case and disable the collision)

#

Make sure your scene Root is replicated then the attachment should replicate

ruby lodge
serene kestrel
#

Sorry, whatever component you are attaching to the vehicle, make sure that one is replicating it's attachment

ruby lodge
#

so it's not directly a run on server event. It's an interface event

ruby lodge
#

I tried to structure the code and clean it up kinda so that it's not so overwhelming. I also shared all necessary information inside the provided material

#

Flying over it should give you a quick understanding on what I tried to achieve with each part. If you have any questions let me know

serene kestrel
#

Okay, I forgot the attachment replication is on the Actor itself, so if your Actor is replicating, calling AttachTo<Component/Actor> will replicate that attachment. Getting in and out of vehicles in a multiplayer game should be a server action, I wouldn't attempt to predict it on the Client until you get it working without prediction at first

ruby lodge
#

The Interface function is called through a run on server event inside the character bp

#

don't focus on this attachement only

#

There are some fundamentally wrong approaches that I made I guess, but I am too unexperienced with such complex code to know what the problem is. I have worked on many more simple multiplayer functionalities but at some point you gotta aim higher right xD

ruby lodge
# ruby lodge

If anyone else wants to give it a try. Here it starts

latent basin
#

If you are going to make a map vote system, so the players all click buttons of maps and a integer stores the number of votes each map has, where should the integer be stored?

#

Game instance?

#

Or the game state

quasi tide
#

I'd say game state. Especially because game instance isn't replicated.

latent basin
#

It doesnt need to be persistant anyway

#

Ok thanks im going to give it a try

latent basin
#

Hey all, i have a widget where if i click a button, it calls a event call vote in my player controller, this then casts to my game state and then increments integer map vote count by 1 run on server reliable. Map vote count 1 is replicated and my game state is also replicated. Any help appreciated thanks

sinful tree
latent basin
#

Hmm so is the base player controller not the right place to call this?

sinful tree
#

Your run on server event can't happen on the gamestate.

#

It can happen on your player controller

latent basin
#

Hmm okay

#

Where is a good place to store votes?

#

Players should be able to vote and the votes are the same across all of them

sinful tree
#

Gamestate.

latent basin
sinful tree
#

But the RPC to the server has to happen on an actor that is owned by the client

#

Click Button > Run On Server event on Player Controller > While running on server, get game state, store vote.

latent basin
#

Like set it and increment?

sinful tree
#

Whatever you mean by store vote.

latent basin
#

Oh i just meant increment it so that all other players see it incremented

#

I tried to set it now with map vote count + 1, set that as map vote count 1 but it just ran locally

#

Thanks its working on beginplay of the controller i think its just because im calling it through a widget

#

appreciate your help

#

Ah figured it out

#

I was using get player controller instead of get owning player

gloomy axle
#

I'm getting the weirdest bug when launching a standalone game, if I set my DefaultOnlineSubsystem to Steam in DefaultEngine.ini, I get the following crash log:

LogWindows: Failed to load 'aqProf.dll' (GetLastError=126)
LogWindows: File 'aqProf.dll' does not exist
LogProfilingDebugging: Loading WinPixEventRuntime.dll for PIX profiling (from ../../../Engine/Binaries/ThirdParty/Windows/WinPixEventRuntime/x64).
LogWindows: Failed to load 'VtuneApi.dll' (GetLastError=126)
LogWindows: File 'VtuneApi.dll' does not exist
LogWindows: Failed to load 'VtuneApi32e.dll' (GetLastError=126)```
gloomy axle
#

ive been having this issue for the last two hours or so :/

gloomy axle
#

unfortunately same result

#

at this point i tried 10 different solutions

#

tried a few more, no luck

#

gonna try verifying files

gloomy axle
#

holy hell that fixed it

#

1 hour later

blazing sinew
#

sorry guys, do u know why in the editor when I host a session from a standalone, I can find the session from the other standalone but when I package the project and try it on different computers the find sessions advanced seems not finding any session?

frail temple
#

Different steam accounts?

blazing sinew
#

yes

#

the session actually can be found by the other client when I insert the code, and I can join that, the problem is that is not found by the find session advanced when I search for all the sessions

#

cause that actually works

#

but can't do it with the list, by finding all the sessions

frail temple
#

It's pretty much the same as my setup, the only difference is you have a bool included. I'm not at the computer right now πŸ˜…

blazing sinew
#

that variable is used by me to disable many buttons

frail temple
#

Close steam and run two copies on the same computer. Check if that works (it's the same thing pretty much)

#

Use the packaged game. If that doesn't work, it could be a similar problem I have but it should work. Is it the same network or different?

frail temple
#

Do you need that get owning player for the widget? I had an issue using that or get player controller.

#

You give it the usual 20/30 seconds to load the sessions?

#

Also, add a string to the end of "add child" to see if it's finding the sessions. It'll let you know if it's finding it or not.

blazing sinew
#

actually on the same pc with steam closed its working

frail temple
#

Should work then with two different computers.

blazing sinew
#

I'll try that again with the other computer

frail temple
#

It might just take a while to load the widget, it does for me and my friend.

#

That's when it goes through steam, through the same PC it still takes a little while (8 or so seconds) but not as long.

blazing sinew
#

on the same network and with different steam accounts

blazing sinew
#

also, searching and joining the session with the code takes like 3 sec

frail temple
#

What is it connected to? To start the search.

#

This is mine for reference. The "SearchSession" runs when the widget gets opened from the controller

blazing sinew
frail temple
#

Ahh fair enough, something I wouldn't have figured out

blazing sinew
#

why when I set that to 1 it's not working?

frail temple
blazing sinew
frail temple
#

Ohhh. It could be because within an Array, int 0 is equal to the first item in an array?

blazing sinew
frail temple
#

It is outputting an array, so if it's 1 it could be trying to read from the 2nd item in the array, could be my guess?

blazing sinew
#

and I think bp and ue5 uses it as c++

frail temple
#

Glad you got it working!

blazing sinew
#

I've found even another problem... if max players is 4 and there are already 4 people in the session I can still join that (cause session aren't refreshed in session list and it will count as if in the session there is only the amount of people that were in the session when I refresh the last time)

frail temple
#

Yea I know that issue

blazing sinew
#

maybe when I join the session I should check the max and current players in

frail temple
#

There is probably a few ways to check if it's full or not, I haven't added one yet as I don't need it right now for testing but I can add it later.

#

I think I did something like that in an old project, give a me sec to see if I can find it or if I have it