#multiplayer

1 messages ยท Page 488 of 1

winged badger
#

listen server, right?

thin stratus
#

No offline

winged badger
#

all PCs will be local

thin stratus
#

Correct

winged badger
#

can wire the GM to react differently to it

#

probably wouldn't take more then 10 minutes

thin stratus
#

I would just love to check via PlayerController if the Player is done loading

#

Maybe I can use that ServerNotifyWorldLoaded stuff

#

I will see

winged badger
#

if not that

#

FWorldDelegates have something for you

thin stratus
#

Yeah that's how the LoadingScreen works in the First place

#

But it might be that the issue also exists in networked games

winged badger
#

there is a local version of that call btw

thin stratus
#

So the Server ultimately will need to know if peeps are loaded

winged badger
#

you don't have to override the RPC

#

for splitscreen offline games

thin stratus
#

Ah good. Guess I will scan the API a bit more

#

Or just Source Code..

#

But now, off to the couch it is!

winged badger
#

i do use it to set the view to overhead camera

#

because that automanage camera is just terrible for most use cases

eternal briar
#

Thank you @thin stratus and @winged badger for all the info! Learned lots of new things today

woeful knot
#

Hey guys. I am trying to make a local coop game and I am spawning the players and possessing them with a player controller from 0 and up.
The issue I am having is that for some reason player0 is always only keyboard and mouse and player1 is the first gamepad.
How can I make it so that player0 is keyboard and the first gamepad?

thin stratus
#

@woeful knot there is a boolean in the project settings iirc. Something with "skip assigning..."

#

That might be set to true on your end

bleak tiger
#

do nDisplay questions belong here?

#

has anyone here used it?

worthy wasp
#

Not sure what i'm doing wrong - i have a function that is printing its running as CLIENT.... yet i'm getting a UNetDriver::ProcessRemoteFunction: No owning connection for actor BP_ItemBase2. Function SRV_StartDestroy will not be processed. Actor is setup to bReplicates=true...... why would this be doing this? The event is coming from a local function from the Character class to interact with this ItemBase class - here's the function chain:

{
    SRV_StartDestroy();
    GEngine->AddOnScreenDebugMessage(-1, 5, FColor::Green, FString::Printf(TEXT("%s - START DESTROY CALLED"), NETMODE_WORLD));
}

void ALNSItemBase::SRV_StartDestroy_Implementation()
{
    bIsDestroyed = true;
    OnRep_bIsDestroyed();
    GEngine->AddOnScreenDebugMessage(-1, 5, FColor::Yellow, FString::Printf(TEXT("%s - SRV-START DESTROY CALLED"), NETMODE_WORLD));
}
bool ALNSItemBase::SRV_StartDestroy_Validate()
{
    return true;
}
#

FWIW - the AItemBase class is a statically placed object in the world. I've done this form of replication in several other projects where you have Interactables (Doors/Lights/Buttons/etc) that are static objects placed in the world.... not owned by any player.

nocturne berry
#

hey guys, anyone knows how can i make a loading screen (transition screen) when the player is connecting to a dedicated server or traveling seamlessly?
can't seem to find a working solution for this case...

gleaming niche
#

look at shootergame.

worthy wasp
#

runs in a seperate thread so it can handle animation properties like Throbbers or movie files specifically

nocturne berry
#

@worthy wasp i had tried this before, didn't work for some reason (maybe i set it up incorrectly).
u sure this is for dedicated servers?

gleaming niche
#

it's for loading while connecting to anything.

worthy wasp
#

@nocturne berry - FYI - SERVER (dedicated/Listen) has ZERO knowledge of anything widget related

#

you dont run any widgets/loadingscreens on servers

#

that is 100% client based

nocturne berry
#

yes i'm aware of that, but the client cannot seem to be able to add a widget while it's trying to connect to a server

#

or traveling seamlessly

gleaming niche
#

you lshould look at shootergame, the way it's implemented there.

#

it works for seamless travel, and normal loads

worthy wasp
#

the above feature will work on a MAP LOAD (travelling seamlessly too)

gleaming niche
#

just not in PIE.

worthy wasp
#

^^^

#

was just typing that too

gleaming niche
#

so if you're testing dedicated server, with PIE

nocturne berry
#

shooter game has a loading screen? never tried it

gleaming niche
#

it won't work there.

#

you have to actually build standalone

worthy wasp
#

play in STANDALONE testing

gleaming niche
#

or run like yeah.

worthy wasp
#

no @gleaming niche - it works standalone too

gleaming niche
#

@worthy wasp you typed before me, just like i did before you ๐Ÿ˜‰

nocturne berry
#

editor standalone can travel? without a build?

worthy wasp
#

โค the world is a happy place! ๐Ÿ™‚

nocturne berry
#

lol u guys :p

gleaming niche
#

๐Ÿ’—

worthy wasp
#

@nocturne berry yah dude - as long as your OSS is setup properly - you can run a local dedicated server instance on your local machine.

#

i even test multiplayer (True multiplayer) by puttin gproject on 2 different machines

#

and setup port forwarding on my router

#

this will get away from problems like STEAM OSS testing (you cant run steam 2 accounts on ONE computer)

nocturne berry
#

well my problem is that my game is setup with gamelift, kind of hard to make it work locally with my setup x.x

worthy wasp
#

induce code to split using gamelift vs. local testing

#

then you dont have to have hte long drawn out process to package/push to gamelift services

#

and can test locally without

#

i did the same with a project i was on using Playfab

nocturne berry
#

yea i think that's a good idea, since it will make testing faster

#

alright thanks guys, will try to make this loading screen work!

meager spade
#

RPC's need an actor channel

#

oops delayed again

#

discord really needs to fix this issue

fiery geyser
#

Where would be a good place to store a pointer to the last pawn owned in case the player leaves the session (gets disconnected) and enter's it again

thin stratus
#

@fiery geyser leaves for how long?

fiery geyser
#

Well, for example in CS:GO you would have up to 2 minutes to get back.

#

Or another example would be, the player dies, gets into Spectator mode and then gets resurrected back, so, instead of spawning a new pawn, I would play a revive animation on the previous one and Possess it. If you could give me an idea for both of my examples I would be really happy.

#

@thin stratus

thin stratus
#

UE4 does that with inactive PlayerStates

#

@fiery geyser

#

So you could keep the pointer in that

#

It should call OnOverrideWith in the ps when a player comes back

#

And or CopyProperties

#

The time they stay alive can be set in the gamemode

#

Just make sure you clean up the character if the inactive ps is cleared

fiery geyser
#

I see, so in UE4 the PlayerState is the one stays the longest "around". Thank you!

winged badger
#

5 minutes

unique kelp
#

I'm about to start working on a stackable movement speed modifier system for multiplayer, any general guidelines or gotchas I should watch out for? I've had problems with network prediction in the past doing similar systems

#

using a custom movement component already for sprinting

real yacht
#

how can i disconnect player controller after pawn is killed

#

?

fleet raven
#

destroy it

real yacht
#

ok

wise depot
#

If I want to use a specific identitiy interface, what do I need to do to get the pointer?

I can't seem to just cast by doing this

FOnlineIdentitySteamPtr IdentityInterface = Cast< FOnlineIdentitySteamPtr >(OnlineSub->GetIdentityInterface());

this throws up an error

 e:\unreal-engine\engine\source\runtime\coreuobject\public\UObject/Linker.h(514): note: could be 'T *Cast<FOnlineIdentitySteamPtr>(FLinker *)'
            with
            [
                T=FOnlineIdentitySteamPtr
            ]
    e:\unreal-engine\engine\source\runtime\coreuobject\public\Templates/Casts.h(271): note: or       'T *Cast<FOnlineIdentitySteamPtr>(const FSubobjectPtr &)'
            with
            [
                T=FOnlineIdentitySteamPtr
            ]
chrome bay
#

You need to use StaticCastSharedPtr

#

Although the point of the online interfaces is that the code using it is platform-agnostic, so you shouldn't really do it anyway

worthy wasp
#

Ok.... really struggling today and im not sure why.

World placed actor (not spawned) needs to be interacted with.... for all purposes say turning on a light from a player character class.

Light is set to replicate. Character local funct interacts with light.... runs a local funct on light actor which runs a server rpc to set a repnotify bool.... onrep = toggle light on/off via repnotif bool state.

Im getting No Owning Connection error on the light actor. Why? What is the proper method chain to pull off non-owned acter replication events?

#

Model is dedi server btw

bitter oriole
#

Two options

#

Have the server set the ownership to the player (preferred / more Unreal way, keeping a permission system of sorts)

#

Or have your player controller class RPC itself for using an item, and then do it on the server

#

Like, APlayerController::ServerUseActor(AInteractiveActor* TheActor)

worthy wasp
#

So the functions on light would be non rpc... essentially run in whatever auth is calling them

#

Ill give a try when im home. The set ownership wont work.... 5 people could try to interact with this at any given time.... very problematic imo

bitter oriole
#

Yeah, if you can have more than one player interact, you need the player RPC option

#

It can be exceedingly simple, too

worthy wasp
#

I thought that ive tried this.... ill triple check.

bitter oriole
#

I have a bit of that myself, even though my objects usually transfer ownership

worthy wasp
#

I know i have an inventory system adding inv items via server.... and i tried to run local non rpc event on this item to destroy it.... it never runs.

#

No error at that point.... but funct NEVER runs

bitter oriole
#

Dunno what you did but PlayerController, PlayerState and Pawn will definitely work fine when calling Server RPCs from their owning client, so you can use any of these classes as a conduit for interactions.

worthy wasp
#

Yes - acharacter class is where im doing this from.

#

All pointers to object are valid

bitter oriole
#

You can absolutely RPC from owning client to server with the character class

#

You wouldn't even move if not

worthy wasp
#

And i can affect map placed actors that i DONT OWN?

#

Thru rpc server events?

bitter oriole
#

Yes - on the server, from your ACharacter server function

worthy wasp
#

Right.... ive done this in past successfully... i dunno whats going on in this proj

bitter oriole
#

Character::DoStuff(Light) -- RPC --> Character::ServerDoStuff(Light) -- regular function call --> Light::Toggle()

#

This works fine

worthy wasp
#

All my other server events run fine.... i know its not a bad oss or dedi setup. Def something im doing wrong in this chain of events

bitter oriole
#

If you can schematize what you did like I did above, it should be easy to understand what's wrong

thin stratus
#

CAsue AnimBPs aren't replicated

#

The Owner has the Authority check

lost inlet
#

animations will only need to tick on the dedicated server if you need to animation to tick for gameplay purposes, but you can make it tick less and possibly have parts of the ABP that are skipped on dedicated

worthy wasp
#

in my own experience - what @woeful anvil says is true...... all replicated variables are pulled from the character/pawn class.... and drive variables inside of the animation blueprint - which in turn drive your animation states/changes.

#

i've gone as far as to not poll-tick for them in teh ABP - rather direct set them from the character class when they change

#

seems liek a needless useage of processing

final thicket
#

Greetings multiplayer ๐Ÿ˜ƒ

#

When you send a serialized TArray does it send only the minimum required data?

#

and if the array is empty is there a 'null' or something along the lines of it sent?

worthy wasp
#

@bitter oriole - you wouldnt believe the amount of stupidity i jus twent through... all worked fine the way it was programmed - except i had my code that SHOULD have taken care of these things buried inside of a switch statement OUTSIDE of the cases..... so it never was executing.

#DURP

unique thunder
#

Is it possible to not have my game pop up the windows firewall dialog upon launch?

grizzled stirrup
#

How do you deal with ensuring all players are on the same build of a game if not using a master server to verify? For example when testing my game after an update on Steam, one computer didn't update and had bugs from the previous build even though everything else worked similarly somehow

#

Would it be as simple as not starting the game if there is a mismatch in an ID that each client provides on joining a lobby?

#

And telling either the client or listen server host that is out of date to go and update the game?

fleet raven
#

set the network version

#

this makes it automagically refuse to connect wrong versions

grizzled stirrup
#

Ah perfect thanks!!

grizzled stirrup
#

Would anyone be able to explain this comment in one of the functions from AGameState ?

#
void AGameState::OnRep_MatchState()
{
    if (MatchState == MatchState::WaitingToStart || PreviousMatchState == MatchState::EnteringMap)
    {
        // Call MatchIsWaiting to start even if you join in progress at a later state
        HandleMatchIsWaitingToStart();
    }
    
    if (MatchState == MatchState::InProgress)
    {
        HandleMatchHasStarted();
    }
    else if ...... etc.

#

I assume the intent is that HandleMatchIsWaitingToStart() would fire on clients even if they join late, in order to make sure that NotifyBeginPlay() gets called

#

However since MatchState is replicated from the server, surely a client joining late would never get a MatchState value of WaitingToStart or EnteringMap?

winged badger
#

not having BeginPlay called on your world kinda sucks

grizzled stirrup
#

Yes it would

#

I get why they want it, but I don't see how it would ever get called

#

Unless the client has a version of MatchState

#

So locally it'd be WaitingToStart or EnteringMap until the server takes over

#

Ah I guess it would actually get called because the default value of PreviousMatchState is EnteringMap

#

So since it's default, it'd trigger the begin play

#

My bad!

winged badger
#

๐Ÿฆ†

grizzled stirrup
#

Always works!

somber glade
#

So in testing, the client never returns true for "is locally controlled" when run in editor with 1 client and "dedicated server" checked.

#

I'm testing VR as the client, so I tick "dedicated server" set for 1 user and run, but this is failing.

grizzled stirrup
#

Where is this being run from?

#

It could be running on a function like OnPossessed() which happens only on the server

somber glade
#

It looks like "onrep_controller" isn't running for the client in this environment.

#

I get this print: LogBlueprintUserMessages: [BP_VRPlayerAvatar_C_0] Server: Running Begin Play LogBlueprintUserMessages: [BP_VRPlayerAvatar_C_0] Server: Running Possession LogBlueprintUserMessages: [BP_VRPlayerAvatar_C_0] Client 1: Running Begin Play

#

The client is running begin play though.

#

which should lead it to the "is locally controlled"

grizzled stirrup
#

It's always worth trying a delay in cases like this where possession might take time

somber glade
#

This character isn't being used at the beginning of the game

grizzled stirrup
#

Right so then he doesn't have a controller and won't be locally controlled?

somber glade
#

They get a menu character first, choose a character to use, then this is spawned and they possess it

#

works in a built game.

#

but testing in PIE it doesn't seem to fire

grizzled stirrup
#

There can be strange issues relating to timing when testing in PIE

somber glade
#

Right, but the onrep_controller never prints, so even if there was some delay the print would come later

grizzled stirrup
#

Are you definitely setting a controller on the server?

somber glade
#

Yes.

#

I added a second print: LogBlueprintUserMessages: [BP_VRPlayerAvatar_C_0] Server: NotLocallyControlled LogBlueprintUserMessages: [BP_VRPlayerAvatar_C_0] Server: NotLocallyControlled LogBlueprintUserMessages: [BP_VRPlayerAvatar_C_0] Client 1: NotLocallyControlled

#

the client in PIE definitely sees itself as not locally controlled

#

I'll try a delay

#

@grizzled stirrup That fixed it, I stuck a 1 second delay in before it, thanks

grizzled stirrup
#

Glad it helped ๐Ÿ™‚

#

Can be a bit tricky in PIE sometimes

somber glade
#

onrep_controller still isn't firing, but begin play handles it for testing

thin stratus
#

@somber glade @grizzled stirrup Don't use delays.

#

In the actual released game, if someone has a slower pc/connection, this might break again.

#

Find out why it needs the delay and make sure you find an event that calls at the right time.

#

A Character on BeginPlay is not possessed, so it won't have a Controller and it won't have any "LocallyControlled" value (well despite not being locally controlled).
This only starts being valid if the Controller in the Pawn is replicated iirc.

somber glade
#

@thin stratus the issue only comes up testing in PIE

thin stratus
#

Even if PIE is weird from time to time, most of the time it's actually just bad code

#

I maybe have 1 or 2 workarounds for PIE in a game that is nearly done.

#

So rather double check if you are actually doing it correctly in the first place

somber glade
#

I am because you helped me set up the onrep controller. It simply doesn't fire in PIE

thin stratus
#

You exposed OnRepController via a simple Implementable event?

#

Just to me sure: You are aware that OnRepController won't call for Servers if you aren't actively calling it

somber glade
#

I'm running with dedicated server checked. I'm the client in this test

#

It's not firing

#

And yes

thin stratus
#

And you are in a networked environment in the PIE?

#

It should def call, it does on my end in the PIE

somber glade
#

Yes, dedicated server is checked and I'm shown as the client

#

Per above: LogBlueprintUserMessages: [BP_VRPlayerAvatar_C_0] Server: NotLocallyControlled LogBlueprintUserMessages: [BP_VRPlayerAvatar_C_0] Server: NotLocallyControlled LogBlueprintUserMessages: [BP_VRPlayerAvatar_C_0] Client 1: NotLocallyControlled

#

a 1 second delay right before that check allows it to report locally controlled.

thin stratus
#

And where are you calling that?

#

Where are you checking

somber glade
#
        void K2_OnRep_Controller();

    virtual void OnRep_Controller() override;```
#

that's what you told me to put before which I did

thin stratus
#

Yeah

#

But where are you checking that LocallyControlled?

somber glade
#

on the character

thin stratus
#

Function?

somber glade
#

of these

#

begin play isn't hooked up in a built game

#

setup possession is called by "onpossession"

thin stratus
#

Yeah BeginPlay should also not be used as explained.

somber glade
#

it isn't used in a built game

thin stratus
#

So SetupOnPossession is the Server

somber glade
#

that onrep_controller print never comes

thin stratus
#

Can you show me the C++ part of the OnRep_Controller?

somber glade
#

when it's possessed by the client in PIE

#
{
    Super::OnRep_Controller();

    K2_OnRep_Controller();
}
thin stratus
#

The Character is marked to replicate, yeah?

somber glade
#

of course

thin stratus
#

If that's the only code you have in C++, then I'm really not sure atm.

#

It should def call

#

Even in PIE

somber glade
#

it works in a built game no problem

#

Just pie is wonky. It's not a big deal, it was only for some replication and function testing.

fathom aspen
#

Guys what's the difference between bReplicates and SetReplicates() ?

empty axle
#

SetReplicates changes the bReplicates variable but it also notifies network driver about that change so the actor can be replicated from now

#

if u know what i mean

#

@fathom aspen

fathom aspen
#

So how does that differ

#

What does this network driver do?

thin stratus
#

Handle connections, sending and receives packages and that crap iirc

fathom aspen
#

I see, thanks for sharing this documentation ๐Ÿ™‚

empty axle
#

So if you change bReplicates at runtime it won't do anything, on the other hand if you SetReplicates at runtime it will start or stops replicating from now on

fathom aspen
#

Oh so bReplicates is constructor-only and SetReplicates is a runtime function?

empty axle
#

Yes

fathom aspen
#

Thanks man, so clear now ๐Ÿ˜ƒ

hollow arrow
#

What does this mean? Ensure condition failed: !Primitive->Bounds.BoxExtent.ContainsNaN() && !Primitive->Bounds.Origin.ContainsNaN() && !FMath::IsNaN(Primitive->Bounds.SphereRadius) && FMath::IsFinite(Primitive->Bounds.SphereRadius) [File:D:\Build\++UE4\Sync\Engine\Source\Runtime\Renderer\Private\RendererScene.cpp] [Line: 1329] Nans found on Bounds for Primitive Skeletal Mesh: Origin X=-nan Y=-nan Z=-nan, BoxExtent X=nan Y=nan Z=nan, SphereRadius nan

#

It causes a breakpoint, sometimes crashing the game

modern swift
#

is the rpc call only can called by actor with owner? what is the better way to make any object/Actor to call RPG function in order to update /exchange data between client and server?

grizzled stirrup
#

@thin stratus I'm doing my best to avoid delays where possible but there are some cases where I think they are essential due to the varying speeds of the replication channels opening

#

I've found that ensuring there is a 5 second warmup countdown stage fixes most of my problems

#

Otherwise replicated properties might not be available on all clients

#

But still on some

thin stratus
#

but there are some cases where I think they are essential due to the varying speeds of the replication channels opening
I don't have a single delay for that in our code.

#

So no, it's not essential

grizzled stirrup
#

I mean even a next tick delay that you showed before is essential for timing

thin stratus
#

Otherwise replicated properties might not be available on all clients
OnRep is a thing. you can use one OnRep for multiple variables in C++

#

Right, but that's a fixed one frame delay

#

This is nothing to do with fixing a timing issue with replication

#

You can of course add a countdown to your game of 5 seconds

#

And that makes things easier

#

But doing a Delay, so you can catch the possession on BeginPlay

#

Is just bad

grizzled stirrup
#

True, I just noticed that if you have your UI subscribe to GS properties such as time, it can work for the host and client 1 but not client 2 unless things start replicating in advance (5 second pre start countdown, then init on the OnStarted event)

#

Yeah I don't do a delay with possession or anything

#

Not like the person that was asking yesterday

#

It's more just: let things start replicating and init the UI after a pre round countdown

#

Otherwise it seems the clients can miss the initial OnRep call and their UI doesn't get initialized to the current value until that value changes again

#

I have a RefreshCharacterUI() function that inits all UI at a point in time where the character is definitely spawned and the replication channels have been open for at least a second or two

#

And that is called when the pre round countdown ends

#

And then the UI is set to visible

raven tinsel
#

Have you guys ever tried to implement multiplayer world origin rebasing? I can't find any information on the subject, but I am thinking about spawning a new server process once a player reaches the limit of the current map area and teleport him on that new instance, is this a valid solution?

chrome bay
#

Not sure what you're doing but in vanilla UE4 it's not an option

#

We use Origin Rebasing in HLL

#

Found it to be a nightmare

#

Particularly with Physics, which isn't happy when you yeet the origin away

#

The Server still works in non-rebased origin space, so it doesn't really solve anything that side

vagrant hemlock
#

I am Having Some Issue While Creating A multiplayer Game When I create session From Server Window And Join From Client Side Then The Client Joins the Session But He Does not Spawn Please Help Me If Anyone Can

keen thorn
#

hi would anyone know how in u4 I can simulate frames without it being rendered, i.e simulate 4 frames with 0.03ms each, and only render the last frame

wary wyvern
#

Is it possible to prevent PlayerState from being destroyed after player leave?

winged badger
#

it doesn't get destroyed immediately by default

#

gets moved to InactivePlayers array and stays there for 5 min

wary wyvern
#

Is it possible to prevent even this?

winged badger
#

should be easy, just need to find a function that cleans those up and override it so it doens't

red musk
#

Hey everyone, I have a question about DestroySession. This call seems to not work as I expect when a client calls it, as it is:

  1. Not triggering the Logout callback on GameMode
  2. Not actually stopping RPC calls from happening. The client that calls DestroySession in an attempt to disconnect from the server still is "connected" in that it receives RPCs and RepNotifies from the server

Can anyone provide some insight on how to use it properly and/or what I am missing please? I'd really appreciate it!

normal girder
#

hello

#

could someone help me for a little thing i dont remember

#

i have dedicated sever

#

is launch and ok

#

when first player join it s ok

#

the second join it s ok too

#

but i have 3 pawn on map instead 2 only

#

i don t know why ....

outer mason
#

Your gamemode/player starts are probably auto spawning a hero pawn

#

What happens if you select default player pawn None?

meager spade
#

or you have a pawn sat in the level

#

seen that happen before

normal girder
#

@outer mason @meager spade I ll check

#

thk

#

you means this ?

dusty stone
#

2 part question

  • does anyone know if it's possible to package in headless mode with no GUI window using the normal binary engine? the only way i can find is building dedicated servers.

  • with a dedicated server build, is it possible to disable the built in server that launches on port 7777?

jolly siren
#

Is there any way to get the sender of a server rpc without sending it as a parameter?

meager spade
#

last time i looked, i couldn't find a way

jolly siren
#

hm well I guess the actor that receives the server rpc has an owning connection. So I should be able to work my way up the owner hierarchy to find the owning pc and then get the playerstate from there?

#

My goal is to find the playerstate that sent a serverrpc

#

Without sending extra data

meager spade
#

that might be possible, the owning connection would be a player controller, so yeah could work

jolly siren
#

okay cool makes sense, thought so ๐Ÿ™‚

#

Thanks for the sanity check

normal girder
#

@outer mason i have defautl player to node already

#

but i don t kown what you mean by " auto spawning "

#

in fact, if i start server and server is on map B

#

and, in editor, i start two stand alone on MAP B, and i set ip 127.0.0.1 and connect

#

all is ok

#

only 2 plyer in map

#

BUT : if i start server on map B

#

and i start two standalone player on map A

#

i set IP 127.0.0.1

#

and join, i go to map B after Join

#

but i have two player

#

and an other pawn

#

(so 3 pawn i think)

vagrant hemlock
#

I have a simple local multiplayer for android when i create a session on hotspot then another android which is connected with wifi is not able to find the session can anyone help

limber mortar
#

they're on 2 disconnected networks most likely

#

I guess I would have to see how the session routed between the carrier network and your wifi network.

twin juniper
#

is there a way to get OnRep to fire for initial values? currently i have to call the onRep functions manually in BeginPlay. They work when the value changes as expected, just not during initial actor spawn.

nocturne berry
#

@thin stratus i've been reading the history regarding starting a players as spectators and how u've been implementing them.
i followed how u did it and everything is working perfectly in the editor, but not in packaged build.

the problem is that the NumPlayers and NumSpectators are always 0 when bStartPlayersAsSpectators is set to true.
any idea how can this be fixed?

thin stratus
#

Not sure if I'm using the boolean anymore. You might want to check what it is used for

nocturne berry
#

it is used to not spawn the pawns for the players when they login

#

and this is what i want

#

i want to spawn them manually when i need to

nocturne berry
#

@thin stratus if i don't use the bool, and i manually make the player as spectator instead of spawning a pawn for him, any idea where should i call my Start Spectating function in order to make sure that both server and client are spectators? doing it in the game mode's GenericPlayerInitialization function currently doesn't replicate to the client (i think because the player controller has not yet been initialized and accepting RPCs on the client?)

thin stratus
#

I had to change a bunch of stuff

#

To get this to work and I'm still not sure it works properly

#

As in, "Works like Epic wanted it to work."

normal girder
#

no one have an idea about my problem ? ๐Ÿ˜ฆ

timber tree
#

can anyone tell me whats MaxClientRate , NetServerMaxTickRate , MaxInternetClientRate?

#

my dedicated server breaks at fps greater than 90

#

or I should say my client face lag issues when its FPS > 90

chrome bay
#

You probably don't want to be running a dedi server at 90 FPS anyway

#

Check the log for warnings about the client character movement running out of saved moves

#

The higher the framerate the more saved moves it'll create

#

at a certain point, the network won't be able to keep up with all the requests

#

And you'll get snapping

real yacht
#

Does anyone have expericen with loat testing, gameLift + unreal

#

?

spare ridge
#

Hello Unreal guys! I want to make Mobile multiplayer game in Unreal. Can you please give me some directions how todo the Networking, and maybe tips where to host server that handles it.

grizzled stirrup
#

Is there a callback for when the replication channels have fully opened and all clients are receiving data (or a callback per client?)

#

I'm doing a 5 second countdown before the match starts but I realize this is not precise and a more specific start time would be better (when it's guaranteed to be ready and all clients are receiving replicated data, therefore can all init their UI at this point etc.)

thin stratus
#

That always depends on the Actor

#

You can link it to every actors BeginPlay calling on the Client

#

PostLogin would also be a point at which RPCs are allowed on the PC

royal isle
#

Hey, a question, the replication graph allows us to do grid 2D spatialized replication, would it be worth it taking this even further and implementing a LOD-like system for replicating things?

chrome bay
#

rep graph already prioritizes based on distance/starvation

royal isle
#

Yeah I am talking more about a system with like 3 levels of detail for replicated stuff in a big actor, the rep graph will do all that for the entire actor but will also enable / disable the lod components on it for another player

winged badger
#

you don't really get to LOD a single Actor replication wise

royal isle
#

Wouldn't it be possible if you break it up in components?

winged badger
#

and what would you gain by it?

#

components share the ActorChannel with the Actor, they don't have their own

#

you could manually turn off replication on a component

#

but i don't see the point

#

also, that would affect all clients, or none of them

royal isle
#

I see, alright thanks for the insight

winged badger
#

you could in theory break up the Actor into several Actors

#

attach them

#

and then toggle some of them on/off

#

(by "big" i am assuming uses a lot of bandwidth)

royal isle
#

Yeah that is what I had in mind

fluid prawn
#

Yo I'm getting some net corrections this is what the log is spitting out
LogNetPlayerMovement:
Warning: Server: Error for FA_Character_C_1 at Time=3.839 is 18.126 LocDiff(X=0.577 Y=18.116 Z=-0.004) ClientLoc(X=-312.240 Y=1281.910 Z=377.550) ServerLoc(X=-311.663 Y=1300.026 Z=377.546) Base: None Bone: None Accel(X=264.700 Y=8295.800 Z=0.000) Velocity(X=63.831 Y=1837.909 Z=147.617)
LogNetPlayerMovement:
Warning: Client: Error for FA_Character_C_0 at Time=3.839 is 18.124 LocDiff(X=-0.578 Y=-18.115 Z=0.000) ClientLoc(X=-312.241 Y=1281.912 Z=377.546) ServerLoc(X=-311.663 Y=1300.026 Z=377.546) NewBase: None NewBone: None ClientVel(X=49.549 Y=1390.297 Z=147.616) ServerVel(X=63.831 Y=1837.909 Z=147.617) SavedMoves 0

Does this have to do with Base difference?

chrome bay
#

LocDiff(X=0.577 Y=18.116 Z=-0.004)

#

That's enough to trigger a correction

fluid prawn
#

hmm where is the threshold set?

#

Seems like a very small difference

#

is it triggering of the Y axis Local dif?

spare ridge
#

Is there a good example, tutorial how todo networking with ue4 c++?

fluid prawn
#

lots

chrome bay
#

18 units is a lot

#

that's nearly 20cm of offset, definitely enough to warrant a correction

#

The default is < 3 units IIRC

fluid prawn
#

hmm I am move pretty fast

#

I have my characters move at 1000 cm/s

#

and I change velocity

#

very fast some situations

#

I am implementing Arena Movement

chrome bay
#

I don't know what arena movement is, but the setting is in AGameNetworkManager

#

MAXPOSITIONERRORSQUARED

#

By default it's tiny

#

Even if you move fast it shouldn't matter that much

#

If the movement isn't properly integrated with character movement it'll cause trouble

fluid prawn
#

I am overriding the CMC to work like Quake does. If you know a bit about quake I am doing strafe jumping

#

I'll do some experimentation here

#

thanks for the insight Jamsh

spare ridge
#

:/

worthy wasp
#

I have my ServerDefaultMap set to my lobby - the game (local client @ startup) enters in at the MainMenu. Theyre 2 totally seperate game modes, and player controllers that setup appropriate widgets for everything.....

When i'm trying to playtest the framework sequencing.... the player enters in on the Main Menu as i'm launching STANDALONE from that map.... However once I do my appropraite login - it should transition to the Lobby Map (via OpenMap::IPAddressOfDedicatedServer) - yet it goes directly back to the Mainmenu. Is this a editor glitch? Should I packaging this and running a complete seperate executable for hte dedi server - and another for the client?

https://puu.sh/E8Fbu/d0195445b1.png

lost inlet
#

i was struggling to find this with find in all files, but is there a BP function in the engine that exposes various net stats (like PUBG and Fortnite have)?

#

eg. packet loss

verbal hull
#

hi is there any way to limit the packets sent by a listen server/client? by default the packets sent are equal to the fps

sharp pagoda
#

@lost inlet iirc unetconnection exposes all of that, no bp access though

lost inlet
#

looks like it's on NetDriver, but i need to see i need to enable bCollectNetStats for it to be set

civic light
#

hey, anyone have any idea why SteamFriends()->GetFriendRichPresence(SteamID, "steam_display"); won't work for my in game friends list?

tall pine
#

Hi Guys,

So I'm facing a problem of the client falls through the wall when a match start, locally. I can block-load on the server side when a match start, but since the client won't have access to GameMode, what would be the best place to blockload the environment so that the client will wait until it's done loading before trigger BeginPlay() ?

grizzled stirrup
#

Would also love to know the answer to this @lost inlet

#

If you find an easy way to get the data out that could be exposed to a UI please post here

#

Would be very useful

grizzled stirrup
#

Is PostLogin only called once per client regardless of how many maps you travel to (if using Seamless travel)?

bleak lily
#

anyone know how I would implement dedicated servers with advanced sessions?

hollow stirrup
#

@grizzled stirrup first question, might wanna look into AGameModeBase::InitializeHUDForPlayer

Second question AGameModeBase::PostLogin is called from UWorld::SpawnPlayActor

IIRC, there is a function in the UWorld class like NotifyMessage or ControlMessage that checks to see if the UNetDriver contains a valid UNetConnection. That function handles calling SpawnPlayActor depending on whether or not the client is seamless traveling

#

@bleak lily that's a pretty broad question.

You need to have a CPP project in order to build a dedicated server, including a source built version of the engine because the pre-compiled binaries from the epic launcher do not include the the build targets for servers

bleak lily
#

I tried using the source built version of ue4 but it didn't work

hollow stirrup
#

Is your project a CPP project?

bleak lily
#

yeah

hollow stirrup
#

Also did you add a server target to your project?

bleak lily
#

probably not because idk what that is lol

#

oh I should probably be more specific, me setting up the ue4 source doesn't work

hollow stirrup
#

what didn't work?

#

Did it not compile?

bleak lily
#

I downloaded the ue4 source folder

hollow stirrup
#

Were you unable to get a solution file?

bleak lily
#

and I am supposed to do the setup and generate new project right

hollow stirrup
#

yes

bleak lily
#

yeah that didn't work

hollow stirrup
#

did you get a error message? I can't help you if the only thing I know is it didn't work

bleak lily
#

well the setup was at 99 percent and got an error yesterday

#

but now it is just stuck at checking dependencies

hollow stirrup
#

Well, it's probably not stuck

#

it's just doing what it says

#

How long has it been on that message

bleak lily
#

idk like 10 minutes

#

it didn't do it last time though

hollow stirrup
#

@civic light Need a little more context on your question

bleak lily
#

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(
1179,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.6.2" were not found. To resolv
e this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the f
ramework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global
Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly ta
rgeted for the framework you intend. [C:\Users\luker\OneDrive\Documents\GitHub\UnrealEngine\Engine\Source\Programs\Unre
alBuildTool\UnrealBuildTool.csproj]

#

this is the error I get when opening the generate project files bat

hollow stirrup
#

The answer is right there

#

You are missing the NetFramework 4.6.2

bleak lily
#

thanks

#

it should work after that?

hollow stirrup
#

Well, maybe. It might error out again, if it does just read the error message and do what it says.

#

The error messages are usually pretty straight forward

bleak lily
#

.NET Framework 4.6.2 or a later update is already installed on this computer.

#

I get an error trying to install it

hollow stirrup
#

@worthy wasp did you get a error message in your dedicated server log?

#

@real yacht Yeah I have experience with GameLift unfortunately

#

What did you need help with

#

@dusty stone I mean, if I understand your question properly you want to run your game with a viewport. You can do that by creating your own UGameEngine class

#

dunno why you would want to though

dusty stone
#

i'm running the engine as a tcp/udp server w/ game logic

#

have no use for the regular networking it launches

hollow stirrup
#

I mean, having a custom socket server is fine. But you'd normally have that be a separate thing and then write your own custom network layer that can communicate with said socket server

dusty stone
#

trying something a little different here

hollow stirrup
#

@vagrant hemlock don't do what @red musk suggested, that's a very bad idea. The GameMode has a few functions that handle default spawning behavior. You can override those. Don't spawn your character in PostLogin lol

winged badger
#

like say, HandleStartingNewPlayer

grizzled stirrup
#

@hollow stirrup Thank you very much! It seems from the log tests I've done that PostLogin gets called only once, when the client joins the initial map then it doesn't get called again while seamless traveling

winged badger
#

its not meant to, that gets called when you log into the server

#

seamless travel never breaks that connection

grizzled stirrup
#

Perfect!

#

Slowly getting to grips with the framework and when things are called

winged badger
#

see HandleSeamlessTravelPlayer for its PostLogin equivalent

grizzled stirrup
#

In this case I'm actually using it as a way to test far later into the game without having to play through as there are some initial things happening on the first round which I do at PostLogin

#

But since it's only called once, I don't have to check if it's the first round and can just call it on PostLogin- it doesn't matter if it's round 1 or round 40, It'll init nicely

#

Which means flexible testing at any point in the game

#

Thanks though there's bound to be stuff I'll need to do per travel that I'll use HandleSeamlessTravelPlayer for

remote lichen
#

What would be the equivalent for BeginPlay, as that's not called after seamless travel either?

winged badger
#

BeginPlay is last step of the Actor contruction

#

for an actor that was constructed on another level, then transferred, there is no BeginPlay

remote lichen
#

Right, so I'm using OnPosses at the moment ... I guess that's the only thing I can use to do stuff after travelling

winged badger
#

yeah, that won't get called either, if you're persisting the player pawn

remote lichen
#

Hmm, it is on the controller ... it was the only thing I could find!

winged badger
#

if your PC and Pawn are presisting through seamless travel together

#

the Pawn comes pre-possessed

#

to the new map

#

override HandleSeamlessTravelPlayer or HandleStartingNewPlayer if you need something extra

remote lichen
#

Interesting ... so I'm not doing anything to preserve anything, just calling ServerTravel ... properties are saved to disc and then loaded ... so given what you've said above Begin play should be called ... or do the pawn and controller from the previous level get preserved automatically?

#

I'll look into those functions, thanks

winged badger
#

controlled does... pawn can get carried over by the controller

remote lichen
#

Ah ok, thanks

winged badger
#

they are not saved to disk, they are kept in memory

remote lichen
#

so it's working here by happy accident ๐Ÿ™‚

#

I'm saving properties myself in a save game file and loading after travel

#

So I wonder why OnPossess is being called now ...

red musk
#

Reposting this since I am still stuck on it ๐Ÿ˜ญ

Hey everyone, I have a question about DestroySession. This call seems to not work as I expect when a client calls it, as it is:

  1. Not triggering the Logout callback on GameMode
  2. Not actually stopping RPC calls from happening. The client that calls DestroySession in an attempt to disconnect from the server still is "connected" in that it receives RPCs and RepNotifies from the server

Can anyone provide some insight on how to use it properly and/or what I am missing please? I'd really appreciate it!

lost inlet
#

@grizzled stirrup nothing readily exposed to BP but you can enable GetWorld()->NetDriver->bCollectNetStats and you can read everything from the NetDriver's ServerConnection, recommend polling every half second

grizzled stirrup
#

Great thanks a lot!!

#

Will be really useful

lost inlet
#

it'd be good if there was a delegate in the engine around line 896 in NetDriver.cpp just before the stats get reset but there isn't, but you could always modify engine source for it

#

actually i'm investigating whether you need bCollectNetStats, you can reset In/OutPackets and In/OutPacketsLost each collection your game does

lost inlet
#

not required, nor is a manual reset

spare ridge
#

Hi, I have defined UFUNCTION(Server, Reliable, WithValidation) and as from docs AddTorqueServer_Validate and AddTorqueServer_Implementation, but it gives no member error. How is this fixed?

vagrant hemlock
#

I am using onlinesubsystem null for android local multiplayer but when i try to join a session i am not able to join please help

cinder quartz
#

Does anyone have any idea how to do player death with ragdoll, so that the ragdoll and root collision capsule stay in same place? Right now, If I enable ragdoll, mesh get's separated from capsule if that makes sense. IF anyone played ARK, when you die there, you ragdoll but your camera still follows the ragdoll and it ends pretty much in the same place for every player. I dont care if hand or leg is in different pose, but I would like to have the "root" in same place for every player.

twin juniper
#

ooh I run onto this issue i guess

#

I had a ball with a collision attached to it and when you enable physics it gets seperated

#

I Think there is a work around that lemme think

#

you can attach the camera to the ragdolling mesh

#

instead of trying to figure out that

#

do you really have to do it that way ?

#

Question : Why cant I access Timerhandle on the clients, It activates it just fine and I debugged it but its not giving me the remaining time when I bind it to Widget

#

it goes to minus one

#

I did fail to do it before as well and couldnt find answers and I made the timer on the client

#

but I dont really want that since it is a major feature

jolly siren
#

What is the difference between WITH_SERVER_CODE and UE_SERVER ?

meager spade
#

i don't see WITH_SERVER_CODE

#

ah

#

WITH_SERVER_CODE is the UBT set version

fleet raven
#

one is probably for whether the build can host a server (editor, normal, dedicated) and the other for whether the build is specifically a dedicated server

hollow bridge
#

What is the best practice for ineracting with actors in the world? Should I check the line traces both in client and server? Or just send the server the hit actor?

fleet raven
#

depends on whether you care about the client hacking

#

in a non-competitive game, it doesn't matter, just check everything on the client for max accuracy

royal isle
#

You could check if the actor is in the actual range allowed in the validation function of the RPC

hollow bridge
#

I care , thanks I'll send the actor and make some validations in the server

twin juniper
#

umm does noone know why my timers are acting this way ?

#

it does not replicate as I expected it to

#

should I create a local timers as well to show player time left

split nova
#

FYI: It is not because the two players are colliding. I've tested it with two separate spawn points, it was just easier to not put two spawn points down for the sake of a video.

distant talon
#

the clientside commands arent getting sent to the server and the server just corrects the wolf back?

#

after it moves slightly

#

do you know how setting up client/server movement stuff works in general

split nova
#

Not exactly, I vaguely understand networking in general.

That first message does make sense though, I just wouldn't know how to fix it :/

#

I mainly just know that stuff is sent from the client, to the server, like input, and the server reviews it and sends it back in a different position or something?

twin juniper
#

characterMovement component although bloated in nature should work out of the box here

grizzled stirrup
#

Are there any ways to reduce jitter when spectating other players using SetViewTarget?

#

It's pretty much unwatchable by default

#

The jitter is acceptable at 0ms ping, but as soon as latency gets involved it becomes harder and harder to watch

split nova
#

Do you mean the second window I opened for the secondary character? That was harder to watch because it was actually colliding with the other one but the first character I moved (When it was in multiplayer) is the same as the second.

winged badger
#

@grizzled stirrup the mesh gets interpolated, not the capsule

split nova
#

BTW, you'll have to talk noob to me because, although I'm not new to UE4, I only really know what I use frequently or need to know to get my stuff working, not much else :/

grizzled stirrup
#

@winged badger I'll try fiddle with some of the CMC listen smoothing stuff they added

#

Though it is present in Fortnite too but not as bad

winged badger
#

meaning

split nova
#

Oh, I thought you were answering me @grizzled stirrup not asking a question haha. My bad.

winged badger
#

to have a smooth experience

#

you need to be viewing the mesh, not the root

grizzled stirrup
#

Ah I see

#

I did try that but it doesn't accept components it seems

#

Only Actors

#

In the SetViewTarget

winged badger
#

so make some SpectatorPawn

#

add it a SprintArm and a Camera

#

and just Attach it to the SkeletalMesh

#

instead of setting ViewTarget

grizzled stirrup
#

Super simple!

#

Thanks

#

That sounds very promising

#

Will be harder to drive what the viewer is looking at

#

But it's better than lag

#

And jitter

winged badger
#

it won't its a Pawn

#

it can have its InputComponent

#

and its a possessed pawn no less

grizzled stirrup
#

I mean what the player that is being spectated is looking at

#

It's nice that SetViewTarget essentially mirrors exactly what the other player is viewing

#

But I'm sure it's possible with the pawn setup too

winged badger
#

you can just bind to a delegate when you attach

#

and have the handler do that

#

match the viewpoint

grizzled stirrup
#

Ah great thanks! Will try it out

rose egret
#

will properties with default value be replicated when actor spawned?

thin stratus
#

Well the default value will be used when spawning anyway?

rose egret
#

nvm

#

can a client connect to a seamless traveling world ?

steady aspen
#

Is this completely wrong? The client can see when the server does this but clients and servers cant see other clients do this

twin juniper
#

is LhandHolding false on other clients too ?

steady aspen
#

When server pick up it says false on server and on client. When client picks up it only says false on the client

#

With print string

fleet raven
#

you accidentally marked ServerPickup as run on client instead of run on server

steady aspen
rose egret
#

how do I load assets of a level asynchronous.
I want to load the assets when player is in the main menu. then after matchmaking client connects to the lobby and lobby transfer the users to game map using SemslessTravel.

gleaming vector
#

asset manager

split nova
#

Can you use root motion for everything for a multiplayer game? If so how?

hollow stirrup
#

@steady aspen why is Pickup a multicast

steady aspen
#

Because everyone needs to know he picked it up

#

I think

hollow stirrup
#

That doesn't make any sense. Have the ServerPickup be a run on server which calls Pickup()

#

Pickup shouldn't be a multicast

steady aspen
#

Ok thanks Ill try that

hollow stirrup
#

There is better ways of doing that

steady aspen
#

Can you tell me how?

#

I have been messing around with this for so long and I dont understand why it wont work

hollow stirrup
#

Well, the best option I can think of for Blueprint would be using a RepNotify

#

The function that a RepNotify generates runs on all relevant clients by default

steady aspen
#

Which function?

#

I think the best would be to redo the entire pickup and drop

#

Could you help me out?`

hollow stirrup
#

Sec

#

So, you have your pickup input. Have that check if the client is already the server, there is no reason to push an RPC onto the actor channel if you are already the server. If you are not the server, call the ROS RPC which is just a callback to Pickup(). In the pickup function, handle all of your pickup logic such as adding it to the player's inventory. Once all of that is done, you can destroy the pickup actor as it should no longer be in the world. If you wanted it to stay in the world, you can set it to be a dormant object so it doesn't send network updates while it's not being used, and if you need to use it again you can do a ForceNetUpdate().

steady aspen
#

I am attaching it to my players hand

#

What should I do then?

hollow stirrup
#

You should still have some sort of concept of a inventory. You can still do that, I am guessing you are attaching the world actor directly to your character which isn't a good idea. You want to have some concept of an inventory system that can keep track of things you are adding to your player and can construct items from data instead of using hard references to actors spawned by the world.

steady aspen
#

Ok thanks then I will destroy the world actor on pickup

#

I deleted all the code so I can start over and make a clean code

#

Could you either show me how the blueprint should look like or do it on teamviewer?

meager spade
#

i dont destroy the world actor on pickup

#

when i drop a weapon, it disables skeletal mesh and everything

#

and shows a static mesh

#

this is still the same weapon, when someone picks it up, it remembers its state like how much ammo in clip etc

hollow stirrup
#

The problem with that is actor ownership

#

If you do something like that you have to make sure you manually set the owner

meager spade
#

@hollow stirrup ofc

#

it works fine with multiplayer and dedicated server

#

@lament cloak i had that issue with spawn deffered

#

i stopped using it, realised i don't need to

#

@hollow stirrup void AKaosItem::SetOwningPawn(AKaosPawn* NewOwner) { if (IsValid(NewOwner)) { OwningPawn = NewOwner; Instigator = NewOwner; SetOwner(NewOwner); } else { OwningPawn.Reset(); SetOwner(nullptr); Instigator = nullptr; } }

#

this is how i handle the owner setting

#

works pretty well

#

how are you attaching it

#

i just call AttachToComponent for my weapons

#

yeah but i don't get flashes

#

oh wait

#

i hide the mesh

#

before attachment

#

and show it once its attached

#

actually i don't

#

i clear the hide before attachment

meager spade
#

nah issue is replication

#

its spawning the actor at 0, 0, 0 which is wrong

#

it should spawn it at the same location you supplied

#

so something is iffy

empty axle
#

I have got a problem with Replication Graph. I have actors that have spatialize dynamic policy set and 150m relevancy distance, no other of their replication settings were changed. And when our dedicated server have a lot of people on it, this actor stops replicating to certain clients for some reason, so not everyone can actually see it. With only few people there is no such problem. What's the cause of that?

rose egret
#

is is possible to seamlessly connect (for the first time) to the server ? I want to let the player select his hero and options while loading the game map. btw I want to decrease the load time as much as possible

meager spade
#

character selection should be done before travelling

#

map load times are quite common in games

trim skiff
chrome bay
#

highly possible that either the gamestate or the player isn't valid at the point you're making the widgets

#

Or that the Player Name hasn't replicated yet etc.

#

You always have to write multiplayer game UI's in a way where they can handle getting data late.

trim skiff
#

So, it could be because I am calling that event on Construct?

#

I should mention that it manages to get the score properly at all times, though.

chrome bay
#

well PlayerName isn't replicated

#

There's a specific function for "getting" a players name

#

But as it stands that will only show you the values of those variables when you create the widget

trim skiff
#

I do create it every time I press TAB, though. But I guess replication is the problem.

#

After checking out the C++ code behind the scenes, the GetPlayerName() method seems to return the value properly for clients as well. Thanks for help indication.

grave scarab
#

Is there a way to use google cloud as the web server for unreal engine using the varest plugin? I was following a youtube guide on using varest and they use a free hosting site and created a domain to communicate with the plugin. I already have an instance in google cloud for the database and was wondering if I could use that to communicate with unreal instead of using the free hosting site

winged badger
#

@trim skiff @chrome bay you have to use the function as of 4.22

#

as the name is in PlayerNamePrivate, which is, well private

#

and the PlayerName still exists, but is deprecated

#

and no longer replicated, iirc

#

sorry, Jamsh, there was no need to tag you there

chrome bay
#

Haha all good, yeah I had a feeling there was a function for it

upbeat hound
#

So I have a problem with showing a umg in a networking setting. I'm not sure if the problem is with networking or with umg, but if you're kind and interested to help, please check the #umg channel (so that I don't post it again here)

somber glade
#

@thin stratus Did you give anymore thought as to why onrep_controller doesn't seem to be firing for me in PIE?

thin stratus
#

Not really, sorry!

winged badger
#

@upbeat hound that a c++ or BP OnRep?

upbeat hound
#

BP

winged badger
#

and your variable is set correctly in the widget itself?

somber glade
#
{
    Super::OnRep_Controller();
    UE_LOG(LogTemp, Warning, TEXT("ONREP FIRING"));
    K2_OnRep_Controller();
}```

In PIE with "dedicated server" checked and the player showing as "client1" this is never called on possession of the character.
upbeat hound
#

Last I checked yeah. Someone in umg channel is suggesting a solution

somber glade
#

I don't get any prints.

rose egret
#

is it right to connect to a seamlessly traveling world?

#

I don't want to wait for late users in lobby map.

winged badger
#

if they are already in lobby, they get pulled during travel

clear salmon
#

@somber glade So i believe i can help you with your problem if you are still looking

winged badger
#

if they are not they can do a normal server connection to the game map after the fact

rose egret
#

someofthem may not be in the lobby

#

๐Ÿค”

#

another question. can I increase the tickrate of transition level. its to laggy

winged badger
#

but the first connection they make to the server cannot be seamless

rose egret
#

and am I allowed to do replication and RPC in transition level?

winged badger
#

your game thread is loading stuff, tickrate won't help

clear salmon
#

@somber glade on rep notify will only fire when that variable on the server changes. So if your controller variable isnt changing on the server then its not going to fire.

winged badger
#

and you shouldn't do anything in transition level

#

except show some widget that doesn't look frozen while its loading

somber glade
#

@clear salmon I was told onrep_controller is called when a controller possesses a pawn?

winged badger
#

its called when a variable Controller replicates

somber glade
#

then what is called on the character when a controller is told to possess it?

winged badger
#

OnPossessed, server side

#

or something similar

#

SetPawn is a commonality in server/client possession calls

somber glade
#

is nothing called client side?

winged badger
#

its called from both Possess and OnRep_Pawn on the Controller

rose egret
#

the game we are making is something like Apex Legends.(in terms of matchmaking )
currently this is my solution for traveling to game:
after a successful matchmake a new server is launched with lobbymap.
game clients connect to it.(for the first time)
in the lobby users of each squad select their hero and weapons.
then server call a seamless travel to load the game map.
I know its not much hard. but my goal is to decrease the load time as much as possible. like selecting hero and weapons in transition map.
do u have any suggestions for faster loading?

winged badger
#

you have your game working fully yet?

rose egret
#

not that much but I am making a prototype. but my matchmaking half works

winged badger
#

transition map will not wait for you to press ready

#

as soon as target map is loaded, it will toss you there

#

so its really awful for setups

rose egret
#

hopefully I don't have ready button. if players connect late random weapon and hero will be selected by server.

winged badger
#

i wouldn't even consider putting an effect into lowering load times

rose egret
#

๐Ÿค”

winged badger
#

until a result of a full alpha told me i need to

#

sure, can do some preliminary work, like using SoftObjectPointers and AsyncLoading assets as needed before then

#

but trying to hack a seamless travel system to reduce the player perception of loading, hell no

#

and few things would be as frustrating to me, as a player, as if your transition map tossed me into game map just as i was about to make a change on my character setup

rose egret
#

I tried to load the assets of the game map asyncly in the main menu. but It didn't help that much.

#

maybe I did it wrong

#

how do I preload the assets of a level?

winged badger
#

there is a problem there

rose egret
#

thats what I used.
FSoftObjectPath levelPath(TEXT("/Game/STTest/STGameMap")); TSharedPtr<FStreamableHandle> handle = UAssetManager::GetStreamableManager().RequestAsyncLoad(levelPath, []() { RUSH_LOG(Warning, "MainLevel Loaded"); });

winged badger
#

aync loading callbacks hold a hard pointer to the loaded asset only during their scope

#

if something... persistant doesn't take and copy that pointer

#

poof

#

like you never loaded in the first place

rose egret
#

so u mean I have to save the UObject* result somewhere?

winged badger
#

a UObject that survives the level transitions, no less

#

so it would be fair to say that the that async load didn't help at all

#

your level is loaded only during the lifetime of that lambda, then promptly GCed

rose egret
#

I am a little confused. traveling will unload the loaded assets?

#

what If I keep the UObject* in GameInstance

winged badger
#

not keeping a hard poitner from root to loaded asset will get it GCed

rose egret
#

๐Ÿค”

grizzled stirrup
#

Should properties that get copied over on the PlayerState with CopyProperties() be public?

#

I guess it doesn't matter actually, you'd just use setters in CopyProperties if there weren't

covert gorge
#

I would be really grateful if someone could help me with one thing related to character movement

#

i have implemented a custom action using this tutorial

#

the problem is that, when you want to add extra information about an action (for example teleport location)

#

in this guide, they use an unreliable server RPC to set that extra information (that may be received after the server processed the teleport movement petition)

#

does anyone know how to add custom data to a character movement move? (sorry for my english)!

fluid prawn
#

Question Regarding the GameNetwork Manager ini file, If I set ClientAuthorativePostion = true will that guarantee that rogue clients can speed hack my game?

#

Even if its tied to MaxPositionErrorSquared?

winged badger
#

sounds about right

#

you could still run a server side location comparison for the clients

#

on occasion

#

see if they are moving faster then they should be

fluid prawn
#

@winged badger I'd assume I can maybe tie velocity to an RPC and then just check that is within a threshold?

#

right now I have pretty fast movement because Im doing an arena shooter

winged badger
#

you can just read the current/last tick location on the server, and see if your velocity can make that transition

fluid prawn
#

so its a pain in the ass to scale that to the input

#

and do it on the server

#

it's kind of hacky because I Set max speed and accel to high values

#

and the I block input

#

and it works

#

but very hacky

winged badger
#

it will be hackier once your players get their grubby little hands on it ๐Ÿ˜„

fluid prawn
#

how so?

winged badger
#

i mean, anything client auth is very easy to hack

fluid prawn
#

the server still has authority on input i beleive

winged badger
#

input? server isn't aware of client input

#

until its RPCed

fluid prawn
#

its tied to acceleration

#

Accel is clamped to input

#

so say max accel is unno 2048 units

#

so at 1.0 i send the server 2048

#

server does that check

#

since I am doing strafe jumping I am changing my accel a lot depending on a dot product

#

so I put an upper limit on accel and block input based on what i set to be max

#

does that work?

winged badger
#

the only way to block input so that it can't be hacked is not to have a possessed pawn, i believe

fluid prawn
#

hmm well I am doing it artifically

winged badger
#

but client auth movement means that your client calculates the position, then just hands it to server

fluid prawn
#

correcto so I am doing client side acceleration

#

calculation

#

and send it to the server

winged badger
#

so there is very little you can do to prevent client to set his acceleration to 10x max

#

you can only catch him after the fact

#

you could make a backup variable for acceleration, hash/split it into multiple variables

#

then when its accessed check if it varies from what was set on last SetAccelleration call

fluid prawn
#

yea

#

very good idea

#

can you maybe replicate a bool

#

for speed

#

for blocking input

#

so the bool will block input based on if the accel i calculated is greater than what max for that delta time

#

so bReachedMax accel is true then block input

winged badger
#

that can also be hacked locally

#

server doesn't check if client still has the last value sent over... ever

fluid prawn
#

hmm okay

glossy karma
fluid prawn
#

ya I have that PDF

somber glade
#

How many times should "setpawn" be called when you start a game? Just started in PIE with dedicated server and 1 client. Set a blueprint node to be called from setpawn, on start, where only 1 pawn is possessed, I got the following output: LogBlueprintUserMessages: [Steam_VR_Player_Controller_C_0] Server: SetPawnCalled LogBlueprintUserMessages: [Steam_VR_Player_Controller_C_0] Client 1: SetPawnCalled LogBlueprintUserMessages: [Steam_VR_Player_Controller_C_0] Server: SetPawnCalled LogBlueprintUserMessages: [Steam_VR_Player_Controller_C_0] Client 1: SetPawnCalled LogBlueprintUserMessages: [Steam_VR_Player_Controller_C_0] Client 1: SetPawnCalled LogBlueprintUserMessages: [Steam_VR_Player_Controller_C_0] Client 1: SetPawnCalled LogBlueprintUserMessages: [Steam_VR_Player_Controller_C_0] Client 1: SetPawnCalled LogBlueprintUserMessages: [Steam_VR_Player_Controller_C_0] Client 1: SetPawnCalled

#

even if I start a non-dedicated server game, setpawn gets called 3 times

meager spade
#

yeah thats about right

#

SetPawn is called alot

#
LogTemp: Warning: SetPawn called
LogTemp: Warning: SetPawn called
LogTemp: Warning: SetPawn called
LogTemp: Warning: SetPawn called
LogOnlineSession: Warning: OSS: No game present to join for session (GameSession)
LogTemp: Warning: SetPawn called
LogTemp: Warning: SetPawn called
LogTemp: Warning: SetPawn called
LogTemp: Warning: SetPawn called
LogTemp: Warning: SetPawn called
LogTemp: Warning: SetPawn called
LogTemp: Warning: SetPawn called
LogTemp: Warning: SetPawn called```
#

thats with 1 client and dedicated server

somber glade
#

Okay. It's the only function that i've found that is reliably called on the client when a controller possesses a new pawn, so I guess I'll have to set up a boolean to make sure it only calls my initializer function once on the actual pawn.

graceful cave
#

is it possible to send an int64 through an rpc?

#

its coming out as 2147483647

meager spade
#

what did it go in as?

graceful cave
#

a big big number

meager spade
#

so its only passing it as a int32?

graceful cave
#

looks like it

#

its just a steam id though

#

can send as a string but the optimization was convenient

meager spade
#

not sure but that number is def the max for int32

#

so looks like int64 is just dropped to int32 on replication

graceful cave
#

right

upbeat hound
#

Listen-server is acting up q.q

#

What is the correct player controller ID on the listen-server?

#

When I execute it with hasAuthority, it's -1, but when I call delegates (event dispatchers) to set visibility of HUD stuff, it prints 0, and it does NOT turn things visible

#

But in both times, it says Server: -1
Server: 0

#

FYI, Set w/ Notify in the first screenshot is called with hasAuthority=True

#

Now why does it print Server: -1

#

and when it's inside the delegate, it prints Server: 0

#

?

upbeat hound
#

I'm willing to share screen if someone wants to help me with this, I'm desperate q.q

thin stratus
#

Why is the id important?

#

That's a splitcreen feature

#

By default all local playercontrollers are 0

#

Also in the first screenshot you don't have a player plugged into the node @upbeat hound

upbeat hound
#

Oh I see, I thought it will give different ids to player controllers of different clients running on the server

thin stratus
#

Na. It's an accessor for splitcreen controllers

upbeat hound
#

In the first screenshot, I called it from the player controller, so I assumed it will take the current player controller as input

#

I seee

thin stratus
#

Doubt as the node isn't showing self

#

Most likely a const ref so it needs an actual value

upbeat hound
#

Well I may have found it's something to do with HUD construction? still strange behavior..

#

I see.. well yeah all those IDs are for debugging

#

I'll remove them, but I'm not sure how does the server runs player controllers.. let me explain in a screenshot

#

So with the above setup, the client works, but never the listen-server

#

if I connect the branch on the left, the listen-server works, but not the client

#

How should I properly set up the HUD widget to players?

#

(This script is in playerController)

upbeat hound
#

It workssssssssss

#

the branch on the left was necessary, I also had to spawn inventory before the branch

soft relic
#

any reasons why sessions would show on editor but not on the built version?

odd carbon
#

If you get all actors of a class in a replicated component do those actors inherit the replication as well?

nocturne berry
#

hey guys, i'm trying to use the built in function RestartPlayer in game mode, but it is not restarting my player in the found player start. though the K2_OnRestartPlayer is being triggered in blueprints, which means that the function is not failing.
any idea what might be wrong?

high current
#

@odd carbon no. why would they

#

@nocturne berry iirc restart fonctionality needs to be manually implemented for each actor, and the gm function just calls it for everything

nocturne berry
#

@high current i've overridded the FindPlayerStart, ChoosePlayerStart, SpawnDefaultPawnAtTransform, and GetDefaultPawnClassForController

#

customized them to how i need them, all is working fine, except for when the player was already spawned and i call the restart player function, it does nothing

#

but if i destroy the pawn, and call RestartPlayer then it spawns the pawn in its correct player start

#

but i really don't want to destroy the pawn, cuz i want all the data in it

high current
#

well in that case it looks like you would need to move it to your default transform then, upon the K2_OnRestartPlayer

nocturne berry
#

manually? ๐Ÿ‘€

#

i actually don't see in code where they would move the character back to his player start...

#

so i guess it's meant to be manually o.o

high current
#

its meant to be something you manually do yourself if the pawn is alive

#

afaik

odd carbon
#

@high current Having a bug that's making me question my assumptions on things. I have a texture mesh that refuses to work in headless dedicated server mode and nothing else.

#

It replicates and resets the clients even though nothing is set to replicated except the grenade that explodes and causes it

high current
#

Welll, I am assuming that texture mesh is cosmetic, and if it is. I would suggest putting cosmetic stuff on a RepNotify

odd carbon
#

It's sort of not, mechanics happen based on if you are standing on it or not. Also I already tried that and I still get the same blinking to unpainted. It works fine as long as the server is a player, but the moment I use a dedicated server it fails

humble zealot
#

Hey, when I try start a dedicated server from unreal editor, it has black screens on both clients. Then my world outliner has nothing in it. But has stuff in it before i press play

#

Has anyone got a solution

odd carbon
#

@humble zealot Could be a bunch of things. Does it work without dedicated servers?

#

I'm wondering if my issue is because of render targets, but if I just has authority remote on it, the system renders correctly on the client so something somewhere somehow is replicating.

humble zealot
#

shows on "server" but not on client

#

its so confusing

humble zealot
#

if anyones able to help me id love that

#

im a few weeks from opening a test for my community an this is one of the problems

nocturne berry
#

hey guys, if i'm teleporting a pawn to a location on the server, it sometimes take time to correct the position on the clients.
is there a way to instantly correct the location of the clients? something other than a multicast (idk if multicast is a good idea in the first place)?

stark echo
#

Hi I want to do a weapon blueprint that can be customized into other guns and work on multiplayer can someone show me how, I didn't find a tutorial.

high current
#

@odd carbon then that should be its own replicated actor spawned from the server

empty axle
#

Hey, will dormant actor on server replicate all past properties to client that just joined the server and then go dormant for this connection?

worthy perch
#

Hello, I am tremendously confused by this online subsystem stuff, particularly with Steam.
OSS's are intended to make crossplatforming easier, but I have heard that is not true in practice?
Furthermore, OSS Steam does some very weird things, with PlayerIDs and the NetDriver on a dedicated server.
Is using OSS Steam recommended?

chrome bay
#

OSS is what you want to use in general, cross-platform or not

#

If you want to use something specific for a platform you'll need to do that another way

#

e.g, something like steam trading cards or workshop

#

Generally speaking however for common online features it's preferable to use the OSS IMO, and keep game code platform-agnostic

worthy perch
#

Alright, thank you Jamsh. OSS it is.
Guess I'll just have to learn the nuances of OSS Steam.

chrome bay
#

The game code that interfaces with the OSS shouldn't care about what platform your using, that's the point of it

#

ShooterGame shows how to use it

worthy perch
#

Well, the only real problem I had in the past was with how Steam handles the dedicated server (haven't tried with a listen server).

chrome bay
#

E.g. you don't pass a CSteamID around game code, you pass an FUniqueNetID etc.

worthy perch
#

And I had ideally wanted to allow IP:port connecting, but that is not supported by default.

chrome bay
#

Hmm not sure what the issue is, we're using dedicated servers via Steam without issues

split gust
#

the Steam network thing doesn't use IP:Port

#

Steamworks at least

worthy perch
#

Okay, sounds good. I definitely have to learn how to use it in the way it wants.
I appreciate the responses.

humble zealot
#

A video of my problem

#

this is getting of my nervsssss man

tame tundra
#

@humble zealot do you have default player start? Do you have default pawn at the gamemode?

humble zealot
#

yes

#

i have both

tame tundra
#

@humble zealot make a screenshot of advanced settings at play please

humble zealot
#

i just got it working

#

i turned off Auto Connect to Server

#

and is now running dedi server

tame tundra
#

yeah

#

that what I thought)

humble zealot
#

so annoying lol

#

now i can continue

#

interesting

#

even if i have "run dedicated server" checked under play

#

it doesnt launch a server and client window

#

just 2 standalones

empty axle
#

If you select run dedicated server then you will never see server window

#

@humble zealot

humble zealot
#

on both ticked or not

#

its just "standalone"

meager spade
#

dedicated server has no visual representation

#

its headless

#

all rendering is stripped out

humble zealot
#

so how can i see if a mp map is working

meager spade
#

so you will only ever see clients

humble zealot
#

it used to work

meager spade
#

well your players are on there own map

#

cause they have not connected to the server

#

thats why they cant see each other

#

you need to connect them to the server

humble zealot
#

how does one do that from editor

meager spade
#

normally auto connect handles it

humble zealot
#

yeah an its black

#

world outliner is gone

meager spade
#

but in beginplay you can call open localhost 7777 on your client for testing

#

but autoconnect will connect to the server

humble zealot
#

it works fine if i use a blank project

#

so its just my project

meager spade
#

yes but its your level

#

is it a normal level?

#

like blank level

humble zealot
#

yes

meager spade
#

i mean not streaming or nothing

humble zealot
#

no

#

its worked before

#

and now it doesnt

meager spade
#

does the player load/

#

or is it just nothing

humble zealot
#

1 player loads

#

but with auto connect on

#

its all black

meager spade
#

thats cause they have no map

#

dedicated server works finefor me

humble zealot
#

what you mean its cause they got no map

meager spade
#

click view opens

#

view options*

humble zealot
meager spade
#

choose world

humble zealot
#

yeah view options

meager spade
#

then server

#

do you see anything

humble zealot
#

when i press play

#

view options

#

then server

meager spade
#

yes

humble zealot
#

yes i do see all items

#

but not on the client

meager spade
#

now select client

#

then client isnt loading a map

humble zealot
#

no no i mean it doesnt show on the actual pop out game window

meager spade
#

eh?

humble zealot
meager spade
#

when you click server

humble zealot
#

on both it shows

meager spade
#

right

#

then when you select client

#

(Untitled)

humble zealot
meager spade
#

is the worldoutliner empty?

humble zealot
#

only "auto" is empty

#

when i press start play

meager spade
#

right so thats a client

#

means they have no map

humble zealot
#

how can they not have a map

meager spade
#

have you changed anything in gamemode?

#

or you using the built in spawning at a spawnpoint

humble zealot
meager spade
#

is this a complete bp game?

#

no c++ code?

humble zealot
#

yeh bp

meager spade
#

goto project settings then play

humble zealot
#

you can play from project settings?#

meager spade
#

err i mean editor settings

#

are your settings the same

humble zealot
#

my port is 27015

#

not sure why mine is different

meager spade
#

๐Ÿคท but is the rest of it the same

humble zealot
#

ye

meager spade
#

well without physically looking at your project

#

we could be here all night

humble zealot
#

shall i reset all my editor prefs

#

an project

meager spade
#

seems a bit rough

humble zealot
#

im going to move my map to a new project

#

see if that works

twin juniper
#

any help with this please?

spring swift
#

Hey! I'm in need of some help, i still haven't been able to over come a problem at the moment. to sum the problem up I'm making a game that uses the steam API and so far it has been good, the steam API worked fine in the editor, but after packaging the game into a shipping build or Dev build the steam API disappears. cant even use it. if anyone has a fix it would be nice. Thanks ๐Ÿ™‚ Please @spring swift if you have a answer


DefaultEngine.ini has all the needed changes

Steam SDK on Unreal is up to date```
meager spade
#

@twin juniper you don't replicate timer handles

twin juniper
#

hmm so how do I show the time left to clients

#

such as ability cooldowns

#

create one locally as well ?

meager spade
#

yes

#

client should simulate

#

less replication the better

#

and for ui stuff, it should be simulated as much as possible

#

client can get the cooldown time

#

via the effect

silent sigil
#

I'm doing level travel with the steam subsystem in 4.22.3 and on world travel the client crashes with a back AckCount.

#
EpicAccountId:be6834c1b4654047bcdd657f4a45cd81

Assertion failed: (SIZE_T)AckCount <= AckRecord.Count() [File:D:\Build\++UE4\Sync\Engine\Source\Runtime\Engine\Private\Net\NetPacketNotify.cpp] [Line: 28]

Hush_Win64_DebugGame!FWindowsErrorOutputDevice::Serialize()
Hush_Win64_DebugGame!FOutputDevice::LogfImpl()
Hush_Win64_DebugGame!FDebug::AssertFailed()
Hush_Win64_DebugGame!FDebug::CheckVerifyFailedImpl()
Hush_Win64_DebugGame!FNetPacketNotify::UpdateInAckSeqAck()
Hush_Win64_DebugGame!FNetPacketNotifyTestUtil::PretendAckSequenceNumbers<TSequenceNumber<14,unsigned short> [6]>()
Hush_Win64_DebugGame!UNetConnection::ReceivedPacket()
Hush_Win64_DebugGame!UNetConnection::ReceivedRawPacket()
Hush_Win64_DebugGame!UIpNetDriver::TickDispatch()
Hush_Win64_DebugGame!UPendingNetGame::Tick()
Hush_Win64_DebugGame!UEngine::TickWorldTravel()
Hush_Win64_DebugGame!UGameEngine::Tick()
Hush_Win64_DebugGame!FEngineLoop::Tick()
Hush_Win64_DebugGame!GuardedMain()
Hush_Win64_DebugGame!GuardedMainWrapper()
Hush_Win64_DebugGame!WinMain()
Hush_Win64_DebugGame!__scrt_common_main_seh() [d:\agent\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
kernel32
ntdll```
raw quarry
#

I'm trying to find the best way to have my Unreal dedicated server communicate with my authentication (node.js) server

#

is there a good way to set up a TCP client from Unreal?

#

it seems it can only be used as a TCP server currently

#

unless i'm mistaken

lost inlet
#

@twin juniper serverworldtimeseconds (i think it's called) on the gamestate is a "good enough" estimation of the time on the server

#

but cooldowns probably need to be more precise

#

depending on how well you're predicting abilities, you might not even need to network that time

#

@spring swift you need to be more specific, did you fill out some of the steam-related project definitions in your Target.cs file?

spring swift
#

I dont think i have @lost inlet the Unreal documents didnt mention this?

lost inlet
#

it's like all here

spring swift
#

ah ok, ive just check the file and they are all good the steamworks one, just gonna do a sweep

#

uhh. welp new error popped up

#

Project Leviticus

Would you like to rebuild them now?```
#

i believe i can fix, ill be a bit

spring swift
#

well ive managed to destroy my project so im gonna be returning to a older version ๐Ÿ˜ฆ