#multiplayer

1 messages ยท Page 383 of 1

ember needle
#

thanks for the pointers

slim holly
#

@thin stratus have you ever seen party based P2P hosting? like 2 parties constisting of 4 players, party replicates with the party leader, who then shares the information with another party leader

#

who then shares it with the party members

wary willow
#

@slim holly talking about something like Typical MMO raid structure?

slim holly
#

afaik mmo is still one auth because of the loot

#

Im thinking data transfer between 2 listen sessions

thin stratus
#

@slim holly No. Parties that join each other have one single host. The sub leaders are just kept in a list to maintain the sub parties.

winter harness
#

@slim holly You need one authorative host ideally in these situations. If you wanted to somehow link two sepperate Listen Servers you would have to write a custom abstraction layer that communicated between the two. Far more work than just hosting a single game session and having two groups as simple abstractions within the code.

vocal dagger
#

@ember needle I also got the nickname of my players but I did so using the subsystem, just in case you need it:
ULocalPlayer* DefaultLocalPlayer = GetWorld()->GetFirstLocalPlayerFromController(); const FUniqueNetId& UserID = DefaultLocalPlayer->GetCachedUniqueNetId().ToSharedRef().Get(); const IOnlineSubsystem* OnlineSub = IOnlineSubsystem::Get(); if (OnlineSub != nullptr) { const IOnlineIdentityPtr IdentityInterface = OnlineSub->GetIdentityInterface(); if (IdentityInterface.IsValid()) { const FString& PlayerName = IdentityInterface->GetPlayerNickname(UserID); . . .

#

I wonder what nickname would the gamestate have if you are in OnlineSubsystemNull

twin sorrel
#

Hey guys, does anyone know why i am getting this error: While compiling E:\Program Files\Epic Games\UE4 Projects\FortniteProjectSource\Intermediate\Build\BuildRules\FortniteProjectSourceModuleRules.dll: ERROR: e:\Program Files\Epic Games\UE4 Projects\FortniteProjectSource\Source\FortniteProjectServer.Target.cs(8,12) : error CS1729: 'UnrealBuildTool.TargetRules' does not contain a constructor that takes 0 arguments

#

i am trying to make a dedicated server

winged badger
#

add : Base(Target)

#

to the constructor

twin sorrel
#

is that the public class bit?

winged badger
#

its c# equivalent of : Super(Target)

twin sorrel
#

i mean, where do i put it, i dont really know any c++\

winged badger
#

public FortniteProjectSourceServerTarget(TargetInfo Target) : Base(Target)

#

i can't recall if its base or Base

#

but only 2 options

twin sorrel
#

ok ๐Ÿ˜ƒ thanks, i'll try it

#

oh yeah, it's asking for lowercase

#

got it :), when i cloned the project, because things don't get renamed i have to use old naming

#

thanks @winged badger

#

when i am building the Development Server, do i have to build the whole SLN or just the proj? because the source engine takes forever to build for me

neon mango
#

I need some advice. I'm trying to replicate grabbing objects and to ensure smooth grabs I'm turning off replication of the objects position when the object is grabbed and turning it back on when the object is released. This works great in that the grabbed object is replicated accurately but there seems to be a hiccup every now and then where because replication is turned off, there is a risk of the item be desynced. Is there a better way to do this?

winged badger
#

objects here are actors?

neon mango
#

Actors are objects yes

#

but not all objects are actors

winged badger
#

you can try and do only bReplicatesMovement = false; instead of bReplicates = false;

neon mango
#

yea that is what I am doing

#

to be clear I do all this on/off ComponentToRelease->GetAttachmentRootActor()->SetReplicates(true); ComponentToRelease->GetAttachmentRootActor()->bReplicateMovement = true; ComponentToRelease->GetAttachmentRootActor()->SetReplicateMovement(true); ComponentToRelease->GetAttachmentRootActor()->ForceNetRelevant(); ComponentToRelease->GetAttachmentRootActor()->ForceNetUpdate();

#

so on grab its the inverse of release which is what you see

#

I thought this would be safe enough but like I said under certain circumstances they desync

winged badger
#

they attached to anything while grabbed?

neon mango
#

nope

winged badger
#

do you know exact conditions when desync happens and how does it manifest?

neon mango
#

I guess I need a confirmation from client that clien has the object

winged badger
#

server should never require a confirmation from client about an action it peformed

#

attaching the GrabbableActor to the Grabber might do the trick for you, depending on your game/setup

#

its Transform would become dependant on the Transform of whatever Actor did the grabbing

#

until released

neon mango
#

Client grabs, server knows client grabs, turns off replication for the object, then client thats it, then on release server knows client releases and then turns rep on for object and client releases

twin sorrel
#

Hey guys! I got my dedicated server working, although in steam it only shows up on the LAN category as far as i can tell.. There are no errors in the server console. Does anyone know what's going on?

#

i've port forwarded port 25017 and 7777, allowed the ports through the firewall

#

hmm.. if i have steam closed when i start the server, it allows me to connect to it using open console command

fleet sluice
#

@twin sorrel You need to check the internet tab from another machine. If you check it from the same machine you run the server on, you may or may not see it, because your router may or may not hair-pin the signal. This isn't predictable and avoidable. If you can't see it from another machine, there's probably some config parameter wrong with it.

#
  • Steam's range of query ports is not limited to 27017. It's more like 26950-27050. You need to be certain 27017 is the one your server is using.
twin sorrel
#

@fleet sluice what's odd is if i start the server without steam open, it shows up in my ingame server browser and other people can join using "open [ip]:7777"

#

but when i have steam open when launching the server, it doesn't show up in my ingame browser and neither me or my friend can connect using console either

neon mango
#

@winged badger Issues seems to be, Actor Movement Replication is not 100% accurate, and the more lag the more of a difference between the Actors actual position and clients perceived position. So Client can issue command to server I want to grab, server gets command eventually, executes its netmulti cast which tells the server to Grab ( I assume that is more or less instant) client eventually gets grab but now object might not be there any more from the delays in both the commands issued and Actors Replicated position so client's cast to grab fails and I'm left with the server having the client grab it but the client not seeing it as grabbed because it isn't actually grabbed client side.

#

Only reason for turning of rep is so the client can handle the object nice and smoothly

#

Trying to only replicate the action of grabbing is tricky

grand kestrel
#

Replicate movement is entirely useless the moment latency is introduced, they should either remake it with prediction and interpolation or remove it

#

Currently it does no more than deceive new devs into believing it exists

neon mango
#

@grand kestrel hmmm, yea I'm researching how to grab fast moving object in multiplayer

#

I'm not sure interpolation would help? Maybe improve? I thought they did that for character movement component

grand kestrel
#

Of course you need interpolation for corrections otherwise it teleports

neon mango
#

Do I have to just replicate some floats manually and interpolat myself?

grand kestrel
#

I wasn't actually responding to your case, I meant in generla

#

You're thinking of something different too, interpolation for client corrections isn't that simple, and there is no prediction to begin with so

neon mango
#

Yea in this case there is no prediction to benefit from

#

It's just physics moving an object

#

Hmm, tricky

#

I could try a wider cast maybe like a sphere cast

#

Gives more room to grab an object

#

Rather than a line trace

winged badger
#

sending a ServerGrab in which case server attaches the GrabbedActor to the PlayerCharacter should work tho

#

as the attachement replicates

neon mango
#

What do you mean by attachment replicates?

#

I make a physics handle

winged badger
#

AttachedParent of whatever the variable is called

neon mango
#

Never use attach

#

Physics handle grab component is what I use

#

I use net multicast reliable to do the grab

winged badger
#

at about the same time you turn the replication off?

#

and it has the replicated Object's NetID (reference) as an argument?

neon mango
#

Not using any net IDs. The turning off/on happens in the grab/release netmulticasts respectively @winged badger

versed socket
#

SpawnActor is crashing in multiplayer for some reason. Tried calling it from the GM and the GS thinking that maybe the replication of the actor calling SpawnActor is relevant, but that didn't work.

#

Tried adding a delay, but the problem is somehow with the SpawnActor node itself for some reason.

fossil spoke
#

You sure its not an issue with the Actor your spawning?

sudden frost
#

hey, do u know any addons to make android game multiplayer but with dedicted server?

sweet spire
#

U cant add multiplayer to a game with addon

#

Thats not how it works

tiny scaffold
#

Hi, would anyone know the proper way to restart / reset a level for example is team 1 won the game how would i make it so the server restarted the level

sweet spire
#

Just default all stuff and move people to where they need to be

tiny scaffold
#

true

#

i also found to execute a console command "RestartLevel" lol

#

lmao nvm turns out there's a function in the game mode called "restart game" im an indiot

tawny rivet
#

am still struggling with this same problem

#

Mesh is not replicated

#

There's a multicast that will ragdoll it for every player (since replication doesn't matter for dead players)

#

by disabling movement, then simulating physics on the mesh

#

I'm aware this detaches the mesh but my bug isn't related to that

#

on servers with any lag (including the default "Start Dedicated Server" in the editor) the camera will offset from the mesh in the direction the player was moving when ragdolled and stay there

#

there's no way to move it back so it focusses on the area n away from the mesh like it's on a second arm

#

spring arm offset is 0 0 0, camera offset is 0 0 0 in all cases

#

why is it offsetting

#

turning off Ignore Client Movement Error Checks and Correction immediately before detach doesn't change the behavior

#

neither does using a seperate camera for ragdolling

#

some deep part of ue4 is causing the problem and i can't find which

versed socket
#

I've done a lot of trial and error to debug the spawn actor code and regardless of what Actor I'm spawning (even if it's just a plain AActor), the SpawnActor command will crash the editor. The only way to get around it, I've found, is to select "Do not spawn" on Collision... which is really weird because even when I try to force spawn at an arbitrary point in open space it still crashes the game.

#

It only ever happens in a multiplayer context, though, which is why it's so puzzling.

brittle sinew
#

Could you show a stack trace of the crash?

versed socket
#

Sure -- the call stack in VisualStudio says that it has something to do with a Replication error. I figured that maybe since I'm calling SpawnActor from the GM that somehow that created a problem in multiplayer, but even if I try to do it from the GS instead it doesn't change the symptoms.

#

I'll screenshot the call stack in a moment here

#

I've isolated the problem to the SpawnActor blueprint node itself, which is crazy to me. My intuition said that somehow spawning in a for loop was going too fast for the server to replicate properly, but when I tried just only spawning 1 actor in total it still would crash. So I'm almost out of ideas right now.

brittle sinew
#

Hmm...what version of the engine are you on?

versed socket
#

4.16

brittle sinew
#

Looks like it's fixed in 4.18.

versed socket
#

So based on that, it looks like the crash only happens in the PIE? And so if I take my project and push it up to 4.18 then I won't have to worry about it anymore?

#

I hope that that won't cause any big problems. My project is getting pretty far along (even though it's almost all a huge amount of gameplay programming)

brittle sinew
#

I can't tell you for sure. ยฏ_(ใƒ„)_/ยฏ

#

It looks like the exact problem you're running into, however

versed socket
#

I appreciate the help though -- that link was helpful!

brittle sinew
#

I would make sure to have your project under some sort of source control before you even think about upgrading your engine, however

#

Things can go wrong, but that doesn't mean you have to bork everything :p

versed socket
#

I've got it setup using the default Git beta plugin there so I do at least have a repo that has been going all throughout the project at least

brittle sinew
#

๐Ÿ‘

versed socket
#

And since it's all programming I don't have any massive binary files

tiny scaffold
#

need some help been trying to print a string variable from a player / player state (idk which one to use to print) and im trying to make the server print the variable when i overlap a trigger box and i can not figure it out? Anyone got any idea?

tawny rivet
#

seems like the problem i was having was caused by DisableMovement

#

which leaves the camera at its predicted offset without ever moving it back

#

guess I can't use that

ember needle
#

Hello Everyone, I can't seem to understand how to persist my playerstates when I servertravel seamlessly... Besides the setting in the GameMode, what else do I need to set?

#

I am using the Event Copy Properties and Event Override With

remote sage
#

@grand kestrel - pinged the team. Will let you know when that IP is unblocked.

versed socket
#

@ember needle When you say "the setting in the game mode", do you mean just checking whether to use server travel?

#

If that's all you did, then you should know that there's another thing you gotta do: define the playerstates as transferable. Cedric_eXi's PDF thing in the pinned messages for this channel explains it specifically if you need to see how to do it

ember needle
#

If you're referring to the Event Copy Properties and Event Override With that's what I did

#

It looks like that it's the game mode you come FROM that defines the seamless travel... DUH. I was setting the destination one.

#

thank you @versed socket for the help

ember needle
#

When I do so, actors are spawned but I get no control of them whatsoever, I spawn with no possibility of doing anything

#

what am I missing?

meager spade
#

try spawndefault controller

ember needle
#

where?

#

I basically just need to retrieve the controller from a PlayerState.

meager spade
#

set the controller, then spawn default controller, spawn default controller, spawns the controller and posseses it

quiet vortex
#

Hey, is there someone who could help me out with a problem about replication?

meager spade
#

possibly

quiet vortex
#

I have a controller base that derives from APlayerController and should replicate the current interactable item (an item, that is being set by the character controller if there is an object in front of the player).

The CurrentInteractable member is being set on the server, but it doesn't replicate to the client instance of the APlayerController

#

even though the the replicated flag is set and GetLifetimeReplicatedProps is setup correctly

ember needle
#

@meager spade yeah I tried that to no avail unfortunately

gloomy tiger
#

Hello,

I'm working on a multiplayer RTS game with a third-person perspective and I achieved movement replication with AI Move To. Basically, a Player Controller owns a character, but an AI Controller is the one actually controlling/possessing it.

The problem with this approach is a laggy movementation feedback for our clients. I've read that one solution to work around this would be to reproduce the movementation on the client and only leave the server to correct if needed. The issue here is that I can't reproduce movement on the client-side because an AI only exists on the server.

Not sure how to proceed on this. Ideas? ๐Ÿค”

nimble garden
#

Could someone help me pls ๐Ÿ˜ƒ I get this error after the client tries to join a Session. I never changed the name of the map and didnt move the map. ( I use Blueprints)

toxic meteor
#

Quick Question: I'm working on an inventory system & I want the players inventory data to be stored on the server, Do I set to replicable & then when calling it use: server has auth?

eternal anchor
#

is there build in way to either get client->server ping

#

or o get approximate time withing miliseconds accuracy from server and client (for timestamps)

ember needle
#

Yes, from session data

#

See last entry in menu

pallid mesa
#

Did someone tested over here how the net update frequency affects the net performance as in what extend?

glacial hamlet
#

its going to vary as to how much is occurring that requires work, but effectively reducing it will help reduce the diff checks on data it is constantly doing

#

it can be pretty dramatic improvements, you should try tuning to be as low as possible for what works with your game.

#

(it also isn't a silver bullet, so some actors clearly need higher rates than others)

main sentinel
brittle sinew
#

The GameMode only exists on the server.

#

There isn't a separate "owning client" on which to call it, so it just executes locally

main sentinel
#

But this is a RPC event, shouldn't it run on the client?

brittle sinew
#

...what client?

#

That's my point.

#

The GameMode doesn't exist on clients.

thin stratus
#

The Client that gets passed via teh NewPlayer

brittle sinew
#

But the RPC itself is on the GameMode

#

Why not call the RPC on the PlayerController?

thin stratus
#

Ah right. I thought that image was two somehow

main sentinel
#

hum, I think I understood. Gonna take a better look at RPC events. Tyvm!

thin stratus
#

That and what classes exist where

#

Cause any form of replication in the game mode doesn't make sense

glacial hamlet
#

^ what @thin stratus said. No sense

#

any replication of game mode info usually is forwarded to the game state which IS a replicated actor that is on players

main sentinel
#

Thanks guys, got it working. Do any of you have an article of a better workflow when using dedicated servers?

Right now whenever I change something I have to:

  • package my game
  • build using "development server" target on VS
  • copy the generated myGameServer.exe to the packaged game's binaries folder
  • run the server; run the client
thin stratus
#

Well you only need to rebuild the server if you actively change the server code

gleaming bobcat
#

Is it possible to pass UClass as a parameter in RPC function ?

thin stratus
#

Should be, yes

gleaming bobcat
#

but it's null always

thin stratus
#

Well at least I passed around character classes before

gleaming bobcat
#

It's quiet complex class which nested objects

#

But I think one shot replication will be much more efficient anyway

lofty holly
#

Have a question... can u play on project with your friend ?

pallid mesa
#

@glacial hamlet right yeah, there is a min and a max for those but I observed that in dc server testing in editor the net updates are more frequent than in listen servers. I also observed that 3 clients on listen server makes the experience smoother with default values than 2 clients, and for me this makes any sense.

glacial hamlet
#

ah right, and thats because it'll try to auto throttle up and down with a windowing technique not unlike TCP/IP backoff mechanisms

#

it tries to auto-scale a bit

#

i think when you've got a listen server it knows that the load on that machine will be much higher for the given host (because they're playing also)

pallid mesa
#

Yes I'm fighting against this thing because I'm working on a generic interpolation for pawns based on what cmc does

#

But I don't know how bad would be to force that value to not go under certain thresold

glacial hamlet
#

ahh

#

my gut feeling is there is some bit hiding somewhere that will help you ensure it stays at a minimum, where that is -- I am unsure

pallid mesa
#

So every net update I decay the translation offset of the root scene component to look as smooth as posible

#

But with low values it doesnt look quiet good, because the pawn gets the vector and quat info every time the actor gets an update

#

So it jumps around a bit trying to adjust its position

#

This isnt as extreme with a higher net update value... :/

robust summit
#

Hmm when i connect to dedicated server my world is black

grand kestrel
#

I have code that spawns actors on the server and adds it to a ReplicatedUsing= TArray, when it replicates with the ReplicatedUsing the array elements are null, however when you spawn an actor on a server it should spawn on clients -- and this is the same code I was just using, only I moved it out of ACharacter into a UActorComponent

winged badger
#

so it worked while it was in ACharacter?

grand kestrel
#

Yeah

#

Hm guess I should check it eventually spawns them

#

On client

winged badger
#

and you didn't forget to move the GetLifeTimeReplicatedProps as well?

grand kestrel
#

No

winged badger
#

those actors are replicated?

grand kestrel
#

Yes

winged badger
#

as is the UActorComponent itself?

grand kestrel
#

Yes

#

Or the onrep wouldn't be getting called

winged badger
#

along with the variable you might had added to store it?

grand kestrel
#

And they are spawning properly

#

Yes

#
    TArray<ARSItem*> DeferredPickups;```
#
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);

    DOREPLIFETIME_CONDITION(URSEquipmentHandler, DeferredPickups, COND_OwnerOnly);
}```
#
{
    bReplicates = true;
}```
#
{
    Super::BeginPlay();

    if (GetOwner()->Role == ROLE_Authority)
    {
        ProvideItems();
    }
}
winged badger
#

i am not 100% that ReplicatedUsing implies Replicated

#

at least, i never tried using one without the other

neon mango
#

Could there be a race condition between depending on a replicated bool to perform an action and the action itself being an RPC?

#

I'm thinking there could be, if the RPC gets there before or after the change of the bool.

#

No guarantee in the order?

winged badger
#

none

#

RPC will usually get there faster

#

but no guarantee

neon mango
#

none?

#

None as is in no race condition?

grand kestrel
#

ReplicatedUsing does indeed imply Replicated, adding it is redundant

winged badger
#

none as in no guarantee of the order

neon mango
#

ok then I see another potential problem with my code

winged badger
#

is the component attached/registered

#

@grand kestrel ?

grand kestrel
#

It's created in the constructor

#

(Yes)

neon mango
#

I have my IsGrabbing replicated. So Client tells server to grab, server sends out a net multicast, server says I grabbed setting IsGrabbing to true then its off to the races. If client gets IsGrabbing first then it won't even be able to grab when it gets its RPC from the server to grab, since I perform that check

winged badger
#

sending a bool and a RPC is not recommended

#

you can just send a bool and do ReplicatedUsing

neon mango
#

ReplicatedUsing?

winged badger
#

a function that is called after the new value has been received from server and set

hollow patrol
#

Does anyone know if there is a way to prevent a client from being disconnected from the world / unloading the level when a host leaves, or if thats even possible? So essentially they stay in the level, in their same game state, but all other clients and host get disconnected.

neon mango
#

oh yea ok I know what that is

winged badger
#

UPROPERTY specifier ReplicatedUsing = <function name, convention is OnRep_VariableName>

neon mango
#

hmm

#

so instead of doing a net multi cast

#

your saying to just have the server perform the action and then use RepUsing?

#

since the bool will change and call the function for everyone else?

winged badger
#

imo NetMulticast should only be used to notify the client that it should present something to the user

#

but shouldn't carry any game affecting functonality

#

(Play a sound, play animation, show some widget)

neon mango
#

well the order of operations would be the reverse. I don't want the bool changing then an action. Perhaps this bool doesn't even need to be replicated?

#

Maybe it just needs to be local

grand kestrel
#

You can make entire AAA games without ever using NetMulticast

#

Thanks to UE4's efficient replication system

winged badger
#

Vaei, your OnRep does fire, it just doesn't have the data?

grand kestrel
#

The OnRep fires, the TArray has the same amount of elements, they're just null

#

It's filled from SpawnActor

#

Which worked when it was done from ACharacter

#

Sec

neon mango
#

ok I think I'll do a comparison. If the server updates the bool saying player has grabbed, I'll cross check that with a local grab and if it doesn't match attempt to perform a grab and if the grab fails force the object to be grabbed, thereby insuring the grab is synced

grand kestrel
#
URSEquipmentHandler::URSEquipmentHandler()
{
    bReplicates = true;
}

void URSEquipmentHandler::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);

    DOREPLIFETIME(URSEquipmentHandler, Slots);
    DOREPLIFETIME_CONDITION(URSEquipmentHandler, DeferredPickups, COND_OwnerOnly);
}

void URSEquipmentHandler::BeginPlay()
{
    Super::BeginPlay();

    if (GetOwner()->Role == ROLE_Authority)
    {
        ProvideItems();
    }
}

ARSItem* URSEquipmentHandler::ProvideItem(TSubclassOf<ARSItem> ItemClass)
{
    if (ItemClass)
    {
        FActorSpawnParameters Params = FActorSpawnParameters();
        Params.bNoFail = true;
        Params.Owner = GetOwner();
        ARSItem* SpawnedItem = GetWorld()->SpawnActor<ARSItem>(ItemClass, GetOwner()->GetActorTransform(), Params);

        return SpawnedItem;
    }

    return nullptr;
}

void URSEquipmentHandler::ProvideItems()
{
    for (TSubclassOf<ARSItem> ItemClass : StartingGear)
    {
        if (ARSItem* ProvidedItem = ProvideItem(ItemClass))
        {
            DeferredPickups.Add(ProvidedItem);
        }
    }
}

void URSEquipmentHandler::OnRep_DeferredPickups()
{
    ARSCharacter* MaybeCharacter = (GetOwner()) ? Cast<ARSCharacter>(GetOwner()) : nullptr;

    if (DeferredPickups.Num() > 0)
    {
        for (ARSItem* Item : DeferredPickups)
        {
            if (MaybeCharacter)
            {
                MaybeCharacter->GetCharacterEquipment()->ServerPickupItem(Item, true);
            }
        }

        DeferredPickups.Empty();
    }
}
neon mango
#

I guess that leaves one concern, will the replicated bool be reliable?

#

Or is that not even really a concern?

winged badger
#

ServerPickupItem?

#

it will be reliable

grand kestrel
#

Doesn't matter, it's null by then

winged badger
#

and NetMulticast has some drawbacks

#

with default NetRelevancy settings any client outside of 15000 UU, as well as any client connected after the multicast was fired

#

will be completely oblivious that NetMulticast happened

neon mango
#

ok currently attempting a rewrite without net multicast

winged badger
#

with replicated variable and ReplicatedUsing they will end up with correct information/state anyways

neon mango
#

Excited to try this

#

seems like it could work better and be more optimized

grand kestrel
#

The only real advantage of NetMulticast is it's instant

#

And replication tick isn't exactly slow, unless you set it to be

neon mango
#

hmm what kind of delay can I expect from the bool ?

grand kestrel
#

You'll never notice it

winged badger
#

half a ping + 0,05 seconds tops

grand kestrel
#

Unless have low net frequency

neon mango
#

Would this work well with latencies as high as 150?

winged badger
#

if you didn't touch the NetFrequency settings

grand kestrel
#

It works at any latency

neon mango
#

Is that a project setting?

grand kestrel
#

It will always get the correct state

#

Per actor

winged badger
#

Vaei, if you breakpoint inside your OnRep

neon mango
grand kestrel
#

Already did, the array is null filled

#

But of course I broke prior to rep to make sure it wasn't being null filled, and it's not

#

It's filled correctly

#

I think I can find a better way to handle this

#

By handling all pickup logic from OnRep_Owner()

#

That way server spawns it, sets the owner, by the time it spawns and propogates to the client it definitely can't be null

winged badger
#

it might be the order of things

grand kestrel
#

Worked from ACharacter though which is why its weird

winged badger
#

if you were to spawn your actors

#

then after all are spawned, append that array to DeferrredPickups

#

this way if client didn't get the replicated newly spawned actor yet

#

it doesn't exist on client yet, and when you add it to DeferredPickups, the reference is not valid on client yet

#

and if this is the case, it working before was "lucky" but was infact a timebomb

#

you will also trigger the DeferredPickups replication far fewer times if you just assign the entire finished array to it then add items 1 by 1

grand kestrel
#

It's not gonna trigger repeatedly within the same loop

#

That would be silly

winged badger
#

point there

#

it will trigger only on NetUpdate

grand kestrel
#

Anyway

#

Moving it to OnRep_Owner() seems to be the way

#

That way when an owner is set it'll tell the owner to pick it up

#

Instead of the other way around

winged badger
#

but you do have a race between AARSItem actors replicating and a TArray<AARSItem*> replicating

grand kestrel
#

Yeah indeed

winged badger
#

what do server and client do with those actors?

edgy bramble
#

Is VR CO-OP Possible? using MSI Backpacks?

neon mango
#

Depends on what you mean by coop here

#

AT remote location with each VR headset having its own setup, sure

edgy bramble
#

I was thinking this right

#

Using Opti track to capture two MSI Backpacks

#

ANd sending that data to UE4 then having it display in VR

#

if that makes sense

twin juniper
#

Do you guys know how to make the server less strict on replicating movement of a pawn (Not using CMC) to the owning client? Trying to figure out how to make the client's movement feel better.

#

Or should I not enable movement replication on the pawn and write my own functions for that?

neon mango
#

So does the update of a replicated variable not happen if the variable gets set to the same value, in this case a bool at false told to be set to false again.

tiny scaffold
#

Hi all, would anyone know how to have the server spawn in an actor and have the player who requested the spawn possess the actor?

neon mango
#

@tiny scaffold Download and check out the shootergame, great learning resource

tiny scaffold
#

alright, where can i find it

neon mango
#

Epic Launcher

tiny scaffold
#

ahh

neon mango
#

Under the Learn tab

#

scroll down a bit

#

probably other multiplayer resources there as well relevant to that

tiny scaffold
#

Thanks @neon mango

#

now that i have this to learn lol if only i knew how to use advanced steam sessions on a dedicated server ๐Ÿ˜ญ

neon mango
#

Yea IDK about that yet

tiny scaffold
#

spent like 2 days trying to get it to work but nope

neon mango
#

The shooter game uses steam to invite players and such maybe your answer will be in there?

#

Not sure what advanced sessions means?

tiny scaffold
#

advanced sesisons is a plugin

#

this might work so

neon mango
#

I'm having a pickle with the fact I need to trigger an OnRep for a bool value that stays the same

#

I must be approaching this wrong

wide iris
#

if the bool doesnt change i dont think onrep will be call xD

neon mango
#

@DarkMatriac yea its why I'm trying out reping a float instead

#

Does OnRep notify the server as well?

#

or only clients?

gloomy tiger
#

both @neon mango

#

actually it depends on the variable replication

neon mango
#

hmmm

#

what do you mean by that?

wide iris
#

@neon mango It notifies the server and client when the client modifies that variable I think if I remember well

tiny scaffold
#

Ugh i still cant figure it out would anyone know how to possess and actor that has been spawned by the server on the gamestate, im trying to make it so the player doesn't spawn in right away but allow them to select a team then spawn an actor (their player / character) at a location and then have the client possess it. Ive gotten it to spawn but cant possess it.

thin stratus
#

@wide iris @neon mango @gloomy tiger Repnotify calls in BP on server and clients when the variable gets modified by the server. In cpp you have to call the Onrep function manually for the server, as it only calls for clients there.
Also replication always only works from server to Clients. So the client setting the variable doesn't do anything

tiny scaffold
#

@thin stratus you wouldnt happen to know how to possess an actor that was spawned by the server? like from a gm on event onpostlogin works but nothing else

thin stratus
#

Well you have to posses it on the server too

#

There no magic to it

tiny scaffold
#

ok ill try that

#

@thin stratus i tried this and the custom event from the game mode and i am using a widget to cast to the game mode and trigger the event

thin stratus
#

Buddy

#

Where does the GameMode exist?

#

On the Server? On the Clients? On both?

tiny scaffold
#

on the sever

thin stratus
#

Correct

#

If you now get a reference to the GameMode on the Client. What would that mean?

#

Plus the fact that the GameMode, only existing on the Server, is not replicated

tiny scaffold
#

it wouldn't cast?

#

ah

thin stratus
#

The reference is null

#

The client can't get it. It can't call events on it

#

Especially no RPCs

#

You have to call the RPC on your player owned actors. E.g. Playercontroller

tiny scaffold
#

ah ok so would i create an event on the playercontroller which would run on server? creating the pawn then possessing it?

thin stratus
#

Yes, or simply getting the gamemode and telling it to respawn the player. As soon as you are on the server, the gamemode is available

#

ServerRPC in the PlayerController - > get GameMode - > respawn player (passing the playercontroller who calls the event along!)

#

In addition, you can't use get PlayerController 0, cause that refers to the servers controller as long as your on the server side. You always need a reference to the controller of the player that wants The Respawn

tiny scaffold
#

ah ok ill try from the player controller

thin stratus
#

Cheers

tiny scaffold
#

Thanks, still learning the networking part of unreal

#

It worked thanks sorry for being such a noob, is there any documentation about it i currently have 1 pdf to read through but any others help

grand kestrel
#

Yes if only someone had written a compendium

#

Unless thats the pdf ๐Ÿ˜›

#

Well, look at pinned messages either way

tiny scaffold
#

Haha i just realised the name woops yeah im reading the one cedric made but i havent gotten through it yet

thin stratus
#

The issues you are facing should be resolved with the compendium

#

No idea what else exist, as I already grabbed things from everywhere to create it

#

Just avoid Epic's lobby tutorial

tiny scaffold
#

Will do

ember needle
#

I do the same and have issues

#

the issue is that i save the playersโ€™ role in their respective states while in a slotting level, but when the game starts (seamless travel) the GameMode and PlayerControllersโ€™ BeginPlay events are run before the PlayerState variables are copied over (with the Event CopyProperties)

#

so when i spawn players in the GameMode according to the role specified in their state, errors occur because the role is still None since the copying over of PlayerState variables hasnโ€™t happened yet.

#

hence i have to do something silly such as loop-checking in the GameMode that all PlayerStates have the role variable not equal to None before spawning.

#

does someone have a better solution?

#

would be appreciated...

winged badger
#

try overriding AGameModeBase::ReadyToStartMatch()

#

when it returns true, that's when BeginPlay gets called on everything

stiff citrus
#

Hi, anybody can tell me whether the input event will trigger on both server and client๏ผŸ I use "add input movement" to cause my server pawn move, and the movement will be replicated to clients. But when I use this node to move my client, only my self will see the movement, server and other clients won't see it. And I don't know why it's happening. So any help or explanation will be appreciated. Thanks.

winged badger
#

Consuming InputVector fires a Server RPC in the MovementComponent

#

which moves your character on the server, then it replicates to clients

#

so it works out of the box for movement

#

any other input action you define is fired on client only, and needs to be RPCed to server for it to take

twin sorrel
#

Hey guys! i set a replicated variable on the server and it is a different value on the client... am i confused about replication? or is something wrong?

winged badger
#

is the object that the variable is a member of also replicating?

twin sorrel
#

Ahh

#

Genius ๐Ÿ˜ƒ

#

thanks @winged badger

#

it was an actor variable in which the actor that the variable of wasn't replicated

#

i didn't think that mattered

#

but thanks

stiff citrus
#

@winged badger thank you, I will try when I got home.

#

@winged badger does input axis event fire on both server and client๏ผŸ

winged badger
#

just client iirc

#

the function that consumes the input is RPCed to the server

stiff citrus
#

OK

#

๐Ÿ˜˜

thin stratus
#

@ember needle @winged badger OnSwapPlayerControllers

#

In GameMode

#

Gives you old and new one

winged badger
#

good to know ๐Ÿ˜ƒ

thin stratus
#

Also BeginPlay seems to call before ReadyToStartMatch returns true

#

At least iirc

ember needle
#

How can that solve the fact that when BeginPlay is called on the GameMode the PlayerState are not copied yet?

winged badger
#

last time i tried it, it wasn't called

thin stratus
#

That you can move the data between your PlayerControllers and don't need the PlayerState for this?

winged badger
#

its one of most bizzare mistakes you can make, forgetting Super::GetLifetimeReplicatedProps(OutReplicatedProps); in GameState

#

then the MatchState won't replicate, and BeginPlay won't be called on clients at all

ember needle
#

then I'll enter other issues, such as the fact that right now all the mechanism relies entirely on the PlayerArray in GameState

#

(which contains states)

#

Sometimes it just feels that we'd be better off in moving everything to GameInstance and forget about all of the race conditions of what gets called when

thin stratus
#

It's actually quite easy if you make sure that things like ids and states are saved in controller and state

ember needle
#

that's what I am doing, and my problem is the one I said unfortunately

#

my SlodID is stored on PlayerState because the good news is that PlayerArray on the GameState seems to be correctly updated before anything else gets called (and I hope this is the case also for non-LAN connections)

#

and because in this way all players already know who is in what role (since PlayerState is replicated on all clients)

#

So: when the game starts, the GameMode gets loaded, it tries to spawn players, but their states have not yet been copied over from the previous states.

#

I don't think I'm doing anything weird here, and I've followed all compendium / tutorials / recommendations I have found on each role of the various BP...

merry haven
#

anyone here know how to make a client server for lan with out using steam
i cant use steam for this project

#

i do have a server running but i cant seem to be able to find the server in a server browser im not sure on how to set it up

peak hinge
#

Hi!
Dedicated Server session using OnlineSubsystemSteam not findable. Can anyone explain me why this may happend?

I used ShooterGame editor runned as -server and logs looks like good, but client can't find it, while the client hosted as listen is findable nicely...

lost inlet
#

online subsystems aren't loaded in editor

tiny scaffold
#

hi just a question i dont know if this belongs here but i feel like it might, im using a mysql plugin for my game would the database location (somewhere in the world) matter for people?

lost inlet
#

do not directly connect to a mysql (or any other database) directly through your game client

tiny scaffold
#

whats the best way, and why? (just wondering) @lost inlet

lost inlet
#

because people can find out the credentials from reverse engineering your game and then do what they like to the database

#

use a HTTP endpoint for stuff like that

tiny scaffold
#

ah ok thanks

#

also would it be better to use a save game? or a mysql db

lost inlet
#

well you need to state your use case

tiny scaffold
#

what do u mean sorry

lost inlet
#

what are you using a database for

tiny scaffold
#

storing player data like their level and currency, only reason i want to use a database was because i wanted to be able to edit another player variables if i needed to for say moderation purposes or something like that

#

unless there's a way to do that with the save game

lost inlet
#

so is this a multiplayer game?

tiny scaffold
#

yes

lost inlet
#

then use HTTP and create a REST API for your game client and/or server to interface with

#

any persistence should be handled by the game server rather than clients

tiny scaffold
#

Alright ill have to try learn all of that

river canyon
#

hello

#

is the use of Open Level a standard

#

or should i switch over and start using sessions?

winter rock
#

Alrighty everyone, I've run into an issue regarding actor rotation replication, and its driving me up the wall.

I'm currently working on an update to my marketplace asset "Advanced Locomotion System" (you can check it out here - https://www.unrealengine.com/marketplace/advanced-locomotion-system-v1), and my finalstep is to get it working with networking. So far, I've got everything working, but I've hit a wall trying to replicate rotation.

In this new version, I'm manualy managing character rotation within the CharacterBP. I know that the Movement Component has some built in rotation settings, however the options are very limited, and dont offer much flexibility. Doing it manually enables me to have full control over how the character is rotating at any given time, and also allows me to interpolate rotaiton to keep everything nice and smooth. Ive created a function that sets a TargetRotation variable, and then interpolates the actor rotation to the target using a custom interp speed. I can call this function on the tick whenever I need, and everything works beautifully (for singleplayer).

#

Now for multiplayer, my goal is to calculate and set rotation locally, and then send the new rotation to the server so it gets replicated to the other clients. This is where I'm getting an issue. In my rotation function, I added a call to an RPC event that sets the rotation on the server, so whenever I call my rotation function, it also sends the rotation to the server (I also make sure I only call this locally, so it isnt getting called by other clients or anything). However, whenever I do this, rotation on the local client becomes jittery, and interpolates at half the speed. From the other clients perspective, rotation appears normal. My best guess is that it has to do with the "GetActorRotation" function that gets fed into the current pin on the Interp node. I'm assuming it gets the actor rotation from the server instead of locally, and since they are briefly out of sync, problems occur. I've also tried messing with every replication setting I could find both in the Character class and the Movement Component, but nothing seems to solve it.

Any insight into why this is happening?

slim holly
#

jittering becomes because you're doing the rotation math on server

#

if you want to have it client authorative, you just send the same value you used for the rotation to server

winter rock
#

Thats what I do. I'm not (shouldnt be) doing any rotation math on the server

#

I calculate and interp rotation locally, and then send that value to the server using an event.

#

(see the second and third image)

slim holly
winter rock
slim holly
#

you shouldn't be doing role checks inside functions anyway

#

unless it's important for the function content

winter rock
#

Even if I take it out, and do it before I call the function, its the same result.

#

Ive done extensive tests.

slim holly
#

and extensive test results tell you that one of them is not setting a proper rotation if it's jittering

#

so, usually it's a role check gone wrong

#

also now that I've seen the video, what is the data driving the rotation variable

#

it's clearly going faster on server

winter rock
#

Right, thats my issue. Interpolation is slower on the local client. (The video isnt mine)

#

I think it has to do with the "GetActorRotation" function

slim holly
#

oh yea, engine default function bugged

winter rock
#

How is it bugged?

#

...or was that sarcasm

slate veldt
#

Hi all, I've been having some trouble connecting to my LAN game from a client on the same network. When searching for sessions, it comes up with the correct details (IP, Hostname, Map, Mode etc), however, upon UEngine::Browse it has the current map name on the prospective client as the URL's map, despite having the correct details for the rest of the URL. It appears that when you step up in the call stack that the engine uses the LastURL as a base for the new URL. Why is this the case and how can I prevent this from happening and ensure the target server's map is the map variable of the URL?

slim holly
#

yes that was sarcasm

#

reason I asked for the data that drives the rotation is that you used dedicated server, which does not load all the data

#

so it could very well be a rotation value of something that doesn't exist

#

then it could be "bugged"

winter rock
#

Well the video isnt mine, but I use variables on the local clients.

#

Such as velocity rotation, looking rotation, etc. I also dont call my rotation function (which handles interpolation) on the server.

#

If I quickly put together a test project, made from the third person template, would you be willing to check it out?

winter rock
slate veldt
#

Hi all, relating to my problem above, it appears that the travel URL only provides an IP address and Port, no map (even though I can see it in the session info). I'm creating this travel url the same way Shootergame does, so I'll take a further look into this

wide iris
#

If i want my characters to open a door with a key when closes to the door, should I get the input inside the controller and check if there is a door nearby? Or should I use the node Enable Input when a character get close to the door? which one would be a better approach?

winged badger
#

you can't send a RPC to server from a door actor

#

as its not owned by your PlayerController

wide iris
#

so I should get the input inside the controller?

#

and tell the server which door I want to open?

gleaming bobcat
#

What is more efficient guys. Send a quite complex class via RPC to client or set a replication of that class (COND_InitialOnly) ?

slate veldt
#

Hey all, what should a typical TravelURL for a LAN game look like? Mine is just coming up as an IP address with a Port and no other info resulting in the default map being loaded

thin stratus
#

Well, dependso n the subsystem you are using

#

Steam is probably returning the p2p address

#

While oculus returns an oculus id

slate veldt
#

Subsystem NULL in this case I think

thin stratus
#

Well that would probably show the ip as travelURL

#

The actual map to join is returned when the server greets you iirc

#

Are you sure that you actively join the server?
Maybe you time out

slate veldt
#

It says that I am successfully joining session

#

but during server travel, it uses the LastURL as a base, combined with the travel to URL and results in the IP address of the host, but with the default map (as the map is not within the TravelURL string due to only the IP address and Port being returned during the GetConnectStringFromSessionInfo function in OnlineSessionInterfaceNull.cpp

#

As you can see, it only returns the ConnectInfo (which is used as the Travel URL) as the IP Address

#

Stepping up a couple of functions into the GameInstance (based on Shooter Game) we can see the following

#

It doesn't enter the if statement as it's successful, and it then passes the URL (only a local IP and port) into the client travel function

#

Then if you let it run and dispatch call backs, it gets to the Engine tick where it is aware the client needs to travel, and therefore uses the Travel URL above, but as the URL is only an IP address and port it does the following

#

So this is from the constructor of FURL, where it sets the map in the new FURL object, as the if statement is true, it sets the map to be the default map

tawny parcel
#

On a dedicated servers log file anyone know why the -ABSLOG run argument would not add a ".log" extention?

merry haven
#

can never find a running server always comes back with 0

thin stratus
#

Show us your code for hosting and searching

merry haven
kind bay
#

@merry haven Did you set up your DefaultEngine.ini? Have you tried checking the "use lan" in find sessions? If you are using a virtual box on your machine, disable the virtual network adapter in your windows network settings, its known to cause issues

kind bay
#

Also check your firewall

random verge
#

Hey guys, just curious. Is a source build of the engine still required for a dedicated server build or can we now do this from the install build?

#

Probably a super noob question but I have almost no experience with UE4 multiplayer

wicked spade
#

i have a strange but hopefully simple problem; i have a replicated actor being created on the server and given an owner in the spawn params (the owner is the player character, also replicated obviously). In the beginplay for this created actor the owner is null on the client. any way i can get it to not be null?

winged badger
#

Owner variable also needs to be replicated

wicked spade
#

where exactly can i set that variable to be replicated?

#

this is just the inbuilt owner variable in spawnparams

wary willow
#

@wicked spade in 4.18 at least, I have noticed my owners aren't not getting set when I spawn an item always.

#

I have been having to set them post spawn.

wicked spade
#

interesting, i can confirm the owner is being set on the host

wicked spade
#

it looks like the owner variable isnt replicated at all, even after the beginplay, which is strange because i havent run into this problem with other actors

undone zenith
#

I just had a quick question in unreal is cross platform supported?

versed socket
#

@undone zenith yes

undone zenith
#

@versed socket so I could make it xbox and lets say Nintendo switch?

versed socket
#

I believe so, yeah

fluid moon
#

Hey guys, anybody know why my Create Session node is failing?

#

it always triggers the error dialogue

kind bay
#

@fluid moon have you set up your defaultengine.ini?

fluid moon
#

No. What do I have to change?

#

nvm, got it. Thanks!

heavy marlin
#

i wonder if theres a general calculation for server population vs landmass size

#

assuming you walk everywhere and population is unlimited

#

is 1000 players for 16x16km too much for example

frank copper
#

that like 1.6 players per square meter

#

actually is 1 player per 16 square meters

#

it seems very crowded

heavy marlin
#

i prefer to call it forced socialisation

#

but yeah thats a bit much

#

maybe 1 player per 100m

frank copper
#

yeah, that's 160 players

merry haven
#

I didn't know about the virtual box thing I'll check it out thanks @wicked spade

fleet raven
#

is ServerTravel meant to work in PIE?

#

it always brings my client back to main menu instead of the new map

slim holly
#

iirc game instance has travel error event

#

set it to print to see if something goes wrong

thin stratus
#

ServerTravel yes, SeamlessTravel no

#

At least iirc

fleet raven
#

SeamlessTravel isn't working at all for me... all clients get kicked to main menu

#

I've probably done something wrong

heavy marlin
#

im afraid the only answer is to step through the code to see whats going on

slate veldt
slate veldt
#

Update on the above question (also posted on the question itself). When debugging yesterday, Machine A was hosting and Machine B was finding the session but with port 0.
However, I have just hosted on Machine B (right clicking uproject and clicking launch game) and then joined from Editor on the same machine and this time the IP address came through with the default UE4 port (7777). This resulted in the client joining correctly.

How can I ensure the host always hosts on the correct port?

thin stratus
#

I hope you are not trying the connection stuff from two PCs with PIE

#

PIE shouldn't be used at all for connections between two PCs

#

Always launch a standalone

slate veldt
#

Machine A (Host) is running standalone, Machine B (Client) is running VR Preview

#

Standalone doesn't seem to support VR anymore

slate veldt
#

So I guess my real question here now is why is my Machine A hosting on Port 0 according the the client?

peak hinge
#

@lost inlet are you sure? I got worked OnlineSubsystem Null and Steam on editor. But Steam worked only if game launched with -game or-server option

thin stratus
#

I really don't get how LevelStreaming is supposed to properly work in Multiplayer

lost inlet
#

standalone game isn't the same thing as in-editor though

#

what was the issue again?

thin stratus
#

Refering to me?

#

Or Artem?

peak hinge
#

@lost inlet I launched dedicated server from my project that using steam and created online session. All logs says the session successfully started. But client can't find this session (search started and finished with 0 results). Besides, I tried do that with ShooterGame and got similar problem. Why I can't find this session? Ini files setted to work with steam. And subsystem works (I can use different online interfaces, such as Friends, but looks like dedicated server session not registered in steam, this is strange, I see the packets sent to steam).

lost inlet
#

that sounds familar, i think there's an issue with how steam heartbeats are setup

#

unfortunately the steam oss shipped with ue4 is trash and you basically have to make your own fork of it

thin stratus
#

Well generally everyone has problems getting a Dedicated Server to run with Steam

lost inlet
#

make sure you have steam_appid.txt in the right place too

thin stratus
#

By default, these steps SHOULD work (but I guess they don't):

  1. Setup Steam in general, including Ini file
  2. Create your own DedicatedServer via Source
  3. Let the Server create a Session in "AGameSession::RegisterServer", making sure 'bPresence' is false
  4. When distributing the Server, making sure to add the steam_appid.txt and also the steam binaries (from engine folder) to the Binaries folder
#

However I think Steam also requires you to setup DedicatedServers in the partner page? Not 100% sure here

#

Been a while since I touched that

peak hinge
#

Can I use this steps with appid 480 for testing project?

thin stratus
#

Other info is: Epic didn't save the IP stuff in the Session info, so only the p2p stuff from Steam is saved

bitter oriole
#

480 works well

thin stratus
#

Technically yes? It's just giving you tons of results of other games

lost inlet
#

we disabled the p2p stuff in our game

thin stratus
#

Which will get filtered

#

Other things are settings in the Engine which can't be changed with changing source

#

Such as the gamename

#

Idk what of this is actually required and what not .Everyone says something else

lost inlet
#

there's also a biggie that you need to implement yourself

#

authentication

#

that's why you see so many answerhub questions about "0 players"

thin stratus
#

/** @TODO ONLINE Server values needed to advertise with Steam (NOTE: Steam expects UTF8) */
#define STEAMPRODUCTNAME "unrealdk"
#define STEAMGAMEDIR "unrealtest"
#define STEAMGAMEDESC "Unreal Test!"

#

That stuff in OnlineSessionAsyncServerSteam.cpp

peak hinge
thin stratus
#

That thing is so old, it breaks stuff

#

And is also not that great

#

It does good and bad things iirc

#

Last time I pulled it it kinda caused crashes

#

But you see the defines above

#

Pretty sure they need to be properly changed?

peak hinge
#

OnlineSessionAsyncServerSteam.cpp must be modified on server and client both?

thin stratus
#

At least I did last time I checked

lost inlet
#

i implemented it myself

#

but that PR shows vaguely what you have to do

#

though that PR makes more changes than are necessary

halcyon abyss
#

hey guys

#

I need help

#

something very small

#

I want to make a client owner of an actor

#

...but...

#

I don't know how to

#

i need the client to be able to throw RPCs on this actor

#

i'm using the node

thin stratus
#

Are you spawning the Actor?

halcyon abyss
#

Set Owner

thin stratus
#

Or is it in the level

halcyon abyss
#

In level

thin stratus
#

SetOwner only works if called on the Server

#

So what ever you do there needs to happen on the Server already

halcyon abyss
#

yep

#

doing that

#

do i give it the player controller as owner?

thin stratus
#

Yeah

#

I do the same with a simple ball actor

#

Works fine for me

halcyon abyss
#

...mmh so just a sec...

thin stratus
#

Obviously only one owner per actor is allowed

halcyon abyss
#

yes...

#

well... I'm doing it that way

#

I'm assigning the owner this way

thin stratus
#

Why a Multicast

halcyon abyss
#

for other aesthetic reasons

thin stratus
#

Well okay and your Multicast calls properly on the server?

halcyon abyss
#

that come after the logic

#

well multicast runs on all machines right?

#

il print a string now

thin stratus
#

If called from Server, yes

#

Given the Actor is available on all machines

halcyon abyss
#

it is running fine

#

i get both the server player controllers in the print string

#

but RPCs aren't working yet

#

know what

#

I probably know what is going on

#

....this is a controlled pawn... that probably causes the problem

halcyon abyss
#

nope its not that

#

can it have something to do with the fact that the actor i'm considering is a character actor?

thin stratus
#

Hm no sure. Never tried to set owner on a Character

halcyon abyss
#

I'm checking on both server and client

thin stratus
#

Usually that happens when possessing

halcyon abyss
#

and ownership works perfectly

unborn nimbus
#

We're running into an issue where if someone disconnects and reconnects, sometimes all the vfx that were spawned while they were disconnected all spawn at the same time when they log in. My idea would be to get the timestamp when the vfx is spawned and check the duration between then and when the client receives it and if the difference is too large, don't do anything.

#

Is there a better way to do this?

neon mango
#

@unborn nimbus This wouldn't have anything to do with reliable vs unreliable?

unborn nimbus
#

no, it's not being done by RPC, it's being done by Rep Notify

#

@neon mango

west rapids
#

So here's something weird: A player joins a server, a PC gets created, but there is no player attached to that PC. Dafuq?

ember needle
#

? what do you mean with โ€œplayerโ€

#

a character?

west rapids
#

no, i meant a player controller has no player attached

#

Pierce helped me, turnes out if your default pawn is None in the game mode, you get screwed, even if you do possess a pawn on login.

thin stratus
#

Sorry?

#

I never had issues with simply spawning a pawn on PostLogin and possessing it

#

So what do you mean with "screwed" here ? ๐Ÿค”

west rapids
#

Create player has an extra bool that spawns a default Pawn. If you uncheck that, it doesn't do anything, at least I haven't managed to get it to work. So I left the bool flipped, and simply set the default pawn to NONE. This solved my problem.

However, when I run on a dedi, using OnPostLogin I possess a pawn with the newly created PC. However, that PC doesn't have a player attached. Printing a GetOwner on PC returns null as well. I've since changed the default pawn to the spectator, and it works fine.
@thin stratus

#

Also note that I'm not spawning a pawn, I already have it in the scene.

#

Blah, false alarm, its still broken.

#

Did I miss something? I mean this should possess a pawn :/

meager spade
#

@west rapids i would try SpawnDefaultController

west rapids
#

that would just add more controllers

modern dome
#

Does the Loop even fire?

west rapids
#

oh yeah, the entire event executes to the end

#

and no errors or anything

#

i just dont understand how a player controller have no owner

#

LogNet: Warning: UIpNetDriver::ProcessRemoteFunction: No owning connection for actor

#

ive googled this error but there's only one person who hit this before

#

and solutions are sketchy

#

things like replicating every variable and such

#

also his case was the fact that he was replicating the PC

twin juniper
#

You guys know how to specify a condition for replication in OnRep functions? I'm writing custom movement code and I need to get my struct to replicate from server to all instances of the pawn on various machines except the owning client, except during exceptional cases (they're too far apart, or the server is disallowing the client from moving, etc.)

I swear to god I heard something about getting an old value of your replicated property as an argument in an OnRep function.

west rapids
#

AFAIK the values OnRep are updated first, so I can' see how you'd get an old value from that since it fires after being changed.

#

as for the other bit, try is owner or is locally controlled and then branch

twin juniper
#

I'm working with C++, and I recall seeing people mentioning how you can obtain an old value from the function. However, I tried looking and couldn't find documentation on that.

#

Seems like it'd be a very useful thing for networking though

#

@west rapids Is it possible to abort replication from the OnRep function somehow?

west rapids
#

I don't think so, not from bp anyway.

#

i mean i told you that ur variables get updated and then OnRep is called

#

I don't think that function is designed for that, you can still probably modify it in C++

twin juniper
#

Well I'm wondering specifically about C++

sweet spire
#

If u want old values u can just store a cache on rep

twin juniper
#

How so?

thin stratus
#

@west rapids CreatePlayer is for local Players

#

Not for NetworkPlayers

#

It's splitscreen related

west rapids
#

i dont use create player

thin stratus
#

You wrote that though

west rapids
#

yeah i did it for the local bit

thin stratus
#

Ah well

#

Anyway, as an info on that: The boolean is wrongly named

#

It#s for creating PlayerControllers

#

If you uncheck that, it won't spawn a controller for the player

west rapids
#

omg ๐Ÿ˜„

thin stratus
#

at least last time I digged int othe source

west rapids
#

well, thanks for the info

#

though i still have no clue why my controllers dont have an owner

#

u supposed to get a PC when u join a server, i get a PC, but it haas no owner

#

i have no clue why this is happening

slim holly
#

oh right because "creating player" is a splitscreen term

#

remote controllers don't have local owners, there's the issue

west rapids
#

i dont get what ur saying

#

when a pc is created its owned by the connection

#

so that u can rpc to the server

#

i cant even create a widget

#

locally

slim holly
#

is this listen server?

west rapids
#

dedi, listen works fine but just for server

#

basically it works fine for server

#

but i create a widget in the HUD class

#

so server should havev nothing to do with it

twin juniper
#

alright apparently passing the variable matching the type of the replicated property is gonna automatically set it to be the old value

#

thanks for the help everyone

slim holly
#

well widget is local only anyway

#

I'm actually concerned how you got player into session without controller and without crashing the editor ๐Ÿค”

west rapids
#

@twin juniper neat trick, ill remember that. Thanks for the update.

#

i did, the player has a controller

#

i got 2 controller,s session gives me 4, 2 clients 2 server

#

so its not like they are missing

slim holly
#

so it's just not assigned to anything

west rapids
#

yeah, to a player ๐Ÿ˜„

#

cuz i tried posessing a pawn and it dont wanna do it

slim holly
#

but the thing is, you can't join session without being assigned one

west rapids
#

assigned to a pawn?

slim holly
#

no, controller comes first

#

it's in the login event @ gamemode

west rapids
#

but u get a controller assigned the moment u login

#

yes

slim holly
#

so, if the postlogin controller is valid, then the ownership is removed somewhere down the line

west rapids
#

this executes fine, but i can't even print a string lol ๐Ÿ˜„ (with input)

slim holly
#

oh I see

#

try without the valid check

west rapids
#

nope, same thing

#

i mean ive tried many other ways i could come up with

slim holly
#

what's the pawns default controller settings like?

west rapids
#

but none of them worked out

slim holly
#

there's auto-possess and stuff in the class settings

west rapids
#

aye. i dont posess it

#

auto

slim holly
#

can't remember, what were the options for that

#

well, either way, fiddle with those

#

I gotta hit the bed

#

early wakeup

west rapids
#

ok, thanks for the idea

#

yeah auto posessing isn't any different

slim holly
#

as long as the default settings are fine, you don't need the valid check for controller

#

player possess will override it

west rapids
#

ill figure it out, get sleep bro ๐Ÿ˜›

#

and tx for the tips again

twin juniper
#

Um, do you guys know what the standard way to limit tickrate is? I don't really want to make my, well, everything tick more than 32 times a second.

#

Should I be just going around and limiting tickrate manually on everything?

#

asking here because my concerns are mainly with the multiplayer implications of the tick rate

west rapids
#

i think it was in a cfg somewhere

#

sec

#

here

#

[/Script/OnlineSubsystemUtils.IpNetDriver]
NetServerMaxTickRate=30
InitialConnectTimeout=600.0

#

in DefaultEngine.ini

#

line 126

twin juniper
#

Oh! Thanks!

west rapids
#

bear in mind this is not the DefaultEngine.ini in the project

twin juniper
#

Wait, where is it then?

west rapids
#

BaseEngine.ini is what u want, my bad

#

its in ur engine configs

#

be aware that this will apply to all projects

#

its 30 by default

twin juniper
#

Oh I see

#

Is it going to apply to packaged projects?

west rapids
#

aye

twin juniper
#

awesome, thanks

west rapids
#

unless u override it

#

dunno if u can do it per object

#

i mean separate the ticks

twin juniper
#

Roger-rgoer

#

*roger

#

๐Ÿ˜„

halcyon abyss
#

Hey guys

timid pendant
#

@twin sorrel Show the other error code in that log

twin sorrel
#

Don't worry, i fixed it ๐Ÿ˜ƒ thanks

#

i had the wrong setting checked when building the server

#

i had like debug game server instead of development server

sharp spire
#

Who here is really good with the understanding of multiplayer and can explain it to someone who understands everything else about ue?

#

Iโ€™ll ask a more precise question for an example, say I have an equipment array setup and a slot setup to display the mesh, does the mesh show to other players if replicate is toggled on, and not show if toggled off?

twin sorrel
#

how are you getting the mesh into the game?

#

via server --> spawn actor?

sharp spire
#

Via my player character controlled by my player controller

#

Lol

#

Iโ€™m a multiplayer noob

twin sorrel
#

Does anyone know how i can restart the game on a dedicated server?

burnt meteor
#

Restart?

thin acorn
#

Hey all,
I was wondering whatโ€™s the basic workflow when using ue4 and Wwise to ensure that sounds play for each client when in a multiplayer environment vs just for a single player. Typically we would grab the reference and have it play to all clients. I will be working on a multiplayer game soon and I wonโ€™t to make sure we are on the right path. I posted in audio but no response.

pallid mesa
#

wwise not sure, but usually you would play the 2D sound on the locally controlled client and spawn a 3D sound for the rest of the clients

slim holly
#

iirc Gamemode has restart option built in

#

or was it gamestate ๐Ÿค”

pallid mesa
#

Super::RestartGame();

#

gamemode using bSeamlessTravel on

#

it just restart the match

halcyon abyss
#

Hey guys, I need a huge help

#

without going through the whole explanation regarding why I want this (I'm working on a VR game and exceptions to how the system was thought are a constant), I really need to make an AIController that replicates like a player controller... In order to have AI controllers on clients that allow for client-side prediction in their motion (I want to use AI controllers as dummies that receive input from the Player Controller to basically have "Vehicles" that work without having to possess them with the player controller

winged badger
#

AI Controller doens't replicate, but the movement component of pawns they are controlling does

#

and it is usually responsible for movement prediction

halcyon abyss
#

I know that is why I wanted it to replicate... The fact is that prediction happens only for the locally controlled pawn

#

I needed to have this extended to other controllers

#

in the client

#

it's a mess... i know

winged badger
#

well, the AAIController is an actor

#

so as long as you set bNetLoadOnClient and bReplicates to true in your inherited class

#

it should replicate

#

you'll want to be really careful to run the AI logic on server only tho

halcyon abyss
#

unfortunately it doesn't

#

Yeah of course think of the Ai Controller

#

as an extension of the player controller

#

which simply fills the gap on the Vehicle character

#

so i can exploit the CharacterMovementComponent for rotation and prediction

#

I won't run logic besides passing movement functions from the client

winged badger
#

so you basically want to turn AIMoveTo into something CMC can digest?

halcyon abyss
#

nono

#

I don't care about AIfunctionality

#

I just need to possess the vehicle with a dummycontroller

#

that receives input from the player controller... In a way that possession remains on the character but the vehicle responds to the player's input

#

it could be a whole new controller

#

but I noticed that add inpout vector on client works only if the pawn is possessed

winged badger
#

you can send the accumulated InputVector directly into the vehicles movement component

#

add sure

#

but you can add it on your PC

#

and Consume it in vehicles CMC

#

i think

halcyon abyss
#

But like i said, add input vector wouldn't work when called from client

#

So yeah in the end all i probably need is a replicated ai controller to achieve this

winged badger
#

you can't add the input vector from the client, but you can do it from server version of your PC

#

and even if the AI Controller was replicated, you'd still need to own it to be able to send a server RPC thru it

halcyon abyss
#
  1. movement input for the CMC needs to be done on owning client
#
  1. Yes, that wouldn\t be a problem, but I would still need a dummycontroller on the client so that CMC starts working when input is given in the client
hidden thorn
#

Question, if you have a door open and then a client joins how do you update that on his pc as well without anyone interacting with the door?

twin vault
#

RepNotify variables, you can execute a function whenever they are replicated

#

which includes joining, getting closer to it, becomming relevant...

hidden thorn
#

I sort of knew that RepNotify is what i need to use as someone told me about it before but I wasn't 100% sure, thanks

hidden thorn
#

Is there a C++ tutorial on how to implement steam?

meager spade
#

@hidden thorn there is a udemy course on steam and ue4

#

but apart from that i dont know

neon mango
#

Is recoil something I can let happen client side only?

#

Or I should have that happen server side as well?

slim holly
#

recoil cheat is pretty common

hidden thorn
#

@meager spade Have you got a link to it cause I can't find it.

bitter oriole
#

@neon mango You're going to have a hard time creating recoil that can't be hacked anyway

slim holly
#

doable with superbullets

bitter oriole
#

Recoil has two implications : it moves the reticle away from the target, forcing additional delay between shots ; and it adds some difficulty to aiming by having unpredictable behaviour

#

You can have hard enforcements of these, but at the end of the day any cheat can always provide the fastest possible correction that your game allows and still give an edge

slim holly
#

yea the correction speed is something you can't prevent

bitter oriole
#

Aimbotting & wallhacking are the two classic examples of client side cheats that are impossible to entirely prevent

#

Well, that and lagswitching

#

Competitive games resort to additional client strategies like cheat detection & banning, obfuscation, etc

slim holly
#

I mean, pubg went +1 on the client side cheats and managed to enable client side skeletal transformations

#
  • they overwrote the relevancy settings that enabled map-wide wallhacking
#

wallhack can be disabled at 95% times, but it's a lot of work to do the line of sight tests

bitter oriole
#

And then it depends a lot on gameplay

#

Oldschool shoot-through-paper-walls gameplay ala CS 1.6, COD4 makes any wallhack a huge advantage

slim holly
#

well if you have custom char movement with custom network prediction, you should be able to tell when a possible sight line is available

#

thus enabling replication at right time and rendering wallhack useless

#

but as you said, that's where the missing 5% comes in to give the advantage if you can shoot through walls

bitter oriole
#

I mean a simple example would be a "wall" that has holes in it - some kind of fence or broken construction

#

You'd need to do raytracing to accurately conclude on visibility ๐Ÿ˜›

slim holly
#

capsule edges

bitter oriole
#

So you have to make that kind of object transparent to replication switching, and voila, wallhacking in a not-so-rare case

#

Hell, foliage can be a super effective option to hide yourself, and there's no way you can toggle replication based on foliage

#

Like I said it depends a lot on the game, but if your game has plenty of hard walls, it might work well enough to deter that cheat approach

slim holly
#

true, it wouldn't work on foliage

#

or, maybe

#

if it would replicate only when the hiding player moves

#

once replication stops, it replaces it with static gameobject

hidden thorn
#

Question, if I integrated steam correctly (I am getting the steam overlay) I host a server but when I start a second instance I can't connect.

#

Did I do something wrong or I need 2 PCs to test it?

slim holly
#

2 steam accounts, so yes 2 PCs

hidden thorn
#

oh ok

slim holly
#

not sure how does it work with virtual machines

#

I guess it should be fine in such case if you have 2 different network interfaces

#

and connections

hidden thorn
#

I just moved my project on a laptop, only issue I have to use my phone to transfer it as I left my ext-hdd, I've been here for a long time ๐Ÿ˜ฆ

hidden thorn
#

What exactly is the difference between Advanced Sessions and the ones provided by the engine.

wary willow
#

@heady merlin May be able to doa summary

#

but, you can easily just read it on the thread

#

and look at all the nodes

gloomy tiger
#

Hey guys, when doing network profiling, what's the most important thing to consider that's killing performance? ๐Ÿค”

neon mango
#

@bitter oriole So your saying do want I want with recoil since cheat prevention on this subject entails a lot more then just validating values server side?

#

@gloomy tiger if you find a good network profiling tutorial please share

gloomy tiger
#

ha! will do @neon mango

bitter oriole
#

@neon mango Basically recoil can't be enforced in a way that's not cheatable, imho

#

You can possibly measure the angle between 2 shots, divide by time, and have a max speed based on recoil

#

To detect and kick the player

#

But at the end of the day the player can cheat with a possible value that's still higher than most players

neon mango
#

ok

summer nova
#

@bitter oriole counter strike does the recoil thing

#

they do it by being lying bastards

#

your local recoil is not the same recoil as the server

#

counter strike recoil has a pattern + a random offset

#

the random offset is fully random and different from client to server, but the pattern is the same

#

they did that becouse there were aimbotters that read the rng seed from the memory, and just counteracted it

icy nacelle
#

UI widget is showing up for everyone when it should only show for the client that its called on. How do I make it so this only functions on the client its called on?

west rapids
#

move this to the HUD or PC class

#

wait, this logic doesnt spawn a widget

icy nacelle
#

Nope, it just edits an existing one

#

I figured it'd be easier that way

west rapids
#

well, if you spawn widgets from the server by multicasting, itll spawn for everyone

#

tho im not sure if that would even work, since im unaware if widgets inherit from HUD class.

icy nacelle
#

Whats really weird is that this function does not touch any RPC

#

For instance, when a player presses a key, this function is used

#

And this function will run on everyone

#

And I have no idea why, must be something to do with HUD classes

west rapids
#

the event u have here runs on owning cleint, but technically every client owns his own hud

#

afaik Server has no HUD, so u cant execute from it onto cleint for hud

#

dont quote me on that though

icy nacelle
#

Yeah I thought making it RoOC, it would make it just run on that client

#

hmmm

west rapids
#

its best to deal with widgets clientside only

#

and update values serverside

#

but then since server has no HUD class, you cant get authority to set things, so you gotta run it through playerstate or gameistate/nstance

icy nacelle
#

Surely though if this function is called from a player controller, it will only run for that player??

west rapids
#

every player has a player controller, so it will run for every player, but it wont by synced.

#

i mean P1 will run his function, but then P2 will run his function, which is the same one, etc etc

#

what exactly are you trying to make?

icy nacelle
#

Just tried to check through it with breakpoints, still cant figure out why its running on both

#

Okay so when a player walks into a trigger volume, a 'tip bar' comes up on screen that tells the player information about this trigger volume. Simple as that

west rapids
#

because if its on the PC, its like you having a beer and me having a beer, I open my beer, but the behavior is the same as when u open urs.

icy nacelle
#

Yeah I just dont understand why this is happening

#

๐Ÿป

west rapids
#

i see, and where's ur logic for spawning the tip bar?

icy nacelle
#

It's literally just that

#

Since I was using it multiple times I wanted to make a function

winged badger
#

OnBeginOverlap (for the trigger volume) -> if OtherActor is a Pawn and a LocallyControlledPawn -> Get the OtherActors HUD and display a widget

#

no RPCs required

west rapids
#

^

#

To be honest I'm struggling to think of a case where ROC RPC would be needed.

#

maybe utility functions or smthing, but then most of those could be on a RepNotify

winged badger
#

bought an item from a shop

#

sure you can figure out that your money decreased, that your inventory has a new item now

#

but its far easier to send a Client RPC so the client knows to pop up a widget "Purchase Successful"

west rapids
#

well if u replicated the inventory array ๐Ÿ˜„ though thats not very smart, it would still work

#

but it's a good example, thanks, never had to think bout shops.

winged badger
#

you want to draw a line of particles from your character to your target when user presses a button

#

and you do not have navmesh enabled on clients for it to calculate the path itself

west rapids
#

aye i was thinking that firing particles would be more common use for roc

winged badger
#

you send a server request to calc a path, which sends a Client RPC back with PathPoint vectors

#

which draws them

west rapids
#

but then theres one thing about that I don't get

#

if you have a Smoke Screen, then it has to fire on all clients, but then if I remember someone saying that particles dont play well with relevancy, so if you get far enough it may not fire when you get into relevant range

#

though that was in 4.8 i think so if it was a problem its probably gone by now

#

But yeah great examples, never occured to me ๐Ÿ˜›

winged badger
#

if relevancy is your problem you can just spawn an empty actor with particle emitter attached

#

and destroy it when its done smoking

west rapids
#

aye makes sense

#

should change ur nickname to RepNinja lol

winged badger
#

i had a funny one, when monster dies it would get its bIsDead set to true, which replicated

west rapids
#

though Evil is cool too i spose

winged badger
#

so if you were to run from outside the NetRelevancy range into a pile of dead monsters

#

bIsDead would replicate, it would trigger its OnRep function, which plays the monster dying animation

west rapids
#

theyd resurect ? ๐Ÿ˜„

winged badger
#

so all the monsters would get up so you can watch them die ๐Ÿ˜ƒ

west rapids
#

ive seen that in older games

#

even SP ones

#

CS 1.3 had that

#

but that is ancient history lol

winged badger
#

what does the function do?

west rapids
#

just adds movement input to pawn

winged badger
#

and define "lock"

west rapids
#

my player controller loses ownership ๐Ÿ˜„

#

i get no owning connection for PC actor

#

took me 2 days to figure out what was causing it

severe widget
#

Wait, really?

winged badger
#

you can't multicast from controllers

west rapids
#

is this very dumb

severe widget
#

If you don't do that, it doesn't complain?

winged badger
#

i mean you can, but it tends to knock clients offline

west rapids
#

i knew i was doing something stupid ๐Ÿ˜„

#

yeah no complaints

severe widget
#

Oh I didn't see the multicast

#

don't do that LMAO

west rapids
#

well i wanted the movement to be seen by all players