#multiplayer

1 messages · Page 727 of 1

twilit radish
#

If it's easy to do I would totally do it yes. If it's really complicated I would move on to something else. But that's up to you to decide what you find worth the effort or not.

faint gust
#

i think making it imposible to pickup somthing from across the map is worth it

quartz iris
#

How would I swap their material within the client event? sorry if im a noob

#

I know about client events just not sure about swapping mats

fresh chasm
quartz iris
#

What about setting the normal material which it had been set to before? For example after the ability ends the material goes back to normal

fresh chasm
#

You can store the original material in a variable for when the ability fades

fresh chasm
#

then you call again set material

fresh chasm
quartz iris
#

Wouldn't the variable have every single player material though?

fresh chasm
#

Or only one material if all players have the same

fresh chasm
#

So you get all characters, then you call "switch to highlight", they all store and swap material, and then you can call another function that reset to the original

quartz iris
fathom aspen
#

Correct you still have to do the trace on the server only if you hit something, i.e the trace is eligible to the client. So you kinda pre-test on client but the server has the final saying and this way you don't bug the server each time you line trace

twilit radish
#

Ah like that.

fathom aspen
#

So doing it only on the server isn't the answer

twilit radish
#

Then yeah, totally agreed.

mild lark
#

Got a bit of a problem. I have two c++ classes for a local multiplayer project (UE5) and basically upon a key press one of the actors will teleport to the other's location and the other actor will teleport to the other's location. This will only occur if both aren't nullptr. but whenever I try it apparently both are nullptr. (I have an error message that appears if their nullptr upon a key stroke) Does anyone know how to solve this?

fresh chasm
twin juniper
#

does anyone know any tutorials on Multiplayer that start from square 1? I see a lot of them and they expect me to know a bunch and it's very difficult.

faint gust
#

is this safe

#

client code

sinful tree
# faint gust is this safe

Sure, but why do you need to go to the game mode to do a trace? That's something you should be able to do on the class performing the interaction itself.

twilit radish
#

It's not. The gamemode doesn't exist on the client.

faint gust
twilit radish
#

Do it on the server or somewhere else if it's need to be the client.

sinful tree
#

(An Executes on Server event is running on the server btw...)

twilit radish
twilit radish
faint gust
#

i mean not client but charafter code so server & clients

twilit radish
# twin juniper does anyone know any tutorials on Multiplayer that start from square 1? I see a ...

Not really a "tutorial" but this is a good start to at least explain some things: https://www.youtube.com/watch?v=JOJP0CvpB8w

An overview of the essential concepts for writing multiplayer game code in Unreal, in under 25
minutes or your money back.

Sample project: https://github.com/awforsythe/Repsi/
Patreon: https://patreon.com/alexforsythe
Twitter: https://twitter.com/alexforsythe

00:00 - Introduction
01:24 - Net Mode
03:33 - Replication System Basics
05:13 - Acto...

▶ Play video
twilit radish
faint gust
twilit radish
#

No they can't. They can however adjust arguments passed from RPCs. But you don't have those with this specific one.

#

Cheaters can't magically change variables on the server. They can only change what you allow them to change.

faint gust
#

i do have this but that stuff is only for client stuff

twin juniper
#

thank you so much brother

#

you are a help

#

i needed a starting point

fierce fiber
#

Hey guys, Im having an issue with my player character, the host can succesfully host a lobby and move around, but when another user joins, they cant move, they just stay there statically, here is the spawning of my players within my gamemode, I have the gamemode parent set to "gamemode", the default pawn set to nothing, and the controller set to my multiplayer controller

foggy rivet
#

Does anyone wanna make a game with me

twilit radish
foggy rivet
#

I already have the name, lore, and story

faint gust
foggy rivet
#

Where do I go to?

faint gust
#

at least i think

twilit radish
#

Unless you meant with pawn an actual character 😛

fierce fiber
twilit radish
#

Ah nevermind then. Character does have movement.

faint gust
#

like it seems to work just fine in my eyes

fierce fiber
twilit radish
#

How do you add input to the character?

dark edge
fierce fiber
#

Im using the third person blueprint, so the input is just default

twilit radish
foggy rivet
faint gust
sinful tree
# faint gust i do have this but that stuff is only for client stuff

Don't pull variables across execution paths - you're going to run into problems, especially so if you do it in multiplayer.

Event Tick runs on both server and client.
What you're basically doing right now is having the server and the client both call the "Interact Trace RCP" event on tick. So the server will end up doing it twice, and is effectively completely unnecessary.
The server doesn't need to know what the client is looking at every tick - that's something that can be handled completely client side. It's only when you go to actually perform something with what the client is looking at that any RPC would really need to be made, and you'd pass along a reference to the actor you're trying to interact with. The server can validate if the player is within range/looking at the actor or whatever other checks you want when the client asks to perform the interaction.

dark edge
#

skip the not cheating part for now, make it work first

#

The client just calls
ServerInteract(ActorIWantToInteractWith)

twilit radish
#

@fierce fiber Do you have this enabled on your character?

fierce fiber
#

Where can I find this

twilit radish
#

In the Character blueprint.

#

On the root of it in the details panel.

fluid summit
twilit radish
# fluid summit Is this a joke? lol

Ever looked at #volunteer-projects ? People ask others to work for them for free on MMORPGs. I don’t consider these kinds of things a joke at all compared to stuff like that. If you can’t afford to pay for people you can’t setup an MMORPG that will succeed 🙂

#

Sounds maybe a bit harsh. But I truly have the opinion half of the requests in that channel are just a big red flag.

#

No contracts usually provided for things like rev share or payments at “a later date”, vague details and often the most ridiculous requests 😅

fluid summit
twilit radish
#

I don’t agree with it too, don’t worry. But still miles better than asking for an entire unpaid team for a MMORPG that you have not even started yet.

#

Which are legit requests from time to time in there.

fluid summit
#

I was just checking unpaid gigs, damn.

potent coral
pastel reef
#

Is it possible to host multiplayer on my own laptop for friends?

potent coral
#

depends on the kind of game ure hosting i guess

pastel reef
#

Building game

#

Just static messhes being placed around

potent coral
#

minecraft should work yes

pastel reef
#

Minecraft?

potent coral
#

yes as long as u dont make the map too big lol

pastel reef
#

What’s the limit? I’m using world partion

#

Also can sever progress be saved?

potent coral
#

you have to test that yourself

twin juniper
#

What is the replacement for "get player controller"? I understand that is for local and not client. What is the equivalent of that but for client? I need to have all the clients to share the same camera in the level but I need to understand how to get them. I apologize for being so everywhere and hard to explain. It sounded better when I was in the shower lol.

dark edge
#

Or do some stuff in PlayerCameraManager to find the camera actor

twin juniper
#

got it

#

any free stuff I can consider as well?

pallid mesa
#

you can extrapolate this to aerial movement

#

but bare in mind it is client authorative

flint star
#

If i use replicated movement, is there a way to NOT interpolate the location on teleport?
I am using actor pools and when I set the location on server it jerks a lot on clients, instead of instantly snapping to the final location

chrome bay
#

Depends, what actor is it?

#

If it's a character, you just need to turn the smoothing off in the movement component

fierce fiber
#

Hey everyone, I'm having an issue. Someone is able to host a lobby just fine, however, when they go to the server browser, join a lobby then enter, they possess the third person character, but is unable to move the camera with the mouse or the camera itself, here is my joining code

grave lynx
#

Maybe you forget to posses the character after spawning

fierce fiber
#

This is my code for possessing when logged in

#

Thats in the gamemode for the map, and the joining session stuff is in my game instance

#

The joining custom event leads back to the menu and applied to a menu button

fathom aspen
#

Call it for the controller

fierce fiber
fathom aspen
#

Nope, in OnPostLogin

#

After possess for example

fierce fiber
#

Didn't work, I put this in after possess

#

And received this error

#

On begin play it is set as a custom variable

fathom aspen
#

Oh yeah you should call it on client 😄

fierce fiber
#

Im using the gamemode for the possessing, shouldnt that already be client side or am I being extremely dumb

fathom aspen
#

Call it OnPossess in Character class and make sure you're the client(using IsLocallyControlled)

fathom aspen
fathom aspen
#

You get it in OnPostLogin as a param. Doing it this way you are susceptible to racing issues

fierce fiber
#

I see, I also tried doing an on possess event and it didn't work, I'm very stumped, would it be too much to ask to join the voice chat? Maybe Im just doing it incorrectly

fathom aspen
#

I'm in another voice. Try sticking to this chat so other people get the info too when they face similar issues

fierce fiber
#

This is how I did my possess event in my PC

#

Not too sure if this is how I was meant to do it haha

fathom aspen
#

No not this. I meant the one called in pawn which is PossessedBy

#

But it seems like it's called only for server too

#

Then call a client RPC and do that SetInputGameModeOnly

#

Seems like APawn::Restart is a good candidate but it's cpp only

twilit radish
#

How do you even add the mouse input to the camera in the first place btw?

fierce fiber
dim trail
#

Are there any alternatives at all for simple move to for dota like movement, that works with GAS? Or am I stuck with using wasd?

grave lynx
#

Hello guys, I have a little issue with multiplayer (maybe because of ue5). I'm using steam session for host/join. When the server is using open level insdie the game instance, the others clients are teleported to the game default map. Any idea?

dim trail
#

@whole grove it does though, because top-down uses simple move with doesnt have replication, so it interferes with GAS

sacred kraken
#

I get that this discord is probably biased towards epic but... Should I try epic online services? I've just finished learning the basics about steamworks and I'm curious if eos might be better in some way? My end goal is to have something that works on quest2 standalone with, if at all possible, crossplay (if that's what it's called) with pcvr.

fathom aspen
silent valley
#

Bit of a long shot, but we're having some issues with Level Instances and replication. We're using level instance actors in the world to load sub levels. They are all loaded when the persistent world is loaded.

Sometimes when we start the game (in PIE, not sure about package yet) some of the objects in the loaded level instance are not replicating. No replicated var changes, no rpcs, etc. Once it's broken it seems to be broken multiple times in a row, then it might start working and work for multiple times in a row. I suspect a timing issue related to loading as it rarely used to happen but now we have more level instances it happens a lot.

While debugging, it seems like the NetDriver on the client has no NetGUID entry for this broken actor, and I don't know why that would be.

Anyone got any ideas?
Do you know how I can check if it's the server who decides the client doesn't need to know about this actor, or if it's the client ignoring the server about this actor?

grave lynx
fathom aspen
#

client is hosting?

#

Sorry. Start to post code otherwise I will lose it

grave lynx
lavish charm
#

Hi all, i got a question related to actor and replication versus network latency.
Is there a way to spawn actor locally and transfer ownership to the server so it can be better managed and allow local player to spawn it faster than the server would ?

i wanted to spawn actor(weapon) non replicated on each client so that the local player dosent feel network latency.
An issue i noticed is that if the actor were not logged in or not network relevant the actor dosent spawn, only way i could fix it is setting the actor as replicated.

is there any tricks to make it work, or maybe use repnotify ?

latent heart
#

Is it possible? Sure. It is easy? No.

#

You could spawn it locally and then replace it with the server version.

chrome bay
#

There's no point spawning a weapon to avoid latency if they can't do anything with it

#

And the race conditions will be nightmarish to try and resolve

winged badger
#

well, only thing you would need to solve is have a deterministic naming between server and client for the Actor, and IsFullNameSupportingForNetworking() returning ActorHasTag(TEXT("PredictivelySpawned")), which you add to Actor at the time of the spawning

#

afterwards you can even turn the replication on, but if you make an error, your clients get booted out of the session

#

it might need additional lying to the server to open an actual ActorChannel

#

all in all, i don't recommend the practice for something as often spawned and short lived as bullets

fallow shadow
#

Executing a server rpc from server will just execute as normal right?

lost inlet
#

yes

grand mica
#

are MoveTo Functions replicated and multicasted by default?

faint gust
#

question the player charafter code is on the server AND client witch means if a hacker modifies the code antyhing they try to change will only be on thier side because the server is doing it also right

pallid mesa
#

yes

sinful tree
# faint gust question the player charafter code is on the server AND client witch means if a ...

It depends. Think of RPCs as entryways into the server - a client could effectively call any client->server RPC whenever they want. Therefore, if a hacker decides to modify the client code to send an RPC whenever they want, the server will receive the RPC and process it.

Additionally, if you're passing data through an RPC, a client could potentially modify whatever the values are that are being passed through. If your server code doesn't do any validation of what is being passed through, then you have an avenue for someone to cheat. An example would be passing through co-ordinates of where a player wants to teleport to - sometimes you may want to have a client tell the server where they want to move, but if the server doesn't check if that location is within range or is a valid place to teleport to, or that the player should even be able to teleport currently, then the client can effectively move anywhere in the game whenever they want.

So it's not really just a matter of what is on server or what is on client, it's more a matter of what the server allows to happen.

faint gust
fallow shadow
#

Is there really no built in basic movement interpolation (cmc)?

sinful tree
faint gust
bitter oriole
fallow shadow
#

shit

sinful tree
fallow shadow
#

interpolation seems like such an annoying thing to make work (especially since i have no idea what im doing)

#

augh

bitter oriole
fallow shadow
#

Making an UPROPERTY Replicated

#

uhh

#

so if i have a replicated uproperty by default the client cant modify it right?

thin stratus
#

It can, but that won't change anything for anyone else

fallow shadow
#

That's what i meant

#

👍

hollow ginkgo
#

Hi all - I'm relatively new to the concept of session based multiplayer games. I've been exploring converting Lyra to support multiplayer gaming via a server hosted on AWS Gamelift. I've got that working, multiple clients can connect and play just fine. The issue I'm hitting is the username/Nickname that is selected for the client seems to be based on the local PC name, with some random numbers appended. I noticed when reviewing the logs on the dedicated server, it shows the connecting client with the Options parameter that includes ?<PCName>_<randomNumbers>... when I'm doing my Open Level call to the IP:Port, I don't include any Option string so it seems like it's being added somewhere else after the fact. After some digging, I found some code in Runtime\Engine\Private\PendingNetGame.cpp at line 253...

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

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

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

Can bad network allow for RPC's misordering?

hollow ginkgo
#

What I'm struggling with is trying to figure out how I can override the nickname that gets sent so that when it does LocalPlayer->GetNickname() it uses a custom nickname, rather than an auto generated one. I tried tracing through but couldn't figure it out

fathom aspen
uncut schooner
#

Thanks

hollow ginkgo
#

Does anyone have any experience with that or ideas on how to set the LocalPlayer nickname?

twilit radish
#

@hollow ginkgo

/**

  • Retrieves this player's name/tag from the online subsystem
  • if this function returns a non-empty string, the returned name will replace the "Name" URL parameter
  • passed around in the level loading and connection code, which normally comes from DefaultEngine.ini
  • @return Name of player if specified (by onlinesubsystem or otherwise), Empty string otherwise
    */
    virtual FString GetNickname() const;
    So what you can do is make a custom ULocalPlayer and just override the method.
#

Not sure if it's the best solution. But it's based on your findings 😄

#

But I kind of expect you to have at least used Google if you went this deep lol.

lost inlet
#

or just don't use the null onlinesubsystem for the shipping game

hollow ginkgo
#

thanks

split siren
#

I am trying to optimise/reduce character features to run as many as possible on 1 server.
I have noticed Anim Blueprints are running on server, which is not necessary for my case. Is there any button to turn them off on the server (and keep them on clients)?

chrome bay
#

Set the mesh animation update mode to "Only Tick When Rendered"

#

Just keep in mind, it means you character PHAT/hitbox server-side is likely in reference pose if you do this. Sometimes it's beneficial to run very primitive anims server-side, or at least set poses

split siren
tame sapphire
#

Can any one helpw tih the following, it works on a server but not a client (when running in PIE). It might all be wrong but half works.... basically trying to get a target player state from a left mouse click

dark edge
#

That's why it's not working, the hit result under cursor is local only, the server has no clue what the client's cursor is aiming at

#

This should be clientside

tame sapphire
#

I didnt think it was on the server

dark edge
tame sapphire
#

@dark edge updated it to this as it seemed smaller

#

print string is returning the ai controller

#

but again that only works on the server of a PIE and not the client

dark edge
#

the run on owning client event

#

get rid of it

#

This can all be local, nothing has to go over the network

tame sapphire
#

I thought you needed to if doing listen servers?

hexed thunder
#

Is there a way to tell a Box Collision component of an object it only exists for the server? I end up writing a bit of code on begin overlap and then switch has authority because really only the server needs to be doing that in a multiplayer game if a player is walking into some area, what are best practices for this? One thing comes to my mind is doing something on construction script and deactivating the box collision for clients maybe?

dark edge
#

You're trying to just pop up some widget when you click a unit right?

fierce fiber
#

Getting this error currently that is appearing in my multiplayer gamemode, when the first player is kicked, it runs through the events and casts correctly, but when another player is kicked, it stops on this node and tells me that its struggling to access it. Essentially, I am getting the player ID and making sure it kicks the correct person, but it wont access this cast when the 2nd person has attempted to be kicked. I am not too sure why on another client, its not running through the same

#

This above event is also happening within the multiplayer gamemode

twin juniper
#

Before I ask another question I will tell about my "shared camera" issue. I have a camera being used by all players over network. I put it in gamestate and I set the viewtarget with blend to my camera that is going to be used by all. Then I "get all actors of class" and use my created "player controller". It worked lol. I appreciate the assistance from those helping me.

#

but my question now is should I have a separate gamemode for Network use and one for Singleplayer use? like would the code and work that is going to be used in the network work for singleplayer modes? such as like an arcade.

dark edge
#

@fierce fiber Show the error

#

Also wtf are you doing with that bool

plucky prawn
#

Is there a generic/OSS-agnostic way to get a unique ID for a player that is persistent between sessions? Eg a steam ID which is the same for the player each time they join a server. Not sure what other platforms have but I'd like to not tie myself to steam if there's a generic way of doing this

hollow eagle
#

No, that doesn't really make sense. Every platform can do whatever they want for their user ids, there's no singular id to uniquely identify players across platforms unless you make one yourself or use something like EOS that works across different platforms.

plucky prawn
#

Ah OK that's unfortunate but makes sense. I thought that's what FUniqueId was for.. Or FUniqueID

hollow eagle
#

FUniqueNetId is implemented per-OSS

#

and it's unique for that subsystem

#

You could store which OSS an id came from along with the id but there's no singular id type for this. How could there be when every single platform uses something different as an id?

plucky prawn
#

Oh OK. That should be fine. For steam this would be the steamid right?

hollow eagle
#

FUniqueNetIdSteam encodes the steamid as a uint64

#

other platforms may not even use numeric ids

plucky prawn
#

Right. I'm curious how a game like satisfactory that allows both steam and eos to connect to the same server would handle things like bans

hollow eagle
#

satisfactory doesn't use steam

#

it uses EOS, which abstracts steam

plucky prawn
#

Oh :0

#

I thought eos was specifically the epic games oss

hollow eagle
#

it's not

plucky prawn
#

Very interesting

hollow eagle
#

it's a separate platform that connects to a number of other services (including epic's own). Playfab offers something similar.

plucky prawn
#

I'm not familiar with playfab but that sounds cool

#

If you are using eos can you check if you are using steam?

hollow eagle
#

probably, check their docs

twin juniper
#

I just love how all my problems evaporated when my team purchased SmoothSync. Just wow. Wow.

I'm trying to study the source code. So far it looks like plenty of intriguing code design choices. I'm in awe.

nova wasp
#

Glad it worked out

azure hull
#

Hi. Anyone knows why - GetOwningPlayer (using for MP) cast to PlayerController BP fails? Trying to get it and cast it in the widget on button click event.

bitter oriole
#

PCs aren't replicated

winged badger
#

ummm

#

its from a widget

#

all widgets are local, and most of them can access the PC

#

usually only ones on the widget component will fail to grab the PC, as their outer is GI

#

ofc if you explicitly put something else other then local PC into PlayerOwner when constructing it, then you broke it

azure hull
#

Yeah the issue was weird, dont know how I managed to get it like that. Had the one on the Right. After recreated again, Left one worked. After inspecting other widgets found out that had Construct not Create.

#

That was the reason why I had a different owner of the Widget.

fierce fiber
faint gust
#

i have this code running on client & server and i constantly get this error
Blueprint Runtime Error: "Accessed None trying to read property CallFunc_GetController_ReturnValue". Node: Line Trace By Channel Graph: Interact Trace Function: Interact Trace Blueprint: BP_player (it extends character)
any ideas?

dark edge
#

If you and me are playing the game, on my computer, your pawn cannot get your controller (it doesn't exist)

faint gust
#

its two clients aswell the controlls and trace work fine

#

but it should only to be egttong its own controller right

dark edge
faint gust
#

i know but im not trying to get yours

#

im only trying to get mine

dark edge
#

Show how you're calling this function

faint gust
#

every tick

dark edge
#

Yes so on tick, your pawn on my machine is trying to get its controller, which doesn't exist.

#

My machine has my pawn and your pawn

#

but only my pawn has its controller here

faint gust
#

so how would i only get my controller

dark edge
#

There's no need to do the interact trace everywhere

#

do it either on owning client or server

faint gust
#

so do an has authority?

#

yup that works!

#

also for this code how would i get this onto the server would i use a custom event that replicates onto a server or is there a safer way?

uncut schooner
#

Since its an input

#

A custom event is the only way

glad escarp
#

If anyone has 5 or 10 minutes to look over the code pasted in the pastebin link below and let me know if they can see what I'm doing wrong I would appreciate it. I tried to comment well enough to explain where each blueprint callable function is being used in a Widget BP but if it's confusing I can explain it. When a player clicks on a server button it seems that they join the session but then they do not appear to travel to the map menu.

https://pastebin.com/h62sbveV

fathom aspen
#

Instead of sending the code, send the logs. No one would have time looking at the code really

glad escarp
fathom aspen
#

This guy didn't have errors and we could help him figure out the issue

glad escarp
fathom aspen
#

It's crashing

#

The UE5-BALLS Game has crashed and will close

#

LogProperty: Error: Struct type unknown for property 'StructProperty /Game/MetaHumans/Common/Face/Face_AnimBP.Face_AnimBP_C:AnimGraphNode_LiveLinkPose'; perhaps the USTRUCT() was renamed or deleted?

#

That's prolly the error that causing the crash. The previous errors can be deleted this way: https://forums.unrealengine.com/t/warning-createexport-failed-to-load-outer-for-resource-for-many-blueprints/365898

faint gust
#

i have this interface that when triggers dstroyes the item and is MEANT to add it to the inventory so it apears in the gui but either the gui dosnt work in MP or the add to inventory dosnt work any ideas and any code i need to share?

tame sapphire
glad escarp
# fathom aspen It's crashing

Thank you. Sorry the crash is happening when I try to launch. I had forgotten that it would show up in the log. I wasn't attempting to address that yet. I appreciate this guidance. I'll get to work on fixing it. I'm not sure how to fix the metahuman pose other than to just maybe remove the animBP from the face mesh?

thin stratus
glad escarp
faint gust
faint gust
thin stratus
#

Then the code inside of that is relevant

#

Also is this called on the Server or on the Client?

#

Or even both?

faint gust
#

this is how its ran

#

this is the inside

#

and it is both iirc

fathom aspen
faint gust
#

shiii how would i fix this?

fathom aspen
#

Use arrays

faint gust
#

is that hard?

fathom aspen
#

Nope

#

Array of structs if you would

faint gust
#

i already have a struct

fathom aspen
#

You don't have an array of structs though

fathom aspen
#

But even if you did, it wouldn't replicate

#

Now you know it doesn't

#

Go make your research on how you will change it

faint gust
fathom aspen
#

Right

faint gust
#

is it hard to convert a map to array?

fathom aspen
#

What do you mean? They are different data types

#

They are built different too

bitter oriole
fathom aspen
#

They are laid out differently in memory too

#

You can do it your way like Weirder said

dark edge
faint gust
dark edge
faint gust
#

this is how im using it i belive im using it to its fullest

dark edge
#

and when you hit 0, do you remove the entire entry or is it Apple : 0?

faint gust
#

yes

#

i plan on adding that but i dont have a way to remove items yet

dark edge
#

@faint gustJust make an inventory struct with name and amount in it

faint gust
dark edge
faint gust
#

would that hurt performance

dark edge
#

Not really. What other options do you have?

faint gust
#

i guess your right

dark edge
#

I mean, are you looping through an inventory with 10,000,000 items every tick?

#

If not, don't worry about it

clear copper
#

Is the GameMode available to the client?

kindred widget
# clear copper Is the GameMode available to the client?

Generally no, with the exception of a Listenserver host. But you should never assume any "Player" has the ability to use the GameMode. Even on a listenserver host you code things so that there is server code, and client code. Keeping this makes it so that your game framework runs whether it's listenserver, dedicated, or singleplayer.

lime iris
#

Question: Maps can't be replicate, so I made a struct with keys and values (and using find -> get copy to get an index number to find the pair), also made macros (add, remove, etc), then I swapped all the maps and array macros, but somehow it doesn't work the same. Would anyone have experience or an alternative solution to this?

lime iris
clear copper
chrome bay
#

If you're using the existing framework, the GameMode/GameState already has a replicated "phase" system

#

It's quite old fashioned tho

#

Still does the job

kindred widget
# lime iris BP

Can I ask what the map is for? Generally you can pretty easily replace a TMap by making some basic Add/Remove/Find functions. In C++ it's easy enough to just write predicates for finding/removing stuff. I don't think I've used TMaps for almost anything except static data lookup.

#

I know some people just replicate a TArray and construct a map out of it for faster runtime lookups.

clear copper
kindred widget
#

Might be referring to the MatchState. Not sure.

pastel escarp
#

I have two TArrays each containing 65536 Elements (256 x 256), Each Connected client has its own two TArrays, How can I send these 2 arrays to the server or a different client ?

vague spruce
#

sup everyone. i'm getting this error when trying to replicate a TArray<UAbilityGrant*>:

LogNetPackageMap: Warning: FNetGUIDCache::SupportsObject: AbilityGrant /Engine/Transient.AbilityGrant_0 NOT Supported.

UAbilityGrant subclasses UObject and i'm creating it using NewObject. anyone have any idea why this is happening? i'm seeing online that i have to potentially modify IsSupportedForNetworking() to return true but i'm unsure if just modifying that fixes the underlying problem

#

~~ah, i see exactly what's happening. disregard. ~~

i guess we'll play a bit of trivia. can someone see what's going on with this NewObject call?

if (const auto Grant = NewObject<UAbilityGrant>())

so it looks like not having an owner was only half the problem. the object is still not supported for network

kindred widget
#

The Actor or ActorComponent will need to override this.

virtual bool ReplicateSubobjects(UActorChannel* Channel, FOutBunch* Bunch, FReplicationFlags* RepFlags) override;
vague spruce
#

super helpful, thanks. so i'm adding these to an array:

                if (const auto Grant = NewObject<UAbilityGrant>(Owner, UAbilityGrant::StaticClass()))
                {
                    Grant->SetAbilityAsset(Asset);

                    // EVENTUALLY: If necessary, calculate levels here.
                    const auto AbilitySpec = FGameplayAbilitySpec(Asset->Ability);
                    Grant->SetHandle(ASC->GiveAbility(AbilitySpec));

                    Grants.Add(Grant);
                }

and then the array is replicated

    UPROPERTY(Replicated, VisibleAnywhere)
    TArray<UAbilityGrant*> Grants;

how would i add the UAbilityGrant as a subobject?

kindred widget
#

So in the same class that the array of pointers is in. You'll want to override that above.

bool MyArrayOwningClass::ReplicateSubobjects(UActorChannel* Channel, FOutBunch* Bunch, FReplicationFlags* RepFlags)
{
    bool WroteSomething = Super::ReplicateSubobjects(Channel, Bunch, RepFlags);
    for (UMyUObjectType* ObjectPtr: ArrayOfPointers)
    {
        if (IsValid(ObjectPtr))
        {
            WroteSomething |= Channel->ReplicateSubobject(ObjectPtr, *Bunch, *RepFlags);
        }
    }
    return WroteSomething;
}```
vague spruce
#

cool! thank you for your help. super helpful. i might just end up using structs instead again (UAbilityGrant was a struct, but i had some issues with null functionality)

#

gonna try to write ReplicateSubobjects now

kindred widget
vague spruce
#

@kindred widget so my struggle was with being able to set this "Ability grant" as null. i'm storing it as a pointer in a UUserWidget but its owner is somewhere else.

i originally had it as TOptional<FAbilityGrant> but TOptional can't be replicated. then i had it as a FAbilityGrant with an IsValid() function but then in blueprints i can't call IsValid() on a struct (structs don't support UFUNCTION). so now i've ended up with a UObject

kindred widget
#

The widget can hold a pointer to it without a problem. Doesn't matter what replicated or owns it. The Widget's pointer can be null or set. Might need a better scope to understand the problem.

vague spruce
#

it's all working correctly now 👍 thank you @kindred widget for the info on subobjects

#

well kinda 🙂 but at least now the UObject is replicating. now i'm just trying to figure out why its inner fields are not replicating

vague spruce
wild ivy
#

could some one help me i have multiplayer set up and it works in the editor. and you can join the session but as soon as i try to package my project with multiplayer in it. it doesent seem to work when you click on making a host the screen flashes and then when i press it again i get my error message that i set up. and i cant seem to find out why its not working. am not using the advanced session plugin. does it maby have somthink to do with that i need to use a service like steam/epic ?

#

btw am using ue5 also using blueprints

wild ivy
#

also done some other testing with a other multiplayer project that i made in 5.0 EA and i know that. that was working but even that cant create a session any more is there a setting am missing or is the multiplayer part just bugged ?

dark edge
#

and btw without an online subsystem you only have LAN sessions

#

Or rather, they're only discoverable on LAN.

rotund onyx
#

I have found the sad way that TMaps can't replicate at all, but I have used them in a significant amount of logic... How do I do the equivalent of replicating them without rewriting literally my entire project?

fathom aspen
rotund onyx
#

just when I thought I was using a better mousetrap

#

I was really enjoying the find function too, rather than looping through everything

fathom aspen
#

Yes and it has a better time complexity. But I wouldn't say it would make that much of a difference

#

Considering your array isn't too big

wild ivy
#

@dark edge ok so if i get it right you can only use the lan then and not just internet. my other project that i made on 5.0EA worked on internet and lan. but in 5.0 it doesent work

rotund onyx
#

Its probably worth me just going and making a couple pure functions for my struct array that match the functionality I need

#

I was hoping there was a better way, lol
Thanks for the help guys

wild ivy
#

also just tested lan on the other multiplayer project i have and same problem it kicks me back to the main menu. and i know that .that projected worked befor so its weird

vague spruce
#

hey everyone, i was told to post this question here because i might get some better answers here: #cpp message

#

say i've got a character that needs some values prepopulated by the user. i need the user to basically pick some stats for the character before the character is spawned. would i do this in the game mode?

my idea is that basically, the player's controller would already exist in the world but the pawn wouldn't be created yet. i'd present the local game instance with a UI, the player would do their selections, send it to the server, and once the server confirms that everything is good the pawn would be created and the player would be able to move the character around.

is it possible to do this in the gamemode? that would be my first idea.

the second idea is that i just create a new gamemode and map for this.

fossil spoke
#

You maybe better handling this via the PlayerController, as in order to send anything to the Server you need a Net Owning Connection.

vague spruce
#

eh i'm probably gonna end up doing the second idea. load into a blank map, present the user with a UI, save the details somewhere outside of unreal (or use a save game) then load the player in the new map with the game mode

fossil spoke
#

The PlayerController is your Net Owning Connection.

latent heart
#

What you could do is spawn and control a dummy pawn that does nothing while they are selecting and then spawn and control the new pawn with the correct stats etc

#

(If you require it to be done on the same map)

lost inlet
fierce fiber
#

My bad!

lime iris
#

Question: maps can't replicate, so as a workaround, I made a struct with two arrays inside (Key = Vector 2D, Value = Color) and I also made macros (Add, Contain, Find, Remove, etc.) to make it work just the same as maps, but it doesn't. Anyone try doing this before?

chrome bay
#

You'd be better off making a array of structs and just making some accessors

#

e.g, something like this:

struct FKeyValuePair
{
    UPROP() FVector Key;
    UPROP() FColor Color;

    bool operator==(const FVector& Rhs) const { return Key == Rhs; }
}

UPROP(Replicated)
TArray<FKeyValuePair> Pairs;```
#

You can also wrap that in another struct or FFastArraySerializer if you wanted, and add your accessors there.

winged badger
#

just slightly dangerous comparing 3 float components of a FVector with ==

chrome bay
#

Yeah, I don't recommend using any floating point type as a key for anything really

zealous wind
#

Hello all. I've run into the classic problem of trying to replicate a TArray of structs. Please could I get opinions here on best practices.

Here is some example code:

USTRUCT()
struct FExampleStruct
{
  UPROPERTY()
  bool value = false;
};

UCLASS()
class AExampleActor : AActor
{
  GENERATED_BODY()
  public:
  UPROPERTY(Replicated)
  TArray<FExampleStruct> Structs = {}

  virtual void BeginPlay() override;
  void DoSomeThing();
};

void AExampleActor::BeginPlay()
{
  for (int i = 0; i < 10; ++i)
    Structs.Add(FExampleStruct());
}

void AExampleActor::DoSomeThing()
{
  Structs[2].value = true;
}

In the example above, how do I ensure that the change to Structs[2].value is replicated reliably?

#

I have tried removing, and completely replacing the struct in the array with a new value, however, that doesn't seem to be replicated either. This could still be user error, but I didn't want to spend too much time debugging in-case before asking here first

chrome bay
#

You don't need to do anything, it'll replicate fine. Just make sure you've marked it as a replicated property in GetLifetimeReplicatedProps

zealous wind
#

Interesting. I have indeed done that.

chrome bay
#

The actor itself ofc needs to be replicated and relevant

zealous wind
#

hhmm... As far as I can tell, all of those assumptions are true, yet it is not replicating. I'll see if I've missed anything.

chrome bay
#

Must be something, arrays of USTRUCT replicate just fine

zealous wind
#

the 'real' struct is a bit larger, so may end up breaking the 400byte limit (that I read about online the other day and can't remember where).

chrome bay
#

The limit is way higher than that

vague fractal
#

Would it be fine to use a server RPC to replicate the Turn value (for turn in place) when marking it as unreliable ?

#

I feel like it's generally bad to even use an RPC here, so i'm open for better options :D

winged badger
#

and limit is 40kB for an array, and can be configured

twilit radish
winged badger
vague fractal
vague fractal
winged badger
#

and guess what CMC does each tick?

twilit radish
#

Does it really do it each tick though?

winged badger
#

it does

twilit radish
#

I thought it grouped them together?

#

I've been lied to once again

winged badger
#

there are few cases where RPCing anything on Tick is fine

#

game critical bits of player input are one of those

#

don't RPC on Tick as a general rule is just a simplified way to guide a weekend warrior away from really bad practices

#

i saw a guy here replicating a FVector with a Reliable Multicast on Tick, just to relay targeting coordinates of a turret to clients

#

and turret was targeting a replicated Actor, so just replicating AActor* Target would bad been sufficient

twilit radish
#

But even then with enough latency it would likely still fall apart.

winged badger
#

if you take a minute to think about it what would be the point of Reliable RPC on Tick

#

reliable means it gets Acked and resent if no Ack happened

#

so if a RPC send on Tick fails it would send one with newer information before it had any idea it needs to resend Reliable one

#

which makes it completely and utterly pointless to make it Reliable

bitter oriole
#

Reliable = your 60fps client got no Internet for two seconds? Let's resend 120 packets worth of outdated input data

twilit radish
#

Reliable definitely has its place. But not for this yeah.

bitter oriole
#

reliable = single events, no input

twilit radish
#

I mean it can be bound to input, just make sure it doesn't allow the input to be spammed.

bitter oriole
#

Probably don't want it for any input

twilit radish
#

A "Start Game" button is something you could definitely use it for. Just make the button non-interactable while it's doing its thing though.

grave lynx
#

Hello, I have a question about game state class. Unreal recommend to use it if we have a timer, because the server and all clients need to know this value. Why can't we use the gamemode, and it we send this value to all player controllers? and the PC will update the widget

twilit radish
#

I'm not entirely sure what you mean with "all clients need to know" about a timer. Completely depends on the context. Also the GameMode is only available on the server so there's no point in doing anything network related in there.

grave lynx
#

well I have a timer in my game, displayed on each player. So according to unreal doc, I should use game state class, because this class is present on the server and all clients

#

So same question, Why can't we use the gamemode, and it we send this value to all player controllers? and the PC will update the widget

fathom aspen
#

GameMode exists only on server so you can't have replicated properties in there

grave lynx
twilit radish
fathom aspen
grave lynx
#

like the unreal tutoriel for online multi

#

but Ok I got the point. To be sure, if I set a custom even on owning client, it will be only executed on the local PC. If I set it to server, only on the PC of the server, am I right?

#

and muticast, own PC and all PC on the server

twilit radish
fathom aspen
grave lynx
#

ok great, tks!

#

so check has authority is useless on the gamemode I guess

#

but it can be necessary on the game state right?

fathom aspen
#

Correct

split siren
#

I am slightly lost in terms of best practices when it comes to Replication order.
Let's say I have 4 AMyPlayerState which get replicated to a client upon joining the server.
When replicated, each player state downloads a profile image from web and broadcasts Ready.
Once all states are ready (all images downloaded), an UMG should pop up.

I tried few ways to do this, but I am worried about edge cases.
For example, if 3 states get replicated and 1 state gets delayed (packet dropped or limitted), clients waits until the 3 states are ready and then shows umg. After that a 4th one gets replicated and my system is broken.

Thus I also need to send how many states to expect, but that info can also arrive after the they ready up, making the checking process a spaghetti code.

Sorry for the long question, I am very confused at this point what is the "best" practice when execution order matters.

twilit radish
#

What is the goal you're trying to achieve with this?

grave lynx
#

again another question, but this one is to be sure to do the things right. To get a value (game time remaining) from a game state, inside a user widget. We can cast to the game state, but it this the right way? Or should pass throw the PC before?

twilit radish
#

If you mean cast a widget to the game state then no. If you mean cast the regular game state to your own yes (assuming that you have made a custom one of course).

grave lynx
#

I mean, inside the user widget, cast the my game state to get a variable

twilit radish
#

That's pretty normal yes. Obviously you do want to make sure that the timer is already initialised on the client.

#

Unless that doesn't matter to your game.

split siren
twilit radish
#

Also you need to make sure that the game state it self is already valid if it's directly when loading into a level.

chrome bay
#

You can't do that

#

There is no defined order when it comes to replication between actors, so you have to build systems that are resilient to it

grave lynx
twilit radish
# grave lynx you mean check if the cast succeed inside the user widget?

It depends on your game but imagine this: You load into the level and just once want to know the current timer value. Then it may not be ready yet. If it's something that goes on constantly however then it really doesn't matter. Just have to make sure that you don't grab any invalid references during the beginning 🙂

chrome bay
#

My advice is don't bother caching references when the object has a simple accessors

#

There's rarely if ever a need to cache the gamestate if you can grab it from the world, and it prevents bugs where data is stale

grave lynx
grave lynx
twilit radish
#

What Jambax said essentially. I kind of worded it a bit poorly 😅

chrome bay
#

Having a similar chat in CPP right now, but if you cache something, you introduce a potential data redundancy issue.

grave lynx
#

so cast again if I need it again

chrome bay
#

The GameState can be very easily accessed, so you might as well just grab it when needed and if you need to cast it, do so

grave lynx
#

btw do use a cast or a interface? is there performance issue?

chrome bay
#

In Blueprint it doesn't matter

grave lynx
#

for gamestate only?

chrome bay
#

For anything

#

Cast (Inheritance) vs Interface is not a performance choice, it's a design choice only

winged badger
grave lynx
#

I see, I think very basic operations like getting a ref from an instance don't affects performance

split siren
twilit radish
#

Blueprints them selves are generally not really performant anyway. If you need performance trying to fix BPs is likely not the solution. Although there's always some things you can do.

winged badger
#

with what you described you don't even need playerstates already replicated to make this work

#

just a bit of data from them

#

so yes

grave lynx
twilit radish
#

I don't know what they do with Fortnite. They probably just have a mix of both C++ and BPs. I think they said they also use BP nativization.

split siren
# winged badger just a bit of data from them

Thanks! I agree that for replication of the initial state ustruct makes perfect sense. I wanted to make it an actor to track changes (if user changes profile pic url), I would catch it with OnRep, but I guess I need to make it work with structs.

twilit radish
#

But I can't imagine they use pure BP for their performance critical code.

grave lynx
#

yea of course

winged badger
#

you don't know which Pawns belong to them before both PS and Pawn replicate and you have no Controllers

#

you can however override Add/RemovePlayer in GameState and hook up a delegate there

chrome bay
grave lynx
#

yea I can guess so, this is only commercial discussion

split siren
winged badger
#

same difference one is a UPROPERTY specifier, other is a function that gets called if you use it

graceful falcon
#

Hello, it seems like OnPostLogin and OnLogout use different Parameters is there anyway to get the same parameters?

languid onyx
graceful falcon
#

OnPostLogin is a player controller object ref and OnLogout is a controller object ref.

languid onyx
#

Internally, before calling OnLogout, it checks it's a PlayerController

twilit radish
#

It's a bit weird though because the internal code immediately casts it into a PlayerController and otherwise does nothing with it.

#

Logout that is.

crystal crag
#

The game session name can be any name (as long as it is using valid values per the platform's requirements) - how to people set session names per server? Do they just set it in the dedicated server config and just read from it? It has to be unique per server instance right?

#

So I can't hard code a session name inside of the server and have multiple servers use the same session name I do not believe. I believe session names have to be unique

#

The session name is kind of like a primary key in a db table. The platform uses the session name and app ID / etc to resolve the server address to have clients connect

#

Seems like a pain to remember to update the server config for each deployment to have a unique session name in each dedicated server config

vague spruce
#

sup y'all. you have any idea why a Client function called from the server is still executed on the server?

void UExperienceComponent::HandleExperienceChanged(FExperienceChange ExperienceChange)
{
    ClientExperienceGained(ExperienceChange);
}

void UExperienceComponent::ClientExperienceGained_Implementation(FExperienceChange Grant)
{
    OnExperienceChanged.Broadcast(Grant);
}

    UFUNCTION(Client, Reliable)
    void ClientExperienceGained(FExperienceChange Grant);
surreal hound
#

Hello I am trying to spawn an ai pawn and move it only on the client side

#

Is it possible?

#

I want it only for some aesthetics.

#

When I spawn it on server the ai works (as soon as I spawn it; it drops to the ground and moves)

#

However when I spawn it on client; it just floats in air and does not take user input.

latent heart
surreal hound
#

Yes..

#

Client is connected to a listen server

#

And I am using the character bp on the client to spawn the ai

#

How do I do that?

vague spruce
#

naw it's a dedicated server

vague spruce
#

so this is happening a component, and this is the owner:

#

NetConnection is nullptr, not sure if that matters

latent heart
#

Probably means it's owned by the server (listen server?)

#

Check its netmode.

vague spruce
#

this is really odd

#

i thought GetNetMode was in AActor but i can't find it

#

its role is ROLE_Authority

#

yeah i'm super confused. the controller on the server has no player state ??? and hasn't begun play

#

when i call a client function it's executed on the server

surreal hound
#

Will setting the aicontrollerclass first and spawnin the default controller on the ai same ?

vague spruce
#

yeah i gotta admit i'm not entirely sure what's going on here. the controller has no pawn, no player state on the server. is this normal?

#

this was also working just fine in my previous build... all i did was change where the delegate is getting triggered... i'm thinking it has something to do with that

vague spruce
amber agate
#

Out of pure curiosity, how much replication is achievable without going too deep into c++?

dark edge
#

Chess, sure.
Civ, probably.
Quake, nah.
Minecraft, prolly not.

amber agate
#

Ok, thanks! Looks like I'm going to have to hunker down and go deeper into cpp because something as complex as a multiplayer shooter definitely requires prediction

dark edge
#

But it all depends on your design, are things hitscan or projectile, what sort of abilities there are, etc etc

#

Also depends on how much you're ok with trusting the client and things being janky. Could probably do a DayZ in BP since the codebase is so jank anyway.

amber agate
#

Likely going to test early on with hitscan weaponry as it's simple traces rather than keeping track of a projectile. I'm working on a shooter where your character follows the surface.

dark edge
#

You won't pull off an Overwatch tho.

dark edge
#

like Aliens vs Predator?

amber agate
#

Like super Mario Galaxy as an fps

dark edge
#

Yeah good luck, you won't be able to use the CMC without heavy modification

#

it implies a vertically oriented capsule and constant gravity etc.

amber agate
#

The player movement components is a bit of a headache but I was able to get it working with a floating pawn.

dark edge
#

You'll probably have to roll your own movement system and/or look at plugins.

#

Does Floating Pawn do prediction?

amber agate
#

No, that's why I'm trying to swap to character movement with slight modifications

dark edge
#

Yeah good luck. You'll need it.

#

make sure you do your testing from the very beginning with lag and jitter and packet loss simulation on

dark edge
amber agate
#

I appreciate the advice, I remember someone telling me to test with like 500 ping to account for any very laggy conditions

dark edge
#

500 is a bit nuts but I'd do 200

vague spruce
amber agate
#

Oh and a physics based movement might be a really good idea I just worry that it might not be reliable

#

Id have to write my own movement component then

dark edge
#

I'm doing more of a Kerbal Twisted Metal type thing

amber agate
#

That sounds like way too much fun

#

Keep me updated

#

The other option is to try to do it procedurally through control rig

#

Which scares me

dark edge
dark edge
amber agate
#

Procedurally moving the character using a blueprint to calculate foot locations

#

This would be the effect. I'd take inputs and translate them into foot placements to animate the and move the character

dark edge
amber agate
#

I'd have to replicate that movement somehow over to the autonomous proxies of each player

dark edge
#

It's also a bit hacky as the drivetrain is a seperate sim from the physics, making the tire model a PITA to get working well.

vague spruce
#

if i replicate this:


USTRUCT(BlueprintType)
struct FBestiaryEntry
{
    GENERATED_BODY()

    UPROPERTY(VisibleAnywhere)
    FGameplayTag EntryTag;
    UPROPERTY(VisibleAnywhere)
    UExperienceContainer* Experience;
    UPROPERTY(VisibleAnywhere)
    uint32 SpentPoints;
};

by using NewObject<> on the server, what happens to UExperienceContainer*?

#

would i need to use ReplicateSubobjects on the parent container that calls NewObject?

chrome bay
#

yes

vague spruce
#

ahhhhhh

#

i freaking

#

GET IT

chrome bay
twin juniper
#

Yo

#

Anyone here know how to add Steam multiplayer to UE5?

#

Im currently trying to add it to lyra starter game

#

Since im having waaaaay too many problems with EOS

lost inlet
#

also Lyra uses OSS so just setup the Steam one

twin juniper
#

Cuz i need a multiplayer system to use with lyra that doesn't require me using the source version of ue5

latent heart
#

If you want dedicated servers, you need a source build

#

If that's not an issue, go ahead?

twin juniper
#

nah i need p2p

#

If it works with the licensed version can u tell me the steps cuz idk nothing atm im very new, im just trying to get into game dev

lost inlet
#

what does "licensed version" mean

#

also this is not a beginner topic

latent heart
#

I'm pretty sure all public versions of UE come with the same licence.

lost inlet
#

well yeah unless you're under custom terms with epic, but likely not what is being referred to

dark edge
#

"Hey guys, I just got my learner's permit. Anyways, how do I drive an F1 car?"

latent heart
#

Technically you need an f1 licence to drive an f1 car.

dark edge
latent heart
#

I mean, you can't own one. And people who do buy them don't actually get to use them whenever. They are brought to the track when you want to use them.

twin juniper
#

not the src

twin juniper
#

i learn the most with shit like this

#

but @lost inlet How would i do what u told me to do?

twin juniper
#

u can easily pay a good garage to build u one

#

thats what my uncle did and he sometimes drives it on the road

latent heart
#

An F1 car? Sure.

twin juniper
#

but u need to make it streel legal first

twin juniper
#

@latent heart

#

Im pretty sure thats where my uncle went

#

he got as funny car and an f1 car

#

but only the f1 car is legal

#

bulletperf can do whatever u want if u got the money

#

shit like this

latent heart
#

I can't help but notice that isn't an f1 car.

twin juniper
#

this is an example

latent heart
#

An example of a, granted, expensive car being run on a track (not the road.)

twin juniper
latent heart
#

Feel free to post a picture of your uncle driving an f1 car around the streets.

twin juniper
#

xD

latent heart
#

One made in the last like 10 years.

twin juniper
#

bro last time i saw him was when i was like 6

#

😂

latent heart
#

So you've successfully not backed up your argument at all.

twin juniper
latent heart
#

Sure, you can make an f1 car if you have the technical skills to do it.

#

What I doubt is that an f1 team will sell you their f1 car to tinker with at home.

#

Especially if it has any technology they still use in live races.

twin juniper
#

oh idk about an f1 team selling it but u can go to a lot of places where they can build u one

latent heart
#

I will grant you, it is possible. I just don't think anyone does it.

twin juniper
#

idk about countries other than dubai, kuwait and saudi but i've been to work shops there who would build one for u

latent heart
#

Not to the level that an actual f1 car operates at.

twin juniper
#

but idk if they were street legal

#

they were all at a street race

latent heart
#

The street legal part doesn't really matter I guess.

#

But still, just because it looks like an f1 car, does not mean it is an f1 car.

#

It's easy to copy styling.

twin juniper
#

😂

latent heart
#

I highly doubt they even have an f1 engine.

twin juniper
#

idk but it'

#

they are fast asf

#

u can find some here

latent heart
#

Maybe a f3000 engine or something.

twin juniper
#

i went to a few of their races

latent heart
#

I'm not saying they aren't fucking cool and impressive.

#

Just that they aren't up to spec F1 cars 😛

twin juniper
#

ye probably for the street legal ones

#

oh also

dark edge
#

You can get your hands on an older F1 car if you got the money

#

but you don't have the money

twin juniper
dark edge
#

lol

twin juniper
#

For a custom built one it's like 400k in my currency

dark edge
#

A real F1 car is like $20m

#

you can probably get an older retired one for a few million

latent heart
#

And that just the parts.

dark edge
#

and a replica that's not as high strung you can probably get for a couple hundred K

twin juniper
latent heart
#

Not talking about the hundreds of thousands of manhours that's gone into the design and production.

latent heart
twin juniper
#

it's a rental

#

😂

#

they probably have streel version tho

dark edge
#

Yeah lemme go get groceries in my 20 million dollar F1 car lmao

twin juniper
#

but the street ones look kinda ugly

latent heart
#

That's hourly income for Jeff.

twin juniper
#

xD

#

It was either that or a drive thru

#

but coming back to the topic @dark edge would u know how to use steam multiplayer with lyra (UE5)

dark edge
#

You should be able to just follow a UE4 guide tho

#

Nobody's gonna talk you through it.

twin juniper
dark edge
#

Chances are it just works tho

twin juniper
#

ok thanks

exotic shoal
#

Hello there!

I have such hierarchy:

  • AActor Character // Replicated by bIsReplicated = true
    • AActorComponent Component // Replicated by SetIsReplicatedByDefault(true)
      • UObject Item // Replicated by ReplicateSubobjects in outer component and IsSupportedForNetworking => true
        • UObject Subitem // ???

How to properly replicate the last part? UObject property of my another UObject

bitter oriole
#

Easiest solution is going to break that chain

#

Make that last subitem a struct, or move it up

exotic shoal
#

Oh, that would be awkward
The chains stands for ACharacter -> UEquipmentComponent -> UEquipmentSlot -> UItem

So to make it work like this I must write some kind of proxy from Slot to Item?
Or probably change the chain to ACharacter -> UEquipmentComponent -> TMap<USlot, UItem>

#

Ok the main question - there is no easy solution that I'm missing somehow and ReplicateSubobjects is the deepest native replication mechanics?

chrome bay
#

Correct

#

But you also can't replicate TMaps

bitter oriole
exotic shoal
chrome bay
#

I'd just think very carefully about whether you really need replicated UObjects at all. They're a very special case, and the problem can often be solved a better way

#

Keep in mind that every object you replicate this way is hijacking the character actors' network channel - so if you add too much, you'll throttle it

#

I use replicated slots for my inventory but only because they need to hold state and have some properties of their own. Items themselves are not replicated though, they're either static data assets, or other actors usually.

exotic shoal
chrome bay
#

Equipment should often just be it's own actor IMO, otherwise you're also wasting cycles comparing it's properties at the same rate as the character

exotic shoal
chrome bay
#

There's very good reasons to split replicated objects into their own actors usually

#

Equipment/weapons especially

exotic shoal
#

Ok, thanks for advice, gotta think all this up

dark edge
#

Have you first checked if HiddenInGame is a replicated property? It well might be

#

If it is, just set it on server

#

If it's not, you'll want to repnotify on some bool. Using a multicast for state is bad

fallen dawn
#

Does someone have any idea why the montage isn't playing?
The add impulse function gets called and executed but the montage is only playing on the listen server and not multicasted

steady cape
#

I also have an issue where multicast events just 100% won't replicate even when no other messages sent

winged badger
fallen dawn
fallen dawn
steady cape
#

Does your actor replicate?

#

Wait, that's a pawn, right?

#

Make sure you hadn't uncheck the "Replicates" box in the class defaults

faint eagle
#

how do I use unreal insights for network profiiling correctly? I'm launching my project in standalone mode tracing parameters from the editor. I've tried launching the insights before and after launching the game clients but still even if I see LIVE session its size is always 0 KB and no network information when I'm opening that session.

#

ok nvm. had to start the editor after I started the insights

spare cobalt
#

hi guys! i've run into a bit of an issue. i have a replicatable actor, which is constructed on left click. One client (on play as listen server) can see the others placed actors, but not vice versa. Any help would be appreciated. Thanks!

#

heres my code

#

heres actor properties

lost inlet
fathom aspen
#

^, in your case the client is the one doing it as input is fired on client

#

So you have to server RPC after the input is fired

#

On listen server it's okay, as the local controller is on server

fathom aspen
spare cobalt
vague spruce
#

if i modify a struct within a replicated struct, should i expect the updates to that struct to be sent to the client?

chrome bay
#

yeus

fierce fiber
#

The pickaxe mesh appears for the owning player but not other clients, and I'm not too sure why, does anyone have any ideas?

dark edge
#

That should be a repnotify tho

#

no RPC required

#

just repnotify on ItemID

fierce fiber
#

Should I change owning client to multicast, then have the custom server event run the multicast from the event tick?

dark edge
#

ItemID drives the whole thing right?

#

Client picks ItemID
Client sends to server
Server sets the variable
Everyone updates on the RepNotify

fierce fiber
#

So my item ID variable is ran from the Q Key. When the Q Key is pressed, it plus 1 to the variable, and when it reaches over 4, it resets back to 0, in the image, I was hoping that the result of when the item ID is 1, it would set the static mesh, it does this successfully on the client, however, on the server, other players cant see it

dark edge
#

It'll Just Work(tm)

#

RepNotify is a function that fires whenever the variable is replicated (actually whenever its' changed but it's weird in BP)

fierce fiber
#

Ill give the above a go, and keep you updated on the result, thanks for your patience btw, Im still very new to multiplayer programming haha

dark edge
#

When in doubt, do it with a RepNotify because they're great.

fierce fiber
#

Holy shit it works, thanks so much man

#

For anyone in the same situation as me, here is what I did thanks to the user above!

dark edge
#

Also try out a Select node on ItemID

#

You can Select mesh given int

fierce fiber
#

Oh yeah, that would make things 10 times easier so I dont have to keep using branches

#

The flip flop was also just an accident, 4am working haha

dense forum
#

Hello Everyone!
I was wondering if it's possible to do the following.

I am working on a multiplayer application for the Hololens2, Oculus Quest II, Linux/x64 Desktop.

I would like to be able to include Plugins that work for some platforms but not others. These plugins would only be used on their supported platforms. But at the end of the day these platforms are still able to connect together in atleast 1 agnostic multiplayer environment.
Is this possible through #if #endif blocks?

worthy eagle
#

Reccomend place to init player HUD? Currently have it as an RPC Event in bp's but can't help the feeling that this doesn't need to be an RPC but rather a inside a function that only gets executed on the client side.

dark edge
#

You have a HUD class

#

it can hold all your widgets

worthy eagle
#

huh guess I missed that. Thanks man!

potent coral
#

whats the fastest way to set up online multiplayer so i can test stuff with my friends?

#

do i need to set up some subsystem or can i just cheese localhost with hamachi or something?

dark edge
potent coral
#

depends if my router will actually let me forward lol

#

else i will have to use hamachi i guess 😅

dark edge
potent coral
#

im just not sure how to best get it working online because the portforwarding doesnt seem to work on this router

dark edge
#

So you want to use LAN sessions. Online.

#

Something like Hamachi is your only option it looks like, unless you just get Steam going

#

You might be able to do some stuff with your own onlinesubsystem but that's more work.

fallow shadow
#

is it a good idea to ditch whatever the steam subsystem has going for matchmaking and making my own?

twilit radish
#

If you have a team of people maybe. If it comes down to just you having to do it I would not. It’s quite a bit of effort, you need to host your own servers for it, write an implementation for the system and maintain it all.

dark edge
twilit radish
#

Even then, assuming it’s not a team then it’s not worth the development time in my opinion you lose on it and having to maintain it.

#

There’s only so much time one person has 🙂

dark edge
#

Yeah. If you're making Valorant, sure, go for it.
If you're making My First Indie Game, hell naw

fallen dawn
twin juniper
#

Is it possible to use EOS with LyraStarterGame with an installed version of UE5?

bitter oriole
#

<@&213101288538374145>

halcyon totem
#

I will have to work from my car for the next 5 months and needed a good either USB powered laptop or 2in 1 tablet that I could run unreal on, can someone recommend something it needs to charge from USB in my cigarette lighter in my car

dark edge
#

It depends on your budget but anything with a decent Ryzen processor and 16gigs of ram should do the trick. Don't expect to run a heavy scene in editor at 60fps but it'll be just fine for doing dev work.

halcyon totem
#

@dark edge yeah I'm seeing if anyone else used something else, I'm not a big fan of AMD stuff, although I do see a good used one that I might buy, I also wonder if anyone else used remote programs like TeamViewer vs buying a tablet

#

I have been using TeamViewer on my laptop using my powerful PC at home and it's working pretty good

dark edge
#

I recommend AMD if you're NOT getting something with a big GPU

#

If you are it doesn't matter

#

but for integrated, AMD blows Intel out of the water

halcyon totem
#

I already have like a desktop power laptop but I heard some of the new laptops charge via USBC although I can't see how that would be possible to power a big GPU and CPU

rotund sail
#

Hey guys, I keep running into an odd problem where I have a TArray containing pointers to objects, and when it replicates, the array has the correct amount of elements, but all of them are null. The objects are just subclasses of UObject with
virtual bool IsSupportedForNetworking() const override { return true; }
so not actual Actors, but AbilitySystemComponent contains a replicated TArray of UAttributeSet* which are also UObjects, so that shouldn't be the problem? If anyone could help, I would greatly appreciate it!

rotund sail
#

The owner does have the array in GetLifetimeReplicatedProps as DOREPLIFETIME, or do you mean something else?

fathom aspen
#

Did you read what I sent you?

#

He should have this implemented too : ReplicateSubobjects

#

UObjects aren't supported for networking with ease

rotund sail
#

Oh, I see! I had that elsewhere, but not on this parent class it seems! Will give it a whirl, thank you! 🙂

#

Yup, that did the trick! Thank you!

still path
#

I use a spline mesh to create sidewalks / other spline assets. When characters are standing on this spline, clients see the character walking in place while the server sees clients standing still like normal. Does anyone know why spline meshes cause characters to walk in place when standing on them? Further, why it would only show up like that on clients?

chrome bay
#

Clients are probably not able to resolve the component the characters are walking on. Is any of this generated procedurally?

still path
#

The system will select the mesh whos size fits the spline section best (uses multiple meshes if necessary) and stretch / warp it to fit into place along the spline. Im not sure if this counts as procedural. @chrome bay

chrome bay
#

Are you spawning the mesh components at runtime?

still path
#

It is done on construction of the actor

#

Everything is placed before starting the game

chrome bay
#

Yeah in which case it the components will not be net addressable

#

You can try one of two things, make sure every mesh component you place has "Can Character Step On" set to false

#

or, go into C++ and generate the mesh components with deterministic names, and force them to be net-addressable

#

(or spawn them on the server and replicate them all ofc, but that would be insane)

still path
#

The step on worked! Just before submitting this question I did the opposite and set it to true for everything. So close lol - Thank you!!!!

chrome bay
#

Just keep in mind any meshes/components generated that way cannot be sent over the network (either as references or replicated properties)

still path
#

Can do thank you! I found success in deleting specific meshes by doing a multicase telling everyone what index to remove. This seems to work so far - let me know if this isnt something i should be doing. Thank you again!

chrome bay
#

Depends really, if you are making stateful/persistent changes to the world you should avoid RPCs and use replicated properties

#

Since if a client joins late for instance, or the RPC doesn't arrive, they will be permanently out of sync

still path
#

Ohhhh you know I am using this to learn replication and was wondering how to sync everyone up on join. That answers that. Would logging the destroyed indexes on the server and having the clients delete them on begin play be a viable option?

chrome bay
#

IMO not really. The sensible option is to replicate an array of deleted ID's. Whenever a client joins, they will receive those deleted ID's automatically and can apply it to their world at the appropriate time

still path
#

How do I determine the appropriate time?

chrome bay
#

Depending on how you're treating the indexes, they may also go out of sync because clients might delete things in different orders as they receive updates. You should assign fixed, deterministic ID's to each item

#

That's up to you really

quasi tide
#

What does the character can step on property even do?

chrome bay
#

It allows the component to be a "base" for movement

#

E.g, you can stand on it and move with it

#

it also means your movement becomes relative to that base

#

But in order for it to work, the CMC needs to send the component reference over the network

rotund sail
#

Oh, didn't know Unreal had support for movement relative to a platform the character is standing on, neat!

vague spruce
#

wtf? why is my game state a PlayerController?!

chrome bay
#

summit broke'd

#

Or that BP is misleadingly named

vague spruce
#

nope that is definitely a controller

#

WTF

fathom aspen
vague spruce
#

dude i am so confused. i'm adding breakpoints to SetGameState and it's a valid GameState

#

why in the world is GetGameState returning a controller????

fathom aspen
#

Prolly GameState is the misleading name?

vague spruce
#

World->GameState is a APlayerController here

#

by far the weirdest bug i've seen thus far

#

how in the world is this possible

#

this is a rider bug. the game state is actually nullptr.

pallid mesa
#

@vague spruce by any chance do you have GAllowActorScriptExecutionInEditor in a constructor?

#

nvm xD

#

didnt read below

vague spruce
#

yeah my game state is actually nullptr. now i just need to figure out why

pallid mesa
#

thats what I wrote is relevant btw

#

it breaks rpcs

#

and the whole unreal architecture

#

my dedicated server had a HUD

#

(just one off detail btw)

fathom aspen
#

🚑

vague spruce
pallid mesa
#

yes

vague spruce
#

i don't have any instance of that in my codebase

pallid mesa
#

beyond unimaginable limits

vague spruce
#

so i have to assume it's not that

pallid mesa
#

👍

#

take a look in your gm

#

maybe you forgot to asign the gs

#

😁

vague spruce
#

so i understand now that rider was showing me the wrong information, but i'm not understanding why my game state is null in my world when i can SEE it being created in SetGameState

#

i'm on remote desktop so, my bad for the screenshots

#

and the game state that is being assigned is correct too:

#

the only thing i can think of is that there's two worlds: one in the server and one in the client

#

and then the client one is empty

pallid mesa
#

im in a choo-choo 🚅 so... heh pictures wont arrive

fathom aspen
#

Maybe you are trying to get it on client and it's just too early(i.e, it hasn't replicated yet)

vague spruce
#

yeah so this is a client RPC as soon as the pawn is possessed

#

im gonna just try to pass the data from the server game state over to the client and see what happens

twilit radish
#

So the issue is that GameState is a nullptr? Are you debugging on a client or server?

vague spruce
#

it worked

#

GameState is a nullptr on the client when i go to check it but it's valid on the server

#

i just needed to get the state i needed from the server and pass it to the client, things are working now

#

shrug not sure why the game state is not yet replicated to the client, oh well

twilit radish
#

Correct me if I'm wrong someone, but I believe actors including the gamestate don't have a specific replication order?

vague spruce
#

yeah i have to assume that the application occurs at random

#

depending on the buffer

pallid mesa
#

you need the world event manager ™️

#

you need the world event manager ™️

#

safely initialize your network events ™️

#

lmao u can really tell im in a train

twilit radish
#

😄

#

Also what is the "world event manager"?

chrome bay
#

it's MINE

vague spruce
#

the world has delegates you can subscribe to

pallid mesa
#

wizard please

#

james

chrome bay
#

jk

pallid mesa
#

yes

#

james now u explain it

#

jahahahha

#

omg my internet noooo

fathom aspen
chrome bay
#

I'll do ya one better

twilit radish
chrome bay
#

The idea is you bind to CallAndRegister_OnNetworkGameReady(), which is broadcast when all the actors you need are received

pallid mesa
#

^ network event subsystem ™️ ✨

chrome bay
#

I had to rewrite it recently so chose a better name 😄

pallid mesa
#

okay im redoing the marketing x'D

#

@chrome bay btw if you have a post that goes along this one piece of code lets get it pinned because its a pretty recurrent topic

chrome bay
#

oh lawwwwd it coming

pallid mesa
#

🙏

#

yus

fathom aspen
#

Yeah really

chrome bay
#

Got into a "general network practice" post and it's got out of control so I need to break it into chunks

pallid mesa
#

LMFAO

chrome bay
#

(and make it coherent)

#

But that .zip should give the general idea... it's pretty useful

pallid mesa
#

might be also great to attach it in the post

#

I have to do that for my other posts 🙄

chrome bay
#

yeah, I'll probably put a sample together

pallid mesa
#

i keep forgetting

#

anyways thank you for the open source contribs james

#

tunnel time (nooooo 🚆 )

twilit radish
#

So if I understand it correctly it just checks if certain stuff has been replicated?

chrome bay
#

yeah, then pushes an event out when it does

#

But since the subsystem always exists, objects that are looking for those actors or are dependent on them to initialize can just bind to the event

#

e.g. you've spawned a UMG widget, and it needs to bind to some GameState events. If the GameState doesn't exist, your in trouble - so this way you can be notified when it exists, then setup your bindings etc.

#

tbh that's mostly what I use it for, UI stuff

dark edge
#

@chrome bayWould you put gameplay dispatchers there too?
OnCharacterDied
OnWhateverElse
Etc?

#

Like a generic open mouth open ear dispatcher so everything that cares can know if a thing happened

chrome bay
#

I guess you could, I just use this as a more generic event thing

#

Just to skirt around the race conditions between actors

dark edge
#

I was thinking GameState for it but if gamestate isn't always guaranteed to be there

chrome bay
#

Especially ones that are quite "core" and need to be accessed by many things

#

Yeah, well that's what this solves in a sense

dark edge
#

So what's guaranteed to exist on client, just the world?

chrome bay
#

Yeah the world and it's subsystems will be present before actors do anything

#

The subsystem IMO is a nicer approach to something like a static delegate (which is what I used to do, but then you have headaches in PIE etc. too)

#

And you can talk to it from BP also

dark edge
#

Yeah i love subsystems. I'm starting to wonder why they didn't just add networking to subsystems then you could replace GameState etc with them

#

the ethereal actors

chrome bay
#

tbh Lyra is going that way...

#

but you can ofc combine subsystems with replicated actors also, but you can't get around the actors not being available when ytou need em

dark edge
#

I take it the way to "replicate" a subsystem is to have it spawn a replicated actor and use it to do the replication?

#

If server -> spawn actor
Actor begin play -> hook stuff up -> ready to go

chrome bay
#

yeah for sure

#

done it a couple times it works well

glass orchid
#

if i have a ready check for each player, where do i actually check if all 4 players are ready? i want to open the level and let each player possess their respective pawns once they are.

twilit radish
#

If you're asking 'where' as in client/server then on the server. If you're asking 'where' as in on the server I would just do it in your check whenever a player says they are ready and then check if the rest is also ready.

#

Also @chrome bay question about your system. APlayerController seems to always have bNetLoadOnClient set to true. Which makes me wonder if the actor reference it self isn't technically IsValid before actually being network ready?

vague spruce
#

hi. this is an issue that bugs me every once in a while so i figured i'd mention it here. anyone know how to stop these kinds of jarring corrections when issuing navmesh movements on the server/client at the same time?

chrome bay
#

(and they are not serialized into the UWorld)

#

Server spawns them

twilit radish
#

AGameStateBase specifically sets it to false.

#

And so does APlayerState

chrome bay
#

Ah yeah makes sense, probably because of Seamless Travel.

#

Controllers have pretty unique behaviour with travel though, I don't think you could do much before they are valid

twilit radish
#

If they aren't serialised into the world I guess there's no problem yeah.

chrome bay
#

They do travel accross from the old world anyway IIRC

glass orchid
twilit radish
#

Is it like a "all players must be ready before the host can start the game" kind of thing?

dark edge
#

Player tells server it's ready
Server checks if all are ready
start game

glass orchid
#

yeah it is, but the host would be a dedicated server

twilit radish
dark edge
#

Every time a player updates their own ready state, you do some check and proceed

#

Player Unreadies -> do check -> oh shit, cancel start

glass orchid
#

thats right, but i dont know where to actually put the check

twilit radish
#

The server I would say. The server should tell all clients that all others are ready.

glass orchid
#

sorry im not being clear lol; i meant as in, what blueprint do i put the check?

#

in what blueprint does the server actually recieve the ready check and start the match once theyre all ready?

twilit radish
#

I would just put it wherever the server receives the message from a player that they are ready for the game.

glass orchid
#

yes but i dont know where that would be 😅

twilit radish
#

How do you currently tell the server from a client that they are ready?

glass orchid
#

i don't yet. hence my question

twilit radish
#

Not entirely sure if Unreal has a built in system for this in specific. But the simple solution would be to just send a RPC through the player controller to the server after they clicked some button.

#

You could also do it in the player state where you then can immediately use a replicated variable if you want to show other players that specific players are ready.

glass orchid
#

my problem isnt the sending, its the recieving. as in, in what object should the server store the ready status of each player

twilit radish
#

I would say either game state or player state.
Game state is nicely able to group it all together so it's easy to just say 'everyone is ready now'.
Player state is likely nicer to see which individual person is ready if you want to show that but you would need to check all other player states to start the game.

Kind of just depends on what you really want honestly. There's also the possibility that you don't want other clients to know who is ready, then I would do it in the game mode.

dark edge
#

But that might already exist

glass orchid
#

ideally i'd have each player see the ready state of others; so i guess ill use player state then? thanks 😄

dark edge
#

Check that you don't already have that variable tho, I thought there was a bIsReady

twilit radish
#

I don't see anything like that in player state. I thought there was something somewhere though but I don't remember.

#

Oh wait I was thinking of GameState that has a replicated FName as 'match state'

glass orchid
#

does playerstate persist between levels?

#

ah, a quick search says no

twilit radish
#

If you're using seamless travel then it should. If you're not then no.

#

Except I think local Client player states?

fathom aspen
#

Depends on what persists really mean. The docs are really shitty at explaining this but PlayerStates will be automatically reinstantiated though most of the data won't persist. To persist its data override APlayerState::CopyProerties and put the data you want to persist in there. Though you have to seamless travel in order for this to work

glass orchid
#

im asking because i have my player select a character and then play in a different level. im using gameinstance to store the selected character at the moment but i was wondering if i should store it somewhere else

quasi tide
#

GameInstance is local only

fathom aspen
twilit radish
#

You should tell the server what character you want to play as because in the end the server has to spawn it.

fathom aspen
twilit radish
fathom aspen
#

The data won't be kept if it's a non seamless

#

They will always be destroyed and recreated

#

No matter if it's seamless or non

twilit radish
#

Seamless keeps playerstates on the server though.

fathom aspen
#

That's not correct

twilit radish
#

// Always keep PlayerStates, so that after we restart we can keep players on the same team, etc