#multiplayer

1 messages Β· Page 647 of 1

chrome bay
#

You need the debug symbols, you aren't going to get anything useful without those.

#

Engine is crashing "somewhere", that's all that tells you

bitter oriole
#

Use the debugger, with engine debug symbols installed. You'll have access to the entire engine and game state and so you'll find out which variable was null

summer tide
#

I had DevEditor config selected, I'm now building using DebugEditor to see what happens

bitter oriole
#

Dev is fine

#

Just make sure you're running the debugger to see the local vars & callstack

faint pawn
#

in very broad terms, how would one implement skill based matchmaking?

summer tide
modern cipher
brazen sluice
#

Hello I have an issue where the character jitters when it's in the air, and I'm not sure what so different then - something to do with physics?

#

(I mean in multiplayer - client only)

faint pawn
#

i was just curious to know whether resources on this specific matchmaking existed online, so that i can safely implement it without causing any troubles for my coworkers

brazen sluice
#

@faint pawnI'm assuming at some point you'd need a 3rd party server that hold the list of game with a SR associated to them

#

Whether you build it yourself or not

#

if you are using a public based game, I wonder if you could cheat the system into using the "public connections" attribute normally, and the "private connections" as the SR (assuming SR is always higher than public connections)

#

So that locally the game could choose which game to join, by passing the need for a 3rd person server. might be hard to balance the games though without a global view and so on

faint pawn
#

i see

#

thank you

bitter oriole
#

Cool

#

Check the call stack now

summer tide
#
Exception thrown at 0x00007FF911B112DE (vcruntime140.dll) in UE4Editor-Win64-DebugGame.exe: 0xC0000005: Access violation reading location 0x0000000000000000.
Unhandled exception at 0x00007FF911B112DE (vcruntime140.dll) in UE4Editor-Win64-DebugGame.exe: 0xC0000005: Access violation reading location 0x0000000000000000.```
bitter oriole
#

The callstack panel is on the same screen

#

Get it from the Debug -> Windows menu if not there

#

You have a nullptr access - good old segfault, as old as time

#

Find out where in the callstack things get called on nullptr

chrome bay
#

<@&213101288538374145>

#

..why are these popping up all the time

#

lel

minor anchor
#

hacked accounts

summer tide
chrome bay
#

Debug->Window->Call Stack

#

And you need to be actually debugging to see it

summer tide
bitter oriole
#

Anyway, we got it

summer tide
#

THat's from VS

bitter oriole
#

Sounds like an actor is corrupted here, or otherwise destroyed while edited

#

Did you use hot reload ?

summer tide
#

No i never HotReload. It's unchecked

#

So that happens when my existing BP_ActorComponent's parent class get changed to the new c++ ActorComp.

bitter oriole
#

Show the code for that class

bitter oriole
#

Weird. Is the Blueprint looking okay ? No empty detail panels or the like ?

#

Do other parent classes work ?

summer tide
#

Other c++ parent classes work. It could be the BP ActororComponent that breaking it. but it works fine as it as BP

bitter oriole
#

Try reparenting to another class

summer tide
#

Yes that works fine.

#

So in my Bp i've some functions and some variables. Also it has a child BP

#

Also an interface

smoky plinth
#

@shadow hatch you should probably do it on a "OnRep" rpc

shadow hatch
#

Yeah, that was my previous method, sort of, but i do enjoy how an an animation blueprint can seamlessly change the characters animation onrep seems a tad clunky

leaden garden
#

Hi friends, Respect for being in this field
Personally I'm been playing Soldier of Fortune 2 since it's come out to this day
There have been plenty of attempts to obtain the source code, through engagements with Raven Software and Activision
By converters to other engines like jk and spearmint
Until we created part of the game in Unreal Engine 4.25.3
Lots in c ++
I'm looking for someone who wants to help lift the project back, for a fee of course
Can contact me

dark edge
#

Inb4 C&D. Don't use other people's IP.

leaden garden
#

k

regal storm
#

If I've got references to playercontrollers in multiplayer in order to determine which player I'm acting on in some way, and that player disconnects from the game, how do I maintain that sense of ownership or avoid someone taking over their exact playercontroller references from then on? Would it be a case of storing a list of all players in the game and assigning each one an int and checking against that instead?

severe widget
#

(linking my response for continuity of discussion)

regal storm
#

Thanks! Wasn't sure they were the same question really πŸ™‚

severe widget
#

@regal storm let's talk more about this int plan of yours

#

I think it's a bad idea to use anything other than the net ID of a player (easily reachable from player states and controllers) for any internal bookkeeping - but even if you do track an int or something, how will that assist you here?

#

What does it solve

regal storm
#

Ahh sorry, here not the other place πŸ˜„

#

That's fair, I guess I'm sort of coming from a database perspective, I need to keep all of these players who have been on the server stored and accessible regardless of whether they're online or not. I don't know why but I assumed having an int as a key to retrieve the netID would be more appropriate in that case

#

But I'm happy to be incorrect πŸ˜„

#

I just need to have a record in a particular actor of who 'purchased' (in-game currency) the actor and use that information to determine who can and can't make changes to the actor through interaction

severe widget
#

Unless you strictly need sequential keys, I think the NetID is probably fine for ID purposes.

#

If you do need sequential keys, then I'd suggest some sort of wrapper so you can leverage the type system to ensure people are looking through your system to get a number - eg, GetEntityIDFromNetID

#

or GetNetIdFromEntityID

#

EntityID being a standin for your gamelogic ID for a player - but also being an actual type

#

whatever you want that nomenclature to be.

#

The net ID is not likely to be the display name outside of the Null OnlineSubsystem

regal storm
#

Wonderful thanks! Multiplayer is new to me, so it's a bit of a maze to figure out. I keep referring to the Network Compendium πŸ˜„

severe widget
regal storm
#

Yes, I've been meaning to read up on the latter!

severe widget
#

(those aren't per-se the same thing, EOS is a particular subsystem/provider)

regal storm
#

I'll check it out before I end up diving too far into anything πŸ™‚ Thanks!

severe widget
#

np! glad to prevent that extra layer of complexity

dark edge
twin juniper
#

Guys, I have coded the necessary functions to manage sessions, but I still have this weird behavior. I spent the entire afternoon trying to figure out. You see, i just used Sessions because my second player is possessing a Pawn, his input are being registered, but his pawn don't move. Also, I'm changing, in my custom GameState::OnRep_MatchState, the ViewTarget of the PlayerController, but only the ViewTarget of the first player is changed. Before coding the session thing, I was getting a warning telling me a lack of GameSessions, and I thought it was the reason behind this behavior. Now that I have a working seesion, the problem remains. Have you ever encountered something like this? Here is the video: https://youtu.be/T5_TIdBeFiw

#

As you can see, in the messages, both players are possessing pawns, and their input are being registered

sand iris
#

Are replicated variables functional on Online Beacons?

fading birch
twin juniper
#

kk But I'm doing a ServerRPC, where I ask the server to SetActorLocation based on the Movement FVEctor

fading birch
#

there's no need to do that

#

make it a character

#

and utilize the character movement component

twin juniper
#

Character Movement Components are automatically replicated?

fading birch
#

yes

#

well, as long as your set replication to true

twin juniper
#

bReplicates = true, right?

fading birch
#

the character movement component handles replication

#

yes

twin juniper
#

kk thanks!

kindred widget
#

CMC uses it's character to replicate.

#

It was largely coded before Components were given replication.

twin juniper
# fading birch the character movement component handles replication

Also, do you have any idea why the second player ViewTarget isn't changing? I'm doing this in the GameState: ```void APongGameState::OnRep_MatchState()
{
AGameState::OnRep_MatchState();

UE_LOG(LogTemp, Warning, TEXT("The game state has changed."));

if(MatchState == MatchState::InProgress) 
{        
    APongCamera* MainCamera = Cast<APongCamera>(UGameplayStatics::
        GetActorOfClass(
            GetWorld(),
            APongCamera::StaticClass()
        )
    );
        
    if(MainCamera)
    {
        APongGameplayController* PlayerController = 
            Cast<APongGameplayController>(GetGameInstance()->
                GetFirstLocalPlayerController());                                    

        if(PlayerController)
        {
            GEngine->AddOnScreenDebugMessage(
                -1,
                10.f,
                FColor::Green,
                TEXT("Player's point of view changed.")
            );

            PlayerController->SetViewTarget(MainCamera);
        }    
    }
    else
    {
        UE_LOG(LogTemp, Warning, TEXT("There is no camera in the level."));
    }        
}

}```

twin juniper
twin juniper
#

I implemented fog-of-war/line-of-sight on my game, the fog of war is just a post-processing effect, but I was wondering how would you recommend making actors stop being network relevant when outside the range of vision, like in a MOBA? Under the hood the fog of war is just line-traces that serve to draw triangles/polygons.

#

I have some ideas but might as well ask first

dull lance
#

@twin juniper the "Easiest" method is to have your fog of war also being your immediate network manager

thin stratus
#

@twin juniper You can override IsNetRelevantFor in your actor (c++) for example

twin juniper
thin stratus
#

If it's visible by the viewer i guess

#

Maybe shootergame or ut have some code for it

twin juniper
#

or unreal tournament

thin stratus
#

Has also nothing to do with fog of war

#

Fog of war is mostly a visual feature

#

The underlying code for stopping actors to replicate when they are behind walls or similar is the same

#

You just swap out the stuff they do to detect walls with you detecting if your actor is in the fog

fading birch
#

You can take it a step further too

#

and just not replicate anything not in your field of view

ripe ravine
#

Hey im using advanced sessions plugin and im having trouble on making a character select screen. Any tips to point me in the right direction?

#

Or easier, how can I save variables onto individual clients? That way I can just save the class I want them to spawn and possess

limber gyro
#

let me see if i can find it

#

here it is

#

In this video we take a look at the finished project and step through each of the features that will be covered in this series. We show our functional Main Menu and its options, a lobby where players can chat with one another and select their characters for the game, some server options such as changing the map or match time as well as the abili...

β–Ά Play video
ripe ravine
#

Appreciate it, I'll check it out

limber gyro
#

it was quite helpfull to me

shrewd tinsel
#

anyone had hands on with epic online services?

#

does it require c++ knowledge?

thin stratus
thin stratus
# ripe ravine Appreciate it, I'll check it out

Please keep in mind that this specific Tutorial Series is kinda garbage. They teach a shitload of wrong things in it.
I called them out ages ago, but they never did something about it. There is a long Forum thread going over that stuff.
Things like RPCs in Widgets, Replicated PlayerController Arrays in the GameMode. Lots of stuff that makes no sense and is plain wrong.

#

Even the freaking Thumbnail of that Embed message of the First Episode has Replicated Variables in the GameInstance

#

Like, man this makes me so sad, even after all those years

shrewd tinsel
#

if i destroy controller will that destroy player state and controlled pawn also?

tardy fable
#

hey, does anyone know how i could smooth physics movement in clients? Physics replicate properly but are jittery af, and thats not pretty to look at tbh.

dark edge
tardy fable
keen cairn
#

Hopefully a simple solution as I'm suuuper new to multiplayer:

#

The server doesn't receive the pawn, it doesn't possess anything

#

Does anyone know why this might be?

dark edge
tardy fable
#

1 sec

tardy fable
#

this part you mean?

#

this is all that i could find related to networking and replication when it comes to physics

dark edge
#

Yeah try turning the error per linear distance down a bit, also the error per angular

#

With stock settings it'll be considered to be in full error at 1cm position diff or 1 degree angular diff which is pretty small

tardy fable
#

i've been trying different values but all seem to give the same result

#

they all havethe problem where the objects go around jittering. If i set it to 0 it goes smooth for a while and then goes nuts jittering until it corrects itself again...

#

ahhhh i've made a different change which seems to be working tho, changing the

#

"max restored state error" thing

#

if i set it to 10 and the other 2 to just 1

#

it works smoothly and the error is small enough to not affect gameplay

#

that did the trick thx man

dark edge
#

Ya that's the same as 1 with other .2 and .1

#

I wouldn't get too invested in this old physics replication system though, I think it's getting thrown out with chaos and they've moved to a new system

tardy fable
#

yeah but im working with an older version of unreal F

#

i'll try to update when i can but i think it could potentially break all of what i've done with physics here... maybe? idk

viscid bronze
#

Im using a particle system and some code to make a laser sight
How do I make it so that the laser particle system is only visible on the players screen and not to anyone else, and the code runs on only that player with the laser sight?

dull lance
#

Dedicated server or P2P?

viscid bronze
round star
#

Anyone here good with physics/optimization/multiplayer stuff? lol

#

I need to find a solution that is as performant as possible, but can handle possibly a hundred or so objects that fly around from a simulated wind field (in this case this was tornadic damage) Currently the sphere collision gets an overlapping component == to component with a specific tag. If true it adds it to an array of these components that have their physics simulated. I am calling on tick every 0.05 seconds. Once the component stops moving it's removed from the array with its physics turned off.

I know this is not the most optimal way to do this. I could use the help

#

tick is only on when the array has at least one element

shy hill
#

Hi everyone, I'm new the multiplayer. If I simply want to change an actor's sprite (with an event called by the server) and replicate it on all clients, ticking the 'replicate component' on the sprite component doesnt seem to be enough to replicate it, do I necessarily have to multicast the 'change sprite' event ?

thin stratus
#

Yes and no

#

It is indeed not enough to just replicate the Component, because the variables inside would also need to replicate :P which they usually don't.

#

A multicast would solve your problem (if executed from the Server), but people who join later or come closer into relevancy range, would never get that update

#

You want to use a RepNotify variable instead.

#

And then set the sprite in the Rep Notify function that UE4 generates automatically

#

If that doesn't tell you anything, then I would advice reading the compendium that is pinned to this channel

shy hill
#

Awesome, thanks a lot for clarifying ! I'll try that πŸ™‚

fading birch
#

Cedric: "Read the guide I wrote, thanks"

#

πŸ˜›

naive elm
#

besides being in range (min<val<max ), what other validation to the input are usual?

gleaming vector
fading birch
#

I was more just poking fun

#

I use that guide almost daily

dark edge
round star
#

I have a question about replicating physics. Could you just have the dedicated server run the physics simulation and simply replicate the mesh transforms? Or is this how it works already in the backend?

unkempt tiger
#

you can do that yeah

round star
#

Because replicating actual physics is kind of stupid

#

for m y case anyway. I can potentially have a hundred or more objects.

#

So long as they 'eventually' end up in the same positions for everyone is all that really matters

fading birch
#

you could fake the funk so to speak

#

use set actor location to determine final position and have clients execute physics for X amount of time until it gets there

#

could lead to some weird results though

round star
#

It's a fairly large problem that I need to solve for my project

#

as destruction is a big element of the gameplay itself

#

If I could hire someone familiar with physics and replication to develop a solution I would pay for something proprietary

unkempt tiger
#

what is the nature of the physical objects, what kind of ways are they going to interact with players?

#

in your game that is

round star
#

Well, it's a storm chasing game. So that speaks volumes if you can imagine.

#

So if house/tree or whatever is damaged and it has pieces that are moving around and land somewhere, it needs to match for everyone

#

Otherwise it would be a bit silly

#

So its not really the player interacting with them. I mean sure if a large tree lands on the road youd expect it to block your vehicle..but that is simple enough. its the weather interacting with the objects

kindred widget
#

Does anyone know off hand what the size of a typical GameplayTag is?

fading birch
#

I think most games handle that by using predetermined physics to ensure everyone sees the exact same thing

unkempt tiger
#

do you mean baked physics sims?

fading birch
#

yes

round star
#

The world is dynamic so a tornadic event may be here, may be there, may be small, may be violent etc

#

I have stayed away from the physics part of all of this for this reason

#

I am not sure how to approach it

fading birch
round star
#

Ah I didnt see the physics section XD

#

Thanks btw

fading birch
#

it's an interesting problem, lmk what you come up with

unkempt tiger
#

if you have a lot of physical objects, as you said hundreds, but you don't need them to be super low latency

#

I would go with snapshot interpolation through replicated properties

#

but with a high enough render delay

#

let the engine do the network prioritization, each object will have an arriving packet every X seconds, meaning you could get away with about 2X or 3X render delay

#

objects will render smoothly that way and won't result in lots of snapping

#

but that could also increase CPU performance a bit too much

fading birch
#

you could put that on the GPU no?

#

that shouldn't be ran on the game thread anyways

unkempt tiger
#

interesting, what GPU api do you have to do that kind of stuff on it?

fading birch
#

I don't

#

I'm not super familiar with this area

#

I just read rendering and thought you could move that off the game thread

unkempt tiger
#

ah, yeah ideally not on the game thread

stray oxide
#

Im having something weird happen. I am doing a server travel from my lobby when it hits a certain amount of players. It travels the clients but not the host. This is a listen-server. Anybody ran into an issue like this before? Thanks

viscid bronze
#

Does anyone know how to Spawn Emitter Attached in a way that other players cant see the particle effect, and everyone can only see their own particle effect

kindred widget
#

@viscid bronzeReally depends on the implementation need. What's the particle for?

viscid bronze
kindred widget
#

Likely just base it off of whether the weapon actor's owning character is locally controlled. Alternatively, some multiplayer stuff uses two different meshes on the same actor for first person/other people's view. Could be hidden from other players that way. Either way likely works.

viscid bronze
#

Ok, I guess that could work, thanks

twin juniper
#

Hello everyone.I already have a project with blueprints with legacy replication like multicast,rpc etc.How can i integrate replication graph in this project??.Thank you

twin juniper
#

Hi, i'm using Steam Advanced Sessions Plugin. I want to know something. How can i use FString UAdvancedSteamFriendsLibrary::GetSteamPersonaName(const FBPUniqueNetId UniqueNetId)? I mean.. i was trying to do:
FBPUniqueNetId bFBPUniqueNetId;
bFBPUniqueNetId.SetUniqueNetId(??????); //dont know how to get unique net id from pawn actor..
bNickname = UAdvancedSteamFriendsLibrary::GetSteamPersonaName(bFBPUniqueNetId);
Thanks for help

#

does steam advanced sessions work in ue5?

foggy rain
#

Is OnRep called on the server?

dark edge
twin juniper
#

Hello everyone.I already have a project with blueprints with legacy replication like multicast,rpc etc.How can i integrate replication graph in this project??.Thank you

chrome bay
#

Rep Graph is C++ only

#

But the core replication machinery of actors isn't any different

thin stratus
#

Aaaaalso, "Legacy" would mean normal Replication is outdated :D

#

James, time to make a blog post about Replication Graph

chrome bay
#

Haha yeah.. still a bit of a black sheep it seems

thin stratus
#

I think a lot of people would be very happy and thankful

chrome bay
#

to be honest though unless you've got crazy high player/object counts, it's not going to benefit you much

thin stratus
#

Yeah but it's always cool to have some custom docs with examples on more tricky systems

chrome bay
#

yeah for sure

#

I'll add it to my backlog πŸ˜„

foggy rain
chrome bay
#

no

#

You don't do anything different at the actor level when using replication graph, except when it comes to functions like IsNetRelevantFor() which are no longer used.

#

Rep Graph is almost entirely a Server-CPU optimisation, so unless your server is spending a lot of time working out which actors are relevant to which connection, it's not going to be of much use to you.

thin stratus
chrome bay
#

tbf I do that as well but mainly because it just doesn't have a name πŸ˜„

foggy rain
chrome bay
#

OnRep's are only called on Clients in C++

#

Still unsure why Epic made them behave differently (aka, wrongly) in Blueprint

#

But I guess it's too late to go back now

#

If you want to call it on the Server though, you can just call it manually

foggy rain
#

But it works on the server too...

#

The code:

void AGardumPlayerState::OnRep_Damage()
{
    DamageChanged.Broadcast(Damage);
     GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Yellow, FString::Printf(TEXT("%f"), Damage));
}
chrome bay
#

You must be calling it yourself

#

How do you know that isn't the client then :D?

foggy rain
#

I see the message on the screen on a listen server and on a client

thin stratus
foggy rain
#

Maybe it's because a listen server is like a client + server?

chrome bay
#

nah

#

100% garauntee it's only being called on client

#

If you add something to check whether the actor is on server/client it'll show it more clearly

foggy rain
#

How can I do it?

chrome bay
#

Something like
const FString Domain = GetWorld()->IsServer() ? TEXT("Server") : TEXT("Client");

foggy rain
#

Yes, it says that I'm client on a listen server.

chrome bay
#

yeah it's just the editor viewport being funky with AddOnScreenDebugMessage

foggy rain
#

Okay... Then maybe a bit weird question, but can I somehow replicate a variable without marking at as a UPROPERTY?

chrome bay
#

negative, apart from sending it directly with an RPC of course

#

But that wouldn't trigger an OnRep or anything

steel agate
#

You could do a replicated event, pass it as a variable and set it.

foggy rain
#

Thank you.
My problem is that I want to call the delegate when the variable changes. If I make a templated wrapper with operators overloaded that call a delegate, I cannot mark the variable as Replicated due to UPROPERTY (cannot be mixed with templates).
It looks like I need to manually call the delegate on the setter and RepNotify :(

foggy rain
chrome bay
#

That's pretty common to be honest

#

Calling a delegate from Setter and OnRep

#

nothing strange about that

foggy rain
#

Yes, I just have a bunch of variables, and writing for each of them is tedious ...

chrome bay
#

You don't want to send properties via RPC because that doesn't handle late join or relevancy properly

foggy rain
#

Understand. Thank you!

chrome bay
#

Anything "stateful" must be a replicated prop - otherwise only pain can result

naive elm
#

how should i make the player control a character in one map and a ship in another map? should i have 1 player controller for both cases or 1 for each? is the server part of the game mode or the game mode part of the server?

chrome bay
#

Unsure what you mean exactly, a player can only be in one server/map at a time

#

And there's only one controller per-player in the Server

steel agate
#

So when you spawn into the new map you can override that i believe its choose spawn point or something along those terms.

#

The GameMode is on the server, but you can get to it through the PlayerController

naive elm
#

if 1 player change from controlling a character in 1 map to a ship in another

steel agate
#

eg, run a server event on the controller to call to the gamemode

#

but make a different game mode for the level you want to be a ship

vocal cargo
#

Does anyone know if there's a solution for custom gravity + multiplayer? Looking through UE4's source code, looks like it'll be hard to change

foggy rain
#

A stupid question, but is AActor::HasAuthority called on the server and on the owning client, right?

chrome bay
#

@foggy rain can be called on anything, but will only return true on the Server for a replicated actor.

steel agate
#

set it up so you would be that controller and pawn. Now you could control the ship with the same player controller, but it might be a little clunky, so you might want to change them up. however i don't believe you can change player controllers mid map. So you have to use the same controller for both pawns.

chrome bay
#

If you tear the actor off, or the actor was spawned client-side, then the client has "authority" over it.

foggy rain
naive elm
chrome bay
#

Not the same no

chrome bay
#

HasAuthority means the local game has full control over that actor, IsServer literally means the current instance is the game server

#

Sometimes you need to use a mixture of HasAuthority / GetNetMode

#

NetMode will tell you specfically whether the current game instance is a server (and which type), client, or standalone.

steel agate
#

@foggy rain Anything that is underneath the ownership of a client, that client has authority on. So Client A, controls Pawn A, Pawn A get a rock, server has authority on that rock. However if you set the owner of that rock to pawn A, Client A and the server have authority on that rock.

chrome bay
#

Ownership != Authority

steel agate
#

does it not?

chrome bay
#

"Owner" means you can call RPC's on an actor, but it doesn't mean you have "Authority" over it

#

So clients "Own" their pawns, but they don't have authority on them.

#

But they can call RPC's through that actor to the Server

#

E.g. "make my pawn walk forward"

steel agate
#

I'm going to go read then, because it might be the cause of problems.

dark edge
#

So client-side, the client would have authority over their HUD and widgets and local-only actors?

chrome bay
#

yeah

foggy rain
chrome bay
#

A client has authority over anything they spawned locally, which includes HUD. (Widgets don't have any network functionality [neither does HUD really])

#

Anything that is replicated, they never have authority for - unless it was torn off (by the server)

#

Owner / NetMode / Authority etc. all have subtle differences in terms of what they describe

naive elm
#

does changing the game mode disconnect the server?

chrome bay
#

You'd have to "travel" to a new map to change game mode

naive elm
#

thanks

foggy rain
#

I have one more question about architecture. I use GAS and have a health attribute. Should I check for a "death" only on the server and then replicate the event to clients?
(Not sure, maybe I should ask it in #gameplay-ability-system?)

chrome bay
#

When it comes to GAS specifically I'm not sure, but most likely yeah.

foggy rain
#

Should I use RPC to call the "death" function on a client in this case?

chrome bay
#

It depends really

#

If you want to replicate some specific death event information, then it's one of the few good use-cases of Reliable Multicast

#

Since you can ping that off before calling 'Destroy' on the Server, so clients have everything they need to handle the "death" locally before the actor is destroyed for e.g. (the reliable event is garaunteed to be executed before the actor is destroyed client-side)

#

If the actor just needs to disappear when it's "dead", then that'll be handled automagically when you call Destroy on the server

foggy rain
chrome bay
#

Potentially yeah

#

There's quite a few different ways to handle death stuff on clients

naive elm
#

a pawn with floating pawn movement component with all replication boxes checked doesnt replicate as well as a character, how to make it work?

chrome bay
#

@naive elm only the character class has full network support by default

naive elm
chrome bay
#

Well it does "work", but ony the character implements advanced movement stuff for networking such as prediction/smoothing etc.

#

And that stuff is pretty complex

#

But sort of a requirement for having good networked movement

#

Most people just heavily adapt the character class to do what they need for floating pawns etc. It's not ideal but can be enough.

#

Epic are improving this but it's not ready yet, probably won't be in fully until UE5

naive elm
naive elm
dark edge
#

Or a gameplay effect or whatever

foggy rain
#

Thank you!

foggy idol
foggy idol
#

You’re welcome

dark edge
#

@foggy rain if you're gonna use GAS, try to phrase things in GAS terms and use the system when possible.

manic terrace
#

I am currently making some UI for my multiplayer game (your player's health for example) where there will be a listening server(don't really know if that plays a role). I am currently Creating the widgets for each player on each game instance. Should I be creating them somewhere else? Where is the best practice to create the Player's UI?

manic terrace
#

oh so that's where HUD is used

foggy idol
#

Tho IDK depends on your workflow

#

I mainly use the hud to handle all ui

dark edge
#

UI is local only, being a multiplayer game doesn't matter.

manic terrace
#

I mean I called on the player controller of the listen server and it threw me an error. The CreateWidget

dark edge
foggy idol
#

Use the hud begin play , it’s called once the client has loaded in

manic terrace
#

probably

foggy idol
#

Just needs more clarification

#

Like the actual error

#

But I’m guessing it had something to do with the controller not being local

manic terrace
#

yea something like that

foggy idol
#

Use the begin play in the hud to call your game instance event

manic terrace
#

Can't I just do it directly on the hud?

foggy idol
#

You can

manic terrace
#

the player hud's begin play gets called when the controller is spawned?

#

Also there seems to be a DrawHUD function in the Player HUD. Should I just override it and call my CreateWidget() there?

dark edge
manic terrace
#

I am now calling the CreateWidget function in a class that derives from AHud and it throws this error: UserWidget.h(1467): [C2338] The given OwningObject is not of a supported type for use with CreateWidget.

#

Can't I call this function in the HUD?

foggy idol
#

What did you pass as the owning object

#

@manic terrace

manic terrace
#

emm.. Nothign

#

you mean on the template or the paramaters?

#

on the paramaters i passed this

foggy idol
#

AHud should have some get owning player controller function , pass that

#

@manic terrace

manic terrace
#

oh ok thx

foggy idol
#

Np

twin juniper
#

Guys, i need an advice: I'm changing the ViewTarget of both players, the one who is hosting the session and the one who is joining, in an overriden GameState::OnRep_MatchState. The problem is that the ViewTarget of the player who is joining wasn't changed. I read the logs of both and what I saw is that GameState::MatchState transition process only happens in the server (it makes sense to me, because "the game is running in the server", so no MatchState transition should happen in the client). So my question is: is there a better place to change the PlayerController::SetViewTarget, guaranteed to be executed in both Clients? I think somebody once told me that PostLogin isn't a good place to do this, maybe in the PlayerController::BeginPlay?

shy hill
#

Hi everyone, if I want to replicate the position of a NPC moving from point A to point B. Is it better to
A) Call a timeline on the server and multicast the position of the npc every frame during the timeline
B) Multicast the 'start timeline'

dark edge
#

@twin juniper just have some sort of variable representing what their view Target should be and use an on rep on it. Or just use a replicated event for the payload. I prefer to keep everything as state driven as possible so I just have an enum that drives view targets

spare lion
#

Hello! I am trying to replicate two booleans and expose their values to my anim blueprint as a trigger for my turn in place animation

#

But I cannot get it to work on my client

#

Basically I have this piece of code to decided If I should be turning right or left

#

In my anim blueprint

#

I get those bools from my character and set them

#

then I use them in my state machine to decide if I should play my turning animation

#

When my server character turns it works correctly from the client and server views

#

but when my client character turns I can see it on client , but not on server so I don't think the booleans are being replicated

empty axle
#

otherwise there is no way it will work

spare lion
empty axle
# spare lion Thanks for replying! I don't think I'm doing that, to be honest i'm not exactly ...

The variables are always replicated from server to clients. You should send the input value to the server through ServerRPC and then the server have to set these bools. Then the server will replicate those bools to all other clients. Here is a link to RPC documentation:
https://docs.unrealengine.com/4.26/en-US/InteractiveExperiences/Networking/Actors/RPCs/

Designating function replication across the network

twin juniper
# dark edge <@456226577798135808> just have some sort of variable representing what their vi...

Thanks for your reply. I'm still a UE4 newbie, so let me ask you this: I understand that any UPROPERTY marked with ReplicatedUsing= will be replicated when its value is changed and a callback (OnRep) will be executed... Are you saying that I should use a ```UPROPERTY(ReplicatedUsing=OnRep_MyViewTarget)
AActor* MyViewTarget;

UFUNCTION()
void OnRep_MyViewTarget();

...

void MyClass::OnRep_MyViewTarget()
{
//Change the PlayerController ViewTartget
PC->SetViewTarget(MyViewTarget);

}``` and change the MyViewTarget value in some place inside my code? Also, I read somewhere that, since replication occurs when sending data from the server to the connected clients, the OnRep is executed in the client, is that right, right?

dark edge
spare lion
spare lion
wispy elk
#

Hey all, I need help with a clothing system for my game. I want to assign skeletal meshes to table rows (each mesh has it's own id) and then assign the skeletal mesh according to it's ID (the meshes icons are loaded as a hotbar in the character maker level) upon clicking on the meshe's icon

foggy idol
foggy idol
#

are you asking someone to show you how to set it up, or do you have a specific issue ?

empty axle
#

and probably unrelated to multiplayer channel as well

wispy elk
#

No, it's related. I'm using REST API to connect to a mySQL database to store the ID of the mesh that's being used

#

and my specific issue/question is that I am manually loading the skeletal meshes in, instead of having them load from an array, for example

foggy idol
foggy idol
#

id, imagine you would have some kind of clothing component that would load the required Ids from a data table and spawn some clothing actor that would set everything up

twin juniper
# foggy idol you will have to change it on the server and dont forget to call the function on...

@dark edge @foggy idol Yes, I'm using a listen server model. So what you're saying is that I must make verify the authority of the machine changing the value of the property MyViewTarget, for example ```UPROPERTY(ReplicatedUsing=OnRep_MyViewTarget)
AActor* MyViewTarget;

UFUNCTION()
void OnRep_MyViewTarget();

...

void MyClass::OnRep_MyViewTarget()
{
//Change the PlayerController ViewTartget
PC->SetViewTarget(MyTargetViewTarget);

}

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

if(GetLocalRole(() == ROLE_Authority)
{
    MyTargetView = NewTargetView;
}

}

#

Or are you talking about this: ```UPROPERTY(ReplicatedUsing=OnRep_MyViewTarget)
AActor* MyViewTarget;

UFUNCTION()
void OnRep_MyViewTarget();

UFUNCTION(Server, WithValidation, Reliable)
void ServerRPCModifyViewTarget(AActor* ViewTarget);

...

void MyClass::OnRep_MyViewTarget()
{
//Change the PlayerController ViewTartget
PC->SetViewTarget(MyTargetViewTarget);

}

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

if(GetLocalRole(() == ROLE_Authority)
{
    ServerRPCModifyViewTarget(NewViewTarget);
}

}

bool MyClass::ServerRPCModifyViewTarget:Validation(AActor* NewViewTarget)
{
return true;

}

void MyClass::ServerRPCModifyViewTarget_Implementation(AActor* NewViewTarget)
{
MyTargetView = NewViewTarget;

OnRep_MyViewTarget();

}```

#

Should I send a RPC to the server, to execute the OnRep? Isn't the first approach enough, since I'm changing the MyViewTarget value? Also, when you say I must change the value in the server, are you talking to do a role verificationm when changing the value, right?

foggy idol
foggy idol
#

just make sure to call the OnRep function after setting the vartiable (Because its C++)

stray oxide
#

im having some issues with server travel, after a server travel none of my player controller functions are being called at begin play or OnPostLogin. Anybody had this issue?

meager spade
#

OnPostLogin will not be called for server travel

stray oxide
#

on blueprint

meager spade
#

there is also PostSeamlessTravel tho its C+ only

stray oxide
meager spade
#

for doing what?

#

spawning the pawn?

stray oxide
meager spade
#

oh i do that in the player controller

#

my AHUD class

#

handles all HUD widgets

#

(even umg)

#

so nice and keeps it all in a nice place

#

need a hud widget? i know i can access it from my games AHUD class

stray oxide
#

I have the function for spawning the widget in the player controller but I was calling it OnPostLogin before changing it to the HandleStartingPlayer

#

So should I write the function in the HUD class but still call it in HandleStartingPlayer? Or how else would I tell it to add the widget when the new map loads up?

meager spade
#

we do it on BeginPlay in AHUD

#

controller is valid, viewport, etc

#

this gets called automatically

#

but if you require pawn, etc to be ready, then you need to handle those cases

stray oxide
#

Thank you!

twin juniper
twin juniper
#

I want to perform some logic in an ACharacter only once, would this be the right way of doing so? Because if I don't do this check the logic would be performed per each ACharacter of this class, and I only want to perform it once for the ACharacter/Pawn the local client controls

#

but I'm getting weird results, so I don't know if this is the right way of doing what I want

foggy idol
#

IsLocallyControlled

gleaming vector
#

avoid GetPlayerController by index calls

#

they dont work as you expect in multiplayer

#

massive anti-pattern

twin juniper
#

Is it going to work for blueprints integrated project??

twin juniper
# foggy idol just make sure to call the OnRep function after setting the vartiable (Because i...

Unfortunately, it didn't work. Trying to figure out this thing for a couple of days now, without luck. I don't know what I'm doing wrong, or I'm forgetting something out of my scope of knowledge. Here is the old code (I tried to do it in the GameState::OnRep_MatchState): ```// Fill out your copyright notice in the Description page of Project Settings.

#include "PongGameState.h"
#include "GameFramework/GameState.h"
#include "Kismet/GameplayStatics.h"
#include "PongGameplayMode.h"
#include "PongGameplayController.h"
#include "PongCamera.h"

APongGameState::APongGameState()
{}

void APongGameState::OnRep_MatchState()
{
AGameState::OnRep_MatchState();

UE_LOG(LogTemp, Warning, TEXT("The game state has changed."));

if(MatchState == MatchState::InProgress)
{
APongCamera* MainCamera = Cast<APongCamera>(UGameplayStatics::
GetActorOfClass(
GetWorld(),
APongCamera::StaticClass()
)
);

    if(MainCamera)
    {
        APongGameplayController* PlayerController = 
            Cast<APongGameplayController>(GetGameInstance()->
                GetFirstLocalPlayerController());                                    

        if(PlayerController)
        {
            GEngine->AddOnScreenDebugMessage(
                -1,
                10.f,
                FColor::Green,
                TEXT("Player's point of view changed.")
            );

            PlayerController->SetViewTarget(MainCamera);
        }    
    }
    else
    {
        UE_LOG(LogTemp, Warning, TEXT("There is no camera in the level."));
    }        
}

}```

#

And this is the new code ```// Fill out your copyright notice in the Description page of Project Settings.

#include "PongGameplayController.h"
#include "Kismet/GameplayStatics.h"
#include "Net/UnrealNetwork.h"
#include "PongCamera.h"
#include "PongRacket.h"

APongGameplayController::APongGameplayController(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
bReplicates = true;

}

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

SetInputMode(FInputModeGameOnly());

APongRacket* ControlledPawn = GetPawn<APongRacket>();
    
ControlledPawn != nullptr ? 
    GEngine->AddOnScreenDebugMessage(
        -1,
        10.f,
        FColor::Cyan,
        FString::Printf(
            TEXT("Is controlling a %s pawn."),
            *ControlledPawn->GetClass()->GetDescription()
        )            
    ) : GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Cyan, TEXT("No pawn controlled."));
    
if (GetLocalRole() == ROLE_Authority)
{
    APongCamera* MainCamera = Cast<APongCamera>(
        UGameplayStatics::GetActorOfClass(GetWorld(), APongCamera::StaticClass())
    );

    if(MainCamera)
    {
        ViewTarget = MainCamera;
        OnRep_ViewTarget();
    }

}

}

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

DOREPLIFETIME(APongGameplayController, ViewTarget);

}

void APongGameplayController::OnRep_ViewTarget()
{
GEngine->AddOnScreenDebugMessage(
-1,
10.f,
FColor::Green,
TEXT("Player's point of view changed.")
);

SetViewTarget(ViewTarget);

}```

#

The ViewTarget variable is a UPROPERTY(ReplicatedUsing=OnRep_ViewTarget), and I'm overriding the AActor::GetLifetimeReplicatedProps() method in the .h.

thin stratus
#

Is the viewtarget a replicated actor?

#

@twin juniper

twin juniper
#

Yes it is

thin stratus
#

Might also make sense to go to your PlayerController class and disable AutoManageViewTarget. Maybe that breaks stuff

twin juniper
#

Hello there

#

I read about that let me try it

thin stratus
#

Generally a good test would be delaying all of this by a few seconds. If that makes it work then your code might be colliding timewise with something else

#

(don't use a delay to fix it of course! Only to debug)

#

Not sure if the variable was called AutoManageViewTarget but something similar

twin juniper
#

Let me check that

twin juniper
#

@thin stratus It was the bAutoManageCameraTarget all along. I set it to false and the view target for the second player was changed correctly, thanks πŸ™‚

thin stratus
#

Yeah then it's probably a timing issue

fading birch
#

race condition?

thin stratus
#

Possessing the players pawn probably overrides your viewtarget

#

At least for the client

#

Yeah most likely a race condition

twin juniper
#

Thanks guys!

twin juniper
thin stratus
#

I usually use the PlayerCameraManager and just supply it with the location and rotation of where I want my camra to be

#

Can't recall the function you can override atm

#

But I basically determine my current camera viewtarget via my own function, e.g. By checking the MatchState, if the Player has a Pawn etc. And based on that I return location abd rotation of cameras in the level or similar

#

But it's also a bit more involved setup

twin juniper
#

I will read the PlayerCameraManager class, to see how to improve my code. And I used a FTimerhandle to define a delay of 2 seconds and it worked fine, without the usage of AutoManageCameraTarget, so the view target is being overwritten when the player possess a pawn, aka there is race condition happening. I'm thinking to use OnPosses to change the camera view.

twin juniper
#

@foggy idol, there is something you said earlier that worked, but its not mentioned in the UE4 page about property replication: I thought, after reading the replication page some days ago, that OnRep functions associated to Replicated variables would be called automatically when the values of the same variables changes. At least this is the idea the page presents.

spark stag
#

i have some custom NetSerialize code that needs to serialize another struct inside it, which i want to do with the default serialization

#

is there a way to call NetSerialize on USTRUCT that i didn't define custom serialization code for?

chrome bay
#

You can't do default serialisation on it, but you can use it's UScriptStruct class to serialize it

chrome quest
#

Question please. I'm working on a sort of persistent universe game. I was wondering about storing things like player data. For things like the player's current health before he logs off the game. Where do I store that health so that when he logs back on his health is set to that current health?
Is there some built in feature like the save game or do I have to use some sort of external database to store that data and load it back in when the player logs on again?

chrome bay
#

You would have an external database usually yeah.

chrome quest
#

Also, on a related note. Can anyone link some resource that tells exactly which actors(player controller, player state etc.) are destroyed when a player logs of the game.
As well as the connection between server game instance and client game instance. Thanks
The network compendium is good but it doesn't answer some of my questions

chrome quest
twin juniper
#

I it really necessary to manually call an OnRep, even after the replicated variable value is changed? Like this```void APongGameplayController::BeginPlay()
{
Super::BeginPlay();

SetInputMode(FInputModeGameOnly());

APongRacket* ControlledPawn = GetPawn<APongRacket>();
    
ControlledPawn != nullptr ? 
    GEngine->AddOnScreenDebugMessage(
        -1,
        10.f,
        FColor::Cyan,
        FString::Printf(
            TEXT("Is controlling a %s pawn."),
            *ControlledPawn->GetClass()->GetDescription()
        )            
    ) : GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Cyan, TEXT("No pawn controlled."));
    
if (GetLocalRole() == ROLE_Authority)
{
    APongCamera* MainCamera = Cast<APongCamera>(
        UGameplayStatics::GetActorOfClass(GetWorld(), APongCamera::StaticClass())
    );

    if(MainCamera)
    {
        ViewTarget = MainCamera;            

        OnRep_ViewTarget();
    }

}

}```The documentation presents a idea that you SHOULDN't manually call it

#

The replicated variable is ViewTarget

chrome bay
#

You never call an OnRep manually, unless for some reason you want it to run on the Server.

twin juniper
#

Yeah, if I execute the code without it, the scope inside the OnRep isn't executed, even if the replicated variable has its value changed, I'm still trying to understand it, since the documentation don't require a manual call

chrome bay
#

OnReps are never called on the Server unless you call it yourself

spark stag
chrome bay
#

OnReps are called automatically ClientSide

#

@spark stag well you will lose per-property serialization, so the whole struct will be sent everytime (or rather, whatever you write in NetSerialize will be sent everytime)

#

You lose per-UPROPERTY replication

twin juniper
#

@chrome bay, thanks, but whats the reason behind the fact the OnRep isnot being executed without a manual call?

chrome bay
#

Because OnRep is a callback for when something has replicated to a client.

#

Nothing ever replicates to a Server

#

In Blueprint it's different because Blueprint is stupid

#

The only reason to call an OnRep manually is if you want the same function body to execute on the Server - that's it

#

The Client will handle calling it automatically, that's part of the engines' replication system.

#

ViewTarget btw is something that is already managed locally in quite a few places by the engine (the pawn is always the viewtarget by default)

#

So I'd be careful about replicating it, because you'll probably be fighting the engine in some places

#

There's already some network code for changing view target, which is handled via RPC's

twin juniper
#

Thanks for the explanation, but this is frustrating: the documentation lacks more information about it, and you have to look deeply inside the engine to find something to help you to solve a problem like this one, or get some advice from people who already know the engine

chrome bay
#

Cedrics compendium explains stuff pretty well I think, that's pinned in this channel so it's worth a read. There's definitely a lot of poking around you need to do, UE is a huge toolset so it's impractical for them to document everything when you can look at the source.

#

I think Epic's biggest failing though is making Blueprint behave differently to CPP to be honest.

#

It just makes it more confusing for someone moving from BP->CPP, and if you're used to CPP you have to remember all the weird stuff BP does. Unfortunately it doesn't look like they fixed that in UE5 either.

twin juniper
#

T_T

#

thanks

shy hill
#

Hi everyone, I'm working a multiplayer project where the core concept relies on pretenting to be a NPC. NPCs have movement patterns, and as a player you have to replicate them to hide from other players.
This of course can only work if all movements are perfectly replicated without any jittering, which is what I'm struggling with.
The NPCs move with timelines and their movement are perfectly smooth on each client. While the Player characters move with the default character movement component (on listen server with the Steam plugin), and though their movement is relatively smooth, it's far from being as smooth as the NPCs. (the movement of your own character is smooth, but other player's movement is not)

  1. Is there any parameters in the character movement I should tweak to make the PC movement more smooth ?
  2. I read about the Smooth sync plugin, would that help fixing my problem ?
marsh pine
#

Hello , does anyone knows why PixelSTreaming comunication doesnΒ΄t work in multiplayer? when the package is in client mode the pixelstreming events doesnΒ΄t work anymore...

heady scarab
#

Hi, what is the best way to send pawn rotation to the server, if it is not determined by controller rotation or movement direction?

bitter oriole
#

RPC

heady scarab
#

RPC every tick, that's no big deal?

bitter oriole
#

As long as it's unreliable, no, it's the only way to have movement

heady scarab
#

I guess I only have to RPC when it changes too. Thanks!

meager spade
#

why do you need to replicate rotation?

#

@heady scarab

#

how is the rotation done?

heady scarab
#

So the simulated proxies can face the right way.

meager spade
#

why are they not facing the right way?

#

how are you rotating?

heady scarab
#

It's controlled by an axis input that is separate from the controller rotation, kind of like a twin stick shooter

meager spade
#

right...

#

but in twinstick shooter, you normally use control rotation?

#

or is it done via mouse location?

heady scarab
#

I'm using controller rotation for camera rotation... I've been second guessing that a lot though

meager spade
#

your camera is seperate to pawn right?

heady scarab
#

I have the camera and spring arm on the pawn

meager spade
#

top down game?

#

we use control rotation here

#

and we have a separate observer pawn

heady scarab
#

hmm, a second pawn... that's in the top down template?

meager spade
#

not sure, πŸ˜„

#

our player controller possesses observer pawn, our player pawn is possessed by AI Controller, then we set up references, and link them, not really easy to do that in BP only.

#

thing is

#

camera is local, other clients don't care for camera

#

so you could just handle camera rotation manually

#

and not have it move with the control rotation

heady scarab
#

ah ok. I have bUseControllerRotationYaw = false set on my pawn, seemed like the easiest way to separate those

meager spade
#

and leave the control rotation just for the pawn

#

this will save you needing to rpc rotation every tick

#

simulated proxies only care for where you pawn is looking, not your camera

heady scarab
#

yeah that's a pretty good argument for keeping the controller in charge of pawn rotation...

dark edge
twin juniper
#

Well, I know I have discussed this with @foggy idol , @dark edge and @chrome bay, but I guess I found the reason you must do a manually call for a OnRep_ in the server: the a RepNotify is automatically called in all connected clients, but, apparently, if you have a local client (aka a listen server), the RepNotify isn't called automatically and you must call it manually, first verifying its authority and then verifiying if its a listen server. Here: https://forums.unrealengine.com/t/repnotify-from-c-confusion/3327/10

#

That's not the way RepNotify works in a BP scenario, where the RepNotify is called automatically for both clients and server.

#

It sucks, but now I know the reason, don't know why the replication system only considers the connected clients and leaves the local client out thou T_T

dark edge
chrome bay
#

@twin juniper well its because a listen server isn't a client, it is the server.

#

Nothing is replicating to the local instance because that instance is the server

#

RepNotify in BP isn't actually a RepNotify

twin juniper
#

That is what I thoight this afternnon

twin juniper
dark edge
#

@chrome bay do you know why they made the blueprint version of rep notify fire on the server? Seems like a weird decision

chrome bay
#

It's just a "this variable has changed" callback. You can change a value client-side and the "rep notify" will even be called ,even though nothing replicated.

#

BP has a stupid system that mimics repnotify but it isn't actually a true rep notify

twin juniper
#

Offf

#

Lol Epic I guess they spent too many tme working on Fortnite

dark edge
chrome bay
#

I don't think so

#

I don't really know why they didn't make BP rep notify work the correct way, but my guess is they've committed to it for too long to revert/fix it without breaking a lot of peoples' projects.

twin juniper
twin juniper
toxic lion
#

I think he meant that it's a client that also acts as a server, not a standalone client?

twin juniper
toxic lion
#

unless there's some magic happening behind the scenes, and its much easier for us noobs to think of it as a client/server?

#

πŸ€·β€β™‚οΈ

twin juniper
twin juniper
toxic lion
#

interesting.. rabit hole gets deeper then

twin juniper
#

But I don't know (yet) why he/she told us the listen server isn't a client, so I have to study this subject a little more

dark edge
#

It might be more accurate to say that in a listen server environment, the process is the game server and there is also a local player.

hollow eagle
#

^
When people say a listen server is a client and a server they're not talking from a networking perspective, they're talking from a player's viewpoint.

#

The engine isn't literally sending networking data to loopback for a listen server

hollow eagle
#

also just from the title I can tell you that article isn't relevant

#

Unreal does not use P2P

#

client/server networking and P2P are entirely different concepts, a listen server is still client/server networking.

twin juniper
#

I guess they messed up the title

hollow eagle
#

No, that article is correct. It just isn't relevant to unreal's networking.

twin juniper
#

He's just saying that people uses the term P2P when they should use listen server

bitter oriole
#

Both terms map to very different things

twin juniper
#

Yeah, he is telling that in a P2P environment, the data passes from a node to another, without the necessity of an authority. Isn't not the case of the UE4, like @hollow eagle said

hollow eagle
#

I think we're all agreeing here.

#

P2P != listen != dedicated

#

they're all used, but only listen/dedicated are relevant to unreal's built-in networking.

fading birch
#

can you use P2P in ue4?

#

or is that a custom solution

hollow eagle
#

That'd be custom.

fading birch
#

thought so, but wasn't sure

#

I've not really worked too much with listen servers, but what's stopping the hosting client from cheating?

#

since they're technically the authority

hollow eagle
#

nothing

bitter oriole
#

Listen server is just that, a server

hollow eagle
#

There's a reason you don't find listen servers as the default mode of operation for competitive multiplayer games. That and network quality.

#

Consoles could do it a bit more safely but it's still iffy... and then you have to worry about possible performance issues with being the host and a client.

bitter oriole
#

Depends on the console

fading birch
#

how difficult would it be to launch a dedicated server alongside the client if you wanted to host a session and have all the clients connect to that? Similar to a listen server, but secretly it's a dedicated server.

hollow eagle
#

that's no different, you're just wasting resources

fading birch
fading birch
hollow eagle
#

you're still running a server on an untrusted machine

fading birch
#

true

bitter oriole
#

Anything happening on client-owned hardware is unsafe and unreliable

#

On some consoles, less so

#

On PC, it's not even a debate

dusk spire
#

if i destroy an actor on the server with the Destroy() function, what happens if a client calls a server side RPC? can it lead to problems?

hollow eagle
#

These days listen servers exist primarily for co-op and selfhosted (non-matchmade) games.

dusk spire
#

like the actor still exists on he client after the destroy was called, till it replicates its destruction i assume.

hollow eagle
#

The server should ignore the RPC. The actor doesn't exist, so the RPC won't execute.

twin juniper
hollow eagle
#

That's why back in the day you had host migration in some games.

dusk spire
#

so i won't get a you are nuked error message? 😁

fading birch
hollow eagle
#

Losing a node in a P2P scenario isn't really catastrophic anyway - every client should have a complete view of the world. This isn't a distributed system where each client only knows a small amount about the game.

#

Host migration was more about choosing a single client that is the authority and actually decides on what happens when there's a conflict.

twin juniper
bitter oriole
#

Listen server = you can do whatever you want

#

Kicking players, etc

twin juniper
#

that too

bitter oriole
#

Outright cheating

hollow eagle
#

It's about network quality in general (not everyone has a good enough network to host), it's about not trusting clients, it's about having a server in a fair location for the group of players in a match.

twin juniper
bitter oriole
#

If you're worried about anything remotely competitive, listen server is simply out of the question

#

Every cheat on the planet will work

twin juniper
#

Is there a good source about how to raise a dedicated server using UE4? I'm not talking about a master server, that would require programming outside the engine

bitter oriole
#

Yeah, google it

#

Just need to build from source

twin juniper
#

Lol KABOOOMMM

#

I know, but I think the official documentation lacks a lot of things

bitter oriole
#

🀷

twin juniper
bitter oriole
#

You're doing dedis, your network team can afford to look things up

#

It's not like it's some kind of arcane knowledge

#

Lots of people do dedicated servers

twin juniper
bitter oriole
#

If you are an UE4 freshman you have no business doing dedicated servers, it's a realllly bad idea

twin juniper
#

I don't the privilege of learn things in a slow pace

bitter oriole
#

I'm not questioning your ability to learn. I'm saying dedicated servers are a bad idea :

  • you need them either because competitive game (do you have a report system ? anti cheat ?) or a game with a lot of players (how many zeroes to your marketing budget ?)
  • running and maintaining dedis is expensive in a world where the average Steam games makes less than $1000
#

Just my 2 cents, feel free to ignore

twin juniper
dark edge
#

@twin juniper I would recommend a listen server design. It's self scaling and MUCH easier to do.

#

Dony make your first game a dedicated server design.

twin juniper
bitter oriole
#

Don't make any game not funded by a publisher with a dedicated server design

twin juniper
bitter oriole
#

if you don't want empty servers*

twin juniper
dark edge
#

The only way I would recommend dedi is of you were going for a community hosting model like Valheim or GMod

bitter oriole
twin juniper
#

Even with patreons, kickstart donations etc

dark edge
bitter oriole
#

^

#

My thoughts as well but hey, if you have a serious publisher beyond you, go ahead

twin juniper
#

I guess I must present you one of my friends, who is starting a Diablo clone in Unity, he's thinking too big and wants me to do the LD for him

bitter oriole
#

We all think too big, some of us just manage to get small enough to release eventually

dark edge
#

We are architecting our game to be as smooth as possible and seamless between playing solo and playing multiplayer. Basically the only difference is "your friends are here too"

#

It helps to have a co-op design and not strictly competitive. HUGE competitive games launch and die all the time. It has to have legs on its own and not just rely on other people being around.

dark edge
#

Notice I didn't say good lol. Although good games die too, like Dystopia (a source mod that had incredible gameplay but is dead now)

twin juniper
#

I have heard, but I never played

twin juniper
dark edge
#

Dystopia was a class shooter with a dual layer map. Basically some players could "jack in" to a Tron/Quake style cyberspace map and open doors, arm turrets, etc. And players in meatspace could affect the Cyberspace map by destroying firewalls and affecting it's layout. Very interesting design.

twin juniper
#

Its a very interesting design indeed, I wish I could play it =\. And right now we have a lot of similar games, like Medium (but still, the player controls two characters at same time, in two maps, and there is no multiplayer, but would be nice to have a terror/horror game like Medium where connected players affect the world of each other, maybe a Silent Hill game with a multiplayer module, where the people have sins that could be related to each other? It could use character backgrounds like the one we did when playing Vampire the masquerade/ Werewolf the Apocalypse, reflecting our sins and having an impact on other worlds)

elder hare
#

hello somebody can tell me What I`m doing wrong. IΒ΄m testing a multiplayer and I want penalise an specific player by hiding and disabling their input. IΒ΄m doing the login in the game state by calling a function that does what I want it. Also I tried to implement the function on the game mode without success. How can I get this function work?. I tried also too many possibilities with run on server and multicast events but I never succeeded

fossil spoke
#

PlayerControllers only exist for each Player.

#

The Server also has a list of all PlayerControllers.

#

Other Players do not have each others PlayerControllers.

#

Pass the PlayerState instead, the PlayerState represents another Player to other Players.

elder hare
#

ok Devils IΒ΄ll try it, thanks for replying

old knot
#

hey, I want to change maxwalkspeed in c++ when player boosted, so i defined "isBoosted" bool that changes by input pressed and released actions, but it is toggling while pressing and make lagg in animation . anyone can help?

thin stratus
#

Are you actually replicating that boolean properly?

#

The Boolean has to be a RepNotify variable. Then MaxWalkSpeed change has to happen in the OnRep. And if a Client pressed the key you will have to tell the Server to also set the boolean.

#

And on top of all of that, this is not even the 100% correct way of doing it, as this should go through the CMC in an optimal situation

old knot
#

yeah, i made mistake in replicating

#

is there any complete tutorial about unreal multiplayer ++ ?
i'm new in that

chrome bay
#

There's also the full multiplayer sample from Epic (ShooterGame)

#

Old but gold

unborn sierra
#

Hi!

I know that it's maybe dumb question, but I think I don't quite understand it.

I have a Character, which is driven by AI Controller. I have behaviour tree with task like "Move To" (default Unreal). On server looks ok, on client also BUT - there is problem with rotation.
Rotation is choppy and looked strange, after few secs it becomes normal (like on server).

I have similar problem with Pawn, but driven by Player, and I ended up with custom replication of movement vector.

Does Character haven't smoothing of rotation? I see it works in e.g. First Person Template, but rotation was driven by mouse, not AI.
If it has, how to handle such case? Change replication priority or interval?

frail sun
#

Hey, so I have an FPS game and I want to implement a multiplayer, I want to have dedicated game servers for each game.
So I was wondering, can the server handle all damage, etc?

sacred smelt
#

Or GTA Online peer2peer lobby cheats.

frail sun
#

I see

#

and how do I mirror the game objects to all the players?

#

like bullets

old knot
#

thankss

dark edge
manic terrace
#

When I have a UPROPERTY(ReplicatedUsing=SomeFunction) it will act like a UPROPERTY(Replicated) and also call the function I have specified?

chrome bay
#

yep

#

Only need one or the other

granite nest
#

Hey guys, which networking library to you recommend ? For just multiplayer shooter or something

chrome bay
#

none

#

UE has all the stuff you need

granite nest
#

oh sweet

split pivot
#

I'd like to adapt the Collaborative template from Unreal Engine by adding additional buttons to the Contextual Menu. I'm looking into the existing blueprints, though I'm struggling to understand how the list of buttons is populated.
If anyone already went through a similar process of adapting the Collab template, I would appreciate some help.

split pivot
foggy wave
#

Is it hard to set up a dedicated server on my pc for my game?

dark edge
#

But not too hard

foggy wave
#

whats the easiest way to test my game with others? i tried with steam subsystem but it works like twice the week , i think it has to do with the servers , btw i tried hamachi for lan connection but it didnt work

bitter oriole
#

Steam is the easiest by far

#

Combined with a private itch.io release so that people have automatic updates

foggy wave
#

yeah but steam doesnt always work for me

#

for some reason

#

at first it worked after many times i tried it it didnt and it worked again for one more time , but thats it it didnt worked again since then and i think it has to do with the servers because i didnt change anything in the code

twin juniper
#

I'm doing a IsLocallyControlled check, and then when I try to access the ACharacter::InputComponent the InputComponent is null

#

any idea as to why is it null?

bitter oriole
foggy wave
bitter oriole
#

So, debug it and see what's going on

#

You kind of need it anyway

foggy wave
#

i only get 1 error

#

Steam api disabled

bitter oriole
#

Yeah, you didn't start your game from Steam

#

Or failed to provide an appid.txt file

foggy wave
#

i only get that error in ue4 not in the built version

meager spade
#

you cant connect to steam from editor

bitter oriole
#

^

meager spade
#

only launch game/packaged

bitter oriole
#

And while packaged in shipping, only with an appid.txt file, or when actually started from the Steam client

#

Editor will never have any OSS feature

foggy wave
#

steam overlay works fine in built version

#

dev mode

meager spade
#

also if you using 480 id, i always had issues with that

bitter oriole
#

Yes

meager spade
#

best to get a proper id

bitter oriole
#

In editor, there's zero Steam support

#

That's the end of it

meager spade
#

(if you get session issues, etc)

foggy wave
#

what do you mean a proper id?

bitter oriole
#

A real game ID for your title

#

Though it's clearly not your issue here

foggy wave
#

in order to do that i have to pay so...

#

not yet

bitter oriole
#

"API disabled" means just that, Steam support is not there

#

Don't test in editor

foggy wave
#

do you want to see the log file

#

from the built version of course

bitter oriole
#

Does the built version work ?

meager spade
foggy wave
#

well

bitter oriole
#

Yeah, confusing statements all around

foggy wave
#

in the built version

#

you cant connect through steam

#

but if you close steam you cant connect localy

#

i can even send you the built

meager spade
#

you need to run with -nosteam

foggy wave
#

its really small

meager spade
#

if you want to disable steam and use without steam

foggy wave
#

i dont want to i just tested it

bitter oriole
# foggy wave you cant connect through steam

Did you test with two different Steam accounts logged on two different Steam machines running the same game, with an appid.txt file, does shift + tab open the Steam overlay on both

twin juniper
foggy wave
#

wait

#

what do you mean

#

with appid.txt file

meager spade
#

@twin juniper hmm, need some context πŸ˜„

foggy wave
#

i did everything else except that i think

bitter oriole
#

"yes I did" - I asked more than one question there

#

the appid.txt file should contain your appid, in ProjectName/Binaries/Win64 in packaged folder

#

Does the Steam overlay work on both machines ?

foggy wave
#

yeah it works

#

should appid.txt be there?

bitter oriole
#

Yeah

foggy wave
#

oh

#

its not

#

but why

bitter oriole
#

Because if you did not start the game from Steam, Steam requires this file to identify the title being run

#

At least in Shipping mode, but hey, doesn't hurt to try

foggy wave
bitter oriole
#

Yeah, or just use the appid file

foggy wave
#

how do i use the appid file since i dont have it?

#

do i create it somehow

meager spade
#

its just a .txt file

#

with the id in it

#

that is it

foggy wave
#

kk i will test it and let you know

#

@meager spade @bitter oriole i tried running game trhough steam didnt work and creating this "steam_appid.txt" file

#

didnt work either

#

should i create that or it should be there automatically

#

btw once i created the file opened the game and closed it

#

the file got deleted by its self

bitter oriole
#

You should create it, and I've never seen that get removed

foggy wave
#

i created it with the exact same name and i dont think that windows defender or fire wall would delete a txt file

bitter oriole
#

🀷

#

In any case, just go through the logs now and search for errors

foggy wave
#

will do now

#

@bitter oriole i tried it on 3 different computers and it deletes it when the game closes

#

cant find anything useful in the logs

bitter oriole
#

No Steam API disabled or anything ? Any mention of net driver ?

foggy wave
#

i didnt find anything

bitter oriole
#

Sure, put it on pastebin

foggy wave
#

@bitter oriole thanks for helping me really , but i have to go now i will be back in 2 hours if you dont have any problem i can tag you and see if there is anything we can do

bitter oriole
#

Looks fine, you should add logs in your session system to find out what happens

manic terrace
#

void AFFAHUD::Tick(float DeltaSeconds) { Super::Tick(DeltaSeconds); if(HasAuthority()) { UE_LOG(LogTemp, Warning, TEXT("test 1")); } else { UE_LOG(LogTemp, Warning, TEXT("test 2")); } I have this Tick on a HUD and I am getting only the test 1 output. I have one listen server and one client. And the test 2 doesn't get printed out. What could be happening?

silent valley
#

HUD only exists for local client, so will always have authority. What are you trying to achieve?

manic terrace
#

I am trying to update my HUDS with a replicated TArray<> I have on the GameState

#

But no luck yet

silent valley
#

so in the HUD you want to run some code but only if it's not the server?

dark edge
#

@manic terrace onrep, get HUD, profit

manic terrace
#

let me show you

dark edge
#

That is if get HUD can fail gracefully, you have a dedicated server?

manic terrace
#

no I have a listen server

#

` UPROPERTY(ReplicatedUsing=OnPlayerDatasReplicated)
TArray<FPlayerData> PlayerDatas;

UFUNCTION()
void OnPlayerDatasReplicated();`
#

`void AFFAGameState::OnPlayerDatasReplicated()
{
UE_LOG(LogTemp, Error, TEXT("Replicated data!"));
APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0);
if(PlayerController)
{
AHUD* HUD = PlayerController->GetHUD();

    if(HUD)
    {
        AFFAHUD* FFAHUD = Cast<AFFAHUD>(HUD);

        if(FFAHUD)
        {
            FFAHUD->RefreshStats(PlayerDatas);
        }
    }
}    

}`

#

this to update on the client only. I am updating the listen server's somewhere else

#

void AFFAHUD::RefreshStats(TArray<FPlayerData> PlayerDatas) { if(PlayerUI) { if(PlayerUI->ScoreHolder) PlayerUI->ScoreHolder->ClearChildren(); for(const FPlayerData& PlayerData : PlayerDatas) { UPlayerStatsUI* PlayerStatsUI = CreateWidget<UPlayerStatsUI> (GetOwningPlayerController(), PlayerStatsSave); if(PlayerStatsUI) { PlayerStatsUI->AddToViewport(); PlayerUI->ScoreHolder->AddChild(PlayerStatsUI); PlayerStatsUI->PlayerKills->SetText(FText::AsNumber(PlayerData.Kills)); if(PlayerUI->ScoreHolder && PlayerStatsUI->PlayerName && PlayerStatsUI->PlayerKills && PlayerData.PlayerController) { PlayerStatsUI->PlayerName->SetText(FText::FromString(PlayerData.PlayerController->GetName())); } } } } }

#

Don't know if you can make sense

silent valley
#

where did it crash?

manic terrace
#

it used to crash on the PlayerController-> until I added a check for it

#

now it just doesn't get replicated. Only on the start

silent valley
#

I guess at the point you're replicating it the clients PlayerController has not been setup yet?

manic terrace
#

yea could be but when I RefreshStats again it doesn't work. When I change the PlayerDatas the OnPlayerDatasReplicated doesn't get called

silent valley
#

that's strange...

manic terrace
#

I must have messed up somewhere

silent valley
#

unless you are using DOREPLIFETIME_CONDITION(... COND_InitialOnly)

manic terrace
#

this is the one I use

#

void AFFAGameState::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const { Super::GetLifetimeReplicatedProps(OutLifetimeProps); // This actually takes care of replicating the Variable DOREPLIFETIME(AFFAGameState, PlayerDatas); }

silent valley
#

I don't know why subsequent changes to PlayerDatas would not trigger OnRep

manic terrace
#

`void AFFAGameState::AddKill(APlayerController* PlayerToAddKill)
{
if(PlayerToAddKill && HasAuthority())
{
for(FPlayerData& PlayerData : PlayerDatas)
{
if(PlayerData.PlayerController == PlayerToAddKill)
{
PlayerData.Kills++;
UE_LOG(LogTemp, Warning, TEXT("Player %s now has %i kills"),
*PlayerData.PlayerController->GetPlayerState<APlayerState>()->GetPlayerName(),
PlayerData.Kills);
}
}
}

if(HasAuthority())
{
    APlayerController* PlayerController = UGameplayStatics::GetPlayerController(GetWorld(), 0);
    if(PlayerController)
    {
        AHUD* HUD = PlayerController->GetHUD();

        if(HUD)
        {
            AFFAHUD* FFAHUD = Cast<AFFAHUD>(HUD);

            if(FFAHUD)
            {
                FFAHUD->RefreshStats(PlayerDatas);
            }
        }
    }
}

}`

#

this is where a change happens

silent valley
#

what does your FPlayerData struct look like?

manic terrace
#

`USTRUCT()
struct FPlayerData
{
GENERATED_BODY()

UPROPERTY()
APlayerController* PlayerController;

int Kills;
int Deaths;

};`

silent valley
#

I'm not sure, but do Kills and Deaths need to be UPROPERTY() ?

bitter oriole
#

For replication, yes

manic terrace
#

oh ok I will change them. But don't think this is the problem. I am calling a server function on a character that in its turn calls the Die function on the player controller who call the AddKill on the gamestate

silent valley
#

Without UPROPERTY() on the int Kills; when you increment kills, the server will not know the struct has changed and will not replicate it to clients who will not call the OnRep

manic terrace
#

ohhhhhh

bitter oriole
#

You might as well not even have those variables

manic terrace
#

ok I got it now let me try it

#

yep works perfectly thx, appreciate it

silent valley
#

nps

unborn sierra
#

Hi!

I have a problem with moving Character via Behaviour Tree. I use simple Move To.
Location works fine, but rotation is choppy.

What can I do to have smooth rotation? I use Character especially for that purpose, but I can't get it to work.
I have listen-server game.

foggy wave
#

@bitter oriole i just came back if you could help me just reply here , thanks

twin juniper
#

Has anyone tested if advanced steam sessions works on 5.0 ?

torn bane
#

It dont work for now

twin juniper
#

Oh, didnt knew that. Sorry

limber moat
#

If I want a client to destroy an actor upon interacting with it, would I call a server event to run a multicast of destroying the actor? Or I guess in better terms how would I go about allowing the client to make changes that happen on the server and which is then replicated to all other clients?

empty axle
limber moat
thin stratus
#

What actor are we talking about

#

And where do you run the rpc

#

@limber moat

limber moat
# thin stratus What actor are we talking about

Just a basic actor with a static mesh and collision, it is replicated. The custom event run on the server is in the event graph to just destroy actor and print a string, along with my 'interact' interface event which then calls the server event

thin stratus
#

So it's an actor in your level?

limber moat
#

Yes

thin stratus
#

You are lacking understanding of ownership. Might want to read up on it again via Google or my compendium.

Tldr you can only call Server and client rpcs on actors that the specific client owns. E.g. Playercontroller, playerstate or the possed pawn. As well as actors that either have one of those passed in as owner when being spawned by the server or set afterwards by the server

#

Due to this, interaction systems should rpc in the character or similar and perform line traces etc on the server side

fading birch
#

the client would still initiate the action, but you need to actually execute it from the server

#

in order for it all to replicate properly

limber moat
thin stratus
#

What are you using for the interaction?

#

@Ian Tharp#0647

limber moat
#

I just fixed it, turns out it was just my silly mistake of not creating server events for my action input on my interaction

limber moat
#

On my player character

thin stratus
#

Yeah that's fine too

#

As long as you RPC first

#

And then do it

limber moat
#

Right, that was my mistake, I forgot to add that RPC for the server

#

Thanks for the help!

unborn sierra
#

Hi!

I have a problem with moving Character via Behaviour Tree. I use simple Move To.
Location works fine, but rotation is choppy.

What can I do to have smooth rotation? I use Character especially for that purpose, but I can't get it to work.
I have listen-server game.

bitter oriole
#

Do int64 replicate correctly ?

unborn sierra
bitter oriole
#

No, it's not related to your question

#

Looks like they are anyway.

chrome bay
#

@bitter oriole yeah all the different int's replicate okay

foggy wave
#

Hello , after many build tests of my game the character that joins the host suddenly just started trembling when moving around and i dont know why

bitter oriole
#

How are you doing the moving ?

split siren
#

What would be cheaper to replicate? FLinearColor or pointer to an actor?

chrome bay
#

pointer to an actor

#

linear colour is four floats, so 128 bits

#

actor pointer is a net guid, so 32 bits IIRC (or is it 16.. I forget)

#

32

split siren
#

Thanks @chrome bay

twin juniper
chrome bay
#

It's implemented by the character movement component

peak sentinel
#

Looping all PlayerControllers and sending client RPCs vs sending a Multicast
Which one is more optimal?

chrome bay
#

Depends

#

Technically, you can't really multicast on a player controller

#

So usually it's for different purposes

#

What's the use case?

peak sentinel
#

I'm executing Multicast from another replicated AActor in a Server RPC

#

Looping all PlayerControllers (FConstPlayerControllerIterator) there and calling ClientPlayAnimShake which is another reliable client RPC

chrome bay
#

So if it's a multicast, the multicast will only go to players which the actor is relevant for

#

If it's a client RPC via controller, it'll go to all players you loop through

#

So that could be quite differnet

#

Can you not trigger the anim shake locally somehow to avoid the network call altogether?

peak sentinel
#

But thats fine, our game is very "uneventful" and sending a couple of client RPCs wont hurt

#

I just wanted to follow best practice if there is any

chrome bay
#

So presumably, other players would see some VFX or sounds etc when the weapon fires already? Or is that not part of it yet?

#

If they do, I would trigger it from the same place

#

We do a similar thing for stuff like tank cannons and big artillery pieces that make the screen shake for players when they're nearby and it fires

peak sentinel
#

I see, I'll check it out, thanks for the guidance πŸ™‚

chrome bay
peak sentinel
#

By the way while you're here, I've been waiting to ask you how you guys handle networked projectile pool in HLL, since for MG42-like weapons you also have client-only visible projectiles (thats what I remember from out last conversation about projectile prediction) do you have two pools like one for client simulation and other one for server?

chrome bay
#

No pools in our case, the projectiles are just data objects that are created locally

#

third-party clients don't necessarily receive all of them, but we replicate a "LastShot" struct for each weapon, and when it's Onrep fires it spawns a projectile on that client

#

It's lossy for remote viewers but good enough for our case

peak sentinel
#

Hmm, I understand

#

Thank you

chrome bay
#

But yeah no actors for our projectiles, just particle systems if anything (which can exist without a host actor)

peak sentinel
#

Whats a "data object" actually

#

Uobject?

chrome bay
#

So the data itself is just a struct (and not a USTRUCT, just native C++). We keep a big list of them in a "projectile manager" of sorts, and keep track of them there as TSharedPtr's.

There's a DataAsset which defines the properties for a projectile "class", and that determines how it should be simulated. So each tick the projectile manager loopsover everything in the projectile array, determines what dataasset to use to update it, and calls the data assets' update function with that data.

peak sentinel
#

I see, thanks for the explanation Jambax, I appreciate it πŸ™‚

chrome bay
#

I'll do a write up on it at some point, it's pretty cool I think πŸ˜„

peak sentinel
#

Yeah totally would like to read πŸ˜„

ripe ravine
#

Hey im having trouble making a character select screen. So few questions, where should I spawn and possess the pawns, how do I replicate it all properly, and how do I get each individual player controller. because right now only one player is able to possess a pawn at a time or something like that is going on

bitter oriole
#

Spawning and possessing are replicated

#

Needs to happen on server, both

twin juniper
twin juniper
#

Hum, I'm reading a tutorial, and the author mentioned the usage of bReplicateInstigator, and how its important to separate server side specific functionalities from client side, but I didn't find in the AActor or ACharacter. Is there any other variable, or isn't used anymore?

chrome bay
#

If you're reading UE3 docs then they are over a decade out of date at this point

#

Never seen that property myself

twin juniper
#

No, I'm reading this one

#

in the page 6

#

I tried to find it in AActor*, didn't find it

chrome bay
#

It's probably too old

#

the doc/link says 2014

twin juniper
#

I know, I was trying to find if it was removed or if it has another name.

#

but inside the AActor class apparently there is nothing related to instigator replication as a boolean so I assume it was removed?

#

Well, I believe that, since the APawn* Instigator is marked with ReplicatedUsing=OnRep_Instigator, I believe it does the same thing that the old bReplicateInstigator=true does, but isn't something internal anymore? The only difference I'm seeing is that, now, Instigator replication is always on

vocal cargo
#

Does anyone know the best way to travel from an "online map" to an "offline map" and back to the "online map" again?

#

Didn't want to disconnect the player from the server, but I definitely don't want to be wasting unnecessary server power

torn bane
#

Hello Does anybody know why when I'm connecting to friend session (friend in other network) my level restarts and does nothing, but when I'm using 2 PC's in the same network it works well?

twin juniper
#

Did you verify the online subsystem you defined in the default engine.ini?

#

What is it?

dull lance
#

I just ran into some -interesting- behavior. I have characters spawned from the server during runtime, and then run a function which turns an Audio Component Fade in and Fade Out. I am updating a variable that is replicated on server. Locally, I'm checking for differences with a non-replicated variables, and I'm getting the following results (rep mode is listen server). What am I doing wrong?

fading birch
#

try a ForceNetUpdate()

#

in your _NR function

#

I would also throw in a role check there too

dull lance
#

so doing a force net update does make the audio play locally... but why was that needed?

the execution of the functions above didn't change; they still show C_0 -> Server, Simulated, C_1 Server, Client

#

project source control and in-game feature replication have nothing to do with one another πŸ˜›

#

If you're talking about whether they can get the updated files as you iterate them, #source-control . the short answer is no; they'll only get the updates whenever something is committed and pushed to the remote server.

wise bridge
#

Hello everyone, I would like to create an hud above an object when someone is looking it. It work well, but when I work on the network the server see what the client player are looking, even when the event is replicated on client only? Here's the event I call to show the UI, really simple

dull lance
wise bridge
#

Hum

fading birch
wise bridge
#

(like this on my actor)

dull lance
fading birch
#

That's complicated tbh

#

I would take a look at the CMC

torn bane
# twin juniper What is it?

Advansed steam session, and its defined, we see each others sessions but i cant join , normally it works in my network compiled instanes of game

fading birch
#

since it uses rotaiton there

#

and just see how it does it

wise bridge
twin juniper
twin juniper
fading birch
#

set the value on the server only, call the OnRep

#

that's only for changing variables though

#

if you want to do actions, an RPC is better

torn bane
fading birch
#

are you traveling to the map?

#

is it marked as ?listen?

twin juniper
#

Kk also, I was reading the SetReplicateMovement method(), and I saw that it sets the bReplicateMovement to true; but I didn't see anything about the rotation replication... Can I assume that isn't replicated directly by CMC or AActor itself, by default? Or if bReplicateMovement receives true, does the engine deal with the rotation replication in another place? This makes me think about the necessity of sending a RPC to the server, asking to rotate the Pawn inside the server

fading birch
#

I don't know off hand

#

i'd have to research it

twin juniper
torn bane
#

I have on both levels diferent gamemodes

twin juniper
torn bane
twin juniper
torn bane
#

Yes client join to server and spawns in the lobby with no problem

twin juniper
#

Are your OpenLevel options using bIsLanMatching=1?

torn bane
#

But when im sending compiled game to my friend somewhere away they cant join/or joining just restart current level

twin juniper
#

Or ServerTravel options using the same option?

torn bane
#

I dont know what blsLanMatching stands for

twin juniper
#

IF you calls a OpenLevel, you can specify url options, and one of them is bIsLanMatching. =1 is for lan sessions

torn bane
#

There is no option to host a lan game, when Steam subsystem is valid lan is setted to false in my case

twin juniper
#

You can read the GameModeBase::PreLogin() method to see what makes the server to reject the client, since you said that your friend can see the session, but he/she can't join. I don't remember very well what the code does inside its scope

#

But its just an idea. Something is making your server reject the join request

torn bane
#

I, will read that tomorrow, thank for help, I have a friend thats have the same problem somehow

twin juniper
#

I would start with this method. But ofc, your code could have something that is messing up the request, somehow

torn bane
#

I maked sessions systems that many thimes that im in state where i have no idea coz code is easy, have logic and imo its without errors

twin juniper
#

T_T Its always about something stupid we forget, in the end. I'm always amused by the fact that even the littlest forgetfulness can #$%! our lives sometimes

torn bane
#

Haha same but in my case i dont care for now coz now if i can test game locally, im doin map and gamemode, later i will cry about it

fading birch
#

@torn bane are you opening the level with ?listen

karmic sparrow
# wise bridge Anyone got a clue?

Try this: When the client is interacting with the object that needs the widget, have the client spawn and attach a widget component to the target object. That way the client owns the widget component attached to the target object.

fading birch
#

hey man, some times it's the simple shit lol

twin juniper