#multiplayer

1 messages Β· Page 637 of 1

odd iron
#

If you have an idea can you explain it to me when you have time please

vivid prawn
#

hi guys, does anyone know why when updating Character Movement properties in construction won't update for client? but if it's in BeginPlay it update on both Client and Server

peak sentinel
#

@odd iron Why you are using integer anyway for seats

#

Are "seats" actors?

odd iron
#

@peak sentinel nope they are just scene components

peak sentinel
#

I tried to read the question multiple times but couldnt understand what exactly is the problem but I feel like using integers is a bad idea, I would have a base vehicle pawn and seat pawns attached to it, and let player characters attach to seats then possess them

#

All seats have a reference to base class so every player in the vehicle can access / interact the vehicle

#

If you would like to speak more about it you can send me a DM, I guess we are speaking the same language

plush shoal
#

Heeeelp meeee

#

When I join a session it shows the level for a frame then goes back to the default level.

distant wave
#

UEnum::GetValueAsString(GetNetMode())

error LNK2019: unresolved external symbol "class UEnum * __cdecl StaticEnum<enum ENetMode>(void)" (??$StaticEnum@W4ENetMode@@@@YAPEAVUEnum@@XZ)

#

I am trying to print the net mode on the screen but something's wronh

#

wrong

kindred widget
#

You're either missing an include, or a module.

distant wave
#

maybe, but I think it is GetNetMode related

#

oh

#

I already included #include "Net/UnrealNetwork.h"

#

and GetNetMode is located in Actor.h so that doesn't matter

#

thing is that this works: UEnum::GetValueAsString(GetLocalRole())

kindred widget
#

@distant waveActually, this might be a UE4 issue.

#

Missing UENUM() marker.

distant wave
#

oh damn

distant wave
#

Does enabling Component Replicates on a Physics Constraint Component do anything significant?

ancient badge
#

Hey Guys, i have a question about servers.
I'm making kind of a puzzle/card game. I have different cards/puzzle pieces that i want to store on a server. So all players can access them. My Game is based on 1vs1 maybe 1vs1vs1vs1 rounds. So would a Dedicated Server be better or one where Player Host the Session?
When i understand it right, i don't need an extra Server when i use the Player as the server.
But when i have something like a Leaderboard, can i store that on the same server as my cards/puzzle pieces?

ancient badge
#

Wouldn't my Cards need to be worldwide to? Where is the point of using a server to store data when you don't use it for worldwide?

woven hazel
#

hey guys I am new to multiplayer programming, So my question is what should programmed on player controller and what should be programmed on player charecter

kindred widget
#

@woven hazelNo one is going to be able to answer that question without more specifics. That question extremely highly varies between game types, design styles, etc.

woven hazel
kindred widget
#

Movement should usually go in the pawn it's associated with to avoid unnecessary logic branching. If you have different pawn types and you put it in the controller, you have to check which pawn type before doing it. If you put it directly in the pawn, the controller never has to know what type it's controlling and the controls will work independently.

woven hazel
tough pumice
#

Is there something special that you need to do in order to get "OnRep_Instigator" to be called

winged badger
#

have the Actor replicated

kindred widget
#

@tough pumiceBlueprint or C++? If it's blueprint, just set the variable somewhere, and make sure that the object is replicated, and if it is a component, make sure that the actor it's on is also replicated. The same applies for C++, but the server also needs to call the OnRep manually too.

twin juniper
#

Am I setting up this server travel correctly. Its the correct file location, seamless travel is enabled, and the node is being called, but it doesnt do anything.

tough pumice
#

I forgot to call super on GetLifetimeReplicatedProps doh

kindred widget
#

@distant waveI would wager it won't do anything other than make the component replicate. A quick search in the PhysicsConstraintComponent.h shows nothing is marked replicated. And on top of that, physics things are generally regarded as not network friendly. If you wanted it to do something with network, you'd likely need to subclass it and do that stuff yourself, or make an actor that handles that stuff for you based on replicated conditions.

distant wave
#

Alright, thanks!

crystal crag
#

Anyone know if world composition in multiplayer is viable with the latest ue build?

quaint coyote
#

I had just a quick logistical question for a multi-player function i wanted to implement. I want to add a money and xp system to my multiplayer game but I dont really know what the industry standard is for doing that. Do most games have a database server with which players values are stored in?

foggy idol
#

how do I quick a player from a session in BP

foggy idol
#

and validated then updated as necessary

narrow leaf
#

Hi! I have a little bit of problem with the actors position. When someone join to a started game, the actors are floating in the original position, and the physic is not working on the actors (in the client), just if the client interact with them. Any idea? The bug doesn't exist in the editor, just in the builded game.

amber ore
#

How are you replicating actor positions.. a movement component or an RPC? @narrow leaf

normal ermine
#

what do the little diamonds on some of these lines mean?

thin stratus
#

Check if the source has something about them

#

Might just be me failing to copy it properly

lusty sky
#

i guess its composition if uml

thin stratus
#

THey usually describe relationships

normal ermine
#

nothing on the source apparently, but i'll keep looking

thin stratus
#

Does it look the same?

normal ermine
#

yeah it's just a circle instead of a diamond

thin stratus
#

I don't really have an explanation atm. Might actually remove them in my version. The important part to take away from it is what exists on which player

normal ermine
#

but it seems to be composition indeed

#

looking at it now

thin stratus
#

The line itself is how they are referenced

#

So you can access all the playerstates in the GameState

#

But you can't actually, at least not directly without GetGameState, access teh GAmeState from them

#

Controller usually has a ref to the pawn it controls and other way round

#

Controller has a ref to the hud and the playerState, where the owner of each is the controller again

#

And the Widgets inside the HUD is preference

normal ermine
#

i think it's starting to click now

#

thanks πŸ™‚

thin stratus
#

Yeah, again, if you ignore the lines and numbers, it becomes a bit simpler and it's mostly about that GameMode only exists on Server etc.

normal ermine
#

got it

dark edge
#

@normal ermine you can read diamond as Contains and the numbers are if it's a 1 to 1 relationship or 1 to many

#

There is 1 GameState and it contains the many PlayerStates

#

There is 1 of each PlayerState PlayerController and Pawn associated

#

PlayerController contains the 1 HUD which can contain many UMG Widgets.

thin stratus
#

Yeah, but the Controller Pawn and Controller PlayerState would also need one then :D

muted perch
#

How do I add a widget to all clients on a listen server?

warped berry
muted perch
#

well multicast runs on the server, UI is client only

warped berry
#

multicasts will execute on all connected clients, if they are called from the server

unkempt tiger
#

Does anyone have any insights/wisdom to share, in regards to how to manage a predicted state with a non-predicted state?

For example: imagine you reload your weapon. The reload process is completely predicted and undergoes syncing by replaying inputs. But as you reload, you consume an item in your inventory, which is not predicted (it's just a fast replicated array). All is fine until you perform a resync by replaying inputs - during which when you try to consume the inventory bullets again, the 20 bullets you had before are now 0, which means you couldn't reload during the resyncing process, which means a jitter until you fall back into sync

#

This has me pretty stumped, I'd really appreciate all kinds of input

vivid seal
#

when you say "undergoes syncing by replaying inputs," could you explain a little more?

#

do you mean like the character movement component's system of replaying saved moves when corrections are receives

#

received*

unkempt tiger
#

Basically that, yeah

#

(although I dont use CMC, but my own system, it's still the same ideas though)

vivid seal
#

so you predict using your item in this scenario, but when replaying moves you can't "unwind" the item usage to restore it and use it again?

unkempt tiger
#

Yeah exactly

#

Because I don't do all that fancy prediction stuff for big things like inventories

vivid seal
#

im trying to figure out how you would end up in this scenario. you wouldn't actually use the item client-side i think, you would just check it exists, then when the server goes to reload, it would actually use the item, but then you wouldn't have to ever replay the reload input since the server confirmed it happened, you usually only replay inputs the server hasn't acknowledged

however i dont have the details of your system so i could be missing something

#

ah wait sorry brain lag

#

yeah, you would have to avoid using the item on the client side in favor of just checking it exists and only actually using it server-side

unkempt tiger
#

no problem, I had the exact same thought process first

vivid seal
#

the only issues would arise if you tried to use it twice before the server confirmed the first use, which would lead to a rollback

#

either that or you need to save some kind of state with your client moves, so that when replaying them you can rollback your inventory as well, but that would get fairly complicated fast

unkempt tiger
#

Yeah, maybe some kind of message system?

#

A 'if you're resyncing on tick 37, you actually have 20 bullets here so use that' message, that is placed during prediction and read during resync?

vivid seal
#

yeah that's basically what i meant by saving some kind of state with your inputs

#

you could even just have the server send its state when confirming a reload or whatever "your reload succeeded, you have this many bullets and this item in your inventory at this timestamp", then every that is resynced after that would start at that base state

#

its a little vague because it really depends on what all you're syncing here and how much you want to save, but the general idea is that you need some information on what things looked like when that input happened the first time

unkempt tiger
#

Yes! Awesome

vivid seal
#

even if you're not using character movement (its not related, functionality-wise, to this) i would still try and read through how FSavedMove works and the way unreal deals with replaying movement inputs, its specific to movement but the concept is the same for any kind of prediction/rollback/sync system with inputs

#

i did my ability system using the same idea as what they did with character movement, having all my resource usage and ability cooldowns based on prediction from a given server state

unkempt tiger
#

Did you ever tackle a similar inventory problem?

vivid seal
#

i am not doing a game with inventory, so no not that specifically

#

but the concept is a very common issue with multiplayer

#

and its not an easy problem either

unkempt tiger
#

I still remember my bullet count jittering when playing half life 2 deathmatch and reloading weapons lol

#

Thank you very much for your help, you just un-stumped me 😍

vivid seal
#

best of luck with it

#

πŸ™‚

warped berry
#

Does anyone have any idea why ServerTravel does not remove UI widgets when it loads the new level while using Seamless Travel?

mild lynx
#

I'm fairly new to setting up multiplayer. Is there a way to send event tick information across the Server?

#

I could also be doing this totally backwards, but I am curious to know lol.

mild lynx
#

I think I found the problem. I misinterpreted what I was seeing.

#

Event tick on Server is working just as it should

#

Object kept hiding on tick for just server, so it looked like it didn't work

quartz smelt
#

Do player controller variables not persist on joining a server? Trying to use it for a character select, but nothing's working

thin stratus
#

No they don't

#

Nothing despite the GameInstance persists joining or leaving. Or generally hardtravels

#

@quartz smelt

quartz smelt
#

Cool thank you! @thin stratus

empty bluff
#

For multiplayer scenario, with a standard widget based inventory where each client has their own inventory that is saved on each clients PC.

If i have a pawn and a pickup, how should the sequence be when walking over it? OnOverlap check HasAuth and then call Pawn and ask Pawn to destroy the Pickup and then call Owning Client with info that he picked up the Pickup item, so it's reflected in the Client's inventory?

#

or is this kinda going over the river to fetch water?

#

thing is, i would like the server to "guard" or govern who gets an item in case two people walk over it simultaneously, while at the same time have each client keep track of their own inventory without having to store it on the server (guess something like a classic listen server+clients scenario).

plush shoal
#

hELP

#

caps

wary wyvern
#

Guys, is there any good docs on how replication of objects/properties works?

wary wyvern
#

@hollow halo Thx

plucky prairie
#

is there a standard for where to place functions? I have the player controller and player character, for things like line traces / dmg text / HP etc. is it better on one or the other?

pastel marlin
#

I usually refer to this when I want to know where to put things

#

for example if you have your hp on the player controller only the server and the owning client of said controller will know how much hp left you have

#

it could be okay or not depending of your game

#

On my project I have the hp on the pawn so when the pawn die i destroy it and spawn a new one without having to reset things on the previous one

#

page 9 of the pdf to be more accurate

#

you have a diagram telling you which class is present where

thin stratus
wary wyvern
#

@thin stratus Yeah. I just finished the pdf @hollow halo sent me, but it is about how to use it. I want to know the background of it.

#

Like how does actor replicates. How do Array gets replicated and stuff like this

pastel marlin
#

Didn't realize the author of the pdf was on this discord big thank you Cedric it is a really helpfull document

wary wyvern
#

Yeah, great pdf, btw πŸ™‚

thin stratus
#

No biggie, glad it helps

#

But yeah, if you want to know more of the inside workings, you will have to read through the engine

#

Some stuff you can find in the PackageMapClient or so

#

That's the thing I looked at last, where the Client gets the replicated objects and actors and spawns them etc.

#

I guess if you start on the netdriver where the packages come in and go from there, you already have a lot to explore

#

It helps having some simple spawner or actor in an empty level to be able to breakpoint stuff

#

And then just stepping through it

peak sentinel
#

For projectile only weapons, whats the best way to handle prediction?

#

If ping is not higher than a given value (125ms) I just fire a fake projectile on client but if latency is high I dont know how to handle lag compensation

wary wyvern
#

Found this video.. More details about multiplayer..
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
#

@peak sentinel The one way is to spawn projectile on client as soon as player press fire button. Then you can leave it as is, if client projectile is not so relevant and more like a visual, or you can switch it with replicated version as soon as projectile gets replicated. But it is not good for weapons with high firerate..

peak sentinel
#

Yup, I guess also thats what UT does, right?

wary wyvern
#

Visual projectiles are ofter just an FX effect

#

And the server does the real job with line traces or projectiles

peak sentinel
#

But it is not good for weapons with high firerate.
Sadly I have choosen a cursed game design and my angle is top down, so even my automatic rifles are firing projectiles

#

Sometimes fire rate is even 0.1s

wary wyvern
#

Well, with weapons with bullets we use delayed line traces

#

Or a single line trace for a pistols or smg's

#

And we do them on owner client, by the way. Deal damage on client and server just verifies it was not fake. That way client get's best experience, but he is not able to cheat as server checks all the stuff.
Other clients simply play FXs

peak sentinel
#

So I should only send server RPC for starting a timer for my weapon to shoot and shouldnt care about anything else?

dawn kite
#

Hey, does anyone here have experience with aws gamelift and cognito?

surreal plaza
#

I am working a way for players to build robots and am trying to figure out how to best architect it. The individual robot components are piece by piece by the clients and the pieces are verified server side before they are instantiated. The question I have it 2 fold.

  1. I had planned on sending basically a string description of the component along with component specific parameters to the server. Something like {Socket}/{ComponentType}/{ComponentProperties}
    SHOULDER/CANNON/ROTATION=10,PRELOAD=TRUE

The different object types would have VASTLY different properties. The server would validate this string for the request and spawn the relevant object and attach it. Then...

  1. These instructions could be strung together into a recipe for a given robot that can be reused, shared, etc.

How does that generally sound? This is without using any formal serialization.

pastel marlin
surreal plaza
#

How so? Is there a way for the user to just build the object locally and then request that the server instantiate said object?

pastel marlin
#

I imagine you have different slot were you can put different part depending on what you want on your robot

surreal plaza
#

Right.

pastel marlin
#

so you have a struct robot which for each slot contain a struct describing the part

#

you send the struct robot and the server instantiate it

#

and if you wan't to share it as copy paste string you serialize as json or something like that

surreal plaza
#

I wonder if I even need that desc now. If I just have the server instantiate it (assuming that the network speed doesn't make this too laggy), then the user can modify the settings (which would also go through the server) and replicate everwhere that is needed. From there I could just serialize. The difference is that for the initial creation, I only need to send the type and socket.

pastel marlin
#

If you don't have per item customization one name should be enough to identify the part and a tag/name/index for the socket

surreal plaza
#

I do have per item customization, but that can happen after is it instantiated and replicated. In game, all clients would get the initial actor, and then whatever modifications happen to the component. From there, when I save the robot, it can just be serialized regularly. Right?

pastel marlin
#

If you have customization I would store them with the part and send them when you initialize them

surreal plaza
#

For example, they add a cannon, and they pay for a larger bullet (enum) type. That would be set on the replicated actor.

#

Right. I was thinking that initially, but that would mean creating a client side only actor, having them configure it, hold onto the config settings, and upon submitting it, get a replicated actor and delete my local one.

pastel marlin
#

work directly on the struct when you make a change and replicate the whole struct to instantiate a new actor and delete the previous one

surreal plaza
#

Got it. And is that for the sake of a snappier UI?

pastel marlin
#

No I did it like this for the sake of simplicity

dark edge
#

@surreal plaza my vehicle parts have a structure that contains arrays of integers, floats, vectors, booleans, and corresponding text for tool tips and other helpers for min max values. Works pretty well

#

So for a transmission, integer zero might be number of forward gears, integer one might be number of backward gears, the floats are the individual gear ratios,

surreal plaza
#

Oh, that is interesting. The cars are configurable then?

dark edge
surreal plaza
#

Yeah, same thing. Do you handle creating the wagon locally with custom components then ask the server to instantiate it? Or does the server instantiate upon start then updates are run through the server?

pastel marlin
#

if it help usegobos i can show you how i set it up

surreal plaza
#

I think I am ok with how to program it. I just want to ensure that it is performant and flexible.

#

It is surprising how little information I am finding on serialization.

pastel marlin
#

by serialization you mean replication or saving ?

surreal plaza
#

Saving. I was hoping that for completed robots that could be loaded from a local library, I could just do traditional deserialization from the disk.

pastel marlin
#

You can you just have to create a blueprint which inherit GameSave and put your structs in it

surreal plaza
#

I am assuming that works in c++ equally?

pastel marlin
#

what work in blueprint work in c++ but i did it in blueprint personally

surreal plaza
#

I am seeing some saved game info, but not as much for saving off an individual actor.

pastel marlin
#

you can't save an actor you can only save struct and base type

#

arrays of structs and base type work also

surreal plaza
#

Oh, ok. So by default I am limited to that. Do you have a tutorial or description of this anywhere?

pastel marlin
#

to save ?

surreal plaza
#

Or buzz words even.

#

Yeah, specifically struts and base types as part of a save game strategy.

pastel marlin
#

on your struct you also have to check what attributes you wan't to save

wintry forge
#

I have an inventory system that correctly replicates from Server to Client. My changes from the client aren't replicating to the server. I've decided to make Server RPCs to be called from the client. I get infinite recursion and a stack overflow.

I have functions such as

void DoThing()
{
if (!GetOwner()->HasAuthority())
{
Server_DoThing_Implementation();
return;
}
// does stuff
}
void Server_DoThing_Implementation()
{
DoThing();
}

HasAuthority() is returning false even though it's being called by a function called by a Server RPC (this is inside of a replicated component)

Does anyone know why this seems to be the case? Using GetLocalRole() has the same effect

surreal plaza
#

You don't actually use the "_implemntation" version of your method right?

wintry forge
#

ahh, sorry. I call Server_DoThing()

silent valley
#

I have a question about how to implement weapon accuracy in a game where the server trusts the client.
My client sends an RPC for each shot fired saying they shot from point A and hit something at point B. Server does some basic validation like: is point A close to the server location for the client? Run raycast on server, does it hit anything before reaching point B?
I added some code to randomise the shot direction the longer the player is firing, but how can I validate this on the server?

#

Changing to server authoritive is not an option.. maybe this is an impossible thing to validate.

pearl moon
#

Im confused as to why a server would not be the authority. Performance concerns?

hoary lark
#

@silent valley FRandomStream is probably the answer which you seek, though I have to echo the others' points too lol

silent valley
#

sorry, didn't see the replies.
I'm taking the fortnite approach where clients are trusted to a certain point, i.e. if a client sees their bullet hit someone then the server will apply damage.
Server does some validation to try and prevent wallhacks etc.

#

The server validation is the tricky part in this case though.

#

It makes sense to do some validation on the server, even if the client is claiming the ray has hit.
E.g. is there ammo in the weapon? is the fire rate within expected bounds, etc

#

I probably got the terminology wrong, I guess the server is authoritive, but it mostly trusts the client if they say they have hit something.

#

I think ShooterGame also does this

mild lynx
#

I'm using Get Player Controller and Get input key time down for Multiplayer, but it only counts up for other players, only the first player I suspect. How do I set it to be different depending what player it is

wild aurora
#

Do you guys know if multicast events are required to be reliable? If I declare a UFunction with NetMulticast but not reliable the compiler exits with code 6

#
UFUNCTION(BlueprintCallable, NetMulticast)

^ breaks

UFUNCTION(BlueprintCallable, NetMulticast, Reliable)

^ works

dark edge
eternal canyon
wild aurora
eternal canyon
#

no

#

or at least its not new for me

wild aurora
#

Ah wow, who knew. Thanks @eternal canyon !

#

I know in blueprints you can send an array via an RPC, is there a way to do this in C++?

chrome bay
#

Same way

#

MyFunction(const TArray<>& TheArray)

#

Has to be const-ref

wild aurora
#

Derp, ref, right, thanks! Mondays.

#

Well Monday, and stupidity, let's not get it twisted.

foggy idol
#

How do I kick players out of a match ?

#

in blueprints ?

quartz gorge
foggy idol
thin stratus
#

That should only work on local splitscreen players

#

If you want to Kick, send a Client RPC to them and make them leave.
Or destroy their PlayerController on the ServerSide

quartz gorge
#

Oh, my bad, yeah then I got nothing. I just realized I answered this in multiplayer. Will teach me to Discord from work.

foggy idol
foggy idol
hollow halo
#

anyone know why https://prnt.sc/12rnap4 doesn't run the event on the other blueprint? I'm doing a line trace which hits an actor in the level to determine the target. It works on the server but it doesn't work on clients

thin stratus
#

Ownership

#

One of the biggest, fundamental things in UE4 Multiplayer that you need to understand

#

You can't call a Server or ClientRPC on Actors that aren't owned by that client.

#

You have to perform the RPC in a ClientOwned Actor

#

Such as PlayerController, PlayerCharacter, PlayerState, or custom actors that have somehow a chain up to the PlayerController as the Owner.

hollow halo
#

I see, back to the books for now then thanks

thin stratus
#

Means you want to RPC and then perform the LineTrace.

#

And never have a ServerRPC to deal Damage, that allows cheating

#

Only inputs should be moved to the Server via RPC (+-). Server should then perform the action to damage, including all prep work, like LineTraces.

dark edge
thin stratus
#

You can always setup some prediction if you need that

dark edge
#

I mean I guess you could consider client side who detection with server side validation to be a form of prediction

thin stratus
#

Yeah

#

You can go all the way from trace to damage to changing the healthbar

#

And it's nice predicted,

#

But you will probably also run into some areas where you can't predict

#

And you gotta endure the lag

dark edge
#

The only difference would be the a hit doesn't happen unless the client thinks it happened. So the client misses out on errors in their favor if their view of the world is drastically wrong

thin stratus
#

Yeah there was a name for it

#

Can't recall, but basically that the corner peeking person is in favor with this

dark edge
#

Didn't they call it favor the shooter in a couple talks

thin stratus
#

Yeah same idea I guess

#

It all has pros and cons, but generally speaking you rather want the input to be RPC'd.

#

Also heavily depends on what kind of game you make of course

#

A highly tactical shooter like Valorant, probably needs a different solution.

#

Buuuut, even then, calling the RPC on the Enemy is wrong anyway :D

scarlet cypress
#

Wich way is less network heavy and better?

#
  • One RPC to spawn sounds with a "sound" and "location" parameter
#

or

#
  • Multiple sound spawning RPCs without parameters where each sound and target location is predefined
wild aurora
#

Will be a mix of frequency and size

#

If you can just do the sound by a simple int32 lookup and just send an FVector, that's not too bad

thin stratus
#

Are you hitting any limits that you need to optimize on such level?

#

Otherwise, stop bothering

#

The amount of data you can send now-a-days is usually covering most multiplayer games

#

Instead of optimizing single RPCs, you should use the Network Profiler and/or Unreal Network Insights to see what makes you reach your self-set bandwith limit and then optimize that part.

potent cradle
#

I remember a terrifying post about someone showing profiled data that indicated they were running into bandwidth saturation at 8KB per tick

thin stratus
#

Well you can set the limit in the ini files

#

Maybe that's the default value, not sure

#

It's way too low

potent cradle
#

If memory serves he tried all that but ran into issues. Was rather scary, made a bookmark just in case πŸ˜›

#

@floral crow shoutout and salute πŸ˜„

thin stratus
#

Hm not sure, last project I worked on had no issues on that front. Most issues were actually related to poor prediction handling via GAS.

hollow saffron
#

What is the recommended way to uniquely identify a player in a multiplayer game for persistence?

thin stratus
#

The NetId

#

Which is usually tied to the backend you are using

#

Or "OnlineSubsystem" in some cases

hollow saffron
#

FUniqueNetId? That's what I thought.

thin stratus
#

Yeah

#

E.g. for Steam that would house the SteamID of the User

#

If you aren't using any OnlineSubsystem, or any sort of "authentication" system, then you probably have a bad time persisting userdata

potent cradle
thin stratus
#

Well, for us it was about abilities that he player could execute. They were living on the player (client) owner GASComponent.
In theory it's pretty straight forward, you set the ability to be predicted and handle the ActivateAbility call as such.

#

Only thing that threw me off was the way the PredictionWindow works

#

Some latent nodes, like a simple delay, destroyed the window and the client stopped predicting GameplayCues after that.

#

Same with Timers

#

It helps catching problems early

hollow saffron
#

I found GAS pretty obtuse. I landed on Able

thin stratus
#

The one that Dan posted, or Tranek on Github

potent cradle
#

Yep, been using it as a bible indeed

thin stratus
potent cradle
#

Oh, what were his gripes?

#

I bought it before

#

But decided to go with GAS in the end

thin stratus
#

Can't say, never really talked about it with her. But she wasn't happy with how it was setup.
She was fighting it more than using it.

#

But could be just a different way of thinking I guess

#

GAS is also a struggle. It wants to replace the need of coding an ability system from scratch, sort of "Teach someone how to fish" wise, but it's also kind of a mess in a lot of areas.

dense narwhal
#

How bad did I mess up when repNotify just trigger on server when changed?

thin stratus
#

Depends on what your setup is

#

There are bugs with RepNotifies, not sure if only BPs but well

dark edge
dense narwhal
#

You know what.. the component was not set to replicate, that did the trick. Sorry to disturb you guys. πŸ˜„

empty bluff
#

where do i store a player inventory? PlayerController?

#

i thought of that too, but player state is replicated to all clients?

finite nebula
#

Does anyone know what Epic Online Services is? Do they offer free game servers or just the SDK to run on your own server? https://dev.epicgames.com/en-US/services

Epic Online Services

Scale your game and deliver the next-generation of connected and immersive social gaming experiences using our fully accessible and open service.

#

I'm an idiot, I didn't even realize that was a channel

#

Ok thanks. I personally like to code that stuff myself lol. I just need the servers

#

If any of you have experience with Unity, which game engine is easier to implement multiplayer?

empty bluff
#

in a respawn scenario where i want to respawn with inventory intact like in most rpg's easy mode, would playercontroller be ok to store inventory?

#

and playercontroller persists over level loads right?

finite nebula
#

What do u mean by that?

#

Is multiplayer difficult to implement with Unreal? I haven't started my project yet bc I'm currently picking the engine I want to use

#

Is C++ required to implement multiplayer? C++ is like black magic to me. I know how to code in like every other programming language though

lost inlet
#

it's actually not either of those things really

#

you can do multiplayer in BP, but if this channel is any indication, it's a painful experience

floral crow
finite nebula
#

Anyone know of a tutorial to watch for multiplayer/networking? Preferably blueprints, but CPP works too

#

Also would you guys say that multiplayer is difficult or just a pain in the ass?

#

Well thats convenient lol

upper lynx
#

evening everyone

#

what does this mean :

#

OSS: No game present to join for session (GameSession)

#

on PlayerController::BeingPlay, I call the GameState, which in turn calls the GameMode and assigns the PlayerController to a team

#

Everything works if you're the sever, or a single player

#

as soon as I spawn 2+ players, I get the above No Game Present error in the console

#

Is this a legit error to worry about, or can I ignore it?

eternal canyon
dark edge
#

@upper lynx that probably has something to do with play in editor automatically joining. It's probably trying to join the session that doesn't exist

narrow leaf
#

Hi! I had a similar question in the past. When I start a game, and the client join to the game, in the client vision the actors (static mesh actors) floating in the original game position. I use replication movement. The StaticMeshComponent is not replicated. Any idea to fix?

dark edge
#

Replicate the static mesh component .

narrow leaf
regal maple
#

I'm sitting right now on a fps game and thinking how I can do it with the accounts just store in a database? Log in? But how the whole thing in ue4 I have no clue how to build the whole thing. And then the problem with dying. I have a dedicated server there people connect to it so then the game starts at some point and how am I supposed to know who the player was that died? And by whom he was shot down.

Last question would be. I want to make a lobby like fortnite. Do I have to build a lobby server then? Or how? That the characters are there and everything? Because somehow they all have to stand there.

#

C++ btw

#

Not bp

vivid seal
#

any tips for fast-firing weapons? my ability system is all set up for predicting abilities, their resource costs, and their cooldowns, but with the caveat that they don't predict the actual cooldown duration, they just put the ability on cooldown and wait for the server to RPC back the calculated cooldown length. in trying to build weapons on top of the ability system, i run into issues if ping is higher than cooldown time, where you're actually unable to shoot until the server tells you your cooldown length, which is longer than the actual duration between shots. this is a problem for any weapon firing faster than 5-10x a second

silk abyss
#

Lobby is just another map where client have minimum controls of movement.(sometimes invisible and only let them do the menus)

silk abyss
silk abyss
regal maple
#

But wait

#

The problem is all players on one server

#

Dedicated server

#

And wait

#

When I will play with 4 friends I will only have the 4 players in my lobby and not the other 1000 on the server yk

#

Idk how I can make it

#

But I have one lobby map

silk abyss
#

Yes, same thing. You spawn a map for a lobby

regal maple
#

Idk how make that that I only have the 4 players

#

And not the 100

silk abyss
#

I don't know if you ever played mod like Rocket Arena in quake era

#

You can have like 64 players and still they go into their own subjection of maps

regal maple
#

The problem is I have a map. And there go all players on it and do not want to have all but only the 4 and in another lobby with friends also only the 4 but are all on one server you understand?

silk abyss
#

Depending on how you would implement world travel(aka switch maps)

regal maple
#

It’s hard

silk abyss
#

I didn't say it's easy, but eventually you will have to follow UE4's convention unless you are willing to code your own hosting/join framework

#

For UE4 you have to load a map after join a server.

regal maple
#

Sure, sure. Only how should I do that with the lobby map I mean many players are in the lobby only you should see only those who are in the lobby...

silk abyss
#

Say one server already have 100 and another just have 2. Traditional way is mod force transfer 2 teams to a different server once the match is done

#

So other server is populated.

#

(cause most certainly people will join leave between matche)

#

That you need some sort of database back end to do load balancing between servers

regal maple
#

I have a dedicated server. Now the problem is, you can play with friends and before the game starts you are in a lobby in the main lobby with the interface etc.. Like in fortnite where the 4 players stand. Now how do I do it that only the 4 players are seen who are with one in the lobby or party. And not the other 100 players

#

That’s the problem

#

How

#

I don’t have an idea how

#

Like that

silk abyss
#

That's custom implementation for party or team

#

Say you can host however many players

regal maple
#

I will only the lobby system how

silk abyss
#

If you load the map and assign them the lobby pawn , they will see exactly what you want to show them.(before the count down and spawn into actual map)

regal maple
#

Okay

silk abyss
#

Don't over complicated things, a pawn can be anything, not always the player character with fp or to camera

regal maple
#

Don't I have to spawn the players all one lobby? Actually, thousands of lobby maps must then be generated or not?

silk abyss
#

You can make them a static cam with a sphere if you want.

#

Eh, you probably need to read the multiplayer host join flow more

regal maple
#

Yeah ik but the problem is the 100 players on server and one lobby map and I will only see the players in party or I will see own lobby

silk abyss
#

You don't spawn thousands of maps

#

Player join and gets assigned to a map

#

It can be lobby only maps(aka the traditional queue waiting map before a match starts)

#

If can be a live match map but with lobby pawn

#

(say you are in a orbital room for character customization)

regal maple
#

Yes

#

Also a sphere like the fortnite picture

silk abyss
#

Yeah, so that is a specific place or standalone map before server transfer worlds(aka maps)

regal maple
#

But it’s not on Server?

#

The lobby map?

#

Or what

silk abyss
#

Everything is on server

#

Player just have the assets locally so you don't need to distribute those

regal maple
#

Ahhh

coral raptor
#

i have a rep notify variable on a widget. the rep notify is never sent to client. What am i missing ?

regal maple
#

But how render the other players lol

#

In Party

silk abyss
#

Lol, like I said, a lobby pawn

regal maple
#

Ok

#

It’s hard?

#

Haha

meager spade
#

@regal maple That screen there is the lobby, lobby is created by the party leader, basically becomes a "party"

#

when you find a game, it tells the matchmaking system, i have X amount of players in my party, find me a server

#

then it connects to that server with open level (fortnite does not use server travelling)

#

this is when you end up in the game on the start island (waiting for the other players)

#

the party persists, so when game ends, you end up back in the main menu with the party

regal maple
#

Yes yes but how can make it wait also I have a lobby alone with me so at start of game. Now I request a party join to a player so then I accept the party how render the other character yk

#

I will show up he in the party

#

In Screen

#

But other players will have Same a lobby with no player or party members

meager spade
#

this is not something you can do with less than 1 year UE4 experience in multiplayer/networking

warped berry
meager spade
#

no we use it in our game

#

just in fortnite they don't need to cause you are not in a game server when your in the party

#

so you have to connect to the game server, and you cant server travel

warped berry
#

aaah I see, thanks

meager spade
#

if you are connected to the server, then you can server travel between maps

warped berry
#

Im using steam subsystem, and I created separate map for lobby host to wait for others to join and then do a server travel to gameplay map

regal maple
#

Also now I can make it?

#

How*

warped berry
#

check the ShooterGame examples

regal maple
#

Is this hard in c++?

#

@meager spade

meager spade
#

you don't do everything in C++

#

you would use both BP and C++ to achieve this

regal maple
#

Uff Why bp

#

I hate bp

#

Haha

#

But what must I do in bp

meager spade
#

because that is what unreal is about, that balance between C++ and BP

regal maple
#

Yes

#

I must accept it then

meager spade
#

heavy lifting/framework in C++, rest in BP

regal maple
#

What you mean with heavy lifting

#

Must I write a own framework?

meager spade
#

no i was generalizing

regal maple
#

Ok

#

But I think it’s Hard

meager spade
#

it's not easy for sure.

regal maple
#

Mehhh

meager spade
#

i would focus on making a working single player game or very basic multiplayer game before doing any of this.

#

you seem to be well out of your depths

regal maple
#

But my problem is to understand the player handling but I have one map and 100 players but I will only render players on pods who are in party Xd

meager spade
#

i would not even do 100 players with your level of experience, no offence

regal maple
#

Or 10 players

meager spade
#

there is more to it than just this. Making it so the game even supports 100 players is a big thing

regal maple
#

Ok

#

Mehhh

#

I hate game development

#

I love web I think I switch

#

Game is to hard and I’m confused

meager spade
#

Sorry to hear that, but if you ever decide you want to, try https://learn.unrealengine.com and not make an ambitious game with no game dev experience. Everyone can dream, but with no knowledge/experience, that is all it will ever be.

regal maple
#

I can c++ but not ue

#

That the thing

#

Haha

#

Ue is Hard af

#

And the docs not so good for dedicated server btw it’s not so nice

meager spade
#

Yes, but knowing C++ != knowing Game Development. My friend works on embedded systems, he knows C++ a lot, but put him into game dev, he would struggle. He even knows that.

regal maple
#

Yes

#

That’s the thing

#

But idk

#

Ue is Hard

#

C++ Easy

meager spade
#

Anyway, if you want to continue discussing, #lounge as this is off topic now.

regal maple
#

Nono all good

#

I must learn

heady python
#

When i run script on an actor, it seems to run on every other actor, as if its multicast. Is there any way that I can only run script on a certain actor? In this case i only want to run script on the actor that overlaps the weapon

#

The script that is being ran (inside of the gun that I walked over)

eternal canyon
heady python
#

ty em

somber glade
#

When you use Server travel will the event "onpostlogin" still fire for every controller when the new map loads?

fresh chasm
finite nebula
hollow eagle
#

Correct, you need to build the engine from source.

#

There are no server binaries distributed with the launcher version. Why? Because Epic decided not to Β―_(ツ)_/Β―

finite nebula
#

Is it possible to run a server without building from source? Maybe through command line arguments?

#

UE4Editor.exe ProjectName MapName -server -game -log The wiki shows UE4Editor.exe is required. That doesn't make any sense

hollow eagle
#

Just pass those options to your packaged build.

finite nebula
#

So I would run ProjectName.exe MapName -server -game -log Instead?

hollow eagle
#

It's not technically the same as running a dedicated server binary but it's as close as you're going to get without building the engine yourself.

finite nebula
#

Wait so couldn't literally anyone who owns my game start a server through the command line? I wouldn't want that

hollow eagle
#

Yes. And that's why when building from source you can build a client-only version of the game.

#

Or server-only binaries (which is what a dedicated server uses)

finite nebula
#

can you build client only in the launcher version?

hollow eagle
#

No.

finite nebula
#

Well fuck to this. I'm going to download source code then

hollow eagle
#

The only variant you can build includes both client/server code.

finite nebula
#

That seems just completely stupid to me honestly

hollow eagle
#

Epic assumes anyone really needing the additional configs should be using source anyway.

#

And so they only ship a single game config.

finite nebula
#

Yeah but think about it. I don't want anyone random to just be able to run a server

#

I guess they wouldn't be able to connect to it tho since they would need to edit the source code of the game

hollow eagle
#

You can pass options to connect to a server on the command line.

finite nebula
#

ok so they can literally just run their own server, thats bogus

hollow eagle
#

Again, if you're doing a true dedicated server setup you're probably better off using source anyway. The binaries shipped with the launcher version are just for the "easy" use-case, which is all features you'd get in the editor enabled.

finite nebula
#

How do I get this pop up? I linked my github to epic games

#

oh nvm it sends u an email automatically

nova wasp
#

Curious why the NP plugin uses MS in integers instead of floats for the fixed timestep. Consistency? It will fit in 16ms into 16.6666 ms for example which I assume will be fine but I wonder if the leftover half MS every frame ever causes issues...

fleet shard
#

Hey I have a really basic question

#

What gives a multiplayer (In blueprints) the functionality to operate two or more players using one set of blueprints? how do i, for example, give each player their own health?

#

you replicate the health right? do I assign it to multiple player controllers?

lost inlet
#

players don't know about other players' controllers

#

usually you have a pawn, with health, and that's replicated in the case clients need to know each other's health

pastel marlin
wintry forge
#

I have a "ContainerComponent" that does server RPCs. This works fine on my players, but on a replicated actor (Chest) it fails as that actor never hasAuthority.
I've tried setting the owner of the chest to my player pawn both through an rpc and locally and it still doesn't work.
How would I go about getting the Chest to be able to call these RPCs? (I.e. the server RPC should show them as HasAuthority true inside of the server RPC)

pastel marlin
wintry forge
pastel marlin
#

it is awkward for me to but i don't know any other way right now

wintry forge
#

From random things that I'm reading, calling SetOwner from the PlayerController/Pawn on the server for the actor should work. I wonder if anyone else has the answer for us

pastel marlin
#

never tried but it doesn't really solve your problem since it will work only for one player at a time and to make the switch you need to call a RPC to the server anyway

wintry forge
#

Well i can lock the container to one player at a time. I should be able to do the switch when I interact with the chest from the player (trying to debug what's happening with this method now)

pastel marlin
#

yep but that mean two player can't interact with the chest at the same time

kindred widget
#

@wintry forgeI solved that issue by always using the local player's inventory component for the RPCs. Client component does server RPCs, server version of it does distance/other checks, and does the transfer code. Then your client's inventory component, which I had mine on their character, does all of the inventory interactions, which works because that client always owns that component.

#

If you add some extra data to your RPCs, you can solidly allow multiple people to use the same chest at once, and the changes just get replicated back to everyone.

wintry forge
#

@kindred widget Thanks for that, I suppose I can change all the container functions to always interact with an "external" container component/its items (and always do the calls from the player's container passing the target container through. or make some ContainerInteractionComponent that only sits on the player and does all the interaction to the container

kindred widget
#

My usual RPC had FromContainer, ToContainer, FromSlotNumber, ToSlotNumber, ItemID, DesiredAmountToMove

#

Allowed me to write some pretty generic transfer functions by having both containers. The ItemID was to check if the item was the one the player wanted to move, just incase replication was slow for some reason.

wintry forge
pastel marlin
#

widget are only present on client so you can't call rpc on them

wintry forge
#

Thanks (wish this would show as errors in the log) I'll need to figure out why my component's RPC still isn't working though

pastel marlin
#

you need to check your component as replicated

dense narwhal
#

Is there anyway to remove the 'sweeping' of teleportation when teleport an actor?

Edit: by sweeping, i mean that the actor is moved to the location in a smooth movement, not instantly placed.

wintry forge
wintry forge
wintry forge
# pastel marlin you need to check your component as replicated

So i have the same problem, except i noticed that the server will work fine and update the when in PIE, but if the client is in PIE and server in standalone, then it doesn't update the client... And either way the local roles don't change when I call from doThing() to server_doThing . the RemoteRole is authority but local role is autonomous proxy

pastel marlin
quasi scroll
#

Hey guys, how would you implements an inventory system with states for the items (like durability, water level for buckets) that would be replicated? As UObject are not that easy to replicates, how can i have differents state classes for the differents items and still be able to replicate it

marble gazelle
# quasi scroll Hey guys, how would you implements an inventory system with states for the items...

Replicating UObjects is fairly easy, you just need some component to replicate them as their subobjects.
You also can write custom replication for this.
If you always have some values you also could use a general Struct that keeps a generic value which is interpreted differently, but since "Godobjects" should be considered evil, I think you want to go with inheritance => UObjects / custom replication.
Maybe as a first shot use UObjects and checkout ReplicateSubobjects

quasi scroll
#

So you would recommand me to have something like TArray<UItemEntry*> and implement custom replication ?

quasi scroll
marble gazelle
#

Well you need custom replication, if you don't use UObjects and ReplicateSubobjects.
If you want to use custom replication, you can use UStructs and store them as TArray<TUniquePtr<FMyStruct>>

quasi scroll
marble gazelle
#

well you basically just use UPROPERTY(Replicated) on the array, and then you need to replicate the actual objects, by implementing ReplicateSubobjects

#

since the Replicated on the array will just resolve the pointers basically

#

the objects them selves are then replicated by this subobject thing

#

that's why I usually prefer custom replication^^'

winged badger
#

TUniquePointer is an odd choice

#

or at least a very specific one

marble gazelle
#

why?

#

better than a rawpointer

#

if you want inheritence

winged badger
#

why would i even use pointers to structs for replication?

marble gazelle
#

if you don't inherit TArray<FMyStruct> is perfect match
If you have different subclasses

winged badger
#

don't think that that scenario is a little too complicated to serve them to someone who doesn't even know where to start?

marble gazelle
#

I just summed up the possibilities I have in mind, with the hint to start with UObject replication.

winged badger
#

i find fastarray to be a better choice for anything but the most basic replication

#

🀷

marble gazelle
#

fastarrayreplicaten still requires you to have smth that replicates

#

so if TArray<FMyStruct> or TArray<UObject*> is not working, fast array won't as well, if I didn't miss smth the time a checked the implementation.

winged badger
#

fastarrays main advantage is per item client side callbacks

#

something without i'd find the inventory UI pain in the arse to make

marble gazelle
#

yeah, I know^^ I implemented smth similar for some specfic stuff, but still, this won't help you, if you don't have smth that replicates as is

winged badger
#

it will generally replicate structs in item array out of the box, subclasses take a little more work

#

same as tarray

marble gazelle
#

so we are where we started^^ we either need custom replication, a godobject or ReplicateSubobjects with UObjects

winged badger
#

the replicate subobject be the simplest method here

marble gazelle
#

yep, as I stated at the beginning ^^

winged badger
#

@quasi scroll to replicate subobjects, you just need to override the objects IsSupportedForNetworking to return true

#

and in the actor that handles its replication override ReplicateSubobject function

quasi scroll
#

i see thanks!

winged badger
#
bool ASolsticeGameState::ReplicateSubobjects(UActorChannel* Channel, FOutBunch* Bunch, FReplicationFlags* RepFlags)
{
    bool bWroteSomething = false;
    for (UBotStatus* BotStatus : TeamBots)
    {
        if (BotStatus)
        {
            bWroteSomething |= Channel->ReplicateSubobject(BotStatus, *Bunch, *RepFlags);
        }
    }
    bWroteSomething |= Super::ReplicateSubobjects(Channel, Bunch, RepFlags);

    return bWroteSomething;
}
#

example of the 2nd one

marble gazelle
#

same for a component btw

winged badger
#

component has a caveat though

#

it will swap out the outer to its Owner on replication

#

even if it was set as the Outer on server when the object was created

marble gazelle
#

does that matter? either way the outer is the actor

winged badger
#

if you do NewObject<USomeObject>(this, ObjectClass);

#

when instantiating on server from the Component

#

Component is the Outer on server, but its Actor owner is the outer on the object that replicated

#

little landmine by Epic

marble gazelle
#

ok, so as long you don't assert on ownership, it doesn't matter since lifetime is the same. But still a good point, didn't know that^^ thx πŸ˜„

winged badger
#

@quasi scroll i put the Super call below in that function, so that Subobjects replicate before the member variables

#

if it was the other way around, OnRep_TeamBots would not have the BotStatus objects yet, it would just be an array of nullptrs

quasi scroll
#

thanks so much for these informations jussetLOVE

winged badger
#
    if (const UBlueprintGeneratedClass* BPClass = Cast<UBlueprintGeneratedClass>(GetClass()))
    {
        BPClass->GetLifetimeBlueprintReplicationList(OutLifetimeProps);
    }
#

and that goes into GetLifetimeReplicatedProps on the object if you want blueprint variables to replicate

errant vapor
#

Does anyone know when/how exactly network relevancy is tested?

#

If I make an actor dormant, or give him a very low netupdatefrequency, under what conditions does it test whether he should replicate to a player?

meager spade
#

relevancy != dormancy != netupdatefrequency

#

Relevancy is done by distance, so if viewer is outside the net relevancy range, then the actor would not be relevant

#

Dormancy determines if the actor should replicate or not. Awake = Always replicate, Initial = Replicate when loaded from package, but only once then go dormant, All = Dormant to all connections - Does not replicate, DormantPartial - Dormant to specific connections = Does not replicate to ignore channels.

#

NetUpdateFrequency is how often the engine considers a non dormant actor for replication for a connection.

errant vapor
#

Right... but if you imagine that at some random point, IsNetRelevant returns false for a player, what I'm wondering is when is it next called for that player?

meager spade
#

its called every time its considered for replication

#

as long as the actor is not dormant

errant vapor
#

which, if dormantAll, is never again?

brazen sluice
#

Hello!
Question, i have a mob BP that is replicated. Like every character I have to pan its mesh with half the height, because the capsule and the mesh are not on the same origin
Because the height depends on which mob it is, the resulting panning will be different
I use SetRelativeLocation in my BP to set that offset
The issue, is that because of network compensation, as much as it works on the server, the client cannot use that node.
Any idea of how I can do it differently? Being able to set offset on the client

errant vapor
#

youve already kinda answered my question... basically, the NetUpdate(through frequency or forced) does a NetRelevantFor each player

regal maple
meager spade
#

NetUpdate does not function does not work if the actor is dormant

#

you need FlushNetDormancy if it was dormant

errant vapor
#

true, but ForceNetUpdate does right

meager spade
#

no

#

ah wait

#

yeah it does actually my bad

#
{
    if (GetLocalRole() == ROLE_Authority)
    {
        // ForceNetUpdate on the game net driver only if we are the authority...
        UNetDriver* NetDriver = GetNetDriver();
        if (NetDriver && NetDriver->GetNetMode() < ENetMode::NM_Client) // ... and not a client
        {
            NetDriver->ForceNetUpdate(this);
            if (NetDormancy > DORM_Awake)
            {
                FlushNetDormancy(); 
            }
        }
    }```
#

it calls FlushNetDormancy

errant vapor
#

ahh, beautiful

#

so if my conditions inside IsNetRelevantFor changes(on the server), i can use forcenetupdate on the server version

#

to make sure its replicated to the now-relevant player

meager spade
#

sure

errant vapor
#

thanks!

brittle tulip
#

I want to add sprinting for my game but don't know what I need to override/add in my character movement component can someone give me some direction?

brazen sluice
dense narwhal
brittle tulip
# brazen sluice

that doesnt work because I keep getting it correcting itself on a dedicated server (I'm writing in C++)

regal maple
#

@meager spade So again about the lobby and the player pods. I would make it so a pod this can then get a character. And if a joint spawns he simply there. is that the way?

brazen sluice
dark edge
#

@brazen sluice why isn't that offset just already set in the BP editor? Are you using different meshes at runtime?

brazen sluice
#

Yes I am

#

Different mobs

dark edge
#

So a mob is NOT a subclass, it's just an instance with different mesh chosen at runtime?

brazen sluice
#

Yes correct

dark edge
#

Are all the meshes the same height or are they varying heights?

brazen sluice
#

Varying

#

(I also have the same probelm when I have a held item and they have different offset depending on the item)

dark edge
#

One way or another you need to calculate or store the mesh height. After that just set size based on mesh height and mesh position to be -Height/2

dark edge
brazen sluice
dark edge
#

But I subclass BaseItem for each Item and can manually adjust position if need be

brazen sluice
#

because network compensation revert it

dark edge
#

Apply it on server and it should replicate out

#

Assuming you have component replicating etc

brazen sluice
#

Well it doesnt πŸ˜„

#

The movement are replicated but the offset is missing

#

the mobs are in the floor

#

It only replicate if I set it in the editor

dark edge
#

Do you have replication enabled for the mesh component?

brazen sluice
#

But not with SetRelativeLocaaiton

dark edge
#

@brazen sluice how many different mobs do you have?

brazen sluice
#

X numbers, it's moddable

#

Right now I have like 6

#

( so presetting it is not really an option)

dark edge
#

And how do you get the mesh height, from a data table? Or do you calculate it from bounds

brazen sluice
#

From data

dark edge
#

Just apply it in the construction script

brazen sluice
#

Will it work on client as well?

#

Also will the data be replicated already?

#

Client needs replicated data to know which mob it is

dark edge
#

First double check that you have the replication settings correct. Should be able to just replicate the position of a mesh inside the actor. Do you have component replicates checked for the mesh component? And I'm assuming you have replicate movement check for the actor?

brazen sluice
#

Checking!

#

Movement replication was checked but not component replicates

#

I'll try with that one on

#

I just need a sec because the game is crashing right now when client connects πŸ˜„

normal umbra
#

Is there a way to change between offline and dedicated? Wen want to create the character without any replication to server, after creation we want to change to multiplayer. Is there a good solution for this?

finite nebula
#

How do I run the server without launching the game? Every single one of these commands runs an instance of the game alongside the server

sullen kernel
#

Just curious, if you have a very big level in a multiplayer game. Is there some equivalent of level streaming that works in a multiplayer game? Or a way to avoid loading the entire map into memory?

dense narwhal
#

Anyone else had issues with rotation on attached actors? I'm attaching an actor and it does not follow rotation of the "parent" actor.

edit: it's only for the attached actor client, the other clients see the rotation just fine.

pastel marlin
#

Where would you initialise HUD widget related to a pawn ?

dense narwhal
pastel marlin
#

The HUD is dependant of which pawn i posses

dark edge
#

@pastel marlin Controller has an OnPossess node, do it there

pastel marlin
#

OnPosses is run on server only if i am not mistaken ?

dark edge
pastel marlin
#

Am I guaranteed that if I call a rpc In OnPosses when the RPC arrive on the pawn its controller will be set up ?

dark edge
#

Not sure. I know there's some way to have an event fire when everything is settled in but I don't recall where or how

#
chrome bay
#

SetPawn() is the best place IMO

#

Using that in CPP and never had any problems with pawn possession

#

SetPawn is called once both pawn and controller have acknowledged each other, so shouldn't be any race conditions there.

dark edge
#

They're looking for a notify when pawn is changed clientside

chrome bay
#

SetPawn is called client side

dark edge
#

Ah so just override, call super, then call a BP event?

#

if theyre wanting a BP notify

chrome bay
#

If you really have to use BP for a multiplayer project then yeah I guess πŸ˜„

dark edge
#

I use BP all day every day lol. Love it. Not really shy of doing stuff in C++ but I prefer BP.

pastel marlin
#

I don't like BP but I hate the compilation time of cpp on my pc 😦

#

thanks adriel and jambax I will test the solution you have given

cunning condor
#

Anyone have any suggestions what I managed to break this time? This is on my local dedicated server.

odd iron
#

something like the location of the vehicle is not replicated

cunning condor
#

I'm clueless

#

it was working fine the other day

odd iron
#

check what you have changed last time before its broken maybe some events

chrome bay
#

Using Physics? Welcome to hell.

odd iron
#

haha

chrome bay
#

Server and client are out of sync, you're getting replicated updates about the position from the server back in time, so client keeps snapping back to old server position.

#

Should use client-authoritative physics if you want vehicles

dark edge
#

I'm of the opinion that if you're trying to do multiplayer physics, you should implement your vehicle from scratch instead of using the provided template, so you know what exactly can fuck up and why it might.

cunning condor
#

this is using chaos vehicles and letting clients decide is not really an option

dark edge
cunning condor
#

It was working just fine for the last 6 months

chrome bay
#

It's the only options if you're using physics

dark edge
#

No it's not, I have server authoritative multiplayer physics and it works just fine.

chrome bay
#

You've probably never tested with different client/server tickrates and/or latency before I'm guessing.

cunning condor
#

I usually test on a dedicated server in another country

#

was working fine there

#

this is locally

dark edge
#

I have, from different computers. I fine tuned the physics replication settings tho and I do NOT do any prediction.

cunning condor
#

server running on my pc

chrome bay
#

and I do NOT do any prediction that's the big difference

#

Server auth and no client prediction = input lag
Client prediction and server auth = sync issues

dark edge
#

well yeah, what happens with 2 client authoritative vehicles collide? Input lag is fine for my project, it's slower paced like rock crawling and tanks and such

#

I am most concerned with everyone agreeing on the state of the world rather than split second responsiveness

chrome bay
#

We use server auth with no prediction in HLL only because we have to but alos as vehicles are slow, but for games with faster vehicles the lag isn't really tolerable on a real-world connection.

#

Even CMC has trouble with client-client collisions

dark edge
#

Although in my case the only thing synced is the major transforms of the chassis and movable turrets. In my case the vehicles are player-constructed like Kerbal Space Program so there's no sane way to predict their behavior.

cunning condor
#

okay seems something is up with my editor

#

if i lock the framerate at 128 ticks its smooth as ever but it behaves like its running at slomo

odd iron
#

I have problem with movement when 2 clients riding same vehicle the passenger see different location for the vehicle

#

the location of vehicle in driver screen going normal on the road but in passenger screen going beside the road or falling under map

cunning condor
#

ok its defo running in slomo :S wtf

quick sparrow
#

@cunning condorI'm just curious, what was your vehicle solution? was it a pack on the market place?

cunning condor
#

It's chaos vehicles

#

building 4.26 from source

#

it's super buggy and crashes if you look at it wrong but the simulation is pretty good

#

though we spent some effort expanding it so we get more granularity over the variables during runtime

quick sparrow
#

Oh, chaos

cunning condor
#

now I just gotta figure out why my editor is behaving like it's set to slomo 0.2

quick sparrow
#

Hopefully they sort out Chaos in UE5.

cunning condor
#

oddly enough if i manually set slomo to 2 things run at normal speed, wtf is going on

hollow halo
#

Hey guys, any reason why the player on server spazzes out so much when im spectating a client's actor? I used set view target with blend to spectate the other actor. https://gyazo.com/cd911996ce32f29d1323cdf9aa53a1c7 It also happens on the other client, but it's not as bad :/

quick sparrow
#

You'll probably have to show the blueprints where you implement deltatime into the calculations, but then again I'm still a beginner @cunning condor

cunning condor
#

like it's behaving as if the entire simulation, not only the cars, are running at slomo

#

so its not specific to the cars

#

if i drop an actor its falling at 0.2 * normal speed

#

even the camera blends are running at slower speed

quick sparrow
#

look into substepping?

cunning condor
#

currently disabled

quick sparrow
#

substepping might fix it.

#

I've only played around with it a bit when I was doing my car project, it seemed necessary but that wasn't with chaos physics

cunning condor
#

substepping shouldn't affect things like camera blends or sequences though right

quick sparrow
#

Not sure.

#

If the camera is somehow tied to the rotation and movement of the car, it might?

cunning condor
#

we're not talking about the cars

#

particle effects are also simulating at slower speed

#

literally the entire editor is running in slow motion

#

FPS is solid

#

the rendering time is like 8ms atm

#

yet the entire editor is running in slowmotion

#

if you wanna get an idea of what i'm talking about type slomo 0.2 in the console, that's how everything runs atm

#

despite slomo being set to 1, so something funky is going on with time dilation

round haven
#

Hey,
Question about replication.

One Client has a VR connected and because of that, I'm spawning a pawn with "VR" enabled.
Another (Server) does not have a vr connected, so I spawn a pawn with "VR" disabled.

Now if the client connects to the server, the server doesnt know that the client is using VR and so he spawns the pawn with VR disabled.

Now how can I replicate this information (Client is using a VR Device?) Should I store it in the PlayerState? PlayerController? Do I have to make a specific setting?

silk abyss
#

What happen if I have vr connected but want to use regular pawn?

round haven
#

if you use a vr device and a regular pawn, it will now have proper tracking of your motioncontrollers.
Also if you have no vr and a vr enabled pawn, it will not properly track your movements and camera rotation

silk abyss
#

So you have 1 pawn but have different event/components base on what config player has right?

#

If that's the case, player controller seems a better place to hold the config

#

Since client have direct control over it.

#

In general, remember this simple rule, replication only happens one way from server to clients.

round haven
#

so the best bet I have is sending a RPC to the clients, asking about the vr state and then them sending an RPC back with the vr state and based on that, spawn the pawn?

silk abyss
#

So it's more like this, the player controller is mirrored on the server

#

When you connect to server you can query the controller (which pretty much represents player themselves)

#

Eventually when the server spawn the pawn that replicate to other clients, they can be spawned and set pawn config/flags properly

#

If you follow that simple rules above it would be more straight forward for your dev decision making.

#

Anything must happen on server for other clients to see that happen.

night tartan
#

Hey, I'm having a major hitch on an issue with replicating FSplineCurves, or any struct that may hold FQuat information. The NetSerialize on this is getting to an ensure on Q.IsNormalized and hiccuping every time, then runs fine after. Wondering how to fix this?

#

Not sure why this is an ensure, engine level, when it immediately just runs Normalize on the Q if it sees it isn't normalized. My struct then replicates fine, everyone gets their info, it's all happy... But I have this nasty hitch the first time it hits that ensure.

#

Using the debugger, it appears to be on the Arrive Tangent, when I'm replicating SplineCurves as a variable to be able to load up a modified spline for connecting clients.

winged badger
#

where?

#

because if you're testing in editor at least one of your clients has a mouse off screen

#

if your spline has to do something with that... it will come off weird

#

likely you have a bad init or no init Quat though

night tartan
#

I have "FSplineCurves SplineCurves {}" in the header, I believe this makes an empty struct?

#

I can load and recreate a spline actor just fine, so saving and storing SplineCurves is working; but I'm having an issue replicating it, server to client, so that joining a game mid-session and getting that data from the server makes a Spline actor for the client

#

ensure fail log

#

here's the server's log

#

after this hiccup, everything is totally fine and the client receives the SplineCurves and updates its meshes and the spline is fine

#

but I cannot find a way to get this ensure happy; I'm just saving and storing the SplineCurves variable server side, then letting it replicate to client, and OnRep with that variable I run an update on the spline

#

so, FSplineCurves doesn't appear to have a default constructor...would that potentially be a problem? It's uninitialized and it's trying to replicate a struct without any initialization?

#

I have isolated it to specifically having an FSplineCurves variable set as replicated in an Actor

silk abyss
night tartan
#

the FQuat comes up with a W of 0.5

#

it is initialized

#

it trips the ensure on Q.IsNormalized()

#

which, ultimately just leads to normalizing

#

I'll attach the debugger to the server now and see what pops up

#

yeah it trips on line 859 of UnrealMath.cpp

#

if (!ensure(Q.IsNormalized()))

#

this = {FQuat *const | ...... } { x = 0 Y = 0 Z = 0 W = 0.5 }

#

ahhh Q is supposed to be set to a dereferenced this...I see

#

no, there's nothing I can tell

#

it's just running FQuat::NetSerialize and hitting the ensure on IsNormalized

silk abyss
#

Remember that ue4 is multithreaded. You might run into situation where sever spawn an actor and replication thread run on incomplete actors(where their properties aren't really at the value they should be yet.)

#

I don't know if there is safe guard against that but I imagine more checks means more overhead and the developer are suppose to manage that part.

#

So if you seem stuck at finding out the reason, try also monitor when the replication doing its stuff and what values it get.

night tartan
#

I have isolated it to specifically anytime I have a SplineCurves struct replicating

#

so it's definitely that

#

it's on tick

#

in the stack

#

I've totally removed any OnRep functions

silk abyss
#

I would also back trace from the error message (so break on the error log and then see what call stack is calling it)

eternal canyon
night tartan
#

break on the error log?

#

I did that

#

I traced back

silk abyss
#

Then cool.

night tartan
#

I'm not sure what you're saying

silk abyss
#

I do not know if entire replication is run on single thread.

#

It's just that I run into issues before that are cause by different events firing asynchronous.

#

So I wouldn't assume anything running single thread.

eternal canyon
#

let me find it rq

silk abyss
#

(except like maybe game mode)

lost inlet
#

there's nothing replicated about a game mode

#

and the game mode runs on the game thread like all other actors

night tartan
#

it's literally just hitting an ensure when trying to replicate the FQuat info in the SplineCurves struct

#

nothing else is triggering the issue

#

there are no nullptrs, everything is wrapped with "if" statements; it's just the tick for replicating actors

silk abyss
#

Cool, yeah like I said, I don't entire know, but I don't assume something is running in single thread and thus my execution order are what I imagine it to be.

eternal canyon
#

This week we'll be joined by Ryan Gerleve and Dave Ratti to discuss general server optimization in UE4, as well as techniques and solutions to improve your Actors' performance in a networked environment.

NEWS

Unlocking Breach’s combat with Unreal Engine
https://www.unrealengine.com/en-US/tech-blog/unlocking-breach-s-combat-with-unreal-engine
...

β–Ά Play video
#

@silk abyss

#

if u go to 55:19

silk abyss
#

Cool thanks.

night tartan
#

Thread-1-[Main Thread] is what's running the FQuat::NetSerialize()

#

it doesn't make sense to me why they put an ensure with the Q.IsNormalized() in the engine if they're just about to normalize it anyway

#

it causes a hiccup, and then just resolves itself, and it's never hit again because it's an ensure

silk abyss
#

Lol, see all the past multiplayer games all have jerky physics actors here and there.

night tartan
#

the full function eventually even outputs bOutSuccess = true

#

so it even resolves as successful

#

but causes a massive thread hitch

#

actually...NetSerialize can't return anything but true

silk abyss
#

Maybe try comment it out and normalize yourself and see what happens. (That's my stupid hammer method just to observe what happens)

night tartan
#

it's its own Q

#

it's internal

#

nm

#

ignore that

silk abyss
#

Yeah, that's too deep for me engine wise.

#

Maybe you found something and can send a pull request later.

night tartan
#

so...with a quaternion

#

is it normal to see a quat with a w of 0.5?

#

is there a math channel on here...

silk abyss
#

There should be a answer you can find on the math stack exchange

#

But it is normal to normalized a quat since some operation don't return normalized result.(I do that all the time in Houdini VEX)

night tartan
#

it's deep in the struct, not sure how efficient it'd be to go through all spline points and try and run normalizations on anything resembling quats

silk abyss
#

And on Houdini, quaternion is {0,0,0,1} (identity? I don't know what that calls in quat sense)

night tartan
#

also, that might mess things up

#

yeah wondering where this w = 0.5 is coming from

silk abyss
#

Like maybe a lazy way to make sure normalization is always triggered from new quat?

night tartan
#

a standard if would trigger the normalization just fine

#

the use of the "ensure" makes it log out, and then causes the thread hitch

#

but ensure also means it only happens once during a run

#

so when it encounters this again, it just skips, normalizes, and everything is happy

silk abyss
#

So the ensure throws exception then so the log function catch it? I am on the phone so all I can do is guess.

night tartan
#

and causes a 7 second slowdown in everything...but after it's done logging and proceeds and normalizes the FQuat everything is fine

silk abyss
#

Can you somehow put in a properly initialized quat before it hits that if?

night tartan
#

it's an engine struct

#

FSplineCurves

#

there's no moment where I can go in and normalize stuff

silk abyss
#

So anytime you create that struct it runs that part.

night tartan
#

and as far as I can tell, it's the default initialized struct that throws this

silk abyss
#

Lol, open source development for you. :)

night tartan
#

the hiccup occurs right when a client logs in

#

the host/listen server never encounters this issue

#

and it's when I have a spline actor that has added an additional spline point beyond the default

silk abyss
#

Join lag is a thing though and really common for UE(be it 3 or 4)

night tartan
#

yeah, I have successfully maneuvered around waiting for things to replicate

#

but now I'm having the problem of this dumb struct issue

silk abyss
#

πŸ‘ hope I will read some blog post from you in the future.

night tartan
#

ha

#

well I livestream all this actually, I'm in the midst of just having a headache and banging my head against a wall on twitch πŸ˜†

silk abyss
#

Most company just write it off as it doesn't impact the game that much as join mid game usually means it's casual queue

night tartan
#

a seven second hitch during the initial run is painful, but yeah, I could hide it with a load screen I guess

silk abyss
#

So the hitch happens on the client that joins? Or all the other existing clients will have this lag as well?

#

Cause 7 secs for the new client is okay

night tartan
#

the whole server hitches

silk abyss
#

For everyone, good luck!

night tartan
#

yup

#

and only the first time, because of the ensure,

#

everyone else who joins...no issues

#

the Normalize goes on, everything works

#

and if the client leaves, and rejoins, because it's an ensure, it doesn't ever do it again

#

just really dumb

silk abyss
#

Can you like start a fake dummy client that joins and then quit on the server machine?

night tartan
#

I think I've found what may be occurring

#

I'm not sure why, but somehow Spline Point 1 has an FQuat for the rotation as 0,0,0,0.5

#

even though FQuat::Identity should be 0,0,0,1

#

I don't know where that 0.5 is coming from, and that's what's throwing the IsNormalized function...so I'm trying to hunt down where the w = 0.5 is first occurring

silk abyss
#

Someone hard coded that part I assume. ;)

night tartan
#

it's when a point is being added it looks like

#

on spawn, the 2 default points are 0,0,0,1 for their FQuats

#

getting closer...

silk abyss
#

Gonna go walk with my son, will check back later. Hope you have a good solution then.

night tartan
#

thanks for sticking with me, have fun

#

I need to walk soon too >.<

#

UpdateSpline() leads to Rotation.AutoSetTangents() which triggers w = 0.5

#

which then leads to triggering the false on IsNormalized()

#

so I'm going to set "false" for update spline when adding a new point and see what happens

night tartan
#

haven't solved the problem, can't seem to Normalize or reset the Arrival and Leaving Tangents W value back to 1 after it's stored as 0.5; I'll continue on it tomorrow...but that is the issue. When you UpdateSpline() it goes through and auto sets the tangents for the curves, and then that screws up the IsNormalized() for replication

gloomy tiger
#

Hey guys!

Am trying to retrieve PlayerState from Pawn but it keeps returning me null. Am trying to achieve this from the Server.

#

If I grab the PlayerState but from the Pawn's Owner (which is a PlayerController), it works just fine.

chrome bay
#

Is the pawn possessed by a player?

gloomy tiger
#

Hmmmmmmm, that's a good clue. Perhaps I'm doing this before possess.

#

Let me check.

chrome bay
#

Yeah it needs to be possessed by the controller in order to set the player state var

lament sinew
#

What happens if 2 different players sent a server RPC at the same time to take the same power up actor from game world ?
will it cause the power up to be duplicated? how to handle that? or u don't have to ?

chrome bay
#

@lament sinew One RPC will be called after the other, so it's entirely down to how you implemented it really

gloomy tiger
#

Doh. Bulls-eye, @chrome bay. Thank you!

#

πŸ‘

mild lynx
#

Is there a way to Add Force through a timeline to a Server that doesn't result in stuttery movement for the client?

halcyon totem
#

does anyone know if I am suppose to have gaming logic inside the game mode? like for respawning players and things like that?

plucky sigil
#

is it necessary to have HasAuthority() checks everywhere ?
When is it not necessary and when is it not ?
Besides from the fact that you already know you are server and that you want to do that thing on client side only.

lost inlet
#

I think you answered your own question

thin stratus
#

No clue. Test it (:

winged badger
#

kinda not the same answer if its running solitaire or a FPS

thin stratus
#

Yeay we can't really answer that. Depends on your project

#

Even if you label the genre we probably can't answer it

#

You will have to go through some testing for this. Dedicated server stuff isn't cheap. Testing what servers you need, specially under heavy load, is part of the expense

#

That's why bigger companies have stress test weekends

upper lynx
#

hello

#

anyone who can assist with replication?

#

TL;DR

PlayerController calls GameMode -> GameMode assigns PlayerController to a team. GameMode then tells PlayerController which team he belongs to.

PlayerController then tells PlayerState which team he belongs to.

PlayerState on the server is aware of this, but PlayerState on the client side has no idea,

#

PlayerController:

{
    Super::BeginPlay();

    AGameModeTitan* GM = GetWorld()->GetAuthGameMode<AGameModeTitan>();
    if (GM)
    {
        GM->AddPlayerToTeam(this);
    }
    
}```

GameMode:

void AGameModeTitan::AddPlayerToTeam(ACharacterController* CharacterController)
{
if (CharacterController)
{
int32 Index = 0;
if (Teams[0]->GetTeamMembers().Num() > Teams[1]->GetTeamMembers().Num())
{
Index = 1;
}

    Teams[Index]->AddPlayerToTeam(CharacterController);
    CharacterController->SetTeam(Teams[Index]);
}

}```

PlayerController:

{
    ACharacterState* CS = GetPlayerState<ACharacterState>();
    if (CS)
    {
        CS->SetTeam(Team);
    }
}```

PlayerState:
```void ACharacterState::SetTeam(ATeam* NewTeam)
{
    UE_LOG(LogClass, Warning, TEXT("Setting Team on State! %s, %i"), *GetName(), NewTeam->TeamIndex);
    this->Team = NewTeam;
}```
#

I had a full head of hair before attempting this....

pastel marlin
# upper lynx hello

Might not be a solution for your problem but you could put the team variable in ACharacterState as a replicated property

upper lynx
#

yip, I've done that

#
    ATeam* Team;```
#
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);

    DOREPLIFETIME(ACharacterState, Team);
}```
pastel marlin
#

and its not replicated ?

upper lynx
#

nothing. Team on CharacterState stays null

#

does it matter than ATeam object is of type Info?

#

I think, that only AActor is replicated...

pastel marlin
#

It might be I don't know what type info is

upper lynx
#

lol

#

"...but might need to be an Actor for replication purposes."

#

screw it, it's becoming an AActor

#

πŸ˜‰

pastel marlin
#

AInfo is an actor already

#

so its not that

#

Is your ATeam marked as replicated ?

upper lynx
#

the object or the variable on PlayerState?

pastel marlin
#

the object

ruby rock
#

Was wondering if someone could help me with understanding a couple of MP concepts. I think I'm missing something fairly simple here.

What is the difference between calling OpenLevel 127.0.0.1 and ServerTravel MyMap?

And where do sessions fit in this? Are they needed at all, or do they add something to the process?

empty axle
#

Sessions are not needed in this case

ruby rock
#

Ahh. So are sessions only needed when you are trying to connect via steam or similar subsystem?

#

Or maybe my question is when do you typically use sessions?

empty axle
thin stratus
# ruby rock Was wondering if someone could help me with understanding a couple of MP concept...

Sessions are basically just information holders. If you know the IP of the Server you want to join, then you don't need a session. But if you need information about a Server being available to others, then a Session would be needed.
A session is not required to play multiplayer. It encapsulates the information of the Server.

Some of those information are or could be:

  • IP Address/Port/UniqueID to connect to
  • How many users are part of the session?
  • What map is the Server playing?
  • What GameMode is the Server playing?
  • Custom information about your game, like standings, time of day, day until wipe, etc.

While they are mostly used for Server Browsers, where a Master Server is used to register sessions and then query them, they can also be used only visible to the backend, mostly for you as the dev to keep track of ongoing matches.
Think about Fortnite, Overwatch, Rocket League, where you only press a button to find a match.
This will perform matchmaking in the background and then join you into a session that you aren't really confronted with as a player.

#

OpenLevel or Open, vs ServerTravel is what Thompson more or less said.
A Server can only host one map at a time. ServerTravel moves the Server and the Clients to the new level.
OpenLevel or Open, with an IP, is basically a ClientTravel (in code), which connects to a Server, or opens a level if passed a map name.

There is a difference in Traveling called HardTravel and SeamlessTravel.
Usually all ClientTravels, may it be connecting, disconnecting or just moving between levels, are HardTravels.
They do not persist any data (+- GameInstance). ServerTravels, by default, are also HardTravels, but you can change the given GameMode to perform a SeamlessTravel in its Default Settings.
SeamlessTravel is preferred at all times and also required for Steam. A HArdTravel would cause Clients to disconnect and try to reconnect after a short delay. SeamlessTravel will send the Clients to a small TransitionMap, while the Server loads the new map and then the Clients follow, staying connected throughout the process.

#

There are also a bunch of default persisting Actors, or at least method that allow you to persist information between maps. Such as PlayerState and PlayerController for Settings and Stats.

#

You can also persist your own actors but that requires C++ iirc

ruby rock
#

wow - thanks for the detailed explanation.

#

I think that makes sense - in my scenario I want players to move to a "lobby" level, choose characters and then "ready". When all "Ready", move all players to the Map.
So that sounds like Open "Lobby", Choose Characters, Server Travel -> Map

#

No sessions required if IP addresses are known.

charred pebble
#

What would you do if your character to spawn logic is set to a perm variable but it’s not inside the game instance? How would one call a perm local variable to a character select widget?

thin stratus
#

Just keep in mind that Lobby to Map should ultimately be a SEAMLESS Travel.

#

And SEAMLESS Travels come with some extra stuff, like PreLogin, Login and PostLogin won't call.

#

It's important that you learn which events call for both, connecting and traveling. etc.

ruby rock
#

It's HandleNewPlayer as the entry point?

thin stratus
#

That should call for both, yes

#

You further have OnCopyProperties in the PlayerState and OnSwapPlayerControllers in the GameMode to move data between old and new PlayerState or PlayerController

#

E.g. you can save a character selection in the PlayerController and move it over in the OnSwapPlayerController function

ruby rock
#

Oh, it'll copy across?

thin stratus
#

It's a good idea to have a base class for Lobby and Game GameMode/PlayerController/PlayerState that shares those fields

#

It won't, but it allows you to

#

basically gives you old and new PlayerController/PlayerState

#

so you can take values from the old and set it on the new one

ruby rock
#

Ah right

thin stratus
pine karma
#

Anyone have solid experience with any Backend as a service products? I know Gamesparks and Playfab used to be the big boys but from what I understand, Gamesparks is dead and Playfab isn't looking so hot. Looking at something like AcceleratXR or Braincloud, but not sure if there's others I don't know about

thin stratus
#

Hm, I worked with both GameSparks and PlayFab and I would assume every other service is exactly the same hot mess. They also quickly get very expensive. Sadly don't know about AccelerateXR or Braincloud, but if they are similar to GS and PF, then I doubt they are much better. They all come with downsides and expensive limits.

#

For a serious approach I would probably suggest setting up the service and backend by hand and only renting the naked servers wherever it fits.

pine karma
#

When you say setting up service/backend by hand, are you saying do things like matchmaking, shops, etc. yourself? Or saying use one of those services, just don't rent their servers?

thin stratus
#

Yeah I meant all the services. I fully understand that that's not an overnight job and needs additional peeps to maintain it, but then you can at least make it work exactly like you need it and don't pay for weird limits that other paid service force upon you

pine karma
#

Yeah pricing it out definitely was expensive. Came to $8k a month for just 5k CCU on one services, and that wasn't including server costs, was just for the BaaS. Makes sense, appreciate the insight

thin stratus
#

If that's not an option due to a time constraint or so, then well, not sure how much of a difference it is to choose one over the other. GameSparks and PlayFab are both bought buy huge companies and are supposed to be the top ones, but the problem is/was that after being bought, these companies wanted to fully change both of those platforms.
Which caused them to basically be set back to square 1. They stopped developing their own systems and made new ones.

#

You also have GameLift, which is for Serverhosting, which has some Matchmaking service, which I forgot the name of

#

But they are all equally expensive. They lure you in with free tiers for testing, but that's about it

#

Not saying that your own system is much less expensive, but then it's at least up to you to scale it

#

And GoogleCloud or so was also something someone asked me about recently

#

Or GoogleCloudGaming or so, not sure what it was called

pine karma
#

Yeah AWS completely dissolved Gamesparks just for reference, its 100% gone. Playfab is on Azure now but it's been fully Microsoft'd at this point. I'm guessing there's some breakeven point where BaaS saves you money until you get big enough where "damn I should have just spent this last 6 months of bills paying someone to do this ourselves". Good problem to have I guess. Fortunately, most do at least seem server agnostic, so any of these companies like Improbable/Multiplay are still usable to manage infra on whatever BaaS works I guess

Wish EOS came out awhile ago, just feels too new still.

rose egret
#

has anyone ever implemented kill cam with DemoNetDriver and InMemoreyReplayStream ? there is not document and I am stuck

#

😿

finite goblet
#

what is the official reasoning behind TMap and TSet not having replication support?

eternal canyon
#

and for TMap

#

You could have a struct with the two values in an array

#

and make a function again do similar things

finite goblet
#

well I have workaround for both of them , I'm interested in hearing the technical explanation for it

eternal canyon
#

oh no idea

#

lol

eternal briar
#

In seamless travel, do I need to manually destroy the persisting playercontroller after the playercontroller swap happens?

thin stratus
#

No

thin stratus
#

At least the TMap one

chrome bay
#

Also difficult to support since you can't guarantee the availability of the keys, or that they will hash the same way at both ends.

#

E.g, UObjects/Actors may not be relevant, FName indices may be different etc.