#multiplayer

1 messages ยท Page 307 of 1

worthy wasp
#

no it doesnt

#

in 4.13 sure it does

wary willow
#

Then wtf are you talking about

worthy wasp
#

in 4.14 no it doesnt

wary willow
#

So, you haven't once tried packaged?

worthy wasp
#

dont even waste the time nope

#

specialyl for a 10gb+ project

bold cedar
#

Might as well test it out...

wary willow
#

I am telling you that there are differences, maybe 4.14 issue, between Editor and Packaging

worthy wasp
#

i'll push heavily on the issue being with 4.14 - i'm moving this to UnrealAnswers tor tech support there

#

thought i'd ask here to see if people had the same problem

wary willow
#

...

worthy wasp
#

have a good night

#

....

native moth
#

Anyone here having run into issues replicating MotionController keypresses to client where VR isnt enabled? I have a 2 Pc setup - one running a spectator client(no vr) and a client running a vr pawn. When using events that are run using MotionController keypresses nothing gets send to the server.

native axle
#

@worthy wasp Well, I'm back now :S Seems like it's still not fixed. It is not working only when connecting via ip correct?

native moth
#

to add on my previous question... Im seeing some very wierd behavior here.
I have this simple setup in my PlayerController

#

When I run this code with a normal pawn and no HMD, everything works.

#

But as as soon as I turn HMD on inside one my clients, all RPCs stop working

#

Anyone knows how to get around this?

thin stratus
#

Input is still working?

native moth
#

yes, "Client" is getting printed on my client

#

@thin stratus Im thinking this might be because I turn on the HMD after I have joined the session. Might be worth doing a transition map between the menu and the session that turns on the HMD

thin stratus
#

Hm last time I connected to a Server as a VR client I made sure that my .exe has -vr

native moth
#

Yeah. in this case the game has two modes, a spectator or VR - so when you open it up first time you're prompted using a standard window, if you select VR it allows you to connect to a session and then when the session is joined, it turns on HMD features

#

Tracking and everything works 100% as long as you are the server, as soon as you are the client with HMD on, the RPCs stop working

thin stratus
#

But you are testing that in standalone or?

native moth
#

right clicking on the uproject file and launching 2 instances on 2 different computers. One with HMD and one without

thin stratus
#

Hm okay

#

Weird, RPCs only stop working if ownership is wrong, the actor isn't set to replicate or the net connection is dead

native moth
#

so might be because ownership changes when the HMD turns on

thin stratus
#

Na, you are on the playercontroller

#

That's yours, if that owner changes then you have other problems

#

You are sure the vr client correctly connects?

native moth
#

yes. when I remove the turn on HMD, the print strings works as you would expect on my client instance and server instance

#

and the HMD is handled after the session has been succesfully joined

thin stratus
#

I had problems using enable hmd

#

That always returned false for me

#

That's why i ended up opening the VR client with - VR directly

native moth
#

Might have to try and create a seperate project where I open one with VR directly

#

and see if I get the same errors

thin stratus
#

I don't know what that could be. Is printing the PlayerController name in tick firing correctly?

native moth
#

will try, hang on a sec

thin stratus
#

So like once for the server playercontroller and two times for the client?

#

You can open your projects with - VR directly. No need to create a new one

#

You only need your UnrealEditor.exe path and the uprojects path. Then you can create a bat file with commandarguments

native moth
#

yeah I know, but my joining system interface is not enabled for VR yet :p

thin stratus
#

Skip the joining

#

Just use the console

#

The VR preview allows that too

#

Open ipaddress

native moth
#

arhh true.

#

Anyways, to answer your question, yes printing controller name in tick works as you would expect

#

2 times on server, once on client

thin stratus
#

Okay other idea to test that

#

Open the editor and set the connection to be not made when you start the game

#

It's in the advanced settings

native moth
#

Anyways, one way I could get around this is saying "Fuck syncing triggers on the server" - for the application I am doing I only need to sync the meshes transform I am moving with my controller. This is not a open multiplayer game but a closed conference project

thin stratus
#

Then start the game in editor with 2 players

#

Let one host and one connect as a vr client

#

And then breakpoint the playercontroller

#

And see what really happens

native moth
#

this one youre refering to?

thin stratus
#

Yeah, think it needs single processes active

#

Then you will see a new boolean

#

Which says something about connect to server instantly or so

native moth
#

this is the standard settings, I had actually turned off the use single process

thin stratus
#

Set the player count to two

native moth
#

arhh

thin stratus
#

That should enable the bool to be set

native moth
#

there I see it

#

hang on, will try

thin stratus
#

Could be that this ends in weird things in the vive

#

As you have two windows on a single procrss and the vive doesn't like that

#

But debugging should still work

native moth
#

Hmm, seems like they are still interconnected as the Print Strings shows on both instances, even with the bool off

thin stratus
#

That's the single processes

#

Process

#

Not the net connection

native moth
#

arhh. Anyways, when connecting it works as you would expect. 1 string on client, 2 strings on server

thin stratus
#

Yes okay but since you are in the editor now

#

Open the playercontroller BP and set a breakpoint on the server rpc

#

You can also filter the playercontroller instances and see what lights up if you press the key

native moth
#

yes, that works fine. Breakpoints activates fine on the server. Do note: Turn on HMD doesnt work when using PIE

thin stratus
#

Turn on HMD aka enable hmd?

native moth
#

Hmm. hold one... When I fire the RPC from my client, the breakpoint doesnt activate, but the server writes the string anyway. But when I fire the RPC from my server, breakpoint actiavtes

thin stratus
#

Hm

#

What string

#

Client

#

Or Server?

#

Because remember the singleprocess

native moth
#

okay so it seems like the client PC cant fire the RPC

thin stratus
#

Makes not so much sense

#

What else are you doing when joining as VR

#

Something breaks if you do that

native moth
#

that is all

thin stratus
#

Hm despite the GameInstance variable replicated which makes no sense and the pawn being saved to a variable after spawning while the controller has GetControlledPawn for that it seems all correct

native moth
#

I will try and start up a new uncontaminated project and so some basic stuff and see if it works

#

Might have to rebuild some of this from scratch if this works

#

trying to go back to basics

bold cedar
#

@thin stratus Hey Cedric, you know a good bit about multiplayer. Both the clients and the host must forward port 7777 (Or the default) to connect with the client-server model via IP? Or just the host?

thin stratus
#

Just the host

#

The Host opens the port 7777 so other can try to connect to it

bold cedar
#

Oh, I see. Cheers ๐Ÿ˜„

native moth
#

@thin stratus okay so I did a complete basic test. When the app opens in VR and one in normal - everything works as you would expect

#

RPC etc. are firing and motioncontroller triggers work

thin stratus
#

So it happens somewhere in your existing code?

#

Need to get ready for city, so won't be able to help the next few hours

native moth
#

or its a problem with turning on the HMD during execution and not from the beginning

thin stratus
#

Yeah that's what I thought

native moth
#

so I will have to work around that by designing the interface to also work inside a couple of vr glasses

native moth
#

@thin stratus just wanted to says thanks again. I got everything working when I start one instance as VR and one as normal! Had to do some stuff with the interface but it works alright ๐Ÿ˜ƒ

thin stratus
#

(: Sounds good

thin stratus
#

Was anyone able to remove full games from the SearchResults of a FindSessionNode?

#

If you paste "MaxPlayers" to the Options list I get automated Kicking when the session is full (that's cool) but the session is still visible

#

I tried AGameSession::UpdateJoinability(FName InSessionName, bool bPublicSearchable, bool bAllowInvites, bool bJoinViaPresence, bool bJoinViaPresenceFriendsOnly);

#

And setting bPulbicSearchable to false once it's full ,but that didn't help

#

@chrome bay Did you encounter that yet

#

Or don't you have a ServerList?

chrome bay
#

I do but it's basically the same as Alan Noons wild west shooter thingy, I hacked it together quickly a couple years ago... my latest venture with parties etc came from my starting to redo it properly haha

#

Can you not change the advertisement type of the server once it's registered then?

thin stratus
#

So you filter it

#

I guess

chrome bay
#

I do nothing atm haha

#

But am planning on filters etc, like BF4's ones

thin stratus
#

Okay so just so you know, if you pass "MaxPlayers=16" it will kick player who join back to the main menu if it's full

#

By default

chrome bay
#

Oo that's interesting

#

Does it give you a text warning, i.e. like "server full" or somethng?

thin stratus
#
void AGameSession::InitOptions( const FString& Options )
{
    UWorld* const World = GetWorld();
    check(World);
    AGameModeBase* const GameMode = World ? World->GetAuthGameMode() : nullptr;

    MaxPlayers = UGameplayStatics::GetIntOption( Options, TEXT("MaxPlayers"), MaxPlayers );
[....]
}
#
FString AGameSession::ApproveLogin(const FString& Options)
{
    UWorld* const World = GetWorld();
    check(World);

    AGameModeBase* const GameMode = World->GetAuthGameMode();
    check(GameMode);

    int32 SpectatorOnly = 0;
    SpectatorOnly = UGameplayStatics::GetIntOption(Options, TEXT("SpectatorOnly"), SpectatorOnly);

    if (AtCapacity(SpectatorOnly == 1))
    {
        return TEXT( "Server full." );
    }

    int32 SplitscreenCount = 0;
    SplitscreenCount = UGameplayStatics::GetIntOption(Options, TEXT("SplitscreenCount"), SplitscreenCount);

    if (SplitscreenCount > MaxSplitscreensPerConnection)
    {
        UE_LOG(LogGameSession, Warning, TEXT("ApproveLogin: A maximum of %i splitscreen players are allowed"), MaxSplitscreensPerConnection);
        return TEXT("Maximum splitscreen players");
    }

    return TEXT("");
}
#

"AtCapacity" checks this:

chrome bay
#

oh I see it there.. 'Server Full'

thin stratus
#
bool AGameSession::AtCapacity(bool bSpectator)
{
    if ( GetNetMode() == NM_Standalone )
    {
        return false;
    }

    AGameModeBase* GameMode = GetWorld()->GetAuthGameMode();

    if ( bSpectator )
    {
        return ( (GameMode->GetNumSpectators() >= MaxSpectators)
        && ((GetNetMode() != NM_ListenServer) || (GameMode->GetNumPlayers() > 0)) );
    }
    else
    {
        const int32 MaxPlayersToUse = CVarMaxPlayersOverride.GetValueOnGameThread() > 0 ? CVarMaxPlayersOverride.GetValueOnGameThread() : MaxPlayers;

        return ( (MaxPlayersToUse>0) && (GameMode->GetNumPlayers() >= MaxPlayersToUse) );
    }
}
#

At the bottom in the else

#

It normally takes "MaxPlayers"

#

No idea what the CVar thing is

#

and how it works

chrome bay
#

oh yeah that's wierd... wtf

thin stratus
#

But it seems to be = 0 by default

#

Might by command vars that you pass when starting a Dedicated Server or so

chrome bay
#

I think it's cus you can set 'MaxPlayers' in a config file somewhere

#

even so that does still look odd

thin stratus
#

Yeah

#

We also have these in the GameSession

#
bool AGameSession::KickPlayer(APlayerController* KickedPlayer, const FText& KickReason)
{
    // Do not kick logged admins
    if (KickedPlayer != NULL && Cast<UNetConnection>(KickedPlayer->Player) != NULL)
    {
        if (KickedPlayer->GetPawn() != NULL)
        {
            KickedPlayer->GetPawn()->Destroy();
        }

        KickedPlayer->ClientWasKicked(KickReason);

        if (KickedPlayer != NULL)
        {
            KickedPlayer->Destroy();
        }

        return true;
    }
    return false;
}

bool AGameSession::BanPlayer(class APlayerController* BannedPlayer, const FText& BanReason)
{
    return KickPlayer(BannedPlayer, BanReason);
}

red ledge
#

@thin stratus wait, game session had this kick player? I had to do it myself to be able to kick players in the UI lobby

thin stratus
#

Well yeah, glory C++

red ledge
#

no idea how to use AGameSession, thought that you had to modify the engine to use that

#

gonna look into it later

thin stratus
#

No

#

You can just create a ChildClass of that

#

But you need to also have a Child of GameModeBase

#

as that one (why ever) is hardcoded to use GameSession

#

And the Variable that you can set in the GameMode BP window does nothing

#

gg

#

Even if you set this

#

It stil ldoes this

#
{
    return AGameSession::StaticClass();
}```
#

Screams for a PR to actually use the GameSession variable that the GameModeBase has defined

#

:D

chrome bay
#

that is true haha

thin stratus
#

But I feel like Epic doesn't want to expose that to BPs

#

Too complex xD

#

But yeah if you override the function i just quoted

chrome bay
#

I guess Game Session doesn't reallty have a lot you can do in BP's

thin stratus
#

with the StaticClass of your own GameSession class

#

or with the variable and then set it in BPs

#

you can have your own gameSEssion

#

Just make sure to set the GameSession to "Blueprintable" in the UCLASS

#

otherwise it's C++ only

#

Well it doesn't but the funtions are really not that complex

#

You could easily expose all of them

#
  • making the GameSession base class Blueprintable
#

No idea why that's not a thing

#

I mean we also miss a "UpdateSession" node

#

I will try to update the current session

#

And stop advertising it

red ledge
#

Thanks, I will check that tommorw when I wake up , might have to change my code to use the game Session

#

as for the not visiable thingy I just don't show it in UI but that's kinda hacky

#

but again the plyer can only see it when they search sessions

thin stratus
#

They get kicked if it's full anyway

red ledge
#

I really wish they can do something to at least make the session results update in real time

thin stratus
#

That's nothing they can do

#

It's an async task

chrome bay
#

until we have quantum computers and lightspeed internet connections we are slaves to async stuff ๐Ÿ˜„

polar bridge
#

@thin stratus have you had any problems with game session with your project? i was having troubles overriding functions, but later found it was apparently a logging issue. the problem is i need the logging to help figure out how to code it lol ๐Ÿ˜„ specifically i was trying to run RegisterServer with no luck

#

i'm on UE 4.14

thin stratus
#

RegisterServer, DedicatedServer, Steam, 4.14 Launcher Version?

polar bridge
#

yes, yes, yes, no

#

built from source

thin stratus
#

But untouched?

polar bridge
#

correct

thin stratus
#

Then you are "simply" missing a PR that fixes that

#

Steam + Dedicated Server is broken otherwise

polar bridge
#

oh, good to know! i'll try to find that, thank you much!

thin stratus
#

Does anyone remember in what file the SessionBP nodes are

#

welp nvm

polar bridge
#

do you know if that PR is on the official github or is that the one that's out there made by some other guy on another repo?

thin stratus
#

official github

polar bridge
thin stratus
#

Yes

polar bridge
#

awesome, thanks again

thin stratus
#

So, for whatever reason, I can't get the NameSession from the Subsystem NULL

#

FNamedOnlineSession* NamedSession = OnlineSession->GetNamedSession(GameSessionName);

#

Hm cool

#

Seems like OnlineSubsystemNULL has no Sessions registered

#

coolio

#

-.-

chrome bay
#

haha

#

ahh.... multiplayer

#

ShooterGame will only get us so far

#

and UT mods the engine

#

sigh

thin stratus
#

whaaaaaaaaaaaaaaaaaaat

#

I have a BreakPoint on "GetNameSession"

#

And sometimes it calls and the Sessions Array is empty

#

and sometimes I have the Session in there

#

WHAT IS GOING ON

brittle sinew
#

Are you calling it at a point where you know the session has been active for a little bit? Only think I could see there is a race condition ๐Ÿ˜ฎ

thin stratus
#

I created the Session on my first Instance

brittle sinew
#

(barring pure magic)

thin stratus
#

it gets added to the Array

#

then a new client connects and the SERVER tries to update the session

#

but the array is empty

#

ยฏ_(ใƒ„)_/ยฏ

#

FLIP THE EDITOR

#

it's an editor thing

#

again

#

if I start it as standalone, it works

#

But even with the UpdateSessions thing I can't get the Session from Appearing in the list

chrome bay
#

haha

#

good old PIE

thin stratus
#

So

#

I would simply say

#

SubsystemNULL does not support hiding the Session

#

I just looked through the SessionSearch code

#

and it's searching for all open LanBeacons

#

Just a plain Broadcast

#

and then fills in the Results

#

it's not even checking if they advertise or not

#
void FOnlineSessionNull::OnValidQueryPacketReceived(uint8* PacketData, int32 PacketLength, uint64 ClientNonce)
{
    // Iterate through all registered sessions and respond for each one that can be joinable
    FScopeLock ScopeLock(&SessionLock);
    for (int32 SessionIndex = 0; SessionIndex < Sessions.Num(); SessionIndex++)
    {
        FNamedOnlineSession* Session = &Sessions[SessionIndex];

        if (Session)
        {
            bool bAdvertiseSession = ( ( Session->SessionSettings.bIsLANMatch || Session->SessionSettings.bAllowJoinInProgress ) && Session->NumOpenPublicConnections > 0 ) ||
                Session->SessionSettings.bAllowJoinViaPresence || 
                Session->SessionSettings.bAllowJoinViaPresenceFriendsOnly;

            if ( bAdvertiseSession )
            {
                FNboSerializeToBufferNull Packet(LAN_BEACON_MAX_PACKET_SIZE);
                // Create the basic header before appending additional information
                LANSessionManager.CreateHostResponsePacket(Packet, ClientNonce);

                // Add all the session details
                AppendSessionToPacket(Packet, Session);

                // Broadcast this response so the client can see us
                if (!Packet.HasOverflow())
                {
                    LANSessionManager.BroadcastPacket(Packet, Packet.GetByteCount());
                }
                else
                {
                    UE_LOG_ONLINE(Warning, TEXT("LAN broadcast packet overflow, cannot broadcast on LAN"));
                }
            }
        }
    }
}
#

Interesting to dive into the Packet data stuff

#

So basically, this happens if someone receives the broadcast

#

And this line defines if we responed:

                Session->SessionSettings.bAllowJoinViaPresence || 
                Session->SessionSettings.bAllowJoinViaPresenceFriendsOnly;```
#

Which, funny enough, doesn't even check if bSouldAdvertise is true

#

LOL

chrome bay
#

haha

#

null subsystem is hax basically

#

all the things we could fix if we could be bothered to do PR's haha

thin stratus
#

Yeah but

chrome bay
#

dammit epic just use perforce so I can help lol

thin stratus
#

there is a boolean

#

saying if advertise or not

#

USE IT EPIC

chrome bay
#

lol

thin stratus
#

So what do I need to do to stop it from sending packages back, let's see

#

Session->SessionSettings.bAllowJoinViaPresenceFriendsOnly needs to be false

#

Session->SessionSettings.bAllowJoinViaPresence needs to be false

#

( ( Session->SessionSettings.bIsLANMatch || Session->SessionSettings.bAllowJoinInProgress ) && Session->NumOpenPublicConnections > 0 )

#

NumOpenPublicConnections needs to be = 0, which I don't know how to do

#

bIsLANMatch is true anyway

#

Damn

#

Lemme check if the NumOpenPublicCOnnections is 0 anywa

#

Alright, NumOpenPublicConnections sorts itself

#

So lets try to set the other things to false

#

coolio, works

#

So I finally found out how to hide sessions that are full

#

For SubsystenNULL at least

cold sparrow
#

@thin stratus thanks for pdf!

thin stratus
#

:P haha, np

rough iron
#

@cedric_exi numopen public is for public joinable stuff

#

But you got private too

#

Which is for invites

#

An invite will perform a search too

#

So keep in mind that scenario

thin stratus
#

Yeah these checks are build in stuff

#

From the NULL Subsystems

#

Not in my hands :D

rough iron
#

Ok ^^

#

Nite btw hahaha

#

Just saw the messages heheh

gaunt kestrel
#

Is there a better way of teasting VR Multiplayer?

#

It's hard because everytime we want to try something we have to package our game

modern fable
#

why so? right click -> launch game

#

@gaunt kestrel

wary willow
#

?

#

Nah, package

#

that's the best and only way to really do it

#

It's not that hard

#

It will save you more time in the end

modern fable
#

well, it does work just fine like that

wary willow
#

Because I've been noticing a lot of things that are different between Editor and true Compiled builds

modern fable
#

I see

wary willow
#

Yeah, I lost 6 hours of dev time tracking down a stupid bug

#

Game worked fine in editor, but didn't in packaged

brittle sinew
#

Just curious, what ended up being the isue with that?

eternal swallow
#

6 hours. Lucky :). I spent 2 days debugging why my packaged game had issues I didn't have in editor.

wary willow
#

@brittle sinew It is in the hands of Epic now

#

I mean, we alerted them to the problem. it's a known issue

fossil spoke
#

Divide and conquer

wary willow
#

No it was just because @fossil spoke was sleeping

#

When he woke up, he fixed it

fossil spoke
#

lol

wary willow
#

Well

#

It took maybe 45 mins

gaunt kestrel
#

Launch game doesn't allow my friend on another pc/ another headset to connect

#

I got some general bugs in packaged.

I think most of it can be fixed by making sure the right check mark boxes are checked

#

There is this one where the client player can't apply damage to the server player.

All it's doing is a sphere trace for objects and applying the damage to the hit object

red ledge
#

@thin stratus so how do you hide full sessions for NULL?

#

also, I wanted to ask, if I'm making a custom session, you said that I have to do it in the game mode, so does all game modes in my game have to have that override?

#

or just the main menu one

red ledge
#

if I'm having a sort of item shop for a match, just something that you buy stuff from for the duration of that match

#

the items only give states, they don't exist in the world or have any use either than that

#

but I want if the player died and respawned to have their items still

#

and maybe other players can see those items online as well

#

should I put the item inventory on the pawn or the player state or the player controller?

#

or something like have them in the pawn but with a ref of only important info like a struct array on the player state for other players to see?

#

the items themselves are UObjects

rare cloud
#

@red ledge, If inventory persist after death, use PlayerState

red ledge
#

yeah it does, goonna use the probably but thought gameplay important stuff should be on pawn or player controller

rare cloud
#

it really depend, and you can easily get playerstate from character

dense citrus
#

hello who knows , how i get player name over head as a Widget , as text render ist works

subtle sonnet
#

Does that seem like a reasonable flow for master/instanced ( on demand ) server flow?

#

With a back-end handling players allowed to connect

#

Since the client would be the only one with valid information about itself when it's moved to a new server

#

Mass instances would be pre-match instances that players can roam around in while waiting for a match.

#

My goal for the project is to have a four tiered system ( Back-end API, Master Server, Large instances (max 500), and Small instances (max 20)) and then spin up large/small instances as needed using docker and dedicated servers.

thin stratus
#

@red ledge Custom Session Class is like a Custom GameState, PlayerState, Character etc one. So yes, your GameMode defines the session class. The GameMode of your running game should have that. The MainMenu doesn't need to if you don't need any functionality there. I often don't even have a game mode for my main menu

#

And for the Inventory question: might be good to save it on the PlayerState. Mine is a component so I can stuck it onto everything i want

#

It's currently on the PlayerController

red ledge
#

@thin stratus I mean, I do the hosting in the main menu (you basically click host game and write some stuff) and I have a diffrent game mode for the lobby and another diffrent one for the game, so should I put the GameSession class override in all of them?

thin stratus
#

You put the GameSession override in the GameModes that have GameSessions active

#

Your MainMenu normally doesn't

#

I mean, if you have functions inside of the GameSession class that you need in your mainMenu

#

then yeah, then you need to override it there too

#

An easier way would be simply creating a new Base GameMode

#

overriding the variable there

#

and then just reparenting the other gamemodes

red ledge
#

probably gonna do that, thanks

#

I think you need to modify the source to make your own online session settings tho, right?

torn gust
#

Hey, i have read that binding functions to umg widgets is performancewise fast , but doing it with setting the value directly is faster. The thing is, i canยดt get it to work and i canยดt find any documentation on this for now. Casting to the UMG widget directly to change something with custom event does not work like it does with binding.

chrome bay
#

Bindingss to functions / variables is slow. It's better to just modify the widget component in place, even if you do it from ticking.

torn gust
#

Jeah. But how is this done in Multiplayer ?

chrome bay
#

Widgets don't replicate if that's what you mean

#

Each client has their own local copy of a HUD which updates itself locally, not via the server

#

you'll quickly run into the bandwidth limit trying to update client huds from the server

torn gust
#

So why does function binding work and direkt custom event node not ?

#

+does not

#

This does replicate if its setup by binding. But not with custom event.

#

Huh maybe i lack the knowledge to explain this better. All i found was this statement : All that said, it really doesn't matter, all the binding options are much slower than setting the value directly. So if you need performance, avoid binding all together, set the values directly on the widget.

#

So i canยดt figure out what to do if i want to just to that as Nick Darnell says.

thin stratus
#

@red ledge No you can simply inherit from the existing ones

#

check ShooterGame for that

torn gust
#

@thin stratus can you explain why we use binding function for health if this is performance whise not the direct way ? I really want to understand that part.

chrome bay
#

@material the non-direct way is to set the actual value of the object

#

For example, if it's a progress bar, you do UProgressBar->SetPercent(HealthRatio);

#

It's faster to do that in the 'NativeTick' of a widget, than to use a binding

torn gust
#

I am already doing that. But i cant understand how to set up that this is replicated.

chrome bay
#

You just replicated the Health value, and the clients update their widget on tick

#

The server has no knowledge of client widgets, so it can't call server functions on them. Widgets have no ability to replicate

torn gust
chrome bay
#

As I said, they don't replicate - so you can't do any networking functions with them

torn gust
#

Hmm so this Set percent needs to be done outside the widget ?

chrome bay
#

No it needs to be done in the widget - but you just replicate the health value

#

The widget updates itself on tick

#

By 'getting' the value from wherever it's replicated from

#

In your case, looks like the character

torn gust
#

I donยดt get it. This setup works with binding and tick. But not with Custom event inside the widget. So with binding health is replicated from my character. But with custom event not. Why and how to fix it then

#

Or isnยดt it possible to prevent updates on tick for Widgets ?

chrome bay
#

because the custom event isn't firing

#

You're trying to run a multicast event to set the percent - which will NEVER fire on the clients because widgets are not replicated

#

clients have their own local copy of widgets / UI etc - which is in no way linked to the server

torn gust
#

Ok this now makes more sense to me now. That raises the question again what " all the binding options are much slower than setting the value directly" means. How this needs to be set up

chrome bay
#

So a binding is kind of a separate 'object' in itself under the hood, which needs to be managed and taken care of - it therefore has overhead and has a cost of it's own.

#

They're convenient but slower than setting the value directly - BUT you probably won't notice a difference unless your game is very UI heavy

red ledge
#

@thin stratus thanks, I will check the shooter example, AGAIN

torn gust
#

Ahhhh you closed my Knowledge hole on this one perfectly now. Setting up values directly i therefore only possible if you set a variable inside a widget and let it read over event tick ? So you leave out this binding extra path ?

#

*is

#

Yeah it works !

#

Thanks man. This was quite hard to ask ( for me, iam bad at asking things)

chrome bay
#

No worries :p

#

Check out @thin stratus's network compendium - it will help

torn gust
#

I did. But i didnยดt understand it out from there. This tiny little bit "So a binding is kind of a separate 'object' in itself under the hood, which needs to be managed and taken care of - it therefore has overhead and has a cost of it's own." was needed for me to understand this topic.

#

I often need this informations side by side alongside the tutorial or i canยดt go further / canยดt process information. Thats why it can be quite hard for me to to tutorials myself. Anyway. Cool to know this now and i can read deeper into it

chrome bay
#

Can you set the tick rate in widgets? If you can change that instead of using the delay

#

tbh the delay there is probably just adding cost, setting pecent of a progress bar on tick wont really cost much ๐Ÿ˜ƒ

torn gust
#

Just to be clear, i am not afraid of performance costs haha ๐Ÿ˜ƒ I might sound like i am . But i wanted to understand the process. I never knew there is a tick rate setup for widgets.

wary willow
#

?

#

@torn gust what are you doing?

#

What is that % value to? HP?

#

Yeah, so. HP/Damage is event based

#

You shouldn't run it on tick

#

While you are not afraid of performance costs, it's just bad practice

#

You might as well learn how to do it as efficiently as possible

torn gust
#

Cool ๐Ÿ˜› Thanks.

wary willow
#

Yeah no problem. Not that what you were doing was "wrong"

eternal swallow
#

Btw, the delay after the tick just leads to your progress bar lagging behind the actualy value by 0.1 s. The function is still called every tick.

wary willow
#

Obviously there are multiple ways to a solution in programming

#

Yeah, there's no reason for that delay at all, but I figured he took it off after Jamsh said something

torn gust
#

Jeah was a stupid idea in general. It was more of a test thing. Delays per tick would make sense for line tracing or something that would be expensive to do extrem often. Event binding on a custom event is crazy powerfull, but i never understood how to set them up properly.

gaunt kestrel
#

My client is unable to damage the server in a p2p network.

Its a sphere trace for objects, if I set the RPC to "run on server" it does nothing, if I set it to multicast my client can see the sphere trace debug but no damage is applied

torn gust
#

@gaunt kestrel will try to set it up myself. Hope i learned something and can help you. ๐Ÿ˜ƒ

gaunt kestrel
#

Thanks Mom! @torn gust

torn gust
#

Okay. Need to read on that too. ๐Ÿ˜ƒ

#

@gaunt kestrel are you using Event any Damage ?

gaunt kestrel
#

Yes

torn gust
#

Ok this worked for me :

gaunt kestrel
#

Yes?

torn gust
#

Funny enough, without any damage given it does not fire to the traced pawn

gaunt kestrel
#

What does that mean?

#

The only thing different on mine is the if statement and the self on damage causer

torn gust
#

See that little base damage float ? I had set it up to 0 and nothing worked. Set it to 1 and it worked. ( I used a float of 10 on the Event damage side for constant damage)

gaunt kestrel
#

Ahh okay

So if the damage is 0 it just doesn't call

torn gust
#

Seems like it. But honestly i didnยดt know that or that i am sure its like that. Someone should correct me then ๐Ÿ˜ƒ

gaunt kestrel
#

Well I'm waiting for a package to come in then leaving for work

#

I'll give that a try when I get there

torn gust
#

The tracing sphere is only visible on one window. Is this expected behavior ?

#

(dedicated)

#

Ah mistyped , non dedicated. Ok makes sense then. Haha

#

Wait, if this works from Server and from owning client which one is the right way ? From what i can guess , run the tracing on the Server favours all handling from the server which can mean that you saw you bullet hit another player but the server can decide you did not hit. On the other hand, shooting from the client side and hitting a target could lead to favour the least laggy player right ?

gaunt kestrel
#

If it's set to multicast it's visible on both.

I want it to be able to damage no matter if you're host / client

#

Technically it's negative damage as it's a heal.

torn gust
#

You mean multicast sphere tracing ?

gaunt kestrel
#

Well if the event is set to multicast

I can see the debug sphere trace on both windows

torn gust
#

Doesnยดt that mean you trace two times if you have 2 players and one shoots ? It should trace for every player. Hm

gaunt kestrel
#

Only 1 set of debugs is coming up

torn gust
#

Ok donยดt know. Damn this topic wonยดt get in my Brain soon.

gaunt kestrel
#

It's okay! Thanks for your help. If what you did before allows client to damage host and host to damage client that will work just fine

torn gust
#

Ah okay i overlooked that i did not drain the Healthbar on the other player and vice versa. So i assumed client side worked but it didnยดt. Need to use second Screen ๐Ÿ˜› Since my Vive steals one hdmi port iam stuck with one screen hehe. Guess i have to set up the viewports so that i can actually see whats happening. Now its all server side (tracing and damaging).

gaunt kestrel
#

Yeah right? Client can't damage

crimson pawn
#

Whats up with projectiles not hitting players when the server is dedicated sever? Works fine on listen server

#

Ok even rays go through..

fossil spoke
#

Check that your collision presets are correct and that you are correctly replicating the linetrace/projectiles

crimson pawn
#

Figured out the problem, the projectiles were flying forward from the gun, and the aiming is done via animation blueprint, and looks like animation isn't performed in dedicated mode (which makes sense)

gaunt kestrel
#

So I tried what you said @Glutamatkrieger#7878 but it didnt work

#

So i've deduced that the server isnt seeing the sphere trace

#

imma try setting up another RPC that does the same exact stuff but on the server

thin stratus
#

@gaunt kestrel I didn't really follow along, but are you doing a ServerRPC that should end in a SphereTrace but the SphereTrace never happens?

gaunt kestrel
thin stratus
#

Are you trying that in Editor?

#

Heard earlier that RPCs in Editor with a VR Pawn are broken

gaunt kestrel
#

Editor and Package dont work

#

Package actually breaks it more, things like turning on and off visibilty break

#

but only for certain objects

thin stratus
#

have you tried starting the Project with -vr as a parameter instead of using "Enable HMD"?

#

You can do that for example via command line

#

"PathToYourEngine/UnrealEditor.exe" "PathToYourProject/NameOfYourProject.uproject" -vr -game -log

#

Something like that

junior tree
#

hey guys I am having a hard time getting my xbox one controllers to work

#

it's hell

#

they are plugged in and work in editor (moving the thumbsticks affect the editor)

#

but if I hit play the input is not received

#

pawn won't do anything ๐Ÿ˜ฆ

gaunt kestrel
#

... one sec

#

I may be an idiot

thin stratus
#

:O Don't say that

#

@junior tree Well did you setup the Input things to use the Controller?

junior tree
#

using the third person template

#

now only the first controller works

thin stratus
#

So you are making a Local Multiplayer game?

junior tree
#

my pawns are put in the level and set to auto possess player 0,1,2,3 respectively

#

yeah

thin stratus
#

And you have 2 Controllers?

junior tree
#

yeah

#

currently 2

#

one works

thin stratus
#

Well do you create a new player for the second one?

junior tree
#

maybe I need to spawn more player controllers?

thin stratus
#

Yes you need to

junior tree
#

yeah perhaps it's that, auto possess player 1,2,3 won't work I guess?

wary willow
#

If you hold on a sec

#

I will show you what you need exactly

junior tree
#

ok, then, I'll look that up. Thank you a lot you kinda saved my life for the jam

wary willow
#

up to 4 players

junior tree
#

oh well

#

I am going to pee

gaunt kestrel
#

essentially i have a fps version of my VR pawn that inherits all the inputs and everything.

junior tree
#

thanks!

wary willow
#

NP, it's old code but it should work

thin stratus
#

That code shouldn't work o.o

junior tree
#

you're not spawning any player controller I see?

gaunt kestrel
#

it was included in part of Mordentral's VR plugin. I'll post there

wary willow
#

But it does

thin stratus
#

The "SpawnPawn" is NOT spawning a pawn

#

It's spawning a PlayerController

#

If you don't spawn an actual pawn and possess it it shouldn't work

wary willow
#

All I know it worked when I played with it ยฏ_(ใƒ„)_/ยฏ

junior tree
#

great! I'll be doing that

thin stratus
#

ULocalPlayer* LocalPlayer = World ? World->GetGameInstance()->CreateLocalPlayer(ControllerId, Error, bSpawnPawn) : NULL;

#

This is what it calls

#

And "CreateLocalPlayer" does this

thin stratus
#

ULocalPlayer* UGameInstance::CreateLocalPlayer(int32 ControllerId, FString& OutError, bool bSpawnActor)

#

There yo ucan see that boolean is suddenly "SpawnActor" instead of "SpawnPawn"

#
if (bSpawnActor && InsertIndex != INDEX_NONE && GetWorld() != NULL)
        {
            if (GetWorld()->GetNetMode() != NM_Client)
            {
                // server; spawn a new PlayerController immediately
                if (!NewPlayer->SpawnPlayActor("", OutError, GetWorld()))
                {
                    RemoveLocalPlayer(NewPlayer);
                    NewPlayer = NULL;
                }
            }
            else
            {
                // client; ask the server to let the new player join
                NewPlayer->SendSplitJoin();
            }
        }
#

WHich is used here

#

So if you set that to false you won't get a PlayerController

#

Yeah

#

That Stream shows the same

#

He is spawning the Pawns with pressing START on the Controller

#

The Node is not spawning a Pawn althoug the boolean says that

#

No idea why you are able to access the "ControllerPawn" in your image @wary willow

wary willow
#

aliens ยฏ_(ใƒ„)_/ยฏ

#

That project was in 4.10

thin stratus
#

Maybe it actually autoposseses the placed pawns that are in the level?

wary willow
#

So who knows what I did there

junior tree
#

so the create player function tells the game mode to check for player starts and spawn a player there

#

what if I want player starts to be single-use?

wary willow
#

?

#

Like you have multiple spawn points?

#

Just add them all in an array at the start

junior tree
#

4 spawn points, only use one

thin stratus
#

Na the CreatePlayer function creates a new PlayerController

wary willow
#

and then remove them accordingly

junior tree
#

only use each once

#

allright

wary willow
#

Right

thin stratus
#

You can then use that PlayerController to possess a pawn

junior tree
#

my createplayer creates a pawn with a player controller at a random player start

#

empirically

#

that's what it's doing right meow

wary willow
#

But it works?

junior tree
#

purr purr

#

it does that, I'd like to avoid using a player start twice is all

wary willow
#

Right

junior tree
#

maybe I can just re-position the pawns after they are spawned

thin stratus
#

That node is so random then

wary willow
#

lol

#

But it works

#

.shrug

thin stratus
#

If you uncheck that boolean you don't get a PlayerController

#

xD

#

You get a ULocalPlayer, but that's not helpful in BPs

wary willow
#

Obviously, if you wanted more control, you'd need to go into cpp

#

and build a function yourself

junior tree
#

oooh I can uncheck that boolean

wary willow
#

Or someone can do a PR for it

#

and maybe get it into 4.50

thin stratus
#

Might be that the Node is hooked up with PlayerStarts

wary willow
#

From PlayerState?

thin stratus
#

That could be although I can't find anything calling something for a PlayerStart

wary willow
#

PlayerState has that override function right?

gaunt kestrel
#

Sphere Trace still not showing up for client .-.

thin stratus
#

@wary willow Why suddenly PlayerState?

#

@gaunt kestrel Did you try to start it like I said?

gaunt kestrel
#

I'm not using a VR Pawn, i'm using a third person pawn that inherits everything from my VR Pawn

wary willow
#

I was wondering just thinking out loud

thin stratus
#

@gaunt kestrel So you are not even using "VR Preview" or "Enable HMD" somewhere?

wary willow
#

Just in case you were wondering

junior tree
#

I think I'm gonna die

wary willow
#

And I have that player setup in GameMode

gaunt kestrel
#

just Simulate, can't really test VR Multiplayer without going through the whole packing process

#

thats why we have the FPS pawn that inherits

thin stratus
#

Of course you can test that

gaunt kestrel
#

0.o?

wary willow
#

You can test MP VR via Steam in editor?

thin stratus
#

Just start the game as StandAlone via command line with -vr and then use the console to start listen server and one to open the localhost address

#

You don't need steam for vr

wary willow
#

So you mean LAN?

gaunt kestrel
#

I'm not using steam when packaging

wary willow
#

What are you using?

#

Ah direct ip?

gaunt kestrel
#

A bunch of checks to see if they have a HMD or not, and @wary willow open level?listen on host, open IP on client

thin stratus
#

In the Editor?

gaunt kestrel
#

In editor, that was simulate loads in as a different pawn

#

Here I'll show you after I try Stand Alone

thin stratus
#

Try this

#
:: Starts the specified Unreal Engine 4 Project.
:: Enables a LOG console, which is also printed to the projects "Saved\Logs" folder.

@ECHO OFF
:: Set your Paths here correctly

SETLOCAL
SET ProjectPath=
SET UProjectFileName=
SET EnginePath=

ECHO ON

echo "Trying to start Game"

echo %EnginePath% UE4Editor.exe %ProjectPath%\%UProjectFileName%.uproject

@ECHO OFF

start /d "%EnginePath%" UE4Editor.exe "%ProjectPath%\%UProjectFileName%.uproject" -vr -game -log
wary willow
#

oh batch

gaunt kestrel
#

... in console?

wary willow
#

nah

#

txt file

#

and replace .txt with .bat

gaunt kestrel
#

oh this is .bat

#

ok

wary willow
#

@twin juniper this is the correct channel to ask your question

#

Especially with Super MP Nerd Genius Exi here

gaunt kestrel
#

apparently im unaware how to use this .bat file

#

and yeah Exi is a god

wary willow
#

I've never seen it, so I can't help

#

Beg Exi

#

But

#

It seems pretty self explanatory

#

SET ProjectPath="FULL DIRECTORY PATH" to project

#

SET UProjectFileName= try Full Path to uproject or Just the uproject name

#

EnginePath=Full Directory Path to Engine Install

#

hmmm

#

same with the rest I guess

#

Actually no

#

You won't need to input anything after those 3

#

It's done in the echo for you

#

Anyway, those are just guesses, never seen this or tried it, just using common sense.

gaunt kestrel
#

whoa cool

#

ok

wary willow
#

did it work?

gaunt kestrel
#

trying it

#

one sec

thin stratus
#

Remember that you need a console key

gaunt kestrel
#

it was "Oh cool" to how it works

thin stratus
#

So you can do "open MapName?listen"

#

and "open 127.0.0.1"

gaunt kestrel
#

wait am I launching this in stand alone?

#

it only opens one window

thin stratus
#

One bat execution

#

is one instance

#

you start it twice

#

First instance will be open MapName etc

#

Second instance wil lbe open ip

#

Anyway, off for today

gaunt kestrel
#

byeeeee

#

Can't find my engine path

twin juniper
#

hey exi so how do i remove a element in a TArray tha tis replicated in c++ but im looping through it in bps (I made an array to hold all my items and they are added by an overlap event). I then want to remove the item from the array when the player drags and drops the item off of the inventory interface (in umg)

#

what i need to know basically

#

is how do i access "Switch Has Authority" in bps

#

@thin stratus

#

@brittle sinew

junior tree
#

I just wanted to tell you that I love you and I am happy to be here

wary willow
#

@junior tree hm?

#

@twin juniper I told your ass to come here awhile ago when he was still here

#

The man is sleeping or having some fun

#

He gone

native axle
#

@twin juniper I think its something like

Pawn->Role < ROLE_AUTHORITY

#

How do I format code in this?

#

Pawn->Role < ROLE_AUTHORITY

twin juniper
#

lol

#

Role_authority

#

is an enum

#

lol

#

like theres an enum of all the different ones

#

i dont remeber them off the top of my head

#

I really wish discord had a spellchecker lol

native axle
#

ohh u wanted it in BP?

twin juniper
#

its w/e

#

for now

#

lol

native axle
#

you can only call switch has authority from a pawn class

#

otherwise you have to store your player pawn and do a branch for "Has Authority"

#

or you can probably just do get player pawn 0 . has authority

subtle sonnet
#

if it's umg that's pretty safe since a server will never have it, but if it's just a standard blueprint taking player 0 should be replaced with get owner

#

otherwise the server will simply take the first user off the user stack

gaunt kestrel
#

how do we open a map and have all currently connected clients join

subtle sonnet
#

There's a bunch of those, but that seems like you best bet for your case ( There's ClientTravel, SeamlessTravel, and a few others if I'm not mistaken )

gaunt kestrel
#

I'm in BP, run these as console cmds?

night jay
#

Works

#

Buggy part about that thing is with Steam it kicks out half the players for some reason

#

So you have to look into seamless server travel

#

But in turn that won't work if you want to change gamemodes

civic light
#

wait, what? I have seamless travel in my game and i can switch game modes

wary willow
#

Well

#

Not sure how it would work in MP, but you could always Keep the same GameMode(actor) and just switch components in it

night jay
#

@civic light can you show your code? I have a main menu gamemode and I want to switch to my gameplay gamemode

civic light
#

are you using sessions?

thin stratus
#

@twin juniper SwitchHasAuthority is just a single node. I don't get the question. In BPs you simply rightclick and search for it

#

@gaunt kestrel To open a map and move Players with you, as a server, you use ServerTravel

#

BP doesn't have a node for this so you need to use it as a console command

#

@night jay @civic light MainMenu to GamePlay is something else than GamePlay to GamePlay. ServerTravel is used for the later. I never actively used Seamless Travel but i was told a while ago that this will keep the GameMode class

civic light
#

Its actually really easy to change the gamemode when using seamless travel. For example when a match is over, i call the following before ServerTravel. gamemode_class is just a TSubclassOf that i get from a function that randomly picks one of my gamemodes.

    FURL &test_url = Context->LastURL;
    if (gamemode_class.GetDefaultObject())
    {
        auto gamemodeobject = gamemode_class.GetDefaultObject();
        test_url.RemoveOption(TEXT("Game"));
        FString gamemodestring = "Game=" + gamemodeobject->MapPrefix;
        test_url.AddOption(*gamemodestring);
    }
night jay
#

Thanks

thin stratus
#

@civic light But this is ServerTravel

#

SeamlessTravel != ServerTravel

#

Changing the GameMode with ?game=GameModeShortName is something known so far

#

4.14 even features a functionality in "Maps and Nodes" to set Shortcut names directly in the Editor

#

Which was previously only possible with setting them in the ini file directly

civic light
#

oh, nice

thin stratus
#

But if you use SeamlessTravel, I'm still kinda sure (based on what I was told) that the GameMode class stays

#

Because the idea of SeamlessTravel is to keep Actors alive and, for example, move the previous saved data of your PlayerStates to the new map

#

Imagine something like Borderlands where you where traveling between zones

#

(always all together cause UE3 worked the same way)

#

That was probably a seamlesstravel

#

As you kept all the information ,the game mode, the PlayerState etc for the new level

#

But moving from Lobby to GamePlay where Lobby is probably a different gamemode, shouldn't work with SeamlessTravel

#

As that would mean the LobbyGameMode stays and the GameplayMap uses the wrong GameMode

#

that is what I learned. I never actually tested it as my first experience with SeamlessTravel was crashing in 4.6

civic light
#

yeah, its different when it comes to using lobbies

#

personally im not using them for my game

thin stratus
#

Well I have a lobby on the Marketplace

#

And I ServerTravel from Lobby to GamePlay level

#

I would love to keep selected stuff in the PlayerState and use "OnCopyProperties" and "OnOverrideWith" (can't remember which one is for the travel) to keep the data

#

But these functions need SeamlessTravel

#

so /shrug

#

I would like a semi-seamless Travel

#

Where you don't keep the classes, but you still have the ability to use the old PlayerState object to give the new one data

#

even if they are different classes

civic light
#

what sort of properties are you looking to keep?

thin stratus
#

Currently, the Players can select a Character and a Team in my Lobby

#

Since the Marketplace Project can't have Steam by default, I save the data in the GameInstance of each Player

#

And ask them in the GameplayMap for their choices

#

While this works, it's not really ideal

#

I could use Steams unique ID and save the selection together with the ID to the match them back up after they traveled to the Gameplay Map

#

But ideal would be, being able to Travel, getting all the new Class (gameMode and the classes that come with it) and having the PlayerState call "CopyProperties", giving me the instance of the old PlayerState (ALobbyPlayerState) so I can get variables from it to fill my "AGamePlayPlayerState"

#

But it seems like the whole CopyProperties thing is bound to SeamlessTravel and to the idea of keeping the GameMode and so also keeping the PlayerStateclass

hallow shore
#

i save data to game instance and than restore it on server

#

@thin stratus is there are some tutorial you know how can i "repack" advanced session plugin (any plugin) with few more functions added?

thin stratus
#

If they give you the source, you simply add the plugin to your plugin directory of your project and regenerate project files

#

then you can extend the stuff in their .h/.cpp files and hit build again

#

then you have the updated plugin

#

Nothing different than having a normal C++ project that you extend

hallow shore
#

it has directory with source, which includes classes, private and build.cs
im not sure is that all source, probably all?

thin stratus
#

Yes, this is Source

#

Mostly made out of a Build.cs, header and cpp files

#

:P

hallow shore
#

๐Ÿ˜›

#

there are no bp function for is uniqueid valid, which give me nasty warnings all over the place ๐Ÿ˜

thin stratus
#

What keeps you from just adding that to your own project

#

instead of the plugin

hallow shore
#

its not for myself.

night jay
#

I have another question regarding seamless travel then

#

Can I change my default controller class

#

And does begin play happen in the gamemode after seamless travel?

gaunt kestrel
#

ServerTravel "Levelname"?listen

or

ServerTravel "Levelname"

gaunt kestrel
#

Also I'm having this weird bug where my client can't recieve inputs at all

#

didnt change anything, just opened the project this morning

thin stratus
#

Without the listen

#

Listen is only for the initial call of creating the listen server

#

@night jay Seamless Travel keeps the GameMode and so also all the classes you setup in it

#

So no, you can't change the PlayerController class if you use Seamless Travel

#

It's only meant for scenarios where you want to keep everything but just switch the map

#

e.g. Borderlands zone change

night jay
#

Issue is with Steam it's kinda necessary because normal server travel kicks out half the players

thin stratus
#

That's weird

#

Would do the other clients get i nterms of log errors?

#

I mean, either you loose all clients or none

gaunt kestrel
#

Well that works now. Thanks!

Problem is client can turn and look, but cant move or do other actions

night jay
#

connection failed or whatever I can't remember exactly

#

But It's been bugging us since the beginning

thin stratus
#

Well seems like Steam ServerTravel only works if you set Seamless Travel to true

#

Which will cause this:

#
Seamless Travel Flow

Here is the general flow when executing seamless travel:

1. Mark actors that will persist to the transition level (more below)
2. Travel to the transition level
3. Mark actors that will persist to the final level (more below)
4. Travel to the final level


Persisting Actors across Seamless Travel

When using seamless travel, it's possible to carry over (persist) actors from the current level to the new one. This is useful for certain actors, like inventory items, players, etc.

By default, these actors will persist automatically:

- The GameMode actor (server only)
-- Any actors further added via AGameModeBase::GetSeamlessTravelActorList
- All Controllers that have a valid PlayerState (server only)
- All PlayerControllers (server only)
- All local PlayerControllers (server and client)
-- Any actors further added via APlayerController::GetSeamlessTravelActorList called on local PlayerControllers
#

Hm

gaunt kestrel
#

Hmm it seems that no matter the pawn I load in for client it doesnt want me to use wasd to move it. (spectator)

night jay
#

Then steam is practically unousable if you want a lobby..?

#

Where you can actually connect to

thin stratus
#

So, I just asked Moss and it seems like this:

The GameMode should NOT override the Gameplay level one if it'S different

#

Seamless Travel only keeps it completely if you have the same gamemodes setup

#

Of course you can't use the features of Seamless travel if the classes aren't the same :x

night jay
#

what do you mean same gamemodes setup

#

I have a gamemode called MainMenu which is in my level's gamemode override

#

Then I server travel with a travel URL which includes a custom gamemode in the URL

#

Which does work if I have seamless off

thin stratus
#

First thing is: Your MainMenu is not really important here

#

MainMenu -> StartServer is a "hard travel", which means non-seamless
MainMenu -> JoinServer is also a "hard travel"

#

Only if everyone is already on the Server you call ServerTravel

night jay
#

I do that

thin stratus
#

So the Lobby, which you probably opened as the first map, has the Seamless Travel on

#

Lobby has a LobbyGameMode

#

and as long as the GamePlay map doesn't have the LobbyGameMode too, it should seamless travel without keeping the GameMode

#

If not then we have a bigger problem :D

night jay
#

Well I exactly have that already

#

And it doesn't

#

Although main menu gamemode and lobby gamemode are the same thing

#

My lobby is in my main menu

#

But that shouldn't matter

#

Server travel I try to load Deathmatch or whatever

#

Doesn't work

thin stratus
#

So

#

Without clients in there

#

What exactly happens if you call Seamless Travel ServerTravel from Lobby to Gameplay

night jay
#

It still keeps the mainmenu gamemode while I called it to use deathmatch

thin stratus
#

And withotu Seamless travel this is 100% changing?

#

(despite the clients problem)

gaunt kestrel
night jay
#

yes 100%

#

So far my team had to start the game and load a level and gamemode before people could join because of the kicking out

night jay
#

@thin stratus would it be possible if you were to make a small example on how to set it up? I might be doing something wrong here..

thin stratus
#

Currently no, sorry. Knee deep in work :(

night jay
#

Alright

#

Thanks anyway

ocean dust
#

Hello, all.

#

When I use the Create Session node and specify IsLAN = False, where is that session hosted?

thin stratus
#

Without a Subsystem, nowhere

#

I mean, it's hosted on your PC

wary willow
#

Oh

thin stratus
#

But the Session can't be found online without a MasterServer

wary willow
#

One question to make sure @thin stratus

#

If I have OSS Steam on, and have that also in the config

#

If I toggle LAN, I should be able to enjoy LAN out of the box, without additional setup?

ocean dust
#

Ah, that's what I thought. How does one go about setting up a MasterServer?

wary willow
#

Because I saw somewhere that I have to do SubSystem=null for LAN

#

But is that just for if the game is only LAN?

thin stratus
#

LAN should work with Steam Subsystem

wary willow
#

Right, just making sure.

thin stratus
#

Well, I never tried it so I can't say for sure either

wary willow
#

Hehe

#

I know it works in editor

#

But I've never actually tested it in Packaged

thin stratus
#

@ocean dust Your own MasterServer? That's quite some work. There is a Plugin on the Forums that features a basic one.
But you might be better off using Steam (though remember they take 30% of your income from the game)

wary willow
#

They take 30%

#

But, you get 10000000000000% more exposure

#

than you probably would alone

ocean dust
#

Our plan is to launch on Steam anyway. But yeah... -30% + -5% + -10% ...

thin stratus
#

True and a lot of additional stuff (like accounts etc)

wary willow
#

Unless you had some crazy marketing and hype

thin stratus
#

@ocean dust Well, without Steam, you would miss a lot of buyers

ocean dust
#

Agreed

thin stratus
#

And you would need to host your own MasterServer

ocean dust
#

which is our plan

wary willow
#

@ocean dust what's that 10%?

thin stratus
#

And your own Database

#

etc for accounts

#

and Your own Cloud etc etc etc

ocean dust
#

The way we see it:

#

-30% to Steam
-5% to Epic
-10% to taxes (probably way more)

wary willow
#

TBH, I would say, if devs wanted to start off a little slow, but earn max profits, use Itch.io

#

then, go to Steam/Humble/whatever other new crap is out there

ocean dust
#

Making games is HARD

thin stratus
#

Taxes only 10%?

#

:D

wary willow
#

I wonder what my taxes will be like.

thin stratus
#

I mean, I don#t know about your Country etc, but I would be surprised if taxes really are that low

ocean dust
#

It's just soul-crushing to know we'll see only 35% or less of our hard work

#

yeah

thin stratus
#

Yeah you might only go home with ~35% of the actualy price

ocean dust
#

It's probably closer to 25% for taxes

wary willow
#

But tbh, If you are getting roughly 30% as profits, that's still pretty good

#

And that's what you should be accounting for when doing budgets

ocean dust
#

Sadly, yes

#

Anyway

thin stratus
#

I mean

#

Germany the taxes would be 35%+

#

So no idea where you live

ocean dust
#

Is there a guide for getting Steam integration set up? I think I saw one a while ago and shifted gears away from MP

thin stratus
#

but 25% is a bit dreaming

ocean dust
#

Yeah...we're trying to be realistic

#

but still fight to get something out of all of this work

thin stratus
#

Make it good

#

And it sells good :P

#

You can see how Steam Games sell iirc

#

How many copies

ocean dust
#

yeah

#

but that's pretty optimistic

thin stratus
#

Well doing all of that work while thinking yo uwon't earn anything

#

is kinda weird

ocean dust
#

even if we net 2mil: 0.3 * 2,000,000 = 600,000

thin stratus
#

Yap

ocean dust
#

That's the power of passion for making fun games and experiences

#

Meh

#

ANYWAY

#

Steam integration? I need that for a MasterServer to host my Sessions?

thin stratus
#

That's why I don't create my own games xD

#

Yeah

#

They register there and your players can get a list of these back from the server

#

Of course Steam features a lot more

wary willow
#

@thin stratus you don't create your own games?

#

what, I thought you had a VR project?

#

Like some exploration type game

thin stratus
#

In my eyes, for me, a VR Project wouldn't cut it

ocean dust
#

@thin stratus I'm making my own games

thin stratus
#

More work than a normal Game
Less buyers cause of less people having a Vive

#

I would rather work on a non-vr Game

#

But as a single dev without any skill in art, I can't do that anyway

#

Maybe at some point in the future getting into one project with Celeste, but that's just a thought

wary willow
#

@thin stratus You gave up on 3d modeling?

thin stratus
#

It takes too much time atm

wary willow
#

Wait, why aren't you two doing something now together?

thin stratus
#

Freelancing for money needs time

#

Because both of us work on clients + she works on her Gamejam game with that leaf

#

No time to start another project

wary willow
#

I'd love to see what the "cute couple" could come up with

thin stratus
#

Oy

wary willow
#

lol

#

Actually...

#

Just saying...

#

You could probably use that as a marketing strat

#

ยฏ_(ใƒ„)_/ยฏ

thin stratus
#

:P Na

#

My relationship and my job are two different things

#

If I end up creating a game, with or without her, i want to sell the game, not my relationship :P

wary willow
#

Right, but there's always a chance of wedding bells

#

And then you're definitely merging some stuff together, other than yourselves

thin stratus
#

hehe

#

Well anyway, currently there is no time to spend on a gameidea

wary willow
#

$$$$$

thin stratus
#

We are both heavily learning slate atm for editor extensions and maybe after I finished that one

#

Also want to go back learning Substance a bit more

#

was fun to create these textures

#

Anyway, food and watching some series

#

o7

stiff rapids
#

hi, anyone here with expireince in blueprint networking mayhem with interfaces between actors, specilly pawn->interface->weapon->interface->enemypawn, i know i have some kind of owner problem, really dont know even if my idea is possible. did i peak anyone intrest to help me?

stiff rapids
#
ocean dust
#

I've found 4 different Steam integration guides and they are all out-of-date as far as I can tell

hallow shore
#

what you need

#

im integrating steam right now

ocean dust
#

Oh sweet! I need an up-to-date guide on Steam integration

#

@stiff rapids Shouldn't the Weapon be in charge of determining what happens when it "hits" something?

#

@stiff rapids The Weapon should say "hey, Pawn, take some damage"

#

Instead of the Pawn determining "I was hit, therefor I need to take damage"

hallow shore
thin stratus
#

Allar's is good

ocean dust
#

@hallow shore Nope, tried that one

#

My cook step says UEBuildConfiguration.bCompileSteamOSS is deprecated

#

and fails

hallow shore
#

engine ver?

thin stratus
#

@stiff rapids UE4 has damage system build in

stiff rapids
#

@ocean dust, yes, you are correct there, this is the end goal, but my problem is that the pawn is not reacting to the client correctly. even if the pawn right now decides what happens, the execution goes to remote instead of server, when the weapon calls the interface.

ocean dust
#

@stiff rapids OK, so, you are doing a raycast check on the Client when you press the button

stiff rapids
#

@thin stratus Yes, i know that. ๐Ÿ˜ƒ just trying my own thing.

ocean dust
#

@stiff rapids You should send an RPC to Server to ask it to "use" your weapon

#

which will then to the raycast and messaging on the Server

stiff rapids
#

@ocean dust Yes right now i am, i was doing it on the server before, same result, for some reason, the executon on the pawn goes to remote... i feel like i am doing somethig with interfaces that i am not suppose to do..

ocean dust
#

@stiff rapids This graph specifically is not running on the Server:

#

I guess I don't understand what "the executon on the pawn goes to remote" means

#

Somehow the Inteface call is executing on the Client?

stiff rapids
#

@ocean dust for simplicity i am executing much on client right now. let me try explain

ocean dust
#

Any other Steam integration guides out there that are correct for 4.14.3?

stiff rapids
#

@ocean dust the fire weapon logic, it just finds any actor attached to my pawn, that implements a weapon interface, then it send the "use" message. The use message gets to my weapon actor, its fires the event use, which does a trace, if it hits a actor witch in its turn has a interface called on hit implemendet. the weapon sends onhit interface message to that actor. Now, the last actor witch recivies the onhit messages, fires onhit event, this event takes "health variable", says to authority to decrease it by some ammount. Healt variable is onrep notify. This onrep notify chages some text. If the OnHit interface call is made from the weapon as i want, is authority fails on the last actor, it goes to remote. If onHit is called from pawn directly with asimple trace, the last actor decreses its variable trough authority... sorry if i am unable to explain this clearly..

ocean dust
#

That all makes sense

#

With one issue: You are running all of this logic on the Client

#

You need to add a new Custom Event, set it to Run on Server Reliable

#

And call that event from your InputAction

stiff rapids
#

yeah i get what you mean, this is the path i went from the beginning, and still failed. But turth to be told, i might have overlooked something, so i am going to try and rewire it again so it server side. One question, if i fire the first interface call "Use" from my pawn but run on server, does the rest of the chain execute on the server too?`

ocean dust
#

Yes. If the Custom Event that starts the logic has "Run on Server" then it will be running on the server

stiff rapids
#

Amazing, just got it to work now, by doing as you said. Thank you. Much appriciated. THe interesting part is, the only difference now is that before all this, i was running the run on server logic on the weapon, it started there with the raytrace... now instead, i just run it even before that...

#

I am guessing that the sideeffect of having all running on server is that i cant see the raytrace debug info from the client view now, but that is expected i guess?

ocean dust
#

Uh hmm. I guess? I set up similar logic for my game to run on both cient and server for some lag prediction (but I'll probably drop the client logic)

stiff rapids
#

Sure looks like that right now, as everything is server side, when the client shoots, the trace debug is drawn only on server(listen). I am still confused as to why it didnt work before when it was client side trace... i know its no good client side, but confusing it worked from pawn but not from attached actor. anyways, thanks.

smoky ore
#

So, My client cant see it's animation but the server can, and my server can see it's animation but the client can't. I am using am using an anim montage, are there certain things you have to do with anim montages when it comes to replication?

#

my code is currently setup like this

#
{
    if (Role < ROLE_Authority)
        ServerReloadWeapon();

    else
        ReloadWeapon();
}```
#

and all what reload weapon does is just play a animation

hallow shore
#

you need to multicast animation

#

i dont know c++ term from it

smoky ore
#

would the reload animation need to be replicated as well?

brittle sinew
#

Yes, you need to play the reload animation on all clients

#

Make a NetMulticast RPC and call that from the server, which just calls the animation

#

Working in MP, you have to realize that most stuff needs to get called on all clients if you want everyone to see it. Things like AnimBPs exist on all clients so they work fine, but manually playing animations needs to be called multicast

thin stratus
#

Things like shooting and reloading are normally handled like this:

#

Client Pressed Button to Reload -> That moves the call to the Server with a ServerRPC and also does the same on the Client that pressed the button

#

You want instant reaction for the Client that presses the button, so he takes care of playing the Animation himself

#

On the ServerSide, you simply perform all the math behind reloading and multicast the reloading animation to the other clients

#

Filtering the original client in the Multicast call as you don't wanna do that twice

#
ServerRPC -> Reload the Weapon (math) -> Multicast -> Play Reload Animation (but not on the weapon instance that is on the original client)
/ 
Client Press Reload 
\
Client Call -> Reload the Weapon (math) (Yes, you could technically cheat here, but the ammo is still replicated and shooting shoot be checked on the server!) -> Play Animation
nova wasp
#

Is there a way to set the extra windows for the other clients to appear spread out when you start playing with multiple players?

smoky ore
#

I see, now I think im beginning to understand, thanks

vivid siren
#

Hey, where should I go to learn about linking website data with ue4 gameplay?

#

Like having someone on a website interact with a player who is playing the game

#

Something simple like allowing a website user to select the music that plays for a player

wary willow
#

probably something like VAREST, JSON, anything that will allow you to communicate externally with a server @vivid siren

#

Otherwise, you can see what the Twitch Integration plugin does

#

But VaRest is a plugin

#

(pretty sure)

vivid siren
#

awesome, thanks! i'll take a look

wary willow
#

Yeah, looks like you can get request objects from server

#

But, no idea how that would get implemented with how you want it (I don't know crap about these things, only know the barest of minimums)

obtuse zinc
#

Hey guys, I have a question that I'm going to try to explain. I have a projectile spawning on the server and replicating and its amazing and thanks to the resources you guys sent me i got it working. The only problem is that for some reason, the projectile isn't firing anywhere near my crosshair. But if I fire the projectile on the client with the same exact values, it goes exactly where i want it

#

Does it have to do with the UGameplayStatics::BeginDeferredActorSpawnFromClass() function maybe?

#
LogTemp:Warning: CLIENT ROTATION:   X=0.916 Y=0.399 Z=0.047
LogTemp:Warning: CLIENT SPAWN:   X=1831.037 Y=798.989 Z=94.453
LogTemp:Warning: SERVER ROTATION:   X=0.916 Y=0.399 Z=0.047
LogTemp:Warning: SERVER SPAWN:   X=1352.710 Y=1462.012 Z=180.821

I'm multiplying the forward vector of the rotation by 2000 and setting that to be the Velocity of the projectile's movement component.

brittle sinew
#

Are you doing the trace that decides where the spawn occurs on the server?

#

If so, you might be battling latency issues, but that far off seems unrealistic for that

obtuse zinc
#

No, I'm calling GetSightRayHitLocation from the playercontroller on the client, but even when I'm standing still they are way off

brittle sinew
#

Is that a function you wrote?

obtuse zinc
#

Yeah it is, sorry lol. Forgot i did. It's just a function that shoots out a cast from the crosshair and checks what it hits

#

or where, rather

brittle sinew
#

So you're calling the authoritative trace on the client, and the values aren't the same on the server? Based on the logs you posted up there

#

And why are you getting the trace hit location if you're just using the rotation's forward vector to spawn it? I'm not entirely following ๐Ÿ˜›

obtuse zinc
#

Well I'm basically using it to see if I'm aiming at something, and if I am then I set the rotation to be the rotation between the spawnpoint and the hitlocation, otherwise I'm just shooting it in the direction that my character is facing

#
// Returns true if hit something, and HitLocation is pass by reference
if (PC->GetSightRayHitLocation(HitLocation))
        {
            // Setting up the rotation and location of the spawn point for the rocket
            Location = GetActorLocation() + (GetActorForwardVector() * 100);
            Rotation = (HitLocation - (Location)).Rotation();
        }
        else
        {
            // Setting up the rotation and location of the spawn point for the rocket
            Location = GetActorLocation() + (GetActorForwardVector() * 100);
            Rotation = GetControlRotation();
            Rotation.Pitch += 1.f;
        }

        FTransform ProjectileTransform = FTransform(Rotation, Location);

        ServerFireProjectile(ProjectileTransform);
#

And those logs are printed immediately after spawning the rocket on the server and on the client. The rotation of the rocket is the same in both circumstances, but when it sets the velocity of the rocket, they are different for some reason

#
MovementComp->Velocity = ShootDirection * MovementComp->InitialSpeed;

ShootDirection is the "CLIENT/SERVER ROTATION" log above

brittle sinew
#

Where are you getting ShootDirection from? If it's calculated on the client, it should be the same on the server...?

obtuse zinc
#

Yeah ShootDirection is calculated on the client, and it's the same on both the client and the server

FVector ShootDirection = ProjectileTransform.GetRotation().GetForwardVector();
brittle sinew
#

Where is the location coming from then, the ProjectileTransform? If you're just taking the client's value, it would be odd if it was just different on the server

obtuse zinc
#
// Returns true if hit something, and HitLocation is pass by reference
if (PC->GetSightRayHitLocation(HitLocation))
        {
            // Setting up the rotation and location of the spawn point for the rocket
            Location = GetActorLocation() + (GetActorForwardVector() * 100);
            Rotation = (HitLocation - (Location)).Rotation();
        }
        else
        {
            // Setting up the rotation and location of the spawn point for the rocket
            Location = GetActorLocation() + (GetActorForwardVector() * 100);
            Rotation = GetControlRotation();
            Rotation.Pitch += 1.f;
        }

        FTransform ProjectileTransform = FTransform(Rotation, Location);

It's all jsut coming from the client. And the rotation value is the same for both, but when I shoot the projectile they go in different directions lol. Maybe there's a weird collision thing happening?

brittle sinew
#

Well, the logs you posted showed two clearly different locations, when are you logging that? From the client's info or from after it's spawned?

#

Because that wouldn't be a collision issue if you're just logging the info that came from the client ๐Ÿ˜›

ocean dust
#

Alright, I got Steam lobby hosting working correctly and was able to get two instances of my game to connect

#

BUT

#

When I attempt to change maps using ServerTravel

#

Only the listen-server travels

#

and the BeginPlay for their resulting PlayerController does not run

brittle sinew
#

Are you using seamless travel? Someone else was talking about Steam not connecting clients to the next map

ocean dust
#

Is there another way to move between levels in Steam multiplayer?

brittle sinew
#

And if so, the PlayerController not running its BeginPlay is intended behavior

ocean dust
#

Yes, I'm using seamless travel

#

Wait what

#

Ah, seamless travel does not run Begin Play?

brittle sinew
#

Specifically for the GameMode and PlayerControllers, they persist

ocean dust
#

Well crap