#multiplayer

1 messages Β· Page 732 of 1

blissful saffron
#

I believe he's asking if the overlaps happen server side. Have you checked that?

graceful flame
#

Think of like this, the normal way a client can start the attack is by triggering the default action. Probably mouse click or something, and you have setup clientside logic to check if they are dead or not, great. Keep that stuff.

But a cheater will attempt to bypass the default click action to start an attack and will just call it directly by modifying the memory. This means they can skip the is not dead check and call Attack as many times per second as they want to. So you need the server attack event to also check if is not dead = T or F. @vagrant grail

twin juniper
#

nobody ?

blissful saffron
#

You need to properly serialize the data for it to be passed correctly

#

(or at all? someone with more technical knowledge would have to answer that)

twin juniper
#

serialize is not means to just reduces the size passed on the bandwith ?

blissful saffron
#

yes, it'll reduce the size. I don't think it'll send items without being serialized? Again, someone else would have to answer those specifics

#

It isn't just compression

blissful saffron
#

Most everything that 'does' things should be done on the server

kindred widget
#

Regardless of whether you have an AActor* in a struct, or as a loose property, it is treated the same way. The pointer itself is a location the actor exists in the client's memory. This is useless to the server machine. So when a pointer to a replicated object is sent, it is converted to a net addressable ID, which the other machine(server in this case) can use to find that actor in it's own memory, and thus convert it back to a pointer from the net id. This netID is the same as a loose property or in a struct.

blissful saffron
#

remember that the server and client both have copies of the pawn, controller, etc. So the server should be seeing everything the client is doing and not need a lot of feedback from the client outside of what's available through movement and input

dusky scaffold
#

What would be the best place to create a standard health widget on the client? I'm doing it in my PlayerController's OnPossessed function, but only the server is getting the widget created. On Standalone it works fine as well.

#

Here's my current implementation. It's super bare bones atm

lost inlet
#

a HUD class is typically used to manage this (you can spawn your UI in its begin play)

fathom aspen
#

As said above, HUD is the class that typically manages widgets and creates them

#

Or in case of BP, a client RPC inside OnPossess to trigger the HUD event to create the widget

worn wagon
#

Anyone got any insight into this?

[2022.07.13-19.16.20:125][ 99]LogNet: ReplicationDriverClass is null! Not using ReplicationDriver.
[2022.07.13-19.16.20:125][ 99]LogNetCore: DDoS detection status: detection enabled: 0 analytics enabled: 0
[2022.07.13-19.16.20:126][ 99]LogSockets: Warning: SteamSockets: Cannot get information on an invalid socket handle, returning null
[2022.07.13-19.16.20:126][ 99]LogNet: Warning: Could not create socket for bind address 76561198033513709, got error SteamSockets: setsockopt SO_BROADCAST failed (0)
[2022.07.13-19.16.20:126][ 99]LogSockets: Warning: SteamSockets: Cannot get information on an invalid socket handle, returning null
[2022.07.13-19.16.20:127][ 99]LogNet: Warning: Could not create socket for bind address ::, got error SteamSockets: setsockopt SO_BROADCAST failed (0)
[2022.07.13-19.16.20:128][ 99]LogNet: Warning: Encountered an error while creating sockets for the bind addresses.
[2022.07.13-19.16.20:128][ 99]LogNet: Warning: Failed to init net driver ListenURL: /Game/Maps/MixtapeMansion?listen:
[2022.07.13-19.16.20:128][ 99]LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = NetDriverListenFailure, ErrorString = , Driver = GameNetDriver IpNetDriver_0
[2022.07.13-19.16.20:129][ 99]LogNet: Warning: Network Failure: GameNetDriver[NetDriverListenFailure]:
[2022.07.13-19.16.20:130][ 99]LogNet: NetworkFailure: NetDriverListenFailure, Error: ''
[2022.07.13-19.16.20:130][ 99]LogWorld: Failed to listen:
[2022.07.13-19.16.20:130][ 99]LogNet: DestroyNamedNetDriver IpNetDriver_0 [GameNetDriver]
[2022.07.13-19.16.20:131][ 99]LogNet: Error: LoadMap: failed to Listen(/Game/Maps/MixtapeMansion?listen)```

Steam socket/subsystem plugins are enabled, added module names in the build.cs, edited the ini file to what the docs said, not sure what other setup is needed
#

Really the whole lack of documentation around this stuff is a real bitch

fathom aspen
dusky scaffold
vague spruce
#

any chance y'all know how to keep the player pawn around when they disconnect? what i need to override?

#

is it AGameMode::Logout?

fathom aspen
#

Correct. HUD is a legacy class where it used to be the one doing all the drawing on screen stuff and all that legacy bullshit until UMG came to the scene. Still that doesn't make the HUD not useful as it still proves itself as a good container and manager for all UMG widgets as it exists only for local controller @dusky scaffold

dusky scaffold
#

Ah okay, thanks!

fathom aspen
#

If you want to make it persist seamless travel you override APlayerController::GetSeamlessTravelActorList and add it to the list

dusky scaffold
#

Sounds good

fathom aspen
#

Unless you wanna bother with Slate you're welcome too

acoustic drum
#

Is there anyway to get network insights with PIE?

dusky scaffold
#

Haven't touched Slate though so I know next to nothing about it lmao

fathom aspen
#

You better know nothing xD
No to be serious UMG is just a wrapper around Slate and it was built so you don't have to mess up with Slate. But once you get better at UI and you feel that some functionality is "lacking", you start getting your hands dirty with it, though it's ugly as hell

dusky scaffold
#

I like keeping things Simple and Cleanℒ️, so I'll cross that bridge when I get there

#

lol

dark edge
#

Have no UI.

#

Make everything diagetic.

echo geode
#

Just opinion, it is not a implementation just yet;
I'm just looking for better idea, now i am making a recipe system into the multiplayer like a simple quest system.
the FocusedRecipe, which is a active recipe is currently progressing on
Recipes which is array of elements added by players..

When the player adds any recipe from the UMG button, i'm willing to call my game state class function from owning player controller something like AddRecipeToThePool(FRecipe..) which adds an element to the array. and i will also thinking to implement the FocusedRecip on PlayerState class, i don't know to be sure about that. I don't quite sure how kind of system i get in conflict if I added FocusedRecipe in the PlayerState instead of Character.

Looking for any better implementation ideas @dark edge I know you good at this

#

So how would you implement something like a basic quest system, which the players can add own quests to the quest list and focus only one in terms of multiplayer and sync in together somehow, that's kind of what I'm looking for.

dark edge
#

Make a quest struct

#

or recipe in your case

echo geode
#

I have that

dark edge
#

some structure to represent everything you need to know about a quest/recipe

echo geode
#

Yeah

dark edge
#

ok so the pool is public and shared right? I can just make one and everyone sees it?

#

Is it mine or the game's?

echo geode
#

It's public for everyone, no team's included. let's say all recipes/quests that we know.

vague spruce
#

anyone know how to get a list of currently connected netconnections?

dark edge
#

all the playercontrollers

vague spruce
#

i am SO dumb

#

thank you

vague spruce
# echo geode Just opinion, it is not a implementation just yet; I'm just looking for better i...

i put things in the PlayerState if i want them to persist even if my pawn is destroyed and i'm okay with other players seeing it. i put things in the PlayerController if i want them to persist even if my pawn is destroyed and i only want the current player to be able to see it. i put things in the Pawn if i'm okay with everyone seeing it and it's okay if the data is wiped when the pawn is destroyed. hope that helps.

fluid summit
#

Hi! does anyone know of any reason as to why this replicated variable is not valid in this case? if i check it from some other place, it's valid.

#

i think it's something really easy, but i may be too hammered right now, i'm gonna check tomorrow.

fathom aspen
fluid summit
#

Found it, spaggheti code of mine

#

i tought i wasn't destroying it before that at any point, but i'm doing it.

fathom aspen
#

It shouldn't matter as it seems it's getting executed on server(like down below in PC class)

fluid summit
#

yeah, but i'm destroying that variable before executing that piece of code

fathom aspen
#

Ah that's ☣️

fluid summit
#

i'm gonna quick fix this and go to sleep, i'm too stupid at the moment to miss that one 😬

timber glacier
#

hi guys i made an online project in ue5 using advanced steam sessions. In my project players connect to lobby then game map with server travel command. Inside editor it works great but in package server is travelling but client is disconnecting when server executes servertravel NewMap Command . Anybody has seen this problem ?

vague spruce
#

sup. i need to somehow disconnect a player when they've failed some kind of validation. i see here NetConn->Close but it's deprecated. i'd love to give a reason, but i'm unsure what the API is. anyone have examples of NetConnection::Close?

#

these structs are in UE::Net and i'm not sure it's usable within my project

#
  unresolved external symbol "__declspec(dllimport) wchar_t const * __cdecl LexToString(enum ENetCloseResult)" (__imp_?LexToString@@YAPEB_WW4ENetCloseResult@@@Z) referenced in function "public: __cdecl UE::Net::TNetResult<enum ENetCloseResult>::TNetResult<enum ENetCloseResult>(enum ENetCloseResult)" (??0?$TNetResult@W4ENetCloseResult@@@Net@UE@@QEAA@W4ENetCloseResult@@@Z)
  unresolved external symbol "class UEnum * __cdecl StaticEnum<enum ENetCloseResult>(void)" (??$StaticEnum@W4ENetCloseResult@@@@YAPEAVUEnum@@XZ) referenced in function "public: __cdecl UE::Net::TNetResult<enum ENetCloseResult>::TNetResult<enum ENetCloseResult>(enum ENetCloseResult)" (??0?$TNetResult@W4ENetCloseResult@@@Net@UE@@QEAA@W4ENetCloseResult@@@Z)
#

oh i just had to depend on NetCore, disregard

still owl
#

πŸ‘‹

Does anybody know why

FString ConnectString;
SessionInterface->GetResolvedConnectString(TargetGameSession, NAME_GamePort, ConnectString)

Would return the correct IP address but a port number of 0? It's preventing me from Client Traveling :/

Looking at the code for the Blueprint Nodes, they do exactly the same thing and yet somehow that returns the correct Port. What am i missing?

vague spruce
clever plinth
#

Would it be valid to store a player's health in the PlayerState instead of the Pawn?

fathom aspen
#

It is, but it just doesn't make sense as it's pawn related

#

And you can always access it from PS

#

PS->PawnPrivate->GetHealth

clever plinth
#

Ah, thank you!

dark edge
clever plinth
#

For my purposes both would work but I'd prefer to keep the health in the Pawn for ease of access

#

The question was more hypothetical πŸ‘

clear copper
#

If the players have a shared score, do I store that "score" variable in the gamestate and use the game mode to update it? or do I use the game state to update it?

fathom aspen
#

By shared score you mean so other players know about it

#

There's one already in PlayerState

#

Use it

clever plinth
#

The GameState is available on clients and the server while the GameMode is only available on the server, so updating on the GameState may also be easier (though I'm not sure)

clear copper
fathom aspen
#

Ah ok then GameState

#

And no GameMode doesn't have to interfere and update it

#

GameState manages it on his own

#

Technically you can also make it into a subsystem. I remember that was the example Epic did when they made the live stream on subsystems, but can't tell if it's a good example

#

Prolly an overkill

dark edge
dark edge
#

They should have called it GameController instead of GameMode

clever plinth
#

True yeah there's a ton of overlap

#

@dark edge Follow your heart fs, whatever works best for you is the right way to go πŸ˜‰

stiff nebula
#

cant seem to get client damaging the server, server can damage client and death is replicated for the client. here's my blueprint

#

any help?

dark edge
#

Show your whole event chain from the input action / button press

stiff nebula
stiff nebula
#

that's the only relevant stuff for the line trace, cant fit the rest haha

dark edge
#

Is all that in the playercontroller?

#

or the input anyway

stiff nebula
#

first is in the playercharacter bp so the input

#

the other part is in the gunbp

dark edge
#

ok so why is this a run on ownging client event?

#

Might still work but that's unnecessary

stiff nebula
#

i've no idea

#

i was tinkering around with it

#

trying to see whatt worked

dark edge
#

Are you setting the pawn or playercontroller as owner of the weapon when equipped?

#

only the owner of an actor can call a run on server event through it

stiff nebula
#

ah

#

havent done that

#

how do i do that

dark edge
#

Show how you're equipping or spawning the weapon

#

It's a replicated actor right?

stiff nebula
#

yeah, disappears whenever it's picked up and respawns on both ends so as far as i can tell it looks replicated

dark edge
#

K show that logic for when it's picked up or eqipped or otherwise set as The Weapon

stiff nebula
dark edge
#

You're doing all this code on server and client

stiff nebula
#

didnt know i had to do that, do i put the authority switch right before everything?

dark edge
#

Overlap -> if HasAuthority AND !bIsEquipped -> Cast OtherActor to MyCharacter -> proceed to equip

#

! is a boolean NOT

#

So if the overlap happened on the server, and the item isn't already equipped, cast otheractor to character, if successful, equip it

#

Equip being:
bIsEquipped = true, MyCharacterRef = OtherActor, Set Owner on self to be MyCharacterRef, other stuff like that

#

you should replicate MyCharacterRef and bIsEquipped

#

or at least MyCharacterRef

stiff nebula
#

holding weapon variable is actually irrelevant, i was going to use that for a setup later

dark edge
#

You can use that to control equipping instead of shutting the collision off

#

but whichever approach

stiff nebula
#

oh, didnt know

#

is this how it should look then?

dark edge
#

First check that it's gonna be equipped, which is when you have authority, you're not already equipped, and the otheractor is Character

stiff nebula
#

setting as in, doing the branch or doing the switch?

#

(or both)

dark edge
stiff nebula
#

ah, i'll just get rid of that for now

dark edge
#

That will set the bool to true on each and every overlap with anything

stiff nebula
#

it doesn't do anything atm

dark edge
#

yes it does, it's your 2nd branch

#

but set it AFTER you've passed all the checks

stiff nebula
#

does this work? i put the set is holding weapon variable at the end

dark edge
#

sure that looks good

#

make sure you set the owner of self to be the character during your equip logic

stiff nebula
#

never done that before, just grab the set owner function and set target to my character reference?

#

also, seems i cannot pick up the weapon anymore

#

on the server or client

warped perch
#

Hi all.
Within the Lyra framework I'm using Server Travel, which works, but (in summary)...

LogLoad: Error: Old World TestMap not cleaned up by GC! Object TestMap:PersistentLevel.B_GGMannequin is being referenced by NameplateManagerComponent.IndicatorDescriptor:
(root) (NeverGCed) GCObjectReferencer /Engine/Transient.GCObjectReferencer_2147482645
-> TObjectPtr<UObject> UIndicatorDescriptor::DataObject = (Garbage) B_GGMannequin
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^ This reference is preventing the old World from being GC'd ^

I've unregistered the Nameplate Indicator before Server Travel and even tried to Destroy the NameplateManagerComponent (disallowed) without any change to the result.

Any ideas?

winged badger
#

generally you get that when something on the blueprint CDO ends up saving the world as its Outer

#

also, nothing to do with multiplayer

warped perch
#

CDO? Which channel would you suggest?

winged badger
#

class default object

#

it doesn't matter you destroyed a NameplateManagerComponent instance, the template is referencing the World

warped perch
#

Ok, thanks for your input Zlo, I'll take a closer look, it's all Lyra code that bit.

sick escarp
#

can someone give me any advised for mutilplayer ?

#

i dont know how to start making a mutilplayer game

livid sluice
#

https://www.youtube.com/watch?v=JOJP0CvpB8w&t=14s
I would first give this a watch, its okay if you dont understand everything. Just try to understand the core system a bit.

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
livid sluice
# sick escarp i dont know how to start making a mutilplayer game

Then you can follow something like https://www.youtube.com/watch?v=GcZQ2o6LpDI&t=659s

In this series we will be explaining how to add online multiplayer to your games. First we are going to explain how it works, then we will go into creating lobbies etc.

In Part 1 we begin with the basics, explaining how replication works, how to test online multiplayer, and how to add sprinting to your online game.

SUPPORT ME
Patreon I https:/...

β–Ά Play video
proud dagger
#

How do i constantly replicate variable from client to server?

#

Should I have unrealiable server rpc called every tick?

latent heart
#

Yup

real ridge
#

hello guys anyone here ? i wanna ask if u dont know how to get player name in game after login via EOS ( epic account in game ) propably it will be same name as player have in his Epic account

#

can u help me ?

latent heart
real ridge
clear copper
#

can you test LAN connections on the same computer? Like if I open two standalone instances, could I connect one to the other?

winged badger
#

you can

quasi tide
#

What do these rascals have cookin' πŸ€”

#

A wild Laura appears

twin juniper
#

Hey, I finished the bp multiplayer tutorial from epic, after the travel from lobby to gameplay level they load the player info structure within the player controller. I then cast to the player character bp,, to transfer this structure. does someone know why they use the controller for everything? is it relevant for the networkrefrencing. and how do you know what stuff you do in the character bp and what in the controller?

dark edge
#

Like if I was making GTA, the pawn would have the walking and shooting stuff, the car would have the driving stuff, and the playercontroller would just handle pause and map etc.

twin juniper
#

I looked into the lyra example and there is none of the old stuff. I dont understand anything. lol

worn wagon
#

please can anyone help with this TE_wearyBIG

#

there is such little documentation on this it's unreal (get it?)

#

This is when I am creating a session using the session's interface, code below

FOnlineSessionSettings SessionSettings;
SessionSettings.bAllowJoinInProgress = true;
SessionSettings.bIsDedicated = false;
SessionSettings.bIsLANMatch = true; // change when using steam
SessionSettings.bShouldAdvertise = true;
SessionSettings.bUsesPresence = true;
SessionSettings.NumPublicConnections = 5;
SessionSettings.bUseLobbiesIfAvailable = true;

SessionInterface->CreateSession(0, FName("Host Sesh"), SessionSettings);
twin juniper
#

copy and paste the error in google. helped me always.

worn wagon
#

Nothing helpful comes up

#

Like I said, I feel I have exhausted all the options I have

twin juniper
#

sorry I have no idea.

rotund sapphire
#

Steam isnt developer friendly, you likely hit issues with running in editor / localhost. Multiple hosts also trigger issues.

#

You could try compiling the game and test it with two PC's, both using individual steam accoutns. Perhaps it will just work.

worn wagon
rotund sapphire
#

Disable the lan match, and go for online testing rather.

worn wagon
#

Yep I did that

rotund sapphire
#

As an alternative, you could try compiling the ye olde shootergame which also has steam setup. And it's kinda lightweight as i recall.

twin juniper
#

@worn wagon here it says disable the plugins

#
#

I would try the socket one first because its mention the the log

worn wagon
#

Otherwise won't everyone need to portforward

twin juniper
#

in the tutorial I watched he said to add something with the steamsubsystem to he engine ini, did you do this?

worn wagon
#

ye

twin juniper
#

I tried man.

worn wagon
#

Na I appreciate it πŸ˜„

rotund sapphire
#

Ghetto, the nat punching is only required when the host is behind an complicated nat. For some people it's as easy as getting a port opened in the home router, and the ip/port becomes available. But for general speaking, it's better to have auto nat solution such as Steam yes.

#

I'd suggest you give a go with shootergame demo (or lyra?) as they have steam setup ready to launch. Once you get these demo games to run between you and friend, you'll get a strong starting point for figuring out the missing pieces in your project.

#

As it's not a dev friendly environment working with steam, you are expected to having a whole bunch of troubles until you get it right.

#

Hence the demo games, may give you a little help, without hiring experts for the task.

worn wagon
#

I'll give it a try if my next test doesn't work

grave lynx
#

Hey, little question about the debugging tool in multiplayer, I guess to have one PC for the server and 2 PC for the client (one for client, one for server)

grave lynx
#

it is

dark edge
#

Yeah so server sees both players controllers, while the client only sees their own

#

so 3 total

fluid summit
#

Hi! does anyone know of a way to lower the graph settings when simulating on "Standalone"?

#

I have it low for editor, but when i play a level on standalone, i get max graph settings

dark edge
fluid summit
#

Yeah, but for the other windows, not the one on the editor

#

already found a fix

#

there was no fix, the graphics was not the cause of my performace problems, it was some error on replication

fluid summit
#

Any way to get "HitResultUnderCursor" from the client while being on the server?

#

i'm doing an RPC on client that updates a variables with another RPC on server with whatever it's undercursor, but it looks like a total mess.

dark edge
#

You can certainly spam a hit result at the server every frame, but whether or not you need to is up to you

fluid summit
#

it's for my "Interact" Interface. I want to keep it as generic as posible, but some actors need that info

dark edge
#

Only do it on Interact

#

Just pass the actor you want to interact with over to the server, it can do a distnace and LOS check if you want, then do the interaction

fluid summit
dark edge
# fluid summit

Nah I wouldn't do that, that's a lot of bandwidth for zero gain

#

maybe for a multiplayer painting game, but not for this

fluid summit
#

That's my current setup, it's awfull

dark edge
#

Just do the RPC between the input and the interact call

fluid summit
#

so i can just ask on server side "give me this client hit result under cursor"?

dark edge
#

Nah just tell the server who you want to interact with

fluid summit
#

it's a little bit more complicated than that

dark edge
#

What's the exact use case

fluid summit
#

i have a big object with all the tile floors, they are components of some actor

dark edge
#

Is interacting continuous or does it happen when you press a button or whatever?

#

You can pass over the specific component

fluid summit
#

so when you interact with the floor, it checks your hit under cursor and gets the corresponding component

#

with that it checks if your character is on that tile

dark edge
#

Just send over the hit result when you press the button then

#

no need to send 100,000 of them over and only using 1 of them

fluid summit
#

i'm not updating it on tick, only on request

#

i'm gonna try and update that before the interact on the PC

dark edge
#

I'd just send over the hit result with the interact

#

one Client-Server RPC

#

not a back and forth

fluid summit
#

Nvm, i just found there's some other problem first with how the actor is replicating.

#

i'm getting nothing when checking "HitUnderCursor" on the client, even when the actor is replicating.

ripe basin
#

Where's the best place to store and fetch a player's Steam Avatar, Player fetch themselves in PlayerState, then have whatever actor that needs it call the PlayerState by Controller?

fathom aspen
#

PlayerState. Accessing that property on PlayerState varies from one actor to another

ripe basin
#

Got it - Issue I'm having now fetching it this way is I think Server isn't pulling it correctly but all Players are. So maybe I'll just set a special condition for Server. GameState fetches it for Server successfully. Is that okay?

#

It's always some combination of Server fetching successfully, vs all Players. Then GameState can fetch and store everything BUT the image itself for Players.

ripe basin
#

It's more an issue of where it's fetching from initially.

#

All data except the image propagate fine through GameState OR PlayerState.

fathom aspen
#

If the property is being set on client then yes the server has no idea what that is

ripe basin
#

Was mostly trying to figure out a catch-all for ALL Player + Server Steam ID info.

fluid summit
echo geode
#

Hey, i am getting a error when getting a replicated property on UMG widget construct.

fluid summit
ripe basin
#

Lobby system with Player info in the map, and I do - But it doesn't work for Server. Only Players.

echo geode
#

ensure(Stack.MostRecentPropertyAddress); // possible problem - output param values on local stack are neither initialized nor cleaned.

fluid summit
fathom aspen
ripe basin
#

Advanced Steam Friends Library fetch by Unique Net ID

fluid summit
#

please show me your call to set the picture, it should be perfectly okey with setting the prop to replicate and just change it on server

fathom aspen
#

Is the replicated property in the UMG class?

echo geode
#

No

#

I have TArray<UObject*> replicated property in game state, i guess UObjects is not involved to replicate. It may be problem.

#

It's on my gamestate

fathom aspen
#

Yes that's the issue if you haven't made your UObject class to support networking

echo geode
ripe basin
#

Wait, maybe I need the 'Request Steam Friend Info' to preload first..

echo geode
#

this is my setup on "character"

ripe basin
fluid summit
# ripe basin

put a "Has authority" after begin play and continue from "Authority" pin.
Check if UniqueNetid is valid (with a print) and also if the avatar is returning anything or of it's empty

ripe basin
#

Yeah I think I'm running into some race conditions with the load too.

fluid summit
ripe basin
#

Good idea

fluid summit
#

Just in case you are quite new to multiplayer, check the multiplayer compendium by cedric, it's on the pinned messages

echo geode
fluid summit
#

Speaking of new to multiplayer.
I'm having troubles with this actor (the hexagonal tiles)
I'm doing a "get hit under cursor" and it hits okey on server, but it doesn't hit at all on client.

#

The floor is set to replicate, the main actor is spawned on GameMode and each hexagon is a static mesh that i add when the actor floor starts.

fathom aspen
fluid summit
#

Does anyone know why the "Hit Under cursor" is not hitting on client?

#

This other actor uses the same method to check with "HitUnderCursor" and works okey on both Server and client

#

🧐

fluid summit
#

i also found that some hexagones are not replicating correctly, like the trees.

#

if anyone has any idea on why this things may be happening, i'm open to suggestions. I have run out of things to check

shell forum
#

How can I debug voice chat? I'm trying to use 'stat net' but not getting much info from it.

grave lynx
#

Hello boys, If I change the charater collision inside the PC, do I have to change on server and on client? For now only have a custom event run on server setting enable character capsule collision. Because as u can see, the client on the right side is on falling mode. but he is not really falling because (I think) the server already set his collision capsule to enabled.

violet sentinel
#

i'd recommend use of NetMulticast for that

twin juniper
#

is the pawn movement "floating pawn movement" not replicated at all like the character movement component?

twin juniper
#

How does server/client garbage collection work in live games? In the editor, objects show up in the object list even if they are client side only. I take it that live game is different since certain objects only exist client side, and client side garbage collection takes care of those?

#

Trying to track down some garbage collection crashes, wanting to rule things out.

fossil spoke
#

How do you know its a GC crash?

twin juniper
#

The crash log has "GarbageCollection" scattered all over it.

#

From what I can tell, its related to Dynamic Material Instances.

#

I didn't realize I was created them on the server until recently. Just wondering how GC is handling cleaning them up on the client and if they're stuck in memory on the server if I do something to replace an existing one with another. I haven't confirmed there are any pointers to the old ones yet though.

pallid mesa
#

Can you change the rep condition in runtime??? ugh o_O (btw old msg because I was reading all the nonsense with OverrideWith)

twin juniper
#
FVector2d ViewportSize;
GetWorld()->GetGameViewport()->GetViewportSize(ViewportSize);```
This causes a crash when I play as a Client. But does not crash when I play as Listen Server. Why is that?
summer tide
#

Hi - If I attach my player to a character. Then play anim montage to that character. It appears shaky. Any idea why?

twin juniper
#

@bitter oriole Its because GetWorld()->GetGameViewport() ptr is empty in as Client Mode. Why is that?

bitter oriole
#

Probably not created yet

twin juniper
#

When will it get created?

bitter oriole
#

No idea. You probably want to check the timing for that

twin juniper
#

Nvm, it works when I just check for the ptr if its null.. after that its works somehow

twin juniper
bitter oriole
#

I mean it looks like something didn't replicate yet and you have to wait later to call that code, using an if like you mentioned

twin juniper
#

Ok, I never made a multiplayer game. I assume by your answer, that this is usual procedure to solve such a problem? I am just worried that I may missed some other underlying problem

bitter oriole
#

So you have to get defensive and rely on passive, observational approaches, like "hey this is valid, let's do stuff on it"

twin juniper
#

I understand, thank you.

winged badger
#

you can assume one timing

#

GameState has replicated before any Actor on Client calls BeginPlay

near bison
#

How is listen servers in unreal? Anyone using it in prod for mobile?

bitter oriole
#

Again?

echo geode
#

Hi, how can I replicate the structs, actors and UObjects in the replicated TArray<ASomeActor*> declared in my GameState?

#

I have this on my GameState

#

Adding an element using RPC on the Server

#

The array of itself is replicated.. but not the actual objects in the array.

echo geode
#

Ok, i got the answer

Structs, replicates only Struct members that have changed.
twin juniper
#

Is it recommended to use Object Pooling in a multiplayer game? If yes, do you have any resources on how to implement it?

echo geode
#

and same kind of principles for replicated TArray<>

polar wing
#

(Although, not a huge overlap with NP, but kinda wondering if it all ties together)

rocky kestrel
#

We are creating mm survival game. We use ue5.0.1. Game depot is on steam (not public) but we can download it from steam internal testing. We would want to make dedicated server up to 100 players. How should we do that? create server and upload it to steam and make that steam host it? We have already tried local server "port forwarding" but we want to test how it works with steam server + overlay etc

#

we also use source version of ue5

winged badger
#

with what i estimate your current understanding is, there is no way you can get 100 players on same server instance

#

that takes experienced network engineering teams

#

and no, steam does not host your dedicated servers

rocky kestrel
#

Okay thank you! What is then best way to host servers?

silent valley
#

Connect via IP, once that works look at setting up Steam OSS

#

After that investigate uploading your builds automatically

rocky kestrel
#

So its work if we lease cloud vm. Then upload server build (same as we do local dedicated server) to there. How expensive those are? Do we need get investors?

silent valley
#

idk, depends on the specs of the machine required to host your server. Should be less than $100 a month during testing.

rocky kestrel
#

Okay thank you much!

#

we have now "almost" working beta test game. Server did work nicely (local port forwarded) with 20 players. But problem is we don't have budget yet. And its very hard to know how many players we get after publish (do we need 5x 50 players servers or 20x πŸ˜„ One solution would be to pitch for investors.

carmine trout
#

How do I attach the player to a vehicle in a multiplayer game? This event works fine when running as the listen server, but as the client there is rubber banding and other issues seemingly caused by the character's collision not being disabled

dark edge
#

And don't screw up your auto-scaling backend or you'll have a $500k/mo bill because you had a bug and requested 100x the servers you needed.

rocky kestrel
#

Okay thanks!

copper plank
#

Does EOS utilize both STUN and TURN for their NAT P2P API? Steam provides "Steam Datagram Relay" which includes TURN servers. I'm assuming Epic also includes TURN given they advertise DDoS mitigation but I can't find any published details of their backbone.

quasi tide
copper plank
#

yeah I'll head over there but figured I'd start my networking question here. I'm at the decision point of buying into either the epic or steam networking ecosystem for crossplay

woeful jacinth
woeful jacinth
pale pewter
#

is there a process for hiding an actor that is not close to the client so the client get more FPS?

fathom aspen
#

Relevancy

#

It's part of the engine

#

Edit the relevancy range to your liking

#

You find it in the replication tab of the actor

dark edge
fathom aspen
#

Haha that's funny

#

You ended up making it bigger?

#

Or making smaller ships 🚒

twilit radish
#

What’s the default distance again?

fathom aspen
#

2250....0

#

I can't remember the number of zeros

pale pewter
#

Thank you

pale pewter
#

so the only thing needs adjusting is the cull distance right?

fathom aspen
#

Yes

#

Technically you can edit too many things to bring better FPS and less cpu stress

#

But this is a good starting point

#

I mean depending on how many actors are you replicating and how big is your map so all not every tool out there is needed. But you can look up the ReplicationGraph, PushModel, FastArrays, etc...

#

NetManagers too

dark edge
#

Only 150 meters

fathom aspen
#

RIP to a 150m+ multicasted sniper shot πŸͺ¦

faint parcel
#

Hi! I'm trying to replicate an Inventory Component (ActorComponent) but the Equipments property only has a null element in it, instead of the valid AEquipment* I was expecting.

The InventoryComponent is added to my CharacterBase class like this:

InventoryComponent = CreateDefaultSubobject<UInventoryComponent>(InventoryComponentName);
InventoryComponent->SetNetAddressable(); // Make DSO components net addressable
InventoryComponent->SetIsReplicated(true); // Enable replication by default

and the property looks like this:

UPROPERTY(EditAnywhere, BlueprintReadWrite, Replicated, ReplicatedUsing = "OnRep_Equipments", Category = "SSP|Equipment")
TArray<AEquipment*> Equipments;

But when this function is hit, the array contains only a null element:

void UInventoryComponent::OnRep_Equipments()
{
    for (AEquipment* Equipment : Equipments)
    {
        AddEquipmentInternal(Equipment);
    }
}
#

The AEquipment constructor has bReplicates = true;

#

What am I missing?

steady horizon
fathom aspen
#

Also SetNetAddressable() is redundant alongside SetIsReplicated()

faint parcel
faint parcel
# fathom aspen Also how do you add to stuff to the array?

Blueprint call that in turn calls ServerAddEquipment:

void UInventoryComponent::ServerAddEquipment_Implementation(AEquipment* InEquipment)
{
    AddEquipmentInternal(InEquipment);
    ClientsAddEquipment(InEquipment);
}

AddEquipmentInternal adds to the array: Equipments.Add(InEquipment);

#

ClientsAddEquipment is a NetMulticast:

if (!GetOwner()->HasAuthority())
{
    AddEquipmentInternal(InEquipment);
}
fathom aspen
faint parcel
#

Not sure I understand the potential issues I might run into with regards to non relevant players.

fathom aspen
faint parcel
#

First oddity: looks like the Level blueprint is called twice (and the HasAuth is true twice) (not sure if related to my null-element issue)

#

(testing with 2 players in editor)

fathom aspen
#

Level BP is some weird ass place to do such a thing tbf

faint parcel
#

Probably very true, might move it out earlier rather than later

fathom aspen
#

I never use it, and most people don't

#

It's probably used for some specific stuff that you don't need to worry about for now

faint parcel
#

I might have misunderstood COND_InitialOnly to also send when a new player joins.

#

related to your point about the initial bunch

fathom aspen
#

Well it gets sent to a new player that joins as the actor that has that property gets replicated to him. But my point was that you are setting the property after the initial bunch has bent sent, aka, after the actor has replicated for the first time...

faint parcel
#

Could that be solved by just doing DOREPLIFETIME instead of DOREPLIFETIME_CONDITION?

fathom aspen
#

Could be. Easiest way to know is test.

faint parcel
#

Alright I had some fixing to do in that level blueprint, it's a bit more sane now.
Still don't know how I end up in this 1-element in the array, but it's null situation.

fathom aspen
#

I have no idea what's going on in your level BP and it's prolly what's causing you issues

#

I would just add elements to the array in the character class itself

#

Anytime in/after PostInitialiseComponents

distant turret
#

How much will it cost to run multiple service from AWS for a full multiplayer game with average 20000 players a day

shell forum
#

Not sure if this is the right channel but what needs to be done before testing Steam in engine? Do I need to upload a build beforehand? Every time I launch the game in standalone it’s using LAN despite properly setting up the config files.

shell forum
faint parcel
shell forum
#

My guess is like $10k a month though.

shell forum
#

I mean a packaged build uploaded to Steamworks

fathom aspen
#

Steamworks is involved yes, I just don't remember the specifics

#

There's prolly 20 million videos on YT that tell you how to do it

shell forum
#

Do you remember is there’s a way to debug it? I’m not getting any sort of error messages on launch to help figure it out

shell forum
fathom aspen
#

Those are the only type of videos I suggest watching though

#

Not the other types πŸ˜›

fathom aspen
#

They should be telling you what subsystem is involved and such

fluid summit
#

Hi! one question.
My current map setup is a bunch of hexagons that have a ST with info about them in, all in one array.
The meshes are all added as "static mesh component" to one actor that holds the map.
Does anyone can think of a better way to do the mesh part? Without losing that each hexagone has different graphics.
Picture as a example below:

fluid summit
#

if so, remember to build on "Shipping" and add a file named "steam_appid.txt" with a text that says "480" inside of it.

#

Yeah, it does.

#

right is the session hosted and left is the session browser, i can connect without problem with lan/internet

#

What problem are you having?

#

do you get the popup of steam when you open the game?

#

are you talking about the editor or when packaging the game?

#

the file is for packaging, let me share my setup, it's not that much

#

Search for sessions:

#

Join session:

#

and that's it i think, nothing extra.

#

Plugings:

#

Do you have steam open while doing this?

#

oh right, i forgot about that.
I have this piece of text added on defaultengine.ini

#

maybe try with 480 to discard that as a problem

#

btw: i'm using it on the editor as standalone with Internet mode (not lan) and it works okey even if i don't have steam open

#

I think i used this for the blueprints if i remember correctly:
https://www.youtube.com/watch?v=r3UWKE4x-6o&t=253s

In this video I show you how you can implement the Steam Advanced Sessions plugin, so that you can make MBLS work with the Steam Online Subsystem.

Steam Advanced Sessions Plugin link:
https://forums.unrealengine.com/t/advanced-sessions-plugin/30020

Unreal Engine Steam Online Subsystem documentation link:
https://docs.unrealengine.com/4.27/en-U...

β–Ά Play video
#

and the oficial documentation later on to get more details

devout dagger
#

what is the reason for this error?

fluid summit
#

Maybe check the video tutorial from start and do all the steps, maybe you missed something

#

but it's quite straightforward, did you add the plugings to the engine?

fluid summit
steady horizon
#

Hey, has anyone been able to connect to Playfab Hosted Servers?

fathom aspen
fluid summit
#

Maybe the 480 modification

#

Does anyone know why this may be happening?
The "Is valid index" goes ok.
But when i try to grab the array item at that same index, it fails ._.

fathom aspen
fluid summit
rancid monolith
#

trying to learn networking... Is there something wrong with my RPC? or is my problem likely elsewhere?
`void AWeaponBase::HandleFireProjectile_Implementation(FVector Position, FVector Direction, FRotator Rotation)
{
FActorSpawnParameters SpawnParams;
//SpawnParams.Owner = this;
//SpawnParams.Instigator = GetInstigator();

AProjectileBase* projectile = GetWorld()->SpawnActor<AProjectileBase>(
    projectileClass,
    Position,
    Rotation,
    SpawnParams
);

if (projectile)
{
    //projectile->FireInDirection(Direction);
    projectile->movement->Velocity = Direction * projectile->movement->InitialSpeed;
}

}`

#

The projectile is spawned client side but doesn't appear to other players

fathom aspen
#

What kind of RPC is this?

rancid monolith
#

I defined it like this:
UFUNCTION(Server, Reliable) virtual void HandleFireProjectile(FVector Position, FVector Direction, FRotator Rotation);

#

hopefully that answers the question

fathom aspen
#

Is the spawned actor replicated?

rancid monolith
#

pretty sure it is

fathom aspen
#

Where is the RPC called from?

rancid monolith
#

I have a weapon actor which is held by a character that calls HandleFireProjectile()

#

the function is called on the weapon

fathom aspen
#

Yeah that should work then. Nothing weird I'm seeing

rancid monolith
#

It doesn't matter if the actor calling the RPC is replicated right?

fathom aspen
#

It does matter

#

If it's not replicated the RPC won't fire

rancid monolith
#

well I already tried both :/

#

replicated and not

#

i'll poke around some more to see if I can find the issue

rancid monolith
fluid summit
#

Is any way to know, when replicating an array, what elements have changed? i would like to avoid doing another array to keep track of the pending modifs

#

i would also like to avoid doing a check on all the array elements when only 1 changed

fathom aspen
#

There is no other way but to traverse the whole array and compare it with OldArray. Problem is in BP you don't have that OldArray param in the OnRep

#

In cpp you do

#

Though in cpp you also have FastArrays where you get replication callbacks for the items that replicated

fluid summit
#

i'll settle with a new array of pending modifications if that is the case. I'll change it later on when i do it on cpp

fluid summit
#

Last one from today, this one have been bothering me for 2 days.
On server the hit works oney, on client it fails.

#

it's a really simple check hit under cursor

#

Any idea why?

nova wasp
#

Probably an input handling issue

#

Perhaps not on the client game world or getting input taken by something else

fluid summit
#

The input is triggering correctly, the "GetHitUnderCursor" is ok, but on the client it just doesn't hit anything

fathom aspen
#

I would just breakpoint GetHitResultUnderCursorByChannel in cpp and see what's going on

fluid summit
#

It works okey on the client for the chests, but not for the floor (the hexagones) there has to be something weird with the replication setup of that actor, but i can't figurate out what

shell forum
#

What’s the difference between β€œToggleSpeaking 1” and β€œStartNetworkedVoice”?

#

I’m trying to setup optional push to talk but all the documentation is geared towards one way only.

dark edge
dark edge
round yew
#

Hello, would it be an issue to multicast physics movements for a vehicle, but make those "reliable". It's the only way we have been able to fix the jittery issue for a physics-based multiplayer vehicle.

But I also often heard reliable multicast are a big no-no

pallid mesa
#

hello @round yew it depends on the frequency you are sending them

#

also sounds like an odd approach to replicate a physical object in a server authorative manner

#

usually you would forward input to the server, feed this input to your simulation

#

and then replicate back the result to the clients which will be dependant of your net update frequency

#

within those network updates you interpolate the vehicle to the next predicted position using the physical state replicated back to the client

twin juniper
#

Do i need anything besides UE and some code for Online multiplayer?

pallid mesa
pallid mesa
twin juniper
pallid mesa
#

some do, steam for example lets you save specific player data

#

for questions about online subsystems there is a dedicated channel #online-subsystems, it's a whole topic by itself haha

twin juniper
pallid mesa
#

I haven't played it so I don't know exactly how it works to guess what they might be using

#

but you can perfectly hook your oss ID to an external DB in which you store game data that you can retrieve at any point in the game

#

also Unreal does have a saving system that you can use

twin juniper
#

ah

twin juniper
ancient badge
#

Hello, if i have a "Listen Server" and one "client" and at the start of a round i need the "listen Server" to know about a varibale from the "Client" wouldn't i use a "RepNotify" for that Variable? Im asking because i just heard in a video that RepNotifys are a one way stret and only work from server to client and not from client to server

twilit radish
#

The replication system is indeed only from the Server -> Client. You will need to use a RPC to send the variable to the server from the client.

ancient badge
#

Well here are the days i wasted questioning myself why i can't get repnotifys to work. πŸ˜„

grand mica
#

What I am facing is - The bots seem to be stationary but when i inspect the position of the bots it seems to be changing but not changing on the screen.
My guess was that the area is huge and it could be some issue with things not getting replicated properly because the bots are far off.

If my main character is near the real position of the bots then they seem to be moving correctly but far off they seem to be stationary but actually moving when i look it into the details window
I am playing it as client
any guess what this could be?

sinful tree
# grand mica What I am facing is - The bots seem to be stationary but when i inspect the posi...

Probably actor relevancy. Actors that are far away from a client's controlled actor won't exist on the client's end. When the actor comes into relevancy range, the server will tell the client to spawn them and will be begin replicating the data to the client. When far enough away, they get despawned on the client. The distance can be set per actor using the "Net Cull Distance Squared" - the number usually needs to be larger than the units you usually use as it's a squared value. So if you wanted relevancy to be within 10000 units, you'd have to do 10000^2 which is 100000000.

grand mica
#

so this net cull distance should be applied on the character or the bots?

#

I guess it should be the character?

grand mica
sinful tree
#

If you mean in the viewport, I couldn't answer that myself XD

grand mica
shell forum
#

What’s the difference between β€œToggleSpeaking 1” and β€œStartNetworkedVoice”?

ancient badge
#

If i have a "listen Server" and one "client" i would have for each one "GameState" right?

dark edge
ancient badge
#

When i use the "debug filter" from UE4 in my blueprints i see "GameState Server,spawned" and GameState Client,spawned"

latent heart
# dark edge

That should totally be pinned <@&213101288538374145> (apologies if it is already!)

twilit radish
sinful tree
twilit radish
#

Also this one is superior πŸ˜‚

latent heart
#

Nah.

twilit radish
#

😦

latent heart
#

I think the Venn diagram one is better.

safe marsh
#

hey, I am looking how to override the network version of client/server so clients built with another engine can connect

potent coral
safe marsh
#

from what I've seen you can override it in the ue source but you can also do it via ini?

twilit radish
safe marsh
#
[OnlineSubsystem]
bHasVoiceEnabled=true
bUseBuildIdOverride=true
BuildIdOverride=12345
#

something like this

#

how do I find the build ID?

#
sinful tree
potent coral
#

lol

dark edge
#

There is nothing that only clients share but server doesn't.

potent coral
#

what if its p2p πŸ˜›

dark edge
twilit radish
#

So then you can just make a config option for it your self.

#

Although I'm not sure why you need to override it in the first place. If there's a mismatch, which the engine already automatically detects for you, it will obviously cause issues.

twilit radish
#

πŸ‘€

safe marsh
#

@twilit radish can I launch a server with a command line override to not do the version check?

twilit radish
#

If it's your own hosted server I suppose yes.

safe marsh
#

-networkversionoverride= seems to need a value though, I need to set it to accept different client versions

#

as we have clients build with different engines ;/

clear copper
#

If I spawn an actor, how do I get a reference to that actor since RPC can't have outputs?

twilit radish
#

For that you will need to bind to the C++ delegate so you can dynamically determine it. The command line won't do that for you yeah.

#

All the command line argument does is say "This is my new current version"

twilit radish
#

But do know that it may not have replicated yet.

#

So you will need to make sure it actually exists on the client first.

#

Maybe I should ask what you're trying to achieve?

twilit radish
clear copper
#

do i even need the last event? or can i just tag it to the end

twilit radish
#

No. Because that will likely cause the issue that your actor is not spawned on the client yet.

clear copper
#

ah

#

so how do I fix that issue

twilit radish
#

Well this is why I'm asking what you're trying to achieve. Why does the client need to specifically know about the actor?

clear copper
#

because i need to update that actor's transform after spawning it

#

when i do, it only updates for the server

dark edge
twilit radish
#

I assumed it's being moved constantly.

#

But otherwise it should just set the proper location yeah.

#

Also if the actor is not replicated then you can't even change it on the client in the first place πŸ˜›

dark edge
#

@clear copper You should do everything you can on server and have it replicate out.

clear copper
#

gotcha

dark edge
#

If you must do stuff local instantly then you're in prediction territory

clear copper
#

ah that makes sense

twilit radish
#

I mean prediction is not a bad thing, but in this case I think it's not the right approach yes.

dark edge
#

Specifically what are you trying to do here? What's the mechanic?

clear copper
#

its like Orcs Must Die trap placement. when you hover on a grid, it moves the trap pre-placement around. I was hoping to have the clients see the pre-placement movement. instead of just the final build transform

#

so when someone spawns a trap actor for pre-placement, it follows their mouse. I wanted to show that for everyone.

#

hopefully that makes sense

#

I'm going to do some more reading because I think Im just a little far beyond my understanding of multiplayer

twilit radish
#

I mean the mechanic makes sense to me. Just not sure if how you want to do it is the best way.

clear copper
#

thats fair lol

twilit radish
#

Because ideally you already have an actor on the client before it's even replicated from the server to the client.

#

Otherwise you need to spawn the actor on the client and replace it with a replicated actor later on that also needs to replicate it's own variables.

#

Seems really unnecessary.

clear copper
twilit radish
#

No. The client that wants to place the trap needs to have an actor represent the trap before it even exists on the server.

violet sentinel
#

or spawn hologram without collision before spawning actual building, like Satisfactory does

twilit radish
#

Otherwise the client needs to wait for the server to create an actor and replicate it down to the client, which is weird I would say.

clear copper
#

side question, do I need replicate AND replicate movement checked on my actor?

twilit radish
#

Oh.

#

But I mean that's what they are after like they said. They want a "hologram" that then later on gets replaced by the real deal. Right?

violet sentinel
#

yeah

#

just two actors - fake for preview , and real for actual thing

twilit radish
#

But the thing is the initial delay. You don't want the client to wait for the server to spawn the "hologram" actor, that would be kind of weird if you ask me. But maybe I'm just seeing that wrong πŸ€·β€β™€οΈ

violet sentinel
#

hm, it is possible to spawn it locally and replace local temporary actor with replicated

#

spawn preview on client (save to variable on PC)
send RPC to spawn preview
recevie onrep when preview actor spawned on client
replace temp preview with replicated preview

#

if you really dont want that few frames delay

ancient badge
#

I have this two variables. One is set if you are the "listen Server" and the other if your are a "client" how do i send that variable from the listen server to the client and from the client to the listen server? I tried RPC and Repnotify but i can't get it to work

twilit radish
#

@clear copper Does it matter to you/your game that there's a bit of a delay between the hologram showing up for the client placing the trap?

twilit radish
#

Then I would go with Aquanox's solution / the initial idea I suppose. I think a good way would be to RPC to the server that you want to spawn a "hologram", set that actor's owner to the client who spawned it and then when the "hologram" gets replicated to the owning client it can from that point on move the actor locally and then send the location over to others.

clear copper
#

lmao all i had to do was turn on replicate movement

sinful tree
twilit radish
#

Replicate movement does lag behind for the person building the trap and has no smoothing (so I was told).

#

But is definitely a thing you can do.

ancient badge
clear copper
twilit radish
#

It just depends on how complicated and thus 'hopefully' smooth you want to make it I suppose.

clear copper
#

Yeah, for initial functionality and testing purposes a simple replicate movement works fine. But no harm in making it better

twilit radish
#

Like if you want the full deal you would need to:

  • Spawn a local actor and move it around.
  • Then send a request to the server to spawn a hologram.
  • Once the owning player gets the replicated hologram replace the local version with the replicated version.
  • Mean while in doing this all constantly send the location up to the server and replicate it to clients.
  • Smooth out the movement on all clients.
#

Which is much more complicated as you probably can tell LOL

sinful tree
# ancient badge It comes from the GameInstance but the screenshot is from the GameState

So then it's a matter of sending those values from one place to the other. Again, the server won't know what the client's game instance contains, and the client won't know what the server's game instance contains. So at some point, you would have to send the client's version to the server, and the server's version to the client if they're both supposed to know what the deck contains.

twilit radish
twilit radish
#

πŸ‘

ancient badge
clear copper
twilit radish
sinful tree
twilit radish
clear copper
# twilit radish What do you currently have as setup?

When the player spawns the actor, it calls these. After checking "Replicate Movement" in the actor's bp, it spawns and follows the player's mouse. But only if that player is the server. The server can't see anything the client has spawned.

twilit radish
#

Well yes because the server can't magically guess where to place the actor. You need to tell the server where to place the actor from the client.

clear copper
#

i thought that's what multicast does

#

is multicast clients only?

twilit radish
#

No.

#

You're currently doing this:
Client to server says "Spawn the actor please" and then the server multicasts to all clients to spawn an actor on that specific client.

#

What you probably want to do instead is spawn a replicated actor on the server.

#

Although.. :/

#

This is why I hate this in specific because it's a bit complicated lol. You need to predict things either way.

#

The quickest setup would be this I guess:

  • Send a request to the server to spawn a replicated actor on the server and set the owner of that actor to the client who wants to spawn it.
  • Once the actor is replicated down to the client constantly send a RPC to the server with the new location.
  • Then you can check the "Replicate Movement" box and it will replicate to other clients. But then you need to make sure it doesn't move on the owning client from the server's request, which honestly I'm not entirely sure how to do from BP :/
clear copper
#

appreciate the help

twilit radish
#

What you can do is skip the prediction.

#

Then you would still do what I just said but instead let the server also say where the hologram is placed, but that does mean a bit of latency will be included.

#

But I guess that's not the biggest issue for testing.

sinful tree
ancient badge
#

no

sinful tree
#

Then this wouldn't work.

twilit radish
# clear copper appreciate the help

Yeah no problem, sorry I couldn't really help too much though. I'll try to build something quickly my self to see if I can get something to work that's easy to do from BP. But it's kind of an annoying thing to deal with because it ideally requires prediction πŸ˜…

clear copper
ancient badge
sinful tree
#

Again, Game Instance only exists on the copy of the game that is running, so if I choose my deck while not connected to the server, and store it in the game instance, there's no way for the server to know about what I've chosen. Even if I was connected to the server, but I stored my chosen deck in my game instance, the server still wouldn't know about it.

In order for the server to know what I've chosen for my deck, I'd have to run a "Run On Server" event, not an "Executes on All" event.

Without really knowing the flow of how your game operates, I'd do something like:
Player Controller:
Begin Play > IsLocalPlayerController (True) > SendSelectedHand (Run on Server Event) passing my selected hand from game instance.

SendSelectedHand Event:
Get playerstate > cast to your playerstate > set Deck Variable (Should be replicated)

Now, what this has allowed is for you to store data about a player in the appropriate place that anyone could look up what the values are. There is no need for "P1 Deck" or "P2 Deck" just a "Deck" in PlayerState since each player has their own playerstate.

As for where you go from here, that "SendSelectedHand" event can also be used to check if all hands have been received by looping through the player array from the gamestate and checking that all hands have been received and begin to do what's next.

ancient badge
#

So, i save my deck that i have created in GameInstance and send that trough the "SendSelectedHand Event" and set it in my PlayerState. And now it is replicated and the other Player can access that?

sinful tree
ancient badge
ancient badge
ancient badge
potent coral
twilit radish
#

@clear copper I have a working setup that seems to work fine-ish with these network emulation settings (No smoothing for example). But it took me a solid 40 minutes to setup lol. Not sure if you want to go through that pain yet? I do need to eat right now so I'll see your answer in a bit hopefully πŸ˜„

clear copper
twilit radish
dark edge
#

So to reiterate, all you're doing is moving the trap actor around in Hologram mode, then placing it is just locking the mode and activating its mechanics

#

You're doing nothing clientside but sending the preplace/place commands

#

you're already syncing movement and aim rotation

shell forum
#

What exactly gets persisted through Seamless travel? It seems to function normally, but I don't want to run into issues in production with actors that shouldn't be persisted going to the next level...

stiff nebula
#

hey, been trying to do this for a bit but i don't understand what to really do here, asked for help before but cant seem to get this working still. trying to let my client damage the server but im not sure how i'd even go about it to begin with. server can do everything to the client and the client sees it. something i learned about since i asked the question is that you need authority to deal damage, and apparently you have to set owner of the weapon? i was a bit lost after that, i'm a bit new to the whole ue4 shenanigans so i apologize if i don't understand what you mean if you're trying to explain something. here's my bp -

#

note this is in my gunbp

elder sage
#

idk if it's actually best practice but I've always just put a branch after my line traces so it can skip some functionality if it doesn't hit anything

frigid ledge
stiff nebula
#

maybe i've done it wrong? here's what i have it doing when the character picks up the gun (highlighted only relevant things)

frigid ledge
#

seems legit

stiff nebula
elder sage
#

I can only assume you're creating the gun through the player character's construction script or later, even

frigid ledge
stiff nebula
#

how would that work? wouldn't it need some input from the game to tell which player is the owner?

#

i just have it spawned on the floor

frigid ledge
#

You probably have an Event on the Gun when "something" picks up the gun and that something needs to be your player

stiff nebula
#

eventually i do plan to make it so all the guns spawn at your feet when you get into the game and you just pick them all up off spawn instead of doing a pickup system

elder sage
#

oh, well just create an event for when it's picked up and fire it then

frigid ledge
stiff nebula
#

so how would i go about telling the gun that i am the player, i'm a bit lost here haha

fluid summit
elder sage
stiff nebula
#

right, this is what i've got in regards to that

fluid summit
elder sage
stiff nebula
#

gotcha

elder sage
#

or this

stiff nebula
#

ohhhhh

dark edge
#

Why even hit test the hexes

elder sage
dark edge
#

ConvertWorldLocationToHexCoordinate

elder sage
#

although that would probably need to be a server rpc @stiff nebula

#

I forgot what channel this was

fluid summit
stiff nebula
#

what do you mean, like i'd have onpicked up on my character BP or i'd put set owner in an event then call it?

#

@elder sage just saw your name haha

fluid summit
#

I think it may be some problem about the static meshes collision not replicating correctly. On server they work fine, the problem is on the client.

#

i'm adding them as static mesh component

elder sage
#

that's why it passes a reference to the character, to be set as the owner

fathom aspen
# shell forum What exactly gets persisted through Seamless travel? It seems to function norma...

If by persist you mean literally same reference then non of the GameFramework objects does by default and there is no reason to make them so. There is a short period of time where you got the old and new references and you have to copy stuff over from the old to the new. That what happens for PlayerController and PlayerState for example. You can make custom AActors persist a seamless travel inside GetSeamlessTravelActorList

dark edge
fluid summit
#

hmm that's a good idea

fathom aspen
fluid summit
stiff nebula
elder sage
#

is your overlap event in the weapon or something?

stiff nebula
#

yes

elder sage
#

just do it the other way around

dark edge
#

Convert world space to hex, and vice versa

fluid summit
dark edge
#

Nah the math is simple

#

Depends on your hex coordinate system

#

You got 2 coords or 3?

fluid summit
#

offset with 2

dark edge
#

Ya

#

You'll want the world space - rounded hex coordinate function anyway

fluid summit
#

yap, i still would like to know why it's not hitting on the client. but i'm gonna leave that for later

stiff nebula
# elder sage just do it the other way around

im not sure how i'd go about that, the way i have it set up right now is that when i press fire it goes through an event dispatch (On Use Item) and then firing is bound to the weapon like so

stiff nebula
elder sage
stiff nebula
#

is that just ass backwards or something, i took the blueprints from the firstperson shooting example

elder sage
#

in theory you only need to set the owner one time when you get that weapon

#

like the other guy was saying, "Owning Client" only functions if it's the local Player Controller or something owned by it, meaning you have to call from your Character (is owning client) to set the owner of the weapon, otherwise it won't work

stiff nebula
#

okay, i think i understand that

#

so it's fine if i call the event from the characterbp even if the event is created on the gun?

elder sage
#

that's from the network compendium in the pins btw

stiff nebula
#

oh cool, ill have a look at that

fathom aspen
#

What do you mean by replicating its timer? Timers are not replicated. Also are you persisting the scene capture inside that function?

split siren
#

Any idea why APawn::OnRep_Controller not triggering when Player unpossesses a pawn? (In another words, when Controller changes to null)

fathom aspen
#

OpenLevel is never a seamless travel

#

You need to make sure the actor of type ASceneCapture2D is persisting

#

Inside AGameModeBase::GetSeamlessTravelActorList

#

I mean TimerManager should be handled using UWorld which is destroyed on level change

#

This piece of code is making me think otherwise

#

If it's handled by GameInstance then yeah it persists without further notice

#

Nope. World.h

#

Wait I don't think I'm quite getting what you do?

#

Are you firing a timer?

#

Oh then that's not what I'm referring to

#

But it could be actually. You have to look at source to know

#

But most probably they are. I mean how else are they are doing this timer xD

#

I see. That's not my territory ^^

#

So this PostProcessing volume is placed already in the level you are traveling to?

#

I'm not quite sure how the backend of it works
You have to look into this

#

Really no idea

#
/** Time in seconds since level began play, but IS NOT paused when the game is paused, and IS NOT dilated/clamped. */
    float RealTimeSeconds;
#

This is what it returns

#

So it's since level started

#

Not whole game

shell forum
#

Strange...

fathom aspen
#

Yep

waxen patio
#

hello everyone who reads this im ryan and im looking for some help i know how to make hacks and im looking to help the game devs stop people using hacks obv we can use eac but is there a way i can make the hacks and they ither get patched or it gets implemented into a anticheat (please @me if you reply)

fluid summit
#

Hi, it's me again with the chapter 93 of "why the hell my hexagones are not collisioning on the client"
i'm doing a linetrace to check and it just goes through the hexagones without a care in the world. It hits okey on the server, but not on the client.
Do i need to setup something else for the collision to be replicated?

#

Currently this is how i'm adding the hexagones to 1 single actor

#

SOLVED Finally: The collision type was changing when being added on the client side, for some weird reason.

faint parcel
#

I have been storing team colors (what team has what color) in my custom GameState class, but I'm running into a replication order problem on the client in multiplayer, as the character tries to get the team colors before the GameState class is replicated (I assume).
Is there a better place for these team colors to be?

#

I would rather not store them on the character itself, as it might be used elsewhere.

acoustic drum
faint parcel
#

I assume the team color is replicated with the GameState but I think too late. The Character tries to look up its color by its TeamID and finds that the GameState is null.

latent heart
#

If the game state has been replicated, though, it should have all its properties replicated already - unless it hasn't replicated the changed properties yet.

acoustic drum
latent heart
#

You can indeed.

faint parcel
#

Oh well I have an OnRep_TeamID but that then tries to find the color in the GameState which, on the client, is null.

acoustic drum
#

Is your TeamID not in your gamestate?

faint parcel
#

Each Character can switch teams during the game, so they have a TeamID property.

acoustic drum
#

I think you should have an OnRep for your gamestate instead

faint parcel
#

That then reacts to TeamColors changing, and applies them to all characters?

acoustic drum
#

I'm not sure what you mean sorry

fluid summit
#

Change it on GameState (OnRep) = Multicast to all PC/PS -> Update colors for each team

fathom aspen
fluid summit
#

honestly i would change it on GameMode and propagate from there

latent heart
#

What would you put on game mode exactly?

faint parcel
#

I think I need the team colors stored on the clients, and GameMode is server only iirc

latent heart
#

That is correct.

#

GameState is the correct place for team colours / info

fluid summit
#

GameMode:
Team 1 = blue.
Team 2 = red.

Player:
Team: X
Color: Y

When team=color relationship changes on GameMode, grab all the players and tell them to update if they have that color

latent heart
#

That's not a good idea at all.

faint parcel
#

Then I'm storing it two places, instead of one I think.

latent heart
#

You want team colours readily available for everyone.

fluid summit
fathom aspen
#

You don't need to traverse players though

latent heart
#

Game Mode shouldk change colours, sure, but it shouldn't store them.

faint parcel
#

I forgot to highlight it, but the gamestate is null in this case on the client.

#

It's called from OnRep_TeamID (an integer)

fluid summit
latent heart
#

The "table of true" ?

acoustic drum
#

XD

faint parcel
#

Someone has a .png for this expression I'm sure πŸ˜„

acoustic drum
#

You either need to set up some sort of async that waits for gamestate to not be null or use an OnRep for gamestate

#

At least those are the solutions I can think of

fluid summit
# latent heart The "table of true" ?

Maybe i'm missing something on what your desired outcome is, but whatever "rule" you want, should be on the gamestate. and the others should acommodate for that

fluid summit
fathom aspen
#

Made by James

acoustic drum
latent heart
#

In my opinion (and yours may differ) the current state of things should be on the game state. The server still has authority over the game state. The game mode might store a list of team colours to choose from, but not the active state of the teams - it just mutates the gamestate from the outside.

fathom aspen
fluid summit
fathom aspen
#

There is a newer link to that system in this channel, but can't find it @acoustic drum

fluid summit
#

maybe there is the confusion.

latent heart
fluid summit
#

Map: Int(TeamID) - Color
or your custom ST.

fathom aspen
#

You would need to traverse players

#

PlayerArray in GameState

fluid summit
acoustic drum
fathom aspen
#

Though I find it awkward that I have to travers players each time a new color is set when I can literally replicate that property

latent heart
#

I don't understand why you just don't have an array of FMyTeamInfo on GameState which has {Name, Color} or whatever

#

Replicate that, done

fluid summit
#

Correctme if i'm wrong, but you want a 1=1 relationship of team->Color globally.
And players can change teams or teams can change colors during the game, is that the intended behavior?

acoustic drum
latent heart
acoustic drum
#

Associate names with colours

#

When all it has to do is replicate teamID with colour

faint parcel
#

Not sure I want the players switching teams/colors, just the characters they can take control of.

latent heart
#

Because the server is "doing it" once at the start of the match and then never cahnging again.

acoustic drum
#

It is changing

fathom aspen
acoustic drum
#

Since players can swap teams

latent heart
#

And it's far quicker to replicate the change of colour, if it does change, once in the game state than to potentionally 50 to 100 players individually

#

The player's colour changes when their team does

fluid summit
#

and if a team color changes?

latent heart
#

There is no need to change a "colour" specifically when a plaeyr changes team, you just change their team id - 1 replicated uint8

fathom aspen
#

Then the change gets replicated to players and set accordingly in the OnRep

latent heart
#

Then you just change the colour on the gamestate and it's replicated?!

#

Then every player on that team changes colour automatically.

fluid summit
acoustic drum
#

I thought your plan was to send an array of peoples names and associate their colour with the name

latent heart
#

You cannot replicate a game mode

fluid summit
#

if a player changes their teamid --> Go to gameMode and grab the color for that

fathom aspen
#

You can't replicate stuff that exist in GameMode

fluid summit
#

sorry, replication is not the word. propagate would be more adecuate

latent heart
#

Why use the game mode at all? Game mode is for logic, not storing state.

fathom aspen
#

Again why would you traverse all players and do it for each one separately?

latent heart
#

I mean, you can store some non-replicated state information if you want, but everything that's repliated, like team colours, should be on game state.

fluid summit
#

if you store it on state, you have to go to all states and tell them the new relationship team=color.

latent heart
#

You do. And the easiest way is to replicate a single variable on the game state instead of doing it to every player individually.

#

An RPC to each player will be less efficient than a replicated variable on the game state.

faint parcel
#

I just want to inject that I find all of this very interesting πŸ™‚

#

(and I'm taking notes)

acoustic drum
#

I guess if you can associate players ID with colour and not resend the same array everytime (only the elements that change) it isnt so bad

fathom aspen
latent heart
acoustic drum
latent heart
# acoustic drum I must be misinterpreting this
struct FMyTeamInfo
{
    FColor Color;
    FText Name;
}

class AMyGameState : public AGameState
{
    TArray<FMyTeamInfo> Teams; // Array index = team ID
}

class AMyPlayerState : public APlayerState
{
    FText Name;
    int32 TeamID;
}```
plucky prairie
#

Anyone had issues using the gameplay messaging subsystem when running as a listen server or in standalone mode? Only appears to be working when connected as client, is this normal?

acoustic drum
fathom aspen
#

Teams are part of the GameState no doubt. Whether you make a subsystem for Teams, whether you make it an actor component that gets attached to the GameState, or it's a simple struct property that is inside GameState, it's always in the GameState and it must be replicated in order for clients to know about it

latent heart
#

Yeah. I'm sure it has some sort of system. That code is a very basic example.

fathom aspen
#

Lyra has a TeamSubsystem if I'm not mistaken

faint parcel
#

Let's say I have it on my GameState (as I do), what would be a good way to get my Characters colored based on their (potentially changing) team?

latent heart
#

There's some sort of friend/foe thing in the AI system too, which has the idea of a team.

faint parcel
#

(while avoiding the startup issue of a null GameState on the client)

latent heart
#

Add an OnRep to the gamestate's Teams array

#

When that fires, just update your local UI/etc.

#

Before it fires, you're "not on a team."

faint parcel
#

Yeah I'm lightly using the AI system's idea of a team.

#

(interfaces iirc)

latent heart
faint parcel
#

No team name atm, so just an array of colors.

#

indices being team IDs like you also suggested

latent heart
#

I would create a struct and place your color inside it.

#

It iwll make extended it easier later.

faint parcel
#

Yeah just to have it encapsulated.

#

Sounds good

twin juniper
#

Got an issue where my boolean is not replicated at all, at least the OnRep is not executing, i got the UFUNCTION above my OnRep in the header, i set it on the server and it's transient so initialized to false by default

#

ItemEntry is also using an OnRep and it getting replicated without any issues

latent heart
#

Transient is initialised to false by default? News to me.

#

Always initialise your variables

twin juniper
#

i'll try to initialize tho

latent heart
#

Transient just means it won't be serialised.

twin juniper
latent heart
#

In debug configuration maybe, but that's nothing to do with being transient.

twin juniper
#

That's what someone explained me a few years ago here, since there is no real documentation about transient πŸ€·β€β™‚οΈ

fathom aspen
#

The only documentation I can find:

latent heart
#

Zero filled at load time doesn't mean zero filled at instantiation time.

fathom aspen
#

Still I would initialize just to be sure

twin juniper
#

It does not replicate 😐

#

And if anyone ask, i'm using Live Coding yes

twin juniper
latent heart
#

Try a complete recompile outside of the editor.

twin juniper
#

already done

#

i did it at least 10 times since x)

latent heart
#

Have you added a breakpoint to a) where you're setting it to true and b) in the OnRep function?

fathom aspen
twin juniper
fathom aspen
#

My wild guess: Something else is setting that boolean to false, faking you into thinking the OnRep it's not called

#

Watch the boolean property when you debug and make sure it stays true

twin juniper
#

it only getting set one time

#

in the code i showed above

#

the first one is in the constructor

twin juniper
# latent heart Have you added a breakpoint to a) where you're setting it to true and b) in the ...
#

that's where i saw that "Transient properties are always initialized to zero"

#

a few years ago

latent heart
#

He's wrong.

#

On some parts.

#

I could absolutely see a need to save "CurrentHealth" to disk.

#

It's a terrible example. 😦

twin juniper
latent heart
#

I'd say transient variables are for temporary, runtime-generated values. Derived values. That sort of thing. Things you can generate from other serialised data or things which are by their very nature ephemeral, like sockets.

latent heart
#

That's just sigh

fathom aspen
#

Believe it or not, I was given this thread as an example when I asked what transient means a few months ago in #cpp

#

I was definitely dietered

twin juniper
fathom aspen
latent heart
#

Yeah.

shell forum
#

So apparently you can reset the game time during seamless travel if you override the UWorld::InitializeActors() method with bResetTime. Need to figure out how to do it in BP though…

fathom aspen
#

Didn't you say you are seamless traveling?

shell forum
#

I am.

fathom aspen
#

Ah ok so in seamless bResetTime is set false?

shell forum
#

I believe so

fathom aspen
#

Yeah looks like so

#

Good luck modifying the engine πŸ˜„

shell forum
#

Could I just run a function to reset the world time manually from C++ in GM beginplay?

latent heart
#

That post about CurrentHealth angered me enough to actually log in to that page and post a reply.

#

Reset the world time?

shell forum
#

Not entirely sure what it is

#

Whatever the time input node is using in the material graph

#

It’s persisting with seamless travel

#

But not with OpenLevel

fathom aspen
#

Sick. That makes it more accurate right? No flaoting point issues and such?

fathom aspen
twin juniper
latent heart
#

Did you BP the CallYourFunctionTHing() or the if statement?

twin juniper
#

yup

#

it does not get reached at all

latent heart
#

That's not a yes/no question.

#

Are you sure that the debugger is actually looking at the rigth instance of the engine ?

twin juniper
#

yeah i attached it to the good instance like usual πŸ€·β€β™‚οΈ

#

but i'll try to debug it more i guess, i don't have other choices

#

Fixed my issue by removing intermediate folder, regenerating files and doing a complete recompilation of my project

#

so i guess it was a serialization issue ? on a transient property πŸ€”

#

Is there a way to get an actor out of dormancy only for one client ?

latent heart
#

Well, the problem was definitely transient!

twin juniper
latent heart
#

Relevancy is how you specify who an actor is relevant to. I'm not sure how/where the engine decides that beyond the rep conditions method.

#

There's distance culling, I know that!

fathom aspen
fathom aspen
#

You've also got Dormant_Partial in the dormancy settings. In this case though, it would load on client but won't send updates

shell forum
#

Found the culprit...

fathom aspen