#multiplayer

1 messages Β· Page 69 of 1

prisma snow
#

for example, in a damage calculation:

#
  • attack is performed on client, target was at life 100 and is now at 90.
  • attack is performed on server, target was at life 100 and is now at 90.
  • server sends the updated 90 value to the client. The client already had 90 so apparently nothing extra happens. The client prediction was succesful.
#

But also can happen:

#
  • attack is performed on client, target was at life 100 and is now at 90.
  • attack is performed on server, but target was out of range so health is never subtracted (remains at 100).
  • server sends the updated 100 value to the client. The client had 90 so health spikes back to 100. Client prediction was not successful.
#

Take note that this is a very simple example, and I wouldn't actually implement damage/health prediction in most cases

#

Usually modern FPS games implement more complex systems that reduce prediction errors

devout granite
#

Does somebody know why the actor is visible on server side but invisible on client ? The actor has child actors which are set to replicate and always relevant

clever hound
glass vector
#

for seamless travel, will the begin play be called for player controllers when they enter the final destination map? ie, since the controllers persist, will they call begin play again?

graceful viper
devout granite
cyan mirage
#

Hey again, simple question, is it possible to set the name of a server? For example if a player hosts a room as the server and client, how can they set the name or key of the server that anyone wanting to join has to type out

frank birch
ember tendon
#

Hi Do you have experience with unreal engine Steamcore multiplayer setup which is non region locked?

ember tendon
frail barn
#

what this mean?
its an HP Variable, and it is Replicated

low vine
#

What is the correct approach for syncing character capsule to (approximately) match mesh (e.g. during jump) that has the capsule synced in multiplayer?

#

This is what I've tried so far (and where I hit a wall)

frank birch
frail barn
frank birch
#

Check the index for "replicated properties"?

frail barn
frank birch
#

Health points in your example there is a float... Not a map nor an set

frank birch
#

Single green pin is float

#

You can't replicate map nor sets because they don't have a serializer, most likely

#

And it might only be a limitation for bp

frail barn
frank birch
#

Yep, and it's replicated

#

It has the little balls on the variable thingy

frail barn
frank birch
#

I am not sure you have the panel on the right variable or If your BP was compilled

#

πŸ‘€

frail barn
frank birch
#

Delete the variable and make it again? πŸ€·β€β™€οΈπŸ€”

prisma snow
steady cape
#

Is there a way I can ensure that the order of replicated array stays the same across the server and all connected clients without sending the array through RPC?

turbid cloud
#

Hey can someone explain to me like I’m 5, how I would get the packaged UE5 server onto, say, digital ocean and figure out the IP so I can tilda/connect IP address for playing around?

dark edge
#

Because the clienside overlap triggers the run on server event which presumably increments Coins, and also the serverside overlap triggers the run on server event which presumably increments Coins

#

Just do it serverside only

#

no run on server event

#

just
Overlap -> Has Authority? -> Yes -> do the coin thing

dark edge
#

You'll need to cross compile for Linux if you haven't already

#

A headless deployment on a cloud server isn't really ELI5 territory

dark edge
steady cape
thin stratus
#

Order of the array should stay the same

steady cape
#

Β―_(ツ)_/Β―

#

I guess I should run some tests and see how that goes

turbid cloud
# dark edge You don't know your digitalocean server's IP?

Thanks for the helpful tips. Can you explain a bit more simply even lol. I've never gotten further than running gameserver.exe -log on my own box and connecting with clients ~open local etc. I see I need to add linux support to source.. That will be more homework / figuring out over the coming days, but in the meantime. I get it's not ELI5 territory.. Would love any solutions you can offer though - the simplest and I'll go research based on your words. Any windows cloud solution? I also see EOS and all these plugins for Amazon and everything.. so confusing. I'm just looking for the simplest solution to get playing around - not having a serious game deployment.

dark edge
#

But the general case is to cross-compile to build the linux dedicated server then just run it on your remote box

turbid cloud
#

You're mentioning Ubuntu.. Can you elaborate on the Linux / Windows thing? I'm assuming that's just for performance?

dark edge
#

most game servers are linux

#

You can just test on Windows if you want

#

Laptop + engine + a launch script and you're good to go, no need to build from source or anything

turbid cloud
#

Yeah my challenge is I'm guess cross compiling for linux (downloading / attaching to engine etc) is going to take a while

dark edge
#

Just stick to Windows for now. here's what a simple launch script can look like

#

tada, windows headless game server

#

no need to build or anything

#

just put that on another machine and fire it up whenever you want to test outside of PIE

#

I have 3 files like that

#

for fast testing without cooking/building

turbid cloud
#

Wow. thank you for that advice. And that would be on my own laptop? I'm confused though.. I'm looking to test just the exported (build game server). Do I need the engine for that? Each time I was planning on copying over the build

dark edge
#

built server no

#

but you gotta do that long cook/build process

turbid cloud
dark edge
# dark edge

With this you can close, pull latest from source control (you're using source control, right?), restart in like 30 seconds

turbid cloud
#

No worries about long cook/build process! I don't mind that. I'm simply looking for how to get the build server running remotely. (ideally on a paid server)

dark edge
#

What I'm getting at is you can do the same thing on linux

#

or on whatever server.

turbid cloud
#

So grateful for your tips. Lots for me to research now

weak linden
#

so I can jump inside and still get moved like if I never left the floor
Would you happen to mind sharing your solution to this? I've been having exactly the same issue for months regarding my physics based "air ships", when players jump and/or fall within their ships, their movement is corrected when they land.

I also ran into your other issue where players can "push" their ships around when making contact with walls, etc, I have been using the same solution @dark edge suggested and just have a secondary mesh that's hidden for player to ship collisions, the main mesh/collision is used for accurate ship to world collisions πŸ™‚

frail barn
#

when i seek a nearest enemy unit, i get closest to position of the 1st client for every clients
how to set, which client is seeking?

dark edge
weak linden
weak linden
frail barn
#

so i cant do it locally

weak linden
#

I assume so, since GetPlayerPawn 0 on client I believe returns local pawn, whereas on server, it returns the pawn for the first connected player (so it'd always be that same player on the server)

frail barn
weak linden
#

Okay, is that being ran from the controller for the player who needs to find the target? If SeekNearestFoe is within that same controller, just use GetPawn/GetControlledPawn (that doesn't have an index parameter)

#

This node refers to the pawn which is currently being controlled by the controller you are executing it within

#

@frail barn

frail barn
frail barn
weak linden
crude marlin
#

Hi, sorry if this is a really beginner question, but I'm kinda new in networking.
So I have actors that can have large amount of data (max 5000 bytes). And the more the player plays the game the more of this actor will exist.

I'm testing with an upper limit I want to achieve, which is 20000*5000 bytes. So I have 20k actor with around 5000 bytes of data(200 vector, 200 rotator and 200 uint8).

So I want to send all this to the client on loading screen. I only have to send this data once. So the client can work with it.

I was trying to use RPCs first like sending 5000 bytes per frame, but it took a lot of time and it also made the client lose connection with the server.

This will happen on a listen server.
So does anyone have any idea what would be a good way sending this data to the joining client?

fossil spoke
crude marlin
#

Well, I have actors that uses procedural meshes. So I store the data(hit loc, rot, etc.) to recreate the procedural mesh. And I want to send this "ChangeHistory" to the joining client, so he can rebuild the proc mesh locally with this data.

#

And one actor will have 200 vector, 200 rot and 200 uint8 at max as "ChangeHistory".

fossil spoke
#

Have you checked that it isnt cheaper to just compress and send the "as-is" procmesh data itself?

crude marlin
#

I tried working with compression, but I couldn't really make it work or figure it out.
Could you recommend me some compression method for this?

#

by procmesh data, do you mean the ChangeHistory I'm talking about or the procmesh's verts, tris, normals, etc.

fossil spoke
#

What you may want to look into is sending this data over a http stream or something instead.

#

The Host can start a HTTP Server and the Client can connect to it when they join their session.

#

Then you are basically free to send whatever you like.

#

Having large amounts of replicated data on actors is not ideal.

crude marlin
willow cargo
#

Running into some replication problems,
I have a Game mode that creates team_manager actor components, and adds them to the game_mode as child actor.
It also saves an array of these actors in the game_state, which is set to replicated, the team_managers on my clients are not seeing the same data as the server.
Should I add the team_manager as a child to the game_state instead?

fossil spoke
#

This doesnt make sense

#

ActorComponents are not Actors, so therefore cannot be added as Child Actors.

willow cargo
#

sorry my terminology is probably off here, the Team_Manager inherits from the 'Actor Component' class, and is added as a component to the game_mode

fossil spoke
#

Just create the Teams as regular Actors.

#

Dont add them as Children.

#

Ensure they are set to Replicate.

willow cargo
#

as in regular objects in the game?

fossil spoke
#

As regular Actors

#

Not Child Actors

#

Or anything else

willow cargo
#

Appreciate it, trying that approach now

fossil spoke
#

Make sure they are set to Replicate

#

If they arent, they wont exist anywhere else but the Server.

mortal mica
fossil spoke
#

@willow cargo When the Team Actor calls BeginPlay you can have it register itself with the GameState.

#

So that Clients can find them.

willow cargo
#

Ye that somewhat makes sense Spawning actual objects feels a tad wrong, but if it works it works πŸ˜„

fossil spoke
#

Why is it wrong?

#

PlayerStates are Actors.

#

PlayerControllers are Actors

#

The GameState is an Actor

#

They are all spawned and replicated.

willow cargo
#

Actor has an physical object 'ring' to it, ( again this is rather new to me )

#

But I understand what you're saying

fossil spoke
#

Actor can contain a physical representation.

#

That doesnt mean it has to.

willow cargo
#

Fair enough

fossil spoke
#

If you are using C++ there is a class called AInfo which is generally meant for Actors that dont have a physical representation.

#

Like PlayerState and GameState.

#

Though at this point its basically legacy as its not really doing much at all on its own.

willow cargo
#

And just like in player controllers etc I can force certain functions like 'add yourself to the game_state' to run on the server only correct?

fossil spoke
#

There are mechanisms for you to control which code is executed in what network context, yes.

#

HasAuthority

#

Is one.

#

Checking GetLocalRole is another

willow cargo
#

Thank you for clarifying

fossil spoke
#

Its worth it to go and read through the pinned comments in this Channel.

willow cargo
#

will do!

fossil spoke
#

Especially this compendium

civic seal
#

Hey guys, is there a particular stage at which RPCs get executed or do they just get fired off as soon as they get to the target machine?

fossil spoke
#

So if the Actor that is having an RPC called on it is not available on the other end, it wont receive the RPC (obviously, how could it if it doesnt exist?)

civic seal
#

I was more asking at which stage in the tick they get called

fathom aspen
#

Something I have yet to investigate is if the Actor needs to be replicating for the RPC to execute or it can be simply referenced over the network

fathom aspen
#

Also some of them might get queued

fossil spoke
#

It must be set to replicate yes.

fathom aspen
#

Yeah I guess for an ActorChannel that handles the RPCs to get created

civic seal
#

Thats what I'm asking about, like what the choreography behind it is once the call is received

fossil spoke
#

As soon as it exists, it can have RPCs called on it.

#

Is that not a decent enough explanation?

civic seal
#

Well there are tick groups, and everything in Unreal from what I see gets synced to the specific group, in "stages" - pre-physics-, post-physics, etc etc.

#

Clearly there's a point at which they get executed so that they don't break game logic. My question was what that point is

fossil spoke
#

Replication data is handled immediately. RPCs are "do this thing now" not tied to tick.

#

When it comes in, it fires.

civic seal
#

Sweet, thats good to know. Explains what I'm dealing with right now. I appreciate the help

fathom aspen
civic seal
#

I had assumed that RPCs get queued up and then executed at a particular point in the tick. Knowing that they fire off as soon as they get to the machine explains things

civic seal
fathom aspen
#

And you shouldn't count on which to use based on this factor

#

The use cases are really far from being who's faster, or which is more performant

civic seal
#

Are you confusing me with someone?

fossil spoke
#

I think he is just explaining something in relation to the article he posted

fathom aspen
#

Am I?

civic seal
mortal mica
#

Ok here's something I'm trying to understand. If I have a Character moving really fast (linear velocity, no damping, etc, just constant velocity), and I use VisualizeMovement cvar, I can see the AutonomousProxy to match the visual mesh rendered on screen, that is, the transform of the actor is always in the center of my character.

This is running as a client from the editor, with a server spawned in the background. No simulated lag.

Now I created a custom pawn, just empty for now, but I implemented a similar VisualizeMovement cvar, draws some text at the actor's location. In the case of the custom Pawn, the AutonomousProxy location always lags behind the actual mesh I'm seeing rendered.

Both methods use GetActorLocation() as the position where to drag the debug text/lines/etc. So I'm not sure what makes the difference in apparent location between the Character and the custom Pawn.

(Note im not talking about the Authority's position, just the AutonomousProxy on the client's machine)

fathom aspen
#

The character moves via the CMC, and the custom Pawn moves via?

mortal mica
#

the custom pawn just has a linear velocity applied to it, constant value

#

the bigger the velocity, the bigger the difference between the position used to render the mesh vs the position reported by GetActorLocation

fathom aspen
#

Well yeah then there are no forms of prediction whatsoever

#

Hence why you are getting corrections

mortal mica
#

I understand that part, but why isn't the mesh rendered behind as well?

fathom aspen
#

So you are basically asking: Why do my custom MC has corrections but the CMC doesn't

mortal mica
#

the AutonomousProxy is the actor on the client's machine, and the client's machine is the one rendering the mesh, so how is the position of the mesh correct

#

if it thinks the actor is behind?

#

I understand there would be a difference between the server's location and the client's location

#

(lack of prediction, lag, whatever)

#

but the mesh is rendered ahead of the client's location ?! how?

fathom aspen
#

So you mean visually you don't notice any corrections?

mortal mica
#

nope

#

let me see if I can screenshot what I mean

#

that's the position of both the ship's location and the player's location, just for reference

#

this is the player moving with a big velocity, but as you can see I added the "autonomousproxy" text in there for the gizmo, and the mesh matches with the GetActorLocation()

#

now that's what happens when controlling the "ship". the GetActorLocation() for the AutonomousProxy is down in the bottom, almost cut out of the screenshot, sorry, but it clearly is not where the center of the ship (the mesh) is.

#

I would have expected that if the client has a different position (either because of replication or whatever) the mesh would still match the client's "view" of where the actor is

prisma snow
fossil spoke
#

RPCs can go both ways, Replicated Variables cant.

prisma snow
mortal mica
#

no speed / some speed

fossil spoke
#

@mortal mica Are you talking about the Text being lagged?

mortal mica
#

well the text is drawn at the actors location (reported by GetACtorLocation()) so not so much the text being lagged, but the position being lagged

fossil spoke
#

How are you determining the position is lagging?

#

Because from what I remember, all the draw debug stuff is a frame late.

mortal mica
#

is it?

fossil spoke
#

I vaguely remember something saying that was the case.

mortal mica
#

well, that's very unconvienient XD

#

well actually it still wouldn't explain why it works fine for the Character (CMC)

#

character must have an extra trick under it's sleeve that im not seeing

fossil spoke
#

Verify they are ticking at the same rate/time/group?

mortal mica
#

oh interesting

#

if I make it tick After Physics the position matches

vivid egret
#

Hey folks, I’m about to lose it over a simple variable assignment. I have 3 machines on LAN. I have a 3 item Boolean array in the game state. Each player has an ID.

I need a ready button widget to set the game state array equal to true for the index of the player ID. I need each player to know when this array is updated because when all players say ready, it should start the game.

However, I have tried seemingly everything and can’t get the all the computers to know when they others are ready. How would you address this?

fossil spoke
mortal mica
fossil spoke
#

Get each Player to send an RPC to the Server saying they are ready, this would then let the Server set the Ready variable to true for that Player, which would replicate down to Clients.

#

You can set it to be a RepNotify, that way your Clients can know when it was changed for each Player.

vivid egret
#

Awesome, I’ll try this out. Thanks!

crude marlin
# fossil spoke The Host can start a HTTP Server and the Client can connect to it when they join...

I partly figured it out, but I need some help.
So I try to start an http server like this:
FHttpServerModule& httpServerModule = FHttpServerModule::Get(); TSharedPtr<IHttpRouter> httpRouter = httpServerModule.GetHttpRouter(ServerPort); httpServerModule.StartAllListeners();
But then if I get the content I get this: {"errorCode": "errors.com.epicgames.httpserver.route_handler_not_found", "errorMessage": ""}
Is this normal or am I missing something? As ServerPort I use 8080.

Is this the correct way of starting a http server?

What do you think about using TCP for this purpose? I'm gonna probably test both, but I'd like to hear your opinion. For this I kinda need a reliable data transfer, so everything arrives as it should so the client can rebuild the proc meshes correctly. I'm just not sure how reliable these in actual practice.

fossil spoke
#

I believe you need to bind a handler to the router first before starting any listeners.

#

I havent played with the HTTP module in a while so I cant remember exactly.

#

Best thing to do is look at the existing source code where they use the HTTP Module.

fathom aspen
fossil spoke
#

@crude marlin You will want TCP.

crude marlin
#

oh really? Is it because of the reliability or something else?

fossil spoke
#

Well yeah, you dont want a packet to be dropped and then your data be unusable.

crude marlin
#

oh I see, alright awesome. I feel like that'll be easier to figure out. hopefully.. πŸ˜…

mortal mica
#

ok so following with my physics investigation, I am now facing some other odd behaviour. My fast moving actor has a box collision in it. My character is on top of the fast moving object, and I managed to get both moving in sync. But the bounds of the box collision seem to not be in sync. Basically It's offset by whatever the velocity is (maybe a frame off?) and the end overlap triggers way before reaching the actual outside of it

#

(im now testing as standalone, so I just have the authority actor to worry about)

#

does each component has it's own location? or if a simulate physics component updates the position of the actor, then all components will use that updated transform ?

mortal mica
#

ok got a new working theory of what's the problem here, and it seems to be all over the place. The CharMoveComp divides movement in two parts, the "Based Movement" (ie if you are standing on something that is a moving platform) happens on a separate tick, After Physics. The rest of the movement happens in Pre Physics with the rest. The CharMoveComp tests overlaps in it's regular Tick, which in the case of a moving platform, it would be the position of the collision in the previous frame, not the current one, since Physics haven't been updated yet, and the actual position of the character hasn't been computed, since the position of the base is, as I said, updated in the Post Physics tick.

#

I guess the current state of the implementation of the based movement is "Good enough" that it worked for a simple elevator in an fps game, but it's not really properly implemented

#

(although as I said, it's just a working theory, I could be totally wrong πŸ˜› )

abstract pike
#

How can I call a FAutoConsoleCommand directly?
Is that a thing?

#

Found it! Nevermind.

hushed heart
#

Hello! Very quick question, when using the open <up address> command to connect to a host, is there any simple way to pass in information from your client to the server? Like a name, or little customisation options, for example. Thank you!

solar stirrup
#

open someAddress?myCustomName=hey?anotherOption=hello

fossil spoke
#

?key1=value1?key2=value2?key3=value3… etc etc

solar stirrup
#

Oh, good to know!

#

I think I do and I just mixed up URL query parameters DogKek

hushed heart
#

Oh thank you! Is there anywhere I can find documentation on those options I can pass in and how to receive them properly on the other end? I'm not sure what keywords I'm looking for here so google failed me blobsmilesweat

fossil spoke
#

@hushed heart These β€œoptions” get passed into the Login function on the GameMode for that connecting Player

hushed heart
#

Aha! Great that helps a lot, thanks!

craggy walrus
#

Hey lads, since I can't find where to set net.AllowPIESeamlessTravel=1 i'm testing in standalone game. But the session creation does not even work. I'm using the advanced session plugin, it works fine in PIE but not in standalone, is there anything you have to do in standalone for multiplayer? (using NULL subsystem, ue 5.1)

fossil spoke
#

Check the Log. It might help explain why your sessions arent being made.

craggy walrus
#

Wait, in standalone you still get logs?

#

not that standalone huh

fossil spoke
#

Yes all instances log except shipping builds

#

Standalone logs appear in the Saved/Logs folder as they are just an editor instance

craggy walrus
#

Ah yeah, not in the editor, makes sense, can you still reach breakpoints in standalone games?

fossil spoke
#

You can attach a VS debugger and breakpoint that way. But blueprints wont AFAIK.

#

Not sure how they could to be honest

craggy walrus
#

I was talking about C++ breakpoint, so you need to attach manually, makes sense

fossil spoke
#

Yep

craggy walrus
#

well it was unrelated, for some reason, it still used some old code I had unplugged, just removing the cpp file solved it, not sure how that happened but

vague fractal
#

It seems like the PlayerState isn't directly available when a client joined the server, at least if i'm not wrong.
If i'm not, at which point would it be available ?

hushed heart
#

I believe the game state is responsible for creating player states. I'm not sure if this is best practise, but dependent on project I would have a set of "player state ready"/"game state ready"/"pawn ready" delegates I could subscribe to, so I knew for sure when I was initialising everything at the right time

vague fractal
#

I wouldn't have a problem with using delagates for this, but is there already one for the PlayerState ?
I don't really know how to set something like this up for myself

craggy walrus
#

but there's probably a built way to do it

vague fractal
#

Actually, there's AController::OnRep_PlayerState, maybe that works ?
Would try it

hushed heart
small burrow
#

what the hell is happening here? I am converting the default UE5 FPS template into a multiplayer template and when I tried changing the projectile spawn to work as an RPC :

#

when I pick up the weapon from the ground and shoot, the game restarts without the client??

chrome bay
#

It's kicking you

#

Presumably some other RPC is failing validation

small burrow
#

urgh

chrome bay
#

Logs will tell you

small burrow
#

i think they changed the fps template for ue 5 and its so frustrating

#

every tutorial looks different than my template

#

you were right

#

but i have no idea what these mean

civic seal
#

Hey guys! I wanted to ask about the dangers of using reliable RPC and specifically how I can tell whether or not I can get away with its usage.

I have a fairly vital chunk of data that I need to get to the clients regularly, at around 48 times per second. Seeing how its a frequent update, I was going to go with a unreliable call, but the framerate of the received data drops to maybe 24 frames, which becomes very noticeable. I do interpolate, but my data changes fairly unpredictably at times.

I don't really use regular Reliable calls anywhere else, so I was wondering if I could get away with the sin of making this one single update RPC reliable after all

#

What are the rules of thumb on that?

small burrow
#

im having a hard time finding info online

chrome bay
#

If you scroll up a bit, it says something about being unsupported. It looks like the client is trying to create a replicated component and failing

chrome bay
#

If you overflow, you get insta-kicked

civic seal
chrome bay
#

The likelihood of that data stream remaining that consistent in the real world however is miniscule, it just won't happen - so probably best to work around that somehow

civic seal
#

Yeah, I got like a hell scenario

#

swarm of unpredictable projectiles πŸ’€

chrome bay
#

Hard to know without context but the solution would probably be to try and make them more deterministic

#

If you can drive randomness from a seed, that makes it easier

civic seal
#

Super tough to do, seems impossible to avoid. They're just incredibly context-dependent with their behavior

#

So I'm gonna end up replicating an insane amount of environmental context

#

I was hoping to avoid all that specifically to keep bandwidth low

prisma snow
#

the best you can do is to buffer updates and interpolate

#

sending such a big amount of data 48 times per second seems a stretch

chrome bay
#

Just don't replicate redundant info. If a client can already figure something out for themselves, that's the best way to save cost

#

Anything that is reliant on a steady data stream will break, ultimately

#

reliables won't fix that, they'll just make the breakage more obvious

prisma snow
chrome bay
#

Without digging into it I have no idea

#

Can't see full log so hard to know

small burrow
#

this is the full error, but idrk what else i should show you

chrome bay
#

Weapon Component is the problem

small burrow
#

i just added a custom event in the BP there

civic seal
chrome bay
#

The issue is the Blueprint is trying to add a "Weapon Component" to the character

#

And I can't really tell anymore than that. Perhaps both Server + Client are creating the component? IDK

#

But if they are, and it's replicated, that's at least one problem

#

Adding replicated components at runtime should only be done by the Server for instance.

small burrow
#

it could be

#

the weapon is in the air and needs to be picked up

#

it then somehow adds the component to the player

#

and deletes itself

#

weird that i only get the error once i try to shoot, the weapon gets equipped just fine

prisma snow
#

ideally some of your projectiles can be aesthetic only and don't need such frequent updates

#

or some that are slower

small burrow
#

this is the weapon to be picked up

chrome bay
#

Whatever this is, I already hate it

#

Presumably said tutorial is not multiplayer ready?

small burrow
#

nope

#

its the default FPS template

civic seal
chrome bay
#

Ah right, yeah so that's at least part of the issue.

#

Both will be adding that component independently. The FPS template was never meant for Multiplayer

small burrow
#

ah yea i see

chrome bay
#

So assume nothing will work in MP

civic seal
#

stupid ass speed of light ruining my vibe

#

wormhole internet when

small burrow
#

do i need to just set it as server only somehow?

vague fractal
#

Would it make sense to store things like player names within the GameInstance ?
I know it should be rather stored in the PlayerState, but so far it seems like i can't really store it only there as i'm not able to use seamless travel 24/7.
With that i mean i'm taking the user name before joining the server, but when i join the server for the first time the prev PlayerState will be gone as it wasn't a seamless travel

prisma snow
civic seal
#

The game's entire concept on its own spells hell for multiplayer

mighty yew
small burrow
#

@chrome bay i managed to make it so it doesnt crash and the component only gets added on the server; problem is, it only gets added on the server, it doesnt replicate

#

i just added an RPC in between the callback and the cast

#

Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor BP_Rifle_C_1. Function RPC Add Component will not be processed.

#

now i think i need to set the owner, but idk how

clear island
#

how do reliable RPC's work internally? I thought reliable RPC used the TCP protocol but I'm now noticing when I start the server it only opens the UDP port

prisma snow
clear island
#

ohhh I guess that explains why I dont see any TCP ports being opened then

#

everywhere I read online it says:
Reliable RPC = TCP
Unreliable RPC = UDP

#

maybe it used to work like that in previous UE versions, because I see this repeated alot

chrome bay
#

It's always UDP

#

UE has it's own layer for implementing "reliability"

clear island
#

I see

chrome bay
#

Classically In MP, a weapon would usually be implemented as it's own actor

small burrow
#

oo

#

i see

#

urgh i thought the transition from unity to unreal would be smoother

#

ill probably ditch the template then and make it from scratch

quasi tide
small burrow
#

how annoying

ornate crescent
#

Hey, by default Online Subsystem is not exposed in Blueprint, right?

small burrow
#

do you guys have any good multiplayer tutorials ?

dark edge
small burrow
#

yea diving in randomly into a huge program sounds efficient

dark edge
#

Then don't dive in randomly. Figure out what you want to try to do, then try to do it. If you get stuck, look up the specifics. Also read the compendium

small burrow
#

oo thank you!

civic seal
#

man im feeling pretty smug

#

😎

prisma snow
frail barn
#

if my function is in a function library, how i can get Controller here?

frail barn
silver cargo
# small burrow do you guys have any good multiplayer tutorials ?

A few I like are from Kekdot and Betide Studios. Might depend on which Online Subsystem you're aiming for. Druid Mechanics has a helpful one for incorporating EOS but ends up telling you almost everything. The code is virtually the same no matter which Subsystem you're using. Mainly brush up on replication, I guess. Lot's of folks handle the lobby functions inside widgets, so UI and widgets is handy. Buy a Patreon and work from project files? That's fairly efficient.

dark edge
small burrow
#

im really new to unreal, ive only been using unity for years

dark edge
#

the thing that handles sessions and connections and stuff like that

silver cargo
# small burrow whats an online subsystem?

The subsystem is that back-end for common multiplayer functions. This way the code doesn't need to change wether you're using EOS or Steam. You will see references to the "built in" online subsystem.... but you need to remember that it only works on a local LAN. For anything the really talks over the internet you need a more robust subsystem like EOS, Steam, Xbox, PSN .. ect. Good luck!

small burrow
#

ohhhhhh

#

like literally steam and epic

#

i see

#

damn yea thanks guys

#

i really like unreal so far cause the game framework is eons ahead of unity

#

there s so much stuff out of the box

#

stuff i didnt even know i wanted lolol

dark edge
small burrow
#

yea i was actually worried about that

#

like its so much stuff that i was worrying it might actually be restrictive

#

but i think id still prefer havin it the unreal way

#

ig its different needs

hardy monolith
#

Hello! I'm using Game Features in my project, some of which are activated when the game room starts. A problem is that when the game is played online the feature fails to load.

I'm trying to reproduce the issue, but when I play with myself locally it does not reproduce (maybe this is because of some race condition that happens due to ping and load delay online).
Since I found it during testing with friends, it doesn't make sense to try to fix it in real-time and send a build each time for testing, I'm looking for a better way to reproduce it locally.

How would you advise testing and fixing it without involving more people? This is quite an important thing in general, isn't it? 😦

hardy monolith
#

(Also important note that I don't have easy access to additional laptop to test from 2 machines myself)

dark edge
civic seal
#

Hey guys! Any clue how I can increase my network bandwidth limit?

I've tried adding the following lines to my Config, but it doesn't seem to have an effect. My RPC and replication are still being throttled, hard.

DefaultEngine.ini

[/Script/Engine.Player]
ConfiguredInternetSpeed=4194304
ConfiguredLanSpeed=4194304

[/Script/OnlineSubsystemUtils.IpNetDriver]
MaxClientRate=524288
MaxInternetClientRate=524288

DefaultGame.ini

[/Script/Engine.GameNetworkManager]
TotalNetBandwidth = 4194304
MaxDynamicBandwidth = 1048576
MinDynamicBandwidth=    524288

[/Script/Engine.Player]
ConfiguredInternetSpeed=4194304
ConfiguredLanSpeed=4194304
#

(these values are just extreme values I set in order to see what the effect might be, so that I see the difference)

late grove
#

Anyone know if Lyra can support 100 concurrent players out of the box? Assuming you have a powerful server and don't add a bunch of laggy code. IIRC Shooter Game was supposed to handle that many

tender gale
#

Or wait do you mean is it setup to have 100 players or handle 100 players well?

#

Because it should be structured to support 100 players, but I don’t know how optimized it is for it

#

It’s probably more configured to run it better than a normal project though

fossil spoke
late grove
#

Yeah I was thinking since it is an inhouse/showcase Unreal project, the devs know their stuff and might have been able to give an estimate on the upper limit or even stress tested it internally. I seem to recall shooter game was said to handle 100 ccu

late grove
#

Like in Squad or something when you get to 100 there are jitters and stutters but usually it remains stable, no major freezing or warping or crashing

#

assuming the server is strong and pings are low etc

tender gale
#

My guess is no, Fortnite is ahead of 5.1 with engine performance improvements, and in general probably more optimized systems than Lyra

#

But like DevilsD said, best way is to find out

late grove
#

Yeah that's gonna take a while hehe. There must be some kind of estimate or insight somewhere, I'll keep looking. Thanks :)

deep coral
#

is it possible to switch online subsystems at runtime?

fossil spoke
#

Its also pretty old

deep coral
#

will AI controllers get travelled and loaded on seamless travel?

faint eagle
#

when my client travels to a match hosted by another client, should I specify the host's current map in APlayerController::ClientTravel URL? or should only the address be specified in the URL? πŸ€”

chrome bay
#

@civic seal Note that the engine doesn't do any true bandwidth control. It just considers the connection "saturated" at those values and won't attempt to send anymore. It's a soft cap at best really. There are separate CVars for RPC limits, limits on tarrays etc. There are still some hard caps you can't exceed.

chrome bay
prisma snow
#

all I know is that some default limits were increased from UE4 to UE5

chrome bay
#

UNetDriver / IPNetDriver has most of the settings IIRC

prisma snow
#

oki thank you πŸ˜„

chrome bay
#

Oh and DataChannel limits the max bunch size

prisma snow
#

πŸ‘Œ

#

I guess the best would be to not have to modify those and comply with the limits

#

dunno how common is to change them

chrome bay
#

We never had to. HLL was shipped with defaults.

#

Just a shit tonne of optimisation work

#

UE 4.26 or 4.27 increased the base limits by a factor of 10 too

prisma snow
#

ahh so it was maybe in later UE4 and not UE5 asI thought

#

btw is there any stats/logs or debug information when the limits are reached? I didn't find any trouble when testing but maybe it is silently failing

#

since my game networking is not in a stage where dropped updates would break anything in a very evident way

chrome bay
#

I don't think it;s easy to get too but you can get the saturation and inging/outgoing bytes from the net connection/net driver

#

Otherwise it's just about profiling

silver remnant
#

Hi guys, I have a question about multiplayer character, when I store my character's data in the server, it shows nothing but a headless figure and not my character progression, any suggestion on how to solve this issue?

fossil spoke
#

@prisma snow You are more likely to be CPU performance bound than bandwidth restricted.

prisma snow
fossil spoke
#

Internet speeds these days are extremely capable from a throughput perspective. Its more about how quickly the data is crunched on either end that will cause issues.

#

Limiting bandwidth obviously does help. But if you are half sensible with data optimization that wont end up causing you the biggest problem

prisma snow
#

The CPU cost for serialization happens on the game thread or network thread? Bcs I have not profiled the latter tbh, probably I should

fossil spoke
#

Remember that the rest of your game systems will cost you as well. The more time the CPU is doing something, the less time it has to complete other stuff like dealing with network traffic.

prisma snow
#

I'll keep an eye on network serialization cost though

fossil spoke
#

Cool. Just keep profiling. Profile everything. It all adds up

prisma snow
#

yeah

#

I bet I can see the network thread on Insights

#

just never bothered recording it

#

the problem as always in multiplayer is profiling in real conditions

#

not sure if profiling a multiplayer editor session is going to provide semi-accurate results

fossil spoke
#

Profiling can be enabled for packaged dev builds

#

Commandline and console commands

#

Do some research into that. They are useful for getting more appropriate data.

prisma snow
#

Ohh, I know the commands, it's just less convenient to test multiplayer since both processes will eat the resources from the same computer, and I don't have two computers to test on easily

hoary spear
#

Sounds like a local animation is played, with an RPC to the server to try consuming the item. server starts a timer, and consumes the item if not cancelled by another rpc from the client ?

#

Server sets players new health when item is actually consumed, so that would be handled by the OnRep_Health I'd guess

umbral horizon
#

Yes that's it

#

What would be a better approach? Rpc or onrep HealingStateEnum?

hoary spear
#

i'd still do a timer on the server, to avoid missing out on a heal due to local lag or fps issues

#

then server char is healed at the correct time regardless of what happens at the client, unless a cancel_consume rpc is sent

umbral horizon
#

okay. What about rpc vs on rep?

#

that's the main concern

hoary spear
#

What do you wanna onrep?

umbral horizon
#

play heal animation for simulated clients

#

it will be a skipowner variable

hoary spear
#

i'd think that'd be an unreliable multicast

#

as it's not important core functionality

short arrow
#

Def

#

it wouldn't even work as an onrep, players who come into relenvcy would see someone doing the animation who finished it long time ago if you didn't clear it

umbral horizon
#

yep i will be clearing it out once the server reload has ended

short arrow
#

any network event that is one and done should be reliable

hoary spear
#

the enemies would react to the reliable server event starting to heal

short arrow
#

the only time you need to make an event unreliable is if you plan to send the even multiple times, and one or two failing won't matter

hoary spear
#

i'd say that an animation for other players are not super important, and if it misses out, that's no big deal imo

short arrow
#

why does he want it to be unreliable?

hoary spear
#

Sure its part of the immersion and all that

#

I just suggested it as unreliable πŸ˜›

#

and i guess thats what they had in mind already

umbral horizon
hoary spear
#

how does it really matter?

#

the only thing that would happen when it fails

#

would be that the player just stands still

umbral horizon
#

If someone is healing near me, i would like to go and attack him since i know he is low hp

#

that's why for more competitveness

#

there will be healing sound played as well

#

so br games also ignore such things?

hoary spear
#

I'd still call that less important than the core element, but oh well

#

I got no clue what BR games do

short arrow
#

Every event should be reliable unless it's being consistently fired. I think you guys might be over optimizing if that's the reason you want it unreliable

hoary spear
#

The significance of the event should also be considered

#

if you're sending location updates on tick, that probably needs to be reliable anyways (if you've got a good reason to do this)

short arrow
#

Hopefully that's the only reason someone would have a reliable event on tick πŸ˜„

prisma snow
#

even the CMC does not send reliable RPCs on tick iirc

thin stratus
#

You should NEVER use Reliable on Tick

#

Especially not for Movement stuff

#

This sends ~60 times per second. Who the f cares if a package drops

#

The Reliable Buffer will fill up way too fast if you do that and you'll start to see a lot of packages being dropped in favor of the RPCs

#

Up to the point where Clients won't even see replicated actors spawning in

#

Had that couple of years ago on a client's project

crystal palm
#

i want to make a replicated pawn movements(like tps project movements) how can i do it?

thin stratus
#

If your Pawns are humanoid you should fall back to Characters and just use the CharacterMovementComponent

#

Replicated Movement requires lots of C++ to work correctly

hoary spear
solar stirrup
#

Hey, do subobjects of an actor component replicate at the same time as the component? As of 5.1 at least.

elfin copper
#

Morning, I have a working replicated shooting system in C++, everything works except first person animations in the clients and spawning sounds (I know I need to multicast the third person animations, I'll do that after). So, any ideas why the animations only work in the server?

#

logging GetAnimInstance()->GetCurrentActiveMontage() shows that the animation is being played in the clients but it just doesn't

austere violet
#

whats the best method for a GameMode on the server to communicate with a game instance on the client?

#

and also to replicate it to all clients

solar stirrup
#

GameMode cannot, GameState can

austere violet
#

yea I am currently letting the game mode call a function in the GameState that have a Have authority switch, that in turn calls the relivant player controller who then calls the Game Instance,
the resault then goes back to gamestate and gets replicated to other players

#

its part of rank/score management so needs to be updated when GameMode ends,
but it seems like there should be a simpler way

quasi tide
#

Have GM bind to an event in the GS stating that the score was reached. Then just do the tracking in the GS.

#

The GS is for the GM to communicate to clients really. These two classes are tied together.

austere violet
#

who have authority over the character movement?
sounds like local and server is fighting each other

#

yea for normal movement that would work, but the moving platform is most likely out of sync.
do the platform just move the character as "impart movement" or does it actually follow the "I want to move" logic

#

I would add a collision box on top of platform to get overlapping character
then add offset to the character the same amount as the platforms movement, feed this into the replication pipeline you have

thin stratus
#

CMC already does that

#

It's BasedMovement

devout granite
#

Is something like this possible:
Server/Client player controller changes something in the game instance -> client player controller should get event that this happend.
My main issue is that the client has no access to the game instance and can therefore not subscribe to any events.

winged badger
#

client has its own game instance

#

if you want to replicate events, GI is not the place to put them

devout granite
#

but how can i share events/variables between both players over multiple levels :/

winged badger
#

add an Actor to do it, put it in GetSeamlessTravelActorList on all GameModes and use SeamlessTravel

#

Actor will get dragged along and persist

#

suggest spawning it from GameMode and keeping a replicated pointer in GameState to it

crystal palm
dire tusk
#

Hi Peeps,
Question on CPP networking.
I have a variable its set to replicate
But I'm noticing when I change the value in a function that is multicasted and only changing the var if we have authority.
In the function I do see the variable change but its after leaving the function.
After that function processes the variable changes back. Its just a bool from false to true. But sets back to false?
Nothing else in my code is touching that bool. I was thinking the set from networking is maybe just not staying for some reason.

I built this whole thing in blueprint originally and it worked just fine.
It seems its some cpp specific step or something that needs to be done differently.
I also made sure to have the function GetLifetimeReplicatedProps overridden and variables replicate set up in that func,
As well as making sure the variable change is done on the server, and making sure they the bool is replicate set on the UPROPERTY

#

Also I'm testing all this just on the regular solo stand alone play not even network PIE. I'm really lost on why the variable would reset.

stoic lake
#

is it best practice to do all calculations server side? or can you do some things client side as well, apart from just handling the keypresses

pearl bear
#

Greetings, I'm having difficulty organizing my Multiplayer gameplay code. Should I separate the cosmetic stuff and the game logic stuff and call it in different methods? For example, my character can cast spell. How should the client call the method I created to do this? The first thing that comes to mind is the client invokes the method of doing the magic with a server RPC call. But then how will the act of doing this spell be distributed to other clients?

#

The other obvious question that stuck with me is when I make a server RPC, does this RPC call run on the server version of the actor that the call is made from?

low depot
#

Hi everyone, rather than respawning a character after rag doll I’m trying to teleport it instead. I have it working on server end I set the location, collision etc. I see the client capsule and mesh teleport in the server view, but on the client only the capsule teleports. The mesh stays rag dolled. I can control the capsule at this point. What could possibly the issue?

hardy monolith
#

When we tested the game we used Radmin VPN for connection. One player hosts game through menu, other player joins

blazing spruce
#

Hi, if i use IsLocallyControlled and its true, then try to cast to the game mode, should that work or not?

ember dagger
#

Depends on whether the local player is the server

#

Game mode only exists for the server

blazing spruce
#

Ok sweet! I was getting a game mode cast failing but thats why, cheers!

winged badger
fiery eagle
#

Any body knows why my ATeamGameMode::PostLogin(APlayerController* NewPlayer) is not being called on a packaged build.
work perfectly fine in editor
it should be called automatically when a client joins right.

#

I Tried on screen debugging but this doesnt seems to get triggered.

winged badger
#

Is this first login into server or seamless travel?

low depot
fiery eagle
#

Seamless travel from lobby to Teams GameMode

winged badger
#

Seamless doesnt call login

granite pendant
#

I am looking for someone to help me with my multiplayer game, does anyone know where I can inquire for engineering help?

winged badger
#

Only first connection does

fiery eagle
winged badger
#

Seamless calls HandleSeamlessTravelPlayer

stoic lake
winged badger
#

Then they meet up at HandleStartingNewPlayer

fiery eagle
#

finally someone with answers damn i was stuck here for the whole day

stoic lake
quasi tide
quasi tide
fiery eagle
winged badger
fiery eagle
fiery eagle
#

iam trying to assign teams on the beginning of the level.

#

i was Doing this

winged badger
#

Id go for HandleSeamlessTravelPlayer then

quasi tide
fiery eagle
#
void ATeamGameMode::PostLogin(APlayerController* NewPlayer)
{
    Super::PostLogin(NewPlayer);
    int32 NumberOfPlayer = GetNumPlayers();
    if (GEngine)GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Green, FString::Printf(TEXT("Number of players?: %d"), NumberOfPlayer));
    AMPGameState* MPGameState = Cast<AMPGameState>(UGameplayStatics::GetGameState(this));
    if (MPGameState)
    {
        /*int32 NumberOfPlayer = GetNumPlayers();*/
        if (GEngine)GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Green, FString::Printf(TEXT("Number of players: %d"), NumberOfPlayer));
        AMPPlayerState* MPPlayerState = NewPlayer->GetPlayerState<AMPPlayerState>();// Get the pointer we use get
        if (MPPlayerState && MPPlayerState->GetTeam() == ETeam::ET_NoTeam)
        {
            if (MPGameState->BlueTeam.Num() >= MPGameState->RedTeam.Num())
            {
                MPGameState->RedTeam.AddUnique(MPPlayerState);
                MPPlayerState->SetTeam(ETeam::ET_RedTeam);
                if (GEngine) GEngine->AddOnScreenDebugMessage(-1, 10.0, FColor::Green, FString::Printf(TEXT("RedTeamPostlogin")));
            }
            else
            {
                MPGameState->BlueTeam.AddUnique(MPPlayerState);
                MPPlayerState->SetTeam(ETeam::ET_BlueTeam);
                if (GEngine) GEngine->AddOnScreenDebugMessage(-1, 5.0, FColor::Green, FString::Printf(TEXT("BlueTeamPostlogin")));
            }
        }
    }
}

winged badger
#

Its where controller ans PS are reinstantiated with new class

fiery eagle
winged badger
#

Someone not on mobile, please provide a code formatting lesson πŸ˜‚

quasi tide
#

Surround your code in three backticks it is the ` key. On a QWERTY keyboard, the key next to the 1.

fiery eagle
#

Sorry Fixed

quasi tide
#

That's not fixed, lol

winged badger
#

3, not 2

fiery eagle
#

Forgot for a moment how to do that

quasi tide
#

This is how

#

After the first three backticks, you can put in "cpp" to give syntax highlighting too.

fiery eagle
#

Ok will try this method

stoic lake
#

does the gamestate replicate by default?

winged badger
#

That looks like it belongs in AMPGameState::AssignTeamFor(APlayerState* NewPlayer);

#

Not in GameMode

quasi tide
winged badger
#

Then you can just call the GS function instead of duping code

winged badger
#

Its replicating, and it has to replicate

#

One of the few guarantees you get with Unreal replication - GameState will replicate before any Actor on Client calls BeginPlay

fiery eagle
quasi tide
#

This is because GS is what tells the worldsettings to kick of the begin play stuff

#

If you're curious about the process, I outlined it here: #cpp message

fiery eagle
winged badger
#

3 `s before and after code block

quasi tide
#

It is just how I said. Surround your code with three `. Then, if you want to add syntax highlighting, add in a language after the first three backticks. Most often in UE's case, it'd be cpp.

fiery eagle
winged badger
#

Another point: why on screen messages when you have a debugger?

stoic lake
#

I'm trying to get the gist of replication, but don't understand why when pressing 1 on the server, the print only happens on the server, and when I press 1 on the client, the print happens on both the client and the server

fiery eagle
winged badger
#

You cook content for windows, you set your target to DebugGame in IDE and press F5

#

Then you just put breakpoints in code with F9 and see whats going on

#

Step by step

fiery eagle
#

You mean to say i can use debbugger in a packed built as well 🀯

winged badger
#

Yes

fiery eagle
#

Iam So noob

winged badger
#

Not sure if any game would end up getting finished without that

fiery eagle
#

like what is cook content

winged badger
#

You need target thats not Editor

#

You can package the game fully or just cook content, doesnt really matter

#

Options are right next to each other

fiery eagle
#

Yes i remember now

fiery eagle
#

i love how in game dev every day i learn something newβ™₯️

winged badger
#

That isnt going to change with time either

dark edge
late grove
hardy monolith
#

You are my saviour

rocky bobcat
#

Hey, where would be the best place to store a reference to a players character pawn so that it can be repossessed later?

dark edge
#

that or playerstate

round mist
#

This is being run on the client and the server but giving slightly different locations. Any idea why that might be?

rocky bobcat
dark edge
round mist
#

Right right.

#

Thanks!

pearl bear
#

Hi, I'm having difficulty organizing my Multiplayer gameplay code. Should I separate the cosmetic stuff and the game logic stuff and call it in different methods? For example, my character can cast spell. How should the client call the method I created to do this? The first thing that comes to mind is the client invokes the method of doing the magic with a server RPC call. But then how will the act of doing this spell be distributed to other clients?
The other obvious question that stuck with me is when I make a server RPC, does this RPC call run on the server version of the actor that the call is made from?

worthy wasp
# pearl bear Hi, I'm having difficulty organizing my Multiplayer gameplay code. Should I sepa...

going back to Cedric's NetworkCompendium and hte years that I had invested into multiplayer frameworks... there are a few ground rules to go on.... but it also depends on the server type - as ListenServer is worlds different from DedicatedServer. In my own experience i had more luck and easier times with DedicatedServer than Listen - because it takes the player out of the loop... Listen server adds in more checks & balances throughout your code to ensure you are server (or not) and what to do in that case.

DedicatedServer:
Anything that is visual effects doesnt belong on the server - its overhead that doesnt need to be done - as there is never a player that plays as its entity. If you need others to see the VFX you intend to spawn (fireball, waterbolt, etc...) then you need to spawn them with a NetMulticast RPC.

Anything that is a game altering event - do damage, affect stats, manipulate movement component, needs to be done on the server,. The puck doesnt stop there - and you'll have to playtest 2 players minimum to see that each player sees the other's code changes if it needs to be replicated out to the other players attached. Soemtimes I found that you still have to do a NetMulticast RPC to make changes take effect on remote clients. I found this portion to be most non-consistent.

Anything that is done locally (but needs authority) still needs to be handled through an RPC with netmode set to OwningClient.

My highest suggestion is to debug thoroughly using print strings & ensure the thing syou NEED to replicate are indeed pulled off to each remote client, and that'll be the best way to learn replication. Have this at your browser always - its a great resource & good read to understand the core classes & lifecycles in effect: https://cedric-neukirchen.net/Downloads/Compendium/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf

pearl bear
pearl bear
rose pollen
#

so it seems sets and maps can't be replicated, what is the standard way to replicate some like a map if that is what you need, do I basically need to make my own class that replicates a keys array and a values array?

worthy wasp
# pearl bear I want one of the players to act as a server in my game, but at the same time, I...

This is called ListenServer... the harder of the 2 types to code against. Its because one player has full authority - and that needs to be handled with the utmost care obviously.

This is also a design question - "do I care about the fact that someone could go out of their way to design cheats for this game?" If your answer is yes - then you are welcomed to some gruelsome code practices that make you a stronger/better network architect in Unreal.

worthy wasp
pearl bear
pearl bear
worthy wasp
pearl bear
#

and story based, so dedicated server way cost a lot

#

and there is no point to maintain that much server

worthy wasp
#

then do it the zero cost way and design your game for ListenServer connectivity

#

this fits most console style gaming - where one client HOSTS the game, and others connect to it (typically via some Friends/Online subsystem)

pearl bear
pearl bear
deep coral
#

when using seamless travel, how do I completely reset the Game Mode, player controllers, game state etc, I don't want anything to persist and I want them to be reinitialised

#

so begin play, contructor function will be called again etc

fathom aspen
#

GameMode and GameState won't persist to destination level by default but to transition level, so they shouldn't be an issue. You're here because PlayerControllers are persisting. For ez mode make sure that PlayerController class is different on the destination and source levels. It's even a good practice anyways...

#

For the mark the pins has a persistent data compendium

fathom aspen
#

Wow, TIL:

  1. Subobjects (including ActorComponents ofc) don't need to be replicated for them to fire RPCs. Their owner/outer actor should be though.
  2. Subobject that isn't replicated, neither stably named, will be replicated (in the sense of created from replication not that it bReplicates) to client if you fire a reliable client/multicast RPC on server. Looking at the code, a server RPC shouldn't do a similar effect on server.
thin stratus
silver remnant
thin stratus
#

Still not sure what your actual problem is

#

First you say you store stuff on the server and now we are talking about traveling :D

#

Can you please explain the full setup and what you are trying to do

#

Otherwise no one will really be able to help

silver remnant
thin stratus
#

OpenLevel opens a new level

#

Not sure what that would have to do with Characters

#

It would cause you to travel to the new map, which is most likely a hard travel, so all Actors will be destroyed and the match cycle will cause a new GameMode and all its relevant classes to be spawned, including, if you use the DefaultPawnClass, a new Character

silver remnant
#

I see, but in your case how did you load your character?

thin stratus
#

What do you mean with load

#

Again, you have to be more specific

#

?Name= question you had is a C++ thing

#

If you can use C++, then you can alter that stuff

#
ULocalPlayer* LocalPlayer = GEngine->GetFirstGamePlayer(this);
if (LocalPlayer)
{
    // Send the player nickname if available
    FString OverrideName = LocalPlayer->GetNickname();
    if (OverrideName.Len() > 0)
    {
        PartialURL.AddOption(*FString::Printf(TEXT("Name=%s"), *OverrideName));
    }

    // Send any game-specific url options for this player
    FString GameUrlOptions = LocalPlayer->GetGameLoginOptions();
    if (GameUrlOptions.Len() > 0)
    {
        PartialURL.AddOption(*FString::Printf(TEXT("%s"), *GameUrlOptions));
    }

    // Send the player unique Id at login
    Connection->PlayerId = LocalPlayer->GetPreferredUniqueNetId();
}
#

That happens in UPendingNetGame::NotifyControlMessage when the Client sends the Login message after being challenged.

#

Means, if you add your own ULocalPlayer class, you can override GetGameLoginOptions and pass over more data in the same format. I wouldn't change the ?Name= part.

#

You can only pass strings though, so not actual objects.

#

@fathom aspen I think you should add this to your Compendium page

#

I only used that in the past to pass over UniqueIDs that the Client had in a more complex Server/Client model

#

But it allows passing over some data on connection from client to server

#

Which is available in PreLogin and Login in the GameMode

silver remnant
#

So first time a user logs in the game it loads a headless, but the second time when a user logs in it loads the character correctly

thin stratus
#

That's probably your code. I still don't know what you mean with load

#

If you join a Server and you properly connect etc., you will get a PlayerController, and if you have a DefaultPawnClass in the GameMode (or similar setup), you'll get a Character spawned for you.

#

Anything beyond that you'd need to tell us what you are doing

#

Cause just from this, there is no reason for a Character to be headless or not

hollow swallow
#

What would be the best way to do enemy name plates that scale for each player based on distance in multiplayer?

silver remnant
silver remnant
peak sentinel
hollow swallow
#

i want to rotate something but only for the local client, how can i do this? im trying to rotate my world space health bars above enemies, but if more than 1 player is close, it will fight between the 2 rotations. can i make it so only the local client sees the rotation so it wont fight between them all?

oak oracle
#

Hey i have read docs about GM and GS and stil didn't get what is the difference between them . They are both pretty similar why to not handle eveything in GS ?

chrome bay
#

Difference is that GS replicates and is available to clients. GM is not

hollow swallow
#

When i hit a tree thats placed with the foliage tool, i want to remove it and place an actor there (so i can damage it) but for some reason it only works for the host and not the client. am i doing this wrong?

#

it still spawns it as the client, but doesnt remove the instance of the tree

stiff oracle
#

Hey Guys, why won't my friend find my sessions? I already forwarded all the ports needed, I am using Steam Online Subsystem. Please any help or insight would be immensely useful

livid sluice
#

I'm Having an issue with getting the tick even to work with get actor location.
I have this code running on the tick event.

#

its connected to this here

#

But what its logs is confusing

#

Even without moving, it gives me very different values

#

I know there might be better ways of doing this, but I want to know why this happens

chrome bay
#

Why is that a Client function hidden behind an authority switch..? Bit wierd

#

Also the only logical explanation is that is is moving

livid sluice
#

When I move the only item that changes is the top most value the 3 values below that wont change at all. The next value is the same as the top value and it continues.

#

I thought it was something to do with the actor so I created a new actor and got the same result.

jolly siren
#

I'm sometimes getting corrections with a quick dash CMC movement ability. The corrections don't happen when move combining is completely disabled. What does that normally mean is wrong? The only thing I currently see wrong is that I'm relying on GetWorld()->GetTimeSeconds() within CalcVelocity

chrome bay
#

Would make sense, the Server will simulate the "combined" move in a single frame - so any reliance on timestamps may break

livid sluice
#

Okay I figured it out, it was so stupid >.> I had duplication of the character in other locations.
Even new characters had the same controller which uses the tick so it caused the different values.
I'm kicking my self rn

jolly siren
#

Right that makes sense, I feel like something else is setup wrong but I should fix this first. I'm trying to change the player's speed based on a curve, which takes a timestamp. Not sure the correct way to do that from within CalcVelocity

chrome bay
#

Hard for me to say, but you'd probably have to store the timestamp outside of the movement update loop, then increment it by the internal movement simulation delta time during the move

#

So you would need to start the dash, store the timestamp, then increment that timestamp with DeltaTime to get the lookup time into the curve

#

You probably would still get occasional corrections though I'd imagine unless the simulation timestep was locked

jolly siren
#

That makes sense, that's what I was thinking too. Where should I increment it? PerformMovement?

chrome bay
#

Yeah possibly, or maybe even with that calc function

#

So instead of storing the start time, store the "time through dash" and increment each time it's called

#

That might be more accurate

#

It would at least work with the server simulating big chunks of moves at once

#

But if Server + client are simulating with different timesteps I still think you'd probably get corrections now and again

#

But not sure.. it might be ok

jolly siren
#

Is there a way to make it work with different timesteps?

stoic lake
#

on which instances does the hud class exist?

chrome bay
#

Might be possible since the character sim is supposedly deterministic but I'm not sure, usually with any physics sim different timesteps mean different results

#

But.. CMC is substepped IIRC so the effects might be subtle at best

chrome bay
stoic lake
chrome bay
#

I think UT had a dash, might be worth checking their source code out @jolly siren

jolly siren
#

ah okay I'll crack that open

chrome bay
#

Not sure that it's time/cuvse based though

hushed heart
#

Hello! Stupid simple question that is stumping me a little, partially why I much prefer working with dedicated servers, but alas I must use a listen-server for this project.

How can I quickly and efficiently tell if the pawn I'm working with is on its owning client and not the server, unless this is indeed the listen-server's own pawn? The issue being I believe all the remote pawns on the server are considered autonomous proxies and have authority, so I'm struggling to be able to distinguish them. I just want to be able to tell if we're on the pawn's own client, so I can apply, for example, some force feedback stuff to their controller. If anyone can point me in the right direction, I'd be super appreciative, thank you!

chrome bay
#

A mixture of IsLocallyControlled() and IsNetMode(NM_Client) should do it

quasi tide
#

Authority is which machine started the spawn process pretty much. So remote pawns do not have authority.

hushed heart
#

Remote pawns on the listen-server would have authority though, is that not correct? If the server is responsible for spawning and replicating them?

chrome bay
#

yep

#

Just note that Authority != Server

#

Which is why you often need to use the more specialised tests depending on the context

quasi tide
#

Listen server is the server, so it would make sense that the pawn has authority. Because that is the instance that started the spawn process.

hushed heart
#

Thanks Jambax, but mm. In that case, IsLocallyControlled and IsNetMode(NM_Client) sounds like it makes sense, though does a Listen-Server also consider itself a client in that regard? Just trying to make sure I can check if the pawn happens to be the listen-server's own pawn.

chrome bay
#

Listen Server would not be a client

#

The local users' pawn on the listen server would have authority, would be NM_ListenServer and would be locally controlled

#

NetMode is the local net mode of the game instance

#

So that's really the only definitive "am I a server" or "am I a client" test

hushed heart
#

Okay so, "Is Locally Controlled AND (am a client OR (am a listen server AND have authority)) should give me true only if the pawn is the owning client's, or is the owning listen-server's own pawn, does that make sense? blobsmilesweat

chrome bay
#

yeah I would think so

hollow swallow
#

I just noticed some of my enemy's sort of desync a bit sometimes. Is that normal in the PIE?

#

They'll teleport 5m away from me but still be attacking

hushed heart
#

Ah! I think I just realised the true source of my confusion. Right okay, thank you both!

hollow swallow
#

Or is it something I've done πŸ˜‚

magic furnace
#

never had that

stoic lake
#

I'm not sure how to disable controls for both the server and the client, right now it's only disabling the controls for the client. This is in a playercontroller class

faint eagle
#

what is the correct way to get FUniqueNetIdPtr from PlayerState on both clients and host/server?

chrome bay
#

GetUniqueId()?

#

It's set by server and replicated

agile loom
stoic lake
#

doesn't work for some reason

faint eagle
stoic lake
agile loom
stoic lake
agile loom
stoic lake
#

Hmm doesn't work either

#

but I think it might be because of the fact that the character sometimes get spawned before the playercontroller gets instantiated

#

because some of my spawning logic also gets messed up from time to time

#

nope didn't work either haha

#

So weird that it does work on the server

agile loom
stoic lake
agile loom
stoic lake
#

I tried doing it with a self reference but that gives the same result

#

or is there a different node?

agile loom
# stoic lake

Most of the time controller is still invalid at Begin Play, Try this (in the character class)

agile loom
# stoic lake

Everything is working, you just call the function in the wrong place

stoic lake
agile loom
stoic lake
#

this doesn't seem to work either, even though it's pretty dirty

stoic lake
#

yeah

#

from beginplay I assume?

agile loom
stoic lake
#

Yeah I'm not sure what's happening either

agile loom
stoic lake
#

No that was to show that the client also runs through the logic with the print string

#

but it doesn't set the ignore move input to true

agile loom
stoic lake
#

No

sinful tree
#

If you're running as a listen server, then you would have two player controllers. One would return local for the server, and the other would return local on the client.

stoic lake
#

I am running as a listen server

#

But that would still mean that the input should get ignored

#

all the other functions work perfectly fine, even the ones with references to self

#

Using this node does work for some reason, starting to think it's a bug or something

agile loom
stoic lake
#

I guess I'll just go with the ui only input mode as that seems to work fine, and players will have to interact with the ui anyway in the lobby

#

thanks for the help anyway :)

ember tendon
#

Hey is there any one that have experience with unreal engine Steamcore multiplayer setup which is non region locked?

frail barn
#

controller makes an rpc to seek target and do damage, then calls a custom event in fighting unit parent class
widget element is updated, if i use every tick, but not updated, when i call a custom event to update
what is wrong?

graceful flame
#

Use the built in apply damage and any damage events

#

Then on the any damage event you setup functions to subtract health or add negative damage for healing.

dark edge
#

why not just save your widget as your HP BAR Heroes type and save yourself the hassle

frail barn
# dark edge why are you casting here

i'm casting, because i use a parent widget as an overhead widget component of a character
i dont understand what u mean "why not just save your widget as your HP BAR Heroes type"
widget is saved as a parent user widget class, is it bad?

frail barn
clever hound
#
AGrippableActorBase* TryCast = Cast<AGrippableActorBase>(OutOverlap[0]);
            if (TryCast)
            {
                ActorInRight = TryCast;
                ActorInRight->GrippableMesh->SetSimulatePhysics(false);

                FName AttachSocket = ActorInRight->RightSocketToAttach;
                ActorInRight->AttachToComponent(GetMesh(), FAttachmentTransformRules::SnapToTargetNotIncludingScale, AttachSocket);```
```cpp
ActorInRight->DetachFromActor(FDetachmentTransformRules::KeepWorldTransform);
ActorInRight->GrippableMesh->SetSimulatePhysics(true);```
When attaching to the socket "AttachSocket" in the AttachToComponent it attaches it fine and all but when I use the DetachFromActor after that, ON THE CLIENT it always sends the actor about 50 meters to my right. When playing on the server it works and if I remove the AttachSocket from the AttachToComponent and just attach it to my mesh it works on the client too when using the DetachFromActor
#

How tf can that be possible

#

The collision settings are all good

#

All of that is run on the server

vocal dirge
#

Hey everyone, im trying to get a problem solved with instanced foliage and don't have luck so far, can anyone confirm that removing a single instance works both on the client and server in ue 5.1 (blueprint)?
Calling this from a multicast only removes the server instance, the client stays no matter what i try πŸ€·β€β™‚οΈ

upbeat basin
#

So there is Online::GetSessionInterface(UWorld) from OnlineSubsystemUtils.h and Online::GetSessionInterface(FName) from Online.h and they return different objects? πŸ€”

clever hound
clever hound
#

But the solution is still unclear

abstract pike
#

hello everyone, what would this close reason indicate caused the connection close?

LogNet: UChannel::ReceivedSequencedBunch: Bunch.bClose == true. ChIndex == 0. Calling ConditionalCleanUp.
[2023.03.15-18.22.54:700][788]LogNet: UChannel::CleanUp: ChIndex == 0. Closing connection. [UChannel] ChIndex: 0, Closing: 0 [UNetConnection] RemoteAddr: , Name: IpConnection_2147482468, Driver: GameNetDriver IpNetDriver_2147482504, IsServer: YES, PC: BP_RTSPlayerController_C_2147482328, Owner: BP_RTSPlayerController_C_2147482328, UniqueId: NULL:DESKTOP-25EVTNG-
[2023.03.15-18.22.54:700][788]LogNet: UNetConnection::Close: [UNetConnection] RemoteAddr: , Name: IpConnection_2147482468, Driver: GameNetDriver IpNetDriver_2147482504, IsServer: YES, PC: BP_RTSPlayerController_C_2147482328, Owner: BP_RTSPlayerController_C_2147482328, UniqueId: NULL:DESKTOP-25EVTNG-, Channels: 403, Time: 2023.03.15-18.22.54
[2023.03.15-18.22.54:700][788]LogNet: UNetConnection::Close: CloseReason:
[2023.03.15-18.22.54:700][788]LogNet:  - Result=ControlChannelClose, ErrorContext="ControlChannelClose"
[2023.03.15-18.22.54:700][788]LogNet: UChannel::Close: Sending CloseBunch. ChIndex == 0. Name: [UChannel] ChIndex: 0, Closing: 0 [UNetConnection] Remot
fathom aspen
fathom aspen
fathom aspen
#

I was however amazed by #2, as someone could abuse it to account for deterministically spawning stably named ActorComponents just by firing RPCs πŸ˜„ @peak sentinel

fathom aspen
fathom aspen
#

Fire a reliable client RPC on an server-only spawned ActorComponent and you have a linked ActorComponent both on server and client (linked in the meaning that it's identified by NetGUID)

wooden abyss
#

Is it possible to wrap a map inside of a struct to be able to replicate that map?

#

Well thats gonna be a tough one for me then πŸ₯²

#

Thanks @tender jay

fathom aspen
#

I mean I replicated a TMap recently but I was kinda forced to do that

wooden abyss
fathom aspen
#

Custom net serialization, but it only works becasuse the Objects on the TMap were archetypes

#

If they aren't then you're out of luck

wooden abyss
#

Well I might already have an idea on how to work around that

#

So I guess I'll just not bother with that πŸ˜‚

fathom aspen
#

Literally just serialize the Object that has the TMap into a byte array and replicate that and deserialize that on client

prisma snow
fathom aspen
#

I needed to do it that way because the Object that had the TMap had tons of other stuff that all needed to ready at the same time on client for an atomic operation

fathom aspen
quasi tide
fathom aspen
#

Nah, ULocalPlayer::GetGameLoginOptions

#

It's really flexible in the sense that you can have a centralized function that takes care of the options for you ^^

#

So you don't have to do it manually each time you do a travel

#

I always wondered where the Name option came from but I didn't dig deep enough to find that. But now we know at least XD

#

I will have to double check that the options string is cached here for clients, so I indeed say that it's cached for clients πŸ‘‹

twilit radish
#

Pretty sure it gets set somewhere during the connection process. Don't see why they would change it afterwards. But definitely can't hurt to check, it's been a bit since I looked at it πŸ˜›

pearl bear
#

I create an actor with NewObject and then spawn with FinishSpawning(), but I can't see the spawned actor on my clients even though the replication flag and net load on client are open. When I spawn the same actor directly with GetWorld->SpawnActor it works fine. What am I doing wrong with FinishSpawning?

hollow eagle
#

you cannot create actors with NewObject

#

UWorld::SpawnActor or UWorld::SpawnActorDeferred are the only ways you should be spawning actors.

pearl bear
dim trail
#

why cant tmaps be replicated?

hollow eagle
#

because epic never implemented it

uneven kraken
#

Anyone know if there're any (very very rough) estimates for when Iris Replication will become a production-ready feature?

Or rather, since it's officially marked as "experimental", does this mean it hasn't even been confirmed if the Epic team have committed to developing this feature through to completion?

tender gale
fossil spoke
#

Experimental can range from "we might drop this feature without notice" to "we are nearing completion and to expect API changes but it could be ready soon".

#

Iris will likely be in experimental for a few more versions, its quite a decent underlying change and will need to be battle tested thoroughly.

rocky kestrel
#

This is how I set lean boolean variables

#

This is c++ interface to get those variables

#

This is in c++ animinstance to set those replicated variables to animBP

#

then I use those to rotate spine in anim graph

#

Problem is when one client lean then all players lean

#

(First image just demostration. In game Leaning happens with keys Q and E etc.)

#

This is from interface.h

cedar finch
#

Are replicated moving platforms possible in blueprint alone, or do I have to edit the CMC in C++ in order to make clients not "jitter" while standing on them?
I havent found a clear way of achieving it anywhere online.

elfin copper
#

guys, bReplicates = true; is causing my weapon to spawn twice for each client, but without it animations won't play for them, thoughts?

quasi tide
#

One spawn is from the server and one spawn is from the client.

chrome bay
#

When CMC is standing on something, it's movement becomes "relative" to that base. That only works if the base itself is network addressable

quasi tide
elfin copper
pearl bear
#

I have a TArray object that I marked as Replicated. I fill this object with a server RPC in my actor component. Afterwards, when I make a Multicast RPC call using the data in this TArray, I see that the Array values are null . What could be the reason for this?

latent heart
#

Why is it marked as replicated and multicast?

#

Drop the multicast.

#

If the tarray has values, but they're all null, it's for 1 of 2 reasons: 1) The array hasn't finished replicating (only its structure has) or 2) The elements in the array aren't replicated. I assume they are uobjects/components/actors.

#

Just adding an object to a replicated array does not mean that that object itself is a candidate for replication.

#

Just that the reference to it in the array will be replicated.

pearl bear
latent heart
#

Maybe I misinterpreted. You're not multicasting the array itself as a parameter?

pearl bear
latent heart
#

And the spells themselves are set to replicate?

pearl bear
#

they are AActors

latent heart
#

That isn't what I asked.

#

Actors don't replicate just because they are actors.

pearl bear
latent heart
#

Alrighty.

#

Do they exist on the client?

#

Have you tried doing a debug check like for (ASpell* Spell : TActorRange<ASpell>(GetWorld())) { log(I'm alive!); }

#

You may want to set bAlwaysRelevant to true.

pearl bear
#

When I cast a spell actor is visible on both client and server

latent heart
#

So you're 100% sure the actor is on the client and it's been replicated from the server and not spawned locally?

pearl bear
#

when I cast a spell, its visible both on server and client

#

net load on client is checked

#

so I think when I spawn object on server its getting spawned on client to

latent heart
#

How are you spawning them?

dim trail
#

why wont my array populate?

void UInsertCardListView::StartCreatingCardList(UInventoryUI* Parent, UInsertCardDisplayUI* CardDisplayParent, int32 Index, FInventorySlot InventorySlot)
{
    ParentUI = Parent;
    CurrentIndex = Index;
    ParentCardDisplayUI = CardDisplayParent;

    Server_AddWidgetToArray(Index, InventorySlot);

    RefreshCardListSlot(InventorySlot);
}

void UInsertCardListView::Server_AddWidgetToArray_Implementation(int32 Index, FInventorySlot InventorySlot)
{
    FIndexToInventorySlot IndexToSlot;
    IndexToSlot.Index = Index;
    IndexToSlot.InventorySlot = InventorySlot;
    ItemIndexToSlotArray.Add(IndexToSlot);
}

.h:

    UPROPERTY(EditAnywhere, BlueprintReadWrite, Replicated)
        TArray<FIndexToInventorySlot> ItemIndexToSlotArray;
latent heart
#

Are you expecting the server call to finish and replicate the result before the refresh call?

dim trail
#

i just need it to add to the array

#

it only adds one instance, i have this class being called twice because there are 2 widgets being made, but it only populates 1 time

pearl bear
latent heart
dim trail
#

it doesnt need to

#

if im reading your question correctly

latent heart
#

Idk what refresh even does. I'm asking if you're replying on the replication happening before refresh does what it's meant to do...

#

If the answer is no or it's not relevant to your problem, just say so.

modern cipher
#

onrep is probably better to call RefreshCardListSlot

latent heart
#

It depends if he's asking why it won't populate on the server or on the client, though.

dim trail
#

So, what Im doing is populating a scrollbox with widgets, and Im adding the widget to an array so I can make some logic to where I can only select one widget at a time

#

I get the information of all the widgets currently in the scrollbox from the array(that is the idea)

#
void UInsertCardListView::RefreshCardListSlot(FInventorySlot InventorySlot)
{
    //Propagate widget into card list

    FInventoryItem OutInventoryItem;
    ParentUI->PlayerInventoryComponent->GetItemDataFromSlot(InventorySlot, OutInventoryItem);

    NameLabel->SetText(FText::FromName(OutInventoryItem.ItemName));
    IconImage->SetBrushFromTexture(OutInventoryItem.ItemIcon);
}
latent heart
#

You're completely ignoring the things you're being told/asked

dim trail
#

RefreshCardListSlot has nothing to do with what im trying to accomplish

#

So, what Im doing is populating a scrollbox with widgets, and Im adding the widget to an array so I can make some logic to where I can only select one widget at a time I get the information of all the widgets currently in the scrollbox from the array(that is the idea)

latent heart
latent heart
lusty sky
dim trail
#

it gets called twice

#

because there are 2 widgets being populated

#

so, the array should populate 2 values

#

it only ever adds one

lusty sky
#

where is it being called twice? this is what i see
StartCreatingCardList() function calls Server_AddWidgetToArray(Index, InventorySlot) one time only

#

where is the code that creates entries for the list view?

fossil stratus
#

When I save player actors to a replicated array on the server, will clients be able to reference the actor correctly from their version of the array? Or do server and client references differ for spawned actors?

dim trail
#
for (const auto& InvenItem : InventorySlot)
    {
        FInventoryItem OutItem;
        if (!PlayerInventoryComponent->GetItemDataFromSlot(InvenItem, OutItem))
        {
            continue;
        }

        const FGameplayTag FirstTag = OutItem.ItemDescriptionTagContainer.First();
        if (CardIdTag.MatchesTagExact(FGameplayTag::RequestGameplayTag("Equipment.Type.Card.Weapon")))
        {
            if (FirstTag.MatchesTag(WeaponTag))
            {
                TArray<UWidget*> InventorySlots = SB_Cards->GetAllChildren();
                int32 CurrentIndex = InventorySlots.Num();
                UInsertCardListView* CardSlotDisplay = CreateWidget<UInsertCardListView>(this, W_CardListView);
                CardSlotDisplay->StartCreatingCardList(Parent, this, CurrentIndex, InvenItem);
                SB_Cards->AddChild(CardSlotDisplay);
            }
        }
        else if (CardIdTag.MatchesTagExact(FGameplayTag::RequestGameplayTag("Equipment.Type.Card.Armor")))
        {
            if (FirstTag.MatchesTag(ArmorTag))
            {
                return;
            }
        }
    }
#

CardSlotDisplay->StartCreatingCardList(Parent, this, CurrentIndex, InvenItem);

#

there are 2 slots currently, so it gets called twice

modern cipher
#

i think a listview takes only an object payload for each entry and it handles creating widgets when you call additem

dim trail
#

is it because im adding to an array of an instance of a class?

#

its an old name, we were using listview but decided on adding children to a scrollbox

modern cipher
dim trail
#

nope, i expect the array to populate 2 items

modern cipher
#

oh

#
int32 CurrentIndex;
if (InventorySlots.IsEmpty()) 
{ CurrentIndex = 0; }
else { CurrentIndex = InventorySlots.Num() - 1; }
dim trail
#

i was right in my assumption

#

i cant add to an array from an instance of a class to another

#

i put the array in my component and it fixed the issue

steady cape
#

Does DOREPLIFETIME handle repnotifiable properties or should I use DOREPLIFETIME_CONDITION_NOTIFY?

chrome bay
#

It handles it

#

DOREPLIFETIME_CONDITION_NOTIFY is for when you want to change the notify method

steady cape
#

πŸ‘

vestal pagoda
#

does anybody here know how does unreal behave with an array of objects being replicated? On the client side, the size of the array seems to be fine, but the items in an array are all unknown

#

all the references are there on the server side

chrome bay
#

Means the objects themselves aren't replicated

#

An array of objects is just an array of references to them, the objects htemselves also need tobe resolvable

short void
#

does anyone have some good documentation and best practices for destroying sessions for the steam online subsystem? I'm not seeing a lot of info in the official documentation

vague fractal
#

I've got there an connection timeout problem where i'm not quite sure how to fix it.
I'm able to join a session created on a different PC. This join leads into loading the "Lobby" level, works just fine.
But when i want to do an server travel to an actual map which isn't empty only the listen server will properly join it.
The client which should also join sees something of the map, but in a frozen like view. After some time the client gets the time out visible through the logs

Error: UEngine::BroadcastNetworkFailure: FailureType = ConnectionTimeout, ErrorString = UNetConnection::Tick: Connection TIMED OUT. Closing connection.. Elapsed: 60.02, Real: 60.01, Good: 60.01, DriverTime: 65.99, Threshold: 60.00
...

Any idea besides just increasing the allowed time and praying it fixes it ?

thin stratus
#

@vague fractal is this using an online subsystem?

vague fractal
thin stratus
#

Are you seamless traveling?

#

From lobby to next map?

#

Cause steam doesn't like the hard travels

vague fractal
#

I'm doing an hard travel as i can't use a seamless level on levels which weren't loaded before afaik

thin stratus
#

That's not true though

#

And you are required to do seamless here

vague fractal
thin stratus
#

Seamless just means that the clients don't disconnect but get parked on a transition map

#

Pretty sure the first way they list is Singleplayer

upbeat basin
#

Is it normal that I get a crash from calling GetWorld() and GetGameInstance() functions (trying to get the controller to travel to the session host) on the result callback delegate for IOnlineSessionPtr::JoinSession function? Only happening in packaged (development) game, no issues for the editor

vague fractal
thin stratus
#

:x

#

Just try it

#

You won't get rid of the disconnects without it

#

I coded enough multiplayer games, including for steam, that you can trust the fact that you will want and for steam need seamless traveling

#

For server travels that is

thin stratus
vague fractal
#

I mean, i'm fine in trusting you as the docs aren't always great, but the docs straight up say a hard travel is needed πŸ˜…
Will try it in either case as i don't have much options here xD

thin stratus
#

My lobby kit on the marketplace travels from lobby to gameplay seamlessly

#

Idk what they mean with the first way they list

vague fractal
#

Just in case tho, since steam seems to be some special case here.
Will the modified code mess up if i'd switch to e.g. the EOS subsystem ?

thin stratus
#

Haven't used eos. Your game should favor seamless server travels either way

#

Epic should also say somewhere on that page that you should seamless travel whenever possible

vague fractal
#

EOS was just an example, any subsystem would be an option here if it helps to answer it ^^

thin stratus
#

Steam is just not good with the clients reconnecting

#

Idk how other subsystems react to it

#

But again, you should not hard travel with server travels anyway

vague fractal
#

Alright, thanks for all the info.
I'll try to use a seamless travel and see if it fixes it. Update sometime soon ℒ️

upbeat basin
thin stratus
latent heart
#

It should use the gameinstance's? Which is updated when you travel. Maybe it's invalid while travelling, though.

upbeat basin
#

Is it travelling when joined to a session?

#

I'm trying to get world to get the controller to call the travel. So I'm not travelling, manually at least, yet while trying to get the world

latent heart
#

Maybe check the source and see what it does!

thin stratus
#

UGameInstanceSubsystem doesn't override GetWorld()

#

It has no valid World :D

#

You can try getting it directly from the GameInstance I guess

upbeat basin
#

GetGameInstance() also crashes though

#

But this part is working without issues πŸ€”

void UNSSessionSubsystem::OnCreateSessionCompleted(FName SessionName, bool Successful)
{
    const IOnlineSessionPtr sessionInterface = Online::GetSessionInterface();
    if (sessionInterface)
    {
        sessionInterface->ClearOnCreateSessionCompleteDelegate_Handle(CreateSessionCompleteDelegateHandle);
    }
    
    OnCreateSessionCompleteEvent.Broadcast(Successful);
    if (Successful)
    {
        APlayerController* playerController = GetWorld()->GetFirstPlayerController();
        playerController->ClientTravel("BattleMap?listen", TRAVEL_Absolute);
    }
}
thin stratus
#

Hm

#

Maybe it auto gets it from Outer

#

Ah yeah it does

#
class UWorld* UObject::GetWorld() const
{
    if (UObject* Outer = GetOuter())
    {
        return Outer->GetWorld();
    }

#if DO_CHECK
    if (IsInGameThread())
    {
        bGetWorldOverridden = false;
    }
#endif
    return nullptr;
}
#

Can you post the Join Session etc. code please

upbeat basin
vague fractal
#

@thin stratus The seamless travel worked!
The documentations should really be edited when it comes to that :D
Thanks!

clever hound
#

How do you detach an actor from the socket so that on the client side it does not offset 50 units to your right. Is it some kind of bug with UE because attaching to a socket works fine but detaching it or getting the socket location to spawn a new item just makes it offset it a lot to the right
All of this called from the server:

    AGrippableActorBase* TryCast = Cast<AGrippableActorBase>(OutOverlap[0]);
            if (TryCast)
            {
                ActorInRight = TryCast;
                ActorInRight->GrippableMesh->SetSimulatePhysics(false);

                FName AttachSocket = ActorInRight->RightSocketToAttach;
                ActorInRight->AttachToComponent(GetMesh(), FAttachmentTransformRules::SnapToTargetIncludingScale, AttachSocket);```

```cpp
ActorInRight->DetachFromActor(FDetachmentTransformRules::KeepWorldTransform);
            ActorInRight->GrippableMesh->SetSimulatePhysics(true);```
#

Or do I have to send a client RPC just to send the socket location to the client and then spawn a new item using that

#

Or why does the socket location not replicate correctly

clever hound
#

Spawning a new item with NetMulticast works but ofc this is not a good solution

clever hound
#

Damn Unreal engine can sometimes be difficult to operate. Updating all socket and bone locations on the server were set off and once again had to scroll every setting to figure it out

#

Works now with the DetachFromActor

outer sphinx
#

Hi guys, one question. I made a "coin collection" system in a game project I have in unreal. The problem is that when I start the game as a server with 2 or 3 clients, I "log in" to each client with different accounts and when I collect the "coins" it adds the coins in all the accounts logged in at the moment. The query in the database is well formulated, I don't know what it could be, maybe replication problems? I really appreciate your help, thank you very much.
I think the problem is that the query when the coin is grabbed is generated in all the clients, how can I make it so that the query is generated only in the client that "grabs the coin"?
That is the function that saves the information in the database table, and the function that adds +1 when you hover over the "coin"