#multiplayer

1 messages Β· Page 88 of 1

dark edge
#

you want a run on server event between the input and the actual interaction

#

You using an interface or component for interaction?

static prism
#

hi i need help i have two charactes and each one have a life but when one attacks the life is change just for one in the his screen and the life that changes is both no just one

dark edge
#

Show your code

static prism
#

the first screen attacks but just the another changes

#

i already replify the var life but nothing works

dark edge
#

the code

#

show how you're changing it

static prism
#

this is damage

#

simple

#

the damage

dark edge
#

ok that looks fine, show how your health bar is getting the health to display

static prism
#

and the life changing on screen

dark edge
static prism
#

i set the reference to the pawn but i dont know if its the correct

dark edge
#

you aren't showing the health of the pawn it's on, you're showing the health of the 1st character on the server, in both health bars

static prism
#

without mention anothers

dark edge
static prism
#

but i dont know how to take your own character and show it

dark edge
#

I'm assuming that's meant to be a ref to the character this hp bar is for

#

What creates this widget? Is it in a WidgetComponent?

dark edge
#

At begin play in the pawn, set HEro ref to self

static prism
#

component on the character

dark edge
#

yes so the character can tell the widget which character it cares about

#

get widget component -> get widget -> cast to YourWidgetClass -> set HEro ref

static prism
#

hmm ok

dark edge
#

You might need to expose it, it looks like it's private

static prism
#

the variable?

#

i think that i know

#

its works thanks

#

but not in the begin play

#

because

static prism
static prism
# static prism

and this do the inverse and set that my object or pawn in the index 0 will be the character

#

but whatever thanks

#

help me a lot

#

more one question its for best practice, do my status character have to be in the pawn or in the playercontroller?

dark edge
#

what

#

That makes no sense

#

If the pawn has the health, then care about the pawn.

static prism
#

hmm ok, I was in doubt because of this text on the unreal site

Also, in some cases, putting input handling or other functionality into the PlayerController is necessary. The PlayerController persists throughout the game, while the Pawn can be transient. For example, in deathmatch style gameplay, you may die and respawn, so you would get a new Pawn but your PlayerController would be the same. In this example, if you kept your score on your Pawn, the score would reset, but if you kept your score on your PlayerController, it would not.

#

but i undestande know

limber gyro
#

hey guys, im trying to join a friends session but never, they can join my sessions fine

#

gives the following errors

#

[2023.05.29-22.49.58:892][634]LogOnlineSession: Warning: STEAM: Session (GameSession) already exists, can't join twice
[2023.05.29-22.49.58:892][634]LogBlueprintUserMessages: [BrowserCell_C_2147479137] failed to join session

#

the last error is a print i added

fleet viper
#

it means that you are already in a session and therefore need to destroy your current session before joining

fleet viper
limber gyro
cyan drift
#

Hey, can someone tell me if an replicated UObject can have an replicated array of UObject? I have an weapon(UObject) and in this weapon I have an replicated array of attachments(UObjects). The client can call the function to add attachments on server but when trying to get this array it has the correct length, but all the items are null. On the server it's all fine. I've done the steps to be able to replicate an UObject and it's working, the Item array on the inventory component can be accessed by the client, I'm only having trouble with the attachments.

fossil spoke
cyan drift
fossil spoke
#

Same place.

timid moss
#

Does anyone know if there is an event on the server for when the level becomes initialized on the client? I see in UNetConnection there is ```C++
bool UNetConnection::ClientHasInitializedLevelFor(const AActor* TestActor) const

but I need an event, not necessarily a bool.
fossil spoke
#

This function in APlayerController

#

However it is only fired for Seamless Travels

#

I just noticed that its marked as a SealedEvent

#

Probably cant override it 😦

zenith pilot
#

I think this is a bug in the collab viewer template from epic games. Notice the outline around the car. Its black for one player and white for the other player. Its supposed to be red from the red player and blue from the blue player.

thin stratus
#

Was there a way to have a Client decide if they want to "receive" replicated data?
E.g. I have Struct with some Data that the Client predicts and in this scenario, I want to have a way to decide if the Client receives the Data based on the incoming Data.

I know I could decide this inside NetSerialize of the Struct, but is there a different way?

gray orchid
#

How would I go about getting the players current session info
for some reason I cant figure it out and I need it to keep working on my game

thin stratus
gray orchid
#

I need the current player count and the max player count

thin stratus
#

I don't know how up to date it is

#

But you should be able to get the Session from the Session Interface

#

When the Player joins a Session, it adds a NamedSession locally too. So you should be able to do "GetNamedSession" on the SessionInterface with e.g. NAME_Game to grab that Session info

#

I just don't know if the Client constantly keeps that up to date when new players join and leave

#

@gray orchid

meager girder
#

How do I handle procedural items(for my item/inventory system) with DataAssets? Do they replicate?

thin stratus
#

Since you usually don't modify those runtime (as they aren't instanced) you can also handle them as such

#

So if you set that in a Replicated Property or an RPC Parameter, they should replicate just fine.

meager girder
#

Would it be better to go with an object library instead then? πŸ˜„

thin stratus
#

Well, if you need to runtime modify them, then you either use Structs or UObjects.

#

Where UObjects need C++ (and an Actor) to be replicated

meager girder
#

I made it with UObjects, and replicated them by doing what epic does with AttributeSets, but I'm trying to figure out the best way to store the items, and create new instances of them. πŸ˜„

#

I want to be able to create them at runtime, using the stored versions as a "template" or base version of the item, where the items' stats will be rolled(generated) when instantiated

woeful ferry
#

If I turn off replication on a component on the client, will it stop listening to RPCs from the server?

quasi tide
#

Otherwise - I don't recall any other method πŸ€” (short of what you're saying)

thin stratus
#

Nope, the Data is actually inside a simulated proxy

#

I fixed the two cases I could repro by now

#

Via NetSerialize that is

#

Serialized the data into a local struct and compared

#

Works fine I guess

spiral rain
#

Hi guys, i wanted to make every player look their own way, but they look at the same spot on each client. This is really confusing me, could somebody help me?

kindred widget
fathom aspen
#

Also you don't turn off replication client-side but server-side

fathom aspen
quasi tide
#

Poll time - is there a server reliable way of verifying QTEs?

#

I keep thinking about it and just keep coming to the conclusion, "screw it - trust the client. It's easier"

fathom aspen
#

QTEs?

quasi tide
#

Quick Time Events

fathom aspen
#

Any examples?

quasi tide
#

So, think about repairing a generator in Dead By Daylight. A radial pops up on the clients screen. A hand (think like clock hand) goes in a circle and the client has to hit a button at the right time in order to pass the check.

woven bramble
#

How can I ignore a specific character for AI Perception?
I want to create a dying system, the most suitable method for my mechanism is the AI Perception method. When the character dies, I want to disable AI Perception for this player.
How can I do that?

quasi tide
#

How could the server verify that they really did do it correctly? πŸ˜…

#

Maybe have some tolerance level?

#

I'm sure I could come up with some fancy rollback or w/e. But that is just too much work 😭

kindred widget
spiral rain
kindred widget
# spiral rain yes

You need to only do this line trace if the pawn is locally owned. You need a SkipOwner, replicated vector. You need to set this locally on the locally controlled pawn. And send it through the ServerRPC for it to be set on server so that it can actually be replicated.

short arrow
quasi tide
fathom aspen
#

I do imagine a tolerance would be an ez mode solution

#

A tolerance that is ping driven saber

quasi tide
quasi tide
#

Or maybe have a mechanic where they can parry an attack at the right moment.

#

These fall under the same "style" of a QTE to me.

kindred widget
#

@spiral rain To cover on this a little more and explain better. The local player who owns this pawn knows where it is looking. The other machines, server included, do not know exactly where that player is looking.

So for the locally controlled pawn you locally do their movement and location set and rotation so that it looks and feels nice to the player using it.

Then you have that player send the location they're looking at through to the server. The server can then replicate this state to all other clients. All non locally controlled pawns can interpolate their updates on a non locally controlled branch of tick so that it looks mostly okay.

spiral rain
quasi tide
#

Unreliable server RPC on tick

thin stratus
gritty lantern
#

I've got a mechanic similar to BotW's Magnesis where I can pick up objects and move them around. The left stick controls the character movement and the right stick controls the object's movement. How would I replicate that from client to server? Is RPC the only way? It seems like a lot of information to send over the network.

kindred widget
gritty lantern
#

Alright, I'll give that a go. Thanks!

fathom aspen
dark edge
gritty lantern
dark edge
#

Specifically, it's making move structs and sending them over. It gets complicated but that's the gist of it

gritty lantern
#

yeah I was reading about the timestamping and merging similar moves

#

thanks!

woven bramble
short arrow
#

cast to your base character and check to make sure it's not dead

woven bramble
#

Make array and each loop method also didn't work but Unregister from sense worked!

dark edge
woven bramble
dark edge
#

No i mean the server should be calling the shots on important things.

#

Why is the client involved with AI stuff?

#

When the AI's target character dies (on the server), the AI should no longer care about them (on the server)

woven bramble
#

Oh, I didn't quite understand, what is the part I need to change as a result for this?

dark edge
#

Just set it up as if it wasn't networked at all, just have it all happen on the server (gate by HasAuthority)

woven bramble
dark edge
#

Dying should be a thing the server decides, which is replicated down to clients

#

Server calls the shots

dapper obsidian
#

I had GameLift working fine a few months ago, but I tried deploying again with the new interface and now I can't submit a fleet deployment because I get the following error:

GameLift is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::691907551351:role/service-role/GameLift-StartGameSession-role-8xjd5bid
Anyone know what that's about?

woven bramble
gray orchid
#

@thin stratus is that c++ cause I need blueprint

thin stratus
#

Blueprint-only Multiplayer has a lot of limits

#

You won't get session info in native blueprints

#

Only thing you can get there is info about connected players in the server (cause server and session are two different things)

worthy wasp
#

Something like a match/lobby timer - how would you guys go about making this so its synced across remote clients - without having to do an RPC every second?

I of course am using GameState to replicate the variable - but I just did a timer (non-repeating) for N# of seconds to start it - and an event when its finished..... if I DONT do an OnRep function - it wont send an RPC out every time it updates (every second) if i switch it to that funcitonality - will it?

prisma snow
#

cannot give you the details

worthy wasp
#

theoretically it makes sense that it DOES NOT send an RPC event every time it ticks the timer - because its not ONRep functioned

dapper obsidian
#

Okay so, in case anyone has to deal with

GameLift is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::691907551351:role/service-role/GameLift-StartGameSession-role-8xjd5bid
You need to go into the policy (GameLift-StartGameSession in this case) and edit the trust relationship policy document (not the policy document itself, but the one in the "trust" tab) so that it contains

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Service": "gamelift.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}

I hate AWS so much.

prisma snow
worthy wasp
#

lol my job wants me to get AWS certified

#

i replied - ID-10T ERROR INVOKED

prisma snow
#

I had once a coworker who had the theory that they made AWS horrible on purpose so that people need to certificate in order to be able to use it

#

🀣

dapper obsidian
#

Lol, now that's a conspiracy theory I can buy into.

worthy wasp
#

man fk that certification program

#

i dont have the time/patience to try to remember 84 different services & depth that it goes into each service - to pass the tier1 exam

#

plus - i'm old

dapper obsidian
#

"Oh hey, we introduced a new IAM system but we also kept the old one around, and half the instructions out there use the old system's authentification system and half use the new, have fun"

worthy wasp
#

Gun->ToHead()

prisma snow
worthy wasp
#

tell that to the hasbeen managers in my company

#

its a sales promotion thing

#

"We have N# of certified AWS programmers.... GOLD TIER BABY"

dapper obsidian
#

AWS error:

Cannot run program "/local/game/install.sh" (in directory "/local/game"): error=2, No such file or directory
What it ACTUALLY means: there is an install.sh there but it uses Windows line returns instead of Unix line returns. πŸ™ƒ

quasi tide
uncut panther
#

Hello ! i was wondering how can i show individual steam name for my lobby ? right now, its showing my name for each players in the lobby instead of their name
(here is my code)

uncut panther
dark edge
#

Do you know why that's your problem?

uncut panther
dark edge
#

What does that node do?

uncut panther
#

It's searching for the player controller, but i guess locally only

dark edge
#

It's getting the FIRST player controller

#

which is the local player on clients

#

and the host on the host

uncut panther
#

Oooh, this is why it's my name, because i'm the game host

dark edge
#

You need to iterate over all players, GameState has an array of PlayerStates, start there

#

does this code run per list item?

#

as in, per player?

uncut panther
#

Yes

dark edge
#

the outer widget should do the iterating

uncut panther
dark edge
#

an individual widget doesn't know what player it cares about

#

the outer widget needs to tell them which player they care about

uncut panther
#

Okay i see

dark edge
#

unless you just use widget index inside parent as the index of the player they care about

#

but you should deal with PlayerStates, not PlayerControllers. Only the clients PlayerController exists on their machine

uncut panther
#

thanks i have learned a lot SCWblush

dark parcel
#

Playing montage in a highping (or even low ping) will result in rubber banding due to CMC correcting the location of the character when it play the montage. How can I do it in predictive way? 😦 I know we can do sprint with Prediction which utilize SaveMove but how about gameplay action like playing an attack animation? How can I make a multiplayer that isn;t rubber banding with root motion?

waxen apex
#

Does anyone know how a Multiplayer Save-Game would work?

#

Like, player skins, player currency, etc. Storing player data on a server and retrieving it.

#

How would that work, potentially

dark parcel
#

ofc doing it that way makes it easy for anyone to alter the local data.
if you want security you need to store the save file on the server side

sinful tree
# waxen apex Does anyone know how a Multiplayer Save-Game would work?

If you intend to have servers that are distributed (ie. Players can host them or some other third party hosts can) then you cannot use a database system for saving details like that as any malicious person could fudge your database with junk data as you'd have to allow access for those servers to request writes to the database. Once someone has access to your database, they are essentially free to write almost anything they want to it.

eg. Say you have a database where you are storing PlayerID 55535 and they have 500 currency. The player gains an additonal 5000 currency during their play time and quits the game. The server sends an update to the database indicating PlayerID 55535 now has 5500 currency, and or/ to add 5000 currency to whatever is currently present. The thing is, if the player themselves control the server, they can then do something like... Update PlayerID 55535 to have 99999999 currency and you'd have no real way of validating if that was an actual valid request, so your database accepts it. At worst, they could then be real jerks and do stuff like Update PlayerID 22455 to have 0 currency, wiping someone's currency they've earned, even if they never even played on this particular server making the request.

If you want to avoid that scenario, then you must host all the servers yourself and not distribute the server executables. Then you'd maintain control.

One alternative is to not store the data online and instead just use save games on the server the player is connected to, allowing players and other 3rd parties to host servers . Then only the data that is on that particular server could potentially be compromised. The downside here is that player data is not retained between servers.

waxen apex
#

I plan to have a dedicated server

#

leaves less room for game fraud

sinful tree
#

A dedicated server in relation to Unreal is akin to an instance of the game that is only being used to host the game and allowing players to connect.
One can still distribute a dedicated server build and allow others to host it.

The issue is who is hosting it. Are you saying you intend to host all potential servers that the game would be running on and not allowing anyone else to host a game themselves? (By me asking if you are intending to host the servers, you can use whatever hosting provider like AWS or Azure, just that you'd be setting up a system to launch servers and remain in control of them)

waxen apex
#

I guess, yeah. Like Overwatch, they join the servers. I would be the one hosting

waxen apex
#

I want to know how that would work, because i was going to create a character selector, but since the Save Game thing seems to not replicate or whatever is it.

sinful tree
# waxen apex And the player data such as player owned skins or stats or playtime would be on ...

You would likely end up using a database system of your choosing that your servers would read and write data from/to. Player data would likely be stored in a way that you'd use a unique ID to identify the player like SteamID or Epic ID. I know Steam has a session ticket that the player can pass to a server, and then the server can validate the ticket with Steam and retrieve their Steam ID from the ticket. Alternatively, you could roll your own authentication system and have them sign up with their email and then you'd store their password (SECURELY).

Unreal Engine doesn't have anything built in to handle authentication of players (save for using Steam or Epic sessions) or database connections if I recall correctly. This is more something that you'd have to develop yourself and have the right workflow worked out for what it is you intend to do and how you want it to be handled.

It boils down to you'd likely need external systems to handle purchases and matchmaking. Once a player joins into a dedicated server, the server can authenticate the player again and retrieve the data about that player directly through Unreal if it's set up to connect to the database. Anything data related before actually joining a game can happen if you have some other system that isn't Unreal handle the requests for you as long as you authenticate the client/request.

waxen apex
sinful tree
#

This is not something that can easily be conveyed in terms of code or using blueprints as it would be an extremely large system and even requires applications running external to Unreal itself.

#

What you're asking is something that large scale game companies would likely be working on for months.

#

Unreal doesn't have exactly what you'll need from the get go. You'd have to code in systems (or use plugins) to make REST requests and handle database connections.
You'd have to code the external applications to handle REST requests, and make your own API, using whatever you're able to use for handling such systems (I've done it myself using something like AWS Lambda and Javascript of all things)
You'd have to code in how you want your database queries and writes to work, again likely through some external API you can call from anywhere, and authenticate it.

Once you have those parts done, then you have to worry about trying to work with those bits of code to make the requests and responses you want, then code in how you want Unreal to handle any data returned and sending it from Unreal.

waxen apex
#

so the data handling is on the API and stuff

dark edge
dark edge
#

if the saved stuff being only for that one server, like Minecraft or Terraria, then just a normal savegame will work.

#

The same way Minecraft saves a file per player

dark parcel
#

can someone clarify if anyone uses root motion at all in their mp game?

queen escarp
#

i cant connect to my server :/ ? any ideas ?

broken shale
#

I’d like to have a series of boulders randomly spawning and rolling down a plane that will kill a player if hit. Simplest way to do this is have physics enabled and let them roll… but I’m assuming the server will not be able to keep them in sync between all players if I use physics, is that right? Alternatives I’ve considered are using a series of randomly assigned splines or using AI and plotting a path. Any better options? Synchronization is somewhat important but not essential unless players are getting killed by boulders they can’t actually see

kindred widget
plush lotus
#

Hi, When you create a Local Player. The Split screen is supposed to work directly or not?
I'm in a Menu, and select to play 2P. Then i create a local player.
But it looks like a new screen is added behind the main screen. So it's not splitted.

I was expecting to have the same screen for everyone (menu) but splitted

kindred widget
#

Can you screenshot it? Initially it sounds like a widget being added to viewport vs being added to player screen.

shadow hatch
#

Is there a udemy course or course in general that covers the basics of making an online game in ue from.a to z thats good? I vaguely recall tom looman, think, had some shooter game course for example but i heard it might be a little outdated

plush lotus
#

so it's the selection screen

#

it's open my start screen

#

and with the controller 0

#

if i press back

#

i have the main menu, and behind the screen open from when i create the new local player

#

and i try that

#

i try without the last Client Set Hud

#

and when i press a button of the new controller i have an error message

#

all those action are well defined for player 0

#

it's like if the controller 1 create a new game mode

#

and like if the new player controller , create a new game mode, the new game mode create a new HUD, and the hud create the new start screen

#

but i was not expecting it to act like that

kindred widget
#

IMO, this menu should never have two players. Main menu is meant for the first local player. A second player shouldn't even be considered or allowed to do anything until something like a lobby.

plush lotus
#

but if i want to let them select their car (before the game).. that's mean i should create a new game mode to allow them to select their car?

#

because its true i start with a solo menu

#

then i select multiplayer mode

#

that's mean i show change game mode there? and create a new one for multiplayer menu?

kindred widget
#

That's usually like a lobby screen or something. Which I'd consider making into it's own map, or the same map as the race so that you can support online sessions if you want as well. But local coop should largely work the same as far as coding except that it's a second local player on the machine.

plush lotus
#

Yes, it's a lobby screen, that has it's own map.

#

when i click on solo mode, i open a new level with all instance parameters.

#

i have the possibility to select my car and the race

#

when i click on the lobby screen multiplayer, i open a new widget.
In that widget i select the number of local player. then create new local player. Should i expect new game mode to be create?

#

when you say : "But local coop should largely work the same as far as coding except that it's a second local player on the machine."
Do you mean, local player should have their own main menu lobby level?

kindred widget
#

What I mean is to separate the main menu and the lobby entirely. Main menu is just a place to select where to go. Should be one player, never two. Specialized simplified game mode, HUD, PlayerController, everything. It's meant to handle specific tasks that aren't really like the rest of your game.

When you choose to start a race. Open a whole new level. This level has a different gamemode, hud, playercontroller, etc meant for the race.

IMO for simplicity and initial setup I would even make your lobby a third level with it's own set of core actors just to make joining easier to handle. You generally don't want players hotdropping into the middle of a race. And handling lobby vs race code in the same set of actors is annoying. Alternatively you could probably put a lot of that state on a component in the game state and destroy it when the race starts.

I wouldn't create players that aren't being used either. There is an event in GameInstance that runs when gamepad stuff changes. You could probably detect local user intentions from or around code related to this.

plush lotus
#

so for you the car selection it's a part of the Race? because we can have multiple player there?

#

So what you advise me to do is :

  1. Level Menu : 1 controller
  2. Multiplayer : New Level with multiple controller
  3. Run de race : New Level (1 or multiple controller)
#

it's will only a local game (no online functionality)

#

but the create local player shouldn't split the screen automatically ?

kindred widget
#

It should split automatically I think. Depends on your project settings for it though.

true spade
#

Hi I have a question, about replication. So we are creating VR game, and we have setup that in the GameInstance We have our variable (custom struct) that's replicated that stores parts for the avatar (array of some custom struct for avatar parts, path of the head,torso meshes...) and in the single player it's working fine, but when we joined MP match or creates one, that variable in the game instance, has 0 items in the array. I trying in the editor it's working fine, but in the build it's empty. Does anyone has some ideas how this might be fixed? Thanks in advance πŸ™‚

thin stratus
#

When NetSeriliazing, when does it make sense to use SerializeOptionalValue?

#

I'm looking at existing code where someone previous to me used that to serialize an actor pointer

#

And so I did the same when I added a second pointer and it totally wrecked the serialization. Are there rules to this?
Does it have to be placed at the start or so?

thin stratus
true spade
thin stratus
#

BeginPlay -> IsLocallyControlled is wrong for Characters

#

Characters aren't possessed instantly

#

They call BeginPlay before that

#

You need to either use the PlayerController's BeginPlay or move the code to a ControllerChanged Callback in the Character

true spade
#

Oh, didn't know that. Thank you for the answer. I'm gonna try doing that now, and get back to you with the response/answer. Thanks again:)

true spade
pastel escarp
#

Any idea on how to implement Waypoints visual in an RTS game that handles the movements over the server only? So I don't really know when unit arrived to destination..etc

topaz carbon
#

I am working on a multiplayer game and would like to do a real world test with several players around 20. Is there a way to do this test virtually somehow without having to find volunteers? I can run a bunch of game instances through the editor but obviously this lags my whole computer down and is super unrealistic.

thin stratus
#

If oyu just call GetGameInstance locally it should give you the local GameInstance with the Data it has

#

If the data on it is erased, then something is doing that

thin stratus
pastel escarp
thin stratus
thin stratus
#

And then you could use stuff like this locally to get the Path Points to draw a spline or so

pastel escarp
#

Thanks so much, will look into this

true spade
thin stratus
#

Login? You mean with some backend while being in the Main Menu?

true spade
#

Yea, when you start game, it will make a backend call to login, in the response I get the whole struct (it's valid in the SP) but when I Join/Create session it's empty

thin stratus
#

You must be doing something for that to happen

#

I can't help you here sadly

#

You can share parts of your code here if you want

#

Maybe someone can spot a mistake

true spade
#

Thanks anyway. I'd like to share but it's not C++ it's blueprint code only and it has a lot of nodes for loading specific path of the mesh. But I can send this part. That's being called in the BeginPlay from the PC if it's locally controlled

vagrant roost
#

ive gotten the 2 players to join a game session. However its always the client thats movement is all messed up. For instance when jumping he sometimes flies up to like 3 times the jump height and overall is jittery and messed up.

So i guess some main questions are

did i need to check some box for anything replicated related when creating the character?

I think the problem is my jump and dash and slide have timelines and something is getting thrown off because of that?

Does anyone know of how to handle this or maybe what needs to be replicated?

other info--- the jump has a timeline to increase gravity, basically to give a mario jump
the dash timeline just sets his velocity for a period during the dash

queen escarp
#

when doing a semless server travel nothing saves from a scene to another

#

ruight

#

its like starting a brand new level

thin stratus
#

Make sure you don't mark any variables or events replicated in the GameInstance

#

Not that it will fix the problem but they shouldn't be replicated

#

What does GetViewGameInstance do?

#

You won't get around trying to follow where and why the GameInstance resets that value

thin stratus
queen escarp
#

hm and thers no fucntion like in unity " (Dont Destroy on load) " ?

thin stratus
#

C++ is full on required because you need to tie that stuff into the CharacterMovementComponent

#

Otherwise you get corrections like you see

vagrant roost
#

damn, was the only way i could really get the timline working for that

#

mostly everything is c++ minus a few things that were easier on bp lol

#

i.e. the timelines

thin stratus
#

If you need something like a timeline I can suggest you to define a Float Curve asset pointer in your CMC

#

And using Timestamps based on Server and Client Data in the CMC to check where along the curve server and client are

thin stratus
#

But not sure how well that works with stuff that is supposed to be in specific places in the level

vagrant roost
#

πŸ€” im fairly new to doing multiplayer but have done like half a course on an online shooter

#

but hadnt done any kinda timeline stuff

queen escarp
#

well its basicly stats that needds saving but

vagrant roost
#

with replication

thin stratus
queen escarp
#

rather i use save/load functions instead then i supppsoe

#

on the character bp

thin stratus
#

Place them on the PlayerState instead

#

And use "CopyProperties" to move them from old to new PlayerState

#

That's how it's supposed to be done at least

vagrant roost
thin stratus
#

CharacterMovementComponent is CMC

vagrant roost
#

oh lmao

#

well yeah i know that

thin stratus
#

Timestamp is just a record of the current time

#

E.g. if you start jumping, you save the time you started

vagrant roost
#

i had thought perhaps i should be doing some kinda delta time thing

thin stratus
#

And while jumping you can do "CurrentTimestamp - StartJumpTimestamp" to get the time elapsed

vagrant roost
true spade
thin stratus
#

It's pretty advanced

#

Not gonna lie

vagrant roost
thin stratus
#

CMC is no joke. I'm doing this sh*t for a couple years now and I still run into problems with it

#

There is a lot to be aware of

vagrant roost
#

seems harder than replicating the amount of ammo i have ina gun haha

thin stratus
#

You should study the git repo that is pinned

thin stratus
#

Or at least predicting it

thin stratus
true spade
fervent leaf
#

Hi, I'm not sure if this is the correct section to ask this but. I use the Unreal's replay system on my project. Like when I move the NPC's on BehaviorTree using AIMoveTo, it rotates to movement direction on server and client as i use Orient Rotation to Movement. On the replay, NPC always walks backwards but to a corrent location, so it doesnt rotate even if it does so on client and server. Also when I scrub on the timeline, replay always forgets like AnimationLayers which are choosen in OnRep -functions. I just dont get it, why is the moving working different in replay and why scrubbing the replay fucks up the RPC's

vagrant roost
thin stratus
#

The CMC has prediction and rollback, as well as reconciliation

vagrant roost
#

ah ok im reading up about it

thin stratus
#

But you need to add your stuff to the correct places and structures in the CMC to make use of it

vagrant roost
#

so its like i gotta have a custom movement for dash slide etc?

#

sorry for all the newb questions

thin stratus
#

It very much depends on what you want to make and how much custom logic it needs

#

Sometimes you can just override a handful of functions and you are good

#

Othertimes it's a lot more involved.

vagrant roost
#

im more on the still trying to learn like what actually needs to be repped more than anything

#

for sure have no idea usually if i run into a problem what to search for. thats really what i wish i was better at. being able to understand the docs half the time haah

whole pine
#

how do i connect an EOS login to the owning player

near granite
#

In multiplayer, I want to set location some ball actor in the level in other client's computer without using replicate for some reason. by using run on server - multicast, is it possible even though the ball's owner is not my computer's pawn? Difficult to explain..

vagrant roost
quasi tide
#

No. They're Cedric

blissful talon
#

~~Hello, I'm going through some Lyra interaction, and I noticed that it gives this warning LogNetPackageMap: Warning: FNetGUIDCache::SupportsObject: AbilityTask_GrantNearbyInteraction /Engine/Transient.AbilityTask_GrantNearbyInteraction_0 NOT Supported. the first time per play a client approaches some interctable object. ~~

By searching for some information I only got that the warning is saying that the ability task is not supported in networking, but why should it be saying that if this task is only triggered on the server? That's the only place this task is triggered in:

void ULyraGameplayAbility_Interact::ActivateAbility(const FGameplayAbilitySpecHandle Handle, const FGameplayAbilityActorInfo* ActorInfo, const FGameplayAbilityActivationInfo ActivationInfo, const FGameplayEventData* TriggerEventData)
{
    Super::ActivateAbility(Handle, ActorInfo, ActivationInfo, TriggerEventData);

    UAbilitySystemComponent* AbilitySystem = GetAbilitySystemComponentFromActorInfo();
    if (AbilitySystem && AbilitySystem->GetOwnerRole() == ROLE_Authority)
    {
        UAbilityTask_GrantNearbyInteraction* Task = UAbilityTask_GrantNearbyInteraction::GrantAbilitiesForNearbyInteractors(this, InteractionScanRange, InteractionScanRate);
        Task->ReadyForActivation();
    }
}

Does anyone know how to fix it?

Edit: it doesn't have anything to do with the activation, but with the task itself. It grants abilities, but when it creates AbilitySpecs it inserts this as the source object, which makes the networking try to replicate it.

eternal canyon
#

my plugin allows for that

woven bramble
#

I can send LineTrace by RPC + Multicast.
What I want is this Line, when it hits a Player, to print a PrintString on the screen of the person who was hit.
(Characters are the same)

How can I do this?

dark parcel
thin stratus
#

Not sure about anim BP tree

dark edge
#

Do it more like this
Owning Client:
WHatever event -> trace -> hit somethign? -> tell server

Server:
Something was hit -> optionally verify the hit -> ok tell them

#

if you care about not cheaing on the trace you could move the trace to after the RPC from owning client to server but that's up to you and what you're actually doing

#

anyway, no multicasts

fair latch
# thin stratus Montages yes.

But when playing montages with root motion the character alwyas snap back because root motion is fighting with cmc correction 😦 im starting to give up working on rpg action game like dark soul.

dark edge
#

If you're new to this you are not going to make anything even close to the core mechanics of dark souls

#

just flat out aren't

#

root motion and the CMC can play nice but you'll have to dig into it.

thin stratus
#

I made a climbing system where I used RootMotion for the "Climb up onto obstacle" and it worked quite fine

dark parcel
#

Hmmm even calling it on server and client, the problem is, the cient uses prediction

#

saved move right, it still pending

thin stratus
#

You can try to call FlushServerMoves before

dark parcel
#

So it;s still correcting the position of the character

thin stratus
#

That's at least needed for RMS

dark parcel
#

I will dig into FlushServerMoves

thin stratus
#

I have never used RM for normal anims

#

I'm also convinced that's not a thing

dark parcel
#

trying to find a way to incorporate playing montage with the prediction 😦

thin stratus
#

Paragon coded this by hand

dark parcel
#

I read thru internet and a lot of people said to just give up on using root motion in network game

thin stratus
#

But one time RootMotion Montages should work

#

The CMC should be catching up on them

#

we are using RMS at least extensively

#

And that's just faking RootMotion from a code source after all

#

And again, I used this before for climbing animations

dark parcel
#

from what i gather CMC use prediction system which mean the client will be authoritive? The problem is the moment we play anim montage, the anim montage will use the server location of the player. Is there a way to incorporate playing montage in prediction? There is the FSavedMove for movement, are we able to use a simmiliar class where we can inject our own code? my understanding is without using time and prediction, CMC and root anim montage will not be compatible?

woven bramble
thin stratus
#

But you are right that the location must be the same

#

The Start Location in this case

dark parcel
#

πŸ₯Ή

thin stratus
#

The RootMotion data is checked upon based on a lot of values

#

So they must be they same for this to work iirc

#

But the CMC 100% has logic in it to handle RootMotion, including the Reconciliation aka SavedMoves

dark parcel
#

For movement I suppose I can use GetCompressedFlags and UpdateFromCompressedFlags but how can I do it for something else?

thin stratus
#

My client (work) is using GAS for their project. So we use RootMotionSources to fake dashes and jumps. We have to ensure all parameters are matching. Start, End, Duration, etc.
We are using AbilityTasks to send TargetData over from client to server to ensure they are both using the same data when starting.

dark parcel
#

I see, but that wil cause delay on the action part in high ping scenario?

thin stratus
#

but this is also somewhat outdated

#

We have proper Struct Containers now that can just be extended

#

We as in UE community/users/whatever

dark parcel
#

The jump is also another example why it can be fluid because the server will perform the act after it gets the compressed flag from the client

#

but in the case of playing montage, the engine just went, hey play this anim montage, ignore the incoming prediction

thin stratus
#

Jumps work just fine

dark parcel
#

Yeah jump works perfectly fine

thin stratus
#

As long as you use the Jump function from the CMC

#

The Client actually tells the server that it's playing the montage

#

Or rather the rootmotion

#

Again you have to call it predicted on teh client and then RPC to the Server

#

To have it sync

#

The server will figure out based on ping and timestamp where along the RootMotion it is when it gets the same call

#

The CMC 100% handles this

#

It might just be enough to call FlushServerMoves before playmontage

#

We do that for the RMS

dark parcel
#

Thank you I will look into FlushServerMoves

dark parcel
#

i tried FlushServerMoves but it;s still snapping. This simple setup seems to remove the rubberband, maybe it was snapping becuase I played the animation twice?

#

Is this setup correct or will there be a problem?

thin stratus
#

I'm half sure you don't need to call this on everyone

#

Only local and server

#

And yes, you would be calling it twice with the multicast if you don't filter

#

@dark parcel

dark parcel
#

@thin stratus Tysm

static prism
#

hi everybody again

#

i have trying to set my rotation character its works normally but in the mode online this doesnt work

#

the logic is when i click with my mouse de rotation changes but in the online mode this happen only in the server and in the client its like no rotation changes always the same

#

how do it works on form online?

warped berry
#

I use FConstPlayerControllerIterator to count players in the level, it works on PostLogin in Game Mode but after 10 to 15 seconds it returns an invalid iterator, why is that?

young spoke
#

do you think spell invocations are using TCP connection in dota2 / LoL?

dark edge
#

Right now you are never telling the server WHAT you hit

#

you're just telling it that you hit something, and giving no other information

static prism
#

i don know

broken shale
# kindred widget You could try the PMC if you want a simple implementation.

Great idea! Is it easier for the server to keep projectiles synced since it’s not using the physics engine? Some of the objects will be colliding with blocks or players. Main concern is I don’t want players getting hit by β€œinvisible” boulders. But would also like for them to be able to see where there’s a boulder being blocked by a cube so that they can destroy the cube and cause the boulder to roll over someone

kindred widget
#

As far as I know PMC is synced, and supports bouncing effects.

woven bramble
# dark edge

Ok, I know but, this is only for printing string on Server when LineTrace hit the opposite character.
This doesn't provide a solution to the problem I'm having, This is just the baseline to get me to the process needed to solve the problem.
What I do next is more important to me, so what can I do and just project a PrintString on the hit person?
Tag method? Or Hit Actor and Cast to character, I really couldn't find it.

dark edge
#

it includes the actor you hit

woven bramble
#

It worked.

#

The system is working, but I am very curious about one thing. Why didn't we Multicast?
So when RunOnServer is used, doesn't it mean that it will only work on the server and not on other clients?
Why do I use Multicast if it will already appear on other Clients when I do RunOnServer. So I couldn't really tell the difference.

dark edge
#

You want to trace and tell the thing you hit that you hit them

#

you need to go through the server so you at least need a run on server event somewhere

woven bramble
#

yeah, I understood that step but So why not use Multicast?

dark edge
#

multicast runs everywhere

#

if you trace and hit Bob, what's that got to do with me? Why would I care

woven bramble
#

When I run on server, it shows everywhere already, what was the main difference

dark edge
#

that's because whatever you're doing is implicitly showing everyone. Just running something on a server doesn't do anything for anyone but the server

#

If you specifically want to do a trace and show some notification on the hit persons screen, it'd go something like

Input -> trace -> run on server event (passing over hit actor)
Run on server event -> get hit actor -> run on owning client event on that hit actor
Run on owning client event -> show the thing

#

You can also do it like:
Input -> run on server event
Run on server event -> trace -> get hit actor -> run on owning client event on that hit actor
Run on owning client event -> show the thing

#

2nd approach is more secure but you'd have no instant feedback on the initiating client

woven bramble
#

oh

#

So if I'm going to shoot (with a gun) and emit sound, if this sound will be visible to everyone, is it Multicast or the method you say?

woven bramble
dark edge
#

or spawn an FX actor, depends

#

Gun having a multicast event ShotFX is the general way to do things

#

ShotFX -> play sound -> spawn particle -> etc

#

but nothing gameplay related

woven bramble
# dark edge but nothing gameplay related

My last question (promise, no more questions) πŸ™‚
Input -> trace -> run on server event
Run on server event -> get hit actor -> RunOnOwning..
Here we can get hit actor and cast to Character _BP and change the Variable in it just for him.
What I'm wondering is, what should we do if there is no "hit actor"? So we get the HitActor through LineTrace, what if we don't have the origin that indicates that it is that character?
For example, if we are going to change a variable for a random character in the game without a specific reason, what should we connect to the "Object" part of Cast to?

dark edge
#

if it fails it wasn't a Character_BP

woven bramble
lime iris
#

Need help! for VR multiplayer replication, should i put MotionControllers in a PlayerController or Pawn? and what about HMD?

humble plaza
#

Would this be correct when changing a mesh for a client to server type thing or is there an easier way? I know i still have some tweaking but it was a general idea

fossil spoke
spark pelican
#

Hello, I was dissecting Lyras inventory system with their item fragments and FastArraySerializer, and I was wondering if the fragments are supposed to replicate (from what I tested they do).
I looked through the code and remade some of it myself and I didn't find anywhere where they explicitly told the fragments array to replicate. Does this have to do with the FastArraySerializer or am I completely mistaken on some other part?

hollow eagle
#

fragments don't replicate, they're static data placed on item definitions. Everyone already has all the fragments and the data set on them.

humble plaza
spark pelican
hollow eagle
#

that's only because you're in single-process PIE

#

you're not modifying that client's version of the asset. All clients in PIE share assets, so you're modifying it for everyone (and the editor itself)

#

Fragments aren't meant to contain any data that changes at runtime - that's what item instances are for.

quaint roost
#

anyone have confirmation on whether structs replicate atomically?

#

as in is there ever a case if i do

struct S {int A = 0; int B = 0};

server sets A = 1 and B = 2
is it ever possible that a client gets {A = 1 , B= 0} or {A = 0, B = 2}?

hollow eagle
quaint roost
#

awesome

#

thanks!

dark edge
hollow eagle
#

packet loss

dark edge
#

Like if I set a, and then in the next line, set b, is there any way that replication could have happened between a and B being set?

hollow eagle
#

no, but that's not what atomicity in replication means

dark edge
#

Oh are you saying setting a and B would imply two packets?

hollow eagle
#

no

#

if property A gets set, then property B gets set some time later but the packet containing property A was dropped then you can potentially have a (possibly temporary) state where property A isn't set but property B is

#

the only way to guarantee that property B can only have a certain value when property A does is to not use delta serialization.

dark edge
#

The some time later being key, right?

hollow eagle
#

...yes

dark edge
#

Yeah that's what I was getting at.

hollow eagle
#

but that's still a problem

#

if you have properties that depend on other property values then you have to write your code with the possibility that they can be out of sync, or you have to guarantee they stay in sync by throwing out delta serialization

near granite
#

how to transfer the actor variable by multicast to all clients?

daring bough
#

Hi! Is any easy way to identify a player like with GetDeviceId in UE5.1? I found only that but it was deprecated

amber barn
#

hi guys, im trying to track down a fatal error my clients get when testing my game over the internet, but i cant seem to get anything to print in the log(running the packaged build via powershell -game -log) the fatal error is just a generic windows box pop up with 'fatal' error on it and thats it.

making it hard to track down whats causing the error, anything I can do to make debugging easier?

dark edge
#

why is this not just a replicated variable?

near granite
# dark edge why is this not just a replicated variable?

You mean that the actor object variable can't be delievered to all clients by multicast?
I'm doing for AR..Replicate can be only used when all clients's origin is same.
but AR is not and remote rendering I'm using is not support for set the world origin location and rotation.
so I'm creating multiplay withough using replicate of actor, only doing by RPC
and only with blueprint! 😢

dark edge
#

It can but multicasting state is a bad idea

#

What are you actually trying to do? WHat game mechanic.

woven basin
crystal palm
#

Any body knows how can I make a pawn movements like character movement?

dark edge
static prism
#

hi good morning

#

please someone help to do it

#

i trying all nothing works

#

i create a interface

#

so i put in the character

#

on click i send a message to interface and pass a vector 3

#

with that vector 3 i change my rotation

#

it works

#

but not update on the server when i do it on the client

dark edge
#

You need to pass the vector over inside the run on server event

#

that's probably not the only problem you have but it's the first one I saw

static prism
#

ok i dint know that the custom event can put a input value

#

and why your nick name have ask me about 1d physics?

static prism
# dark edge

hahah it works fine you really know about the subject

shy yarrow
#

I have an issue with split-screen local multiplayer on UE5, it does not work, it makes the screen divided into 2 parts but when I press the keyboard button and gamepad button it only moves player 0, and player 1 will not move , any solution?

drifting spear
shy yarrow
#

it does not work in Unreal engine 5.1

#

both keyboard and gamepad controls the player 0

drifting spear
#

How about two xbox controllers plugged into your PC - the second controller is still assigned to player 0 ? I doubt this behaviour is different in UE5

vestal flax
#

Hey all - when looking to hire a freelancer who can design a multiplayer setup for a VR app - what keywords, roles, etc. should I be adding to my job posting? Trying to determine the best way to seek out the task I want completed, after which I'll post in the hiring threads.

shy yarrow
shy yarrow
#

guys any help ? it work in 5.0 but not working in 5.1

unkempt lodge
#

I have 2 players, one server and one client. When the client is possessed, i try to acces its controller using the "GetController" node but it returns null. I know that there is a controller on the client side and server side but why i can't I access it on the server ?

graceful flame
#

Where are you trying to access the controller from?

unkempt lodge
#

If i getcontroller in the beginplay for example, the client return a value for himself but the server returns null for the client

#

I don't know if i am clear enough

graceful flame
#

GameMode?

#

GameState? PlayerState? Character blueprint?

unkempt lodge
#

No, all i do is in character blueprint

#

But i know that there is a controller, as there is an output for the OnPossessed event and if I print it, it print the good controller

graceful flame
unkempt lodge
#

I'll read that, thanks

unkempt lodge
#

BP

#

But my BaseCharacter is in c++

kindred widget
#

And you're overriding "Possessed" in the Pawn?

unkempt lodge
#

Yes

#

In the c++

#

I call the Parent function and do some stuff

#
void AMainPlayerCharacter::PossessedBy(AController* NewController)
{
    Super::PossessedBy(NewController);

    PawnExtComponent->HandleControllerChanged();
}
#

I copied some stuf that are in Lyra

kindred widget
#

And you're 100% that controller is null, and not the Controller's Pawn?

unkempt lodge
#

Well i call GetController in the pawn so it can't be null right ?

#

As it is effectively called

kindred widget
#

Definitely doesn't make sense. That super should be setting your controller in the Pawn.

#

And the only thing that calls that normally is a controller, so it's usually not invalid.

unkempt lodge
#

Ohhh

#

I know why

#

I'm so stupid

#

In the blueprint i wasn't calling the parent function

kindred widget
#

That shouldn't stop the controller setting though?

unkempt lodge
#

Yes actually

kindred widget
#

Those are two different functions. One is a BlueprintImplementableEvent that the other one calls.

unkempt lodge
#

Yes, but now it is working

#

Maybe because I restarted the Engine ?

kindred widget
#

πŸ€·β€β™‚οΈ I dunno. But not calling that Parent function in BP should only break parent BP classes, not this class.

#

The only way that should come through null is if this class has a BP child that overrides Possessed, calls the Parent function, and doesn't pass in the controller.

#

Actually scratch that. It wouldn't even then because you're using GetController.

unkempt lodge
#

Yeah it is weird πŸ€”

worthy wasp
#

I just tracked down the spawn logic of a player - and had some questions of you guys... how deep down the rabit hole do you guys override for your own projects for custom player spawn logic?

I started in the function ChoosePlayerStart() but it goes much deeper than that - and theres ALOT of functionality in the engine base implementation of these functions...

It seems appropriate that you'd override AGameModeBase::Login() - but that takes out 3 underlying functions in chain - and several other lines of implementation... seems dangerous :/

last grail
#

Question, should character death be handled on the character asset or within the gamemode? Is there any downside to handling it in the character?

thin stratus
#

The Death of the Character itself, so the visuals, the health, any abilities it might have, whatever, should be done in the Character.

#

Any outer gameplay, like scoring points, queueing a respawn, etc. should/could be handled in the GameMode

last grail
#

Thanks, I figured there wasn't too big of a difference.

wooden abyss
#

Is there an easier way of incrementing a variable thats set to RepNotify than this?

#

Increment node doesnt work with repNotify 😦

quasi tide
gritty lantern
#

is there a way to spawn an actor on the server, have the player position it somewhere in the world with input, and then replicate that placed object to all the clients?

fathom aspen
wooden abyss
sinful tree
dark edge
thin stratus
#

if you don't call the Set node directly, it won't trigger the RepNotify

#

RepNotify in BP s*cks

#

Same with array modifying functions

#

I always set the array with itself at the end

#

.>

sinful tree
#

The OnRep fires on the client with this set up.

#

Not on the server tho πŸ˜›

dark edge
#

lmao

#

"Why have one way for things to work when you could have 3?" - Epic

wooden abyss
# dark edge That's readable, what's wrong with it?

Of course its readable. Still takes more nodes than the increment node^^ Was just wondering if there was something else. I just made a macro to have it look a bit cleaner in there. There is a lot of stuff around that so I wanted to keep it smaller i guess πŸ˜…

last grail
#

Where should I store a list of player controllers that I want all players to be able to reference? I thought gamemode, but that is server side only.

plucky prawn
#

player controllers only exist on the server, except for the player who it belongs to

dark edge
#

no client can see any player controller other than their own

#

PlayerState is what you're wanting

#

and you already have an array of all PlayerStates

last grail
#

yeah in the game state

#

okay, trying to figure out a spectator system thanks yall

safe marsh
#

hey, I have a question about OnRep functions. The server is setting ActivePlayer and the OnRep is being called. The listen server receives OnRep and a valid object, but the Client OnRep function is null?

limber gyro
#

im having a bit of an issue trying to spawn a widget only on the local player, i have a basic pawn that spawns at the beggining of the game, this pawn is only for spawning logic, it spawns a a widget where u select ur character and then gets destroyed and u get ur proper character, but im having dificulties getting the proper "IF" check so that it only spawns on user that it relates to

safe marsh
safe marsh
limber gyro
#

im trying is locally controled but i need to call that on the owner and the owner doesnt have that function

#

only "get player pawn" has it

#

and player pawn 0 is lawys localy controlled

safe marsh
#

pawn0 isnt always locally controlled, if there is a dedicated server it wont control any pawn but have a reference to all of them

#

*controller 0

#

if you are spawning a tempoary pawn for the player until they make their choice, you can spawn the UI in there. when a player connects to the server they are assigned a controller, and if there is a default pawn in the game mode set, the game mode will spawn a new pawn for them, and the controller will posses it. you can either spawn a HUD on the Controller Beginplay, or when the pawn is posessed

wanton bear
#

why is it not replicating

#

only visible on owning client

safe marsh
#

you are adding the child actor component only on the server

sinful tree
#

References to them will never be valid on other clients other than on the client that is using that player controller.

wanton bear
#

neither are showing on other clients or the server

safe marsh
sinful tree
#

When you change ActivePlayer, the OnRep would be called and can read the name from it as you want.

safe marsh
#

the turn manager is setting the active player which is the vent I need to trigger. So do I run that only on the server, which sets ActivePlayerState and that OnRep can be passed to clients?

sinful tree
#

Yes (Sorry, after re-reading what you wrote I realized that was what you were asking)

wanton bear
#

ah i mixed up the node order on something, it was spawning but in the sky 2524_chefkiss

safe marsh
#

okay. I will make a server event to OnRep playerstate

#

thanks

muted onyx
#

Hello everyone!
I am spawning actors and positioning them in the server and I want to know if there is an event on client that let me know when all the spawning and positioning is ready on the client side.

safe marsh
#

you need to set them to replicated variables. If the object you spawn has an OnRep replication type, it will trigger an event when the pointer has been updated onc onnected clients

muted onyx
#

what about the location changes?

#

assuming that the client has no authority on this actor

safe marsh
#

if you spawn an actor on the server and it has replicate set to true, it will spawn on clients, and the BeginPlay event will be the first time the client is aware of it
location changes, you can check Replicate Movement on the actor properties
its important to realise that unreal asks you to specify EACH variable inside the object and if clients should know about it. setting replicate to true will just mean that the client knows of an empty shell of an object, but not much about the data inside

#

to get the variable data on clients, you have to set each variable to replicate in its properties. this does not guarantee you will have the data when you look for it, beecause when the data is changed on the server, it takes time for it to propogate to clients. there is another replication mode OnRep this will replicate the data and generate an event for when the data is updated on the client

#

its done this way to save bandwidth so you need to be aware of that. setting the actor to replicate and replicate movement will spawn objects on connected clients, but if you need clients to know about data inside them you need to replicate that manually

muted onyx
#

Awesome! Thank you so much!

limber gyro
#

i have a pawn that return true on "locally controlled" when it first spawns, but after respawning that pawn in the server and possessing it, it returns false is this normal?

jovial dawn
#

Hello everyone, I got a multiplayer game that I make, I use Layers with WP. I tried to change the light for the dongeon and the worldmap. here my code.

#

I have created two seperate layers, but does'nt seem to change the state here. any Idea ?

#

I run this from PlayerController

#

I changes the PlayerController replicates checkbox

sinful tree
# jovial dawn Hello everyone, I got a multiplayer game that I make, I use Layers with WP. I...

The "Set Data Layer Runtime State" nodes appear to be marked to only be able to run on the Authority as indicated by those icons. Your player controller would not be something that the client would have authority over so it won't execute on the client.

The variables "World Map" and "Dungeon" would also likely play a big role in what you are doing. If your intention was to have the client execute based on values that the server has, the client needs the values of those variables to do the exact same. Those variables would either need to be replicated or passed through an RPC so the nodes have the values to execute.

jovial dawn
#

I change the WorldMap variable to replicated but does'nt seem to work

#

and here the custom event

sinful tree
#

First bit I said...
The "Set Data Layer Runtime State" nodes appear to be marked to only be able to run on the Authority as indicated by those icons. Your player controller would not be something that the client would have authority over so it won't execute on the client.

jovial dawn
#

ok understand, but how to make the player execute something on the server then.

#

if I enter in a dongeon, I need to turnoff the world light on client side then.

#

my goal here is to use Layers on multiplayer... and change light when entering to a Dungeon.

sinful tree
#

Actually nix what i said.. Just realized that the target is the subsystem - that means it would run on the client as the subsystem is likely tied to game instance which your client would have authority over.

It's likely running those nodes correctly, but the values being fed in may not be correct. If you just set those variables and then call the RPC the RPC could be arriving before those variables are actually replicated. You may need to figure out a better way to handle the logic like if these variables are meant to be stateful, then set them as Rep w/ Notify and use the OnRep function to perform these actions instead. Then whenever these variables change, the client will receive the new value and call the OnRep function, which can call these nodes to apply the changes.

jovial dawn
#

ok well , those variables will not change, it's why I have both variable for each realm. if I make a print screen at the end of the custom event it's pass. but not executed.

#

I will try with OnRep if it help

sinful tree
#

You likely do not want to use a multicast in that case either... Every time you're multicasting then you're asking the server to do the same thing which you probably don't want it to do every single time. Perhaps only use a "Run On Client" event marked as reliable and pass through the variables as inputs so they'll pass whatever the server value has along and then use it on the client.

jovial dawn
#

does'nt work either... gee.. it's hard lol

#

this is a difficule exemple but what append in a multiplayer game and a player decide to turn off the light switch for a light in a room, since it's the server that control everything, player don't have any power to change anythings ? or maybe using interface ?

sinful tree
#

Based on your current logic line, you're checking authority, which means the true branch would be running on the server. From there, you'd have to call a Run On Client event if you want the client to run it..

#

The thing is, you're using something that doesn't replicate - your subsystem is likely tied directly into the game instance. Any changes you make to that subsystem will not replicate automatically.

#

That means you have to pass something to the clients.

jovial dawn
#

but "Set Data Layer Runtime State" is Autority only, only executable on server

sinful tree
#

The target is something that the client would have authority over - namely the subsystem which is tied to game instance which clients have authority over.

#

The thing is, this subsystem exists separately on the server and the client. They cannot talk to eachother directly.

jovial dawn
#

ok I need to send it as parameter to my custom event

#

from client/server

#

for the subsystem

grand tree
#

question for you folks. I've got a TArray of an FInventoryItem structs where the TArray is replicated. I'm updating the UI in my OnRep, but the thing is once I simulate network lag, it gets kinda slow (taking like a second to update even at only a latency of 30). I tried doing some client prediction but if you started moving things too quickly, the UI would get confused. What can I do to fix this? Would switching to a FastArray help? The inventory lives on an actor component on the character which has the default netupdatefrequency

UPROPERTY(ReplicatedUsing=OnRep_InventoryItems, BlueprintReadOnly, BlueprintGetter=GetInventoryItems, Category=Inventory)
TArray<FInventoryItem> InventoryItems;
dark edge
thin stratus
warped gorge
#

DOES anyone know how to make character animations play on the server even on a dedicated server where it is not being viewed?

#

I have a sword attached to my Mesh and it is not detecting overlap events on the server unless a listen-client is nearby

#

Driving me crazy

grand tree
grand tree
thin stratus
#

Well in theory a lot of stuff should be client predicted that isn't. UI imo should probably be if possible

#

You'd mainly need to keep track of the Inventory interactions in some local history when and moving an item tell the server the result and some id to know which interaction this is about.

If the server has the same result you can send an RPC to acknowledge the interaction.

If the server has different result you can send a correction.

Theoretically you don't even need the local history if the correction should simply reset the whole history anyway

#

E.g. when dealing with movement you usually replay newer moves locally after a correction based on the new starting point.

#

For moving items back and forth you might not want that

#

Then it would simplify itself to just the correction RPC fwiw

grand tree
#

Ah that makes a lot of sense actually

#

Thanks for the explanation!

#

I might still try to do fastarray first and if that doesn’t work I’ll go the client predicted route

#

I appreciate the advice!

graceful spoke
#

Hi guys i'm a little confused on what's going on but right now, in the editor when i change the number of players from 1 to 2 or 3, player 0 ends up not having a pawn to possess but players 1 and 2 do have pawns that they can possess and move on with. if i comment out my handlenewplayer implemetnation function, player 0 will have a pawn to possess but player 1 will be frozen. I also noticed that within my handlestartingnewplayer implemetnationfunction, when i check to return if the new player has a pawn, it always returns true and so returns from the function but i am confused as to how my player has a pawn once they login because i never implemented any function to spawn a pawn for the player to possess once they connect to the server unless post-login or pre-login or init-game already does this?

fossil spoke
#

You absolutely want to be doing that.

austere imp
#

Could someone please help me out? I am pretty new at UE but learning as I go! I have created a sailing system in a multiplayer game I am working on. I have the possession of the ships sorted & replicated. but the ship movement is not. On the server side I can use the sails and drive the ship but on client side it doesnt work. Would someone please assist? Ill send all screenshots in DM -

dark edge
#

If you're new, why in the hell is the first thing you do a multiplayer physics-driven game?

#

Are you using physics or doing the actual movement on tick yourself? Show your code

austere imp
#

Im a dive into the deep end type individual

graceful spoke
#

like i see character 1 on the client side for player 1 but for player0, there's just nothing and i can't move

crystal palm
grave widget
#

Can I test a mulitplayer game using world partition in Editors of 2 PCs in local network? I remember I used to do this on UE 5.0 and the editor crash.

dark edge
# crystal palm Replicated

The CMC is several thousand lines of code, very tightly integrated with the character class. Any particular reason you're trying to basically just remake it?

fervent leaf
#

Hi, I currently have BT-Task Aim. That takes the target location and saves the Yaw as a float on tick on the server. The float is RepNotify, so when the float changes on BT-task, it also sets worldrotaion yaw for the character on server and client. The thing it, it seems to be really heavy for the network. Thats why I'am now wondering if its a completely wrong way to do it. Thank you

thin stratus
#

In case that's your reason for this

quiet fjord
#

Guys I am making a mechanic where in my gamemode the general pawns are charged as the users are connected with the postLogin the doubt in the spawn actor of my pawn how should I mark the collisions to avoid that sometimes the character stays locked with map

crystal palm
normal crypt
#

Hi there. Is it possible to have unreliable replicated variables?

thin stratus
#

Not really

normal crypt
#

That's weird

#

Seems like a pretty important feature to save bandwidth

thin stratus
#

You think it's a good idea to have variables that are meant to convey state, be unreliably dropped?

normal crypt
#

In some cases yeah

thin stratus
#

Yeah no :D

normal crypt
#

A location variable for example

thin stratus
#

There are already a lot of ways to control how often they should replicate

#

And how they should be serialized to keep the footprint small

normal crypt
#

How do you control how often they should replicate? Haven't seen that in the documentation.

thin stratus
#

As well as only replicating them to some net roles that need to know about them and not replicating the actor at all if unrelevant

thin stratus
#

You can toy around with the NetUpdateFrequency and the Net Priority of the Actor

#

Or change them to be Push Based (C++ only)

normal crypt
#

I didn't see anything about push based in the doc either

thin stratus
#

No idea about the docs

normal crypt
#

Well thanks

thin stratus
#

PushModel is basically just a way for you to mark them dirty when they are changed so the engine doesn't have to compare them every time even if they are unchanged

#

If you need to keep the footprint low you netserialize them as small as possible and usable.

normal crypt
#

I'm very familiar with replication in general. That's what I did professionally. Just trying to figure out how to do it in Unreal.

#

I want to replicate actor locations, but not their rotations. Doesn't seem like Unreal allows that. So I was looking at doing it myself with an unreliable location variable.

quartz iris
#

Is there a good guide for how to setup a 1 vs 1 win/loss system from 5 rounds? I feel like i've been banging my head against a brick wall watching all the tutorials on youtube as they don't provide enough help with the networking side

#

I just need it so in the gamestatebase I can reference all the players and their slots

dark edge
#

gamestatebase already has all playerstates

nocturne quail
#

doing this always failed when I run the game as client.

void AARMACharacterBase::BeginPlay()
{
Super::BeginPlay();
APlayerController* ControllerRef = UGameplayStatics::GetPlayerController(GetWorld(), 0);
AARMAPlayerStateBase* MyPlayerStateRef = ControllerRef->GetPlayerState<AARMAPlayerStateBase>();
if(!isvalid(MyPlayerStateRef))
{
//log Player State failed
}
}

how to fix this issue?

worthy wasp
#

Controller has a pointer already - try using this:

#

instead of GetPlayerState<T>()

#

i do the following in my own project:
CastChecked<AVI_PlayerState>(PlayerState, ECastCheckedType::NullAllowed);

#

@nocturne quail

nocturne quail
nocturne quail
worthy wasp
#

ALSO - i've got in the habit of this - way back when i started Multiplayer....

#
AVI_PlayerState* NewPlayerPState = nullptr;
        do
        {
            UE_LOG(LogVIGame, Log, TEXT("NEW PLAYER JOINED - LOOPING PLAYERSTATE."));
            if(AVI_PlayerState* TempPS = Cast<AVI_PlayerState>(NewPlayer->PlayerState) )
            {
                UE_LOG(LogVIGame, Log, TEXT("NEW PLAYER STATE CAST SUCCESS"));
                ...
                NewPlayerPState = TempPS;
            }
        }
        while(NewPlayerPState == nullptr);```
#

you may think this is unsafe....

nocturne quail
worthy wasp
#

be understanding that PState isnt 100% available at time of PController instantiation... takes a few frames to set in

#

in ALL of my logging - thi shas only done the UE_LOG 1x

#

which i would imagine = 1 frame

#

unless you have a bad game mode setup - this will never crash engine.

#

i picked this up SEVERAL years ago

nocturne quail
#

this not crash the engine, I am returning when it fails so it not crash

nocturne quail
worthy wasp
#

i dont think you're understanding me - you have to loop as I did above to get the playerstate.

nocturne quail
worthy wasp
#

its a latent setting - and unfortunately to my knowledge - not a lifecycle event on its setting

worthy wasp
nocturne quail
#

Ok, I am now implementing the loop, I hope it will work, will update for results

worthy wasp
#

so ... i've granted my abilities as server - and when I execute my abilities i'm getting a print strin gof both Server/Client... which tells me that its at least running as both.... but when I attempt to just simply do a SetActorLocation() - its not setting the location on remote clients. Should I have some other functionality here - perhaps using the CMC so its replicated? This obviously isnt a problem on ListenServer client

nocturne quail
worthy wasp
#

i guess that begs to question then - are you setting your playerstate class in your game mode?

nocturne quail
#

restarted the PC by direct power buttom pressing for few seconds

worthy wasp
#

then somehow you have circumvented setting the playerstate in the playercontroller - do you have any overrides you've done in playercontroller class?

#

maybe any custom spawn logic in GameMode that does perhaps htis?

#

its going to be deep-seeded at this point :/

nocturne quail
worthy wasp
#

for a safety sake - you could just do a iteration - instead of a endless loop... that way you iterate 10x persay - and stop if it doesnt reach it... of course your funcitonality would be the same - playerstate would be nullptr :/

#

but atleast you have loop-safety

#

sorry it crashed ur PC

nocturne quail
worthy wasp
#

past eyour code so we can figure it out

#

If you're doing htis in BeginPlay - remember that htis runs on both SERVER/CLIENT... you're inevitably running this loop 2x

#

if it is faililng - its failing in one of those netmodes

nocturne quail
# worthy wasp past eyour code so we can figure it out
do
    {
        print("New Player Joined, looping");
        if (AARMAPlayerStateBase* TempPS = Cast<AARMAPlayerStateBase>(NewPlayer->PlayerState))
        {
            print("NEW PLAYER STATE CAST SUCCESS");

            MyPlayerStateRef = TempPS;
        }
    } while (MyPlayerStateRef == nullptr);
#

NewPlayer is of type PlayerController

#

APlayerController* NewPlayer = UGameplayStatics::GetPlayerController(GetWorld(), 0);

nocturne quail
worthy wasp
#

I would authgaurd this then on server only.

#

i'm uncertain where your failpoint is - what class::BEginPlay() are you running this in?

worthy wasp
#

if you're all the way in MyCharacter - you're playerstate is most certianly valid.... and ALSO has a TObjectPtr named Playerstate..... you dont even need to reach ou tto the controller to get it.

#

i'm almost sorry we went through all of htis - i went back to read your original post and saw that the class was indeed your CharacterBase .... this was alot of unecessary troubleshooting :/

nocturne quail
#

yeah it was a confusion πŸ˜„

nocturne quail
# worthy wasp if you're all the way in MyCharacter - you're playerstate is most certianly vali...

I need to do something like this, right?

MyCharacter.h

    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Default")
    AARMAPlayerStateBase* MyPlayerStateRef;
MyCharacter.cpp

if(HasAuthority())
{
do
    {
        print("New Player Joined, looping");
        if (AARMAPlayerStateBase* TempPS = Cast<AARMAPlayerStateBase>(GetPlayerState()))
        {
            print("NEW PLAYER STATE CAST SUCCESS");

            MyPlayerStateRef = TempPS;
        }
    } while (MyPlayerStateRef == nullptr);
}
worthy wasp
#

if (AARMAPlayerStateBase* TempPS = Cast<AARMAPlayerStateBase>(Playerstate))

#

take out the do/while ...

#

you shouldnt need it

#

not in ACharacter tiemframe

nocturne quail
#

Ok

#

and Playerstate is inaccessible declared in pawn.h

thin stratus
#

Has a getter

#

Also what in the world are you doing there haha

#

If you need a valid PlayerState use PossessedBy for the server and OnRep_PlayerState for the clients.

#

The do while is never ever needed for this

#

And will also not work cause you just get stuck in the current frame

nocturne quail
#

Ok so I will use with get method standalone for server and for clients onrep

quartz iris
#

Like could you show the events I should make for the round system for a 1 vs 1

dark edge
#

I mean it's just there

#

just get it

#

Give your Playerstate an int NumGamesWon variable or whatever

#

give gamestate a NumGames variable

quartz iris
#

ok

dark edge
#

whenever someone wins a game, increment NumGamesWon for them and check if it's > NumGames/2

quartz iris
#

I think maybe i'm overcomplicating it.. I am still not sure about networking

dark edge
#

You can do all this on the serverside of GameState and PlayerState etc. If you find yourself reaching for a RPC of any sort, probably not (maybe something like CongratulationsYouWon but nothing gameplay related should need any RPC for this)

#

Detect win condition -> add to players score -> check if they won the set -> ??? -> profit

#

all of that can be done serverside just setting replicated variables (so clients can see their score update etc)

normal crypt
#

Do you have to set an actor as replicated in the constructor or can you do that later?

fathom aspen
#

Can do that later via SetReplicates

normal crypt
#

And that will create an instance on clients too?

fathom aspen
#

Can also make it dormant and wake it from dormancy once it wants to replicate

#

It will

normal crypt
#

Awesome, thanks

clear island
#

how does one detect the shutdown of a dedicated server?

#

the GameInstance::Shutdown and GameInstance::ShutdownAfterError dont get called for dedicated servers, is there any other way?

nocturne quail
#

I tried to add SetReplicates(true); on character, and attached a mesh to character, got a breakpoint in here

// Due to replication order the ensure below is only valid on server OR if not both parent and child are replicated
        if ((Owner && Owner->GetLocalRole() == ROLE_Authority) || !(GetIsReplicated() && GetAttachParent()->GetIsReplicated()))
        {
            // Make sure parent points to us if we're registered
            ensureMsgf(!bRegistered || GetAttachParent()->GetAttachChildren().Contains(this), TEXT("Attempt to detach SceneComponent '%s' owned by '%s' from AttachParent '%s' while not attached."), *GetName(), (Owner ? *Owner->GetName() : TEXT("Unowned")), *GetAttachParent()->GetName());
        }

nocturne quail
nocturne quail
#

can Replicated functions call a return type function?

fossil spoke
#

RPCs are Events, Events dont have return types.

nocturne quail
# fossil spoke What do you mean?

means like:

const FName UserName;
UFUNCTION(Server, Reliable, WithValidation, BlueprintCallable)
FName ServerUserNamesDatabase(FName NewUserName);
FName UserNamesDatabase()const {return Username};

ServerCalculateHoldGunSocket(FName NewUserName)
{
UserNamesDatabase(NewUserName);
}
nocturne quail
fossil spoke
#

UserNamesDatabase in that example would just be a regular function?

#

There is nothing wrong with the code you posted above.

nocturne quail
fossil spoke
#

Can you post the exact code

#

All of the code

#

Both .h and .cpp

nocturne quail
#

.h

const FName UserName;
UFUNCTION(Server, Reliable, WithValidation, BlueprintCallable)
FName ServerUserNamesDatabase(FName NewUserName);
FName UserNamesDatabase()const;

.cpp

void AARMAPlayerControllerBase::ServerUserNamesDatabase_Implementation(FName NewUserName)
{
    UserNamesDatabase(NewUserName);
}

bool AARMAPlayerControllerBase::ServerUserNamesDatabase_Validate(FName NewUserName)
{
    return true;
}
FName AARMAPlayerControllerBase::UserNamesDatabase() const
{
    if (!HasAuthority)
    {
       UserName = ServerUserNamesDatabase(UserName); return UserName;
    }
//Somemore logic... 
return UserName;
}
fossil spoke
#

Ohh sorry

#

I must have missed it in the original code

#
UFUNCTION(Server, Reliable, WithValidation, BlueprintCallable)
FName ServerUserNamesDatabase(FName NewUserName);
#

This is wrong

#

You cannot have a return type on a RPC

#

As I said earlier, they are Events

#

Events dont have return types

nocturne quail
#

hmm sadly

fossil spoke
#
UFUNCTION(Server, Reliable, WithValidation, BlueprintCallable)
void ServerUserNamesDatabase(FName NewUserName);
#

Im not quite sure what you expect to happen here?

#

What are you trying to do?

nocturne quail
#

names, scores, kills etc

fossil spoke
#

Ok thats sort of a separate issue though.

#

Why do you think you need a return type on the RPC is the question.

nocturne quail
#

later compiled, and got error

fossil spoke
#

Do you understand what an RPC is?

nocturne quail
fossil spoke
#

Ok, so you know they are only 1 way calls.

#

Thats why they dont have return types.

#

So converting an existing function to an RPC with a return type makes no sense.

nocturne quail
#

Ok, but I didn't convert...
I just tried to call this function FName UserNamesDatabase()const; on server , just duplicated it and added those return types and the function type remained FName as well

#

Now its working changing it to void

#

Thank you very much for correcting me

fossil spoke
#

πŸ‘

shadow hatch
#

ive run into a bit of an odd problem. so im simulating two players trying to interact with the same 'chest' that has an array of game items they can manipulate

now the problem is ive made it so the last player to interact with the chest takes 'ownership' of the container actor for the purposes of being able to use PRCs but then that stops the first player who interacted with the chest from making use of those RPCs, is there some more universal solution to this

thin stratus
# shadow hatch ive run into a bit of an odd problem. so im simulating two players trying to int...

I fixed that by splitting the Inventory into 2 systems or rather components.

I have inventory components and an inventory manager component.

The Inventory Component sits on the Chest and other Actors and mainly deals with the actual item part of Inventory as well as with modifying itself. It doesn't have any logic to move items between inventories (or itself) but rather had the logic one needs to perform that action. Such as figuring out where an empty place is or if it can stack something. And then actually adding and removing entries. However all of that without the knowledge of a second inventory.

The Inventory Manager Component sits on the PlayerController and can receive RPCs. It exists once per player and handles the communication between two inventory components. Such as move item from I InvComp 1 to InvComp 2 .

mortal tusk
shadow hatch
tardy lark
#

anybody here knows how to make a whitelist system for beta testers (IP based) so that if a beta tester sends a build to someone who isn't a beta tester the game crashes at startup

cursive steeple
#

Curiosity

daring gorge
#

Hey everyone i wanted to ask about making multiplayer games using blueprints, ive been working on my fps over a year now and ive made it completely in blueprints and ive implemented most of the core systems but i am slowly finding out that blueprints are not really suitable for making a big multiplayer project, does anyone have any ideas of what can be done in such situations?

vestal path
#

It's not an either/or choice between "blueprints" and "no blueprints"

you can always migrate just the bits you've run into problems with into C++ and keep the rest in blueprints

the systems are designed to work together

daring gorge
#

How would i migrate bits of my character bp into cpp when most of it is already done?

vestal path
#

Generally speaking that decision is made at the actor level, and in most cases involves a rewrite

typically you'd have the basic code functionality of the actor (so, in this case, movement, input binding, etc) in a C++ class and then make your Blueprint derive from that class and add stuff like models, animations, etc in the blueprint

daring gorge
#

Right , id have to basically rewrite the whole thing from scratch

vestal path
#

this is why it's good to design scalably early! whether it be with just a simple division of labor between components (you can mix and match C++ and blueprint ActorComponents too) or with the gameplay ability and gameplay feature systems

daring gorge
#

Indeed but i didn't know that only bps would not be the right way

cursive steeple
daring gorge
#

and i do wish to someday publish this project on steam so i do wish for it to be optimized and for people to not jitter around-

vestal path
#

there are far too many moving parts in modern games for performance to be a game of pure reason

measurements are king

cursive steeple
# daring gorge im quite confused as to what to really do, most of my character bp is done, almo...

Guess it depends on specifically what aspects are unoptimized. If it's deeply tied to your core class functionality, then I guess only a full rewrite can really improve things. If it's a specific functionality tho that you can turn into a component lets say and only move that part over to cpp, that's an option then. It all comes down to your bottlenecks and the hardware youre targeting. Do you ACTUALLY have a perf issue atm?

#

(Also gotta point out that not even cpp can save bad coding, so it really depends on what youre actually doing.)

vestal path
#

and yeah you can move just the bits that you need to optimize into c++, you know? whether that be via actor components, blueprint function libraries, loose uobjects, subsystems...

daring gorge
#

The only issue ive faced is when play testing till yet theres a bit of a movement jitter or rubberbanding but thats all really

vestal path
#

Are your player pawns Characters?

daring gorge
#

Yeah

vestal path
#

huh, usually that kind of network jitter should be handled by Characters then

in any case I don't think it's a performance problem then unless the game is stuttering or the profiler shows a high time for the blueprint

cursive steeple
daring gorge
#

Listen server

#

I realise it can be a bit contributer to this but i was more concerned just about the use of bps

#

Ive been watching more videos regarding how they are not really the way anyone would go about making a multiplayer game and it tensed me up since ive been working on my project since quite a long time

#

And tbh i did test my game in conditions where there was a network issue from the host

vestal path
#

Blueprints, by themselves, are not unoptimised by default

Code performance is more about the code you write rather than what you write it in

Blueprints are slower than C++ but that's often an entirely acceptable tradeoff in the vast majority of situations

daring gorge
#

Hmm

#

Would nativization help?

#

Like when i project

vestal path
#

no longer exists

daring gorge
#

Oh

#

I use 4.26

vestal path
#

ah, it's still a thing in 4

still, it got removed from 5 for a reason

#

(unreliability and complexity)

daring gorge
#

Oh i see

#

So you say i do not need to rewrite or worry much unless i do face an issue that strikes out

vestal path
#

In any case

Don't worry, honestly

The engine has profiling tools, you shouldn't overoptimize too early

Some thought is good to put into it early but you don't need to squeeze every cycle out before you even have a game

daring gorge
#

Thats relaxing to hear. I shall profile before i take any decision i guess. Sorry for the weird doubt ig as i said i just got tensed over having to work all over again on something ive been working for so long for. I appreciate your help and input : )

cursive steeple
# daring gorge So you say i do not need to rewrite or worry much unless i do face an issue that...

I think worrying abt BPs without an exact performance issue is pointless. If you see high game time (bp execution time), thats where you should spot the code thats causing the issue and try to optomize it. If you cant, (cz it absolutely needs i.e lots of nested loops or w/e, things that are inherently slower in BPs than in cpp), thats where you could look into turning that functionality into a cpp component or function library.

daring gorge
stoic matrix
#

is it bad practice make iteminfo modular like lyra? many tutorial make item info into one big struct

#

Is it because this way is more performent in a multiplay environment?

#

lyra's modular way was seemed better, but everyone don't using it, so I'm afraid it would be the wrong way

cosmic yoke
#

hello, i have an actor that loses net relevancy (as intended) but it takes around 3 seconds to remove it from the client, how can i speed that up? i tired increasing the net update frequency and the net priority but it seems the same duration to disappear

gritty kestrel
#

Hey guys I'm developing a multiplayer game for Android bt I am unable to use unreal engine deafult gamepad joystick for example let's say we have 3 players then only player is getting controlled like if 1st player uses controller 2nd player moves and if 3rd player controls 2nd player moves

#

How can I fix this add your inputs guys. Anything will be appreciated

kindred widget
# stoic matrix lyra's modular way was seemed better, but everyone don't using it, so I'm afraid...

People don't use it because it's newish. People have a hard enough time following Lyra let alone implementing it's data structure.

Whether it's good or bad depends. As far as static data goes, it's probably the best way. Pointers are cheap to replicate and all you really need is the top level asset holding all of the other assets for a thing. If you have statically specified modules for stuff that you want to swap out, it's probably still a good idea to use data assets.

But for anything that needs to be dynamic. Like the item stack on a simpler item, you still need some form of pod replication, which is usually best in a struct of some kind.

stoic matrix
jaunty marsh
#

Hey i’m working on a multiplayer game and setting up a server for the first time so i decided to follow Ryan Laleys online sessions tutorial but now I’m stuck with only the host session being able to spawn in with their chosen character and everyone else spawning as a blank character class. in his tutorial he’s able to fix it because he handles respawning in blueprints but that’s handled in c++ for my project and i’m not really a good enough programmer to sort this out myself tbh can anyone help?

#

Basically the way I have it set up is that you join a session into a character select lobby and once you choose a character it gets saved to a game instance and once you load into the map after start it looks at the game instance and replaces the default pawn with your chosen character

#

however only the host will actually spawn as the character they selected

thin stratus
#

@jaunty marsh I can already tell you that there are better ways to do the "Save what Character got selected" when you are already connected to the Server

#

Moving data from MainMenu to Lobby might be a sh*tshow, but Lobby to Gameplay Level is a lot easier

#

You can save the Data in the PlayerController of the Player (Server-side)

#

And in the GameMode you have a function called "OnSwapPlayerController"

#

Where you can move the Data from the Lobby to the Gameplay PlayerController.

#

The cool thing about this is that you can then override the "GetDefaultPawnForPlayer" (or whatever it is called) and simply get the data from the Player function param.

#

Also saves you from the whole sh*t of RPCs you need for the GameInstance solution

#

Does require you to use SeamlessTravel ,which you should anyway

jaunty marsh
#

@thin stratus I got it mostly working thank you

quartz iris
quartz iris
#

Like I can figure out who died

cursive steeple
# quartz iris Like I can figure out who died

Idk what your project looks like or plays like cz I wasnt following, but normally you'd have a bDead bool var somewhere, you can have it in the player state in this case and you'd set it to true when someone dies ingame (based on your custom rules and gameplay). If it's 1v1 then it automatically makes the other player win, if more players, then you'd check for an overall wincondition everytime anyone dies.

quiet fjord
#

guys i have a problem i am using the gamelift plugin in blueprint and now with the aws interface change. When I have to change the map with the open level, it doesn't do it and before in the previous version, yes. Has this happened to anyone?

quartz iris
#

Like how do I put it into code

cursive steeple
cursive steeple
quartz iris
cursive steeple
quartz iris
#

Also which player won the overall game

#

Because I need to call an end screen widget

cursive steeple
quartz iris
#

Would you be able to show me because I spoke to a few other people and they just said what I said basically lol

cursive steeple
quartz iris
#

Pls

cursive steeple
quartz iris
cursive steeple
quartz iris
#

But i'm not sure how to keep track of the winning player

#

Like how to reference it in the gamestatebase

cursive steeple
cursive steeple
quartz iris
#

This is the gamestatebase

cursive steeple
# quartz iris

Getting the player state in the last pic is pointless, just cast the array element to your custom class

#

And you pretty much have it btw

#

The only thing missin is you calling your gamestate check when incrementing the value for the win

cursive steeple
#

Getgamestate->cast to your gamestatebase class -> call the win check

cursive steeple
quartz iris
#

This correct?

#

Doesn't increase the round wins variable

#

below is from the player

cursive steeple
# quartz iris

First increase the int in your playerstate, then call the gamestate winner check to see if with this last win anyone has won the game overall.

#

Youre doing it the other way around

quartz iris
#

You can't increase the player variable from the gamestatebase?

#

I would prefer this if possible

cursive steeple
quartz iris
#

It doesn't work