#multiplayer

1 messages · Page 6 of 1

fluid summit
#

still looks really neat

glass orchid
#

So if an actor is not net relevant i cant get the distance between the actor and my character, right?

#

since their location is never updated

fluid summit
#

if you are on the server side, yes. because both exist.
If you are on your client, you may be able to get the location if the proxy actor already spawned before (in this case you will have an outdated location for that proxy actor)
if the proxy has never been spawned, the client doesn't know about it.

amber raft
#

Is there a way to play with two player controllers on the same machine?

#

So that when I run any instance of the application it creates a new player controller for that instance?

glass orchid
dark edge
glass orchid
#

yeah, so disabling relevancy is not the solution here

fluid summit
#

you can enable it by distance if you are worried about performance

glass orchid
#

im not worried about performance (yet). i just thought disabling relevancy was a good way of making an actor invisible to specific clients

fluid summit
#

i don't know much about it, but this may be a good case of environmental ques maybe? not sure

glass orchid
#

problem is that i want to be visible to some clients and invisible to others.

fluid summit
dark edge
glass orchid
#

yeah, team would be a good way to put it

#

thematically its about entering a mirror world, which mechanically just hides your character from everyone outside of the mirror world and applies some post process effects

dark edge
#

If you want to trust a client call me you can just have it locally not be visible if the team doesn't match the local team. If you don't want to trust a client, you can just replicate some variable on the character to play the sound floatCloseness

glass orchid
#

ideally i wouldnt trust clients, since in the end it's a pvp game, and those are very vulnerable to cheating

#

How would i go about setting up such a team system?

dark edge
#

K so just use relevency and tell the client how close they are

glass orchid
#

and how do i tell the client only how close they are?

dark edge
#

The same way you do anything. Either an RPC or a replicated variable.

#

You can easily have a variable on your Pawn, call it distance to nearest invisible thingy, and then have the server be set in that. The server tells a client how close they are. The client doesn't figure it out by checking their location and the things location, cuz then they know the things location and can cheat and just go there

glass orchid
#

So the distance variable is set by the server on the player character. That makes sense yeah.

#

Im guessing this would be done from the gamestate?

lean surge
#

I mean this is mostly location based whether a player should be “visible to another” but you might find it interesting

glass orchid
#

This is a very interesting read, thanks 😄

hollow belfry
#

X from the bp channel:
i'm running into an issue with client to server messages.
i want make an ingame terminal that can control a remote vehicle thats linked with it. should i make an ownership class that controls both from the top down? right now im trying to send messages between them via linked objects and it fails client side.
sorry if this is the wrong channel!

fresh geode
#

I'll keep it

fathom aspen
#

Keep this one instead @fresh geode

obsidian cargo
#

High level question: How do you have clients pass custom "character data" to the server when joining? I'm thinking preferences data such as name, character hair color, etc.

#

Or more particularly, I need clients to indicate if they are VR or non-VR when they join so the correct character can be spawned for them

fathom aspen
#

Do you mean data they had from previous level?

obsidian cargo
#

I've been looking at a few places on the connection flow, and I don't see where I can send custom data

#

I'm sure there has to be something I'm overlooking

graceful flame
#

EventOnPostLogin

fathom aspen
#

There are many ways...

#

That's the good news

#

The bad news is that you're going to have a hard time picking what works best for you

obsidian cargo
#

Yeah I know with a dedicated server you'd want to have user accounts, etc. But for now I just want a simple and dirty LAN approach where I trust the client

#

Just building some quick PoC stuff to test viability of VR and non-vr playing together

fathom aspen
#

One thing you can consider is the OptionsString. You pass it to the server when you travel

#

Even on first connection

obsidian cargo
fathom aspen
#

Correct

#

You have a bunch of params/options

#

Each can has its value

obsidian cargo
#

I've read about the options string before but I'm having trouble remembering where in the connection flow it is

fathom aspen
#

You parse it when the player joins

#

See InitNewPlayer for reference

#

In GameModeBase

obsidian cargo
fathom aspen
#

See the login functions

#

PreLogin

#

Login

obsidian cargo
#

Oh good to know

fathom aspen
#

The URL param there is what you're looking for

#

InitNewPlayer

#

For example parses the PlayerName

fathom aspen
#

It's a quite handy tool, really underrated

obsidian cargo
#

I was hoping there was a diagram / document about this flow that I missed somewhere. Cedric's guide is great, but I still feel a little fuzzy on some of the details

fathom aspen
#

You can also have some sort of a database service linked and have something similar where you parse data on player login

obsidian cargo
#

For now I'm building out a PoC as quickly as possible so I can try to win publisher funding on the project

fathom aspen
#

We should pay Cedric to write lol

obsidian cargo
#

🤔 Yeah that might work

fathom aspen
obsidian cargo
#

I've spent the last 8 months building a custom Chaos Destruction alternative that is VR friendly and fully replicated. But I've done most my testing in PIE up to this point

quasi tide
obsidian cargo
#

Now I want to scale up to a more direct LAN test with VR / non VR players

fathom aspen
#

Pardon me my lords 🙏🏼🤣

fathom aspen
obsidian cargo
#

I set my connection speeds and packet loss percentages to ludicrous numbers and found the CMC replication falls apart long before my custom destruction system does

obsidian cargo
fathom aspen
#

Yeah that's it. It really doesn't reflect how your game going to function in realtime

obsidian cargo
#

Yeah I have some concerns that single process muddles my results

fathom aspen
#

Also some of the things just don't work or crash. Take for example a seamless travel

obsidian cargo
#

In theory I should be safe regardless of packet ordering. Holy hell was packet ordering difficult to consider when dealing with alternating break / repair events

obsidian cargo
#

It should in theory be pretty simple, but I'm vague on the details

fathom aspen
fathom aspen
quasi tide
#

Apparently they're working on getting server travel to work in PIE

obsidian cargo
fathom aspen
#

Hopefully @quasi tide doesn't find a lot of bugs in there xD

obsidian cargo
#

Fast Array has some quirks. I NEVER "update" any of my elements, but sometimes I get a replicated update

fathom aspen
obsidian cargo
#

I went with a "read only" data approach where entries are only ever created or deleted, but never modified.

#

Yet I rarely get the update rep event on clients. I don't know if it's something to do with PIE, or just a quirk with Fast Array in general

#

Right now it's a small amount and I just ignore it

fathom aspen
obsidian cargo
#

Tell me about it I ❤️ FastArray

#

Made things so much easier for a neophyte like myself

#

Prediction Keys in GAS are pretty sick too

#

I made a simplified version for my own prediction. Really cool techinique.

#

In my case the prediction is visual only, so I didn't need to support roll back of any form.

fathom aspen
#

Yeah GAS is inevitable too. Has to get into it asap!!!

#

It's like every system out there has some GAS in it

fathom aspen
#

Yeah it's really a depends™️

#

Though when it comes to travels it's like never

#

Even hard travels

#

I mean I found that OpenLevel won't work if Absoulte was turned off in PIE. Though it works fine in standalone

pallid mesa
#

yeah traveling is out of the question in pie

#

i wish we'd get something working

fathom aspen
#

Has to so with single process thingy prolly

fathom aspen
limber gyro
#

hey guys, does any one have a code snipet on how to pass an int as an option to a server?

solar stirrup
#

Define pass

limber gyro
#

my bad

fathom aspen
#

Same thing. Use HandleOpenCommand

#

HandleServerTravelCommand

#

Whatever function works for you

#

And pass that URL like it's passed in the link I sent you

#

You have multiple options and they are separated with ? sign

#

You parse it when you login

limber gyro
#

ok my question might be a terribly articulated, what i meant was that i need to get the value in c++ after the server is open so that i can pass it onto a variable

fathom aspen
#

My answer still stands

#

See InitNewPlayer

#

Inside GameModeBase

#

They parse the PlayerName in there

limber gyro
#

im getting those values in the initGameState

#

im looking for something like this

#
    {
        UE_LOG(LogTemp, Warning, TEXT("Restart match setted"));
        restartMatch = true;
    }
fathom aspen
#

You can parse ints too

limber gyro
#

yes i just dont know the function

#

thats what i am asking

fathom aspen
#

Again go to the function I suggested

#

You'll get it once you look in there

fathom aspen
limber gyro
#

u mean HandleOpenCommand?

fathom aspen
#

That's the function that opens a level. Do you want to be able to pass the int on travel?

#

Or occasionally?

limber gyro
#

on travel

fathom aspen
#

Ok then look at the travel functions

#

There's a plenty

fathom aspen
obsidian cargo
pallid mesa
#

😄

obsidian cargo
#

Recommendations for a blog? I have a domain for my company. It's on my list to spin up a website soonish.

fathom aspen
#

I find GitHub Pages amazing ^^

fathom aspen
pallid mesa
#

don't bully Wiz

obsidian cargo
#

Only 129 lines in header and 44 in cpp, should I just post it here?

#

Funny part is most of it is usage notes

#

LOL

fathom aspen
#

Feel free

obsidian cargo
#

Oh looks like discord thinks it is too long

#

I'll look into a blog in a few days

#

The key core idea is really simple though. You just need this in your structure: ```cpp
bool bIsOnServer = false;
/**

  • On the Server, this uniquely identifies the network connection this was serialized on/from.
  • On the Client, will always be zero.
    */
    UPTRINT ConnectionKey = 0;```
#

And this in your net serialize: ```cpp
bool FSimplifiedPrectionKey::NetSerialize(FArchive& ar, class UPackageMap* map, bool& bOutSuccess)
{
// Only net serialized bit is if this is the connection for the client of interest. (most are not)
bool bIsSet = false;
if (ar.IsSaving())
{

     // The ConnectionKey is only valid on the server if this serialize is going to or coming from the client it was created for.
     // It is never valid on the client, but doesn't matter as client operates exclusively on bIsSet
    bIsSet = ((UPTRINT)map == ConnectionKey);
}
ar.SerializeBits(&bIsSet, 1);

if (ar.IsLoading())
{
    // Determine if this is on the server.
    UPackageMapClient* mapClient = Cast<UPackageMapClient>(map);
    if (mapClient)
    {
        bIsOnServer = mapClient->GetConnection()->Driver->IsServer();
    }

    if (bIsSet || bIsOnServer)
    {
        // Will get here if on a client and the server indicates the data around this serialize were predicted
        // OR will get here if on the server receiving details from a client that the client predicted
        ConnectionKey = (UPTRINT)map;
    }
    else
    {
        ConnectionKey = 0;
    }
}

bOutSuccess = true;
return true;

}

#

Oh and you also need this in the header, but it's pretty simple: ```cpp
/**
* If true, we know the RPC or rep that sent this key was predicted by the client.
*/
bool WasPredictedByClient() const
{
return IsSet() && !IsOnServer();
}

/**
* On Server, if true and a proper ConnectionKey is set, the Server will notify the Client that replicated Cues were previously predicted and don't need to be played again.
* On the Client in Break and Repair calls, this tells the client it can avoid calling the Server RPCs because the server is already running the logic.
*/
bool IsSet() const { return ConnectionKey != 0; }
/**
* Returns true if this key was told it was created on the server.
*/
bool IsOnServer() const { return bIsOnServer; }```
#

The reference to "Break and Repair calls" comes from my destruction system. They are essentially calls made interchangeably on server / client that "magically" cause the logic to end up on the server because they utilize an internal Server RPC call that just calls back into the Break / Repair call.

#

IE: void Break(/stuff/, predictionKey); is called on both client and server, and inside is if (IsClient() && !predictionKey.IsSet()) { Server_Break(/stuff/, predictionKey); }

#

void Server_Break(/stuff/, predictionKey) { Break(/stuff/, predictionKey); }

#

There's additional validation details, but not related to the prediction key here.

#

@pallid mesa ^ Feel free to use. I can share additional details if needed.

#

Ultimately, this is just a regurgitation of the prediction key in GAS with a small amount of added documentation.

unkempt tiger
#

Is anyone else experiencing horrible performance when playing as several clients in PIE on UE5?

obsidian cargo
#

I've observed really odd issues with timing with clients with PIE in 4. As in timers have finished 6 or 7 frames too soon or too late

unkempt tiger
#

It feels like it's gotten worse

#

But yeah, in UE4 it was also bad, especially after upgrading to 4.27 if I recall correctly

obsidian cargo
#

Cries in 4.27

unkempt tiger
#

Are you using Wwise @obsidian cargo ?

obsidian cargo
#

Absolutely not

#

I've used it in the past and won't touch it if I don't have to

unkempt tiger
#

What did you dislike about it?

obsidian cargo
#

I was using it at a smaller company where it was way overkill, but the short version is it was a PITA to get asset packs for DLC in Unity working.

#

Maybe the Wwise UE integration is better 🤷

unkempt tiger
#

Oh I can imagine, I asked because I thought it was having trouble handling different audio devices for each client, but perhaps that's not the case

rancid monolith
#

I'm trying to equip a weapon to player characters using a c++ function called during BeginPlay, but for some reason the weapon class (assigned through blueprint) is null, but only for clients. It works when run standalone or as listen server, but not for connecting clients.

Should I be calling the function elsewhere, in case I need to wait for the value to initialize or something?

twin juniper
#

Guys a help here for me, I installed an unreal engine 5, I put the Sessions plugins for the guys to use with a steam and I'm stuck for 8 h trying to fix a package error by the plugins.

no joke
https://forums.unrealengine.com/t/engine-is-unable-to-access-appdata/624025

valid bough
#

Hey, im playing on a listen server testing out my game. How do I get all the players in the listen server? I put the player count to 2 and im only getting 1 print back which is my computer. How can I get the actual pawns / players in game? I understand why its printing my pc because im the only pc in the game but I'm playing with the player count to 2 i need both players locally on this PC currently playing

#

Should I just get world , get all actors of class and point to the controllers its using?

lusty yarrow
#

Hey I got a dedicated server running on aws gamelift, whenever I try to connect to it (no gamelift features usage yet) with IP:PORT in the Open Level node, I get this error LogOnlineSession: Warning: OSS: No game present to join for session (GameSession)

#

I thought the dedicated server is supposed to create a session when it gets a connection?

crystal crag
#

How are you supposed to know which friend is tied to the presence structure?

#

[2022.08.08-23.33.27:532][ 85]LogRaevinParty: Warning: FOnlineUserPresence {Online: 1 Playing: 1 ThisGame: 1 Joinable: 0 VoiceSupport: 0 SessionId: NULL Status: FOnlineUserPresenceStatus {State: Online, Status: , Properties: }

#

What the hell am I supposed to do with that

#

That is the most worthless event ever, in the history of events

#

OSS: Hey! Hey now! There is someone that has updated their presence and is playing the same game you are playing!
Game code: Ok great! I am so glad to hear that. Who is it? so can you tell me who they are?
OSS: Oh it's... it's.... well I don't know. I can just tell you that someone is online playing the same game you are.
Game code: Oh... well I am so glad that someone on the planet is playing the same game I am playing. It sure would be great to know who so I can invite them into the game.

weak osprey
#

So, I've found a variety of projects you can purchase that enable multiplayer over lan, but none that are first person over epic services and/or steam; has anyone found a project like that available for purchase?

#

I don't want to code it myself, I want to code on top of it. Sorry in blueprints, all this.

novel bison
#

qq: if a ballistics plugin needs me to run animations on the server is that going to cause performance problems? i dont think the animation itself would have to be synced, but just assuming that it runs if the same overlay state is active on the server

fathom aspen
winged badger
#

this is also one of the very rare uses where GetPlayerCharacter[Index] is acceptable

#

GetGameMode->GetNumPlayers->For (0 to NumPlayers - 1) GetPlayerCharacter[Index]

fathom aspen
#

Yeah I was amazed the other day that these functions works on server for indices bigger than 0

#

Or maybe GetPawn on that PlayerState array element

#

Sorry to necro this, though I didn't think of this at the time. How do you get a refernce to the deactivated PS inside OnDeactivated? Do you cache the one Duplicate creates?

winged badger
#

It has a function thats called like that

#

So its this

#

That is actually a pretty good way to iterate all characters or controllers from bp

#

On server

fathom aspen
winged badger
#

void ARTS_PlayerState::OnDeactivated()

#

which is an engine function override

fathom aspen
#

Correct. It has no reference to the inactive duplicated PS. It destroys the old one by default

#
void APlayerState::OnDeactivated()
{
    // By default we duplicate the inactive player state and destroy the old one
    Destroy();
}
#

I was asking how you get the reference to the inactive duplicate PS 😄

#

I'm afraid that overriding Duplicate and caching the one created there has side effects

#

The other option would be to traverse the InactivePlayerArray here and finding it based on UniqueId (before old PS is destroyed at that line) for example, but that seems an overkill 😦

winged badger
#

ask me next week when i have more time to dig through code i only vaguely remember writing

#

this week DLC going out

#

we might had not duplicated and destroyed the PS, i don't remember now

fathom aspen
#

Thank you and no worries. Also good luck on that too!

coral wing
#

How do you name your multiplayer session for people searching.

ocean vessel
#

Hello, I have a specific problem

Current floor in Character Movement Component doesn't return actor on Simulated proxies on Clients, but only on a spline mesh i've created. I guess there's something i should turn on in the collision, but i have no idea what.

grand mica
#

@fathom aspen another question for you.
I am trying to print logs on client's screen from AIController.
Since you told AIController logic happens in the server so I tried to print the logs with client rpc, didn't work. Then I tried to call the server function and then call client rpc to print the logs

#

nothing worked tho

#

how should I approach this?

thin stratus
#

If you try that then you didn't understand Ownership

#

You can't run ClientRPC on something that isn't owned by a Client.
And that AIController, ontop, doesn't even exist on the Client.

grand mica
#

I tried to print it from the character too.

thin stratus
#

Is that Character owned by a Client?

#

Answer: No

#

So no, it won't work there either

#

AI is Server Auth

grand mica
#

How should I approach this then?

thin stratus
#

What are you trying to do?

grand mica
#

want to print the Bots' tasks on client's screen to know what they are trying to do

thin stratus
#

Is that for Debugging?

grand mica
thin stratus
#

If that's only for debugging and will be removed again, use GetAllActorsOfClass with the PlayerController as Class

#

And call the RPC on that.

grand mica
thin stratus
#

Depending on what it is, you can also simply replicate in through the Character

#

And let Tick print it locally

#

Just not via Client RPCs

grand mica
#

player controller will have client auth I guess and calling a delegate from server to client might work?

grand mica
fathom aspen
#

Only way to go from server to client is either replication or RPCs

#

Attach a 3d widget to your AI pawn and print w/e you want to it

#

Since AI pawns replicate you should see what they are trying to do

gilded merlin
#

Hi. My case is that I have 2 players, one is listen server, second one is player.

I use repnotify to close or open doors.

Repnotify is being called on the server, and the door mesh location is being updated, however, mesh collision isn't updated, until I get a little bit closer.
Any ideas why would it behave like that, any solution?

(So when I want to go trough the doors on client, i cannot do that because server thinks there's collision and blocks the player)

#

(I move doors using animations)

thin stratus
#

Is that a SkeletalMesh?

gilded merlin
#

Yes

thin stratus
#

Go into the SkeletalMeshComponent of your Door

#

And check for the Bone Updates

#

It should always update, not only when rendered

gilded merlin
#

Is that what you mean?

thin stratus
#

Think so yeah

#

There is an option to always tick everything or so

gilded merlin
#

Doesn't seem to work 😦

thin stratus
#

Are you actively Playing a Montage when opening the door or just setting the position?

gilded merlin
#

Setting the variable which translates to anim percent

thin stratus
#

Does it work if the Server stands directly next to it?

gilded merlin
#

yes

thin stratus
#

So if you are further away, you can still see the door opening on the Server, but hte Client isnt able to go through?

gilded merlin
#

yes

#

I can see that the doors are open, both on the server and on the client

#

But I can't go through them with client until I get closer with the server

#

I even debugged it, and can see which specific skeletal mesh is blocking me, even thou on server it looks like it's open

thin stratus
#

What happens if you move the whole mesh component aside in your OnRep?

#

(trying to see if it's animation related)

gilded merlin
#

It works then

#

So it seems to be animation related

thin stratus
#

Hm, then it's something with the animation :<

#

Not sure right now, sorry

gilded merlin
#

sure, np. Thanks for trying! I'm a little bit closer now anyways

#

I'll let you know what it was when I fix that

grand mica
worn wagon
#

Question about replication. Say I set a couple of replicated variables one after another serverside, are they guaranteed to arrive in any particular order?

fathom aspen
#

Nope

worn wagon
#

didn't think so

#

thanks

#

Syncing variables with RPCs seems much easier to work with

chrome bay
#

It's not because late join and relevancy breaks it

#

Persistent properties should always be replicated vars

worn wagon
#

It's irritating

#

I need some of the functionality of both

chrome bay
#

The way to deal with it is to mark the vars as replicated, everything else should work automatically. If you use RPC's then state will be lost

#

If you want properties to replicate together, put them in a struct and define a custom NetSerialize() method for it - but note that you lose the delta-replication that way

worn wagon
#

For example though, for firing a weapon I was queuing up weapon shots to deal with variable latency. If the client shoots an automatic weapon with a ping of 100ms, then the next shot the ping is 90ms, the server won't be ready to fire again because of the fire rate, so it needs to be queued up and fired as soon as it's allowed. But this meant the replicated ammo was being changed on the server and replicated late causing the client's ammo to jump sharply.

#

So I set it to replicate conditionally as InitialOnly and do the rest with rpcs

chrome bay
#

It won't work - and it won't make a difference anyway because the RPC will arrive just as late as the property

worn wagon
#

Wdym

chrome bay
#

the latency is the same regardless of whether you use a replicated property or an RPC

worn wagon
#

Oh I only update the ammo on a reload

chrome bay
#

An RPC can actually be worse, because when they are reliable they delay all other reliable RPC's to preserve execution order

worn wagon
#

I know the latency is the same

#

So the client ammo is independent outside of reloads

#

But it should always be the same outside of the client cheating, even so it wouldn't matter it's still validated on the server

chrome bay
#

The other approach ofc is a prediction system. The ability system has this built in as a general concept, but you can also roll your own

#

But the real problem is you will have trouble synchronising the true state of the weapon if network relevancy changes or when a client joins late, because the server will have no idea what properties changed for each client.

worn wagon
#

Queuing up the inputs seems to work pretty well

#

At least for my purposes

#

I have a question, since you seem pretty experienced. I'm having issues with the "first function" to be called when a pawn is created or restarted. Sometimes the beginplay function is called first, sometimes the restart function gets called first. It's annoying. Also the listen server host has its own set of issues with running all of that shit before the pawn gets possessed. Is there somewhere you can run code after the pawn is created AND after it has been possessed?

#

Something that is guaranteed to run before everything else

#

It sounds like it should be obvious

chrome bay
#

There isn't really, possession is determined by the controller - and since it's a different actor it replicates independently of the pawn, so it's fairly random whether or not the pawn will be fully possessed when BeginPlay() etc. is called.

#

But you can workaround it by overriding things like the OnRep callback functions

#

Similarly whether BeginPlay() is to be called is determined by the GameState, which is another independent replicated actor - so there are race conditions between three different actors for something like that. These are mainly why the OnRep functionality exists, to be able to handle initialization/changes etc. when properties are updated from replication.

quasi tide
#

I have a question, since you seem pretty experienced.
I'd hope Jambax is pretty experienced. Job title would be awkward otherwise 😅

fluid summit
#

@dark edge Hi! i was thinking on how to make this "packages" of similarity with the wave function collapse approach.

i'm thinking on use the normal weights that they already have for the chances of spawn and also add a new condition like "Multiplied chance of same cell type near" and a flag for it.
So if i want to, there's X more chance of a cell of the same type spawning around it.
What do you think? did you have something similar on your setup?
p.d.: posting it here and not dm because maybe it's usefull for someone

chrome bay
#

@worn wagon Generally you can get around race initialization issues doing something like this:

{
    Super::BeginPlay();
    
    TryInitiailize();
}

virtual void OnRep_Controller()
{
    Super::OnRep_Controller();

    TryInitialize();
}

virtual void OnPossessed()
{
    Super::OnPossessed();

    TryInitialize();
}

void TryInitialize()
{
    if (HasBegunPlay() && GetController())
    {
        // Do init
    }
}
#

Psuedo-code but you get the gist..

fading python
#

@thin stratus Hi, do you setup and manage UE5 servers?

worn wagon
#

The initialisation issues have been annoying me for a while now

#

so OnRep_Controller is basically the clientside version of OnPossessed?

#

I wonder if it would be called at any other times

chrome bay
#

The OnRep's are just called whenever the replicated property is changed, so it could be valid, or it could be null

twin juniper
#

Hey, any good tutorials to make a UE5 game server
I have source access and did pull it off in UE4 but that was ages ago

static sable
#

hi, anyone has any good doc on "fog of war in RTS" - obviously I don't want to replicate any info if unit is in the fog... etc...

fathom aspen
#

Didn't check it yet

limber gyro
#

hey guys, this works on the editor but not when i package the game, any ideas?

#

it complains of invalid options

#

nvm i misspeled a letter

#

if i want to spawn UI only on the client what would be the ideal node for the "if" check?

graceful flame
limber gyro
graceful flame
#

Are you using listen server?

#

or dedicated

#

actually doesn't matter, its client only yeah, mouse over the Add To ViewPort node and it tells you

limber gyro
#

my idea was to use a check for performance reasons but it seems that its not needed then

#

im acualy using both server types

#

the cast that i am doing will still run in the server i assume but a cast only shouldnt be an issue

graceful flame
#

I don't see any cast in your screenshot

limber gyro
#

this is was what i was refering to after

#

it had a "if" at the beggining

#

so since those nodes are client side only does that mean that the execution stops at the client side nodes in the server or the next nodes still run?

graceful flame
#

i dunno, just step through your code with breakpoints to find out

dark edge
graceful flame
#

If the server reaches "Create Hud widget" it stops there because that's a client only node.

fathom aspen
# limber gyro

Those functions are cosmetic meaning they don't run on dedicated servers, or shouldn't be

#

They would get you errors in such case

#

Widgets in general are owned/assigned to local controllers

#

So they can still be server sided in case of a listen server player

fluid summit
fathom aspen
fathom aspen
graceful flame
#

Well it switches to whatever client stuff has to be processed next then back to server for the other player... etc right?

#

You can test this by setting a breakpoint and leaving the debugger set to default instead of a specific target and watch as the process happens.

fathom aspen
#

Yeah it executes on whatever instance calls that flow, even if one of them fails it

rancid monolith
#

On my character actor class, I have a property that I assigned in the character's blueprint, and for some reason it's just a null reference for characters running on client games.
It works properly for all characters on the server when playing as a listen server, and when playing standalone.
Any idea what might be the cause of that?

rancid monolith
#

Yeah, but I probably messed something up setting it up

sinful tree
#

What type of reference is it?

rancid monolith
#

UClass

#

UPROPERTY(EditDefaultsOnly, Replicated)
UClass* FPAnimInstance;

sinful tree
#

Do you have the property defined in the GetLifetimeReplicatedProps function?

rancid monolith
#

I have:
void AWeaponBase::GetLifetimeReplicatedProps(TArray< FLifetimeProperty >& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(AWeaponBase, FPAnimInstance);
}

sinful tree
#

Is AWeaponBase marked to replicate?

rancid monolith
#

in the derived blueprint class I made, yeah it is

still coral
#

Question: is setting the Velocity manually client prediction friendly?
I'm doing this on the client for prediction but also doing the same on the server, and I'm getting hitches whenever this happens 😐

light iron
#

Does anyone have a resource for setting up a team, round based single elimination game mode? Using Lyra so I have teams set up, but would like some guidance as to how to craft this alongside their toolset.

winged badger
#

if predicted, and server modifies speed/velocity first, you get corrections

#

if autonomous proxy modifies it first and RPCs it to server, then corrections are minimal, if any

shell forum
#

How would one go about persisting something like an array of playerstates through seamless travel?

#

Aside from using GameInstance.

worn wagon
#

It thought it was in gamestate too but I can't find it

#

Also, does anyone know if OnRep is called if the value hasn't actually changed? In the case where you update a variable on the client and server around the same time, then the server goes to replicate it. I'm sure I could figure out a test for this but would be easier if someone knew already xD

sinful tree
worn wagon
#

Since I want variables to be replicated but I also need them to be update in a timely manner in some situations via reliable RPCs. If it called on rep after the rpc updated the value on the client it would run the functionality twice which is not what I want.

#

Seems like it should all work out then

worn wagon
#

Like you said earlier the GameInstance is the place to do it

#

That's the only thing that will persist across levels

#

Outside of caveats like the copyproperties function

#

So in seamless travel the gamemode will be carried over, you can just store stuff there it seems

celest pulsar
fathom aspen
#

The functionality is already there

fathom aspen
worn wagon
winged badger
#

there is also a funny part where the travel map game mode can fuck up the seamless travel list

fathom aspen
#

Even if you use the GameInstance to persist PlayerStates that are linked to players you're still out of luck. The references are still destroyed

winged badger
#

if not of the same class

fathom aspen
#

I mean try to override that function and make the GameMode persist to destination level

#

You would still have to reconnect your players, otherwise they're stuck

fathom aspen
winged badger
#

i have a mission setup actor

#

it gets loaded with entire map and random generation config

#

travels to combat, records notable stuff there

#

travels back to lobby

#

in campaign mode that carries information like deployment result victory/retreat/defeat back

#

and then strategy layer awards are based on that result

#

and also, as a seamless travel actor

#

it and all its data is there and ready to be used when functions like InitGameState start to be called

#

so its great for initialization order too, its just there, no matter how early you try to find it

fathom aspen
#

Wow, cool! The reference truly persists. Though GameMode is the one that spawned it right?

winged badger
#

reference does not

#

i do need to actually find it from the GameMode

#

each time i transition a level

fathom aspen
#

You TActorRange it?

winged badger
#

GameMode did spawn it, but that doesn't matter for travel here

#

yes

fathom aspen
#

I see. So you don't cache a reference but find it, as the reference won't keep up

worn wagon
winged badger
#

for (AMyActor* MyActor : TActorRange<AMyActor>(GetWorld())

#

more elegant syntax for iterating actors of type

fathom aspen
#

Finds an actor (iterates)

#

Elegancy at its finest

worn wagon
#

Ah i see very nice

still coral
winged badger
#

if its a bit fast

#

you might want to configure CMC for greater tolerance before correction

celest pulsar
humble edge
#

Dedicated server stucks at this log . Dedicated server of Old version of this Project runs successfully last log (Engine Initialization) while dedicated server of updated version of project dont initialize properly and cant connect to clients. Help how can i fix it ? Anyone who has experienced this and solved it?

gilded merlin
sand holly
#

Incredibly rookie question, but do you need to spend money on servers if you want to make an online game with Unreal? Or does Unreal already have servers you can use?

hoary nova
#

I think there are some options as to servers, but i'm guessing they are not free. Check Epic online services, I haven't looked into it myself but I'm guessing it is exactly that - servers.
also unreal supports peer to peer

fathom aspen
#

Unreal doesn't support a true p2p. The most close configuration to that is called listen-server, were stuff has still to go into the server.

sand holly
fathom aspen
#

Yes by default, everyone is disconnected. A while back, someone sent a plugin here were they workaround that. Not sure what they do

sand holly
#

So can't you make another player the new host of the server?

fathom aspen
sand holly
#

Wow exactly what I was looking for. I'll take a look, thanks!

celest pulsar
#

Hi, i have the same "UniqueId: INVALID" problem. Do you solve it finally ??

opal fox
#

anyone know how to communicate with a the Client regarding sending values to the Animation blueprint from a server only place in code? Sending an rpc to owning client doesnt work because the server is the one who owns the creatures im trying to animate.

unreal plover
#

Hey everyone,
So I'm creating a multiplayer game with Steam OSS. So far I'm able to host and join on LAN. But, when creating over Steam OSS, third player is unable to see the hosted server, i.e. not listing in the server browser. Checked server settings and max allowed players. Everything works fine in LAN session but not so much in Steam session. Anyone having any insights on this?

thin stratus
#

Is there a UActorComponent function that guarantees that I can run RPCs from that point on?

#

Other than BeginPlay

static flare
#

I attach a ChildActor to a ParentActor using SnapIncludingScale, and set the Parent's scale to 0.5. They both scale down to 0.5. And the child's Transform.Scale is 1 (so it's relative to Parent). Nice. This is as expected.

Then I replicate the Parent (and the child) to a client, and there they show up with Parent scaled at 0.5 (correct) and the Child scaled at 0.5 (relative to parent, so 0.25 in world scale). Why?
How does the attached child inherit the scale?

thin stratus
#

Are you scaling the Actor directly?

#

Cause iirc ActorScale is already replicated

#

It basically takes the ActorScale and applies it twice then

#

Which causes your 0.25

static flare
# thin stratus Are you scaling the Actor directly?

So, I'm actually only spawning a ParentActor, with scale 0.5 in its Transform. That code only executes once, and only on the server.
That ParentActor then spawns the ChildActor (during its OnConstruction) and attaches it to itself using SnapToTargetIncludingScale. I store a (replicated) reference to the ChildActor in the ParentActor.

It feels like the ACTOR-instance for the Child is replicating itself with 0.5 scale because that's its RootComponent's world-scale on the server, disregarding the fact that its scale is 1 relative to its RootComponent's ParentComponent (since it's attached). Or.. something. This is hard for me. Could the ChildActor's "ActorReplication" be fighting with the ParentActor's "ComponentReplication"-stuff? Since the ChildActor is a "replicated actor reference" and a replicated component..?
(So no, I never apply any scale on the client-side, and never on the Child)

mighty barn
#

I'm wondering about the best way to set up locomotion to be multiplayer ready, would state machines be the best choice?

opal fox
#

@mighty barn theres no multiplayer regarding state machines

#

and what do you mean by multiplayer ready?

mighty barn
#

Im hoping to use listen servers and allow players to host their own server by acting as a client for other people to connect to. I was wondering how I should set up everything so that it would be replicated properly

thin stratus
#

I usually only scale visuals and change collision sizes accordingly, cause I only had issues with Actor Scale and networking

opal fox
#

@mighty barn as far as I know the replication of the animation blueprints its already handled by epic, if youre playing a specific animation based on a specific variable, u just need to make sure the clients and server are synced on the value

#

so yeah just using the normal state machine is probably the most common solution to your problem

unreal plover
#

How to call a function declared in client game instance from server game mode?

mighty barn
fathom aspen
still coral
winged badger
#

there is tolerance somewhere in editable config

#

i think its 3 UU by default

#

but that doesn't work for speeds much larger more then bipedal movement speeds

#

which is saying, it better be under 1000 if you don't want corrections

opal fox
#

@dark edge yes it seems obvious and when I do that it doesnt replicate the variable down to any clients, im nto sure why

#

not even multicasting the variable works, this is specific because its being done inside a blackboard task, so im not 100% what that implies

latent heart
#

As long as the object it's on is replicated, it should replicate.

#

As long as the actor is replicated to every client, a multicast rpc should get sent to every client (from the server) as long as the actor is relevant to that client.

opal fox
#

@latent heart so the AIController is always relevant, and the monster or whatever that is using the controller is replicated and everything else replicates, but this specific BTT_BlueprintTask doesnt replicate its variables 😦

latent heart
#

Controllers are never replicated except to their owning client.

#

It won't be relevant to any clients.

opal fox
#

Yeah, but the actor that has the controller is replicated

#

and relevant

latent heart
#

Doesn't mean the controller will be.

opal fox
#

no, but is it the controller that owns the BTTasks ?

latent heart
#

Probably.

opal fox
#

Probably something like that yea

#

Might need to approach hwo those tasks are used a bit differently

quasi tide
#

I'm pretty sure BT's only run on server anyway. Why would a Task be replicating?

#

Only the server needs to know anything about it.

latent heart
#

Put any variables you need to replicate on the actor itself

opal fox
#

Yeah but if it has some value in the task, that u wanna get to say the animation blueprints, which wants to be on the client

#

then that is the issue

#

@latent heart yes I think that makes more sense anyway

dark edge
#

anim bp doesn't care abuot the brains, it cares about the body

opal fox
#

@dark edge yes it makes sense that the animbp should read variables, thats the idea behind recieving information from its replication

clear swallow
#

Would anyone be able to help me figure out why my replication is not smooth please

#

It is in C++ and I'm just totally stuck

opal fox
#

@clear swallow maybe check the update frequency of the actor

clear swallow
#

I did

opal fox
#

what about it is that is not smooth?

clear swallow
#

I have to set it to 5 and then use the server to update it

opal fox
#

5 is pretty low for a "smooth" behavior

#

try putting it to 10

#

see the difference

clear swallow
#

But when i change the variable on the server it wont update and goes really laggy

#

Like the rate at which the object spins doesnt change on the server at all

opal fox
#

are u updating it to the server ?

#

or sending it to the server from client

clear swallow
#

It should be yeah

#

the variable is replicated

opal fox
#

ok so if its replicated then u should set it on the server

#

and make sure the whatever function ur running on the server is updating frequently enough for it to be smooth

#

or alternatively lerp the value

clear swallow
#

I am running the movement in tick

opal fox
#

did u try setting the net update frequency to 10 ?

#

if i set it to 5 on my enemies they are also choppy

clear swallow
#

I can show you what im trying to do if you want

opal fox
#

sure i can have a quick look

karmic kite
#

having trouble getting replicated actor deleting working, when the item is picked up and dropped once every time after that the actor will not be deleted on the client and only on the server how do I fix this issue any ideas? (video of the issue and the code )

sinful tree
# karmic kite having trouble getting replicated actor deleting working, when the item is picke...

If it's a replicated actor, you only need to destroy it while running on the server.
You can only call "Run On Server" RPCs on actors that are owned by the client.
It's also a really bad idea to have an RPC that tells the server to delete an actor as someone could potentially spoof that RPC and feed in whatever actor they want, and the server will destroy it.

So what you should do:
Update your Interface to pass along a reference to the interacting player controller or character based on wherever your interact event is.
Your interact event (key press I'm assuming) does as it does up to the point where you're about to pass to the Interact interface.
Instead of calling the interface, do your "Run On Server" event in your player controller or character, wherever your interact interface currently is. Pass through the reference to the actor that you want to interact with.
In the Run On Server event, call the interface on the actor, passing along a reference to player controller/character - this avoids you from having to use anything like "Get Player Character 0" within the item.
Once you validate that the player is able to pick up the item, proceed with destroying it.

young kestrel
#

Quick and maybe stupid question:

Is it normal to have weapons spawned X times? (for each client + server)
If I have 4 clients and each has 3 weapons would that mean the server has to handle 12+ weapons (which are actors)?

sand holly
#

Does anyone know a good document/article that states the pros and cons of each type of networking? Like p2p, listen server, dedicated server, ...

sinful tree
# sand holly Does anyone know a good document/article that states the pros and cons of each t...

In UE there is no P2P, only listen server and dedicated server.
Listen servers have one player acting as the server of the game. If the host leaves, all players are kicked from the game. It generally takes a bit more processing power to be both the server and playing the game.
Dedicated servers are their own copy of the server running with no player acting as the host. If all players leave the game, the server can still be running.

sand holly
sinful tree
# sand holly But a dedicated server costs money right?

No. The concept of a "dedicated server" just indicates an instance of the game running in which no players is also playing on that same copy of the game. That means you could run a dedicated server on your own hardware, or a player could run one on theirs. If you wanted to join your dedicated server, you'd have to run another copy of the game and connect to it.

sand holly
#

Does your PC have to constantly run the game for the dedicated server to be up?

#

Or how does this work, is it like in the background?..

sinful tree
sand holly
#

Wait so let's say as a player, from the main menu you can create a server that others can find and join. This server doesn't have to be a listen server?

sinful tree
sand holly
#

But still when that player leaves the whole server gets shut down right

sinful tree
#

Only if the player shuts down the dedicated server instance / turns off their computer.

sand holly
#

Hm okay, so is there a way to have this system of creating and joining servers without depending on the host?

sinful tree
#

That would mean you would have to manage your own dedicated servers instances like an MMO.

#

At that point, you're probably spending a lot of money as you'd need to use some hosting service to handle multiple servers.

sand holly
#

Like when the host leaves, the server gets a new host?

sinful tree
#

Can't speak to it, it's not something I'm familiar with.

sand holly
#

But technically would it work?

sinful tree
#

I have no clue.

sand holly
#

Hmmm okay well very interesting setting up multiplayer is actually such a hassle lol

#

Thank you for your insights

fathom aspen
sand holly
#

Good idea, will do!

quasi tide
#

It'd be interesting for you to ask someone trying to sell their plugin, if it works or not and they respond with, "nah"

sinful tree
#

XD

sinful tree
# sand holly But technically would it work?

I will say this, if it does work, it's probably a ton of data that would need to be transferred over the network constantly (eg. you lose the benefit of actor relevancy, all players would have to know where everything is and what it is doing). It's probably still running as a listen server, and upon the host disconnecting, the new host's game launches their own listen server and is set up as it was before the host disconnected, then the other clients would be attempting to reconnect. This means its also probably not seamless.

sand holly
#

Idk if you've ever played overwatch, there is a custom games feature in which you can also setup your own servers

#

When the host leaves, automatically another person becomes the "leader" of the server

quasi tide
#

Yes. Host migration.

sand holly
#

But in OW it's seemless, I wonder how they pulled it off

sinful tree
#

But when the host leaves, how quickly is the transition to the new host? Is it seamless?

sand holly
#

Yess

sinful tree
#

That probably means it was set up to be a P2P networking model from the get-go. All clients would have all the data, know all the states, share "rules" and determine if something happening is valid, one player leaves, the rest keep playing as is.

peak sentinel
#

its actually basically how Datura explained

#

everyone saved the state of the world, then loads it

sand holly
#

Does it affect performance?

peak sentinel
#

never tried

#

But just assumption: it wouldnt

#

it just saves transform, actors etc.

#

my biggest worry was the size of the saved data

#

but owner said it'll be around a few kbs

#

biggest problem of that plugin is, its exploitable

#

since everyone saves the data locally

#

you can change it and become host somehow

sand holly
#

Can hosts easily exploit a game

#

even if it is just a normal listen server?

peak sentinel
#

not hosts, everyone

#

everyone can exploit a listen server

#

no way to fix it

#

thats why dedicated servers a thing

#

data is in somewhere far away in a server lab

#

you cant modify it

sinful tree
#

Um

#

That's not entirely true.

sand holly
#

gawd dayum

peak sentinel
sinful tree
#

If you're the host, then you have control of the server, so yes, you can do whatever you want to the server.

#

Just because it's a listen server doesn't mean that players can exploit it.

peak sentinel
#

true

#

the problem is, hosts are players

#

thats what I meant to say

#

but Im aware its poorly formalized

sand holly
#

So what would be the best option if you want a system where players can create a server that lasts until there are no other players in that server?

sinful tree
#

If you want a seamless system in unreal, then when a player wants to start up a server, they're making a request to launch a dedicated server on some hosting platform that you've set up, and then that player joins it. Others can join by searching for it/using sessions. If the original player that start the server leaves, the game still continues without them. Once all the players leave, the server shuts itself down.

quasi tide
#

The easier approach pretty much.

sinful tree
#

But $$$

quasi tide
#

Provide server binaries. Have them set it up themselves 🤣

sand holly
sinful tree
quasi tide
#

I'm aware

sand holly
#

Well what part of it costs money

sinful tree
#

Well, you're either going to be opening up your own data center to house the servers required, or you're going to be paying a hosting service (like AWS) to run those servers for you. Both cost $.

#

That's where the benefit of letting players run their own dedicated servers.... They then are paying that cost.

sand holly
quasi tide
#

Literally

sand holly
#

What I don't want the players to pay for a server then no one would play 😂

quasi tide
#

Not true in the slightest.

#

People love community servers

sinful tree
#

In the early days of networked gaming that's basically all you had.

#

Had to boot up GameSpy and find people running their own Team Fortress servers and join some 2fort4.

sand holly
#

And those people payed with money for a server?

sinful tree
#

Sure. Sometimes it can be as simple as just running an older computer in your house.

#

That still costs money.

#

Power, internet usage, etc.

#

If you host the server, you are paying for it.

sand holly
#

So let me get this straight, i can implement:

  • A listening server system where the player is the host of the server. This is easily exploitable and the server shuts down once the host leaves

  • Set up a hosting platform and let the player connect to a dedicated server hosted there. This costs a lot of money for me

  • Let players pay to create dedicated servers. This costs money for the player and gets shut down once the player turns their computer off

graceful flame
#

What is the process to figure out how much it will cost to host your own servers? My guess is that you first need to determine how much cpu/memory is required to run one instance of your game and then try to find the best option where you can fit as many instances as possible into a single server without affecting performance. Then you also have to consider bandwidth costs...ughh

graceful flame
#

Could also do a mix of hosting options. Let players host it themselves and play with friends, host some dedicated servers on your own and allow for community servers to thrive on their own as well.

#

It depends on your game

#

If you're making something like a co-op horror game or whatever then it makes sense to stick with listen as small groups of players are probably friends and cheating isn't all that big of a deal.

But if you're making a game for a larger amount of players per game it makes much more sense to go down the dedicated server path.

sinful tree
# sand holly So let me get this straight, i can implement: - A listening server system where ...

Listen servers are only exploitable in the sense that a player is the host and they have control over the hardware the game is running on, thereby they can tamper with the memory of the game allowing them to do things that may not necessarily be valid.

If you allow players to create dedicated servers, it's a similar issue - they have control of the hardware the game is running on, so they can tamper with it. The dedicated server doesn't necessarily mean they're running it on their own computer, they can host it somewhere else if they decide that has 24/7 uptime, but that's up to their discretion.

sand holly
#

I want the servers to be like a freeroaming space where players can PvP freely, chat and trade stuff

graceful flame
#

So like an MMO?

sand holly
#

In a way, but like getting your abilities and stuff in a separate single player mode

graceful flame
#

Unlocking stuff in single player that can be used in multiplayer will result in lots of cheaters who are able to unlock stuff instantly.

sand holly
#

Is a singleplayer mode that exploitable?

graceful flame
#

Single and listen are exploitable, even dedicated although to a lesser degree

sinful tree
#

Again, if you have control of the hardware the game is running on, you can manipulate the game.

sand holly
#

Okay so what if I have an offline story mode where you unlock your stuff normally, and then in the online mode you can customize everything freely

graceful flame
#

Your game is just a process running on your computer. Any process can have its memory altered because well the memory is just there physically on your own computer. So in other words you can boot up a cheat engine and start changing the memory around to make the game do stuff without having to actually do the thing you designed the player to do. They can just hunt around and find the bit of memory that flips the switch to unlock all abilities...etc

sinful tree
#

If you allow players to upload their "saved data" to represent their character in multiplayer, then that saved data could've been cheated.

graceful flame
#

Save Data in unreal engine is also not secure. There's websites where anyone can simply upload their save file and it allows them to edit the values and re-save it.

young kestrel
#

Even AAA games struggle with that.
Cheating in NfS is as easy as in manipulating some numbers in your memory.

And that's a multiplayer game with the ability to play locally.

GTA online has the exact same issue.

sand holly
#

Scrap the idea of transferring data between offline and online

sinful tree
#

Then you're having to save player data yourself which will cost you $$$ for database storage/usage.

graceful flame
#

So even if you were to use an external database server that you have full control over to manage the player's access to unlockables. That STILL isn't secure if its a single player game because the functions that reach out and make a request to the server can still be triggered manually by altering the memory.

Therefore the only secure way is to use a dedicated server which reaches out to an external database to manage player's access to unlocked things.

sand holly
#

Jesus...

sinful tree
#

Security is hard if you want to make it secure.

graceful flame
#

I'm currently in the process of setting up a system like this for my game. It all comes down to a few JSON POST requests that are being sent from a dedicated server to the other database server. If those URLs were to leak then anyone could simply boost their high score or whatever just by sending authenticated POST requests.

sinful tree
#

I could throw a masterlock on my shed, and most people wouldn't care to go in, but someone with knowhow will know that lock will fail within 3 seconds if they could get to it.

young kestrel
sand holly
#

Why must people hack 😭😭😭

sinful tree
#

Exactly.

dark edge
graceful flame
#

It takes that dude like 5 seconds to unlock that LOL

sand holly
#

I think I'm gonna have to rethink my whole concept a little bit now that I've gathered this information

sinful tree
#

I decided to get a lockpick set myself to play with because of LPL.

graceful flame
#

Imagine a horde of enemy viking ships appearing on the horizon as the town's people start screaming and running around franticly.

sand holly
#

Wait what about easy anticheat

#

🤔

sinful tree
#

Same problem. Something executing on your computer, you have control of. Nothing stopping you from cheating the anti-cheat system.

graceful flame
#

My (limited) understanding of something like easy anti-cheat is that you can pick an anti-cheat partner to work with and they perform a security audit of your game. You probably also pay some sort of license fee and then they make it so your game works with their exe which runs on your player's hardware to detect cheat processes.

sand holly
#

Okay so scrap that idea 😂

sinful tree
#

And that still doesn't protect your databases etc.... If you have something exposed on the internet, people don't need to even run your game to access it and send commands to it.

graceful flame
#

There's also tons of things you can do with the design and development of your game to reduce cheating. For example Valorant came up with a custom "fog of war" system with their game. Essentially they hide all non relevant player characters (even when behind walls) and only reveal them at the very last moment. This helps reduce the effectiveness of wallhacking because you can't see an enemy behind a wall until they are just about to step out into line of sight.

young kestrel
#

Technically you could do some kernel level of anti cheat... But... kekw

sand holly
#

I think I'm gonna have to go full online or seperate the two gamemodes

fathom aspen
young kestrel
graceful flame
#

My game is also a mixture of single and multiplayer. For the single player part its entirely PVE and there are some unlockable perks that aren't all that difficult to obtain in the first place. The unlockable custom events make a request to the external database which reads and validates the request. Sure it can be hacked but I don't really care because the unlocked item isn't all that amazing.

The unlockables on the multiplayer side of things are far more important for gameplay.

left dagger
#

is there anyone that could help me with logging network related logs, im using steam and using listen servers and keep running into weird random disconnecting client and host side and cant seem to find a way to log what is happening

sand holly
#

External database

graceful flame
#

yea

sand holly
#

:(

#

Broke

graceful flame
#

Well you could try to host your own but a cloud solution is much better.

young kestrel
#

Yeah. Cloud solutions are actually pretty decent.

graceful flame
#

Cloud database is cheap though.

sinful tree
#

And in some instances, some companies have "free tier" access for development purposes that has certain limits on storage and access rates.

graceful flame
#

But be warned they can be very VERY expensive if you screw things up. They scale automatically and there's no hardware to manage.

sand holly
#

I think I'm just gonna give up on the idea of transferring data between modes

sinful tree
#

Yeah AWS charged me $5 for some bloody error logging on a free database -_-

graceful flame
#

An example of doing something wrong to result in a huge cloud bill would be like writing some buggy code that does an endless loop of making some change on database table or something like that.

#

I have a few Firebase apps that I'm hosting for basically free. The highest I've seen my bill is like $0.03

sinful tree
#

Event Tick -> Write to database (All Player Data)

graceful flame
#

Normally uploading images over and over again isn't all that big of a deal, but it IS a big deal when you're running a website that is hosted in multiple datacenters across multiple regions.

sinful tree
#

omg that's horrible XD

eternal canyon
graceful flame
#

Oh? Do you happen to know which folder or file?

#

or perhaps a keyword I can search for?

static flare
#

I'm struggling with making clients possess a server-owned pawn. I was thinking I could just call a Server-RPC on the pawn, but since the calling client doesn't own it - the call is just dropped.
I understand this is by design.
I assume I have to tell the server to give "me" ownership over this pawn before possessing it (or have the server make "me" possess it), but how should I do that if I can't call the server through that particular pawn? Am I supposed to route the request through my PlayerController/Pawn? Like make a generic AMyPlayerController::ServerRPC_RequestPawn(APawn* Pawn) or something, which I would call whenever my current pawn interacts with the server-owned pawn, and then pass the server-owned pawn?

left dagger
#

it just needs to be something that is owned by the client that way in can call rpcs

eternal canyon
#

There’s a should replicate function if I remember correctly

#

Where they implement a version of it

#

Tho it’s not perfect

graceful flame
#

I'm compiling already right now but I'll have a look for that code in shooter game. Thanks @eternal canyon

static flare
#

Is there a fancy way of getting the PlayerController of the client that is calling a ServerRPC, or would I have to pass it in the RPC?

#

Holup.. I'm using my frontend-brain again..
If I call a ServerRPC on my PlayerController, then the exectution will be on the server - but it will still be on MY PlayerController.. right?

iron crest
#

Hello, I have no clue if this is a ue bug or replication bug but whenever I try to equip (Capes) And (Masks) It Cancels either or out, here is the code

#

Im On ue5

sinful tree
iron crest
sinful tree
#

Much cleaner, less nodes to deal with. Easy to add more options.

iron crest
left dagger
fathom aspen
# sinful tree

I didn't follow-up, but this won't run for non relevant clients. Are you aware of that @iron crest ?

sinful tree
#

True 😛

left dagger
#

if you want skeletal mesh updates to replicate youll need a setup that sets the skeletal mesh remote as well as calls it on the client, not just calling it on all

quasi tide
#

You need OnRep

#

OnRep for state changes - IE, changing the mesh of something.
RPC for one-off events - IE, an explosion effect

fathom aspen
iron crest
static flare
#

Is it always illegal to call Possess from client? Even if my PlayerController owns the pawn?

sinful tree
fathom aspen
#

Only runs on the network authority (where HasAuthority() returns true).

sinful tree
#

There is a setting "bCanPossessWithoutAuthority" in the code.

fathom aspen
#

Hmm that's new to me.

sinful tree
#

Either way, I think it's probably a bad idea to possess a pawn locally only in a multiplayer game.

fathom aspen
#

Yeah honestly if it's that way by default I won't change it. Especially that stuff like this is authority

#

Wondering what the special cases to turn that on

static flare
#

I see.. If I have a server-spawned replicated actor and the server called SetOwner(SomePlayerController), what would the "owning" client's authority be? Not Authority, but one of the Proxy-values? (i.e. HasAuthority is false?)

fathom aspen
#

A replicated server spawned actor would have Role_Authority on server

#

On client it's autonomous for you and simulated for others on your machine

#

At least for controllers it's that way

static flare
#

Wait, so the NetRole doesn't change when the actor's Owner is changed? Are they completely unrelated aspects of ownership?

#

oh shit, there's a RemoteRole too. I have to look more into this tomorrow.. 😴

fathom aspen
#

Yeah there is LocalRole and RemoteRole. Not really sure about the details, but yeah LocalRole stays the same

#

Has to write a blog post about it eventually

valid imp
#

I have a hard time finding a definitive answer on the web: what is the best way to send a large amount of data (more than a normal RPC) with Unreal?
Given that TCP sockets are not really supported..

sinful tree
#

You can potentially make the data into chunks and send it through multiple RPCs and reconstruct on the other end.

valid imp
#

The problem with TCP sockets is that Steam multiplayer isn't happy with opening more ports.
Sending data into chunks and reconstructing is probably the best idea, is something built in Unreal for that?
I don't think there is, but I don't see why, it sounds like a common use case.

sinful tree
#

I don't think there's a catch all solution, you'd have to make it yourself. What kind of data is it you're needing to replicate?

woeful ferry
valid imp
# sinful tree I don't think there's a catch all solution, you'd have to make it yourself. Wha...

Something more or less voxel-like. It's not terrain but it's still 3D points with properties each, that I generate on the server around players and I now want to send to clients.
I could just limit the number of amounts of points I send to fit the 65kb limit, or I could compress a bunch of them into a binary, slice the binary, send it into RPCs and retrieve it.
For the binary strategy, I don't see why there couldn't be a catch all solution though. It wouldn't depend on the actual usage of the binary data exchanged.

quasi tide
fathom aspen
finite scaffold
#

I'm just about to start with UE. For doing a MP game, should I learn how to do multiplayer first, or do the base game and then implement mp?

fathom aspen
#

It's not safe to start working with MP right away even if you had UE knowledge, how if you don't have any. I would suggest you know UE first, then try and indulge in MP. This is the MP starter pack: #multiplayer message

graceful flame
# finite scaffold I'm just about to start with UE. For doing a MP game, should I learn how to do m...

If you're a solo dev and your game is going to have a multiplayer experience then there's plenty of other stuff to learn before you start working with multiplayer such as getting comfortable with blueprints, level design, material design, character design, audio design and AI. Only then does it make sense to spend time making things replicate and learning about RPC's and organizing your code into the proper base classes and implementing a server authoritative structure.

If you're working in a team to make your first multiplayer game I'd suggest splitting the work up into programming and design. One person makes things work in both single and multiplayer while the other person makes things and makes sure they look good.

finite scaffold
#

I'm in the planning stage and began to learn the basis. I'm an artist about to become a solo dev by now. So I will follow your advice and learn and get comfortable with ue bases, and then start again to do the mp

graceful flame
dark edge
#

Are you at least having a base set and diffs to it?

limber gyro
#

does any one know the diference between private and public connections in this node?

fathom aspen
#
/** The number of publicly available connections advertised */
int32 NumPublicConnections;

/** The number of connections that are private (invite/password) only */
int32 NumPrivateConnections;
limber gyro
#

thanks

#

another quick question

#

do these options look good ?

#

putting the name of the map first is enough right?

fathom aspen
#

Correct

#

btw it's called MaxPlayers

#
/** Maximum number of players allowed by this server. */
UPROPERTY(globalconfig)
int32 MaxPlayers;
#

That gets auto assigned

#

In case that what PlayersPerMatch meant

limber gyro
frosty trail
#

Are there any ways to check what is/isn't being replicated in the editor?

#

Getting a bunch of LogProperty: Error: Replicated TMaps are not supported. logs, but I'm 95% confident I'm not replicating any TMaps.

fossil spoke
#

Its likely that you are.

frosty trail
#

Yea, but not that I can find

#

😛

#

Even after going through everything in the reference tree, no TMaps that I'm setting to replicate

fossil spoke
#

Find where that error is in code and set a breakpoint?

sinful tree
#

Perhaps you're replicating a structure that has a TMap in it?

woeful ferry
#

So dont worry lol

humble edge
#

My dedicated server stuck at Bringing up level for play and doesnt show Engine Initialization. Help!!! anyone who can help me.

uncut schooner
#

How do I do WLAN mobile multiplayer

thin stratus
#

By connecting via IP to the local IP of the Phones?

celest pulsar
# uncut schooner How do I do WLAN mobile multiplayer

On Iphone, i got some net work error. Unreal@4.27.2, OnlineSubsystemNull. But it's success to create and join online session.

[UE4] [2022.08.09-06.40.57:252][191]LogNet: UIpConnection::HandleSocketSendResult: Socket->SendTo failed with error 37 (SE_EHOSTUNREACH). [UNetConnection] RemoteAddr: [fe80::33:511e:d503:e311]:7777, Name: IpConnection_2147479383, Driver: PendingNetDriver IpNetDriver_2147479384, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID Connection beginning close timeout (Timeout = 0).

sage lodge
#

Does someone know why the Set Collision Enabled isnt working?
I disabled it and now after a delay I am trying to enable it again, but it doesnt work
At the beginning of this code I added 2 custom events on running on multicast the 2nd on run on server
Everything is working (replicated too), only the collision isnt working

glacial ermine
#

Hi everyone, are there any open source examples of a dummy multiplayer game? Nothing more complex than just allowing a few players to join a server and run around one of the template maps.

#

Which I could just download and use that is

winged badger
#

shooter game example should work

#

quite a few games started as a shooter game, then evolved

fathom aspen
#

Or Lyra BabyRage

winged badger
#

i heard only weird/bad stuff about lyra

#

people messaging me "look what they did here weird"

fathom aspen
fathom aspen
fathom aspen
winged badger
#

one was matching some manually assembled strings with class names to pick which class of debug controller should you use

#

that was very awkward

fathom aspen
#

Hell nah

#

Seems like they made it in hurry

#

Also the data driven approach overcomplicates stuff

winged badger
#

ah i know about that one

#

should bring fond memories for @chrome bay 😄

fathom aspen
#

Haha James should have went crazy over it

winged badger
#

HLL had that iirc

fathom aspen
#

Yeah it's mentioned in the post

winged badger
#

so did SCUM

fathom aspen
#

Wow, it really shows that games were built upon it lol

chrome bay
#

Yeah, found that pretty early on 😄

#

Tbh that's just the tip of the iceberg when it comes to working shootergame hacks

#

Lyra isn't any better

#

Took about 2 seconds to make a weapon speedhack

fathom aspen
#

It's crazy how easy it's to miss these stuff at development

#

Was you the one who fixed it?

chrome bay
#

tbf I don't think they were really thinking about making things cheat proof when building the samples

#

Yeah though I "fixed" it because we essentially did our own ballistics system that required getting rid of all that anyway

fathom aspen
#

Oh yeah it was all ditched then

azure beacon
#

Hi folks, I'm having an issue with client actors and movement. Hopefully this is something really simple that I have overlooked.

I have a multiplayer game based on the top-down game example. The game starts and spawns two actors - one for client and one for server. Both of these actors function correctly, as you would expect.

However, when respawning the client's actor (Actor instance is deleted, and then a new one is spawned using the same blueprint), that actor is unable to move correctly and the error message "Movement not allowed" is printed to the console.

When it is respawned, it is assigned a player controller in the same way as when we created the initial client actor, so I'm really not sure why it's failing. Could anyone shed any light on this?

static flare
#

I need an action triggered (client-side) on a newly possessed pawn, so I was hoping I could find and override something like APawn::OnPossessedBy(APlayerController), but it seems no such thing exist.
I can only find the other way around: APlayerController::OnPossess(APawn). Do I have to override this in the PlayerController and specifically check if it's a certain pawn class, then call the pawn-function from there?

Or are there other ways of being notified inside the Pawn when it's being possessed? I can see that PawnClientRestart should do something similar, but "restart" isn't that well documented so I don't really know what it means..
I don't want to clutter my PlayerController-class if I can avoid it.

unborn light
#

Hello everyone, I have a problem, I dynamically load static mesh from an external server, then load it through the path and add it to the inventory/building system. Locally, everything works fine, however, in multiplayer, other users do not see this static mesh. How can I replicate this static mesh?

thorn wraith
#

Hello all,

I am researching in creating a MMO using Unreal. I know that this is a huge undertaking but I might make something really simple. I am using this project as a guide for learning so that I can touch many aspects of Unreal and learn as needed. Like I said, it is going to be a pretty "simple" MMO for my learning purposes.

Currently, I have some very basic movement for a main character and I am currently looking at implementing an inventory system and also utilizing the GAS for my abilities. But before I get too thick into the gameplay side of things, I want to make sure that I build this with the view of MMO correctly so that I do not have to go back and spend hours redoing things.

My first set of questions are pretty basic.

  1. I was reading that for MMO, it is best to run the entire game on a headless server. Does this apply to Unreal?
    1b) I know that Unreal runs the client-server model where a server hosts the game. When creating an MMO, do I make the game as if it is a single player game where the project implements everything and later it turns into the headless server to monitor the states? Or is there more special implementations that I need to consider?
    1c) As a follow up. I am working on an inventory management system. For now, do I setup it up "normally" in my project for now? Or are there any special considerations that I need to think about when moving over to the headless server?
  2. I am reading about networking from the Unreal documentation. For the MMO, can I consider it as one big multiplayer game or are there additional considerations that I need to take into account that are not mentioned in the documentation?
  3. Can anyone recommend some good resources for me look into implementing MMO with Unreal?
fathom aspen
unborn light
fathom aspen
#

Why are you setting it to replicate at runtime? And anyways this won't work when you SetStaticMesh, unless you do it using an OnRep

unborn light
fathom aspen
#

Does the spawned actor replicate?

#

ItemBuilding

unborn light
fathom aspen
#

So the actor is replicating though you can't expect the set skeletal mesh to replicate too, because that is done locally

#

Even if you replicate the component it won't work

#

So my point still stands you need to set it when the actor replicates for example.

#

OnRep_ActorHasReplicated->SetStaticMesh

unborn light
#

default staticmesh builds perfectly, but which is loaded does not appear

#

if I try to output the class name, it outputs an empty string

unborn light
unborn light
#

this didn't help too

fathom aspen
unborn light
#

I think the problem is that there is no static mesh class on the server that was loaded on the client, so it can't deliver anything

fathom aspen
#

The thing is that BuildingSimMesh you are passing should be replicating too, by the time you set, which if not attached to the actor spawned there you can't guarantee they replicated at the same time

unborn light
radiant nebula
#

I've got this problem where the host of the game shoots straight out from the camera to the forward vector but the player who joins the game shoots down even though they are looking flat (the angle of the gun is where their camera is looking). I'm not to sure what's going on, please help if anyone knows.

glacial ermine
unborn light
#

when i use local static mesh all works fine, but with downloaded one - unknown type

final turtle
#

Hi 🙂 I'm looking for a function which is called on the dedicated server when a client leaves the server (on graceful disconnect, client crash, network connection crash...). The main Problem is that I need to have access to the Pawn (which seems to be already destroyed in AGameMode::Logout). Is there any overridable (C++) function that satisfies these requirements?

winged badger
#
void APlayerController::Destroyed()
{
    if (GetPawn() != NULL)
    {
        // Handle players leaving the game
        if (Player == NULL && GetLocalRole() == ROLE_Authority)
        {
            PawnLeavingGame();
        }
        else
        {
            UnPossess();
        }
    }

    if (GetSpectatorPawn() != NULL)
    {
        DestroySpectatorPawn();
    }
    if ( MyHUD != NULL )
    {
        MyHUD->Destroy();
        MyHUD = NULL;
    }

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

    // Tells the game info to forcibly remove this player's CanUnpause delegates from its list of Pausers.
    // Prevents the game from being stuck in a paused state when a PC that paused the game is destroyed before the game is unpaused.
    AGameModeBase* const GameMode = GetWorld()->GetAuthGameMode();
    if (GameMode)
    {
        GameMode->ForceClearUnpauseDelegates(this);
    }

    PlayerInput = NULL;
    CheatManager = NULL;

    Super::Destroyed();
}```
#

@final turtle

#

the PawnLeavingGame is what destroys the Pawn too

final turtle
#

@winged badger Thanks! I gave it a try and the PawnLeavingGame function sems to work perfectly for my usecase!

thorn wraith
#

Hello all,

I am researching in creating a MMO using Unreal. I know that this is a huge undertaking but I might make something really simple. I am using this project as a guide for learning so that I can touch many aspects of Unreal and learn as needed. Like I said, it is going to be a pretty "simple" MMO for my learning purposes.

Currently, I have some very basic movement for a main character and I am currently looking at implementing an inventory system and also utilizing the GAS for my abilities. But before I get too thick into the gameplay side of things, I want to make sure that I build this with the view of MMO correctly so that I do not have to go back and spend hours redoing things.

My first set of questions are pretty basic.

  1. I was reading that for MMO, it is best to run the entire game on a headless server. Does this apply to Unreal?
    1b) I know that Unreal runs the client-server model where a server hosts the game. When creating an MMO, do I make the game as if it is a single player game where the project implements everything and later it turns into the headless server to monitor the states? Or is there more special implementations that I need to consider?
    1c) As a follow up. I am working on an inventory management system. For now, do I setup it up "normally" in my project for now? Or are there any special considerations that I need to think about when moving over to the headless server?
  2. I am reading about networking from the Unreal documentation. For the MMO, can I consider it as one big multiplayer game or are there additional considerations that I need to take into account that are not mentioned in the documentation?
  3. Can anyone recommend some good resources for me look into implementing MMO with Unreal?
worn wagon
#

Would it be acceptable to replicate things using the InitialOnly condition, so that players who join "late" get the current state of everything, then past that variables are kept in sync using only RPCs? I'm trying to think if there are scenarios in which they would not be synced correctly, such as when an actor is no longer relevant. Do the multicast RPCs still get triggered if the actor is not relevant?

#

The reason I need to do this is because I have 2 properties that work in tandem that must be replicated, but there is no way of knowing which is replicated first. I need to run functionality only when both have been replicated, but there is also no way for me to logically pair them up.

#

Everything would be so much cleaner just using RPCs, but I want to know I'm not shooting myself in the foot here somewhere down the line.

fathom aspen
#

Struct don't replicate atomically though by default

#

You will have to make them so

#

Stateful = replication
transient = RPCs

#

No way around that

worn wagon
static sable
#

hi, isn't replicating (repnotify) USTRUCT with multiple properties from server to client just a bad practice? I mean shouldn't RPC be used instead when more than one property needs to be replicated?

worn wagon
fathom aspen
#

You would have to implement NetSerialize in there

worn wagon
#

The 2 properties I need replicated are an array of uobjects (weapons) and an enum (the active weapon slot)

worn wagon
worn wagon
fathom aspen
#

Nothing bad about that. What's bad is using RPCs

worn wagon
#

When a player swaps weapon the change needs to show immediately

#

Ofc I can do both but still

fathom aspen
#

Do it locally then, still replicate it

worn wagon
#

Oh I meant for showing other players weapons, I do that stuff locally already for the local player

fathom aspen
#

You would have to wait to replication to occur I guess

#

Even if you multicast that, the change isn't going to be faster

static sable
#

so in NetSerialize you'd be able to tell when to send them over to the client? only if both weapons and the active weapon slot have been updated... how do you manage to tell if they both have been updated?

#

..before sending them over

worn wagon
#

If I'm creating a replicated actor and then storing a pointer to it in an array which is set to replicate, how am I guaranteeing that the actor is replicated before the array of pointers. Isn't it possible the pointers are just null on the client? I haven't had any issues but I realised I'm not entirely sure what's happening under the hood.

static sable
#

like simple example, I have this:

struct {
  int x;
  int y;
} struct_s;

how can I tell that both x and y have been updated and only then send that struct to the client. Won't they come as 2 separate updates likes this:

// this is repnotify
struct_s s;
s.x = 1;
// sending over to the client
s.y = 2;
// sending over to the client
chrome bay
#

NetSerialize() just means both properties will always be sent and received together. Still no garauntee however that a reference to another actor is valid when you receive it

chrome bay
static sable
#

then I have to redo my multicasts 😄

chrome bay
#

State = Property, Event = RPC

#

If you don't follow that general rule, you can't expect replication to work properly

worn wagon
chrome bay
#

But the OnRep will be called again when the actor pointed to becomes valid

worn wagon
chrome bay
#

No, you still use properties and OnRep callbacks - but you cleanly handle it when the property is null

worn wagon
chrome bay
#

OnReps will be called again when the object/actor pointed to becomes valid

worn wagon
#

That seems really important to know damn

unborn light
chrome bay
worn wagon
chrome bay
unborn light
grave notch
# thorn wraith Hello all, I am researching in creating a MMO using Unreal. I know that this is...
  1. Dedicated server in unreal is headless, yes
    1b. You have to make game as multiplayer from the beginning, im not sure what you mean by "turn into the headless server". You need to understand what server and client are and how to work with them, what server responsible for and how it communicates with clients etc.
    1c. 1b already answers it
  2. Its more than just multiplayer, but you can think about it as big multiplayer game for now, and then implement additional logic for MMO specifically, like saving state of the world.
  3. No idea
unborn light
#

than i want to place it, but can't

worn wagon
# chrome bay Not sure exactly what you mean there

I have 2 properties that get replicated, and I need to execute functionality only when both have been replicated. An RPC would make it easy but then there's state issues, so I need to "pair them up" somehow. WizardCell told me I should put them both in a struct and replicate that with NetSerialize.

chrome bay
#

It's up to you really, if it makes sense to put the properties together then having them in a struct seems sensible. NetSerialize() may not help a great deal

unborn light
#

i need some way to replicate static mesh that dynamically loaded on client

worn wagon
chrome bay
#

You could pair them yeah. NetSerialize at least ensures the struct cannot be in a state client-side that it was never in server-side

#

(besides null pointers obviously)

thorn wraith
# grave notch 1. Dedicated server in unreal is headless, yes 1b. You have to make game as mult...

Thank you for taking your time in answering my questions!

Yes, I figured that I need to make it as multiplayer from the beginning.

I am reading up on the UE documentation on multiplayer because like I said I want to start implementing some of these before I get too far and having to redo the entire structure.

So far, this is what I am reading through:

https://docs.unrealengine.com/5.0/en-US/networking-and-multiplayer-in-unreal-engine/

But I think that the perspective is from a fps multiplayer game. Which is fine because I believe mmo and fps will use similiar systems. And then later I can add in more specific systems for the MMO.

Setting up networked games for multiplayer.

unborn light
#

Jambax, mb you can help me something, i need some way to replicate static mesh that dynamically loaded on client

chrome bay
#

Dynamically loaded? What do you mean?

#

Also replication is Server->Client, not the other way around

quasi tide
unborn light
grave notch
#

thats true, its better to start with single player, then multiplayer and then MMO

chrome bay
unborn light
chrome bay
#

You can't replicate that. If the file is stored on some other server, just tell other clients what the file is and have them retrieve and build it themselves

unborn light
chrome bay
#

Not with gameplay replication logic no, apart from anything it'd be way too much data for a reasonable mesh

thorn wraith
# quasi tide Please, do not jump straight into doing an MMO when you don't know multiplayer. ...

I understand the risks and the sheer complexity of doing everything. I am using this as a sandbox to learn different components. That is the best for me to understand what is going on.

Thankfully, there is a portion that I do not have to do which is asset and animation creation. All those I already have. Just need to focus on the gameplay part.

I am taking my time with this and am understand this will take time.... Alot of time. I am sure that I will be picking up other projects along the way. But this is like an itch that needs scratched every once in awhile

unborn light
twilit anvil
#

if there is quite big codebase written for a singleplayer game, how hard is to convert it into multiplayer?

quasi tide
#

Quite difficult.

#

Multiplayer introduces whole different approaches to the same problem in SP.

#

It's not a simple switch flip or "oh, I'll just throw some RPCs in here"

#

Not saying it can't be done mind you.

graceful flame
# chrome bay State = Property, Event = RPC

With that golden rule in mind, does it make any difference if a multicast has some nodes to execute directly on its chain, VS a multicast that only calls a single custom event which has the same nodes to execute.

Server-->Multicast-->Do this, do that, do some more of this, and finally that.
vs
Server-->Multicast-->Do this custom event
This custom event: Do this, do that, do some more of this, and finally that.

quasi tide
#

Not really. You're still executing the same stuff.

#

Unless you're talking about using RPCs for stateful replication.

twilit anvil
#

thanks, I thought so but, haven't done anything like that for such a scale and wanted some input @quasi tide

worn wagon
graceful flame
#

Okay that confirms my thinking, but I wasn't 100% sure.

sage lodge
#

Does someone know how to fix it, this is a disappearing platform which comes back after a delay, but when it comes back the collision is weird, if you try to jump on it the character glitches and falls through it (custom event 1 is multicast custom event 2 is run on server)

worn wagon
graceful flame
#

So if a multicast has input parameters, floats, int, bools ... etc those are also sent over the network, right? It's a good idea to keep input parameters for server and multicast events to a minimum whenever possible. Right?

quasi tide
#

Send the information you need.

#

Just do your safety checks on the server.

sage lodge
#

What does that mean?

#

Would should I change

graceful flame
# sage lodge Would should I change

1 and 2 should be in reverse order. Overlap --> has auth --> cast --> (isValid?) --> server event

Server event --> multicast event
Multicast event --> timeline --> change material param --> set scale ...

Why is your platform collision screwed up? Because you're changing the scale of the mesh on the server only but not for all clients so it looks larger than it actually is.

pallid mesa
#

but we are years beyond a secure Lyra

#

unless it somehow becomes a priority

sage lodge
graceful flame
#

You're also reversing a different timeline

#

Perhaps you intended to reverse the existing one?

umbral horizon
#

Hi, there are some phases where I want the pawn to follow server movements. I can't use AddMovementInput from server. How should I go about adding movement from server? Any help is appreciated. Thanks

sage lodge
#

and the collision is attached to the mesh

#

hmm

#

what if I separate them

eternal canyon
#

btw

#

this is what the function is called

dark edge
#

Why is everyone multicasting and not using repnotify for stateful stuff

#

stop multicasting so much lmao

fathom aspen
#

That's prolly the most repeated mistake here ^^

quasi tide
#

Multicast for life baby!

graceful flame
#

Not enough multicast!

sage lodge
#

What now xD

grand mica
#

Hey,
In my game when I run as client and run the game under one process the bots in the game seem to be moving but when I run it under multiple processes the bots don't move at all but their tasks get updated. Looks like something is not replicated. I have replicated the task enum, and turned breplicates to true but I am trying to figure what is not making it to move

sage lodge
#

I am still stuck on that collision stuff

#

Suffering … pain …

grand mica
graceful flame
# sage lodge I am still stuck on that collision stuff

Have you tried stepping through the code with breakpoints? F9 on a node to add a stop sign, then Play your game and it will pause automatically (when the node with the F9 stop sign is executed) , then press F10 to proceed to the next node and F11 to enter a node. If it doesn't pause on anything then you know your breakpoint didn't even run.

#

You can also hover your mouse over the pins to see the current data in a popup

sage lodge
#

So if I F9 the set collision and it doesn’t stop then the node isn’t activated

graceful flame
#

ah-ha! so now what you can do is move the F9 stop a bit further back and watch as the red pulsing lines show the flow of logic and pinpoint why it stops

misty stirrup
#

any good network plugins that push the limits of players higher?

graceful flame
sage lodge
#

but I will try it

misty stirrup
graceful flame
#

like what sort of issues? do they only happen with a full 100 player server?

misty stirrup
#

performance issues on the server side

#

trying to find like a distributed server system, i only found one so far that's suppose to be releasing a plugin

#

the other one, the main dev got scalped by star citizen lol

graceful flame
#

yea i dunno, that's something i haven't done before

#

Question: Is there anything to be aware of with save game files for misc player settings in a multiplayer game? It seems that testing saving and loading with multiple clients using PIE is pointless because they all read from the same file.

Should I be using the User Index int slot? Is that just for splitscreen or something?

celest bough
#

I am trying to get a message to display when a player joins a game, but the username being shown is always the hosts name. Is anyone able to look at my code and possibly tell me what im doing wrong? Thanks ❤️

umbral horizon
#

I can't use AddMovementInput from server. How should I go about adding movement from server? Any help is appreciated. Thanks

sinful tree
celest bough
#

I was looking at the pic just now and spotted that and started to wonder if that could be the issue. My reasoning behind that is because i assumed get player controller 0 returned the server pc since its being called in the game mode

#

thanks

#

and i didnt think it mattered if the server or the client called that event since its a server event anyway

sinful tree
#

Actually the more I'm looking at it, the more I'm getting confused XD
You are right, it shouldn't specifically matter in this case.
The issue is likely contained within these functions. Check what the UniqueNetID is (possibly print it out?) and see if everyone has the same Unique Net ID, or check the GetPlayerNickname function.

celest bough
#

i may actually try just including those 2 functions in the PC only and take them out of the initial GM step

winged badger
#

it holds the replicated PlayerName, and replicates itself

celest bough
#

do i need to set the player name in the player state?

winged badger
#

so as long as your server is immediately aware of Player's Name (and it doesn't need to be sent to the server when the game starts)

#

solution is as simple as PlayerState BeginPlay sends a message to whoever local player is

celest bough
#

im not sure i understand atm so il take a little peek at a player state. never actually used one before

winged badger
#

if you're using something like steam

#

you can pull the steam data from the net ID

#

and just send a message using their steam name

#

its an actor that belongs to a PlayerController, unlike PC its replicated to everyone

#

and there is an array in GameState called PlayerArray that holds all of them

celest bough
#

so instead of trying to do it from the game instance, i would instead call the "server - Issue liveplay event" from the playerstate using the local pc

winged badger
#

now, being replicated to everyone, as long as PlayerState has the data about PlayerName on server's instance right away (so you either joined from lobby, send a name in login url or are using something like Steam)

#

all PlayerStates on every machine will have the correct PlayerName at the moment they call beginPlay on that machine

celest bough
#

yeah im using steam

winged badger
#

which makes your life much simpler

celest bough
#

so from the post login event i can set the player state name using the incoming pc reference?

sage lodge
#

@graceful flame I tried the F9 on the Set Collision Enabled (Collision Enabled Query and Physics) and it stopped

winged badger
#

it might set the steam name correctly

#

on its own in the engine

#

i don't remember that bit

#

engine code for autoassigning players (nick)name is all ways weird and convoluted

#

but

sage lodge
#

@graceful flame the problem is the timeline ... the one behind collision enabled