#multiplayer

1 messages Β· Page 670 of 1

dawn shore
#

but then I need to wait for another frame, I guess

#

it is complex..

meager spade
#

@violet sentinel then how do i change the ALobbyBeaconHost class ?

#

everything looks super unexposed

violet sentinel
#

don't you spawn it ?

meager spade
#

possibly, i am still digging my way through the lobby beacon system

violet sentinel
#

there is a marketplace plugin (although it is a bit pricy and messy code-wise) still shows basics of working with beacons

#

unlike rest of engine code

#

πŸ˜„

meager spade
#

nah would rather learn, nothings too hard :

violet sentinel
#

essentually a GI subsystem that manages beacons

meager spade
#

more reading πŸ˜›

violet sentinel
#

when creating lobby, spawning the beacon host actor

meager spade
#

still confused they didnt expose stuff to config

#

for things like the beacon classes

violet sentinel
#

the API is barebones

#

without a single implementation for OSS

#

like every time i try to use (mostly Steam) OSS, find unimplemented functions i get urge to just write own OSS

sly barn
#

Good morning! How are you guys handling different commands for different equipped items? Ex. Apple vs pistol. Are you sending generic commands to the item and allowing it interpret? Ex. Press button A for Action1 and button B for Action2? The parent Item class (or interface) then interprets and reacts accordingly.

violet sentinel
#

there are also other ways with utilizing hierarchy or composition

#

and in mp with everything being handled preferrably on server, and client receiving vfx/notifications

sly barn
#

I believe your first statement is what I'm shooting for. Let me restate the question a little...

#

A weapon may have fire, reload, change fire mode "buttons" or commands. An apple may have eat, drop or throw commands. How are you genericizing these commands? Or are you?

#

Action1, Action2, Action3?

#

All of these action functions are exposed via an interface or generic base object Item.

#

?

meager spade
#

i have a generic base actor

sly barn
#

For your "item" class, right?

meager spade
#

(AKaosWeapon) and everything like Grenades, Bandages, Guns, etc all use this base (yes it was JUST weapons, but i adapted it :P)

sly barn
#

πŸ™‚

#

Wow, that's a big smiley face.

meager spade
#

I use GAS tho, and pressing input key, gets your equipped item, and does what it needs to

sly barn
#

GAS is an acronym?

meager spade
#

i use GAS, so each item has 3 abilities, Primary Activation, Secondary Activation, Auxiliary Activation. For a weapon this is Fire, Aim, Reload.

#

Gameplay Ability System

#

they don't have to have all 3 abilities

sly barn
#

Ok. That's what I'm looking for.

meager spade
#

if they don't have that ability, nothing happens

sly barn
#

I was considering something like that. Multiple generic commands that the item doesn't necessarily have to implement.

meager spade
#

example bandages only have 2, left mouse and right mouse (Primary and Secondary) primary heals you, secondary heals what player you are looking at and close too

sly barn
#

Yep. Ok. Perfect. That answers my question.

#

I spoke too soon. Is reload assigned to one of the Activation commands?

#

I'm assuming so if you are maintaining the generic interface.

meager spade
#

@sly barn also don't cross post into multiple channels. Reload is an ability. You press the R key, it grabs the equipped weapon and calls Weapon->AuxiliaryActivation()

violet sentinel
# meager spade still confused they didnt expose stuff to config

that would assume they have a central system to work with beacons which they don't have.
even significance manager is working within FSignificanceManagerModule but beacons are just api skeleton that you somehow need adapt: create GISubsystem, inherit BeaconHost, BaconClient, BaconState and manage them

#

also don't forget to transfer them on seamless travel

kindred widget
#

I feel like I'm missing something important. I thought 4.26 was supposed to support Pushmodel by default? Yet Any time I implement a property that is replicated with pushmodel = true, it replicates regardless of marking it dirty. Also the RepNotify setting doesn't seem to have any effect.

#

I feel like I'm missing another setting somewhere? Project wide or something?

violet sentinel
chrome bay
#

IIRC you have to compile the full engine with it enabled

violet sentinel
#

it was completely disabled in 425, in 426 all macro active

kindred widget
#

Wait. Pushmodel requires an engine build? O.o

violet sentinel
#

it is kinda a global feature

chrome bay
#

I'm working with source, if I add bUsePushModel = true to my target, it recompiles the engine

#

Which makes sense, since USE_PUSH_MODEL is an engine-level define

violet sentinel
#

you can check it with

#if !WITH_PUSH_MODEL
#error Push model is off
#endif
chrome bay
#

BTW note that all properties are marked dirty by default

violet sentinel
#

^

chrome bay
#

So if it is working, they'll be dirty first time, but not after that until you mark them

#

Oh I'm wrong, looks like it is on by default in 4.26

kindred widget
#

My test scenario was using an int32. Initialized to 11. On Beginplay, server set it to 12. Was running OnRep without marking it dirty. But if I changed the 12 to 11, it wasn't running the OnRep.

chrome bay
#

That makes sense

#

The property will be gathered at the end of the first frame

#

So it the actor was spawned + changed the property in first frame, it will replicate initially

kindred widget
#

Fair. What about the OnRep setting though?

chrome bay
#

Well it's 11 by default, so it won't be sent

#

Server will only send it if the clients value doesn't match

#

And even if it sends, client will only fire the OnRep if it's different from the local value (by default)

#

Even if you mark it dirty it might not send it

kindred widget
#

I had the OnRep set to Always. So that doesn't affect server sending a value when marked dirty?

chrome bay
#

They still do the property comparison

#

no

kindred widget
#

Moo.

chrome bay
#

Server will only ever send a property if it thinks the client has a different value

kindred widget
#

Is there an override for that?

chrome bay
#

Even when using push model

#

nope

meager spade
#

Always just means it will fire OnRep even if the property is the same

chrome bay
#

^

#

Yeah the Always/OnChanged flag is client-side only

kindred widget
#

So.. TLDR, if you need what I want, set an initial only value and RPC it.

chrome bay
#

What was it you wanted?

kindred widget
#

For an OnRep to fire on client, and for server to send it regardless of change.

chrome bay
#

Yeah if you want the server to send it no matter what, RPC it

#

or override the == operator to always return false but that's sp00ky

kindred widget
#

For instance in the event of client predictions, server doesn't know what client might be predicting, but it sends an authoritive value. I still want it to send that in some cases even if it's still the same on server if something else happens so that client can use the authoritive value to correct.

chrome bay
#

Yeah the only way you can do that is uniquely identifying it. With a counter or something

#

GAS obviously uses prediction keys, and RPC's to ack/reject them

#

Or the key replicates with the changed property

warm sequoia
#

hey guys, In UE4 my game works fine but when I try to launch game from file explorer it is just a black screen... anyone know why? I never got this before

bitter oriole
#

Play-in-editor works differently so that makes sense

#

Make sure to open your game in editor on the entry level

#

And then debug it I guess

warm sequoia
#

@bitter oriole it is being opened on the entry level... that is why i am confused lol

sand iris
#

does APawn::UnPossessed() only get called on the server?

meager spade
#

yes

sand iris
#

I see, thanks!
I've seen some BP functions in C++ use the specifier BlueprintAuthorityOnly so that it only runs on the server. Is there an equivalent of that for non-BP functions?

Example:

    UFUNCTION(BlueprintImplementableEvent, BlueprintAuthorityOnly)
    void ReceiveAnyDamage(whatever);
#

I'm talking about a case where you want a C++ UFUNCTION to only run on the server. Is there a UFUNCTION specifier for that?

Or you would just put if(!HasAuthority()) return; at the beginning of the function to make it server only?

kindred widget
#

Not really. Those specifiers are pretty much just an easy way to stop designers from doing things they shouldn't. It's more assumed that if you know C++, you have a vague idea of what you shouldn't do.

rocky topaz
#

hi, I have a few issues with the way the character movement component handles movement packets

#

I have an enum that stores the current state of the player (which can be wants to slide, sliding or none) and I send the data of this enum in the compressed flags

#

my system works pretty well but I have noticed that in high ping/packet loss situations the update out of sliding can be somehow skipped and the cleanup doesn't happen (so movement is stuck to the plane of the slide server side)

#

this is the way I'm currently handling it

#
void UYmenokMovement::OnMovementUpdated(float DeltaSeconds, const FVector& OldLocation, const FVector& OldVelocity)
{
    Super::OnMovementUpdated(DeltaSeconds, OldLocation, OldVelocity);
    const AYmenokCharacter* const Character = Cast<AYmenokCharacter>(GetCharacterOwner());
    if (!Character)
    {
        return;
    }
        
    if (YmenokMovementMode == EYmenokMovementMode::Sliding && Velocity.Size() <= 50)
    {
        StopSliding();
    }
    
    if (YmenokMovementMode == EYmenokMovementMode::WantsToSlide && IsMovingOnGround())
    {
        StartSliding();
    }
}```
#

I assume on server side there can be cases where the movement mode is set by the autonomous proxy to None (since StopSliding does that) without the server actually simulating that to call StopSliding

#

I'm considering making StopSliding a reliable RPC at this point but in high ping situations it could take time ...

#

I want to make the server check the previous move it received and see if it was Sliding and then the last move it received to see if it's not sliding anymore and run the cleanup again to make sure

sand iris
kindred widget
sand iris
#

for a server RPC call to be successful, do I (the client) need to have ownership of the class object where the RPC is defined or the class object from which the RPC is called from?

For example, I declared+defined a server RPC on the PlayerState but then called that server RPC function from my PlayerController on the client side.

meager spade
#

the owner must have a route to the player controller

kindred widget
#

The object that the function is called on.

meager spade
#

so your pawn can own that actor, as pawn as a route to the player controller (owning connection)

#

RPC's from playerstate is fine, as its owned by the controller.

kindred widget
#

A better example might be if you had an RPC on PlayerController. You could call that RPC from a Widget which has no networking. This would still work since the RPC is through the controller.

daring folio
#

Hello! Quick question, I think...

Which classes are involved in moving user input from the controller, through to the network? From what I understand replication and events involved - I may be misunderstanding - so I'm just trying to track down how the classes and threads involved work together.

rocky topaz
#

does anyone know where I can hook my function to check if there wasn't an important unsimulated move server side? πŸ˜…

meager spade
#

eh?

rocky topaz
# meager spade eh?

I have a sliding system that I handle with a replicated movement mode containing an enum for the state of the character

#

and my StopSliding function is called on OnMovementUpdate to cleanup from the sliding settings when the player becomes slow enough

#

the issue is that with high packet loss sometimes the state where the character is slow enough and still sliding gets skipped so the cleanup never happens

#

but I can still check for that if the last acked state was sliding and the current state is not sliding

#

I don't know where or how to insert that though

#

I'm thinking about overriding ServerMove_HandleMoveData

summer spade
#

Is there any good example code of network projectile prediction
Apart from the unreal tournament?

barren patrol
#

Does anyone know how to make the Start Separate Server in PIE start on a different level?

#

I'm running in Standalone and want client to start on my Menu level and server to start on the game level

#

none of the editor / project settings that I've tried seem to work.

barren patrol
#

ok what I did was add an Open Level call in my level blueprint. If dedicated server, load my game level.

#

LogNet: Warning: TravelFailure: ClientTravelFailure, Reason for Failure: 'Invalid URL: /Game/TestProject/Maps/Game'. Shutting down PIE.

#

for some reason i get this when i open localhost:17777 on the client side in the console

#

If I use open to try and load the game level on the client (aka not through the server but just locally), it loads for both permutations of the game level (short name and full path name with /Game/...

rocky topaz
#

I added this to UpdateFromCompressedFlags : ```cpp
const EYmenokMovementMode NewMovementMode = static_cast<EYmenokMovementMode>(Flags >> 2);

// Stop Sliding if the sliding stop was not simulated
if (YmenokMovementMode == EYmenokMovementMode::Sliding && NewMovementMode != EYmenokMovementMode::Sliding)
{
    StopSliding();
}
#

there's really no magic formula to make things less jiterry with 500ms ping and 20% packet loss

#

but this makes sure that at least the player won't be stuck with the plane constraint on

barren patrol
#

haha yeah if the network is that bad you are doing well as long as its not a catastrophic failure kind of issue

nimble parcelBOT
#

:triangular_flag_on_post: Trinigio1#2949 received strike 1. As a result, they were muted for 10 minutes.

rotund cosmos
#

Unsure if this belongs in here or in #blueprint - mods please lmk
I have a 2 player game, when the game is over I want to press a button and restart the same level, with the same 2 players (re-init the map, recreate all actors etc..). In the game mode i call Restart Game (which from my googling seems to be correct?), the server restarts correctly and loads the client that's also running as server, but the 2nd player seems to be stuck forever in the previous game. What am i doing wrong? (Yes i'm pretty new to the unreal ecosystem)

formal kernel
rotund cosmos
formal kernel
#

it looks like time is always 0 for the other client yeah

#

ill try making it a value that gets sent to the server as well and see if that fixes it

rotund cosmos
#

so RInterp To never actually interpolates, as time is always 0, you always get current as output value

formal kernel
#

thank you for the advice ill let you know if that fixes it if so you are a lifesaver haha

harsh lintel
#

Sometimes anim notifies aren't triggering on the server, is there a setting I can use to ensure animations happen on server an client

formal kernel
rotund cosmos
#

I'd put a few Print String or breakpoints around that area, and figure out which parameter looks wonky

formal kernel
#

it looks like the issue is with my control rotation

#

the server thinks its always 0, the client has the correct

livid solar
#

Did anyone make first person in multiplayer with third person look for another player?

meager spade
#

Many people have

eternal canyon
#

Lol

hollow eagle
#

at least one person

cosmic trail
#

Is there a way to check how much oodle is compressing network data in 4.27?

dim flame
#

hmm im having some wierd interaction

#

using ray traces to for stuff fails unless server is looking at it happening after restarting the server controller

#

works just fine before restarting that player

#

without researching it too much I figured i'd check here if its something stupid XD

#

getting the traces done client side but not server side when out of view

violet sentinel
twin juniper
#

Is it normal to get very bad performance in 'run in standalone' for multiplayer? Normally I test using 'new editor window' and have okay fps there but if I try 'run standalone' I get terrible performance which is worse the number of players I select, but is this just my pc not being able to handle 4 separate instances of the game running together?

violet sentinel
twin juniper
#

what do you mean?

#

Are you saying the lag is most likely caused by having the four separate instances so is not necessarily a reflection of how the game would run on 4 different remote clients

#

Which on standalone 4 player mode on my home computer is fairly smooth at the moment.

dim flame
#

is this only in mp?

pallid mesa
#

how does push-based networking work over structs?

violet sentinel
#

same as scalars, value sent only when dirty

#

and marked dirty initially

#

you mark fields manually i ncode

pallid mesa
#

ah so isntead of marking the whole struct dirty

#

I mark the fields?

violet sentinel
#

no, you have to mark struct

pallid mesa
#

and then it only replicates what changed, I assume?

violet sentinel
#

as it is the replicated field

#

yes

pallid mesa
#

purrfect! Thanks Aquanox!

violet sentinel
#

replicates only when marked as dirty

pallid mesa
#

mhm got it hehe, I just didn't know if there was any difference in this case

violet sentinel
#

you can modify struct contents but it won't be checked or sent until you mark the struct property as dirty

pallid mesa
#

oki, as long as it only replicates the modified fields and not the whole struct, it's okay

violet sentinel
#

no it will send whole struct

pallid mesa
#

what if I want to replicate only the property that changed within the struct?

violet sentinel
#

check net delta serializers

pallid mesa
#

perfect, will do!

#

also another question

#

I've seen that they do

MARK_PROPERTY_DIRTY_FROM_NAME(..., blah, this);
blah->Mutate();

rather than

blah->Mutate();
MARK_PROPERTY_DIRTY_FROM_NAME(..., blah, this);
#

why is that?

violet sentinel
#

doesn't matter

#

as check happen much later when replication is happening

pallid mesa
#

ahh good to know

elder sage
#

Does anyone have good spawn logic for an arena shooter that they'd be willing to share? Mine currently just gets a random PlayerStart and then checks line of sight until something passes. Too random imo

#

I've actually thought about putting some functionality in the PlayerStart BP to upkeep a type of "score" for how strong a given spawn point would be, but I'd have to maintain that for multiple teams while avoiding making it too complex

hollow stirrup
#

Hey, could someone point me to the class that handles variable replication? I know that the general idea of how it works is it loops over all replicated properties and updates ones that have changed. But I can't seem to find where the engine actually does this

violet sentinel
#

break on prereplication and look here it is called from

#

why do you need to know?

hollow stirrup
hollow stirrup
tropic snow
#

Anyone know why when simulating bad ping. The walking and jumping is tolerable but multicast functions like shooting really delay in response ? Even when its reliable

amber slate
#

so on Fortnite there is a shop that changes every day without updating the game

#

how would I be able to do this in a multiplayer game?

twilit radish
#

I would imagine they have for example web servers that the clients connect to when they launch and then fetch whatever is needed from there.

urban mason
#

Hello; I'm working on a project and have a few multiplayer networking/replication related bugs. I was hoping someone could pair with me for a bit to give me a hand. Happy to compensate if necessary. Is this something that this Discord is good for or is this considered spam?

twilit radish
chrome bay
#

It being reliable doesn't necessarily matter, messages between machines are always delayed by latency. It takes clever programming to workaround that lag and reduce the perceived effects.

tropic snow
#

How do I get shooting to feel a bit tolerable in high ping

#

Do I need to adjust configuration values?

chrome bay
#

Nope

#

Most games play firing effects locally, to reduce the perception of ping

twilit radish
#

Ah I understood the question wrong I guess, I thought they were being bottlenecked πŸ˜…

chrome bay
#

Look at Epic's shootergame example, specifically how they trigger firing effects

tropic snow
#

I mean when I shoot 1 bullet it literally takes 1 second to response at high ping. For example in a server in Italy while I'm in the US

chrome bay
#

Well yeah but that's just what ping is

#

latency. Nothing you can do about that

#

Have to workaround it and "fake" the responsiveness

twilit radish
#

That's the big problem with multiplayer, it doesn't happen instantly. There's always a delay of some kind πŸ˜›

tropic snow
#

But again jumping and moving feels natural

chrome bay
#

Yeah because it's predicted locally as I said

#

If it wasn't, it would feel just as bad

#

The Character Movement system is the only thing that has this concept built-in

tropic snow
#

I see.. is it possible to do some predictions with functions?

chrome bay
#

Anything is possible really

#

It's a complex problem, have a look at ShooterGame for a simple example

tropic snow
#

Got it

#

C++ right?

chrome bay
#

Multiplayer makes every simple problem about 10x harder

#

yeah

tropic snow
#

Dang lol

urban mason
#

not sure if this helps, but the way I fire is by calling my Fire function locally first and then using an RPC to call Fire on the server which replicates the fire to the rest of the clients, and then doing client side hit detection with server validation. What that sorta looks like is:

tropic snow
#

Good start thanks

rough kestrel
#

has anybody used photon on ue4? I wanted to know if it needs a separate build for the dedicated server

twilit radish
urban mason
#

I can try asking -- I'm mainly wondering if anyone is willing to pair with me or give me guidance on a multiplayer issue. I'd be grateful if so. My issue is that:

  1. On map load I'm setting a bunch of properties in each player's state based on a widget. These properties are being stored in a replicated array
  2. Once a 'confirm' button is hit on all player's widgets, I kill all the players and use the info from the state to load something for each character (GAS abilities), which is called via a server RPC on Event BeginPlay

The result is that every client is able to load their abilities, but the host doesn't load his abilities

#

However, if I start the game from the level described above instead of from the main menu, it all works properly. The main menu will use the Advanced Sessions Plugin to connect all of the players and doesn't do much else

twilit radish
#

Have you tried this several times? Maybe it's an issue with the beginplay order where something has or hasn't been loaded yet? It's a bit difficult to say what could be wrong here, but that may just be me πŸ˜›

urban mason
#

yeah agreed, the problem is a bit in the weeds rather than a general multiplayer question. I have tried it several times with a different number of clients and its always the host who cant load his abilities. I've also stepped through the debugger to try and make sure everyone's state is correct and it seems like they are

#

the fact that it works properly if i dont go to the level from the main menu makes it really challenging to debug since the main menu isn't doing much here

twilit radish
#

I would recommend trying to add debug messages or using a debugger again from the beginning point to the end. Other than that I'm also not quite sure, it's difficult to tell what the issue may be. It could also be that maybe something doesn't correctly persist or does persist from the menu to the other level πŸ˜…

#

Maybe step through the code from begin to end and see where it could potentially cut off something.

urban mason
#

thanks man, i'll try that

dim flame
#

level streaming is iffy with loading and begin play/tick order

#

I ended up using a custom event and Remote Event node to do what I want instead of waiting for begin play. Could too early begin play/ticking be the cause of your issues?

urban mason
#

I don't think so because the flow is like this:

  1. The map loads and everyone interacts with a widget (begin play is called here, but it's not the relevant one)
  2. Every one dies (behind a loading screen)
  3. Begin play is called again when everyone respawns, and every time a player dies and respawns again. These are long after map load
dim flame
#

hmm

#

does the loading screen do anything on begin?

urban mason
#

this is basically the full menu. you either click host or you click join

#

those events are hooked up to buttons in the main menu widget

#

the loading screen is just a widget that takes up the entire page while everyone dies; doesn't do anything

dim flame
#

hmmm

#

it really does seem like a problem that would come back to begin play and load order but I digress

urban mason
#

hmm maybe i misunderstood what you meant by that. say more?

dim flame
#

is there any sort of level streaming in that level?

#

or is it a plain map

urban mason
#

nah, it's all just 1 map

dim flame
#

hmm

#

then im out of ideas

urban mason
#

thanks anyway my dude

dim flame
#

haha I have a somewhat similar problem actually XD

urban mason
#

maybe i can help, let's hear it

dim flame
#

after killing and restarting host, rpc event that should trigger linetraces somehow stop firing on the server when host isnt looking towards the event

urban mason
#

where is the code that's triggering linetraces?

dim flame
#

input client-> trace on server reliable event-> trace multicast reliable event -> linetraces

#

basically

#

im doing traces from an actor attached to pawn

urban mason
#

which class type tho? is it happening on the player character? on a random actor? in game mode? reason i ask is because I imagine it's either happening on the player character or wherever its happening is referencing the player character. when your host dies, the refernce is lost.

#

and you might need to reestablish. that being said, a problem like this definitely needs eyes on it, same as mine. it's hard to debug from a sentence haha

dim flame
#

yeah for sure

#

but lots of content to screen

#

if the problem persists I might be inclined

urban mason
#

if it's happening from an actor attached to the pawn, it does make some sense for it to stop when the host dies at least πŸ€·β€β™‚οΈ

dim flame
#

whatever is happening is unfortunately not referencing the host player at all

#

and the wierd thing like I said

#

if the host looks towards the client

#

then the clients traces are run on server

#

if host looks away, traces are gone from attacks

#

on the server

#

but only after kill and restart

urban mason
#

similar to my issue. i wonder if there is any setup that you do in game mode or game instance begin play

#

that doesnt happen the second time the host dies

dim flame
#

hmm there is

urban mason
#

is it relevant to this? if so can you call it from your host's begin play

#

slash from your player character begin play?

#

because that gets called every time you respawn, whereas the other stuff only gets called on level load

dim flame
#

this might actually help

#

im not sure I get why the direction the host is looking changes anything

#

i mean im not doing anything complex

urban mason
#

yeah in order to debug that i have to know way more about your game

#

that sentence barely makes sense to me without knowing what you're doing

dim flame
#

yeah sorry

#

thats in game mode anyway

#

i'll do some more debugging

#

cheers

#

hmm no not really doing anything wierd there unfortunately, just simple spawning of a few actors(Equipment), attaching to sockets and play a spawning animation montage

#

i'll pop down what im doing, I ended up hardcoding alot just to try to debug this XD

#

get called from damage event

#

im probably making some simple mistake somewhere XD

#

im not reusing the equipment actors

#

I leave them

#

spawn new ones for new player

#

the equipment contains the linetrace code which gets called from multicast event

#

which fires on the client but never gets run on the server or replicated to other clients after host has restarted once and is looking away

#

Guess I could reset manually instead of calling restart

#

see how that changes things

#

I should just go code, blueprints get confusing by comparison XD

warm sequoia
#

Hey can someone help me with this replication? I’m not sure why it is only working on the server for all.

dim flame
#

hmm

#

not sure what runs what here but

#

mayeb make the run on server event call a multicast event that runs the actual code?

#

then you can call the multicast event in places where you know its auth only

#

and the run on server event everywhere else

sinful tree
#

Doors should probably be set up with a state (using an OnRepNotify variable) rather than relying on multicast events.
Multicasts are fire and forget, and if the actor isn't relevant to one of your players, they won't receive the change of state of the door.

What you can do differently is create boolean variable for the door state - open or close - and set it as OnRepNotify.
In the OnNotify function that is created, you can then check what the variable is, and perform the needed action (open or close).

#

Your Server RPC would then just change the value of the boolean when you want to close/open door.

dim flame
#

hmm probably something similar thats the cause of my issues

#

above

#

i'll refactor it for rep notifies I guess

sinful tree
#

Though yes, death should probably be a boolean state on your characters which could still benefit from using an OnRep variable.

dim flame
#

mm using an enum state right now

#

could rep notify that I guess

sinful tree
#

Enum is fine too

#

If you have more than dead/alive

dim flame
#

got a few more states yes, but could probably benefit from disconnecting death from the same enum

#

o7

stone shore
#

for multiplayer, should i be putting input on the character or the controller?

sinful tree
tepid pawn
#

Hey guys been racking my brain but can't find anything that tells me why my instances are spawning sideways. Any ideas about how to rotate them to be upright?

#

Here is my BP and the issue

vivid seal
#

if i apply a Root Motion Source to a player on the server (not predictively) i get a ton of jitter and corrections on the client who had the root motion applied to them. Any way to fix this? For root motion a client applies to itself, i can do it predictively and then on the server, and it works great. However for something like a knockback, that is initiated by an NPC on the server, how do i smooth that for clients that are affected? do i just have to apply it on affected client after the server? Or do i need to RPC to the owning client and delay applying it on the server until the client has applied it to himself?

winged badger
#

@tepid pawn MakeRotFromZ will align the actor's up vector with the normal

#

also what does this have to do with multiplayer?

#

(RotationFromXVector aligns the shrubs forward with the normal)

tepid pawn
vivid seal
#

if i create a uobject on the server with a bunch of replicated variables, and one of them is OnRep, is the OnRep going to fire randomly with some variables replicated and some not, or will all the variables replicate at least once before the OnRep is fired off?

#

what i mean is will the client have all the initial values for variables before the first OnRep call

meager spade
#

All replicated properties get sent kn the same bunch

#

If they agree different

#

Are

sinful tree
meager spade
#

That was not part of the question tho

#

I answered the question asked

vivid seal
#

I know how to replicate UObjects, just wasn’t sure if it was safe to use OnRep of a variable for basically an Init function on the client

sinful tree
#

Righto I'll shuddap πŸ˜„

meager spade
#

Owhy would it not be safe ?

#

Why

vivid seal
#

If OnRep fires before all properties are replicated basically

meager spade
#

As long as the properties are in the correct order then your good. If you want to do stuff after all props are set you can use PostNetRecieve with a bool gate for first time.

vivid seal
#

TIL about PostNetReceive

#

Are properties replicated in the order I declare them?

#

I didn’t realize that

meager spade
#

Typically yes

#

Test it lol

#

Two rep props with log in the independent

#

Onrep

#

Stupid phone lol

quartz smelt
#

Anyone else ever have a project completely stop working? Variables, overlaps, etc don't work anymore lol

empty axle
quartz smelt
empty axle
quartz smelt
#

hahaha thank you, I didn't know about that

sudden geyser
#

Hey ive been struggling launching a dedicated server on ue5. Did the same steps for ue4 26 and worked successfully. Is there any documentation for ue5 multiplayer setup

chrome bay
#

That's why we have PostRepNotifies etc etc.

steady musk
#

Guys is that normal that Net Cull Distance just breaks replication but not trying to recover replication once player is close enough?

chrome bay
#

Not really sure what you're asking, breaks how exactly?

#

It's certainly not normal that it "breaks" anything

steady musk
#

Like I know that it will stop replication if player is far enough

#

But will it replicate if player gets closer again?

chrome bay
#

It will yeah

#

If it's an actor spawned at runtime, then the actor is destroyed/respawned with network relevancy. If it's an actor that's serialized with the level, then it just stops/starts

pearl jasper
#

Hey, I'm trying to make a local coop where Player 2 is not spawned, but is a result of possessing an existing AI Pawn. How could I achieve that?

chrome bay
#

Something you'd handle at the GameMode level most likely, take a look at RestartPlayer()

#

The default implementation always spawns a pawn for new players at a given player start. Presumably you'd want to look for an existing pawn first

steady musk
lusty badger
#

I want a game in which you can have human players or bots or a mix of two.
I understand that you have the PlayerController (Human) and the AIPlayerController so I can switch between them.
But, for example, If I want to keep track of some character-driven values like: "Heath", "Ammo", "Team color"... My first guess is to use the Player State, Is that a good way when using AIControllers too?

bitter oriole
#

Yes

lusty badger
#

Thanks!

empty axle
#

<@&213101288538374145>

vital canopy
#

Hey Guys, Whats the best way to implement third person character on a first person game? I know bad ways to do it that work, but games like Call of duty and stuff tend to do it really well and accurate, Are they adding FPP arms and then adding a third person body or whats the best way?

peak sentinel
#

ShooterGame has an example

#

But yeah they add 2 meshes

#

make them visible based on controller

#

if you are local controller you dont see 3rd person one

#

Most FPS multiplayer games dont use single mesh

karmic briar
#

hey guys dumb question what does marking something as dirty means?

peak sentinel
#

In general terms it means that property will be updated on next update/tick

#

I guess you saw in on push model?

vital canopy
karmic briar
peak sentinel
#

With normal system engine loops each property and checks for difference, if property is updated its being replicated

#

With push model, you need to mark it dirty

#

So it will not loop it forever and you will save performance

#

i.e. its a manual way of pushing updates across network

karmic briar
#

ah okay thats cleared my confusion

#

thank you for the response

twin juniper
#

Hello everyone.I am spawning a actor which I marked as replicate.I am spawning it on game mode.But actor is not able to spawn on clients.When I set to simulate I can see it spawn.Plz help me here

#

Any actor is not able to spawn here

peak sentinel
#

Are you playing with listen server model or dedicated

golden nest
#

Hi, i'm having trouble creating a widget after a map change

#

Does someone know why my game instance does not execute an event "Show message" when i load the main menu map?

#

This is my setup

#

after i call open level i'm trying to show a message that "someone logged into your account form another device"

#

But the "Show message" event does not seems to work

#

Show message is in the game instance too

#

any ideas'

#

?

#

After the map change i tried to show the widget many times with another error message from another event, but it does not work anymore

twin juniper
#

@peak sentinel I figured it out.it is not spawning properly on game mode.Now I am spawning on game state.I have one problem.i am spawning Pubg blue zone type of thing. I had a sphere component to the actor and I made it replicates as well. But when I am trying to reduce its scale on server it is not affecting on client but when I do it on multi cast it is working do you know any reason why it is happening thank you

golden nest
#

i post this here because my map load is opening a server

twin juniper
#

@golden nest when you open a level there will be a player controller.Try to spawn widget there.Game instance is generally used for maintaining data throughout levels not for spawning widgets

#

How are you calling the spawn widget function in game instance??

golden nest
#

what do u mean?

golden nest
#

I open the level then i call the event to show the widget

twin juniper
#

I think it is bad practice to spawn widgets on game instance.Maybe I am wrong.never mind.did you print any string to check that function is being called

golden nest
#

yes, i printed a string with no success

#

the event never fires

#

i noticed that there's a problem with lan session

#

Because i can travel to any map with no problems, but when i create a session, then come back to the main menu, the widget stops working

#

nevermind, i solved it haha

#

There was a problem with the destroy session, i call it, then open the level. Opening the level then destroying the session seems to work

kindred widget
#

@dusky radish In general, everything past the button click, which should call a ServerRPC on the controller, should be done on the server. Replicated Pawn should spawn on the server, and the server version of the controller should call possess on it which is all you should need to do I believe.

#

There doesn't need to be any other networking past that. The Possession code will handle it all for you. If you need a client to respond to possession, I find it's better to hook into the client RPCs made from possession routine and add a binding call in them.

split sentinel
#

Hey,
i want to ask how the multiplayer (Host/client. No dedicated server cause it's too complicated) in unreal engine is. I wanna make a multiplayer arena fps shooter game but i don't know,
if it is going to lag if like 300 people play it simultaneously. I do have multiplayer experience with Unity (Photon Pun) and when i tested the game with many people there, it started lagging.
So i wanna know if the unreal engine networking stuff can handle many players.

empty axle
split sentinel
#

I am not that familiar with this system, but i wanna have for one host 12 clients

empty axle
split sentinel
#

yeah, but what do you mean by servers? @empty axle

empty axle
split sentinel
empty axle
#

yes as well

daring folio
#

And those that connect to it are clients. Your hosted server is the authority

split sentinel
#

ah ok

#

So can it lag or something if 300 people are playing simultaneously, but it's one host(server) per 12 clients, on a arena fps shooter?

#

Do the 300 people actually have anything to do with it?

daring folio
#

A part, yes, but there's hardware factors there too.

empty axle
split sentinel
#

oh damn

daring folio
empty axle
daring folio
empty axle
split sentinel
#

Does unreal engine have integrated matchmaking?

empty axle
#

but the Steam one depends on which platform you are deploying

split sentinel
#

Oh alright. Thank you guys for helping me

empty axle
#

@split sentinel if you are deploying for PC and you don't care about publishing to Epic Launcher and GOG you could use Steam built one yes

#

I recall ShooterGame have some basic setup for that

eager jolt
#

ive just followed a tutorial online that works locally but to work across the internet i need to port forward.
Instead of port forwarding my own router i have signed up to Portmap.io that generates me a random port i can use.

How could i change the port in the game?

daring folio
# empty axle Yep, currently not possible with plain ue4. With one dedicated server and some/...

Yeah, I can imagine the sorts of optimizations that would need to happen to make it possible. It'd have to serialize game data to a distributed cache that each physical server uses to read the game state, session, instance, and relevant controllers. there'd probably need to be possibly separate authorities for various parts of the engine like physics, state, etc. It's doable but it's a pain and astronomical man hours. I'd use gRPC with sparse and size constant datatypes and a clean hierarchy.

eager jolt
#

does anyone know how to change the port?

daring folio
eager jolt
#

sorry to be a pain but what is a INetAddress?

#

@daring folio

daring folio
#

It's a type in unreal that represents an address on the internet. An address is typically formatted like <ip or hostname>:<port>

eager jolt
#

ahhh

#

so must I portforward myself or after running the VPN my IP will be updated?

daring folio
#

I'm not sure that'll help you though, that's why I asked for corrections

eager jolt
#

ok thanks anyway

#

ive never done mp before but a 10 minute tutorial seemed to explain it all

#

but he only did it on LAN and claimed u must portforward for multiplayer

daring folio
#

well, i'm sure there's another 10 min tutorial on port forwarding in UE lol sorry wish i could help more

eager jolt
#

thanks πŸ™‚

urban mason
#

Hello reposting this from yesterday hoping it's not considered spam; I'm working on a project and have a few multiplayer networking/replication related bugs. I was hoping someone could pair with me for a bit and attempt to show me what's wrong.
My issue is that:

  1. On map load I'm setting a bunch of properties in each player's state based on a widget. These properties are being stored in a replicated array
  2. Once a 'confirm' button is hit on all player's widgets, I kill all the players and use the info from the state to load something for each character (GAS abilities), which is called via a server RPC named LoadAbilities from Event BeginPlay whenever someone respawns.

The result is that everybody correctly gets their abilities after dying and calling Event BeginPlay except for the host. Using a 1v1 scenario (2 clients and the server) through the debugger, what it looks like is happening is when a client dies there are 4 instances of the LoadAbilities function which I assume is the client and the server both calling Load Abilities on both the player characters. However, when the host dies, I only get 2 instances of LoadAbilities as the other 2 that are expected are unable to cast the player state into my BP_PlayerState class

#

hopefully it's detailed enough. mainly hoping to pair with someone and happy to compensate for the time if that encourages someone to pair with me.

vivid seal
#

any way to replicate an object to only one client

#

(the owning client)

#

its a UObject derived class so I'm using ReplicateSubobjects to get it to clients, but remote clients shouldn't need it at all

elder sage
#

I'm using an impulse node, and I can't figure out how to make it less jittery on the client. I've tried running the event on the client or the server and neither seems to make a difference

meager spade
#

@vivid seal override IsNetRelevantFor

#

and make it return false for anyone BUT the owner

#

ah

#

thats for actor

vivid seal
#

yeah i think uobjects just use owning actor's relevancy

meager spade
#

UObjects, you need to override ReplicateSubobjects somehow to only send to owner

#

tho i have never done this, nor needed to do this

vivid seal
#

okay, i didnt know if there was an easy way to do it. i wont bother, just guard initialization on clients with auto proxy role and eat the networking cost, its probably not a big deal rn

#

its for root motion sources, it doesn't seem like i need to replicate them to remote clients at all (it looks smooth and there aren't net corrections if i just apply them on server)

meager spade
#

i run them on simulated proxies also

#

not sure how your not getting corrections

#

cause i did unless the simulated proxy ran them

vivid seal
#

i was getting insane jitter on the owning client (since this is for non-predicted sources like knockbacks) but none on other clients watching that client

#

not sure, maybe my test case was just slow enough that the smoothing from the server was covering it

meager spade
#

i mean yeah the owning client and the server def need to run them

#

but i had issues where simulated would look weird

#

(for things like jetpack, etc)

vivid seal
#

im basically just copying constant force, move to force, and jump force from the GAS ability tasks in my own version

meager spade
#

still not sure why you are reinventing the wheel πŸ˜›

#

not sure what you dislike about GAS

vivid seal
#

mostly already did a lot of what GAS does in my own system before I heard about it, and don't want to remake all of it. also I don't like the way GAS thinks about GEs, I have a distinction between "buffs" and instant things like damage that I like in my system. I also have buffs as objects that are instantiated because its easier for me to write blueprint logic for them that way rather than try to tie everything to an attribute modification or a gameplay cue. also I do prediction of cooldowns and have a charge system for cooldowns which GAS doesn't support out of the box, and looked like a pain to get working

meager spade
#

we did that with our system in TRS2 (cause at the time, GAS was very little known)

#

and i dislike "Buffs" being able to run Blueprint logic

#

our game designers break all rules, basically turning buffs into abilities

#

its really bad, and i hate it, i really do like the GAS way tho, and GameplayEffects work perfectly fine

vivid seal
#

i actually hate that in GAS you have passive or automatically activated abilities rather than just letting buffs do logic

meager spade
#

buffs should not do logic tho

vivid seal
#

i get why it is that way

meager spade
#

that is how i see it

vivid seal
#

but i dont like thinking about it in those terms

meager spade
#

well they are not actually buffs tho in GAS, they are Effects (i dislike the name TBH tho)

#

cause Effects sounds like FX

vivid seal
#

i think my biggest problem with effects is that they are an umbrella term for both buffs/debuffs AND instant attribute modifications

#

in my head those things are two separate categories of event

#

idk. the main thing is i just didnt want to relearn everything AGAIN

meager spade
#

i mean i understand what you are saying, but if you think GAS way, it actually starts to become easy

#

and you get to understand how things work, and its really good

vivid seal
#

if i ever finish this game, my next game will definitely be GAS so that i can learn it

meager spade
#

i keep saying in TRS3, we will go GAS

#

trying to convince Zlo tho πŸ˜›

vivid seal
#

lol

elder sage
#

can somebody help me smooth out an impulse node I'm using on the client? I've tried running on both client and server and disabling movement checks and it is still really jittery

urban mason
#

do you guys happen to know a better discord channel or site to get my question answered? i'm only really able to find this one from google searches on ue4 help and by the (lack of) replies it seems like not the right one

dark edge
dark edge
elder sage
dark edge
#

Use Launch Character. It's pretty much just an accident/handy overload that Impulse works on Characters

elder sage
#

okay, I'll use that then

dark edge
#

Test if it's already networked first, try launching just like jumping (local call). If it works, great, if it doesn't, well, you'll have to do some C++ to get predictive launching

elder sage
dark edge
#

same way you do jumping

#

Not sure if that'll work but jumping is predicted so it may

#

If not, do it server only and live with it or bust open the C++

elder sage
#

client-only seems to get corrected immediately

dark edge
#

What does Server-Only do?

elder sage
#

it launches but is jittery, I'm pretty sure

#

let me test it again

#

it functions the best so far, but there's some noticeable corrections happening

#

what if I use "ignore client movement error checks and correction" and then run on both client and server?

dark edge
#

Running on both is not the approach I'm pretty sure. I'd look if anyone has done a multiplayer dash or leap. Launch Character might not be built for multiplayer

elder sage
urban mason
vivid seal
#

Launch has to be done with saved moves, it’s not handled by default

warm sequoia
#

Hey can someone help me with why this is not replicating? I have a repnotify boolean to set the door as open out of frame.

lost inlet
#

Where’s the onrep function? Also holy redundant casts

tame shore
#

I tried following the initial multiplayer guide from unreal, and I can't get shooting to work so I wanted to log something happening, but I can't get logs to work at all. I've tried searching google but all I could find was the community wiki which doesn't help much in case you don't get any results

lost inlet
#

Show code/BP

tame shore
meager spade
#

The code that is not working

tame shore
#

UE_LOG(LogTemp, Warning, TEXT("Hello"));

#

I'm just trying to log anything to the output console, and no matter what nothing happens. I've used this piece of code inside the MoveForward function, and various other places

#

No logging occurs

meager spade
#

are you using the correct class in your game?

#

where is this log placed?

#

we need more info to help you.

warm sequoia
#

@lost inlet thats the onrep

tame shore
#

There's a default function for a character when you create it called MoveForward.

What do you mean using the correct class in my game? I've literally followed the guide, and things are running besides no bullets are being fired, which is what I'm trying to debug. Now I've spent more than an hour just getting an output log

#

I've also defined a BeginPlay for my character, and the log also doesn't fire from that

lost inlet
meager spade
#

Wait, you are asking the exact same question as this: #cpp message

tame shore
#

Oh, I didn't realize he wrote as well, I am

meager spade
#

strange, well if its not firing then you are not using the correct class in your game, or you missed a super call in your overridden functions.

lost inlet
#

Gonna need to see more

#

What have you tried? What does anything look like? Most programmers will know what a UE_LOG is

tame shore
#
void AThirdPersonMPCharacter::MoveForward(float Value)
{
    UE_LOG(LogTemp, Warning, TEXT("Hello"));
    if ((Controller != NULL) && (Value != 0.0f))
    {
        // find out which way is forward
        const FRotator Rotation = Controller->GetControlRotation();
        const FRotator YawRotation(0, Rotation.Yaw, 0);

        // get forward vector
        const FVector Direction = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X);
        AddMovementInput(Direction, Value);
    }
}

This code should be fine right?

#

Given the class is called AThirdPersonMPCharacter

lost inlet
#

Yes and is your character BP actually deriving from that class?

#

Did you setup the input component

tame shore
#

What is BP and yea, it's also there by default

#
void AThirdPersonMPCharacter::SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent)
{
    // Set up gameplay key bindings
    check(PlayerInputComponent);
    PlayerInputComponent->BindAction("Jump", IE_Pressed, this, &ACharacter::Jump);
    PlayerInputComponent->BindAction("Jump", IE_Released, this, &ACharacter::StopJumping);

    PlayerInputComponent->BindAxis("MoveForward", this, &AThirdPersonMPCharacter::MoveForward);
    PlayerInputComponent->BindAxis("MoveRight", this, &AThirdPersonMPCharacter::MoveRight);

    // We have 2 versions of the rotation bindings to handle different kinds of devices differently
    // "turn" handles devices that provide an absolute delta, such as a mouse.
    // "turnrate" is for devices that we choose to treat as a rate of change, such as an analog joystick
    PlayerInputComponent->BindAxis("Turn", this, &APawn::AddControllerYawInput);
    PlayerInputComponent->BindAxis("TurnRate", this, &AThirdPersonMPCharacter::TurnAtRate);
    PlayerInputComponent->BindAxis("LookUp", this, &APawn::AddControllerPitchInput);
    PlayerInputComponent->BindAxis("LookUpRate", this, &AThirdPersonMPCharacter::LookUpAtRate);

    // handle touch devices
    PlayerInputComponent->BindTouch(IE_Pressed, this, &AThirdPersonMPCharacter::TouchStarted);
    PlayerInputComponent->BindTouch(IE_Released, this, &AThirdPersonMPCharacter::TouchStopped);

    // VR headset functionality
    PlayerInputComponent->BindAction("ResetVR", IE_Pressed, this, &AThirdPersonMPCharacter::OnResetVR);

    // Handle firing projectiles
    PlayerInputComponent->BindAction( "Fire", IE_Pressed, this, &AThirdPersonMPCharacter::StartFire);
    //PlayerInputComponent->BindAction("Fire", IE_Released, this, &AThirdPersonMPCharacter::StopFire);
}
#

Everything working besides the Fire action

#

I can move, see it from another client, like it seems to work great

#

I also tried starting a new project, made the BeginPlay function, and added the log. Nothing else. Still no results

lost inlet
#

So where are you setting this as your pawn?

#

That’s why I was asking about the BP

hollow eagle
#

I hate to ask but... You compiled the project, right?

tame shore
#

I press the play button in the unreal engine studio

lost inlet
#

Yeah

#

You need to exit the editor and compile the code from your IDE

tame shore
#

Okay so the official documentation is just bad?

meager spade
#

It's not magical like Unity C# πŸ˜›

lost inlet
#

No? That’s just typical

hollow eagle
#

No, it assumes you understand the basics of C++

tame shore
#

I do, I'm a systems developer and am very confused I'm not getting logs. If I have to compile to get logs the documentation should say so

#

I assume it's compiling when I press play

#

A debug specific build

meager spade
#

That is not how it works

tame shore
#

I see

meager spade
#

You need to compile ALL code changes

#

there is no magic "Press play and my code works"

tame shore
#

Lol that's not what I'm saying calm down

#

I'm assuming it compiles when I press play

#

I was*

meager spade
#

But it was though, you added a log line, and you expect it to work when pressing play. I am just saying, you can not do that in UE4. You need to compile all code changes, which is standard actually for all C++ programs.

tame shore
#

Which I'm saying I understand is standard. I know what compiling is

#

But what does the play button do then

meager spade
#

And code compilation does not take a few seconds

#

just plays what you have already compiled.

tame shore
#

Okay great, that's something they could add somewhere, especially in the beginner guide. Anyways thanks for the clarification I'll return when I get my result

#

I work in Rust normally, I compile 100+ times a day when I change code

meager spade
#

Its not beginner guide actually, it says Intermediate

hollow eagle
#

The link you posted earlier wasn't a beginner guide for the engine, it was for getting started with multiplayer... Which assumes you are already are familiar with the engine.

tame shore
#

I thought the UE engine studio compiled shit when I pressed play

tame shore
#

Bad docs, they should state it

lost inlet
#

It’s an intermediate tutorial

hollow eagle
#

It literally says intermediate

meager spade
#

πŸ™‚

tame shore
#

Okay I don't look at pretty graphics

#

I begin reading

#

That's on me

meager spade
#

anyway, close editor, compile code, start editor, and things will start working

tame shore
#

Yea I see, thanks for the help again.

meager spade
#

You can turn on Live Coding for function body changes, and can compile without closing the editor. Only thing you can't do is header/constructor changes.

#

UE5 actually handles header changes

hollow eagle
#

Does it now?

meager spade
#

yeah, and its on by default

hollow eagle
#

Haven't checked out ue5-main recently. Nice.

meager spade
#

livecoding new classes in, etc

#

still rough around the edges

#

but it works decently well

#

and won't corrupt bp's

hollow eagle
#

Hah, maybe in a year or two we can get rid of the hot reload sucks domain

nova wasp
#

it's weird 5 even has it still

#

just seems more pointless than ever

tame shore
#

Compiling works. Thanks for the help.

I know I should have read the initial beginners beginner guide, but the UI on the webpage is so badly made, it takes me like a second to locate the 'difficulty'. I've done a bunch of web dev, and I've never seen anything so badly placed besides everything on the amazon website.

I'm making a multiplayer game, and know it's important to implement the functionality from the beginning, so I assumed the multiplayer tutorial was also introductory

#

πŸ™

rocky stag
#

I have replicated property and i replicate that property using push models manually . just curios to know does this property waste cpu cycles on each frame on server or it take cpu cycle after i mark it as dirty ?

vivid seal
#

i put a breakpoint in my ReplicateSubobjects override inside a custom CMC class, but it's never called. Any idea why that might be?

vivid seal
#

apparently the CMC is not replicated lol

eternal canyon
#

oh wait

#

if ur replicating vars within a custom cmc then yea

#

but for default u shouldnt have too

vivid seal
#

Yeah I’m having my CMC manage objects that handle root motion sources. Instead of using gameplay tasks and their component.

barren patrol
#

Any tips or good examples on how to handle client level transitions between menu and games? Do you have a single Menu level that knows if you just started or have come from end of game? where do you persist such state?

urban mason
barren patrol
#

I guess GameInstance is the place I should save the session information between games for the menu to work

agile pendant
#

I need a dedicated server for each match or for each map? (For example fortnige need 1 dedicated server per 100 players in match/a creative match or 1 dedicated server for all the battle royale (normal modes that use the same map) and 1 for all creative?)

dim flame
#

What would be best traffic wise between replicating a widget through component replication or using an actor variable with repnotify to update the contents of the widget?

#

or should I research what component replication does more in depth? XD

meager spade
#

you can not replicate a widget

dusky yoke
#

Hey guys. When I simulate my code on two clients its not working as intended, but if I simulate with the Listen Server and clients it works perfectly. Is this fine? Will the listen server always be active once Im hosting the server?

lost inlet
kindred widget
#

Each match. In your Fortnite example, if there are 1200 players playing, and 100 in each game, all playing the same map, you would have 12 server instances running.

bitter oriole
#

Though in reality more like 10 with 200 players in matchmaking

dusky yoke
#

To iterate on my previous question, I've read that the LSC is a server and a client at the same time - but lets say I setup a hosting service for my game, I dont wanna be connected as a LSC (as its generally a super client and wouldnt be good to debug MP stuff with I guess), but somehow my gameplay requires an active server to function properly. If I simulate as two clients without an LSC it breaks my tracing system for melee combat, but if I jump in as LCS it works for the clients. Did I do a coding mistake, or is this a fine behavior? Im not sure how serverhosting works and if that adds a Server which in this case would replace the LSC?

chrome bay
#

It's impossible to get another players' player controller

#

Widgets are always local. You'd just create two health bars, and assign each bar to one of the other players' pawns.

#

(Assuming the pawn is what contains the health value)

agile pendant
kindred widget
#

That's slightly beyond basic Unreal. That's backend server architecture work. You need something set up so that a user could cause you backend to start a server and then join it. Alternatively, if it's more of a creative mode, the player themselves could host that as a listenserver.

bitter oriole
#

Essentially you need some online service that people connect to and have your server farm spin up a new instance for them

kindred widget
#

The idea behind it isn't that difficult, but it does require backend server knowledge. General idea is to have users have an ID or to use their Steam/Epic ID as their login maybe. Your Unreal game would have code that can interact with this backend to make requests and receive data. I haven't done anything like that in years but last I messed with that it was PHP /VB .NET territory. The implementation theory is very simple, the downside is cost. Running dedicated hardware is not cheap.

agile pendant
bitter oriole
#

Listen server = client hosts, everyone gets kicked if their wifi goes down

#

Dedicated server = your server farm that you pay for hosts the game and clients connect to it

#

Listen server is just ?listen added on the open map URL, costs nothing, but only works for small cooperative games here cheating or being disconnected aren't problems

#

Dedicated servers requires source builds, hosting, some infrastructure, and are generally used for more competitive games with larger teams

agile pendant
bitter oriole
#

Usually by clicking a "join" button on Steam after the host invites them

#

To give one example

#

Depends on your game though

bitter oriole
#

Probably, if you can get your players to create an Epic account

#

No experience with that

agile pendant
#

and a listening server can be done on blueprints or i need c++ too?

bitter oriole
#

Blueprint's fine, though any serious multiplayer work will definitely include C++ at some point

kindred widget
#

Even the most basic C++ can make multiplayerany project incredibly easier.

agile pendant
#

and how can i pass a variable trough dedicated server/listen server? i want to make a 1v1 game with cards and i want to get which number the other player choosed for compare the number and get the higher number or that can be done without pass it trough server?

bitter oriole
#

For a 1v1 game, you probably don't want a dedicated server because the cost will be absurd, so listen server, and your question becomes a simple replication problem

#

Look up some tutorials

dusky yoke
#

Is a listen server generally good enough for a 8-player coop game?

#

In the lines of Valheim (although that uses dedicated servers)

bitter oriole
#

8 is kinda pushing it imho but if the game isn't too heavy it might work

#

Imho the main issue with 8 is that it's probably matchmade at this point

agile pendant
bitter oriole
#

Tutorial stuff, go watch them πŸ™‚

agile pendant
#

fortnite creative is a listening server?

bitter oriole
#

Unlikely

misty plover
agile pendant
#

ok thanks

dusky yoke
#

Very interesting reading what you guys know, thanks for sharing! I generally want the option to host the server as a player (closes when the player quits, listen server right?) and dedicated server hosting. Havent dived too deeply into this yet, but are there any recommended frameworks designed for this purpose? πŸ€”

bitter oriole
#

Imho if you have listen server support there's no point for dedi

dusky yoke
#

The issue atm is that with my setup atm, the combat works when a listen server is simulating with multiple clients, but not without the listen server. So I guess Ive made it support that accidentally πŸ˜‚πŸ€¦β€β™‚οΈ

pastel escarp
#

Hey guys, Any idea how I can pause an online game for all connected clients without breaking replication? ( every thing goes out of sync), I tried pause game and slomo 0 and global time dilation 0, all breaks my game sadly

bitter oriole
#

Dedicated servers are more annoying to support (need a way to update them since clients will automatically do so and be incompatible, need source build of the engine, need different UI, need to decide ho wto host them and how to pay... ) and so generally if your game works under listen servers, it's likely not worth it to go with dedi support and it'll be a big time sink for few players

harsh lintel
#

I have an actor that has a function member that calls a bunch of RPCs server-side, I want all of those RPCs to finish and then I want to call SetReplicates(false) on the actor, is there a way to do that?

bitter oriole
#

Yes, have some counter of RPC sent, and have the server replicate down a counter of RPCs received

#

Obviously after SetReplicates(false) your actor will have no way of reaching the server anymore, though, so that's a final thing

harsh lintel
#

Some of those RPCs are engine calls though so I can't increase the counter there

#

Well maybe if I approach it differently, basically when my character dies I want it to stop replicating after some setup

bitter oriole
#

Then as long as all of these RPCs are Reliable, you can simply send a final one that toggles a replicated FinalRPCReceived bool

#

If they're unreliable there's no credible solution

harsh lintel
#

so I put that final bool RPC at the end of the RPC chain? I didn't know RPCs executed in order

bitter oriole
#

Reliable RPCs do

harsh lintel
#

Oh that's cool, then I'll do that, thanks

harsh lintel
bitter oriole
#

Those are from server to client so I'm not sure they concern you

#

But yes reliable = preserve order

harsh lintel
#

Alright thanks

eager jolt
#

I've made a sliding animation, the server can do this fine, the client gains the sliding effect (no friction) but doesnt enter the animation, any tips?

SOLUTION
Since this i realised my "Start Crouching" & "Stop Crouching" events were not changing the variable required, so I linked them to the "Set Crouching variable"

#

this is on the animation BP

blazing spruce
#

Hi, anyone know the best way to handle network failure? if the host leaves the game it doesn't destroy the session for the clients so it takes them back to the main menu but they then cant host or join another session, im working in BP atm

eager jolt
#

i figured it out nvm

dusky yoke
#

Thanks alot for that insight, Stranger πŸ™Œ

near swift
#

what is automatically replicated in ue4. im watching a tutorial and the guy said root motion is replicated automatically

chrome bay
#

Well, character pawns support it. That's about it

split sentinel
#

Is there a sdk or plugin for steam matchmaking?

warm sequoia
#

Hey does anyone know what I should put in the repnotify function? It is to open a door...

sinful tree
lost inlet
#

that's what I DM'd yesterday lol

warm sequoia
#

it gets weird with the engine cause of the way the door is programmed to spawn...

lost inlet
#

the things after "set w/notify" don't get magically called on the client

#

that's what the onrep is for

dull lance
#

BP ReplicatedUsing is a member from hell though

agile pendant
#

how can i make a level streaming and save the level that the client changes on the server/api? (like fortnite creative when you create a map)

spring saddle
#

Hi everyone, I'm building a map for Unreal Tournament using the UTEditor and I'm trying to make a low-gravity area. for that, what I thought of is make 2 custom events in the player character that set the gravity (one decreases and the other one decreases it back to normal). what I'm currently doing is OnBeginOverlap of the trigger volume, i'm casting to the player character and calling the custom events. it works perfectly fine in editor, but when I package the map and play it on my server, the moment any player enters the volume, all clients (and possibly also the server?) crash. could anyone help me debug this? thanks a lot!

rocky stag
#

I have replicated property and I replicate that property using push models manually. just curious to know does this property wastes CPU cycles on each frame on the server or does it take CPU cycle after I mark it as dirty?

lost inlet
#

the replicator will only compare properties when they're explicitly marked dirty when using push model

kindred widget
#

@agile pendant I would start by making a savable world. But to do that you need to start making a creatable world in a way that you can serialize all of the data and restore it correctly. You question is extremely high level and that kind of thing requires multiple systems working together correctly.

compact trail
#

I've got Issue. My multiplayer game works perfectly in pie, but if I'm using builded game and connecting to local host or other PC in LAN I'm experiencing huge langs.
I've tested creating&joining sessions in pie and it's working fine.

#

How can I fix that?

autumn glen
#

Any information would be appreciated - new to unreal engine, trying to replicate a character's head rotation, works as the server client (ofc) but client is receiving and updating movement, however as you can see in the print string the rotator is being set to the new rotation, then 0 0 0 again. Happy to send over the BPs if needed for feedback

meager spade
#

I assume your rotating your capsule when you rotate the head and counter rotate the body to stay still right?

autumn glen
#

I'm not - I'm instead just disabling orient to movement when I'm not moving

#

😬

meager spade
#

show the bp

autumn glen
#

You wanting the whole thing for head / body movement?

meager spade
#

the relevant stuff

autumn glen
meager spade
#

well for starters, you should never set variables in the animbp

#

the animbp should always pull those values from the pawn/character

#

what calls UpdateHeadRotation?

#

seems like that is running on server and client

autumn glen
meager spade
#

that will not work..

autumn glen
#

I've followed a tutorial type deal for most of the head movement which included the BP variables, I wasn't aware about not setting variables in animBPs

meager spade
#

anyway, it should be replicated by default

#

you should be able to use GetBaseAimRotation

#

and use the Yaw to determine where your looking

#

no need to replicate anything

autumn glen
#

Still mega new to all this, thanks for the information I'll try working on it from that, thanks

meager spade
#

do it simple first

#

just 3 nodes

#

GetBaseAimRotation -> Set Head Rotation on AnimBP to it

#

2 nodes*

autumn glen
#

Ok looking good just from that change

#

So what's being replicated by default here?

#

Ah right, baseAimRotation is already replicated so by using that, each client already knows the values and is using that for head rotation got ya

#

Although it does still seem like the server is seeing more movement than the client?

meager spade
#

did you turn on use control rotation

dim flame
#

hmm this problem is kindof obnoxious to solve as a newer unreal user

meager spade
#

and disable use rotation yaw on the pawn @autumn glen ?

dim flame
#

is there something special that happens as a host for a listening server when you destroy its actor and restart its controller?

autumn glen
#

I had use rotation yaw disabled, but also had control rotation disabled

dim flame
#

because as soon as my host gets destroyed and reset it the server stops reacting to things happening to replicating actors that are attached to the clients

#

if the host is no longer looking at the clients

autumn glen
#

Enabling control rotation now means that the client sees the server turn it's head along with its body, however the server cant see the client's body moving

dim flame
#

as soon as you rotate the host camera to see them, it all works fine

#

rotate away it stops working again

meager spade
#

@autumn glen that is weird, cause it works fine for me using that

autumn glen
#

hmm

meager spade
autumn glen
meager spade
#

host on left looking and client rotating

#

ignore heads missing on clientside (PIE bug we got atm :P)

autumn glen
#

Yeah that's pretty much what I want - looks good. Could be an issue on my side due to something I may have changed in the blueprint or something

meager spade
#

yeah i am not sure what else i can really say

#

apart from check your logic, but it should be simple

#

you do need to change the control rotation on all clients and server

#

else they will act weird

dim flame
#

hmm i mean you could simply calc on server and send the transform through an interface to the bpa if you wanted to force it no?

#

like states

autumn glen
dim flame
#

thats what I do for my upper body blocking

#

first is bpa

#

second is character

#

with a simple interface

#

set on the bpa

#

should be able to do exactly the same thing for head

#

and transform

#

pretty new to this aswell but that works fine client and server, just gotta move some logic to the client

#

I send the wanted state through a run on server event on client, check some stuff on the server then run the multicast event with the bpi message

thin stratus
#

"State" is exactly what you shouldn't Multicast :D

#

Anyone coming in later or hotjoining won't get the info on that

#

OnRep Variables are for State stuff

dim flame
#

its just a custom int enum but you just aswell replicate the variable , but i'd still send the client input to the server through event

#

afaik servers dont get knowledge of onrep variables set on client

#

in this project the state is for telling the server if the player is trying to hold up its shield or not and also used in the bpa to activate upperbody slot blending

#

either way not sure why I got stuck on this issue

#

got my own problems with the host restarting thing...

dim flame
#

is there another way to send information reliably from the client?

#

built in that is

meager spade
#

Reliable Run on server event

#

its guarenteed to arrive on server.

dim flame
#

but this riddle I cannot solve, what could make a restart somehow make line traces not generate hits on pawn capsules if server isnt looking at the traces or capsules?

#

is the capsule not reset to defaults if you destroy the entire actor and reset the controller?

#

or does it somehow change the server collision settings?

#

mm thats what i've been doing

#

for changing my wanted blocking state on server

#

but its unrelated to this anyway, im not having a problem with that atm

#

was just trying to assist

#

i mean is there a setting you can set that could make changes which connect that players view to which hits are being generated by traces?

dim flame
#

the traces are running on the server

#

but the hits are not being generated

#

except when listening server looks in that direction

#

thats as far as i've been able to debug it

#

I can turn the hits on or off by simply rotating the server local player camera

dark edge
#

@dim flameI've seen this before, it's something to do with not updating if not rendered

dim flame
#

would the server player somehow get changed settings regarding that when character gets destroyed and controller restarted?

#

or is the server player somehow losing the active status of the clients?

dim flame
#

omg

#

I wonder why its working before the player reset

#

but I found the solution

#

Visibility Based Anim Tick Option on the player mesh is not set to always tick pose and refresh bones, its just set to tick pose

#

but somehow that doesnt matter before restarting the server player, making it obnoxious

#

thanks

#

anyway that meant my linetrace sources werent moving

#

because they were attached to sockets on a seperate weapon actor attached to handsocket on pawn mesh

#

been stuck with this for a while

#

its set to default on new actors with new skeletal meshes

#

but I started this project building off third person template

#

hmm or maybe its default for actors inhereting from character

#

shrug

waxen umbra
#

Is there any way I can, on the client side of things, say "I'm taking ownership of this actor now, and I don't care what the server does anymore"? I have a server controlled actor that I want to destroy but let the client keep purely during an animation

#

It's a magazine for a gun. I'm destroying it on the server and instantly replacing it with the new one, but I want to let the client keep it as a simulated object and/or hold it in their hands during an animation

dim flame
#

keep them seperate maybe?

#

spawn a seperate version only on the client on destruction?

#

theres set owner but I havent used it

tight glen
#

Is there a good way to verify you are making modifications to the correct game instance? I am holding variables in a game instance but when the client RPC calls it modifies it's own game instance and the server never modifies it's version of the game instance.

sinful tree
tight glen
#

So how would I store variables/values onto game instance to keep to load after server travel?

sinful tree
#

Make sure you're running on server first, then do a Get Game Instance.

#

if the server itself is triggering the move, then you should be able to get into the server's copy of the game instance from there, before you're doing the move.

tight glen
#

Okay so I can’t call rpc directly then. But I can have an rpc that when executing on server gets the values and modifies it’s game instance?

#

Thanks for the assistance I will give this a shot tomorrow!

compact trail
#

?

silent valley
#

I would guess it's not network related. Maybe loading? Check the logs for any errors or repeated spam.

twin juniper
#

Hello, I would like to ask if it is better to do a multiplayer game (I love mp games, I can't play sp), or do I prefer a sp game, I'm a beginner?

dim flame
#

you def dont wanna end up in a situation were you havent designed for mp and want to add it later so

#

and i feel its easy to learn ineffective design when you dont have to think about mp

#

but do at your own pace

true grotto
#

Hi there! I have a problem with broadcast. I create the dinamic multicast delegate:

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnHPChange, float, HPStat);

I Declarate him:

UPROPERTY(BlueprintAssignable, Category = "HealthComponent | EventsForBind")
FOnHPChange OnHPChangeBind;

And i call him:

void UKT_HealthComponent::BroadcastsHPAndSP_Implementation(const bool IsHPBroadcast)
{
    OnHPChangeBind.Broadcast(Health);
}

But it is not called. My function listening to calls does not fire. What could be my problem?

#

I run in Play as Client mode

empty axle
#

you either broadcast before you bind
or you are not binding to the broadcasting component, maybe to some other one?

#

@true grotto

true grotto
#

I'm binding to Begin play, broadcast only after begin play

Character->HealthComponent->OnHPChangeBind.AddDynamic(this, &UKT_MainHUD_WD::UpdateHP);
#

For some reason, everything works when issuing UFUNCTION (NetMulticast, Relaible), but when it does HP incorrectly counting and I would like to avoid NetMulticast

empty axle
#

that delegate will for sure not work across network

#

if you fire server-side it won't fire client-side

true grotto
#

That is, I cannot run delegates on only one side?

empty axle
#

in most cases health should be a replicated variable with onRep in which you call your delegate and then based on that you update your UI or whatever

empty axle
true grotto
#

@empty axle Ok, thanks for help)

manic agate
#

hey guys, is there a delegate/overridable function somewhere that is called on the client when it's kicked from the server?

#

I only found a void ClientWasKicked(const FText& KickReason); inside APlayerController which is called on the client when kicked, but its body is literally empty, and it's not overridable

chrome bay
#

It's a Client function so you can override the virtual _Implementation part

manic agate
#

oh really? didn't know that πŸ˜…

chrome bay
#

Another reason I don't like GENERATED_UCLASS_BODY is it hides those extra declarations from you, but also always makes them virtual even if you don't need them to be πŸ”«

manic agate
#

yeah I had no idea actually, thanks for the tip!

#

so that's the only place where the client gets actually information of him being kicked, right?

manic agate
#

It's fine actually, that function is all I need πŸ˜„

#

Bonus question: what happens when a player gets kicked out in real situations? I could only test in the editor at the moment, and there it simply ends the PIE session

#

it should open the startup map, correct?

chrome bay
#

Yeah they go to whatever the "Entry" map is by default

manic agate
#

got it, thank you Jambax!

rocky stag
regal flower
#

I'm trying to pass custom USTRUCT as an network multicast RPC argument. It is okay on the server but on the client I've got zeroed member values.
Could you please point what is wrong? I'm not using custom serialization

#

Seems like there isn't default serialization in this case

#

So, am I right? πŸ™‚

chrome bay
#

The internal properties a UPROPERTY()?

#

Only UPROPERTY()'s are serialized

regal flower
#

Just bunch of other custom structs (non-USTRUCT). No UPROPERTYes inside

chrome bay
#

Yeah won't work then

regal flower
#

okay, thank you for quick help!

chrome bay
#

They either need to be UPROPERTY() themselves, or you can use custom net serialization

harsh lintel
#

I have a character, it has a function that is a Client RPC, I'm calling that RPC on the server, also when I call this RPC, on the next function I call I possess another character/pawn, but I have to put a delay to the possession, otherwise the client RPC isn't called at all, is there a way to go about fixing this? the Client RPC is part of the source code of UE4 so can't modify that

lost inlet
sinful tree
chrome bay
#

It's likely that it's being rejected on the Client, since it would see that as a Client RPC on an object it doesn't own and would ignore it.

#

RPC's are sent instantly rather than waiting for end of frame so it's unlikely that the Server is rejecting it I would think.

harsh lintel
chrome bay
#

Well Multicast doesn't require that the player owns that actor to execute it, whereas a Client RPC does

harsh lintel
#

yeah but a multicast executes on every client except the client possessing a new pawn

chrome bay
#

Are you sure that actor exists on that client?

#

I.e. the client hasn't destroyed it locally, or it's not net relevant etc?

harsh lintel
#

hmm let me check

chrome bay
#

ATM it sounds as if no RPC's are being executed on that actor, for that client

winged badger
#

i'd start with the question "do i really have to send the client RPC there?"

#

what does it do?

chrome bay
#

It does seem risky to call a client RPC on an actor you're about to change ownership of

harsh lintel
#

it's to stop all character abilities when it dies (GAS), and possess an spectator pawn on death too

winged badger
#

so

#

it has no payload, its just a vanilla RPC call?

#

in which case, override AController::SetPawn, do GAS cleanup before you call Super

chrome bay
#

^

#

SetPawn ftw

harsh lintel
#

Well I'd have to check the plugin, I just gave a generalized example, because im calling AbilitySystemComponent->CancelAllAbilities and that should end all abilities on the server which should end them on clients, it ends the abilities on all clients but not on the client dying/possessing

winged badger
#

it runs both on server and client btw, SetPawn

#

prior to super, your Pawn is still the old Pawn

chrome bay
#

Presumably it's not ending on the controlling client because of prediction maybe?

#

Not that familiar with GAS though

#

Should only need to call that Server-side unless I'm missing something

harsh lintel
#

Oh I just noticed, when I possess the new pawn, the old pawn (at least the mesh) disappears

#

but it doesn't disappear on other clients

chrome bay
#

Yeah sounds like that client is destroying it locally

harsh lintel
#

I'm printing a string on the Destroyed event, and it's called at the right time

#

same as other clients

#

maybe it is not network relevant for the client possessing the new pawn?

chrome bay
#

Possibly, but you would see the Destroyed call

#

and it wouldn't happen instantly, relevancy takes a few seconds

#

(by design)

harsh lintel
#

yeah nevermind, the pawn is still there

#

I'll try SetPawn 🀷

chrome bay
#

Anybody ever experienced being in a steam dedicated server but the client not actually having any session info?

#

It's like i've joined the server and am in the map, but haven't joined the session itself.

#

Having to use open steam.##### console command to join, and I get into the session but have no session for NAME_GameSession

#

Digging throgh engine for a couple of hours and none the wiser currently as to where they actually join the session from automatically..

winged badger
#

if you have a console available, you sure its not rogue piece of debug code that did something unspeakable?

#

like someone connected directly to server via IP

meager spade
#

@chrome bay i had that before

#

(when we were using UWorks :P)

peak sentinel
#

I guess/hope there are better practices than this guide?

#

Multicasting for turn in place sounds weird

dim flame
#

woudlnt you just make the client bpa play the animations depending on its local rotation?

blazing spruce
#

Hi, how can i disable buttons on the clients lobby screen when the host clicks the start game button?

sinful tree
#

When the host clicks the start button, set the boolean.

mellow gate
#

I'm just now getting into MP for the first time really, after several years of avoiding it, and I'm immediately running into an issue I don't quite understand.
I have a character actor, and a Tool actor. The character receives an input to Use the tool, and the tool then performs some local stuff for input queueing etc, followed by an event call marked with "Execute on Server" to actually perform the action.
The issue is that the event is never called on the server.. somehow. When spawning the tool actors, I do spawn them on the server by checking for authority. The tools are also owned by the same player controller that owned the pawn when they spawn (on begin play). The Tools are replicated.

#

I have confirmed that the event that's not being sent to the server is actually being called on the client.. so it's just not actually being replicated to the server

sinful tree
#

Are you getting any error/warnings in the log?

mellow gate
#

ohhhhkaaayyyy that's really cool, I figured it out.. sorta? I'd liek an explanation. When I create the tool, I was just passing owner into the spawn actor node in bp. I never actually called Set Owner because.. that's what I would assume was happening there?

#

Why does the owner argument (which as far as I know is just an interface for FSpawnActorParameters, same as c++) not actualyl set the net owner?

#

it even says in the tooltip that that's what it's for?

kindred widget
#

That value should be setting the owner. There's very few conditions that would stop that being set.

#

@mellow gate Worth asking. After setting the owner manually, you can RPC without any other changes?

mellow gate
#

Hm, it seems so yes, I'm able to use the tool more or less nromally

#

I am having some wierd behaviour with replicating what exactly the tool did, but I haven't done any work to make that work in mp yet

#

it animates and queues etc as expected

sinful tree
#

My guess would be that the "owner" doesn't exist before the object is being spawned if you're spawning it on beginplay somewhere. Passing in the owner should be sufficient on the spawn actor node.

kindred widget
#

Weird. If you care enough to find out why and you're working in an IDE, you could breakpoint SpawnActor in LevelActor, or SetOwner in Actor. Might tell you what is up.

mellow gate
#

this is ran on beginplay

sinful tree
#

On Beginplay of what?

mellow gate
#

Oh, sorry, the player character bp

sinful tree
#

The character may be getting created which fires the begin play before the player controller possess it.

mellow gate
#

Ah, so it may be unreliable to create the tools on beginplay

sinful tree
#

You can possibly do it OnPossess.

mellow gate
#

Ah, yeah makes sense

#

ok, well, I'm on my way again at least, this is gonna be interesting. Thanks for your help!

kindred widget
#

It's also worth noting that you can use Self for the owner as well.

mellow gate
#

that's what I tried at first, with the same result

dim flame
#

mmm no need to get owner afaik

sinful tree
#

My testing confirms it - I spawned a replicating actor on Beginplay of the character on the server, but I couldn't RPC through the actor. Changed it to use Possessed, I could then RPC through it.

mellow gate
#

I've swapped it back to self now, and that works fine with the manual SetOwner

dim flame
#

I had this problem with animation montages on begin play before I moved them

mellow gate
#

I'll give delaying the tool creation to OnPossess a try

dim flame
#

could be dirty hacked with a delay

#

to see

mellow gate
#

It actually seems inconsistent now, at least on beginplay

dim flame
#

does it work with a 5 second delay?

mellow gate
#

I think sometimes the playercontroller may possess the pawn before the beginplay runs on the pawn,. and sometimes it waits till after?

kindred widget
#

Beginplay isn't the best place to call most network things.

mellow gate
#

either way, waiting any amount of time, or until OnPossess will defs fix it

#

That makes sense yeah

dim flame
#

beginplay is really wonky yes

kindred widget
#

This might be something to consider putting into the create default pawn code in GameMode too.

dim flame
#

the order of operations is wierd

#

esp with level streaming XD

quasi tide
#

I've had issues with relying on OnPossess personally.

kindred widget
#

If this tool relies on the pawn, but only needs created once, it's best to have a pawn value on the tool you can set from controller's possession. Then just create the tool with the controller and leave it connected to the controller when trying to use it, test if pawn is valid, if not, try getting valid pawn from controller, if no, deny use. Otherwise you're looking at creating and throwing these away if you have respawnable pawns, or you're going to have netcode gating all of the time on possess/beginplay.

mellow gate
#

Ah, at the moment I'm just creating tools from beginplay for testing/learning purposes