#multiplayer

1 messages ยท Page 643 of 1

thin stratus
#

I think the UWorld or so checks on that

#

I'm half sure the LocalPlayer pushes the name

leaden atlas
#

ahhh okay that makes more sense, it didnt hit ClientTravel on join

#

i'll look at localplayer

hollow flicker
#

The logic in the character currently goes like this: [Key] -> calls Event in the Actor BP. In the Actor BP itself, it just does the usual logic after the event got called. Is that how you meant it or do I maybe misunderstand something?

thin stratus
#
FString ULocalPlayer::GetNickname() const
{
    UWorld* World = GetWorld();
    if (World != NULL)
    {
        // Try to get platform identity first
        FString PlatformNickname;
        if (UOnlineEngineInterface::Get()->GetPlayerPlatformNickname(World, ControllerId, PlatformNickname))
        {
            return PlatformNickname;
        }

        auto UniqueId = GetPreferredUniqueNetId();
        if (UniqueId.IsValid())
        {
            return UOnlineEngineInterface::Get()->GetPlayerNickname(World, *UniqueId);
        }
    }

    return TEXT("");
}
#

I assume this will further down the line give you the PC Name

#

SubsystemNULL probably does that

#

That's prrroooobably where the Nickname is then used to send it along

#

GetNickname is virtual

leaden atlas
#

yes! this is it

#

thank you!

thin stratus
#

So your best bet is to override that

#

Make your own LocalPlayer class

#

You can assign that in your ProjectSettings

#

I would do something like testing if NullSubsystem, then return some random generated name. Otherwise do the parent implementation

leaden atlas
#

Thank you so much!

thin stratus
#

I do have to note that I suggested that right at the start haha, maybe too vague

leaden atlas
#

Alright crap i've got another question, how can I tell if the current subsystem is null subsystem?

#

i assume i can probably just get the subsytem and cast it but it seems like i can also just pass in a FName and see if it exists

#

oh here we go

#

IOnlineSubsystem::Get(NULL_SUBSYSTEM)

stone dust
#

Hello guys, I'm really lost on this problem trying to solve it for a while now, I have 1 client, 1 server players, both of them have their health displayed on the screen, when I created a pain volume to test if the replication works for health, it worked, but when the health reaches 0 it executes this code player->handledestruction() my problem is this code only works on the server

#

it does not work on the client for some reason

#
void AGrudgeDotssCharacter::HandleDestruction()
{
    if (bDied == true)
    {
        UE_LOG(LogTemp, Warning, TEXT("You are dead!"));
        Destroy();
    }
}```
heres whats inside handle destruction
cyan drift
#

No, I'm not using

dim barn
stone dust
#

Well that makes sense

#

How can I destroy it from the server?

dim barn
# stone dust How can I destroy it from the server?

If you want to destroy it when health is 0, then only check health on server side and then call destroy. And to check that you could use Actor::HasAuthority(). Or you can use Actor::IsNetMode(ENetMode).

stone dust
#

it still only works for the server

dim barn
stone dust
#

My problem Is I need to set up my code to identify who is the client and who is the server, so all these problems won't appear right?

dim barn
#

The check looks correct with the HasAuthority(). So it should already only be executing on server.

stone dust
#

so ```cpp
if (!AGrudgeDotssCharacter::HasAuthority())

#

?

#

I just started networking with unreal today, so don't mind my stupidity ๐Ÿ˜†

dim barn
#

If you do it like that, then it will execute on client. Which is not correct in this case. Leave it as it was before. And no worries, networking takes some time to grasp especially at the start. It's a different way of thinking than singleplayer.

#

I'm not clear what is not working for you at this point? if (HasAuthority()) should do the trick. The actor's not getting destroyed?

stone dust
#

Its. only for the server side

dim barn
#

Is the actor set to replicate?

spark owl
#

How do I tell a dedicated server to open a new level with blueprints?

stone dust
#

one sec

spark owl
#

I tried using the open level node but it seems to not work

dim barn
stone dust
#

I guess yes, but on the source code(cpp) theres no mention of replication

spark owl
spark owl
dim barn
dim barn
stone dust
#

So what exactly is the problem? I even deleted the bdied and still the same

#

handle destruction is getting called from the gamemode

#

Is it a matter of concern? I think yes?

dim barn
#

But no, it should still work from there.

stone dust
#
void AGrudgeDotssGameMode::ActorDied(AActor* DeadActor)
{
    if (DeadActor == PlayerOne)
    {
        PlayerOne->SetDiedTrue();
        PlayerOne->HandleDestruction();
        HandleGameEnd(false);
    }

}
#

hmmm if everything is normal then why it doesn't destroy the client ;__;

twin juniper
hybrid zodiac
#

Hi everyone, is there a way I can find both dedicated and presence (listen) servers? Currently FindSessions only sees listen server if the SEARCH_PRESENCE flag is set to true, but this then means dedicated servers cannot be seen. Setting both SEARCH_PRESENCE and SEARCH_DEDICATED_ONLY to true means only dedicated servers can be seen

#

I could add an option in the server browser so that the player can choose if they see public (dedicated) or private (listen) sessions, but ideally it would be nice if I could just have all servers visible in one go

brisk bluff
#

is it possible with blueprints to change the server name

winged badger
#

what server name?

#

@hybrid zodiac you could make 2 queries and mesh the results together

brisk bluff
#

Like when you were to get the session name and it gives the hosts PC name, how do I make it not show that but show maybe like a custom server name or a code or something

winged badger
#

should be able to set settion data

hallow mica
#

hi , i'm having looong hard time trying to get simple setup to work with no luck
i'm having a npc character on the map that has string variable on it
and i got a widget on my playable characters made of 3 buttons
to set the value of that text on the npc
THE PROBLEM WHEN I PRESS THE BUTTON TO CHANGE TEXT

  • on the server the value changes for the server and client
  • on client the value changes only on client
winged badger
#

MC only works from server

#

otherwise it only executes locally

hallow mica
#

so how to change a value on the server

winged badger
#

only way client can affect server is via Server RPC

#

and it has to be sent through the client owned actor

#

= PlayerController, PlayerPawn, PlayerState, their components, and any Actors that are owned by those

hallow mica
#

so what i'm getting is
put the variable on the character controller
and put the event on the player controller and make it multicast
then the button onclick event will get owning player controller and call event on it ?

winged badger
#

no

#

clients don't have other clients PCs

#

so replicating variables and MCs works only for owner

#

PC sends a server RPC with string input for the name

#

then sets the variable server side

#

MC is not required as variable is replicated

hallow mica
#

done a little research so what i have to do is
0 - the event should be on a client owned actor say controller
1 - check if i'm on a server or client
2 - a ) if on client call event that is set to "call on server"
2 - b ) if on server the event should MC to all

hallow mica
#

it worked thank you so much
i been struggling with that for about 1/4 a day
the problem was i didn't know what i don't know
had no idea of the "OWNING" and how it works

fossil merlin
#

Has anyone every used the Circle Damage Indicator Component from the market? I'm trying to get it to work with a MP project and I'm not sure how to get it sorted. If not, any thoughts for another alternative?

EDIT: I did get it to work, replicated. If anyone else has the same issue, let me know.

queen notch
#

Hey everyone, I'm having some issues getting my game online through the steam subsystem.

I'm running 4.26.2, my
Ini file is set up with all that jargon, my plug in for the steam subsystem is enabled, my build file has a line of code for the subsystem, and I added a c++ actor.

Why is my game not working with steam?

rough jolt
#

how can I reliably tell the server to do something?

I keep running into really annoying replication problems because sometimes the server's like "No fuk u i wont listen to you" despite events being set to "run in server" or as "replicated"
i am worried this has something to do with authority or owning player but i don't know how to reliably tackle it and it's getting to my nerves

hoary spear
rough jolt
#

well this is my problem

#

I'm pretty darn sure

#

but i still have no idea how to fix it

hoary spear
#

Guess you need to make sure the RPC is made from within an actor that has the right ownership

#

Im not very well versed with this, sorry

rough jolt
#

I am modding a game (with an SDK) I got a tank's commander seat telling the tank itself to open a hatch, and it wont listen, I'm not sure at all how to make sure it has the right ownership

#

am I just supposed to always get the player seating in the commander and make it the owner of the commander?

#

won't that cause issues or conflicts with the game's original code?

#

Also is there any easy way to get the information of which player /actor owns each thing?

#

because that'd probably help not have to fix everything by making whatever thing i'm trying to have change it be the owner

sinful tree
# rough jolt I am modding a game (with an SDK) I got a tank's commander seat telling the tank...

It all starts with how any interaction takes place. Eg. If your player has to "activate" something to open that hatch, then you may want to do the "Run on Server" event from the player's controlled character or their player controller.

No one would be able to tell you anything about the code that you may be using unless they're actually familiar with it.

You can always try calling "Get Owner" on actors to see who owns it.

thin stratus
#

Why trying to mod a game with Multiplayer if you are lacking the basics though

obtuse flame
#

^ is the vehicle spawned by the owner/actor? -or by Server/default on? -maybe try set owner, if no owner exists?

thin stratus
#

Should be better if you first learn the stuff in a smaller, empty, new project, where you have full control over.

rough jolt
thin stratus
#

The problem you are facing is not the devs docs fault

#

You can't execute a ServerRPC in a Server Owned Actor

#

At least not from Client-side

rough jolt
#

I'm using the get owner and printscreen to try and learn more, hopefully that may help?

thin stratus
#

You need to go through a Client owned Actor. Either Character, PlayerState, Controller, a Component on those or by making sure the Actor you use is already owned by the Client.

#

That will only tell you who owns it

rough jolt
#

that's the idea. It could help me learn how i can replicate it, right?

#

since I know what actor i have to have calling the actions

thin stratus
#

Well... it's not really the way to "learn" this :P

#

But yeah, sure

rough jolt
#

I'm doing my best quq

#

Replication confuses me, that's why I asked for help. So far i've been making it work somehow by probably very spaghetti-od code but i feel it always takes me a lot more time than it should

thin stratus
#

Yeah I would not try to learn Multiplayer by modding a game

#

Makes a lot more sense to learn it with your own small project where you can try things with simple and small actors

rough jolt
#

I'm not trying to learn multiplayer by modding a game, I'm modding a game which requires me to learn multiplayer xD

thin stratus
#

Then learn Multiplayer first

rough jolt
#

subtle but important difference

#

fair

thin stratus
#

Make a new Project and place a replicated Door Actor into your Scene.

#

Try to open that with a Client

#

Once you have that solved you know a lot more about how to structure your code

#

Very simple but hard test

digital current
rough jolt
#

I've already replicated multiple things. I know the basics from tutorials and stuff, so idk if a simple door would help

thin stratus
#

I would assume so @digital current

digital current
#

Which ones? 7777 and 27015?

thin stratus
#

Well Ownership is basics @rough jolt And it seems you didn't know about that a few minutes ago :P

thin stratus
rough jolt
#

I highly suspected it was an authority issue, I was more asking about a way to fix it reliably.

#

like- i'm by no means an expert

#

but i've done the equivalent of a door

#

tank doors tho- apparently that's what gets me

thin stratus
#

Well okay

rough jolt
#

(tank door message was a joke)

thin stratus
#

The Tank or Tank Door is most likely not owned by the Client.
So you have to go over a Client owned actor

#

That's all there is.

rough jolt
#

this is what i get when i print the owning actor for the tank commander seat BP

printing the owning actor for the tank itself just retrieves "Client 2: (empty space)" multiple times

I tried to check the output log to see if there was more to it and my SDK seems to have crashed

thin stratus
#

Are there two players in that Tank?

rough jolt
#

Now that you mention it i don't think i had any players in the driver seat. that could be why
I'll test as soon as i restart the SDK

thin stratus
#

The Owner can be the PlayerController of the the Driver

#

Then Client 2 can't print that anyway

#

And the Client 2 also wouldn't own it

#

It makes sense that the driver owns the vehicle

#

So you can't use the Owner here anyway

rough jolt
#

what does this mean tho? does the BP have a different owning actor on each game instance?

thin stratus
#

Not sure what Bob and Vehicle are

#

But the BP_PS is correct I guess

rough jolt
#

BP_PS_PlayerController is the player of course
BP_BobSemple is the tank
VehicleArmoredMedium doesn't sound familiar

#

worst part of this is that i've done this exact same thing with the gunner instead of the commander of a tank and it worked, yet the same code won't work for the commander, despite both gunner and commander seeming to be handled very similarly by the game

thin stratus
#

Is there more than one Actor involved in that Tank?

#

And if so, are they all marked as replicated?

merry steppe
#

Hi, I'm really searching for an answer but just cannot find it. I have a custom struct that I would like to create a custom NetSerialize for. I created the function and also added the templated calls like in the picture below.

However when I call RotationInfo.Serialize inside the FCharacterNetworkMoveData::Serialize the debugger says that it just doesn't fire this function (even though I'm running it networked). What am I doing wrong?

rough jolt
# thin stratus Is there more than one Actor involved in that Tank?

From what I underestand, the chassis is a pawn and then each aditional seat that isn't the driver (commander, gunner, machinegunners) are pawns that are attached to the driver / chassis pawn

And would assume they're all replicated since i'm using modified duplicates of vanilla tank files so if they are not... that'd be odd

#

Can confirm, the tank itself is owned by the player controller

#

Wait, does this mean the code to open the hatch needs to be in the player controller? Cause that feels a bit odd considering it's a completely different player from a different seat opening the hatch

thin stratus
#

Well

#

In theory you would make sure the Player who is controlling the specific part of the Vehicle is owning it.

#

But that can't always be given. E.g. a normal car with 3 passengers might still be owned by the driver.

#

So yes, you have to route the RPCs through the Player first

#

But if the player who wants to RPC is the one owning it, then you don't need that

rough jolt
thin stratus
#

You should really first figure out who the f is owning what part of the vehicle at any given time

rough jolt
#

I tried to use the framework as well as anim blueprints to have both hatches be on the driver and the commander still be able to open the commander hatch and it worked, but as I posted in #animation the driver hatch would close whenever the commander one would open

thin stratus
#

And if the Player who wants to open the hatch is not owning it, then you have to go through an owned actor first

rough jolt
#

I'm sorry if i'm being a little slow, but that going through an owned actor thing- how do I do it? that may be the part i need to know to solve all my replication dilemmas

thin stratus
#

Simply calling RPCs in an Actor that is owned by the Client

#

Character, Controller, PlayerState, or a Component on those

#

I assume the is triggered by a key press

#

So KeyPress -> RPC -> (Now on Server) Get Hatch Actor -> Open

rough jolt
#

Also I just tested and the commander seat when empty is owned by the chassis, when a player is inside it its owned by the player

rough jolt
#

i guess that mayy work?

#

thing is i don't know how to trigger it in the chassis since it's triggered (in vanilla) by an event that happens in the commander seat

thin stratus
#

If you have an Actor on the Vehicle that is owned by that Client, and you have access to it, then yes, that would work

rough jolt
#

RN i have a replicated variable on the commander seat. I'm checking on tick if it's on by casting to it from the chassis. and if it's on, then the hatch opens. I'm gonna test that

#

aaand it's only happening for the commander

#

found out why. the variable isn't replicating at all for the commander for some reason

#

OK i think maybe i got it

#

it worked! :D

#

@thin stratus thanks man, i think you helped me underestand this better :)

sharp furnace
#

What do I have to do differently when hosting a dedicated server compared to p2p with online sub system?

verbal gust
#

does anyone know the correct way to get LogHandshake outputs? I dunno what I am doing wrong but -loghandshake doesnt work for me

thin stratus
#

You mean how to enable it?

#

Usually via config file or console log LogHandshake VeryVerbose

#

VeryVerbose being the level of log you want (and above)

#

Not sure how the config file has to look like again

thin stratus
#

DedicatedServers usually override the GameSessions "RegisterServer" method to do the CreateSession stuff.

gusty slate
#

Hello ๐Ÿ™‚ Is there any way of getting client's viewport size? Without doing any replicated set variable to track it?
I'm trying to implement a crosshair for shooting and it is a bit offset from center of screen

#

And I basically need that world location for tracing

thin stratus
#

GetBaseAimRotation on the Pawn

#

Eh

#

One sec haha

#

That's for rotation, so you can just use the CameraComponent on your Pawn

winged badger
#

but having a crosshair depend on RPCs

#

= bad

#

it will feel like crap

thin stratus
#

I'm also not quite sure what the offset has to do with the firing

#

Is it offset on purpose?

#

If so, do you know the offset? ANd if yes, just add the offset into the location?

winged badger
#

your client targeting ultimately depends on the client

#

so let it handle its own crosshair

thick blade
#

Hi, is there any way to get pass the ICMP blockade? I'm trying to get ping between players (using Victory Plugin to get IP, AdvancedSession for passing IP to client and PingPlugin by DescendentStudios) and I'm getting almost every time "Request timed out".

#

Of course if someone will allow ICMP echo requests it will work, but the trick is to get pass that windows firewall

#

Huh, is there maybe a plugin or something like that to use it through blueprints? It doesn't matter if it's open-source or on the market

twin juniper
#

i have a 3d mesh that moves and is supposed to push player off track if player gets too close to it, the character "shakes" when pushed by the object, how can i optimize this collsion wise , and also do i need to think about that its selected for replication since its a multiplayer game, can i optimize there aswell?

silent valley
thin stratus
#

"Off track" sounds like a racing game

#

And Racing Games should theoretically be Client Authoritive

#

So the Client would tell the Server that they get pushed off the track

#

Pretty sure the Movemenet Component for Vehicles have some Client Auth boolean?

#

I mean, even if we ignore the "Pushed off by block" stuff, controlling a vehicle not client auth sounds problematic

silent valley
#

Don't want to derail, but what about resolving collisions with other players?

gusty slate
#

That is what I meant with offset

#

This is all basically to find where the client is point at to determine the target location for the gun shot

thin stratus
#

Is that a wanted offset?

#

And if so, is that offset everywhere the same?

gusty slate
#

It is the same in screen location

thin stratus
#

Then you should be able to calculate it serverside

#

You can deproject locations from screen to world. So center of the screen + offset and then deproject it

gusty slate
#

I have worked on this a whiiiile ago I just noticed something, shouldn't I just be doing the shooting checks on the server then call the actual bullet line trace on client? ๐Ÿค”

#

Is there any real benefit on doing the line trace on server?

gusty slate
#

which takes me into the origin of this issue

thin stratus
#

Well

#

What I do is fire the weapon locally and on the server, and then via OnRep also on the Simulated Clients

#

But I can use the center of the camera

#

I wouldn't know why someone would want the cross hair to be offcenter

#

Sounds like that would only confuse people

silk abyss
#

Mecha games usually have free crosshair, cause they are like tanks

#

(sorry for my random comment cause I saw the off center cross hair one)

gusty slate
#

@silk abyss Can I have a reference please? It would benefit me seeing how some other games handle topdown/odd third person shooting

fading birch
#

like hosting stuff in the cloud or something else?

silk abyss
#

But I was referring to Mecha game that you sit inside the cockpit and the reticle are hovering where you aim them.

#

(the mech can go/face different direction if developer allows it.

gusty slate
#

Ah ok I see what you mean ๐Ÿ™‚

#

Thanks for the tips ๐Ÿ‘

silk abyss
#

np, if you are looking for custom TPS ones, it shouldn't be too far off from those.

#

I think they usually do the HUD as a "guide" not actually indicating where it would hit

#

ie. say you have a gun that fire and trace to where the reticle aimed, but something obstructed in the middle(ie. side of a building when you peeking out) it would still hit the building instead of there the reticle is.

gusty slate
#

Yes the cursor needs to be used to calculate the end point of the trace and start point should still be muzzle

#

or whatever start point is

silk abyss
#

I remember what I did pretty long time ago I just basically did this(this is before UMG), so I have it setup as follows:

  1. the attached gun component would aim where the center trace is.
  2. I save the traced world location and guns muzzle position/rotation back to pawn every tick
  3. you can setup whatever replication method you want to update the server.
    @gusty slate
#

so this way server doesn't need to know where player is looking at or whatever resolution player is using.

#

server just trace from muzzle to a world location

#

of course this is not ideal for anti-cheat etc if player found out about it. but consider it was back in early days of UE4 and I just do whatever I think is good at the time. there should be more consideration being put into it so that there is a balance from client side hit-scan to totally server authenticated movement/hit trace.(cause if there aren't rotation limit, player can and will rotate at whatever rate they see fit. )

regal sand
#

Why would only one controller accept input when working on a local multiplayer game?

#

I tried a keyboard and a controller, and that worked fine before; two controllers is no dice

silk abyss
#

did you do the in editor listen/client or just tryiung to do split screen?

regal sand
#

Play Standalone, I dont want splitscreen

#

two players on same screen

silk abyss
#

yeah, cool, so it's kinda tricky that way cause by default you will possess one screen while the "controls" follow whatever is the window getting possessed.

regal sand
#

Can I show you how mine works in programmer parlor?

silk abyss
#

you might be able to find this answer hub, cause it was like discussed a couple times before.

#

I forgot the details about this but I remember I can use kbm on the server while my controller on the client

#

but I have never tried 2 controllers as I didn't have additional spare ones.

regal sand
#

I got it to work fine with a keybrd and a gamepad, but it is disappointing since I wanted to have both players using gamepads

silk abyss
#

have you seen this page?

#

you might have to do the play in editor window one I think for the 1 gamepad per window to work proper(instead of standalone windows)

#

so use the "New Editor Window" option when you test.

regal sand
#

Tried it, did not work

#

I think something is wrong with my blueprint code

silk abyss
#

could be

#

maybe your control is always from player controller 0

regal sand
#

thats what it feels like, because it ignores every controller I have tried for that second slot

silk abyss
#

how do you do your controls from player controller class to possessed pawn?

#

I know a lot of examples do controls directly on the pawn

#

so I am wondering how you do it?

regal sand
#

I have them on events in the player controller. Watching a tuctorial rn, and they say to do it in the character, but that does not seem to be working

#

mainly trying to get any input at all from the p2 controller

silk abyss
#

have you see the input flowchart?

regal sand
#

?

silk abyss
#

specifically this flowchart

#

if an input is "consumed" by one of the input component checks, it goes to game logic part

#

and skipped the rest checks

regal sand
#

Its not going to the logic (Which is just a print string atm)

silk abyss
#

(but you could setup so it's not consumed as well.)

regal sand
#

It works on P1 controller but not P2 controller

silk abyss
#

can you briefly post screenshot of your player controller class where it fires event from your action bindings?

#

(I need to be away for a bit, will come back later. )

regal sand
#

No problem, they all look like this pretty much

hollow eagle
#

You're pretty much on your own for something like that. If you don't want to use unreal's networking... just don't use it.

#

You'll be losing out on anything built into the engine though - no replication, no RPCs, no character movement prediction, etc.

silk abyss
#

so local player controller and server player controller have kinda mirrored relationship? don't know if I say it properly. it's like a locally player contoller sends rpc through the network to server's playercontroller receiver and then server playback the inputs for you on server.

#

on the client, 1 would fail to get anything really, and cast should be failing

regal sand
#

Theres a server player controller?

silk abyss
#

yeah, for listening host, server player have it's own player controller

#

(it's the same class, just that server spawns one for each client connected.)

#

if you play with editor window, you should be able to go to the player controller BP and debug the player controller instance

#

see how the events fired and where the execution goes

regal sand
#

How do you recommend I do the rpc?

silk abyss
#

so if you did have a listening server as setup(so it's players connect to other players) you need to set it up so it knows if it's on server or not

fading birch
#

Using GetLocalRole() can tell you and you can check if you're authority there.

silk abyss
#

mhThis and say during begin play of your player controller, you can save it somewhere(variable, struct, etc) so you don't have to fetch that everytime.

#

so standard way(? or intended) is server authenticate, you send everything to server to execute and do all the game related logic on server.

#

of course the UI eye candies run locally since they just ways to display information

regal sand
#

Does that mean the game is still local multiplayer if you have a listen server?

silk abyss
#

Ohhhhhh.....You want one screen for all players and not split screen.

#

So everyone is on server basically.

#

Then you need to use the Create Player BP node in game mode I believe.

regal sand
#

I have that already made, the create player node. I made a function that prints strings for which player controller is inputting, but it still does not print for player 2

silk abyss
#

Check this one, the question is for split screen but the answer is how you setup those players/controllers etc.

regal sand
#

Looks nice, thanks man

silk abyss
#

You don't have to implement split screen.

regal sand
#

I figured it was not needed since it is just bp code

shy kelp
#

Im having this weird problem where if I use any gamestate other than the default one, half the things such as other characters are no longer replicated, and i litterally cant move the player pawn unless its the server. this issue wasnt present a while ago, and randomly appeared. I even made a new gamestate and the issue is still present. Any fixes?

fossil spoke
#

The GameState and GameMode come in pairs.

GameStateBase | GameModeBase
GameState | GameMode

You cant mix these, you get inconsistent results if you do.

shy kelp
#

im using gamestate

fossil spoke
#

Double check you arent accidentally using GameModeBase with GameState

shy kelp
#

and gamemode

#

im only using gamemode and gamestate

#

just checked

fossil spoke
#

Make sure your editor is in the right network configuration your expecting.

#

Play As Client etc

shy kelp
#

oh yeah i did

#

it works on listen servers

#

but not client

fossil spoke
#

C++ or BP only?

shy kelp
#

BP

fossil spoke
#

Did you accidentally turn off replication for the Characters?

shy kelp
#

no, its a gamestate issue

#

lemme try restarting

#

ue4 is weird

fossil spoke
#

UE4 is doing exactly as its told, you need to make 100% sure you havent adjusted something thats changed it.

shy kelp
#

i think

#

yeah

#

i think i might have done something without realizing

fossil spoke
#

๐Ÿคท

severe tendon
#

As far as I'm aware the Gamemode is Server only right?
Meaning if I multi-cast a teleport to all Players in a foreach loop from it, it should teleport them all to the locations I provide?

severe tendon
#

Yeah, so if the server gets all Players and then casts to them with a Teleport it should teleport them all to where the Server wants them to be right?

#

Because Im having a weird issue where it'll teleport both clients successfully for the Host but the Client will have both users at the place before teleport

shy kelp
#

https://gyazo.com/6a486b020b4313d36da911dba4c1f27a Ok, I'm kind of out of my element here, but How would i synchronize the mass spawning of something in the server and client. This spawning happening here is all happening in the gamestate but somehow the client individually is summoning them, while the server is instantly doing it as its suppose to. Is there a way to fix this, would changing out the code into the GM help?

twin juniper
#

someone knows a good inventory's logic for a large player amount shooter game, i heard about FFastArraySerializer to manage items (since there is only count and owner that is changing.) but there is not so much documentation about it. My actual inventory is an actor component and my item an UObject and item definition, a dataasset. Im not rly glad about my current system cause it uses a TArray to manage my UObjects (items), should i go to use FFastArraySerializer ?

fading birch
#

We use a TArray to manage our inventory in a 100 person game. We haven't noticed any performance issues related to it on full servers.

fading birch
#

the class that holds our inventory? Or the actual item?

#

it's fairly large

twin juniper
#

The actual item

fading birch
#

It's an actor at it's root

twin juniper
#

How many items can hold ur players on them

fading birch
#

as many as we place really. But generally there's 6-7 items each.

#

actually more than that

#

as we have a hidden inventory for other things

#

so more like 15

twin juniper
#

Mmh k, thanks you ๐Ÿ™

fading birch
#

np

#

each pawn is responsible for managing their own inventory. We handle that through RPC calls to not overload the server.

twin juniper
#

I guess FFastArraySerializer should be used when having a large inventory for players, base(houses or smth) that can holds large amount of items ? Like Fortnite STW or survival games like that. ๐Ÿค”

fading birch
#

i'd give that a read

#

there's pros/cons

twin juniper
edgy valve
#

Hi Guys, Are session region/ping locked ? I'm running some tests, i have 2 computers in 2 different networks and they can see each other sessions, but when i host a session ( i'm Living in Ireland ) and my friend from Brazil tries to find a session he is not able to find it

silent valley
#

What kind of session? Steam?

edgy valve
#

yeah, i'm using steam advanced sessions plug in

silent valley
#

I've successfully shared games with Australia, Tokyo and UK, so no there's no inherent region locking.

edgy valve
#

Do you have your APPID or are you using 480 ?

silent valley
#

We have our own

edgy valve
#

do you think that could be a reason ?

#

as there are a lot of users using that appid i thought it might be one of the reasons

silent valley
#

Possibly but I don't know.

#

Maybe a port forwarding issue?

edgy valve
#

i see, but just to know that you were able connect with friends helped me already

silent valley
#

๐Ÿ‘

edgy valve
#

i don't think its port forwarding

#

because i tried with several friends

#

all of them are not able to find the session

#

or all of them have a very strict firewall rules hahaha

silent valley
#

Are you using the Steam P2P network protocol?

edgy valve
#

i might give a bit more attention to this when i get my own appid

#

Yes its p2p

silent valley
edgy valve
#

let me check , i not sure if i enabled that

#

Hmm interesting, i will try to use this and check the results

#

Thanks a million man

edgy valve
#

@silent valley Are you still there mate ?

silent valley
#

hi

edgy valve
#

is there any chance you would help me testing the lobby ?

#

if you are not busy ๐Ÿ˜ฆ

silent valley
#

Sorry I just started work

edgy valve
#

all right no problem ๐Ÿ˜„

silent valley
#

I'm not sure anyone would run a random exe on their machine either if that's what you're going to ask? ๐Ÿ™‚

#

If you can spare a few $ I'd suggest getting a cloud account/VM you can test with

#

there's no alternative - it's impossible to test Steam with two clients on one network in my experience

edgy valve
#

I'm managed to get it working with 2 machines from 2 different networks

#

but still having the same problem with my friends from brazil

#

i was just trying to see maybe with people from other countries would work haha

#

but i understand your point

#

it is not safe at all running an exe provided by a complete stranger ๐Ÿ˜„

silent valley
#

if you have it working for 2 different machines/network that's a great start... I don't know why the friend in Brazil is not working

edgy valve
#

it is funny, they can find other lobbies from people using the 480 appid

#

but they can't find mine haha

silent valley
#

are they definitely using the exact same engine version?

edgy valve
#

yes, i just packaged the project and uploaded myself

#

and gave them the link form google drive

silent valley
#

at this point you're gonna have to grab the logs and starting looking through

#

I guess it could be due to lobby filtering based on ping/location, if you're using 480 there might be a lot and the Steam API will only return the top N results

#

I don't use the Advanced Sessions plugin, but there might be a way to filter based on additional criteria...

edgy valve
#

Yes i will give this lobby some love later hahha

silent valley
#

or stump up ยฃ100 to buy your own AppID ๐Ÿ™‚

edgy valve
#

i'm so tired right now haha

silent valley
#

you've done well, setting up Steam/Online in UE4 is quite a difficult process

edgy valve
#

it was a 12 hours journey today hahaha

#

multiplayer is being very hard for me

#

i have no experience in C++, but i know java

#

it is being hard to learn the different aspects of C++

#

i was trying to use the steam sdk and expose some functions to blueprint, but man... thats wayy to complicated for me

#

so i decided to stick with a simple lobby sistem xD

#

and YET it is giving a hard time to get it working properly ๐Ÿ˜ข

#

Well, i need to get some sleep now, Thanks for helping me out man ! i really appreciate that !

silent valley
#

๐Ÿ‘

hardy valve
#

Does anyone know how i get the Host Ip? need it in a BP actor ๐Ÿค”

thin stratus
#

Hm, I'm half sure you need to ping some service for that as the Host doesn't know its public ip

hardy valve
#

Hmm, well that was a bit inconvenient

potent cradle
#

Is there a way to keep the player state connected to the pawn even though the player disconnected?

#

The playerstate has an AbilitySystemComponent, meaning if player D/Cs but pawn stays in world, it loses access to its attributes

chrome bay
#

Not usually. Player States have a "max inactive time", if a player re-joins within that time they will get a new player state, and a chance to copy properties/data from their old one.

potent cradle
#

Crap, okay :\

#

I'll have to mirror it on the pawn at D/C then or something like that

#

So other pawns in the world can still interact with the disconnected player's pawn

thin stratus
#

Well you can override how the Inactive stuff works though

#

You could override the AddInactive function and do the same, minus the LifeTime setting

#

Or set the lifetime higher than one day, your Server should restart daily anyway

potent cradle
#

Hmm, interesting. That might actually be the cleanest way to do it

#

Override the inactive flow, and maybe even reconnect the old playerstate when the player rejoins?

#

Or am I forced to spawn a new one for the new playercontroller instance? ๐Ÿค”

#

if a player re-joins within that time they will get a new player state, and a chance to copy properties/data from their old one.
If not this might actually already be nice ๐Ÿค”

#

Oh actually, couldn't I just keep the entire playercontroller alive and re-assign that? Player state and all

#

I did actually override PawnLeavingGame to keep the pawn in the world, so I imagine I might be able to do that for the PC as well ๐Ÿค”

#

Voila, there's already support for what I wanted to achieve with persisting the PS. I think this was a bigger problem in my head than in reality ๐Ÿฅณ

#

Seems like it will work out of the box exactly how I want just by changing the timeout. I totally missed this because I was inheriting from GameModeBase ๐Ÿ˜„

thin stratus
#

That finds a PlayerState

#

You should not keep the PlayerController alive

potent cradle
hybrid zodiac
#

Hi all. I'm using the Steam subsystem and I was wondering if it was possible to have players join a game without the game running. I have got invites working, but currently the invitee has to already have the game running, otherwise when they accept the invite it will just start the game and they sit at the main menu

winged badger
#

you can use lobbies

hybrid zodiac
#

If starting the game from an invite, or from clicking "join game", does UE4 start with extra parameters I can use?

winged badger
#

they are basically a steam hosted chat that can hold data like a session

hybrid zodiac
#

Interesting

#

I assume I would need to handle an "detect if the game started from an invitation or join request, and automatically connect to session upon starting the game" in the game instance somewhere

#

Do you know how I might determine this?

#

I had a look at some tutorials but I can't see anything specifically about joining a session upon starting the game from an invite, just handling an invite while already in the game

winged badger
#

we do have invites running though

potent cradle
#

For the AddInactivePlayer flow, it seems like Epic went with duplicating the existing playerstate and storing that in case the player reconnects. Is this mandatory, or can I just keep the existing one alive as well?

#

It would make my life easier, but maybe there's a good reason why they do it this way.

hybrid zodiac
#

I should note I'm not using the advanced sessions plugin

winged badger
#

its duplicated, doesn't make your life easier to keep old one

#

i have no idea about that

#

there should be a steam API callback

#

when you start the game because of the invite

#

you need to reach to it and join the game

hybrid zodiac
#

@winged badger Thanks, I'll take a look at the callbacks and see if anything pops up

potent cradle
winged badger
#

non uproperty or transient stuff would get lost in the process

warped berry
#

what Net Mode would all Player States have on the host's device?

winged badger
#

depends on what kind of server it is

warped berry
#

listen server

winged badger
#

then ENetMode::ListenServer

#

usually best to do NetMode != NM_CLient

#

as standalone has its own net mode

warped berry
#

yea but the thing is Im using EndPlay in player state to update UI in lobby to display current players in lobby, but when the host leaves and still there are clients in lobby the host tries to update UI while tearing down his lobby menu and get's really stuck for some seconds

warped berry
winged badger
#

yes

warped berry
#

It's confusing for me

#

shouldn't it be NM_Client on the host's PC as well, since it's replicated to everyone ?

#

or is it that way because it depends on the current connection?

#

and not really related to the original client!

winged badger
#

net mode is the mode your net driver is operating in

#

its not replicated

hybrid zodiac
#

@winged badger Hey, in case you're interested in future, I found out how to launch the game straight to a lobby. If you accept a Steam invite and the game ISN'T running, then when it starts up it will have a command line argument +connect_lobby <id>

#

So in the GameInstance init function, you could check for that parameter and join the session right away

#

Pretty simple

winged badger
#

nods i didn't implement that part

gentle depot
#

I just want to ask a question, It's not issue for me but I just wonder why.

I have a begin play event in my map level blueprint. I have 2 different Custom Events to call at the beginning of the game to make things ready.
Events are: Game Start and Spawn Items

When I connect Begin Play to Spawn Items first then Game Start, it works fine without any issue.
But when I replace the positions of events, Spawn Items doesn't called at all for Client after Game Start.
When I add Print before and after Spawn Items, they both called but Spawn Items doesn't call at all (for Client only)

What can cause that issue;
Here is Begin Play: https://blueprintue.com/blueprint/0u75gsws/
Here is Game Start: https://blueprintue.com/blueprint/6b32o0h0/ (Not Replicated Event)
Here is Spawn Items: https://blueprintue.com/blueprint/uptcr-55/ (Just to Inform, Spawn Items is Server Side Replicated Event)

I just wonder, why it's happening :)

And forgotten informations;
toController is a function from my library to call my custom Player Controller class from Default Game Controller.
toBase is a function from my library to call my Custom Player Character class from Default Game Controller or Default Player Character.

brisk bluff
#

Trying to add a weapon switch mechanic via blueprints and have it show up for other players but I been stumped. I used the spawn actor and attach actor to component and was changing the visibility for every switch but it doesnt seem to pop up for other players despite the weapon actors having replicated enable. There somethin im missing?

warped berry
#

got it

meager spade
#

@rustic hollow check out the exi multi player compendium in the pins.

rustic hollow
#

Ok )

south rampart
#

It was a programmer who is no longer with us who implemented it. It's either EasyAntiCheat, Advanced Sessions Steam or Unreal itself which offers the protection against lagswitches

#

I have seen people with high ping or unstable ping get disconnected though. If I ever find it in code I will let you know but I'm afraid you'll have to research yourself : s

#

Could also be your servers are unstable

hybrid zodiac
#

Bit of a long shot, this, but has anyone used the FindSessionById function within the Steam online subsystem? It was always returning as having failed, so I looked into the OnlineSessionInterfaceSteam.cpp code and the function appears to be stubbed out:

{
    FOnlineSessionSearchResult EmptyResult;
    CompletionDelegates.ExecuteIfBound(0, false, EmptyResult);
    return true;
}```

It seems like it just always returns false and an empty result. Does anyone know what I'm missing here, or is this really an unsupported feature?
warped berry
lost inlet
#

yes there is?

hybrid zodiac
#

@lost inlet Thanks! I'll take a look

lost inlet
#

in an MP game, you'd run ServerTravel from the server itself, which will result in all clients travelling to the new map as well

lost inlet
#

I'm not sure what World->ServerTravel is exposed as in BP, if at all

#

and you have a map called "1"? you also wouldn't really run it in the context of a player controller

hollow eagle
#

ServerTravel as a console command is indeed the only built-in way to do it from BP

#

but that append makes no sense

#

the command is ServerTravel <map name>. You're giving it ServerTravel1

#

Even if you do have a map named 1 you're missing a space.

fading birch
#

unhook the player controller input.

#

if you have players in your server, server travel will bring the players in that server to the new map when server travel is exectured

#

You're testing in standalone correct?

grizzled stirrup
#

Anyone else getting this error on 4.27 P1? 'FUniqueNetIdSteam::FUniqueNetIdSteam': cannot access private member declared in class 'FUniqueNetIdSteam'

I'm using it like so: FUniqueNetIdSteam InFriendId(SteamLobbyCallback->m_steamIDFriend);

It compiled before just fine, any solutions would be greatly appreciated

eager gulch
#

Is there any built in command/tool in Unreal to visualize or debug collisions/geometry on a dedicated server from the client?

silent valley
#

I don't think so. You can use p.NetShowCorrections 1 to display client and server locations when they mispredict which can be helpful.

#

You can also use GameplayDebugger to show various server information on client but I think you might need to add your own information.

#

Did you try Listen Server?

snow thorn
#

i setup advanced sessions

#

how would i go about making server passwords

#

and creating player accounts/logins

edgy valve
#

Hi guys, i was trying to learn how i can "limit" how far the player can see, but i have no idea where should i start from, any chances anyone could help me out ? I would be very happy with just the keywords to search on google

#

Red square = visible area , everything else should be dark

short arrow
#

sounds like a fog of war @edgy valve

edgy valve
#

@short arrow thank you very much

wheat magnet
#

few keywords you need to research on that : fade out distance in camera, cull distance volume, post process material, view distance quality, cinematic camera with lens settings @edgy valve

#

these are the ways, you can try any method to achieve the thing that you've asked

fluid summit
#

Hi! can someone orient me on how to create something like path of exile / diablo 3 where you have your own instance and others can join too?

edgy valve
#

@wheat magnet Thank you very much

gloomy tiger
#

Yo. I have this UObject that I'm exposing to BPs. From there, I'd like to call RPCs from clients. I believe this has something related to Ownership - so my question is, how can I achieve replication in UObjects?

sinful tree
winged badger
#

and if its a UObject, not an Actor or ActorComponent

#

it needs to override a few things in c++

#
    virtual bool IsSupportedForNetworking() const override;
    virtual bool CallRemoteFunction(UFunction* Function, void* Parameters, struct FOutParmRec* OutParams, FFrame* Stack) override;
    virtual int32 GetFunctionCallspace(UFunction* Function, FFrame* Stack) override;
#

plus the owning actor needs to be owned by your PC/Pawn/PS and actually replicate the UObject by overriding ReplicateSubobjects

#

@gloomy tiger

tall pine
#

Hi guys,

For multiplayer FPS, how do you go about updating your UI on the client when a kill event happens?

Currently I base if off the replicated event of the kill count in the player state, but I find it lags behind a bit.

Another way is to use an RPC call and pass along the kill count with the player's name. This seems to be more instantaneous.

Thanks!

meager spade
verbal gust
#

@winged badger Hey have you ever came across timeout issues after the client initiates the handshake protocol. The server never responds with a SendChallenge packet? I am running a listen-server model. The Server travels to gamemap but when the client tries to travel to server map, it times out because server never responds (w. SendChallenge)

digital current
#

If this event is an RPC in a parent blueprint, will it also be an RPC in child blueprint?

#

It doesn't show the description text

somber glade
thin stratus
#

?game=GameModeShortcode

#

And GameModeShortcode can be set up in the Project Settings, under Maps and Modes

somber glade
#

and the short code is the gamemode.gamemode_c?

thin stratus
#

it's in the top advanced menu

#

And called GameModeClassAliases

somber glade
#

ah okay thanks, I'll dig around in there

thin stratus
#

@somber glade Make sure to do an Absolute Travel when Server Traveling. What the Forum post encounters might be a Relative Travel.

somber glade
#

okay I'll keep that in mind. Appreciate it

thin stratus
#

Now I feel dirty for reviving a 6 years old post, but maybe that helps others in the future.

somber glade
#

if there is wrong information or stuff that needs clarification it's fine. This kind of stuff shows up in google searches

thin stratus
#

Yeah I figured

#

:D My Mod Status shall protect me

somber glade
#

So servertravel mymapname?game=gamealias

thin stratus
#

Yeah

#

I do the exact same thing atm

#

Well in C++ that is

somber glade
#

It was kind of hard to find this information, so that's really helpful.

#

yeah I'm just running it as a console command from BP right now to try it out

thin stratus
#

My lobby on the marketplace uses the Console Command and works fine

somber glade
#

I'll make a function for it later

somber glade
#

@thin stratus One more question...if you're still around. If you start hosting as a peer to peer host and then server travel. Would additional users be able to join you on the new map, or would you need to somehow republish the session?

thin stratus
#

They should be able to join you

#

You need to actively block them off

somber glade
#

Yeah I have a host full bool that I set and that my c++ base checks before letting anyone in.

#

I could unset that if some users leave.

#

thanks.

thin stratus
#

Same goes for the Session itself

#

That's 2 different things you will need to manage

fading birch
#

You can probably store most of that in the session info no?

thin stratus
#

The Session should already have settings for that

#

Not in BPs of course

digital current
#

It should be directly in front of the barrel of the gun

#

but it's at the point where I am drawing the debug point

fading birch
#

I think you can add more session settings via the advanced sessions plugin

#

@somber glade is your boss still allergic to c++?

thin stratus
digital current
#

hmm kk guess I'll just my do my calculations on the client with replicated properties

digital current
thin stratus
#

That's up to you

#

I have it on both

digital current
#

both?

thin stratus
#

Yeah

fading birch
#

We do it that way as well.

#

So we can play effects on the client side

somber glade
#

@fading birch It's not that he's allergic, I took the project over while it was already blueprint. There was no time for me to spend however long it would have required to move everything to C++, so I just add c++ when it's absolutely needed. The next one will be started from c++ from the beginning.

fading birch
#

working in BP is fine, i was just pulling your chain lol

somber glade
#

๐Ÿ™ƒ

digital current
#

Would you guys recommend having a separate first person mesh and a separate mesh for other players to see in a multiplayer game?

#

Or is it usually not worth the extra effort

kindred widget
#

It's not really that much effort with the OwnerNoSee OwnerOnlySee settings.

#

I find that first and third person meshes are pretty standard in most FPS projects. Not necessarily required though.

digital current
kindred widget
#

Really depends on your animation stuff and how polished you want it. Many crazy successful games barely have third person models walking and playing a few arm movements coupled with aim offsets. While fancier animations are kept to the 1st person.

hardy valve
#

Any tips on how to make sessions password protected? ๐Ÿค”

chrome bay
#

Add an advertised "is passworded" property to your session, when a client tries to join that session they then know that they must enter a password, server rejects or accepts the join request based on that.

hardy valve
#

Sounded simple enough, can i add that property to the standard onlinesubsystem?

thin stratus
#

(and yes, you can)

hardy valve
#

Ah, woops, sorry and brilliant

somber glade
forest flint
#

Hello. What is the best way to know when a client has finished loading replicated actors? In my game players can build structures, which are replicated. When there are many structures on the server, after the player connects, it takes some time for these actors to be replicated. They are popping out for some time after joining.
I know that after actor is replicated, Begin Play is called, but I am not sure if it is the best way to check that. Besides it can be problematic if during loading, some players will place new structures or destroy existing ones.
I am looking for a way to detect that these actors are still loading to disable loading screen when everything is ready.

meager spade
#

you cant really

#

you can fake it

#

i do notice sometimes in big games (Fortnite for example) that i can join a game (Private) and i see replicated actors just pop up out of nowhere

#

or dissapear out of nowhere..

#

you can always just give a couple of seconds after connecting.. unless anyone else has a better way ๐Ÿ˜„

winged badger
#

wait, this is for hot joining?

meager spade
#

i assume so

winged badger
#

you can mitigate it a little, via replication graph, gradually expand range on which actors are replicated for that connection

#

prevent it, no

peak sentinel
#

Anyone is using push model for their systems?

winged badger
#

custom one here

forest flint
#

I want to avoid adding timer to loading screen ๐Ÿ™‚ Maybe give each structure unique ID and then check list of loaded IDs on client versus what is on server?

peak sentinel
winged badger
#

you can do that only if the list is predictable client side before he joins

#

totally different, but using engine features

peak sentinel
#

I see, where do you use it, if I may ask?

#

I'm thinking to take a look but couldnt find any documentation (as always..)

prisma fiber
#

Hello everyone
Can anyone give me tutorial for UE server with database? Even 8 hours tutorial from mumbling guy with bad accent will be fine
Everything I can find is server without database/database without server/author doesnt know what he is doing/it's made by rewritten 100 times plugins
It'll be 100 times better if you got tutorials with sql databases
In UE therere 2 built in SQL plugins but theres 0 documentation and the only one mention of these plugins is a reddit thread literally asking where they can find the documentation.

peak sentinel
#

And I found it on PushModel.cpp/h

twin juniper
#

Hello guys.I am trying to spawn 100 Ai in my game.I am spawning them inside my gamemode using spawn actor from class.But Only 8 AI are being created.Is there a limit.If not plz help me.Thank u

thin stratus
#

Show your code please, just in case

twin juniper
thin stratus
#

They probably can't all spawn on the same spawnpoint like this

#

For now you can try to set the Spawn Collision to AlwaysSpawn and see if that fixes it

somber glade
#

if a VR controller is only being spawned so that the client can use a widget interactor to navigate a menu only they can see, does it need to be spawned on server? or is it fine since the widget interaction will be local to them.

thin stratus
#

If you don't need replication, it's fine

hybrid zodiac
#

Hi everyone, might be a bit of a dumb question, but am I able to run SessionInterface->FindSessions twice at the same time with different callback handles? I want to run two searches, one for dedicated servers, and one for listen servers, but I want them to be populated into separate lists once completed. I suspect it isn't possible...

chrome bay
#

Pretty sure it isn't but would also likely depend on the online backend being used.

#

Can you not search for both and filter them afterwards?

hybrid zodiac
#

@chrome bayUnfortunately not, FindSessions only lets you search for dedicated OR presence in one go

#

If you set SEARCH_PRESENCE to true then it will exclude dedicated servers, if you set it to false it excludes listen servers

chrome bay
#

IIRC Presence is more about players being able to join via friends etc.

#

Don't even think any of the online backends have an implementation for it AFAIK

#

Oh wait lol

#

The Steam OSS uses it to denote Lobbies vs Internet sessions. That doesn't seem stupid at all.

#

Man it's almost as if the bIsDedicated flag doesn't exist -.-

#

In that case no you can't, not without Fixing Epic's implementation of the Steam OSS

#

I guess it's a side-effect of abusing steam "lobbies" to do player-hosted servers

hybrid zodiac
#

@chrome bay Ok no problem. I guess from a C++ perspective I can't run the same function twice with different callback handles? Or is that actually possible?

#

I mean, the worst case scenario is I just have to run FindSessions again from the OnFindSessionsCompleted delegate so it can run back-to-back searches

#

(obviously with a check to avoid an infinite loop)

twin juniper
#

Hey guys just wondering, I've read the documentation for a dedicated server and how to set it up for a game, but it doesnt seem to mention setting up multiple dedicated servers? How would one go about doing that?

fading birch
#

You need to host them on servers. There are several options such as Gamelift, Playfab, Azure, etc.

#

You'll need to implement a way to find the servers that you want players to join. You can do this in a few ways. Gamelift provides a matchmaking service named Flexmatch which you'll additionally need to setup websockets and write some lambda functions on AWS. Playfab also does something similar. If you want to show something like a server browser, then you'll need to do a session search, which will populate your servers that are hosting sessions.

twin juniper
#

I just meant connecting to multiple servers, thats unmentioned in the documentation.

Like it says "To connect to a server over a network, you can provide that server's IP address in place of 127.0.0.1."

How would I enter multiple servers/IP addresses to connect to?

fading birch
#

you don't

#

you can only connect to one game server at a time

twin juniper
#

But I want to be able to list the available servers/worlds players can join?

fading birch
#

If you want to show something like a server browser, then you'll need to do a session search, which will populate your servers that are hosting sessions.

#

to clarify

#

the player does the session search

twin juniper
#

Sorry new to the whole server/multiplayer thing.

fading birch
#

each server that has an active session that matches your search params, will send back a result

twin juniper
#

Interesting, looks like i need to do some researching. thanks

fading birch
#

no problem.

hybrid zodiac
#

@twin juniper the basic workflow is:

  1. Dedicated server creates a session using the online subsystem of your choice, sets a server name, max players and so on

  2. Client runs a search for sessions using the same subsystem, with appropriate parameters

  3. Once the search is complete, the client receives a list of search results, which contain info like the server name, ping in ms etc, so it can be displayed in a menu if you like

  4. Client calls JoinSession using the subsystem, passing in one of the search results, to join that server

  5. Once successfully joined, client travels to the server url using client travel

twin juniper
#

I feel like im missing steps from what youve told me.

The dedicated server creates a session...
The player client asks for other sessions...

But where do these other sessions come from?

fading birch
#

the online subsystem

#

for example, Steam has an online subsystem which can host sessions on steams backend. Steam games have a specific steamappid, which you set in your config files. You can then browse for those sessions in your game. Ignore the red as i'm on an internal build atm, but this is an example of what that can look like:

twin juniper
#

But I have to set up the extra sessions in the backend right?

#

And say that my sessions consist of 2500 player slots, wouldnt i need multiple servers then?

eternal canyon
#

do u mean the thing that manages the sessions or

twin juniper
#

Like each game world has 2500 players max

eternal canyon
twin juniper
#

*if

fading birch
#

that's a completely different type of system

#

each server can only host 1 session

twin juniper
#

Well if gamelift is scalable im sure its possible?

fading birch
#

2500 players on a server is a lot

twin juniper
#

Wdym? I thought the exampke you showed is one server with two sessions?

fading birch
#

my picture?

#

no

#

i'm the player

#

those are available sessions

#

1 per server

twin juniper
#

So then back to my first question i guess? how would one set up multiple servers?

eternal canyon
fading birch
#

Through a service or build your own infrastructure for it

twin juniper
#

No but i mean, back to where it says 127.0.0.1 is one server, how would iadd in all the other servers?

fading birch
#

you just enter the IP of the server you want to connect to

twin juniper
#

You said that i dont, but in this case its different?

fading birch
#

you can't connect to multiple servers at once

#

it doesn't work that way

twin juniper
#

Not connecting to, but listing through a server browser, is what i meant

fading birch
#

you're looking for sessions, not servers then

twin juniper
#

Is it not the same thing as you just said 1 session per server?

fading birch
#

a server is basically the game server

#

a session is something that you can search to find the session

twin juniper
#

Okay i will... but i dont think it answers my question.

twin juniper
placid flame
#

hey how can I set the cull distance to disappear players with distance and appear again?

twin juniper
#

And you suggested sessions, which you said one server per one session, but im looking for a list of multiple dedicated servers?

fading birch
#

Then you are looking for a session list. You need to perform a session search and then join the selected session. That will connect you to the server.

twin juniper
#

Right. But how does that work, would i set up the sessions in the aws backend?

placid flame
fading birch
twin juniper
#

So its practically automatic..?

fading birch
#

you need to initiate the search and display the results

twin juniper
#

Well, thanks.

fading birch
#

no problem

twin juniper
#

Ehhh i have one more question but, it should be rather simple?@fading birch

fading birch
#

shoot

twin juniper
#

How exactly does it work, how does a server instance connect to UE?

fading birch
#

No.

#

Under the hood when you join a session you've found via a session search, you get the IP of that server. You then connect to it via open IP:PORT

#

that's handled in the engine itself

#

using the console menu in game to open IP:PORT will do the same thing

#

but you won't join that server's session

#

you'll still connect to it though

twin juniper
#

Ehmm... okay? Lol

fading birch
#

the flow goes:

1. Server boots up
2. Game Instance on server starts hosting a session, this registers it with the online subsystem's backend, Steam, EOS, etc
3. Client boots up game
4. Client executes a Find Session (session search)
5. The online subsystem's backend, Steam, EOS, etc, returns a list of available sessions that match your search parameters.
6. The client is displayed a list of sessions (you need to hook this up via widgets).
7. The client clicks a session in the list and clicks a join button.
8. The client attempts to join the session, if successful, it will then travel to the server.
9. When a client joins the server, the player is registered in the online subsystem's backend via RegisterPlayer
10. Normal gameplay loop```
lusty badger
#

I have a question, I want to change the collision to an actor:

  • The actor in question have the replication option turned on
  • From the player client I make a RPC to the server to change the collision of the object
    Is that ok? Because my clients don't update the collision
#

This is the blueprints to deactivate the collisions

#

It's called from the server after it spawns the objects I want to change

spiral epoch
#

hey friends
coming from inhouse engine/networking dev, I'm curious if UE inbuilt networking can be used for server-to-server communications? Replicating actors cross servers/RPCs and such

chrome bay
#

It cannot

#

As far as UE networking goes, there's one server, and x amount of clients

spiral epoch
#

sad

bitter oriole
#

It's honestly not very hard to implement yourself

#

Serialize your data, open a socket, send the data

spiral epoch
#

Well, I know how to implement it from scratch

fading birch
#

you would need to setup a master server for it to handle the communications. UE4 at it's core was built for FPS games and branched out from there

chrome bay
#

Multi-Server stuff is usually the realm of MMO's and/or large scale - which often will need it's own backend support.

bitter oriole
#

There isn't any need for master servers if your two servers know their own addresses. Literally open a socket, serialize actor, write to socket.

spiral epoch
bitter oriole
#

Well, mostly Unreal is a client/server model meant for fast-paced games with up to 50/100 players, with dedi or listen server, and that's about it. There really isn't much more than that.

#

There are different strategies for doing more - using some third party net stack, using Unreal as a client only, or doing whatever Rare is doing in Sea of Thieves with server migration

kindred widget
#

@lusty badgerYour multicast is pointless. You're spawning something on the server, and then making a multicast to everything, and telling them all to check if they're the server, and if not do nothing, if they are, set collision. Why not just set the collision right after spawning without the multicast?

round latch
#

I have a question about multiplayer. If you make a game without multiplayer, can you still add it?

#

Like if I made an fps game and I finished it, can I add multiplayer like how Call of Duty is?

violet sentinel
round latch
#

ok

lusty badger
round latch
edgy valve
#

Guys any ideas on how i could store a list of characters in a database ? I was using the VaRest plugin for that,i have a database and a webserver, i was storing my characters as Json files, but for a more complex character structure i don't think that would work, any chances anybody could share some ideas ? thanks in advance

fading birch
# edgy valve Guys any ideas on how i could store a list of characters in a database ? I was u...

I used relationship tables to store character data. Each user would have a user id. Each user could have X characters. Each character could have Y loadouts. Each loadout consists of 2 weapons, 2 equipment items, a player custom name, and the loadout id. I stored pretty much all of it as ints and just kept a table on the game server of what id matches what. That would then determine what to spawn for the player.

#

one to many relationships are your best friend in cases like this

#

did you do anything weird to the input stuff in your controller? Replicated character movement should just work out of the box.

#

you shouldn't need to do that

#

just drop player starts in your level

#

the engine handles that part for you

#

unless you want to customize it

#

you should override RestartPlayer in your gamemode to adjust that then

#

you also need to override a few of the match state functions in your gamestate as well

fathom dust
#

If I wanted to have a character move along a spline, and have that movement correctly replicated, does anybody know a) whether using the CharacterMovementComponent / FSavedMove stuff is the right approach, and b) where I could find an example that'll help me sort out how to build it?

hollow eagle
#

FSavedMove is indeed the right way to handle network prediction. As for examples... honestly your best bet is to look at the engine code.

fathom dust
#

Makes sense. Just start from saved move > find references and go from there?

hollow eagle
fathom dust
#

Thanks for the help ๐Ÿ™‚

#

I'll check it out

fluid summit
#

Hi! Does anyone know how hard is to make server timers specific for each client? So for example you can leave something building and when you came back, the time elapsed is discounted

#

Or how would you advice to approach this?
Im thinking on 2 ways, the server has timers specific for each client that are saved on the server side and checked when ever needed.

Or the client saves a timestamp when he left and the server checks thst when he comes to figurate the time elapsed

fading birch
#

Have the server store it and use actorbeginoverlap to trigger the update client side.

#

Just check ROLE_Authority and call the rpc from the server.

edgy valve
#

@fading birch Thank you very much !

steel agate
#

I'm trying to understand the flow of possession and the events that occur. It seems like on multiplayer possession and the event possessed only occur on the server. Correct?

Then it seems like it's reliant that all variables be passed to the owning client. However i do have some interfaces stored as variables I use for abstracting inputs on held objects. i want the player controllers to handle inputs, then those inputs get passed to the interface.

It works on initial load of a map, however If I respawn, destroy pawn and spawn in a new pawn asigning owner to the selected character controller, it spawns in on the server, possess event occurs on the server, interfaces are assigned on the server. However they are not replicated to the client.

#

So my question would be are interfaces not replicated even if set to replicate? I'd assume the reference would still get passed.

fading birch
#

Does your controller implement the interface?

steel agate
#

the pawn gets an object, weapon, etc that implements the interface

#

So its an input interface, for 16 buttons/8 axis. It's implement on the weapons or other equipment. Pawn itself, implements the interface which just calls to that items interface which actually implents the functionality. The controller gets the actual inputs and calls to the interface on the Pawn which then travels down the line.

#

So when you spawn in, you get the pawn, which you find its interface, which then would be driven by the actual inputs on the player controller.

#

Okay I solved it with a repnotify on an object.

#

object gets cast to the interface.

#

in the repnotify

half jewel
#

playerstate lifetime is volatile and is destroyed when player connects and disconnects

steel agate
#

yes

half jewel
#

even setting the persist option on them just copies data, new ones are still spawned or destroyed.
i spent hours trying to control the lifetime of them and just ended up just making an actor during prelogin and its never destroyed just stored in a tmap for reuse

#

in my game these actors are the owner of player owned assets, so even when the player is disconnected the owner is held, so when player reconnects, the gamemode tells the actor the new PlayerController is owner, and walah all of the assets rpcs work again

half jewel
#

he will say that wont work well guess what, i did and it works lmao

#

it was one of heavy attacks that clapped him

kind ember
#

Anyone worked with PlayFab dedicated server?

fading birch
#

No, but I can probably give you some info as I've done some research on them. Whats up @kind ember

kind ember
#

I got server deployed and healthy.
Set the server to active.

But nothing happen when I tried connecting to the server "open 123.123.123.123:7777" and "open 123.123.123.123"

fading birch
#

Does playfab make you specify which ports need to be allowed?

kind ember
fading birch
#

i'm not sure if you can connect to it directly actually

#

via open ip:port

#

you may need to use playfab's service to connect to it

#

which seems weird

kind ember
#

As long as the server is active, which can be set to active by using RequestMultiPlayerServer api, this api also return server info ip and port.
Matchmaking also return ip and port.
And client uses ip and port to connect according to thier doc, maybe I am missing somthing or port is closed.
This has been a headache.

fading birch
#

unfortunately, this is outside of my expertise. Google isn't really helping much either. Maybe contact playfab support?

steel agate
#

So the server is running outside of your home network correct?

kind ember
steel agate
#

Ah yes, so it is definitely a pain in the ass for this. It's been a long time for me but yes first your port is going to be an issue. Can you ping it from on your network?

#

through command prompt?

kind ember
# steel agate through command prompt?

Never tried pinging. Is what do you mean, in cmd prompt?
But I am about to find out by connecting to a PC with opened port.

The project is dedicated server, no peer to peer, so could be port issue.

steel agate
#

like on your computer, run windows command prompt, try and ping server.

kind ember
#

whats the cmd syntax for that?

steel agate
#

it would be like ping 111.111.111.111

#

i'm not sure if you can put in a port exactly, but yeah first steps see if you can reach it

fading birch
#

you should be able to ping the ip. Port is just for ue4

steel agate
#

XD i'm too slow to say that

#

yeah telnet <ip> <port> so telnet 111.111.111.111 5000

#

in command prompt

kind ember
#

ipv4 should the one right?

steel agate
#

There are 4 sets of numbers for IP addresses

#

also that's weird your ip is 123.123.123.123

#

that sounds like a place holder, but it is a valid ip

#

syntactically

kind ember
#

Which of these? I tried ipv4

steel agate
#

ipv4

#

try telnet

#

look in the link i shared

#

I'm out for the night o7

#

or morning....it is that time XD

kind ember
#

Cool, will try, thank you.

kind ember
#

Lol, was pinging the wrong ip, my ipv4 and external are different.
Pinging external ip worked.

Though telnet isn't able to connect, the cmd prompt "ping" works

Now waiting for engine copy paste to finish so I can test.

thin stratus
#

Can someone remind me what Event is called on a PlayerController, locally, for both new and seamlesstravel controllers?

#

Need some common entry point. Freaking BeginPlay..

#

Actually, BeginPlay works for Local Players, but not for the Server. Great times.

winged badger
#

what are you trying to do?

#

you have HandleStartingNewPlayer in GameMode

#

that is usually a common thread between the two, but all "construction" events will get called, ending with BeginPlay

thin stratus
#

Yeah, I use that to init my UI. But the UI needs the GameState and that is invalid on Clients at that point.

#

I made myself a callback now to listen to so I don't have to weirdly query the GameState

winged badger
#

no actor on client will call BeginPlay without a GameState

#

and you can do before BeginPlay easy enough

#

AGameState::PostNetInit, as a simple solution

#

which is the first point you will have replicated data in GS available on clients

thin stratus
#

Right, sorted it now

lilac raven
#

Hello, currently developing a rapid fire weapon in multiplayer, and im getting server lag when firing due to it multi casting every 0.2 seconds, is there a better option?

thin stratus
#

What are you multicasting for?

#

What I usually do is:

HandleFiring on Server and Client at the same time.
Increment an Integer whenever the Weapon is fired.
Make that Integer OnRep.
When the Weapon stops firing, set the integer to 0.
In the OnRep, check if == 0 and stop effects
In the OnRep, check if > 0 and Perform Simulated Shot. You can also Start looping effects here if the previous integer value was 0.
The OnRep should not run on Authority or LocalClient. It only simulates the weapon shot.

#
// Executes on Server OR Owning Client
void TryStartFireWeapon()
{
  StartFireWeapon();
  if (!HasAuthority())
  {
     ServerRPCFire();
  }
}

// Executes on Server
void ServerRPCTryFire()
{
  TryStartFireWeapon();
}

// Executes on Server and Owning Client
void StartFireWeapon()
{ 
  // Start Looping VFX/SFX
  FireWeapon();
}

// Executes on Server OR Owning Client
void TryStopFireWeapon()
{
  // Same as TryStartFireWeapon but with Stop
}

// Executes on Server and Owning Client
void StopFireWeapon()
{
  // Stop Looing VFX/SFX
}

// Executes on Server and Owning Client
void FireWeapon()
{
  if (HasAuthority())
  {
     CurrentShots++;
  }
  PerformWeaponTrace();
}

// Executes on Everyone
void PerformWeaponTrace()
{
  // Trace
  // Handle VFX/SFX
  if (HasAuthority())
  {
    // Handle Damge
  }
}

// Executes on Simulated Clients
void OnRep_CurrentShots(int32 PrevCurrentShots)
{
  if (IsLocallyControlled())
    return;

  if (PrevCurrentShots == 0 && CurrentShots > 0)
  {
    // Start Looping VFX/SFX
  }
  else if (PrevCurrentShots > 0 && CurrentShots == 0)
  {
    // Stop Looping VFX/SFX
  }

  if (CurrentShots > 0)
  {
    PerformWeaponTrace();
  }
}
#

Yoooooooooooooooo

#

Why not a snippet Discord

#

Why not

lilac raven
#

Haha, thank you for the help! I am using blueprint but can read code somewhat, so ill break this down!

thin stratus
#

It's not 100% code

#

It's just pseudo code

#

So should be simple. If you use BPs, you won't have access to the PrevCurrentShots in the OnRep, but I'm sure you'll find a work around

lilac raven
#

ah alright, yeah i am sure i will figure it out somehow!

thin stratus
#

Should have written it all into one line

chrome quest
#

Quick question please. If I have a regular actor that is set to replicate, when I run functions on that actor, do the functions automatically run on the server or I have to explicitly mark the function to RunOnServer?

sinful tree
# chrome quest Quick question please. If I have a regular actor that is set to replicate, when ...

You normally mark an event as "Run On Server" when you're trying to call the server from the client (Eg.
You click a button on your client -> Run On Server Event -> Server does something). This will also only work on actors that are owned by the client.

Events that are not marked will fire from wherever they are called. So if they are called while you are currently running on server, they'll run only on the server. Eg. "Begin Play" fires on both the client and server. If you had a "Switch Authority" and took the "Authority" path, then you're running only on the server and if you called an event on that path that doesn't specifically indicate what it should run on, then it would only run on the server.

twin juniper
#

Does anyone here have experience implementing ok mulitplayer netcode in large maps (> 10km^2) in unreal multiplayer (multiplayer origin shifting)?

twin juniper
chrome bay
#

It works, sort of - so long as you account for it everywhere

#

Server is always using zero-origin space though, it's only clients who can rebase

#

Which also means it's not an option for listen servers

bitter oriole
#

Which also means that server calculations will have inaccuracies and clients will need to account for that

fluid edge
hardy valve
#

Evening everyone, I have one large variable that i want to replicated from the host to clients when they join the session, RPCs dont work since im guessing its to big? Anyone smart that has a solution to sending that? ๐Ÿ˜„

heady python
hardy valve
heady python
#

Game instance is another thing. game mode is what you want to save the variable on. It wont load the variable automatically but whenever your player joins, it will fire off the OnPostLogin. from there you set whatever variables you want on the player that joined.

heady python
hardy valve
#

Ah! yeah i have used repnotify for it but from the player controller so it failed, Super thanks for the help!

fading birch
fluid edge
#

@fading birch Just standard character movement component

fading birch
#

with regular input? interesting

fluid edge
#

Yup

fading birch
#

have you changed anything about net updates in your .ini?

fluid edge
#

No I havenโ€™t

winged badger
#

are you replicating your skeletalmeshcomponent or are you replicating any owning client predicted updates back to the owner?

normal jacinth
#

Hi, I'm running a Multicast RPC from a pawn, and I'd like to run a function only on a single player character, rather than replicating to all characters. How can I go about this?

lusty badger
lusty badger
fluid edge
#

@winged badger Can you elaborate? I have never done anything with prediction so I doubt I'm doing that

winged badger
#

replication condition SkipOwner if you're doing that

#

its more likely ComponentReplicates ticked on SkeletalMesh though

fluid edge
#

Not sure if this information helps, but if I walk forward there is no stuttering like in the gif. Only if I walk left, right, or backwards

fluid summit
#

Hi! any way to quickly mockup a dedicated server to load/save profiles between accounts?

digital current
#

How do you guys deal with the delay in the projectile spawning on the client

#

I am trying to spawn projectiles from my gun on the server

#

and they're quite a bit far ahead already when they appear on the client

twin juniper
#

is there a good way to make player movement server side (i mean asking the server to confirm that the player can do it.), like move forward, right etc

#

Or the movement component from Third Person Template already manage that ?

peak sentinel
#

Do you want to get rid of prediction (client-side simulates the movement first) or just asking if server confirms (after every server update, server checks the clients position based on the velocity and checks if its possible that client be there, if not, corrects the movement) the clients movement?

summer tide
#

Would this work in multiplayer?

snow thorn
#

does anyone know a function to check if level is multiplayer or single player

#

its for a branch in my pause menu

#

if it is sp it will call the pause game function and bring up pause menu

#

if it is multiplayer it willl not pause game but will still bring up pause menu

gleaming vector
#

the world has a net driver, and in it is a NetMode

#

GetWorld()->GetNetDriver()->GetNetMode()

rich dune
#

Does anyone here use EOS? I integrated it into my project and so far it's working. However once I try to host a dedicated server on a remote windows PC I get an SSL Certificate issue. However on my dev PC it runs without an issue. Both systems have no additional SSL certificate.

What are they referring to?

As Epics support is as bad as always my question gets even deleted without a comment from the EOS Forum ....

Any idea what this issue could be?

kindred widget
#

@snow thorn There isn't one by default I don't believe. If you're not opposed to C++ You can basically make a function that does two checks. First is if the net mode is client. If it's not a client. Then you can iterate over all playerstates in the gamestate and check if there is more than one playerstate that is a player's playerstate. Easily done via !PlayerStatePointer->IsABot()

young spoke
potent cradle
#

Hmm, trying to use UnrealInsights on my dedicated server to see where my memory costs are coming from, but I can't seem to actually find the data anywhere.

#

Has anyone used the tool for this purpose before? I can connect and all, and it says the module is active

#

I seem to only have these tabs

kindred widget
#

@young spokeYour Onrep looks fine initially. Put prints in. Make sure the OnRep is running on the client.

fluid summit
#

Hi! does anyone know if there's an easy way to put a test server? i want to test things like login, data saving on the server and functions running on the server when the user is logged off.

#

i can only setup a dedicated server for my project if it's on cpp? o.O

fluid summit
#

i'm doing something like travian, where a lot of people connect to the same server. Not sure if a listen server will work, what do you think? i'm extremely new to multiplayer and i'm looking for what are the best ways to implement it

astral perch
#

I haven't done it before, but that CPP looks pretty straight forward.

fluid summit
#

i'm not sure if for CPP project it means to just initialize the ccp class or have it all full CPP with no BP D:

astral perch
#

I see. It looks like it's just the server that uses that C++ setup and once you have that you can compile the server. But I really shouldn't be talking about it because I have no idea. I'll be looking into that soon enough myself though. I'm playing with listen as we speak (and running into a little issue).

#

As soon as my second PC character spawns in, they disappear (and make their own instance it looks like). Not sure what's going on there yet.

#

Yeah, I'm not sure what's going on with my setup. Sometimes the second player disappears and sometimes he stays. I'll get to the bottom of it.

hybrid zodiac
#

Hi all, when calling SessionInterface->UpdateSessions and passing in some new session settings, do I need to pass in ALL of the settings, or can I only pass in the ones I want to change? For example, if all I want to do is change the name of the map, can I create a new session settings with only the SETTING_MAPNAME defined, or do I need to redefine everything like player limit, whether it should advertise, if it's a presence server and so on

fluid summit
#

One quick question, i'm reading the documentation of UE4 on multiplayer, but i don't see anything to limit the scope of how much something is being replicated on each client, like a LOD.
for example:
on a mmorpg, you don't want to replicate on player1 what is happening to player2 unless it's near enough to be relevant.

#

anyone knows on where i can look more into that?

hybrid zodiac
#

@fluid summit For an MMORPG I would look into the replication graph, it is a more efficient way of handling relevancy for potentially thousands of objects

fluid summit
chrome bay
#

Relevancy is the concept of "lodding" in UE4

fluid summit
#

Relevance and Priority
Relevance is used to determine whether or not it is worthwhile to replicate an Actor during a multiplayer game. Actors that are not considered relevant are culled during replication. This saves bandwidth so that Actors that are relevant can replicate more efficiently. If an Actor is not owned by any players and not physically near any players, then it is not considered relevant and does not replicate. Non-relevant Actors still exist on the server and can affect the authoritative game state, but do not send information to clients until players are nearby. You can manually control relevance by overriding the IsNetRelevantFor function, and you can determine the distance at which an Actor is relevant using the NetCullDistanceSquared property.

Sometimes there is not enough bandwidth available to replicate all relevant Actors during a single frame of gameplay. Actors therefore have a Priority value which determines which Actors get to replicate first. By default, Pawns and PlayerControllers have a NetPriority of 3.0, which makes them the highest-priority Actors in a game, while base Actors have a NetPriority of 1.0. The longer that an Actor goes without being replicated successfully, the higher its priority will get with each successive pass until it is replicated.

For more detailed information about Actors' relevance and priority, refer to our guide on Net Priority.

chrome bay
#

but it's more about completely culling, not lowering "detail" as such

fluid summit
#

it seems i just needed to read a litle bit more jaja

kindred widget
#

@fluid summit On a side note to your earlier point about the C++ project. Any serious project will be C++ and Blueprint mixed. Even the absolute most hardcore C++ people still make use of BP child class data only blueprints for setting default values.

fluid summit
#

Yeah, another question.
let's suppose i want to have one variable HP that increases by 1 each 5 seconds you are playing.
but i want it to increase even when the player is logged off.
how would you implement something like that?
i'm thinking on update it only on demand and on each update check the last time of update vs the current time and in this case, divide by 5.
any other good way?

kindred widget
#

Sounds like a pretty classic case of Replication to me. On Server, just have a timer or tick function that handles your health update. Only ever set the value when it changes every 5 seconds. If the client isn't logged on, nothing happens to them but it still updates on the server. If they are logged on, it replicates to them.

fluid summit
#

do you think that would be too costfull? let's say you have 1k players (just for sake of the example)
and all of them are logged off, the server will have to update 1k set of variables every 5 secs.

#

is it really cheap since it is updated only on the server and no bandwith is required?

kindred widget
#

I mean.. you're talking about setting 1k values once every 5 seconds. Assuming no one is logged on, there is no replication. So at that point it's just a computer setting 1k values in a frame. that happens once every 150-300 frames. If your server chokes on that, it needs replaced. ๐Ÿ˜„

fluid summit
#

That is really nice to heard jajaj

kindred widget
#

What you won't like hearing is that that kind of scope is unrealistic.

#

No game actually has 1k people on the same server. For that kind of thing you're looking at major outside infrastructure. Even major MMOs, which refer to their individual worlds as "Servers" are kind of misusing that. What they actually are are several different servers working together to create one world, likely with a main, very simplified overlord that manages them.

#

And when I say no game, I mean this from any standpoint, not just UE4

#

I mean. Maybe it might be possible with some very slow strategy style game where things are slow enough to be updated very carefully over the course of many seconds and the server can send updates to connected clients, and you put in that framework to handle it.

fluid summit
#

Oh Yeah, i got that. For this project im aiming at Most for a dedicated server that allows for 15/20 players at Most, it's mainly to learn and to get a game wish out of my head

fluid summit
#

Even for a game like travian where you only need to update Flat values?

snow thorn
#

example would be like bungeecord/waterfall for minecraft

#

thats how they get those crazy 100k plus player counts

hasty reef
#

For some reason my new blueprints no longer multicast correctly
I am calling multicast functions from the server, and it is only running my multicast on the server

#

does anyone know what would cause this?

#

I've confirmed that it is actually running from the server so that's not the problem, and it is set to reliable

heady python
meager spade
#

Not seen much about, but is it possible to dynamically increase/decrease update rates for network

#

for replicated actors?

#

ie actors moving far away from a target have a lower net update freq

#

wondering if just changing the netupdate freq would work

hasty reef
meager spade
#

how do you know the multicast is not working?

#

who is calling the multicast? client or server?

#

(only server can invoke a multicast event)

hasty reef
#

I'm using print string

#

from other actors I get this

heady python
#

. . .

meager spade
#

so.. whats wrong/

hasty reef
#

but when I use my multicast in my current blueprint I only get this

meager spade
#

print on tick of that actor if its replicated

#

maybe you have done something that turns it off

hasty reef
#

That's what I'm wondering

#

this is the tick

meager spade
#

i said print if its rpelicated

#

not if its ticking ๐Ÿ˜„

hasty reef
#

oh replicated to the multicast event? Sorry I am a bit confused

meager spade
#

like this

hasty reef
#

riight

#

okay

#

It calls on all for things like Beginplay and OnRep but not multicasts

#

and I have no idea what's wrong lol

meager spade
#

strange

hasty reef
#

right?

meager spade
#

multicast is reliable?

hasty reef
#

yep

meager spade
#

not called on tick?

hasty reef
#

I'm just gonna start posting my blueprint

#

that's the whole pathway

meager spade
#

not sure why memory game calls a netmulticast

#

cause that would not work

#

cause its comes from a OnRep

#

which is run on clients

hasty reef
#

I thought onrep also runs on server?

#

but even if I call show colors from my beginplay it doesn't multicast

meager spade
#

ah its gated

#

but feels a bad design choice tho

#

what if you make a new funciton

#

and call that does it work? i have had issues where bp gets a bit screwed up

#

and looks like you are making the memory game from CoD zombies Moon Easter Egg troll

hasty reef
#

๐Ÿ‘€

#

perhaps

meager spade
#

heh, anyway, try a new function

hasty reef