#multiplayer

1 messages ยท Page 561 of 1

queen flower
#

ill delete the old ones and drag in a new one.

#

whats the difference between Player Start and Network Player Start?

dull flame
#

not sure, ive never used the NPS

queen flower
#

interesting

dull flame
#

the normal one is fine for what ive done in multiplayer

queen flower
#

ok deleted the player starts and added 1. both players spawned at the same point but client is still not moving.

#

server player does move.

dull flame
#

can you screenshot how your pawn handles input

queen flower
dull flame
#

oh thats way different that what I thought

#

sorry I've never used the top down templatw

queen flower
#

yea

dull flame
#

is that last shot from in your pawn or your character controller

queen flower
#

controller

dull flame
#

and when you're testing, you have a menu level that you load into first, right?

queen flower
#

yea

dull flame
#

yeah thats all I can think of right now

#

I'll mention you if I can think of anything else though

#

I'd just go for classic debugging techniques like testing to see if the pawn is even recieving input, and how far it gets in the BP without messing anything up

queen flower
#

it goes all the way to that last screenshot

#

printing the "Default moving" string

dull flame
#

maybe test to see if it gets past the branch?

#

also when you click it says the client is printing out stuff right?

#

should be like "client: default moving"

queen flower
#

yep

#

maybe itll specify Client once i have a 2nd player

#

sec

dull flame
#

oh

#

yeah

#

the default is to run as server

#

you need to connect a second dude for a client to exist

#

whoever hosts the game is also the server, unless you're using a dedicated server

queen flower
#

still doesnt specify...

#

this is why i wanted to see if the index for the controller was changing

dull flame
#

weird, maybe that only specifies in the pawn?

queen flower
#

to see if somehow the same controller is conflicting

#

yea maybe

dull flame
#

I don't think it would, but you could always print the controller index to debug

queen flower
#

how?

#

I can only manage to get controller 0 in all the nodes.

dull flame
#

I'm not on my pc rn but I'd say somewhere in the controller the should be a "get index" node or something of the sorts

queen flower
dull flame
#

maybe not tho

#

the id

#

right there

#

that should be it I think

#

thats in the pawn?

queen flower
#

yea the TopDownCharacter

dull flame
#

and on the second screen, does it not show a player index of 1 in the ui?

#

on the clients window

queen flower
#

let me add the client

#

testing on 2 different machines so have to submit through perforce each time

dull flame
#

lol you dont need to do that hahah

#

open the dropdown menu next to the play button, and slide the number of players to 2

#

that will just open two windows on your main machine

queen flower
#

this only opens 1 window..

dull flame
#

prob cause its standalone

#

i would make 2 players, no dedicated server, and new editor window

#

thats my defaults

queen flower
#

isnt stand alone needed to test multiplayer/steam stuff?

dull flame
#

not to my knowledge

queen flower
#

have you tested your game on 2 different networks?

#

had a friend join your game from a different home or city?

dull flame
#

"By default, the server type is set to a Listen Server when playing in the editor or standalone game."

#

still a listen server either way

#

but no i haven't so you may be right

queen flower
#

yea maybe play modes need to be different depending on what youre testing

#

the steam popup doesnt come up unless in stand alone

dull flame
#

actually i just remembered that i have had a friend connect from another network

#

it was a packaged game though so i dont know if that affects it

#

i usually just join by hosting a lobby and not through steam

queen flower
#

lol yea that isnt somehting ive done before.

dull flame
#

im pretty sure that joining thru steam just bypasses the step of finding the lobby, and just joins your friends

queen flower
#

havent packaged a game and then tested multiplayer joining

#

nope

#

you still have to use the lobby if you set that up

dull flame
#

hmmm

queen flower
#

this testing.. in standalone/steam popup just allows other unreal editors to join your game.

dull flame
#

i've always just used the defaults i recommended above and didnt worry about steam, but when the game was packaged my friends were able to join

#

it was an awful attempt at a game but the point is there

queen flower
#

yea ill use your ways for testing locally

#

just worried that itll change replication

dull flame
#

shouldn't, i still have to deal with it all the time

#

ue4 still treats client viewports as dedicated clients, whether you run on a different machine or not

#

cross network testing should really only affect the "use lan" setting when finding/making sessions

#

the two viewports are still separate entities from ue4's view

#

that also rules out anything that might have gone wrong when transferring through perforce and anything like that

queen flower
#

alright

dull flame
#

when you join the host's session, the UI should say player controller 1 (the number doesnt really matter, as long as it's different than the host's) and auth: client

#

or auth: remote, i dont remember which

fervent spoke
#

is there a good resource for information on implementing lag compensation in UE4?

frozen brook
#

Lag as in?

#

@fervent spoke

fervent spoke
#

FPS lag compensation

gusty raptor
#

Hi, what does 'Replicate Movement' exactly do? will it do client side prediction? Im just moving a actor on server with setActorLocation, but the client is very laggy

fossil spoke
#

No it does not enable prediction, it simply replicates changes to Location and Rotation of the given Actor to Clients.

#

The CMC is the only movement component that handles Client side prediction.

gusty raptor
#

So why is Replicate Movement so laggy? is that expected?

oak hill
#

ReplicateMovement works differently based on wheter or not the root component of an actor simulate physics

#

if it isn't, it snaps to the last value received from the server

twin juniper
#

Hey devilsD

#

:[

fossil spoke
#

Hello?

gusty raptor
#

Its not physics @oak hill , just moving actors

bitter oriole
#

@gusty raptor "Replicate movement" simply teleports the actor every time a server update is received.

#

So maybe once a second when the network bandwidth is low

oak hill
#

Yeah, it's replicated at the frequency setted in NetUpdateFrequency

#

If you look in ACharacter it overrides the function PostNetReceiveLocationAndRotation, where it applies the smoothing

bitter oriole
#

It's replicated at the maximum frequency in NetUpdateFrequency

#

Will commonly be much lower

oak hill
#

Definitely yes. In fact, I don't understand why the default value is so high

lusty badger
#

I'm trying to copy properties in the player State, but it doesn't seem to work, the variable change back to it's original state, I have read that variables that are not mark as "ReadOnly" doesn't get copied, but that have no sense, how can I transfer the variables of a player state trought levels then?

meager spade
#

we use copy properties fine

#

only works with seamless travel, and seamless travel does not work in PIE

lusty badger
#

Yes, I have seamless travel activated and I pack the project to test

#

But the thing is that only happen in the clients, in the server the variables are copied fine

meager spade
#

that doesn't sound right

lusty badger
#

Other thing is that I'm doing this to select the Skin of each characters in the function "GetDefaultPawnClass", maybe the problem is that the player state don't have the data copied jet in that moment?

meager spade
#

our game would break if that happened

waxen socket
#

Good morning. I'm trying to determine when a yet-unpossessed pawn's BeginPlay is running on the listen server in Blueprints. I've determined the following information about role:

Server

Server: Authority / SimulatedProxy
Client1: Authority / SimulatedProxy
Client2: Authority / SimulatedProxy

Client1

Server: SimulatedProxy / Authority
Client1: AutonomousProxy / Authority
Client2: SimulatedProxy / Authority

Unfortunately for me, it looks like all pawns have the same local and remote authority during their BeginPlay on the server.

Does anyone know how I might single out the listen server's own pawn running BeginPlay on the server?

gleaming niche
#

islocallycontrolled

#

actually not in beginplay

#

because it's not posessed yet

#

beginplay happens after it's been spawned, but before it's been possessed.

waxen socket
meager spade
#

hmm

#

checking get local role on an actor is not good

waxen socket
#

Pourquoi?

meager spade
#

what is the "Actor" here?

waxen socket
#

A pawn that has not yet been possessed.

meager spade
#

right, why do you need to care ?

#

when its unpossessed?

waxen socket
#

Because I want to run a function on only the client or listen server that is going to control that pawn.

meager spade
#

right, but clients won't have a controller, nor is it reliable to check ROLE_AutonomousProxy before possession

#

and this will return Local for Simulated pawns also

#

ah nvm

#

cast failed goes to remote pin

#

but even so

waxen socket
#

Sorry about the bubble. ๐Ÿ˜…

#

So why is it a bad idea to get local role on an actor? It's worked so far for me although I haven't tested it too hard.

meager spade
#

i mean if it works it works, but ROLE_Autonomous is not reliable before possession

#

and casting to a controller on begin play

#

which may or may not exist

waxen socket
#

So I should keep my eyes on that role check for the day it screws up?

lilac bear
#

quick quesiton guys, what is the proper way to "kill" an actor on a client? Currently I have server calling Destroy() on replicated actor, but to avoid lag rep issues I am hiding the actor on client side at same time. Anything else I should do? Such as mark actor on client side as "pendingKill" or something?

For use case example, this is a projectile I'm killing on overlap

waxen socket
#

Mjolnir, that's how I handle it.

lilac bear
#

@waxen socket ๐Ÿ‘

gleaming niche
#

i just hide the visible stuff

#

with a bindable event

#

it deletes on it's own

#

or returns to pool, if it's a pooled thing

#

for non-predicted projectiles, i just do the hide part only, cuz it will be destroyed once the server says so (i delay the destroy on server side with a lifespan, so it gives the replicated thing time to do stuff)

#

like spawn client-side effects, etc.

twilit oak
#

if a client calls a Server RPC, and this RPC then calls a normal c++ function. that would get called on the server aswell right?

rich cradle
#

Just wondering, does anyone here know how to search for dedicated servers using the SteamOnlineSubsystem?
I haven't been able to get any results with the regular IOnlineSession::FindSessions(). I have also been completely unable to find anything online about it

#

Seems like most people have a problem with hosting a dedicated server but not a single question on how to actually find em. In order to test some UI stuff I just wanted to return all dedicated servers found for appID:346110 (I have set this appID in the Engine configs cause I figured that FindSessions pulls the appID from there in order to know where to look for servers)

waxen socket
#

@twilit oak Yeah, your execution flow won't switch machines without you telling it to do so.

twilit oak
#

yep, makes sence. i got paranoid becouse of some bugs. ty

dull island
#

Ok folks, I'm super stumped. Has anyone else ever implemented a custom UNetDriver/UNetConnection?

#

I have it 99% working, packets and everything are being sent between clients, but for some reason when clients connect the server just keeps replicating their player controller and pawn to the clients.

#

Over and over and over again, and it makes weird flickering, and I can not for the life of me figure out why UE keeps replicating the player controller over.

#

(and by replicating it over I mean, the client thinks it's not net relevant, and every time it spawns a new one it increments)

#

I've been digging through the net driver, net connection, replication code to find anything that might indicate why this is happening

#

I've compared my implementation with the Steam sockets net driver/net connection and it all does the same thing

#

The closest I've been able to get to is whenever the server goes and runs UNetDriver::ServerReplicateActors_ProcessPrioritizedActors, it doesn't seem to have a channel for the actors

#

so it goes and creates a new channel

#

but as to why it's not keeping track of channels I have no idea

#

especially since my net driver/net connection don't do anything with them

gleaming niche
#

if a client calls a Server RPC, and this RPC then calls a normal c++ function. that would get called on the server aswell right?
@twilit oak if a client calls a sever rpc, only the server runs it.

rich cradle
#

The entire execution path starting from your (Server) _Implementation function will be executed only on the server. This includes all function calls and variable edits regardless of if they are replicated or whatever

dull island
#

FYI folks the answer was config

#

I needed to add the following config to DefaultEngine.ini:

[/Script/OnlineSubsystemEOS.EOSNetDriver]
NetConnectionClassName="/Script/OnlineSubsystemEOS.EOSNetConnection"
ConnectionTimeout=80.0
InitialConnectTimeout=120.0
NetServerMaxTickRate=30
MaxNetTickRate=120
KeepAliveTime=0.2
MaxClientRate=15000
MaxInternetClientRate=10000
RelevantTimeout=5.0
SpawnPrioritySeconds=1.0
ServerTravelPause=4.0
#

if you don't set that RelevantTimeout is 0.0, which means actors and other things become irrelevant instantly

lilac bear
#

coding in C++ here, does AttachToComponent() replicate? I think I'm missing something somewhere since it attaches on server but not on client

#

I'm 90% the answer is yes, so I'm still digging around to figure out what I'm missing that would cause this behavior, brb folks

real wind
#

Sup all, me again with the same null pointer issue. I describe the issue in much greater detail in the linked issue. If anyone has experience with the ALS C++ library or/and the Advanced Jigsaw Inventory I would greatly appreciate it if you took a look. ๐Ÿ™ https://github.com/dyanikoglu/ALSV4_CPP/issues/42

dull flame
#

@lilac bear I believe that to replicate the component, there should be a bool way to set that (i do BP so idk the ue4 implementation for cpp), but if you are spawning and then attaching, make sure each client is calling the spawn, or the server is calling it for each client. In other words, make sure that it isn't something just happening on the server

lilac bear
#

@dull flame that does seem to be the case here as I am only calling the attachtocomponent() via a server function, but wasnโ€™t sure if it was proper to call this same function on client if it is already a replicated function

wary wyvern
#

Guys, I'm trying to move object on client by navmesh. But nav mesh seems to be available on server-side only. Is it possible to make FindPath() work on client as well?

dull flame
#

@lilac bear if youre calling it on the server then it will only execute on the server, and no clients. if you want to condense it a bit and leave the logic on your server, you could call it as a multicast function, which calls it on the server and on the client. Again, idk how to in cpp tho

lilac bear
#

@dull flame No worries, if you have to do it in BP then Iโ€™m sure cpp will be the same. Iโ€™ll give it a shot ๐Ÿ™‚

meager spade
#

Attachment replicated

#

replicates*

#

calling on the server will replicate that attachment to all clients automatically, as long as both replicate

lilac bear
#

@meager spade that is what I thought I read, but it doesn't seem to be behaving that way despite both actors (in the child BP class) being set to replicate. Can you direct me to how to verify this sort of thing myself in the base UE4 engine? I'm starting to wonder if I'm overriding some replication value like a doofus

meager spade
#

hmm the property is called ReplicatedAttachment

#

its in AActor

#

@lilac bear

sand tusk
#

How do i do the the launcher for my game? (is not a completed game, want to try the multiplayer)

lilac bear
#

@meager spade thanks yet again! (3 times now)

meager spade
#
    struct FRepAttachment AttachmentReplication;```
#

i mean this has to be done on the actor that IS attached

#

so that has to replicated, and replicate to everyone

lilac bear
#

@sand tusk are you looking to package the build (so you can run from an exe out of the editor)? Do you have a menu built in or looking to just use a console command outside the editor to do the basic multiplayer test? There are some good tutorials covering some of that out there that I could point you to ๐Ÿ™‚

sand tusk
#

@sand tusk are you looking to package the build (so you can run from an exe out of the editor)? Do you have a menu built in or looking to just use a console command outside the editor to do the basic multiplayer test? There are some good tutorials covering some of that out there that I could point you to ๐Ÿ™‚
@lilac bear Just basic multiplayer test

#

tbh tried to look on yt

#

but idk how to search, looked for "unreal engine 4 create launcher for game" but nothing showed up

meager spade
#

when you package, it will create all the files

lilac bear
#

@meager spade yep, in this case it is a pawn "spaceship" who has an 'inventory' actorcomponent that is 'equipping' an actor 'item', both item and spaceship are replicated

meager spade
#

you just run the resulting exe

#

@lilac bear i have no idea then, cause i have yet to see my weapons never get attached

lilac bear
#

@meager spade yep, I think I goofed something and just have to track it down ๐Ÿ™‚

meager spade
#

i just set the attachment on local client and server

#

(cause all weapon swaps are client lead, for responsiveness)

sand tusk
lilac bear
#

I believe it is this:

  1. click dropdown next to launch
  2. select what device you want to build for (my windows pc in my case)
  3. click launch
    Edit: (this is just for building to test in a separate window/process, not for sharing with someone else)
#

been loooong time since I've done it but hopefully my memory is still good

sand tusk
#

then i can send it to someone?

gleaming niche
#

file -> package project -> <platform>

lilac bear
#

ah thanks omega >_<

gleaming niche
#

also works, as long as you don't need any custom build behaviour

lilac bear
#

full disclosure here, last time I was messing (as a hobby) with UE4 it was during the 4.9 days ๐Ÿ˜„

rich cradle
#

Figured I would ask again! Anyone know how to actually find steam dedicated servers of a given appID using FindSession?

sand tusk
#

After i package the project if someone come online, and i'm online too, we'll see eachother?

meager spade
#

that depends on your subsystem setup

#

would not be like that by default

#

you need sessions, a OSS (null is fine for LAN), like Steam or EOS

gleaming niche
#

@rich cradle in the search, don't search presense.

#

dedicated servers aren't presence.

#

that reminds me, i need to figure out a way to search both.

rich cradle
#

@gleaming niche

SessionSearch->bIsLanQuery = false;
SessionSearch->MaxSearchResults = 100;
SessionSearch->TimeoutInSeconds = 5.f;
SessionInterface->FindSessions(0, SessionSearch.ToSharedRef());

You mean at another line like this?
SessionSearch->QuerySettings.Set(SEARCH_PRESENCE, false, EOnlineComparisonOp::Equals);

#

because I have tried that and it makes no difference

#

I dont even understand what sessionsearch is searching for. Is it using the APPID set in the EngineConfig.ini file?

#

I tried launching the game in standalone with steam to get the subsysetm attached, then attaching the debugger and stepping through the FindSession function but I couldnt find anything useful

gleaming niche
#

GameSession->FindSessions(PlayerOwner->GetPreferredUniqueNetId().GetUniqueNetId(), NAME_GameSession, bLANMatch, !bSearchDedicated);

#
    * Find an online session
    *
    * @param UserId user that initiated the request
    * @param SessionName name of session this search will generate
    * @param bIsLAN are we searching LAN matches
    * @param bIsPresence are we searching presence sessions
    */
    void FindSessions(TSharedPtr<const FUniqueNetId> UserId, FName SessionName, bool bIsLAN, bool bSearchCustom);```
#

i think i renamed it in mine, but

#

CurrentSessionParams.bIsPresence = bSearchCustom;

#

so when searching for DS, bIsPresence should be false

#

as DS should never create a presense session (and will usually crash at startup if it does)

#

in the staem plugin

rich cradle
#

well thats for if you host a session

#

I am just trying to get FindSession to return all dedicated server for a given appID

#

I am trying to get the same results you can see when you go into steam and just open the global server browser

gleaming niche
#

you want to search different appid?

rich cradle
#

Well what appID is findSession searching for?

#

I assume the one set in EngineConfig.ini?

gleaming niche
#

the one your game is using

#

and either steam_appid.txt or whatever is passed when launching from steam

rich cradle
#

oh thats new

gleaming niche
#

anyway, what i said was the case. witht he defaulkt OSS plugin the only way I could see both DS, and listen servers, was to just make two lists

#

one searches presense, the other doesn't

#

the ds's show up in the non-presense list, and listenservers are in the presense list.

rich cradle
#

so you would call FindSession twice with different parameters?

gleaming niche
#

for now, i eventually would like to figure out how to search both

#

and then filter myself

#

yeah, well i do it with tabbed window

rich cradle
#

Where did you read about the steam_appID.txt?

gleaming niche
#

the tabs on the top switch the list, and then teh serach happens independently

#

uhm, documentation + steam

rich cradle
#

huh, doc mentions that the file is created on program start and deleted on program shutdown

#

so no wonder i have never seen it

gleaming niche
#

there's the option for restartin steam or whatever it's called, so if it's launched outside it will relaunch

#

i believe that's the one that will create it

#

when actually launched from steam, it sets an environment ariable too

rich cradle
#

I have just been starting from within the editor using the "Standalone" option

gleaming niche
#

ah i guess editor is craeting it

#

i never do it that way. i probably should.

#

i always just run my build script and auto-publish to beta branch, so i can test with two machines lol

rich cradle
#

hmm running ultrasearch there doesnt seem to be a steam_appid.txt created when running from the editor

half jewel
#

i have a vehicle actor and a weapon actor. The vehicle spawns the weapon during roleAuth post initializeComponents.

the weapon is designed in a way where it looks for sockets on its mesh named Barrel to shoot from. This way FireWeapon() can fire 4 projectiles (4 sockets) with just one actor. If there is no weapon mesh then it finds Barrel sockets on its owner.

there lies the problem. sometimes for client weapon is replicated BEFORE vehicle. now weapon cant find barrel socket on owner, cause owner does not exist yet!

what can i do ?

rich cradle
#

yet the steamonlinesubsystem works anyways

gleaming niche
#

a looooooong time ago, i used to do it from editor

#

and i had to make a steam_appid.txt and put it in project folder somewhere

#

to make steam work there, but then i stopped doing that entirely once i established my build scripts

rich cradle
#

well ultrasearch found a bunch of those steamappid txt files in all the folders where I have steam games installed

#

so I am pretty sure thats just something steam itself needs when distributing builds

gleaming niche
#

when something is not launched from steam

#

it needs steam_appid.txt for SteamAPIInit

rich cradle
#

right

gleaming niche
#
The Steam client couldn't determine the App ID of game. If you're running your application from the executable or debugger directly then you must have a steam_appid.txt in your game directory next to the executable, with your app ID in it and nothing else. Steam will look for this file in the current working directory. If you are running your executable from a different directory you may need to relocate the steam_appid.txt file.```
rich cradle
#

jop, but my issue is on the unreal site

gleaming niche
#

unreal is using steamapi, and linking with it. therefore, it applies

#

infact, my actual dedicated server, running from steamcmd, also needs teh steam_appid.txt so the DS can even create a session

#

wel, it creates it.

#

but it doesn't work without it.

rich cradle
#

I was using UWorks before (bp steam api wrapper) and its find server function would take an APPID and then just return all servers it finds

gleaming niche
#

yeah, so you can actually do that too

#

if you want to work with teh steamapi directly

#

just add SteamShared to build.cs

#

and then you can do the thirdparty includes, and run steam functions directly

rich cradle
#

I feel as though going down that route would be disastrous because then I would have to probably make my own implementation and ue's session stuff work together

gleaming niche
#

well as i said, I use teh OSS as is

#

and for me, my only way to See DS, is to jsut set bPresense to false.

#

and then they always show up.

rich cradle
#

you mean when creating a server

gleaming niche
#

no.

#

finding.

#

well yeah wehn creating too, you don't use presense.

#

if (GameSession->HostDedicatedSession(MapName)) //my function:

#
bool ACSGameSession::HostDedicatedSession(const FString& MapName)
{
    IOnlineSubsystem* const OnlineSub = IOnlineSubsystem::Get();
    if (OnlineSub)
    {
        IOnlineSessionPtr Sessions = OnlineSub->GetSessionInterface();
        if (Sessions.IsValid())
        {  
            HostSettings = MakeShareable(new FCSOnlineSessionSettings(false, false, MaxPlayers));
            HostSettings->bAllowJoinViaPresence = false;
            HostSettings->bIsDedicated = true;
            HostSettings->bShouldAdvertise = true;
            HostSettings->bAllowJoinInProgress = true;

            OnCreateSessionCompleteDelegateHandle = Sessions->AddOnCreateSessionCompleteDelegate_Handle(OnCreateSessionCompleteDelegate);
            Sessions->CreateSession(0, CurrentSessionParams.SessionName, *HostSettings);
            return true;
        }
    }
    return false;
}```
#

and then the search, to find DS is just

#
        CurrentSessionParams.bIsLan = bIsLan;
        CurrentSessionParams.bIsPresence = bSearchCustom; //if true, find listenservbers, false, find ds
        CurrentSessionParams.UserId = UserId;

        IOnlineSessionPtr Sessions = OnlineSub->GetSessionInterface();
        if (Sessions.IsValid() && CurrentSessionParams.UserId.IsValid())
        {
            SearchSettings = MakeShareable(new FCSOnlineSearchSettings(bIsLan, bSearchCustom));
            if (bSearchCustom)
                SearchSettings->QuerySettings.Set(SEARCH_KEYWORDS, CustomMatchKeyword, EOnlineComparisonOp::Equals);

            TSharedRef<FOnlineSessionSearch> SearchSettingsRef = SearchSettings.ToSharedRef();

            OnFindSessionsCompleteDelegateHandle = Sessions->AddOnFindSessionsCompleteDelegate_Handle(OnFindSessionsCompleteDelegate);
            Sessions->FindSessions(*CurrentSessionParams.UserId, SearchSettingsRef);
        }```
rich cradle
#

what type is CurrentSessionparams?

gleaming niche
#

FCSGameSessionParams CurrentSessionParams;

#
{
    FName SessionName;

    bool bIsLan;
    bool bIsPresence;

    //Id of the player creating the lobby
    TSharedPtr<const FUniqueNetId> UserId;
    int32 BestSessionIdx;

    FCSGameSessionParams() : SessionName(NAME_None), 
        bIsLan(false), 
        bIsPresence(false), 
        BestSessionIdx(0)
    {
    }
};
#

actually you don't even need that.

#

SearchSettings = MakeShareable(new FCSOnlineSearchSettings(bIsLan, bSearchCustom));

#

that struct

#

which

#

is a child of FOnlineSessionSearch

rich cradle
#

Ah okay

gleaming niche
#

don't really even need it, i used to have custom crap in it.

rich cradle
#

I just use the base FOnlineSessionSearch

gleaming niche
#

strange if you just use the base one

#

it should find dedicated automatically

#

it shouldn't even search presense.

rich cradle
#

and the base one has this in its constructor

    FOnlineSessionSearch()
        : SearchState(EOnlineAsyncTaskState::NotStarted)
        , MaxSearchResults(1)
        , bIsLanQuery(false)
        , PingBucketSize(0)
        , PlatformHash(0)
        , TimeoutInSeconds(0.0f)
    {
        QuerySettings.Set(SETTING_MAPNAME, FString(), EOnlineComparisonOp::Equals);
        QuerySettings.Set(SEARCH_DEDICATED_ONLY, false, EOnlineComparisonOp::Equals);
        QuerySettings.Set(SEARCH_EMPTY_SERVERS_ONLY, false, EOnlineComparisonOp::Equals);
        QuerySettings.Set(SEARCH_SECURE_SERVERS_ONLY, false, EOnlineComparisonOp::Equals);
    }```
gleaming niche
#

yeah that's what im saying

#

it should find dedicated

#

because you need QuerySettings.Set(SEARCH_PRESENCE, true, EOnlineComparisonOp::Equals); to search for the listen/presence ones

rich cradle
#

yeah and I dont have that

#

SessionSearch->QuerySettings.Set(SEARCH_PRESENCE, false, EOnlineComparisonOp::Equals); I also added this line just incase

gleaming niche
#

is the dedicated server ACTUALLY connecting?

#

and creating it's session, for reals?

rich cradle
#

I am not creating sessions

gleaming niche
#

then you won't see it.

#

it won't show up

#

since it won't register with the steam master server.

#

unless it creates a session, witht he steam serverapi

rich cradle
#

I am literally just trying to have FindSession return the thing as the regular steam server browser

gleaming niche
#

if you want that, then you need to use steamapi directly

rich cradle
#

so if I were to change my appID to whatever appID "Squad" used for example I would want FindSession to return me eaxctly this information

gleaming niche
#

there's two types of servers.

#

OSS creates steam lobbies.

#

and then there's the old school stuff that steam is based on

#

like goldsrc/source

#

and quake, with the master server

#

OSS only finds sessions (steam lobbies in the case of steam)

#

if that other app, is not creating lobbies, even if you use it's appid, you won't find anything

#

with OSS.

rich cradle
#

oof

gleaming niche
#

random useless info: lobbies/matchframework was originally created for l4d

rich cradle
#

I really dont want or need automatching for my game. I would like a simple server browser that lists all dedicated servers the master server knows about and then join those directly

gleaming niche
#

if you're using OSS, then you need to make the DS create a session

#

the normal way, is to implement that stuff that i pasted

#

and just place is in:

#

AYourGameSession::RegisterServer()

#

dedicated server will automatically call that

#

from GameModeBase

rich cradle
#

well, I havent gotten to any other steam part yet

#

I have literally just enabled OSS and my first step was to have my server browser be populated with some popular game to see if it works

gleaming niche
#

you need to find a game that uses lobbies

#

and then you can see it

#

lol

rich cradle
#

Right, except that I dont even want lobbies so I suppose I now have to do the steam stuff myself

gleaming niche
#

you can use lobbies without actually "using lobbies"

#

just use the sessions

#

which creates the lobby in the backend, and then people can just join

#

they just "join the session" in "unreal language"

rich cradle
#

Well I tried Ark and Squad (both ue4 games) and I couldnt get anything from either so I just assumed it didnt work at all

gleaming niche
#

the other benefit is that you also have steam networking

#

if they are showing up in the server browser in steam

#

they aren't using lobbies.

#

so OSS won't find them

#

cuz as i said, OSS does sessions

#

so those g ames must not be using OSS

rich cradle
#

well then I wont be using OSS either, as painful as thats going to be

gleaming niche
#

out of curiousity what is your aversion to it?

#

you just want people to be able to use the external server browser only? instead of just finding ingame?

rich cradle
#

Nah, I just like things simple, even if its more complicated

gleaming niche
#

well i would say using sessions that is already built in is the most simple, since it works haha

rich cradle
#

True. I dunno, I just deeply despise over complicated things.

#

I like things that are just stupid and as straightforward as possible

gleaming niche
#

yeah, and that's what im saying, the OSS way is "stupid and straightforward" if you want to dig into the steam api itself, it's way more complicated, totally doable, but a lot more complicated.

rich cradle
#

Dedicated server informs master server that it exists. Client pings master server and gets all servers. <- That to me seems like the most straightforward simple implementation of the entire thing

gleaming niche
#

you can for the most part just copy and paste from spacewar

#

so you have to implement everything

#

like the steam tokens

#

and your own method of restarting the engine when launched outside, etc.

rich cradle
#

oh god...I vaguely remember steam token stuff...fuuuuck

gleaming niche
#

and you won't be able to use steam sockets anymore

#

not from game level

rich cradle
#

steam sockets?

gleaming niche
#

yeah teh steam networking stuff, that does NAT punch, or relay

#

and p2p for listen servers

rich cradle
#

ahh..well my game is dedicated servers only so I guess that wouldnt be relevant. But the fact that I didnt know about does not bode well if I were to implement the steam stuff myself

#

so I guess...fuck it

#

session it is

#

even if it aint EXCATLY what I want

gleaming niche
#

take a look at shootergame, it's the simplest to follow

#

hell you can copy and paste all the session stuff from shootergame, and just rename it and change the _API

#

and it will work instantly

#

that's what i originally did 3 years ago

rich cradle
#

alright, I can take a look at that at some point. Thanks for the info

gleaming niche
#

in a different project

#

yw and good luck ๐Ÿ˜‰

twin juniper
#

Anyone who can help me :)?

limber gyro
#

ask away

twin juniper
#

I want to understand how i can use FURL to connect to servers using FBlueprintSessionResult

#

I see that FURL has port.address is that the right one to use?

limber gyro
#

never used that sorry

#

ur using sessions correct?

twin juniper
#

yeah.

limber gyro
#

theres plenty of tutorials for that ou there, ive never used sessions so i cant help

twin juniper
#

hmm yeah. I've seen alot.

#

What i am trying to do is get players to connect to a server from a searchresult

limber gyro
#

cant u just link that result to a connect to session node?

#

and connect that way?

#

or join session, i dont remember the name of the node

twin juniper
#

In blueprints yeah.

#

but i want to do this in c++

#

FBlueprintSessionResult& SearchResult

#

is the one i used to get my results for async node.

gleaming niche
#

if you want to do it in C++ you aren't using FBlueprintSessionResult

{
    bool bResult = false;

    IOnlineSubsystem* OnlineSub = IOnlineSubsystem::Get();
    if (OnlineSub)
    {
        IOnlineSessionPtr Sessions = OnlineSub->GetSessionInterface();
        if (Sessions.IsValid() && UserId.IsValid())
        {
            OnJoinSessionCompleteDelegateHandle = Sessions->AddOnJoinSessionCompleteDelegate_Handle(OnJoinSessionCompleteDelegate);
            bResult = Sessions->JoinSession(*UserId, InSessionName, SearchResult);
        }
    }

    return bResult;
}
twin juniper
#

well that makes sense...

limber gyro
#

that above probably helps haha

twin juniper
#

Thank you.

limber gyro
#

my turn now haha

#

does any 1 know how to connect to a server with parameters

gleaming niche
#

with a session?

limber gyro
#

say for example i want to connect to a server and join blue team and not red

#

no sessions

#

im trying to figure out team sorting with matchmaking

gleaming niche
#

i mean if you want to pass parameters

#

you would do it with the ClientTravel call

limber gyro
#

currently im just doing "open ip:port

gleaming niche
#

just add the option to the url

#

i've never used open. but i think it's just like open ip:port?option=whatever

#

and in gamemode ::Login()

#

you can parse the paramaters

#
APlayerController* ACSGameModeBase::Login(UPlayer* NewPlayer, ENetRole InRemoteRole, const FString& Portal, const FString& Options, const FUniqueNetIdRepl& UniqueId, FString& ErrorMessage)
{
    APlayerController* NewPC = Super::Login(NewPlayer, InRemoteRole, Portal, Options, UniqueId, ErrorMessage);

    UE_LOG(LogCSGame, Log, TEXT("ACSGameModeBase::Login: Options: %s"), *Options);

    return NewPC;
}```
limber gyro
#

well now that i think about it i could pass the parameter to the game instance and just use it inside the server?

gleaming niche
#

that would only work for the host

limber gyro
#

well maybe not, since the server doenstk nwo about game instances

#

ye

gleaming niche
#
  1. gamemode only exists on the server
  2. every instance of the engine has one gameinstance
#
  1. server won't know other clients gameinstance
limber gyro
#

so the join params are handled in "login"?

gleaming niche
#

some of them yes. depends on which onlinesystem is used

#

like there is a "hello" that happens elsewhere

limber gyro
#

i just want some thing simply like , a bool that specifies if the player is in team A or B

gleaming niche
#

again, i dunno about using "open" as i never have, but

#

something like

#
              
  APlayerController* PC = UGameplayStatics::GetPlayerController(GetWorld(), ControllerId);
  if (PC)
  {
    FString URL = FString::Printf(TEXT("%s:%i?Team=%i", *IP, port, teamid);
    PC->ClientTravel(URL, TRAVEL_Absolute);
    return true;
  }```
#

the "options" in gamemode::Login(

twin juniper
#

Okay so i need a bit of c++ logic explained to me.

gleaming niche
#

will have "?Team=x"

#

and then you can use int32 requestedteam = UGameplayStatics::ParseIntOption(Options, TEXT("Team"));

#

and then make the new playercontroller join it

twin juniper
#

in the joinsessioncallbackproxy.cpp you have two functions activate() and oncompleted. within activate() there is a commment "oncompleted will get called nothing more to do now" but i am missing when it is called within activate. So how does it get called?

limber gyro
#

how are url parameters specified? i can just write whatever and they will accept it?

#

the server''

gleaming niche
#

?

#

i just showed you

limber gyro
#

ye i understand

#

but this

#

?Team

#

is not declared anywhere

gleaming niche
#

i know, because i just made it up

#

as an example

#

it's just a string

#

there's only specific options that are "built in"

limber gyro
#

but dont u need to declare it anywhere? will the server just take "team" the same way it would take "auhduadhau" for example?

gleaming niche
#

like ?Game=gamemodewhatever

#

uhm that's what the GetIntOption / ParseOption functions are for

#

to just read the string

#

looking for the option format.

#

you can make anything an option, and just use those fucntions to look for it.

limber gyro
#

ok, it makes sense now

gleaming niche
#

kinda like commandline switches, where you just check if they exist

limber gyro
#

do u happen to know the syntax for multiple options?

gleaming niche
#

?Game=game?Team=1?Potato=Chips?NoParamaterOption?NoOtherOption

limber gyro
#

great, thank you

#

will write that down

gleaming niche
#

if it's something that you aren't passing a value

#

you can just use HasOption(TEXT("NoParameterOption"))

#

or something like that

#

let me look haha

#

yeah

#

static bool HasOption( FString Options, const FString& InKey );

#

look at gameplaystatics.h (UGameplayStatics)

limber gyro
#

thanks mate

#

will get on this as soon as i finish matchmaking with playfab

#

other thing, all those custom options are parsed in the login right?

gleaming niche
#

by you.

limber gyro
#

u were saying some other options werent parsed there

#

thats why i am asking

gleaming niche
#

you have to parse for them

#

the different subsystems will parse for different things, some things are automatically added

#

like the steam one, which actually adds to the string differently

limber gyro
#

i saw that they have some built in ones already like name

#

that comes in handy

gleaming niche
#

it does like steamid: xxxxx steamsomethingiforget: xxxxx

#


//sever side
[2020.08.13-10.52.34:090][509]LogNet: Login request: ?Name=omega userId: Steam:omega [0x2F6E02DF500] platform: Steam
[2020.08.13-10.52.34:394][524]LogCSGame: ACSGameModeBase::Login: Options: ?Name=omega?SplitscreenCount=1```
limber gyro
#

im not using steam for servers so i shouldnt have to worry about that i think

gleaming niche
#

fromt he log, the steam stuff is stripped off before it gets to gamemode

#

so that's fine either way

#

the extra stuff rather.

#

only the ?xxx options remain

#

but as you said, you're not using it, so it doesn't matter either way

fossil spoke
twin juniper
#

Oh i see delegate handles gets called within oncomplete.

#

Thanks Matt!

fossil spoke
#

Well its binding the delegate so that it gets called when the async comes through.

dark edge
#

Is there a way to spawn actors server and client side and have them "link up" or should I just spawn like 1200 tile actors set as replicated and let them replicate out?

#

I suppose I could just replicate the abstract tile representation instead and run the same logic both sides on OnRep

fleet raven
#

override IsNameStableForNetworking to return true and give them the exact same names on server and client

#

there may be more minor things you need to do to make it work

#

of course if you can do without them being replicated at all then it's even better (but that means you can not call rpcs or send references to them)

meager spade
#

@dark edge we did a lot of trickery

#

but we have clients and server produce the same map from seed

#

then we only replicate stuff (like lockers, doors, etc) via a fast array and a network manager for that zone

#

as they have states which can be handled via a fast array

dark edge
#

@meager spade We'll be having a static tile map with dynamic actors on it, maybe just spawn map on either side and replicate dynamic actors will work

meager spade
#

that will work, but we generated an entire level from a empty level

#

so we couldn't just use replicated actors

dark edge
#

ya same here, I'm guessing 1-2k static actors and maybe 200 dynamic ones

meager spade
#

yeah we are close to 30K static, and around 3-4k replicated

dark edge
#

jeepers wtf u guys making?

#

If you say top down roguelike shooter.....

dark edge
#

haha

#

how are you doing FOV?

meager spade
#

we have a observer pawn in the sky

#

which is on a spring arm

#

seperated from the plaayer

#

we interp it to the players position to keep it smooth

#

but also gives it a non-stuck feel

rough jolt
#

@dark edge so basically i have this mod for a MP game that makes it so when you go up high a space sphere fades in and it looks like you went out to space

#

but problem is when one player does it players on the ground also see the sphere spawn in

#

that's what im trying to fix

dark edge
#

@rough jolt Just don't replicate the variable that controls the fade

#

On each machine, the sphere should fade based on the height of the local player only

rough jolt
#

i, sadly and having picked up this program 4 days ago, do not know how to do that, this is my code (fade is the selected block, although there's also visibility that would also need to be individual to each player) could you guide me on how to do this?

dark edge
#

Check if Other Actor is equal to Get Player Character

#

I'm assuming it's the Player Character that's triggering the fade

rough jolt
#

yeah

dark edge
#

Also why are you enabling input?

rough jolt
#

players are what triggers the fade, problem comes in MP, from what i've checked leaving a vehicle floating and going down doesnt trigger the space

#

also what imput?

dark edge
rough jolt
#

the tutorial i did for that fade told me to, it sounds dumb but thats the truth

#

like i said- still learning, as you can probably tell i barely know what im doing

dark edge
#

It is dumb unless you intend to have player keypresses do things on the spacebox directly

rough jolt
#

i'll delete it then!

#

done

dark edge
#

You'll also get a lot less spaghet by just dragging in a node for your variables each time you use them instead of linking them all to the same node

#

you can just copy paste that tatooine reference for example

rough jolt
#

yeah, that's good advice although i'm afraid to touch it right now, but i'll do that for future codes!

#

so any idea of how i could fix my multiplayer problem?

dark edge
#

I already told you, on the overlap check if other actor = player character

#

like that

rough jolt
#

oh!

#

ooooh

dark edge
#

That's assuming get player character references your actual pawn, should unless you're doing something a bit wacky

rough jolt
#

so simple yet so good

#

awesome!

dark edge
#

There's also "Get Player Pawn" which is more generic

rough jolt
#

sorry for another question but how's that equal called exactly?

#

there's many

#

nvm found it

#

i'll test and see how it goes

#

@dark edge It doesnt work, the sky doesnt fade in at all now, this is my current code

#

i tried both with character and with pawn

#

is there any way i can just make every player have one of these actors assigned to them? if i could do that there'd be no need for this

#

its the only idea i can come up with

dark edge
#

@rough jolt print other actor on overlap and see what it is

#

also print player pawn at the same time and show what they are

rough jolt
#

would that work in-game @dark edge ? because the player actor is only in-game, i dont have access to those objects from UE4, this is a mod

dark edge
#

wait what

#

You can't print a string?

rough jolt
#

idk if i can print a string in-game

#

like the only way i have of testing the overlap with the actual actors is cooking, putting it in the game and testing there

#

would print show something in-game?

dark edge
#

This should be the most robust way to get whatever the player is controlling, try it.

rough jolt
#

i shall try it in a sec, testing an alternate method, shouldnt take long

#

you didnt answer what i asked tho @dark edge is it possible to print in-game? even if the game doesnt have a console? i assume no

dark edge
#

I dunno, just try it. Never made a mod.

rough jolt
#

ya im on it, getting people to test with is hard since nobody seems to be able to "copy this folder here", i dont know how but they keep getting it wrong and i'm dying a little

rough jolt
#

didnt work

#

space box didnt show up

#

i have a sneaking suspicion the player actor might be set to not cause overlap events @dark edge

#

any good alternatives to an overlap again to know if the specific player is in the space area? like a z coordinate or something?

dark edge
#

You can try to get the character and check it's position on a timer or even tick if you want.

#

you gotta be careful tho if the character gets destroyed/recreated like when it dies or whatever

rough jolt
#

also question, wouldnt there be a way to avoid all this by spawning this actor individually for each client but having only that client see it?

#

like the skybox is an actor

#

couldnt each client just have one? thats what i wanted to do originally but i couldnt find how to by googling

dark edge
#

How is it being spawned? Each client only has one already

#

it's just that its fading whenever anything triggers the overlap, even other players

rough jolt
#

oh, right, right right, stupid me

#

sorry

#

trhat makes a lot of sense

dark edge
#

so what exactly is triggering the overlap if not the character then?

rough jolt
#

something is, i have the space trigger set so any overlap can trigger it... which might not be the best anyway. but there isnt supposed to be anything up there unless you purposefully fly up so i get away with it

dark edge
#

quick and dirty implementation would be to get the pawn on a timer and check it's location, try that

rough jolt
#

so something like on tick if (player code from before) is above this z coordinate > rest of space code?

#

sounds like it could work

dark edge
#

tick would be overkill but it'd work if the get is working

#

just change the tick interval to like 0.1 or something

rough jolt
#

i actually have other functions on tick and somehow the game performs constant 60fps, idk what code the game has to not die, but hey if it works

#

i realized an issue tho aah

#

if it checks for the player's position every moment, and if its true the sky fades in, wouldnt it be constantly fading in- nvm i can actually change it from play from start to just "play"

dark edge
#

@rough jolt You can remove the timeline and just map player elevation to sky fade

#

map range float

rough jolt
#

good idea but i dont want there to be a middle ground between space and ground since there's also a planet and a semi-transparent planet would be weird

dark edge
#

you map the range

#

like this

cunning stirrup
#

What is the best data structure to network a lot of data through unreal ? TArray<uint8> ?
I'm asking because I have inherited structs that I need to network without knowing the type, so changing them to raw data would make that possible without loosing anything.

dark edge
#

That would start fade in at 1,000 and be fully visible at 1500

#

change to whatever numbers you would want

rough jolt
#

@dark edge after extensive testing and lots of confusion it turns out it... only works for the host? somehow? like we'd spawn right next to each other and i'd have space and not him, its weird

#

and with that i have to go to bed but if you have any ideas i could try leave them here and i'll see them tomorrow

dull island
#

Not sure how useful it is to people here since it's a pretty niche thing to need to do, but hopefully it helps someone so they don't have to spend the 3 days of "things silently don't work right" that I've just gone through

gusty raptor
#

Hi, so is it common that replicate movement on a simple actors laggs on the client? (while CMC not)

thin stratus
#

Yop

gusty raptor
#

I read that as yes:), so any idea where to start of replicating myself?

#

i suppose i need to do client side prediction and interpolate?

thin stratus
#

Yeah, learn what you are actually dealing with and what common solutions are. Then implement them.

#

Yes

#

And no

#

It depends on what you are doing.

gusty raptor
#

i was not really able to find any good examples when google

thin stratus
#

If it's just a replicated actor, then Interpolation would be enough I guess.

#

Prediction is only needed if the Actor is moved via Player Input

gusty raptor
#

basically im just setting a actor location on server, client needs to replicate it

#

right, okay

thin stratus
#

Yeah, by default that also happens

#

But it just sets the Location to the new one

#

If there is a longer time (higher ping) or even a lost package, then it becomes very choppy

#

So you have to learn how to interpolate based on distance, ping, etc.

#

Also nothing i would really tackle in Blueprints

gusty raptor
#

yeah, true

#

any example u know to read?

thin stratus
#

Misclicked

#

Etc.

gusty raptor
#

nice, thanks

waxen socket
#

Good morning. Is it common when implementing slow-moving projectiles in multiplayer to spawn the projectile separately on each client and only check for overlaps on the server?

grizzled stirrup
#

Does the options string of a game persist through seamless travel?

#

Say map 1 is traveled to with an options string, then all players travel to map 2 later, will the same options string be available when map 2 opens?

#

I guess the game mode and all of its properties persists through seamless travel?

crude wraith
#

Hi guys, I've tried steam advancedsessions multiple times and it hasn't worked, even though I followed the instructions to a tee. Are there any other ways I could go about incorporating multiplayer into my game?

lilac bear
#

Networking noob here. What is the method/practice I should be using for replicated function calls that require a set order/sequence to be called in? For example, function A must be called before B, and B before C, etc. Not sure what the proper word/term is for this sort of networking practice (to avoid lag/state issues between server and client).

#

@waxen socket I would suspect you'd still want to keep things looking responsive by performing some form of visual feedback to the client on overlap (which would require some form of tracking on clients still). But probably depends on your use case as to how necessary this is. But in general, I'm probably too inexperienced to answer your question as to how common that would be. :S

waxen socket
#

When it overlaps, couldn't I use the position of the overlap on the server to spawn the effects?

lilac bear
#

yep, but the worse lag gets the more disconnect you will have in that effect with the clients

waxen socket
#

I see. Hm...

#

Do you think the approach is preferable to actually replicating the projectile?

lilac bear
#

it is more work to do, but as for the long-term approach for performance/code-maintenance/etc I can't say how necessary ๐Ÿ™‚

dull flame
#

@lilac bear Any reason that you cant call function B from the end of A?

lilac bear
#

so my thought here is if I have a chain of calls, can I be sure that UE4 will execute those replications in the same order? And another example would be if I have a player who picks up an object then drops it quickly (two player triggered actions) and I get some sort of weird lag spike just as the pickup occurs, can I be sure the pickup will happen before the drop?

#

it may be too soon in my networking journey to worry about these situations but I'm trying to pickup good practices from the start

bitter oriole
#

Replication != RPC

#

Replication is server to client, does not maintain any order or guarantee anything except the eventual replication of a value

#

Reliable RPCs guarantee order

#

Unreliable RPCs do not

waxen socket
#

Oh, here comes Stranger to set us all straight. ๐Ÿฟ

lilac bear
#

whoop whoop, I like being set straight, thanks Stranger ๐Ÿ™‚

#

so obviously making everything reliable isn't a great practice either, sounds like I just need to be very congnizent of what i'm doing in my RPCs. I'll keep this in mind as I continue to work

meager spade
#

most non crucial stuff should be Unreliable

#

(like effects, etc)

#

reliable things are like telling the server you are interacting

#

all client movement is unreliable RPC's

lilac bear
#

makes sense ๐Ÿ™‚

meager spade
#

you really don't want to fill that reliable buffer up

fleet raven
#

most things a client directly caused should be reliable to himself

#

imagine the confusion if you interact and the effect doesn't play on your side

meager spade
#

i am on about things like explosions, etc, unless they cause massive gameplay changes, they can be unreliable

fleet raven
#

imagine if you trigger an explosion and it doesn't appear

#

players be like ????

meager spade
#

yeah but hey, ๐Ÿ˜„

#

mostly all my effects are done via Gameplay Cues

#

which are Unreliable Multicasts

fleet raven
#

it's less of an issue if you have client prediction that will play the effect regardless

meager spade
#

true that

#

most of my stuff is predicted

lilac bear
#

hmm... @meager spade "Gameplay Cues"? Is this a term/practice or a system/functionality in UE4 I'm unaware of or haven't tapped?

meager spade
#

its part of Gameplay Ability System in UE4

lilac bear
#

hmm, don't remember that, perhaps post UE4 4.9

meager spade
#

its been about before then

#

not sure if it was released th

#

but it has at least been in the engine since 2015

lilac bear
#

ah probably too new for it to come across my radar, I let you pros figure stuff out and document well before diving in lol ๐Ÿ˜„

#

on the topic of the reliable buffer, I'm still needing a good link to network debugging/monitoring in UE4. But it's not high on my priority list yet since I'm not seeing any slowdown/lag just yet. However, I do suspect that my usage of creating/destroying actors is probably excessive

meager spade
gusty raptor
#

Hi, so i was trying to solve my simple actor replication, as suggest trying to implement interpolation to solve the jitter on client

#

but well, it wont solve the jitter, atleast

fleet raven
#

you'd need to interpolate in tick

#

so it happens every frame and smooths out the sparse updates

gusty raptor
#

yep, so note i call this function in tick

#

the Location input is the actor location from the server

#

its a multicast function

fleet raven
#

what

gusty raptor
#

like that:)

fleet raven
#

that makes no sense

#

you want to be interpolating it locally

#

there's some plugin "smooth sync" on the marketplace that claims it does this properly for you

meager spade
#

you should space out the rpc's, then interping from current to new position, then possibly keep interping till you get the next update (a bit of prediction)

fleet raven
#

I've never used it myself, but it was free at some point

meager spade
#

that RPC should only be a vector

fleet raven
#

so if you have that maybe look at it

gusty raptor
#

@meager spade how to interp without delta time?

meager spade
#

locally in tick

gusty raptor
#

@fleet raven i dont have it, but i saw it somewhere today

#

@meager spade u mean i should not use a multicast at all? and write it in the tick?

meager spade
#

you need to multicast, but just the new position

#

store in a property, then tick can interp to it

gusty raptor
#

Right, yeah!

#

i see

#

so that is a fix for sure heh ๐Ÿ˜…

#

@fleet raven kinda like to implement it my own before checking out the plugin though

#

but thanks for mention for sure ๐Ÿ™‚

misty stump
#

@meager spade I was wondering if you could provide some insight to a question you helped answer last sunday about sending player input through the CMC. I set up a Server RPC through my Character class but not surprisingly ig its laggy and clearly very wrong lol. The player input vector I'm sending which is used in my physfunction needs to be saved into savedmove right? Do I need to override ReplicateMoveToServer() and ServerMove() to send and unpack the data as well?

unkempt wing
#

Anyone know how to fix this error from the Server Log?
[2020.08.16-12.07.14:340][ 0]LogLinker: Warning: Unable to load package (../../../../UE_8-7-20/Engine/Content/Animation/DefaultAnimCurveCompressionSettings.uasset). Package contains EditorOnly data which is not supported by the current build.
This asset is referenced by every animation as a curve compression setting. I tried duplicating it and referencing the duplicate but I got the same error.

#

The error is [2020.08.16-12.08.14:343][ 0]LogWindows: Error: Assertion failed: !GEventDrivenLoaderEnabled || LoadPhase > ELoadPhase::WaitingForHeader [File:D:/UE_8-7-20/Engine/Source/Runtime/CoreUObject/Private/Serialization/AsyncLoading.cpp] [Line: 7284]

gusty raptor
#

So, ive tried @meager spade 's suggestion to lerp in tick, still its jittering

#

thats the multi cast function

#

the tick is run for authority only

meager spade
#

eh

#

your supposed to interp the clients

#

not SetActorLocation on the multicast

#
{
    Super::Tick(DeltaTime);
    
    if (HasAuthority())
    {
        InterpVector = SomeVector;
        MulticastReplicateMovement(InterpVector);
    }

    SetActorLocation(FMath::VInterpTo(GetActorLocation(), InterpVector, DeltaTime, 5.f));
}

void AKaosPawn::MulticastReplicateMovement_Implementation(const FVector& Location)
{
    if (!HasAuthority())
    {
        InterpVector = Location;
    }
}```
#

๐Ÿคท

gusty raptor
#

the second image is within the tick, btw

#

Ace code @meager spade

#

thanks ๐Ÿ™‚

#

so, i really need to blog some stuff, i mean, first off i cant find shit on google, second the unreal docs are offline

#

@meager spade so why did epic not implemented interpolation to replicate movement btw?

meager spade
#

they did in CMC

#

but ReplicateMovement tick box literally just replicates the position

#

you need to handle smoothing yourself

#

its just the way they did it i suppose

gusty raptor
#

yeah, i dont really mind that much though, but might be a cool addition

#

the CMC is pretty much a cool example though, but cant use it for my ai

meager spade
#

why?

gusty raptor
#

need to be able to do pathfinding for like 500 to 3000 AI ๐Ÿ˜„

meager spade
#

hmm

#

that will still be expensive

#

updating transforms is expensive

#

(locally)

gusty raptor
#

actually just using the NavigationSystem and get a path in c++, then i use it on my cheapy actors

#

but its not really multiplayer related though

meager spade
#

i have around 140 ai

#

and just moving them locally (SetActorLocation), costs about 1.8-2ms

gusty raptor
#

actually i just calculate the ai positions, and only update them in range

meager spade
#

need to do a lot of smoke and mirrors

gusty raptor
#

lol

meager spade
#

Something that is described as smoke and mirrors is intended to make you believe that something is being done or is true, when it is not

gusty raptor
#

so actually, yeah so u say like, a 'moving' actor is (way) more expensive than a not moving actor right?

meager spade
#

ofc

#

then you have tick for each one

gusty raptor
#

yeah

meager spade
#

2000 ticking ai, will eat time aswell

gusty raptor
#

yep

#

i dont call them 'ai' but just actors

#

since im not using a full ai like blackboards an all

meager spade
#

you would probably want a manager to handle groups of "AI Actors"

gusty raptor
#

ive been testing with like 2k of moving actors (with a skeletal mesh) and it was pretty good (like 70 fps instead of 90)

#

but yeah, it eats

meager spade
#

we have 30K actors

#

and 150 AI pawn (max allowed)

#

and we run around 12-13ms game time

#

(on listen server)

gusty raptor
#

hhm cool

meager spade
#

normal client around 9ms

gusty raptor
#

ive actually read some article that they have like 40k of replicating actors in Fortnite

#

u actually do culling on that 30k actors?

gleaming niche
#

fortnite also uses the replication graph too, which is a bit different

meager spade
#

that only saves replication calculation costs

#

we have Network managers in zones, which handles our interactable stuff (like lockers, doors, windows, etc)

#

and lockers, doors, windows don't replicate on there own

#

our considered actors is around 300ish for networking, which is nothing

#

fortnite has 50K replicated actors

gusty raptor
#

so u mention the 30k of Skeletal Mesh actors @meager spade ?

meager spade
#

no

#

30K actors in total

gusty raptor
#

ah, k

meager spade
#

in the level

#

only skeletal actors we have are pawns

#

and weapons

gusty raptor
#

in my situation i actually have the "HumanActor" as a custom SkeletalMeshActor that just have a somehow cheap character mesh

#

i found, that not using a CMC and the regular AI stuff saved it from like 100 ai ๐Ÿค“

#

i mean, its not possible to create more than 100 AI like a zombie game

#

however i still need to really see how to improve the SkeletalMesh for sure, like having much on a screen

#

i kinda think its somehow a unreal limitation that the skeletal mesh is not very cheap

prisma vortex
#

anyone have easy to implement code that allows someone to host a server but instead of getting the LAN or IP Address, it stores said info and allows the host to name their server and password protect it? Sorry if thats confusing ๐Ÿ˜‚ I'm new to multiplayer hosting and unreal in general ๐Ÿ‘‰ ๐Ÿ‘ˆ

gusty raptor
#

@prisma vortex u just mean how to password protect the server?

prisma vortex
#

yeah and to host without needing to list the IP Address or LAN, my teacher said I could use the cloud but doing that I'd have to pay for space and I'm too broke to do that ๐Ÿ˜ฌ

gusty raptor
#

u could host your games using steam, and test it with friends ๐Ÿ™‚

prisma vortex
#

I'll look into it ๐Ÿค” I'm hoping to develop my own way to host at some point ๐Ÿ˜‚ doubt my games will go far but itll be fun ๐Ÿ˜

gusty raptor
#

u could just create a game in unreal and host it using sessions and steam. how it helps. Good luck!

prisma vortex
#

Thanks!

twin sable
#

Does anyone know how to increase the network bandwidth limits? I've added

[/Script/OnlineSubsystemUtils.IpNetDriver]
MaxClientRate=1000000
MaxInternetClientRate=1000000

[/Script/Engine.Player]
ConfiguredInternetSpeed=1000000
ConfiguredLanSpeed=1000000

to my defaultengine.ini but it hasn't seemed to change the limits

#

my game has a lot of actors but theyre all static, literally just with meshes. dunno if this is causing it

eternal anchor
#

@gusty raptor 2k moving actors

#

reduced your frame rate by around 23%

#

that's actually

#

terrible

#

you are far more constarined on server

queen flower
#

is there a simple diagram for each replication option, that summarizes like this:
"Use Multicast to make sure all clients and server see an object spawn"
"Use Run on Server to store number of objects spawned"
"Use Run on Client.. to show ..."
"Use Not Replicated for multiplayer games to show..."

twin juniper
#

can somebody help me resolve something real quick?

gleaming niche
#

there is tables that explain it in the docs.

glacial pollen
#

I intentionally seamless travel with a level sequence actor, over the last engine version or two, my level sequencer now breaks apart after travel. (play time starts going negative)
I'm at a bit of a loss as to what breaks, as all my references are valid.

#

I'll try a master sequence

glacial pollen
#

nevermind, its not a real thing. Its just another level sequence

round mesa
#

hey guys, how should my UI widgets be added to players when doing muliplayer

#

doing it on begin play causes duplicates when a new player joins

#

(please tag me if you respond, thanks)

humble plaza
#

Completely ignorant question...but anyone know how to apply network Smoothing to listen servers?

#

I have a blueprint project and when I play online with a friend, and I host a game using Steam backend, I get a LOT of lag and stutter for non host players.

#

They describe as jitter and stutter of movement and actions, with long delays.

#

I have read about the SmoothSync tool, but was wondering, is there such an interpolation built into Unreal by default?

hoary lark
#

@twin sable no guarantee but in an old project I also had this in DefaultGame.ini

TotalNetBandwidth=600000
MaxDynamicBandwidth=80000
MinDynamicBandwidth=4000```
winged badger
#

@humble plaza the idea is not letting the server force non-predicted corrections on owning client

#

and keeping stuff like MaxWalkSpeed in sync

#

also, if you're spamming reliable RPCs, then CMC's unreliable ones won't get through

#

one more thing that can cause jitter on clients is letting things like skeletal mesh replicate

charred ivy
#

Anyone have some good tutorials or resources/links to utilizing epic online services? Having a pain with it haha

#

(Feel free to ping me if you know ๐Ÿ™‚ )

winged badger
#

@charred ivy one channel down

charred ivy
#

oh wow no clue how I missed that

#

thanks! haha

glacial pollen
#

I fixed my issue, it appears the Sequencers do not survive seamless travel unscathed. It destroys the audio component it uses, I just created a new sequence player after travel and overrode my references to the original with it. This is technically a memory leak as I am throwing away sequence players everytime I change maps, but since I am only using this for an "in-game trailer" this is fine. xD

gleaming niche
#

meh GC will clean up anyway.

fervent spoke
#

is there a good resource on implementing lag compensation in UE4?

thin stratus
#

Theoreticlaly, the only real resource is the CMC, UT4 and maybe the ShooterGame (not sure they do something like that).
"Good" is a different story.

elfin cliff
#

Fun question for everyone. Say you have a multiplayer game, and you want to create non-replicated pawns as well (that do not increase load on the server or other clients). What would you use for this.

karmic briar
#

how do make blueprintimplementable event that have parameter similiar to blueprint custom event with run on server and run on owning client parameter and its reliable?

#

๐Ÿค”

twin sable
#

I've ran into an issue with replicating large numbers of actors. It seems each actor uses a channel and there are only 2048 available. Does anyone know if replicated actor components require their own channel, or use their parent actors channel? Cant find anything on the internet about it and i'd hate to refactor everything just to find out it was for nothing

waxen socket
#

It seems very unfortunate to me that OnRep functions run before BeginPlay. ๐Ÿ˜’

thin stratus
#

@waxen socket Story of my past few weeks

waxen socket
#

It's tragic.

#

Am I doomed to riddle my blueprints with timers...

thin stratus
#

Yeah and no

#

You are doomed

#

But don't use timers

waxen socket
#

๐Ÿ˜†

thin stratus
#

What we is at the start of the OnRep, check if the "ActorHasBegunPlay"

waxen socket
#

Ohhh.

#

That sounds useful.

thin stratus
#

And then in BeginPlay we call the OnRep, or whatever the OnRep is supposed to call, manually. However this only really works if you can makr out based on your variable if the OnRep has to call

#

E.g. if it's a pointer variable of something you know needs to be valid, you can call it when the pointer is already valid on BeginPlay.

#

But it's very depending on the OnRep variable of course

waxen socket
#

I see. That's good advice. It appears the only HasBegunPlay in Blueprints is from GameState. So my options may be more limited than in C++.

thin stratus
#

HasActorBegunPlay also doesn't exist?

#

I can tell you ,you want to learn cpp if you deal with multiplayer. Too much stuff is locked away from bps

waxen socket
#

I'm searching without context sensitivity and all that comes up is HasBegunPlay from GameState.

#

I did work in C++ for a couple years. I will use it when the time comes that I must.

#

Thanks for your advice, eXi.

livid solar
#

Hi everyone, just wanna know do you guys use Gameplay Ability system for your game?

meager spade
#

people in there use it

livid solar
wheat magnet
#

what is the best way to show widget on multiplayer? in game instance or game mode or player controller?

dark edge
#

@wheat magnet It depends on the context. I usually do mine through the player controller

meager spade
#

@wheat magnet don't ask the same question in multiple channels, #old-rules

#

swear you have been warned before

jolly siren
#

@wheat magnet I've infracted you for posting the same questions in multiple channels. Please adhere to the #old-rules in the future. Thank you

twin sable
#

what is the best way to show widget on multiplayer? in game instance or game mode or player controller?
@wheat magnet You can also do it per character if you think different characters will have different UI's. Just clear the old ones first

wheat magnet
#

what is best way to share global variable to all players in multipalyer

twin sable
#

gamestate

wheat magnet
#

i tried game state it only increament for once, then if other player try to increament then it still show 2 instead of 3

rich ridge
#

Guys I m looking to find a way to update my minimap as players or minions move.

What I can think of at the moment is to on every tick of umg query all actors and get their position and draw on map.

What I want to do is to get callback from actor class when their movement updates by networking and replication and then it sends broadcast and then I update the map. Is this possible to do.

#

@wheat magnet you need to make them replicatable. UPROPERTY(Replicate) float MyScore;

#

And override the LifetimeProps function and add this variable

wheat magnet
#

can i do in blueprint?

#

when i add widget in my character blueprint, it add to all clients, but i want to show widget only on client

crude wraith
#

Hi guys, is it possible to use multiplayer replication to make a 2-player game where the spawn positions and character pawn are randomized between the 2 players each round?

rich ridge
#

@wheat magnet yes you can do that in bp

#

And widget are client only

fervent spoke
#

projectiles seem to be spawning further forward on dedicated server vs. listen server. this is causing a problem where, if i'm right up against a wall, the projectile from my gun tries to spawn inside of the wall

#

any idea why this would happen?

fossil spoke
#

Latency and Replication is why.

#

When your a Client, there is a delay between when the Server spawns the Projectile on its side and when your Client creates the Projectile after Actor Replication.

#

The Projectile will have moved on the Server side by the time this occurs.

#

When your a Listen Server and the Host, you have no Latency

#

So its a perfect world for you.

fervent spoke
#

so how do I reliably make projectiles spawn where they should?

fossil spoke
#

Well maybe a hybrid approach would help you solve edge cases like this. If your to close to a Wall for example, maybe use a Linetrace to represent the Projectile instead. Since the visuals of the Projectile wont be relevant as its most likely to explode/hit the wall straight away and disappear.

fervent spoke
#

i considered that, i thought maybe there's a better way

fossil spoke
#

If your 1 meter away from a collider, spawn the Projectile.

#

Since the Projectile would have room to move and be visually present in that space.

fervent spoke
#

there must be a better way to do this

fossil spoke
#

Make sure the initial position your spawning the Projectile is inside your Players collision capsule.

fervent spoke
#

it is

gleaming niche
#

do like shootergame. fire a trace from the start location (ie: view center) and adjust the spawn location

#

on if it hits a wall or not, instead of always spawning out at the front

fervent spoke
#

how do i check if it has tried to spawn inside of a wall

gleaming niche
#

by tracing from the view location forward.. if you hit a wall.. instead of nothing

fervent spoke
#

wut

gleaming niche
#

since view location is not going to be in a wall

#

or even the center of the capsule of the character firing

#

so you trace from the character, if you hit a wall, adjust the spawn location of the projectile instead of just spawning at the end of the gun.

fervent spoke
#

it already spawns from inside the player's collision capsule

#

or rather, it should

#

the spawn location is inside of the player's collision

#

but the projectile has velocity

#

and when it's above a certain velocity it tries to spawn the projectile outside of the collision capsule

gleaming niche
#

then you have two options

#

turn on CCD

#

on the collision comp

#

of the projectile, or do a trace to see if you're gonna hit a wall

#

and then just make the thing hit the wall

fervent spoke
#

the problem with the trace idea is it's gonna vary based on ping'

gleaming niche
#

or just do the impact effect of the projectile on the wall

#

the start location should always be the same though

#

are you predicting the projectile on the client or something?

fervent spoke
#

ccd on collision component of the projectile didn't help

#

i'm doing a "run on a server", it does a line trace to see where the camera is pointed, subtracts that by the spawn location of the projectile to find a vector for the projectile (so that the projectile goes where you're aiming inside of just using the same rotation as the camera and keeping an offset)
it spawns the projectile inside of the player collision

#

it's calculating the position of the projectile before it even spawns it, is the problem

#

i tried to set the velocity to 0 and then increase the velocity on beginplay but that doesn't help

gleaming niche
#

try adding some logging, print the camera location, and the projectile spawn location

#

if it really is spawning inside of the character, it shouldn't be spawning in the wall

#

unless it's a collision issue, and it's doing the spawn adjustment

#

like taht your projectile is colliding with the owner, so the spawnactor call is adjusting the position

#

and pushing it somewhere it's not supposed to be

fervent spoke
#

this is printed on beginplay for the projectile

#

the server and client don't agree probably because of what devilsd said

gleaming niche
#

so it'sc reating projectiles on both server AND client?

#

the client print isn't necessarily at the exact spawn position either, if it's just happening from replication

#

since that would be the position that it's at, at the time the client actor is created

#

after postnet

#

tbh i'm not 100% sure as i've never encountered this proble

fervent spoke
#

my "spawn actor" comes from an event that is "run on server"

#

i'm not actually sure why i can even see the projectile clientside tbh

#

was wondering that

#

i'm brand new to networking in ue4

gleaming niche
#

the projectile actor itself must be set to replicate then.

#

i don't use blueprint, so the way you implement this stuff is a bit different

fervent spoke
#

oh yeah it is

gleaming niche
#

ie: i don't use an rpc to spawn my projectiles, they are created from the server automatically, for the replicated type anyway.

#

i just RPC the button presses.

fervent spoke
#

ah

gleaming niche
#

start/stop

#

runs locally too for prediction though, but projeectiles only spawn on authority, so the server side part of the state update

#

at any rate, it seems fishy if it's just not spawning in the correct location, only on DS, while.. standing still

#

i could see, maybe some latency issue if you were say, running towards the wall, and then you fire

#

but even in that case, it should still be delayed, or .. behind

#

rather that infront

#

assuming you actually have significant latency

meager spade
#

btw, could it be because your gun is in the wrong place?

#

if you are spawning from the muzzle

fervent spoke
#

i'm not spawning it from the muzzle anymore

meager spade
#

cause dedicated server doesn't actually update the bones by default

#

why not?

#

that is where the projectile should come from

fervent spoke
#

because i'm trying to troubleshoot this problem

#

i moved the spawn further inside the collision just to make sure

meager spade
#

i spawn my projectile from the muzzle and not had any issues

fervent spoke
#

it's also putting the emitter and sound for the impact at 0, 0, 0 in world space

#

idk if that tells us anything

#

(it's doing that when i'm too close to a wall with too high a projectile velocity)

#

uuh it seems to be the "destroy actor" node causing the issue somehow

#

after it does all of the logic for the projectile, it destroys actor. i guess the server is destroying the actor before the client has time to be informed properly on whatever happened, if i add a slight delay it doesn't have an issue anymore

peak star
#

It seems something is wrong with the java source code for Android to work on WiFi LAN.
Can someone point me to an easy fix so my game can work on Android over LAN?

weak wind
#

hello guys everything great, I was wondering how do I create the server packages for people to create their own dedicated servers, I went after creating the windowsserver packs but when I look at the pack it has some mb since in the windowsnoeditor version the pack is almost 5gb of power someone help me

rich ridge
#

@weak wind windows no editor is basically your game client and it is supposed to be huge in size.

weak wind
#

@rich ridge ok, my problem this being my server package compile it but it has come well smaller want to make a version for people to mount their dedicated

rich ridge
#

Dedicated servers are very small in size

marble gazelle
#

It's smaller due to the fact, the server doesn't need all resources, like texuters, which can be realy huge^^

weak wind
#

thanks guys but just one more doubt in the case if a person set up windows server he will manage to create his own dedicated

#

because most of the dedicated I saw was by binarios on win64 already in a pack for public server have not seen a tutorial

marble gazelle
#

I don't really know if that is a question oO What do you want to know

rich ridge
#

@weak wind I think you are confused between UE4 dedicated server VS actual server which most of the people heard before landing into UE4 domain.

UE4 dedicated server is like a game only which doesn't have a window to render , it's black console that's it. And if you run this game client which has black console at servers then they are called dedicated servers.

weak wind
#

ready the people uses the right cmd console, what I'm looking for is to create a package that she can manage her own server in my game

void nest
#

Hello. Does anyone know how I can make steam work when using "standalone" play in editor? My co-worker does this to test steam and it works perfect. But on my PC when I start standalone with Steam running in the background, Steam doesn't work.

gaunt kestrel
#

you need somehow add key '-GAME' to starting code

#

and it will start with Steam

split siren
#

Hi guys, how is Fortnite and other BR handling lobby and game instance from server-side point of view? I can only guess Lobby server is a separate program that forwards all connected clients to random available game server. That means, two completely separate server builds, but I can't find any way to create two server target.cs files. Any ideas?

polar wing
#

hey, is it possible to shove a development build on Steam for testing or does it need to be a shipping configuration?

split siren
#

@polar wing It can be development build

polar wing
#

thanks!

gleaming niche
#

should make a beta depot too, and then you can even auto-publish with build scripts

polar wing
#

epic

gleaming niche
#

*branch not depot