#multiplayer

1 messages Β· Page 549 of 1

winged badger
#

GetOwner

#

but that works only on server

shy kelp
#

im using interfaces instead

winged badger
#

accessing a controller via playerstate via gamestate

#

definitely sounds like you're doing something you shouldn't be

shy kelp
#

yh i realized that now lol

#

i access the playerstate in the playercontroller, calling it from there now

elfin tartan
scenic gull
#

Hi there. Dumb question: But how do i switch maps in a local mulitplayer session without using seamless server travel? I want to test my multiplayer functionality within the editor and not on two machines which using the steam online subsystem.

winged badger
#

you don't

#

seamless travel does not work in PIE

scenic gull
#

Yeah i know. That was my point. So how do i switch maps then without clients getting disconnected from the session?

chrome bay
#

You can't, you have to test outside editor

#

Steam itself doesn't allow for two connections on the same machine anyway

scenic gull
#

I know that too. I just wanted to know if there is any way to test my functionality when switching maps (e.g. Lobby to Battle Arena 01) in the editor. But ic, it's probably not possible...πŸ™„

chrome bay
#

You could play "standalone", that should work with the default net driver AFAIK

#

but new editor window and PIE still don't work that way IIRC

slate veldt
#

@supple vapor Oh my! I'd completely forgotten about that function! I recall using it now - thanks for reminding me 😎 I'm a fool! haha

vernal light
#

@scenic gull it is advisable to use seamless travel and use stand-alone editor

#

But make sure to make a travel map if your lobby is very big

#

The travel map should be empty

#

This would reduce strain on the CPU

#

And make everything run more smoothly

#

Seamless travel means the clients does not disconnect whiles non-seamless means clients would disconnect from the server and reconnect which can bring sometimes complex issues

gusty slate
#

Is it possible to find stats about how saturated the server currently is? With RPC calls and such?
I am trying to implement physics movement replication and I would like to know if the server will be able to handle 5-10 players

rose egret
#

how do I get UChannel of a Actor on server ?

gilded vapor
#

Hi, I just started working on adding multiplayer support.

Can anyone comment on the effects of network-prediction (specifically using GAS)?

Is network-prediction more or less a standard or is an option?

winged badger
#

GAS has it more or less integrated

#

and its required before you can call your game production ready imo

sweet marsh
#

Hi guys, are there commands to adjust the packet loss etc in the editor? I have tried a few but nothing seems to happen

#

PktLag etc

#

trying something like Net PktLag=0 in the console seems to do nothing

potent cradle
#

Does anyone know how an RPC call can cause the client to be called "-2"? This is from a print done after a RunsOnServer RPC

#

Aha, it seems like this happens when you run an RPC from something isn't capable of having RPCs, like a widget.

gusty slate
#

I personnaly tested PktLag

#

and it does work

sweet marsh
#

@gusty slate Hi shinzo, i tried following that but not sure if it changed anything, are there any confirmations on screen or any other things i can do to see the change?

gusty slate
#

There is Stat Net

#

there are many information in there along with Ping

sweet marsh
#

thanks

sweet marsh
#

Hey guys, when it comes to replication for components OnBeginOverlap etc.. how does this work exactly, i assume that flagging the component to replicate will mean that it will automatically handle this for the server and clients?

chrome bay
#

Overlap events aren't replicated, that's just done locally

#

Flagging the component to replicate just means that it's replicated properties will be replicated, and it will handle RPC's

crude coral
#

hello guys! i need help for push my didicated server in the docker desktop because i will use Kubernetes+ Agones from google cloud server services for hosting my dedicated game servers...NB : my game multiplayer for (android)

humble zealot
#

just wondering how i'd go abouts creating a "Killed by X"

eternal igloo
#

Hi! Would anyone have advices for me on a good way performance-network wise to get all players positions and get feed that to some material. I need a black and white map of their positions. Thanks!

sweet marsh
#

@chrome bay Thanks for the info, so if for example i am doing a check one characters fist overlapping another character, would i have to do anything for this to network correctly? Imagine i send the GAS an activate message when this happens.

open quail
#

yeah, you would send a message to the clients announcing what happened

dark edge
#

@humble zealot Send X when doing damage.

#

Instigator is a good thing to use.

sweet marsh
#

thanks guys, i assume that's if the overlap occurs on the server i.e. HasAuthority()

#

but what happens if its the client?

tame linden
#

@sweet marsh That depends on your implementation. By default any overlap events will occur both on the server and on the client, but independently. So the proper way to handle that is to play any visual effects on overlap, but afterward use "Switch Has Authority" and then do stuff that is gameplay critical (e.g. doing damage) when it has Authority.

fringe dove
#

what is a net index and where is it used?

#
    void BuildFromNetIndex( int32 StaticNetIndex )
    {
        Value = (StaticNetIndex << 1 | 1);
    }

    int32 ExtractNetIndex()
    {
        if (Value & 1)
        {
            return Value >> 1;
        }
        return 0;
    }```

(From FNetworkGUID)
tame linden
#

It's important to note that just because the overlap happened on the server, doesn't mean that it'll happen on the client or vice versa.

fringe dove
#

I don't see anywhere in the code ever call BuildFromNetIndex or ExtractNetIndex

tame linden
#

@fringe dove This is just a guess, but in order for things to be replicated by Unreal, they need a number to refer to the same thing, so the net index is likely the number they use to talk about entities

fringe dove
#

I thought FNetworkGUID was the number they used though

tame linden
#

I'll see if I can find a reference somewhere one sec

fringe dove
#

I think the 'Static' may be a hint it is for map objects?

sweet marsh
#

@tame linden thanks Dave, i was wondering how that would work with GAS as well, would I still need these checks when sending a gameplay event as GAS should check for this right? It’s a little hard to figure out as technically the overlaps occur from a character, and his movement is replicated by the movement component so technically the overlaps of his fists should be fairly accurate.

tame linden
#

FNetworkGUID is the structure they use to wrap the number it seems. So once Unreal gets a packet saying "I have object # 31313" they can use that to construct an FNetworkGUID

fringe dove
#

looks like in FNetworkGUID::Make:

#
CORE_API static FNetworkGUID Make(int32 seed, bool bIsStatic)
    {
        return FNetworkGUID(seed << 1 | (bIsStatic ? 1 : 0));
    }
#

so I guess if it is a static actor in the map, the least significant bit is set to 1

#

and the 'NetIndex' or 'StaticNetIndex' is the guid shifted right by one, if and only if it is static

tame linden
#

@sweet marsh Honestly not sure about GAS, I haven't really used it much. Generally I'd say you shouldn't risk it and you should pretty much always do the "Switch Has Authority" thing for critical stuff that should only be done by the server. Otherwise it can lead to desyncs and stuff. For example, if OnOverlap you spawned a replicated object, the server would spawn one (which would be replicated), but so would the client (locally only) so the client would see 2 copies but everyone else would see one copy. Whatever GAS function you're using may be Authority only though which solves this, you can tell because it has a lightning bolt symbol on it in blueprints.

fringe dove
#

basically though, I'm trying to refer to an object in an RPC that may not have been replicated yet; can I pass FNetworkGUID in the RPC instead of the object pointer (which may end up null on client)?

#

and then lookup that object from the GUID once it replicates

tame linden
#

@fringe dove I think you have that mistaken slightly, I think the net index is always shifted left one (to make room for the static bit), unless I've got my operator order mixed up πŸ˜›

#

Oh dude I would LOVE to have that ability, I have no idea if that's possible, but I could definitely use that πŸ˜›

#

TBH not that big a fan of Unreal's networking system because you can't tell when anything will be ready to use (networking wise) :/

fringe dove
#

the guid is shifted left (to add the bit), but the index is shifted right (to remove the bit)

tame linden
#

Ahh I see what you mean

fringe dove
#

lots of stuff could benefit from async continuations

#

where you could say "don't do this until everything needed is replicated"

#

but preserve all this context

tame linden
#

Do you have a function for taking an FNetworkGUID and getting the corresponding object?

#

Like a function name or whatever in the engine?

fringe dove
#

I'm not sure, I guess that's what I'm looking for next

winged badger
#

you can lie to the engine and convince it the actor is loaded from the package

tame linden
#

@winged badger Whaaaaat? What do you mean by that?

fringe dove
#

Engine/Classes/Engine/PackageMapClient.h
238:    UObject *               GetObjectFromNetGUID( const FNetworkGUID& NetGUID, const bool bIgnoreMustBeMapped );
269:    TMap< TWeakObjectPtr< UObject >, FNetworkGUID > NetGUIDLookup;
416:    virtual UObject *               GetObjectFromNetGUID( const FNetworkGUID& NetGUID, const bool bIgnoreMustBeMapped ) override;```
winged badger
#

we spawn a procedural level on each machine separately, with matching names

fringe dove
#

is 'PackageMapClient' only for looking up static guids from the map?

winged badger
#

override IsNameStableForNetworking and IsFullNameStableForNetworking to return true for prefab actors

#

we set bNetStartupActor and bNetLoadOnClient true manually

dry turret
#

hey, i'm having issues with characters not getting attached to vehicles upon entering them or even getting detached due to netcull. is it reasonable to crank it up so that all ~24 players are always replicating on a 8x8km map?

winged badger
#

and those actors, when replicated map ther NetGUIDs and replicate just fine

tame linden
#

Huh interesting! I'll definitely need to look deeper into IsNameStableForNetworking!

#

@fringe dove Honestly not sure

winged badger
#

takes about 10 seconds to get full net addresable level with 33k actors and 2,2k replicated actors

#

all networked and working

fringe dove
#

so that's basically for procedurally generating static guids?

#

for a kind of deterministic level layout

winged badger
#

we are not generatign GUIDs except to resolve actor to actor references on the level

fringe dove
#

but the stuff on the level itself is procedurally generated at runtime?

winged badger
#

we do not manually create NetGUIDs

#

it is, from blocks

glad wharf
#

that's very interesting! so basically if the name is considered stable for networking, it will be used instead of a generated GUID allowing procedurally generated actors on client and server to "connect"?

winged badger
#

and within blocks, a door and a door terminal will be linked

#

for example

#

name stable for networking gives you net addressable actors, ofc if you don't match names exactly, clients get booted

#

we replicate a seed to spawn the level from

glad wharf
#

sorry for this newbie question, but is "being net addressable" the same thing as "replicating"? Or is it more low level?

winged badger
#

we set bNetStartupActor and bNetLoadOnClient true manually this part convinces the engine those actors are static

#

and if a client receives a static NetGUID for an actor it doesn't have yet, it will assume it didn't get around to spawning it yet, and queues it up for lalter

#

it is not

#

net addressable = pointer to an object can be resolved over network

glad wharf
#

ah ok I see, thanks for these explanations it's super useful

winged badger
#

all actors loaded from the package

#

are net addressable by default

#

because they have their implementation of IsFullNameStableFOrNetworking returns true, and they are guaranteed to have matching names from the package

glad wharf
#

I see, makes sens

fringe dove
#

what's the "NetPushId"?

vast forum
#

Hey all you smart people. I'm trying to set some Widget data from cpp code. The issue is that since the server doesn't draw its own widget, i'm having trouble figuring out how to make it work.

Singleplayer is working fine, but as soon as I run the dedicated server, everything breaks, and GetUserWidgetObject is returning nullptr.

glad wharf
#

yes dedicated server cannot access widget and UI stuff it's considered client only as the server has a null renderer

#

you should be able to rethink how you organize your code, your UI should not be necessary for the server to work

fathom cove
#

Hi,

I am still quite new and have messed up a setting that I can not find anymore.

I think I have set the bones to not replicate their positions over the net to save some performance following some video a long time ago. Now I can not find it anymore. I might totally be miss remembering so this is kind of a long shot type of deal πŸ™‚

sweet marsh
#

@tame linden thanks for the information Dave I’ll have a look into it tomorrow.

wise depot
#

does PostLogout get called when a server travels for everybody who is travelling with it or only when a player disconnects?

#

i seem to recall seeing in the past that its called when it travels

chrome bay
#

Anybody used the SocialToolkit system at all?

halcyon totem
#

is there a difference in performance with multicast vs multicast reliable?

#

I am trying to get my equip and unequip working, I have it working like this, but they say using multicast will cause performance issues in the future and to not use it. is my code ok? Im new to this but it only seems to work like this, is there any way else to do it so it doesnt use multicast so I can save on performance?

shy kelp
#

im using a varest and sending a post request. I cant tell what im missing, i used a normal html request on this php, and it worked fine. so ik its in the code

#

note: i originally used a get request and the output was fine

somber glade
#

are there any guides on setting up an ad-hoc connection for doing local multiplayer say between two phones or tablets?

atomic wing
#

Has anyone encountered an issue where your Game and your dedicated server have different steam appid's?

floral crow
#

Sorry to ask this again, but why would a PlayerController from LevelA not be destroyed after a SeamlessTravel from LevelA to LevelB?

thin stratus
#

Same PlayerController class in both levels?

#

@floral crow

floral crow
#

No, different classes

#

Even BeginPlay is called on the old PC, and it throws errors because it's state is HasBegunPlay

thin stratus
#

Happened only recently?

#

Same GameMode parent classes? Also not mixing child and the Base version for GameMode and GameState?

wise shale
#

Hi guys! Im sorry to bother you all. I'm having an issue and there's no much information online, been trying to figure out this. I'm doing the Blueprint Multiplayer Tutorial Series by unreal engine in 4.25. Im using this node for my hosted server ( im the server admin) Event OnPostLogin but it's being called 4 times and it's creating me 4 different players. I'm using the Switch Has Autorithy node but that node is also being called 4 times on my end, so im getting in a server with 4 pawns instead of only one, been stuck with this for almost 2 hours and I'm not really sure what the issue is, if im the server, there should be only one player connected to the server right? Correct me if I'm wrong and thanks in advance!

wicked brook
#

@wise shale do you have a default pawn set in game mode?

swift kelp
#
UHealthComponent::UHealthComponent()
{
    PrimaryComponentTick.bCanEverTick = false;
    SetIsReplicated(true);
}

I get an error by UE4
SetIsReplicatedByDefault is preferred during Component Construction.
even though I have it set in the constructor
Any ideas for a fix?

wise shale
#

@wicked brook Yes I do

wicked brook
#

that prob y

#

set to none

wise shale
#

@wicked brook I set it to none on the map world settings and in the project settings, the Event OnPostLogin it's still being called 4 times

wicked brook
#

how many clients you running?

wise shale
#

only one

#

And im running it on standalone version, and using the project file/launch game

#

And im still getting the same issue

#

The RespawnPlayer is where the actor is spawned, and it's being called 4 times

wicked brook
#

add a counter to your post login and print string to make sure. I had some other stuff spawning i had forgot about one time

wise shale
#

Still the same

#

This is how I added the counter just in case

#

How do I make sure im only running one client, just to scratch that out

wicked brook
#

try printstring each new player also see what it shows

wise shale
#

That's the name of the default controller

wicked brook
#

hmm

#

do you have a loop somethere creating the player controllers?

#

one thing you can try also is start from post login and detach everything behind. then run the print strings. See if it still does 4 times. If not move down the line til you find it

wise shale
#

The one that is starting everything is that Event, the Post Login

#

I have this as a player controller class, but I dont think that has anything to do with it

#

there's no loop, Ive detached everything that resembles any kind of loop

#

and it still gives me 4 players

winged badger
#

@wise shale that usually happens when you manually go and execute logic that engine does on its own, without disabling the engine code

#

for starters, don't use PostLogin for spawning players, it works only after hard travel, use HandleStartingNewPlayer, which executes after both seamless and hard travel

#

HandleStartingNewPlayer also calls RestartPlayer() in its default implementation, so you can override it without calling Parent and not have to put your default pawn class to none

#

EventPostLogin is a function on the GameMode, so any authority checks there are redundant, its always authority

wise shale
#

Hi @winged badger ive tried to use event handle starting new player but im still getting the same result, it's being called 4 times

winged badger
#

its called once per connecting player, unless you did something unspeakable

#

connecting player includes the listen server host

#

and all clients

thin stratus
#

That's the freaking ue4 lobby tutorial

#

High changes that they indeed did something unspeakable

#

Tired of mentioning how bad that tutorial is

#

Replicated PlayerController Array in the fucking GameMode.

fallen pawn
#

switch has authority in a gamemode

#

(gamemodes only run on the server for those that dont know, making that switch pointless)

chrome bay
#

That's in the official tutorial? I sort of want to be sick in my mouth.

fallen pawn
#

some of the older official template projects have even worse stuff than that

chrome bay
#

MP isn't easy at the best of times.. won't help if there's a bad foundation there :/

fallen pawn
#

once you get into it, you'll find out that Unreal4 multiplayer is one of the easiest multiplayers to get up and running

chrome bay
#

for sure

sweet marsh
#

Hey guys, do you have to set replicates on ACharacter or is this done by default?

#

More over how exactly does the client / server behaviour work, for example, I'm a client and i punch another character (the server) the BeginComponentOverlap is fired and an impulse is applied to the server. Now should this code be wrapped in a HasAuthority() ? Does this mean that whenever a client fires a BeginComponentOverlap the server will confirm that the overlap happened? Or would it actually mean that the code does not run at all on a client, in which case how would you actually handle a client firing that method as the resulting punch from them is important.

#

Apologies for asking a fairly simple question, just attempting to get my head around this

thin stratus
#

Overlap events aren't really "replicated" in that sense.

#

If you have an Actor replicated to Server and Clients, then its Collision Primitives are also existing on everyone.

#

If you now have a second Actor that is also replicated to Server and Clients, with Collision, and those Collision Primitives overlap, then this happens on every instance.
So it executes on Server and all Clients.

#

Using HasAuthority would then only be used to discard either authority or non-authority executions.

#

There is no confirmation happening

#

@sweet marsh

#

Note here though: Authority does not always mean Server. It can be that you always use it in a scenario that results in the server being the authority, but that doesn't mean that this wouldn't return true elsewhere for non-server,.

#

If you want to filter for the exact player who's owning the character that performed the punch, then you can filter for "isLocallyControlled"

sweet marsh
#

I see, so would there be a reason why some of the hits seem unreliable in my game, for example on client 2 every punch lands where as on Client 1 only 50% seem to? Ahh ok thanks

thin stratus
#

But then you still need to send the data to the server, as you actively block their call for everyone but their own character

#

No, that should not be the reason

#

If Client 1 and Client 2 perform the same thing in a 0-ping and 0-packageloss environment, then it should be the same result 99% of the time

#

1% counting for floating point errors and such shite (which is much lower in % but well)

sweet marsh
#

Hm ok, not sure why that is happening then. I am using GAS, and also notice that my custom task sometimes fails to finish as well, e.g. it adjust characters movement speed and then doesn't reinstate it,

#

anyway will continue looking into it thanks @thin stratus

crude coral
#

i have question freinds! for mobile multiplayer is the same steps like pc games multiplayer or i need others steps and methodology? my Android game app alpha version in the store

vestal thistle
#

Hello, we are a small indie team that has hit a huge roadblock setting up our Dedicated Multiplayer server (which runs on playfab) game up on steam. this is some of the issues we're getting.

LogOnline: Display: STEAM: Loading Steam SDK 1.42
LogOnline: OSS: Creating online subsystem instance for: Steam
LogOnline: STEAM: [AppId: 0] Game Server API initialized 0
LogOnline: Warning: STEAM: Failed to initialize Steam, this could be due to a Steam server and client running on the same machine. Try running with -NOSTEAM on the cmdline to disable.
LogOnline: Display: STEAM: OnlineSubsystemSteam::Shutdown()
LogOnline: Warning: STEAM: Steam API failed to initialize!
LogOnline: Display: STEAM: OnlineSubsystemSteam::Shutdown()
LogOnline: OSS: Unable to create OnlineSubsystem module Steam
LogOnline: OSS: Creating online subsystem instance for: NULL

If anybody has any knowledge on how to properly troubleshoot this, or has had experience please contact me! I am looking for a consultant to help my team out!! Pleassee thank you!

supple vapor
#

@vestal thistle do u have steam running on your dedicated server?

floral crow
#

Same GameMode parent classes? Also not mixing child and the Base version for GameMode and GameState?
@thin stratus I have the same Base class for GameMode GameState and PlayerController, but different inherited classes for Lobby and InGame.

Structure looks like:
ACustomGameModeBase : public AGameModeBase
ACustomGameState : public AGameStateBase
ACustomPlayerController : public APlayerController

Then for each mode Lobby and InGame there's a separate inherited class (e.g. LobbyPlayerController : public ACustomPlayerController and InGamePlayerController : public ACustomPlayerController)

thin stratus
#

Pretty sure you, overall, want the AGameMode and AGameState

#

The Base versions are more for very simple non-multiplayer games iirc

floral crow
#

Hmm, that decision was taken a while ago by other people so I'm gonna investigate that

#

Reason they took it is because we're building an RTS game and most of GameMode and GameState built in things apply to FPS or Fighter games

wise shale
#

Hey guys, does the execute command ServerTravel Map_XXX works in UE4.25.1?

foggy idol
#

How do I set the camera rotation and base aim rotation on ai so their looking in the right direction

#

I heard set focus is supposed to do this but it doesn't work

swift cargo
#

Hey guys, This is my blueprint for the server applying damage to a target player. it doesn't really work, as in the only way the server updates the health is when i tab in to the window really fast back and forward and shoot really fast.
Why isn't it updating as expected?

#

I have to actually tab in, tab out, tab in and CLICK CLICK CLICK for it to print a change in value for the health..

foggy idol
#

@swift cargo does it happen with other variables or just health

#

And have you tried doing it by using the apply damage function ?

swift cargo
#

@foggy idol Only "Health" and i've tried using apply damage before but i think its the same result.

foggy idol
#

Try using a different float to see if it gives that same. Problem

#

If it doesn't then it might be a bug

#

@swift cargo

swift cargo
#

What do you mean by different float?@foggy idol

foggy idol
#

Like make a new float ant name it test then set it to replicate

#

Then use that in place of the health variable and see if it works

#

@swift cargo

swift cargo
#

How would that change anything? @foggy idol

#

you think its broke Because the names are the same as other things?

#

Renaming didn't do anything.

foggy idol
#

I think the variable might be broken or something

#

And I'm not saying you should rename

#

I'm saying you should make a completely new variable @swift cargo

swift cargo
#

Attempting

#

no, it didnt work. @foggy idol

grave ermine
#

I'm having some issues with event copy properties in the player state. I can get it working just fine with a float or linear color variable, but it will not copy a class reference on the client.

foggy idol
#

I'm sorry @swift cargo I'm all out of ideas

swift cargo
crude coral
#

@swift cargo why not try onrepnotify for your health variable?

swift cargo
#

@crude coral I'm not sure how to use that. i know how to start it but i dunno what to do with that.

crude coral
#

ok wait i will send you example and i think will work with you

swift cargo
#

ok thanks

crude coral
#

i need open just my project example where i have it so please wait me for open my project example

swift cargo
#

mhm

crude coral
#

so the problem for you is the health of the client not update? is that?

swift cargo
#

Its hard to describe, basically it doesn't always update the health value for anyone. it only sometimes works when i tab IN and OUT really fast while clicking to fire.

crude coral
#

you testing with dedicated server? and 2 players?

swift cargo
#

Yes. and also without Dedicated Server.

#

Its the same effect.

crude coral
#

i can see the event ?

#

all the event and not just the call for deal damage

#

because i think is authority issue

#

for server dealdamage event you need call applydamage event and not set the health variable

swift cargo
#

@crude coral

crude coral
#

your linetrace event replicated and run on server or is simple event?

swift cargo
#

im so confused

#

i dont know where to even begin

crude coral
#

the picture you send it to me is for the linetrace yes?

swift cargo
#

yea

crude coral
#

ok so the start event of all this picture you send to me is envent replicated or no?

swift cargo
#

Yea it is.

crude coral
#

this where my line trace and the start event is replicated and run on server

#

now you see my other picture about (health setup)?

#

try to do the same setup with health repnotify and you not need to do anything with the repnotify function just leave it empty

swift cargo
#

im happy your helping me, but i think im figuring it out right now. ill use your pics as reference though.

crude coral
#

and create event like i do (modifyplayerhealth and add after it has authority

#

nice!

#

@swift cargo is ok now? you figure it out?

swift cargo
#

i got the Server to actually deal damage, but i need to make the client able to deal damage as well.

crude coral
#

yes Chase! send me message when all fine πŸ™‚

#

and sorry for my bad english πŸ™‚

swift cargo
#

it's okay.

#

When the player is the Server it works, when the player is the Client it doesn't work. i dont know how

#

@crude coral

#

The auth doesn't make a difference btw.

crude coral
#

but you not do like i send you from the first picture

swift cargo
#

i know.

crude coral
#

try make the same and will work because it work for me

#

with dedicated server and without

#

where you have the linetrace you call the replicated event you do it and not the unreal event (applydamage)

#

because the unreal event(applydamage run just on server)

swift cargo
#

I got it to work.

#

It is REALLY messy.

crude coral
#

good!

#

happy for you

swift cargo
#

Thanks for your help.

#

but i have to fix this spaghetti

crude coral
#

ah ok you link authority when is server and when client

#

but you can make new event for be more clear and not spaghetti πŸ™‚

#

and your variable health can make it onrepnotify if you want fire others events when health changing

swift cargo
#

How do you add the circles to the lines?

#

Like dots

crude coral
#

with capture is windows application

#

ah! sorry you mean the line between events and variables??

#

just click two time

#

on the line

swift cargo
#

ahhhh

#

thank you.

#

lol

crude coral
#

lol

#

is good for fix spaghetti

swift cargo
#

Indeed

crude coral
#

@swift cargo have nice time and welcome always

warped stream
#

I will never understand how people can live with blueprints that are not organized readable (Atleast as readable as blueprints can get)

#

Triggers my programmer asperger syndrome every time

crude coral
#

@warped stream hi yes for blueprint need allways organize them because easly be chaos

#

guys anyone have idea how add image of unreal dedicated server to docker desktop for create container and then push it to kubernetes+ agones?

#

i look for some help 5 days now and in this 5 days of looking for help i help 3 persons lol but can't help my self😫

wise shale
#

Im poping a qeustion I asked before, so the Execute Console Command (BP) using the command servertravel Map_XXX is working un ue4.25.1? Im not able to use it and sometimes my client + server crashes

wicked brook
#

@wise shale it works for me. You have to make sure the map is set up as server build for it to work i think

fossil veldt
#

How can I call a Server RPC from the Client PlayerController to the GameMode and then have the GameMode return data back to the Client PlayerController? I notice you can't have return functions on an RPC

#

Do you have to use delegates for this or something?

shadow aurora
#

Think it got lost up there, but does anyone know of any guides for replicating attached UActorComponents? I'm having trouble getting mine to replicate its variables. Running on 4.25

thin stratus
#

@fossil veldt Use a Client RPC on the PC

#

@swift cargo you should not use Get Player Character

#

You will always get the Servers character behind the authority check

#

Same with get player controller

#

You are already in the character bp

#

So pass "Self" for the character

#

And use "GetController" and cast it to PlayerController for the Player Controller

#

@wise shale Should work just fine

wise shale
#

So this should be working right?

#

or servertravel needs to have some capitalization

fleet raven
#

disconnect the specific player pin

wise shale
#

This is what im doing, (im only running the 0 integer for testing)

crude coral
#

i have 3 map : main menu map, transition map, and the game play map...and what if i want the main map be run on server like the game play map too? on unreal project settings for maps there is just one default server map not two!

light fog
#

dont know how events work 100% on ue4 networking but when i use the same event to respawn 2 players with nearly no time between, the first respawn doesn't completely finish as the second one is triggered changing some of the events variables. How can i make it so each time an event is triggered on the server it cannot be overwritten before it is finished or is "independent"

empty matrix
#

Hey, how are you? How can I make a character selection system replicated on the server, in this case a Multiplayer?

light fog
#

In this video we create the visual layout of our Character Selection screen that can be accessed by both Clients and Servers inside of our Lobby Menu. This allows us to choose between 8 different characters as well as default to a null selection. By the end, we test out that w...

β–Ά Play video
#

This series at least for me was a bit all over the place so if u get frustrated watching them im sure u can find a forum on ue4 to help you. If u still cant do it then pm me and i can help you out πŸ™‚

crude coral
#

@light fog : you have idea about docker , kubernetes and Agones for hosting unreal dedicated server?

empty matrix
#

@light fog: I've already done this tutorial ... But it never worked the way I wanted. Can you help me?

light fog
#

dont know what any of them words mean hahaha. Im working on listen servers atm so can only help out with that sorry πŸ™‚

#

@empty matrix yeh just give me a call whenever im free now πŸ™‚

empty matrix
#

I'm brazilian

#

I'm not very good at English

crude coral
#

@light fog : thank you!

light fog
#

@empty matrix No problem man πŸ™‚ Just dont really like messaging too much back and fourth questions

#

@crude coral Np sorry couldnt help out

crude coral
#

@light fog i think you know AWS gamelift..so if yes Kubenetes + Agones is other solution for game server from google cloud like the AWS gamelift from amazon

light fog
#

hmm how come you decided to go for ageones?

#

theres a lot of documentation on aws and even good youtube tutorials

crude coral
#

is more easy than AWS gamelift

#

the new Apex legend use that

empty matrix
#

Hey, how are you? How can I make a character selection system replicated on the server, in this case a Multiplayer?

crude coral
#

@empty matrix : i can send you link from youtube will show you step by step a character selection system for multiplayer if you want..because what you ask can't get it with messages here

empty matrix
#

Yes! Send it to me

crude coral
#

ok

empty matrix
crude coral
#

i send you the link in private message

forest glacier
#

so hey everyone

#

I'm trying to make my character controller and pawn controller multiplayer-ready

#

I don't understand why my server (aka the editor) sees my second player rotating but the controller doesn't rotate in game for the other players

#

the server pitch and yaw are replicated

#

the clients also have the correct variables, so they are correctly "applied"

#

but my floating hands don't rotate and move :c

empty matrix
#

i send you the link in private message
@crude coral Okay

steady briar
#

its widget related but i think its a multiplayer question... basically im trying to make a targeting widget that when i trace someone it turns its display on, if i look away it turns it off. i have the tracing working, but it can only seem to turn its display on. also... the reason i think its a multiplayer question is if a client looks at an enemy and it turns on the widget, it turns it on for the server, but not the client. i only want this to be client side, am i doing something horribly wrong? the widget is on the enemy class. im wondering if the better way is to make a widget on the player character and then attach it to the enemy its targeting? not sure though

winged badger
#

you are doing something horribly wrong

#

you're not keeping your widget logic completely local

#

and you turn it off by caching the target, so next time you trace if your new target != old target and old target is valid, you turn it off

#

when you play as a client, the server instance of your character has no business throwing around traces for the purpose of showing the widget

steady briar
#

right and i was pretty sure it wasnt

#

and ya i store the traced actor, if it changes i use an interface to disable that ones widget, enable it on the new traced actor. if i trace nothing, disable widget on the stored actor and then set it to nothing and do nothing with it

#

but should the widget be on the enemy or on the player?

winged badger
#

i prefer player, because then you need only one (provided a single one at a time is sufifcient)

#

with 100 or so enemies, the performance savings of them not having a widget component each are... significant

steady briar
#

i was thinking enemy so they could each have a health bar, and just have player target make their name display or something

#

i dont think ill have a hundred of them though

#

also, would it be completely stupid to make a 2 vert rectangle over the character (in the model) and have it a material value to fill it based on a material scalar? like faking a health bar with a couple polys. dunno, was just a dumb idea. not sure why my widgets hate me right now

winged badger
#

it wouldn't, an effective optimization

#

keep in mind its easier manipulating a widget then a shader

steady briar
#

i guess a lot of my problem is separating the server character from the client characters. it seems like if i want something to just run locally, it doesnt run at all on the server character

fossil veldt
#

Is it possible to send a const TMap reference over RPC? I know they don't replicate but I was wondering if they are okay to send like this?
const TMap<ACPlayerState*, FSomeStruct>& StructsMap

fleet raven
#

no

fossil veldt
#

ah okay, ty

red sand
#

Where is the option for Run Dedicated Server on 4.25?

winged badger
#

@steady briar thats what IsLocallyControlled is for

gusty slate
#

@red sand It is now listed as "As Client"

grizzled stirrup
#

Is it fine to increase your GameState NetUpdateFrequency to something like 30.0f if you feel OnRep properties sometimes aren't getting through in time?

fleet raven
#

it would not need any such silly limit if replication worked sensibly br_egg

grizzled stirrup
#

Do you mean I should be doing something better or that the replication system can be unreliable?

#

I have an OnRep enum that goes through MOST of the time but I noticed that sometimes on a real connection overseas it doesn't potentially because of other things going on at the same time, but it is the thing that enables UI for clients, so if it doesn't make it through, no UI is shown

fleet raven
#

OnRep should always be called

#

it might take a little longer sometimes but it does not get dropped

grizzled stirrup
#

There's a 2-3 second window in this case

#

And other things are getting spawned

#

I'm trying to figure out why though because it still should get called

#

I noticed with other actors simply bumping up the update freq works perfectly

#

Otherwise they can be dropped for multiple seconds

#

The bandwidth usage is nothing crazy either it feels like an artificial limit

fleet raven
#

it is an artificial limit, because unreal networking is made in an extremely stupid way

#

they try to reduce the cpu usage with this

grizzled stirrup
#

Oh I see! interesting

#

Any way to remove / lessen that limit?

#

Other than the usual bandwidth .ini limits

fleet raven
#

just set the frequency higher

grizzled stirrup
#

Ok will do on the gamestate

#

Thanks!

#

Wanted to make sure I wasn't doing something dumb and that's a fine thing to do

fleet raven
#

I wonder if we'll get push model but actually going all the wayℒ️ sometime

grizzled stirrup
#

The weird thing is that I have ForceNetUpdate() called on that property though

#

I felt that was a definite push that will get through now

#

But I guess not without a higher update freq

#

It seems it still prioritizes higher net priority actors even if there's plenty of bandwidth to go around

vernal light
#

For those who wanted the network character selection I think you can find it on the unreal engine official page on YouTube

shrewd tinsel
#

why does server not fire the event while multicasting?

#

the print "Hello" doesnt print

#

this is inside of player pawn

thin stratus
#

When do you call that ServerRPC?

shrewd tinsel
#

beginplay

#

nice

#

thanks

#

i guess the issue is ping right?

#

im more lost now actually

#

but you didnt even say anything

thin stratus
#

Are you filtering this call?

#

Cause BeginPlay calls on everyone already

#
  • BeginPlay is too early
#

BeginPlay calls before the Client has ownership

#

Because Possess happens afterwards

#

If at all you'd need to hook into the OnRep_Controller function via C++

chrome bay
#

Is there a way to restrict the Broadcast() call of a Dynamic Multicast Delegate to the delegates owner?

#

Or at least, it's owners class

shrewd tinsel
#

OnRep_Controller would provide me with an event which fires when pawn gets possesed?

thin stratus
#

It provides you with a point in time in which the Client's Pawn has a valid controller

chrome bay
#

DECLARE_EVENT() seems to mark the broadcast events as private members, only accessibly by the owner.

thin stratus
#

Which happens after possess

#

You can also use OnPossess in BPs

#

But that only calls on SErver end

#

If you need to pass the player name to the server, do it on connection

#

Half sure you can use ?name=XYZ in the connect string

#

Although if you only use BPs

#

And use JoiNSession

#

Then you won't get a chance to pass anything into that string

#

:D gg Epic Games and their BP Multiplayer shite

#

@chrome bay No idea. Also not sure what you are trying to do

#

:D

#

Never had the need for that I think

chrome bay
#

Haha well it's not strictly necessary, I'll just skip it

shrewd tinsel
#

check it

#

i fire this on beginplay

#

so i see no issue why that would not fire on server

#

cuz it works on everyone else

#

its so simple

#

and i still think it should work

thin stratus
#

i fire this on beginplay
so i see no issue why that would not fire on server

#

I just explained why

#

Needs owning connection

#

BeginPlay is too early for that

shrewd tinsel
#

too early to fire the rpc

#

or to set the variable?

thin stratus
#

RPC

#

"If Owning Client"

#

There is no owning client on BeginPlay

#

Only post possess

shrewd tinsel
#

thank you for the info

#

i think i need to sleep on it

#

i really dont want to put a delay node

thin stratus
#

You shouldn't

#

Delay is never the answer to this

#

Unless it's a frame issues and you delay by 0

#

But that's not the case here

shrewd tinsel
#

just need to find the way

#

da wai

#

u kno da way

thin stratus
#

"OnPossess" -> ClientRPC -> ServerRPC -> OnRep Name Variable

#

And in the onRep of that varibale you set the naem

shrewd tinsel
#

yeah man

#

thats what i was going towards

#

thank you

thin stratus
#

Acceptable BP only solution I would say

shrewd tinsel
#

very elegant

foggy idol
#

Is there any way to know if a player currently has a spectator ?

shy kelp
#

are there more optimized ways to search an array with thousands of variables, than a for each loop? i think a for each loop running multiple times for multiple different people with thousands of entries will lag out the servers real quick.

clear copper
#

I know you can get the player's steam name from their player state, but is tthere a way to get their steam avatar?

calm monolith
#

pls help my camera in game only goes left and right not up and down and my character wont walk straight

crude coral
#

for android multiplayer i upload the build of apk +main.obb for both the 32 bit and 64 bit and now my alpha app in the goodle play store and i download it from google play and test it with emulateur on my computer so the game working fine from the main menu i click the start play then transition level after that player spawn on the gameplay map (world coposition map) the player spawn in the lobby island is separated tile from the gameplay map and when the number of players begin 70 they all attached to big plane for choose the location where each player want go....i want know when the player in the main menu and click start play he need call the level name (gameplay map)or call the server IP(dedicated server) ? i hope you can undrestand what i mean...

#

i need some help for undrestand if android multiplayer strategy is the same for pc multiplayer (the dedicated server)

#

my game ready for google play store but what i need to do for the clients connect to the dedicated game server ( my dedicated server i want host it with kubernetes+ agones the google cloud game servers services)

neat stag
#

@clear copper If you use the advanced session plugin then you can get their avatar along with several other things

clear copper
#

i saw that one but i've heard people say you should avoid plug ins that aren't on the marketplace. makes sense, they were probably rejected for a reason

#

is that one reputable?

neat stag
#

@clear copper I have had no problems with it and it seems pretty widley used with multiplayer

clear copper
#

hmm ok

#

i guess i'll take a look at it

#

do you have the nodes/method i'd use to get the avatar and name from the plugin?

#

ah nvm i found something on it

#

ty

thin stratus
#

@shy kelp A TMap could be faster. That is hash based.

#

But only if the container is very big

shy kelp
#

Tmap?

#

What is that?

thin stratus
#

@clear copper Don't think it was rejected?

#

It exists for quite a while. You can't get the Avatar without c++

#

@shy kelp Just "Map" in Blueprints.

shy kelp
#

Oh ok

thin stratus
#

It's a Key, Value Dictionary basically

shy kelp
#

Isn't map a dictionary

thin stratus
#

Yeah

neat stag
#

@clear copper np

thin stratus
#

Has faster access time if it's bigger vs a huge Array

shy kelp
#

I don't see how that would work for searching tho?

foggy idol
#

@thin stratus I managed to do the spectator stuff you told me about

#

Thank you

thin stratus
#

You'd need to change it so you can just search by the key directly @shy kelp

#

@foggy idol Coolio

shy kelp
#

Oh

#

Ok

thin stratus
#

Unless that's not an option

#

idk your actual data

#

But if you just compare one specific part of the array element

shy kelp
#

It's a strict array

thin stratus
#

Then you can just put that as the key maybe

#

Ahhhhhhh

#

Hm

#

What exactly are you trying to achieve?

shy kelp
#

It's a struct array with player info and stuff to search in the gamestate

#

It's contains private messages and global, which is why it might get big

thin stratus
#

@crude coral This should be similar to PC networking as you'd connect directly to the IP of the Server or?

clear copper
#

@clear copper Don't think it was rejected?
@thin stratus I can't find it on the epic launcher am I missing it?

thin stratus
#

Otherwise, if it's ServerList based you'd need to use a subsystem that supports that or use google directly.

#

@clear copper No, sorry, I don't think it was ever submitted and thus never rejected or?

#

Like, I know the changes go rejected on source pull request, cause Epic wanted it to be a Plugin instead

clear copper
#

ah ok, i figured they would've tried to submit such a popular plug in

thin stratus
#

And it's free, so not sure why one would submit it to the marketplace

clear copper
#

lots of free stuff on marketplace, but it makes it easier to add to engines and keep updated i would imagine

#

idk lol

thin stratus
#

Yeah but that didn't exist when the plugin came out

clear copper
#

just what i had seen in some forums

crude coral
#

@thin stratus is question ?

thin stratus
#

Marketplace developed very slowly

#

@crude coral I'm not 100% sure, sorry. Check #mobile maybe? Networking is not easy, specially on lesser used platforms

#

Or let's say, "lesser discussed platforms"

crude coral
#

@thin stratus mobile tell me to check multiplayer lol

thin stratus
#

Yeah i figured

#

it's just not very often discussed here, if at all

#

I would guess you handle Mobile the same as PC if you want to connect to dedicate server?

crude coral
#

@thin stratus i want undrestand if peoples download my app from google play store and then click for play from the main menu so the call will be for the IP or calling just the level name?

thin stratus
#

Well what do you want to do?

crude coral
#

@thin stratus if peoples call the level name each player will have his own session i think and he will stay in the lobby waiting forever there and never the rest of the players coming (69 players) because each session need 70 player for the plane take them all to the locations

thin stratus
#

That is not how you do this stuff though?

#

You are talking about matchmaking or?

#

Where people queue up and then get matched together?

#

Either way, if you just do "open levelname", then people will just open that level

#

If you do "open <ipaddress of server>" then they will connect to the server.

#

But for that they need to know the server address

crude coral
#

@thin stratus i do the staff for multiplayer the game session need 70 player in the lobby for trigger the plane and attach all the players on it

thin stratus
#

And 70 players on UE4 is not easy to achieve?

#

Yeah then they have to connect to the server

crude coral
#

@thin stratus yes! so how can that happen and connect to the dedicated server?

thin stratus
#

What do you mean "How can that happen"?

#

There is documentation on how to connect to servers

crude coral
#

@thin stratus i mean if the game play map( default server map in unreal )included inside the client game so he will create session for him self just no?

thin stratus
#

Only if you actively code it to do that

#

That all up to you to code

crude coral
#

@thin stratus i run the dedicated game server in local with my computer and working ok...the problem i want that happen on the internet

thin stratus
#

Why is there a problem?

#

Buddy, you need to learn this stuff before making the game

#

You connect to Dedicated Severs either via session or via ip

#

This is pretty basic stuff, please read up on it

#

I won't explain the basics here

#

Connection via IP works the same on Mobile as it does on the PC

#

You need a backend for the DedicatedServer setup

crude coral
#

@thin stratus the game ready but i need push the dedicated game server on docker desktop for make container and push it to kubernetes+ Agones the google cloud game server services you undrestand me? possible do it?

thin stratus
#

Well yeah

#

open <ipaddress>

#

That's all you need

#

Get the IP of your server

#

and call open <ipaddress>

#

Clients will connect then

#

How you get the ip is up to you

#

e.g. open 127.0.0.1

fast mason
thin stratus
#

That will connect to the server

crude coral
#

@thin stratus i know how can get the ip but that will be sure the clients will connect to it?

thin stratus
#

That's how you connect to an ip, yes

#

@fast mason Do Server and Client have the same character movement speed?

crude coral
#

@thin stratus you have idea about kubernetes + Agones ?

thin stratus
#

no

#

Also, can you stop pinging me in every answer :D

fast mason
#

@thin stratus you just put me to think.. 1 sec

crude coral
#

@thin stratus yes the same movement speed

thin stratus
#

I didn't ask you

crude coral
#

@thin stratus ah ok sorry

thin stratus
#

:D stop pinging/tagging me in every reply

fast mason
#

hahah

#

yeah the thing is.. I have a AIController spawned server side and a Invisible Character following it in client side

#

checked, both have max speed 600.

thin stratus
#

Hm, not sure tbh

#

That setup is always a bit wanky

#

Epic's Character Movement is meant to be autonomous if you possess the character

fast mason
#

I still don't know how to properly setup a point and click multiplayer

#

its a big F

thin stratus
#

If yo ujsut control it via an AIController, it can't predict anymore

fast mason
#

is there any way to "properly" do this?

thin stratus
#

Not sure this works out of the box

#

Hm, not sure

#

Possess the Character and somehow fake the input via the normal AddMovementInput nodes

fast mason
#

I mean, NCSOFT did this with lineage and UE.. but maybe since they have their own server implementation..

thin stratus
#

You could have the NavMesh on the client too

#

ANd only use it for the path

#

And use the path info to guide your player by hand

#

Then you would keep the prediction stuff

fast mason
#

navmesh is on the level placed..

crude coral
#

for my problem i need some one have idea about Kubernetes + Agones and google cloud game servers services i think

thin stratus
#

Maybe, then go to their forums and ask there though

#

This here is the UE4 side of things

fast mason
#

I would change the "someone" for documentation xD

crude coral
#

but agones have plugin for unreal so sure is there some one can help

thin stratus
#

Yeah, the docs and the peeps who did the plugin

#

I have never had anyone here ask about this

crude coral
fast mason
#

@thin stratus do you think that I should go with a custom server approach or should I dig other ways to solve the point and click mechanic ?

#

effort appart

thin stratus
#

I would write down what the system needs to have, then check how UE4 works there and then try to solve it accordingly

fast mason
#

I'm working just with movement.. but this specific case doesn't work multiplayer out of the box

thin stratus
#

"custom server approach" is vague af

fast mason
#

haha yeah, oh that..

fast mason
#

ok, so finally fixed it disabling the smoothing network movement

empty matrix
#

Hello @everyone, how can I make a Solo, Duo and Squad system?

foggy idol
#

Is it possible to replicate the camera rotation to all players ?

swift cargo
#

I'm trying to use SAVEGAME info to have everyone in a server have their own name. have any idea how to do that? i can't get mine to work.

shrewd tinsel
#

is pawn being possesed on server?

serene meadow
#

I'm trying to use SAVEGAME info to have everyone in a server have their own name. have any idea how to do that? i can't get mine to work.
@swift cargo what have you done so far?

swift cargo
#

@serene meadow Client makes his own name in a text variable and saves it. when the client begins play they set a nameplate above their heads using their info, i make a custom event thats runs only on client but when the client joins the server the client sees his own name on the server player.

#

im really confused overall on what i should even be doing, im using tutorials but i dunno if something changed.

shrewd tinsel
#

@empty matrix you can make a variable of integer type named for example "team" and use it to check if the team is the same or different while doing damage for example

serene meadow
#

Hello everyone, how can I make a Solo, Duo and Squad system?
@empty matrix really depends on what do you want to implement on each mode

foggy idol
#

@shrewd tinsel I would but my allowance can't cover that

#

Any other way

shrewd tinsel
#

then you can

empty matrix
#

@empty matrix you can make a variable of integer type named for example "team" and use it to check if the team is the same or different while doing damage for example
@shrewd tinsel Have a Tutorial?

foggy idol
#

I mainly need it for whan players are spectating

shrewd tinsel
#

@empty matrix nope

foggy idol
#

Because the pitch doesn't work

serene meadow
#

@serene meadow Client makes his own name in a text variable and saves it. when the client begins play they set a nameplate above their heads using their info, i make a custom event thats runs only on client but when the client joins the server the client sees his own name on the server player.
@swift cargo maybe you can set a player name variable in the player state (wich will be set to the one in the save game) of each player on the server, that is replicated so it can show to other players

swift cargo
#

How do i do that?@serene meadow

shrewd tinsel
#

you can set camera's transform for everyone except the owner to the same of the owner, however, it would flicker, because it would refresh at the speed of the owners frames per second, like 60fps, so if other guy has 144hz he would see strange things, this is why you need interpolation, and interpolation is hard to do so i suggest spending 20 eur for very good plugin, it is really easy and you can do basicly everything with it

foggy idol
#

Oh wow

#

Aiit

#

I'll see

#

Thanks @shrewd tinsel

shrewd tinsel
#

yeah i needed the same exact thing

#

but i got that plugin for free when it was on free for the month event πŸ˜„

empty matrix
#

@empty matrix you can make a variable of integer type named for example "team" and use it to check if the team is the same or different while doing damage for example
@shrewd tinsel Could you record a tutorial and send it to me? it is very complicated

shrewd tinsel
#

yeah 150$

empty matrix
#

And I want to add a list of the same team on the HUD

#

yeah 150$
@shrewd tinsel hey, hard

#

Is there any other way?

foggy idol
#

@shrewd tinsel wait are you fr

#

If it was on that event then I probably have it

shrewd tinsel
#

tare you can actually make it with timelines so its smooth but it wouldnt be very precise

foggy idol
#

I made sure I got everything

shrewd tinsel
#

yeah dude

#

check it

#

it will save ur life

serene meadow
#

@shrewd tinsel hey, hard
@empty matrix i think he was talking to the other person

shrewd tinsel
#

i was talking to victor

serene meadow
#

oh ok nvm

shrewd tinsel
#

im using teams as integers right now in my project

swift cargo
#

@serene meadow I can make it work flawlessly with Get player name and shit like that but i want a custom name based off of save game stuff

shrewd tinsel
foggy idol
#

@swift cargo like once the player loads in you load and set the name ?

serene meadow
#

@serene meadow I can make it work flawlessly with Get player name and shit like that but i want a custom name based off of save game stuff
@swift cargo you can just switch the Get Player Name to a replicated variable that has the value of that saved name

swift cargo
#

im confused but ill follow.

foggy idol
#

If that's what you want > @swift cargo like once the player loads in you load and set the name ?
@foggy idol then you can just setup an event in the player controller to load the name then set it

empty matrix
shrewd tinsel
#

you can have any ammount of teams if you make a variable 'max teams'

foggy idol
#

Call the event in the player controller from begin play in the HUD blueprint

#

Because at that point the player has successfully loaded in

#

If you still don't understand I could show you an example @swift cargo

#

OMGGGGGGG

#

@shrewd tinsel I have it

swift cargo
#

@foggy idol Sure

foggy idol
#

The solution to all my problems was in my library πŸ˜‘ πŸ˜‚πŸ˜‚

#

Ok @swift cargo

#

Lemme just open discord on my laptop

swift cargo
#

My brain is so fried

#

i've been trying to do this for like 6 hours

#

its so simple

#

but its impossible for me to understand.

#

Why can't i just have custom player names based on a clients savegame variable?

foggy idol
shrewd tinsel
#

congrats @foggy idol

foggy idol
#

thanks @shrewd tinsel

shrewd tinsel
#

anyone know if i can replicate interface call?

foggy idol
#

@swift cargo are you using C++ if not then i suggest Getting the Advanced Sessions Plugin

#

this is in my Player controller . I Used on Posses so i could store the name in the player even if the character dies and respawns

#

@shrewd tinsel c++ or Blueprints?

#

C++ interface's Confuse me but i can do BP

swift cargo
#

From BeginPlay

#

Event

#

Both dont work.

foggy idol
#

@swift cargo are you using C++ if not then i suggest Getting the Advanced Sessions Plugin
@foggy idol I Said this because you would also want to set the player name in the player state but it can only be done through c++

swift cargo
#

i am using the advanced sessions plugin...

foggy idol
#

Your calling it in the characters begin play

#

i used the begin play in the HUD BP because it isnt called until the player is done loading

swift cargo
#

What do you think i should do?

foggy idol
#

the one in the character could possibly be called before that

#

make a variable in the player for the name

#

then set it from the player controller on posses

swift cargo
#

??

foggy idol
#

wait lemme do it then post screen shots

shrewd tinsel
#

@foggy idol blueprints, i guess i need to make a rpc event or something to get it working?

foggy idol
#

yup

#

in my case i use it to pick up weapons

shrewd tinsel
#

how do you do it?

foggy idol
#

@shrewd tinsel it depends. in my case weapon pickups can be done locally or on the server. do you plan to call something locally or on the server with the interface

#

for example i use render custom depth to highlight weapons and pickups locally

swift cargo
#

im still so confused

foggy idol
#

on ?

swift cargo
#

just everything

foggy idol
#

ok

swift cargo
#

i've been legit trying to do this stupid shit for like 6 hours

foggy idol
#

lemme try my best to explain it

#

make a string variable for the name in your player BP

swift cargo
#

okay.

foggy idol
#

now make a string variable for the name in your player controller

swift cargo
#

??

#

player bp

#

player controller

#

isnt that the same ?

#

how can you make somethin IN the player controller?

foggy idol
#

nooo

#

do you have a custom player controller

swift cargo
#

what?

#

i have a Blueprint for a player character

#

wtf is a custom player controller?

foggy idol
#

ok

#

so a player controller is like the soul while the player character is the body

#

create a new blueprint of type player controller

#

name it as you see fit

#

@swift cargo

swift cargo
#

Why? i have one

foggy idol
#

ohhh

#

then open it up

swift cargo
#

Yeaaaa

#

im in it

foggy idol
#

ok

#

now make a variable for the player name

swift cargo
#

i did

#

as a string.

foggy idol
#

so now you have a player name variable in your character and in your player controller ?

swift cargo
#

Yea.

foggy idol
#

good

#

now set both to replicated

swift cargo
#

BOTH?

foggy idol
#

yes

swift cargo
#

wait

#

Where is the player controller?

#

im so fucking lost

#

holy shit

#

Where is the character?

foggy idol
#

ok calm down

crude coral
#

@swift cargo player controller bp is empty just camera inside

foggy idol
#

yes

swift cargo
#

yea i know.

foggy idol
swift cargo
#

not mine.

foggy idol
#

ignore the name

swift cargo
#

or the icon

#

i have shit in mine

foggy idol
#

like ?

swift cargo
#

A mesh

#

and code for controlls

#

and many many other things

foggy idol
#

thats the character blueprint

swift cargo
#

Yea

#

So how is the player controller and the character different?

#

how can i have 2 varibles in the 2 different things

foggy idol
#

the character blueprint and the player controller are completely different things

swift cargo
#

????????

#

show both.

foggy idol
#

ok

crude coral
#

@swift cargo in your game mode setting you can see character bp and player controller bp

foggy idol
#

thats my character blueprint icon

swift cargo
#

yea

foggy idol
swift cargo
#

where is that?

foggy idol
#

so i am now going to assume that you dont have this

thats my player controller icon
@foggy idol

swift cargo
#

im so confused

foggy idol
#

go to add new

#

blueprints

swift cargo
#

why do i even need that? i have never seen it in ANY tutorials

foggy idol
#

playercontroller

#

its needed for things like voice chat and a bunch of other stuff

#

and i get what you mean

#

when i started using UE4 i never used it

swift cargo
#

why use it?

#

EVER?

foggy idol
#

Because in situations like when you need to respawn the player the player controller doesn't get destroyed

swift cargo
#

So do i just remake my player in THAT then?

foggy idol
#

and if you want to do anything multiplayer its a must have

#

noooo

#

the player controller is like the brain

#

and the character is the body

swift cargo
#

i guess

foggy idol
#

both exist

swift cargo
#

what do i do with it now?

foggy idol
#

ill explain how to link it to your character later

#

for now we need to start with making one

#

open it up

swift cargo
#

yea

foggy idol
#

create the player name variable

#

and set it to replcated

swift cargo
#

Both or just the player controller?

#

for replication.

foggy idol
#

both

swift cargo
#

done

foggy idol
#

ok

swift cargo
#

No.

#

i need to make a hud?

foggy idol
#

yup

#

add new

#

blueprints

#

all classes

#

search for HUD

swift cargo
#

i got a hud

#

just now.

#

now what?

foggy idol
#

ok now go back to the player controller

#

make this custom event

swift cargo
#

okay.

foggy idol
#

make sure reliable is ticked

swift cargo
#

yes

foggy idol
#

ok now go back to the Hud blueprint

swift cargo
#

ye

foggy idol
#

this is where you want to load your custom name from the saved game

#

do it on begin play

swift cargo
#

yea

foggy idol
#

good now right click and search for "Get owning player controller"

swift cargo
#

yea

foggy idol
#

drag from it and cast to the player controller you made

swift cargo
#

yea

foggy idol
#

now from the cast call the event we just made

swift cargo
#

im assuming this?

foggy idol
#

yup

#

now go back to the player controller

swift cargo
#

yea

foggy idol
swift cargo
#

yea

foggy idol
#

select on posses from the list

swift cargo
#

yea

foggy idol
#

ok

#

now from the possessed pawn pin cast to your character

swift cargo
#

yea

foggy idol
#

oh wait

swift cargo
#

okay.

foggy idol
#

ok back the cast

swift cargo
#

wait

#

how do i reference my character bp?

foggy idol
swift cargo
#

i make this event in my Player controllerbp?

foggy idol
#

yes

#

if you still dont know how dont worry just remove all the inputs and leave it

#

well add them soon

swift cargo
#

ok

#

now what

foggy idol
#

drag from the cast and search for a has authority macro

#

its "Switch has authority"

swift cargo
#

i cant get switch has auth from the cast

foggy idol
#

not from the blue pin

#

from the execution pin

swift cargo
#

done

foggy idol
#

good

#

now from the blue pin set the player name variable in the character

swift cargo
#

yep

foggy idol
#

connect it to authority on the has authority

swift cargo
#

yea

foggy idol
#

now duplicate the name node you just set

swift cargo
#

yea

foggy idol
#

connect it to that set name on server event we kept aside

swift cargo
#

yea

#

im assuming this

foggy idol
#

waitttt

#

well yes

#

but did you change target to refrence your character ?

swift cargo
#

i think

foggy idol
#

ok

swift cargo
#

the target is my firstpersoncharacter

foggy idol
#

good

#

now set it up like this

lucid vault
#

Is the net pktlag 1 way or roundtrip?

swift cargo
#

@foggy idol ok.

foggy idol
#

ok

#

Now to Your Character Blueprint

swift cargo
#

mhm

foggy idol
#

Are you Using the Name For anything ?

#

Like for a name tag or something#

#

because i noticed a text render

swift cargo
#

Yea

#

It is.

foggy idol
#

ok then

swift cargo
#

Set text for the render with the value from begin play?

foggy idol
#

nope

#

go to the name variable and change it from replicated to rep notify

swift cargo
#

okay.

foggy idol
#

did a function get created ?

swift cargo
#

yes

#

Onrep function

foggy idol
#

good

swift cargo
#

yes

foggy idol
#

now use the name to set the text render in that function

swift cargo
#

like so?

foggy idol
#

yup

#

now do you have a game mode BP ?

swift cargo
#

yea

foggy idol
#

open it up

#

and change the player controller to the one you made

#

also change the HUD bp to the one we just worked on

swift cargo
#

i have one for the menu and one for the game, so ill make one for the game

foggy idol
#

put it in the one for the game

swift cargo
#

oki

#

all set.

foggy idol
#

i dont have the plugin right now so i cant send a screen shot

swift cargo
#

like this? what should the target be?

#

@foggy idol

foggy idol
#

Drag the target to the custom event

swift cargo
#

ok

#

Reference Self?

foggy idol
#

yup

#

also call set player name on the authority side

swift cargo
foggy idol
#

yes

#

but also call set player name on the authority side

#

and you forgot to plug in the string on set player name in the custom event

swift cargo
#

yea

#

i know

#

what else?

foggy idol
#

yes

#

now see if everything works

swift cargo
#

it doesnt.

#

The text are displaying default values.

empty matrix
#

Hello everyone, how can I make a Solo, Duo and Squad system?

foggy idol
#

waittt

#

Set Up A Print on tick to see if the name variable is being set

#

because thats the setup i use and it works for me

swift cargo
#

its not being set.

#

i checked.

#

im looking through everything to figure out why not

foggy idol
#

hmm

#

send me a screenshot of the setup in the player controller and in the HUD blueprint

swift cargo
foggy idol
#

waittt

#

in the player controller

#

add a print on posses

#

to see if its possesing the pawn

#

and are you testing with a client

swift cargo
#

Yea

#

through editor.

#

2 clients

foggy idol
#

ok

#

try the print check on the event possesd

swift cargo
#

So when i press play, my default is the menu screen to load into a game. it prints my print when i play.

#

so as soon as i play it prints.

#

The map im using ISNT using the shit.

foggy idol
#

wait

#

i had a feeling πŸ˜‚πŸ˜‚πŸ˜‚