#multiplayer

1 messages Β· Page 473 of 1

naive shell
winged badger
stark echo
#

oh thx @winged badger

winged badger
#

also, post login is not the place to spawn players from

#

there are better hooks, like HandleStartingNewPlayer

#

and the thing works pretty well out of the box

#

for just adjusting spawn location, you override gamemode's ChoosePlayerStart and leave it at that, usually

naive shell
#

Im sure its related to the player itself,smt im doing wrong

random oxide
#

@winged badger does HandleStartingNewPlayer fire after onPostLogin ?

winged badger
#

it does

random oxide
#

cool thanks

winged badger
#
void AGameMode::HandleStartingNewPlayer_Implementation(APlayerController* NewPlayer)
{
    // If players should start as spectators, leave them in the spectator state
    if (!bStartPlayersAsSpectators && !MustSpectate(NewPlayer))
    {
        // If match is in progress, start the player
        if (IsMatchInProgress() && PlayerCanRestart(NewPlayer))
        {
            RestartPlayer(NewPlayer);
        }
        // Check to see if we should start right away, avoids a one frame lag in single player games
        else if (GetMatchState() == MatchState::WaitingToStart)
        {
            // Check to see if we should start the match
            if (ReadyToStartMatch())
            {
                StartMatch();
            }
        }
    }
}
#

all it does, by default

random oxide
#

I was spawning player onPostLogin and it is working fine so far but I will take your suggestion seriously

winged badger
#

and it doesn't do that if you override it in BP and don't call parent

#

last thing PostLogin does is call HandleStartingNewPlayer

random oxide
#

aha

winged badger
#

and that happens after the BP event

#

so spawning from PostLogin tends to have default implementation of HandleStartingNewPlayer restart you right after

naive shell
#

Basiclly clients dont work

random oxide
#

I really need to start coding in c++ instead of those BPs I do... I just give a little time to learn the framework better

winged badger
#

start reading the source code of game framework classes]

#

a little at a time

random oxide
#

sure yeah

naive shell
#

At least you started

random oxide
#

a start is a start πŸ˜„

winged badger
#

@naive shell go and check your output log for any LogGameMode or LogSpawn entries

#

after it fails to spawn your client

naive shell
#

It looks like after some seconds im able to control the player but just walk

random oxide
#

but I mean doing complicated and advanced BPs in a month compared to previously having no idea how they work is huge progress πŸ˜„

winged badger
#

there is a real possibility the term "complicated" applies only because you made them so, even if they didn't need to be πŸ˜„

random oxide
#

well BPs look complicated anyway it's in their nature, and this is one of the reasons I wanna code directly.

#

very hard to debug or change them around if you need

fleet raven
#

bp is like 90% unnecessary visual noise and 10% code

random oxide
#

heh

naive shell
#

It find it way easier to use bps

fleet raven
#

at least reading them feels like that

#

takes way way way longer to reverse engineer a node graph than it would take to read equivalent code

winged badger
#

after you get used to c++, it takes way way longer to make one, too

random oxide
#

especially if your mouse does crazy things cause of temperature changes and double clicks

fleet raven
#

the most infuriating thing when exploring bps is that the navigation does not actually work

#

if you double click a node to find out what it's doing, surprise, you can't go back now and have to start over

random oxide
#

yes that can drive me crazy too

fleet raven
#

maybe this would be worthy of a PR to fix it

random oxide
#

can't put delay in functions and many other things

fleet raven
#

no delay in functions makes sense as the function must return immediately

winged badger
#

@fleet raven what do you use to get the values displayed inline when your breakpoint hits in VS?

fleet raven
#

entrian inline watch

winged badger
#

cheers, and your personal experience with it?

fleet raven
#

10/10

#

you can make it more useful like this

random oxide
#

a function must return immediately ? why that

fleet raven
winged badger
#

looks handy

#

can it do other magic, like scope my Locals to an object?

fleet raven
#

I don't think it can

#

adding those boxes inline in the code is the only thing it does

#

and the natvis file is like formatting rules for display in the debugger

winged badger
#

nod

#

its also cheap, will give it a try

fleet raven
#

it's incredibly useful when debugging math/algorithms

#

no more painful checking what the new values are

winged badger
#

there go my years of practice to quickly decipher Locals πŸ˜„

random oxide
#

my vs takes forever to open projects or the engine

#

I hate it

winged badger
#

why?

random oxide
#

I blame my pc

fleet raven
#

takes like 1 minute for it to get fully ready for me, but I only open vs like 1 or 2 times a day so

#

it mostly just stays open

winged badger
#

same here, no need to get VA reparsing all the time

random oxide
#

but in any other IDE I run on this computer things are lightning fast

fleet raven
#

the entrian search is also very useful

random oxide
#

ah so you keep it running

#

so it is normal to take forever to open

winged badger
#

i often go days without shutting VS down when working from home

random oxide
#

πŸ˜„

fleet raven
#

I turn my pc off every night because the noise would bother me

winged badger
#

sound padding on the casing here, don't even notice it until it runs all cores for a while

random oxide
#

no computer shuts down in this house

#

I got 2 servers running in the other room

#

24/7

fleet raven
#

also like why

#

there's no real reason to not turn it off

random oxide
#

one is also a local DNS

fleet raven
#

doesn't take too long to turn back on

random oxide
#

I know right

winged badger
#

for me, starting VS and loading my project (about 1k source files) takes 5-8 seconds, 20ish seconds to start the editor

random oxide
#

I need an SSD I think on this desktop

fleet raven
#

vs might start fast but it still takes a while for it to decide to begin loading the plugins and then for va to eventually start coloring things

winged badger
#

that depends on if you restarted the PC or not

#

and you do, a PCIx4 SSD

random oxide
#

that other visual studio code opens way faster why

fleet raven
#

get a samsung 970 evo plus

random oxide
#

but I cannot build server from it or at least I don't know how yet

#

yes I will get a samsung

fleet raven
#

the m.2 one

#

best ssd

#

too bad I can't afford one

random oxide
#

ups that's a little more expensive than I thought πŸ˜„

#

is this a german eshop ?

fleet raven
#

it compares prices from all the relevant shops that exist

random oxide
#

oh ok, cause I wanna find some good german eshop that sends to EU countries, for my upcomming purchases

fleet raven
#

so you can put up a wishlist with the parts you need and it'll compute the cheapest way to purchase all of that

random oxide
#

ok I bookmark it

fleet raven
#

been using it for every pc build

random oxide
#

I always order from germany

random oxide
#

lol

#

hey no not that bad πŸ˜„

#

it's jsut that running visual studio or windows makes it feel like older than it really is

fleet raven
#

wait I don't see a power cable

#

that thing's not plugged in

#

make sure you use va

random oxide
#

va ?

fleet raven
winged badger
#

potatos generate their own electricity

random oxide
#

oh well ... you know I am one of those that consider assistant tools a visual noise

winged badger
#

intellisense that is responsive and actually works...

#

really?

random oxide
#

I actually type the whole class or methood by hand without using tab

#

yes

naive shell
#

real dev

random oxide
#

yeah lol

#

but that's how I like it

fleet raven
#

that's silly tho especially in unreal with the style being to write 100 letter function names

random oxide
#

I know especially when they look like whole sentenses

#

camelCaseWordOneAfterTheOtherEtc

winged badger
#

its slower and more error prone

fleet raven
#

va also does a lot more than autocomplete

naive shell
#

It adds colors lol

winged badger
#

and finds references

#

fast

fleet raven
naive shell
#

Which is the correct way of adding a widget to every player ?

fleet raven
#

add how

naive shell
#

create widget node

fleet raven
#

do it locally on every client

naive shell
#

And where should i do it?

random oxide
#

depends the widget really

fleet raven
#

well in a place that makes sense for the thing you're doing

naive shell
#

Its a main menu

fleet raven
#

main menus are usually not opened in multiplayer

winged badger
#

you have a main menu level

naive shell
#

More than a main menu its a host / join one

winged badger
#

it opens main menu via GameInstance on BeginPlay

#

and players actually change the level when they start playing together

#

is how it usually goes

random oxide
#

is it possible to make the dedicated server start session automatically using BPs ? or I can do that only from c++ ?

naive shell
#

Im done with multiplayer lol

random oxide
#

single player is oldschool πŸ˜„

naive shell
#

But multiplayer was easier in the old ue4 versions now idk why its harder

random oxide
#

that's classic in every framework, but don't call it easier/harder, just call it different

copper mango
#

I don't think multiplayer was easier in the older ue4 versions

winged badger
#

starting with it was always an exercise in masochism

grand kestrel
#

UE4 multiplayer is the holy grail -__-

#

Just need to keep going until it clicks

naive shell
#

Gotta keep working on the weapon system

random oxide
#

everyone is making an FPS for some reason huh

naive shell
#

I never mentioned fps lol jk

random oxide
#

πŸ˜„

#

you got to show the shooting taking place on the client screen first and then tell the server to tell everyone about what happened

#

your bp logic was a bit weird

glad sedge
#

Tracking an actor across all clients - in my case, it's a soccer ball - should I store that reference inside GameState? or GameMode?

copper mango
#

what do you mean tracking it?

#

GameMode only exists on the server, so you don't want it in that

glad sedge
#

hmm

copper mango
#

but if the soccer ball is set to replicate, then every client will be able to see it already

#

what you could do is have the soccer ball register itself with the local game state on begin play, so then you have a globally accessible pointer to it if needed

glad sedge
#

Yeah, I think my architecture needs a rethink. So in my game, a ball is referenced for a few things. Like 'Get the player closest to the ball'. The ball also gets destroyed and respawned at various times.

copper mango
#

is "get the player closed to the ball" to decide who's like hitting it?

glad sedge
#

Ah right, so every local game has a reference to the ball - and it'd update on the server.

copper mango
#

that would be something you'd want to decide on the server, anyway

#

right

#

because server is authority

glad sedge
#

Yeah

#

Bit rusty on multi

#

I recall once your head is in the right place it's fine

copper mango
#

yeah, the starting point is basically the clients are all dumb and the server does everything

#

and then you layer in some predicted behavior on the client so the game still feels responsive if there's latency

glad sedge
#

I think I kept telling myself something like

#

"but how does the server know?"

#

and that helped a lot of the time with the whole owner / auth thing

naive shell
random oxide
#

πŸ˜ƒ you are getting there

naive shell
#

Thanks im currently doing some fixes cause it was bad before

random oxide
#

never worked on an fps, do you actually replicate bullets ? or you just calculate where the crosshair shoots ?

naive shell
#

I havent replicated anything at all

#

Thats what i want to do

random oxide
#

I see

#

one by one

naive shell
#

Step by step

#

Now ill replace the old weapon inventory

random oxide
#

it always takes time

naive shell
random oxide
#

you fixed the spawn ?

naive shell
#

The multiplayer one?

random oxide
#

yes

naive shell
#

I leave it for before i have to focus on game mechanics to

random oxide
#

I see

#

I start with the basic mechanics so that later I can enjoy making the visuals on top of a system that works

naive shell
#

true

karmic briar
#

hi anyone i wanna ask

#

anyone here have created instance manager?

#

im trying to build this for my mmo since its doesnt have an instance manager yet if i wanna do instance dungeon apartment switch between zone etc

#

anyone can help me

ember needle
#

When a player controller unpossesses pawn A and possess pawn B in a dedicated server environment, the original pawn A raises the following:
ProcessRemoteFunction: No owning connection for actor xxx. Function ServerMoveNoBase will not be processed.

#

all is good in a listen server environment.

#

any ideas?

steady tendon
#

Guys i have a Run on Owning Client event on the player controller that doesnt fire when the server calls it

#

Here you have an image

#

But the Remote branch in the SwitchHasAutority node executes properly

#

(I have just noticed that i have to remove the RunOnServer property of the SocialPlayer component, but thats not the problem)

steady tendon
#

SOLVED: i just needed to add delay node with 0.2 seconds because of the OnPostLogin event to be executed

#

I will change beginplay with a custom event to be called from there

dusty halo
#

Hello. Anyone making MP game with dedicated server and save System?

raw quarry
#

So my dedicated server is hosted in AWS GameLift, and it's been working for the past year. However, my most recent builds aren't working. When the client connects to it, they aren't spawned and possessed in a pawn.

#

The server logs show these errors at the very start of the file:

#

LogWindows: Failed to load 'aqProf.dll' (GetLastError=126)

LogWindows: File 'aqProf.dll' does not exist

LogWindows: Failed to load 'VSPerf140.dll' (GetLastError=126)

LogWindows: File 'VSPerf140.dll' does not exist

LogWindows: Failed to load 'VtuneApi.dll' (GetLastError=126)

LogWindows: File 'VtuneApi.dll' does not exist

LogWindows: Failed to load 'VtuneApi32e.dll' (GetLastError=126)

LogWindows: File 'VtuneApi32e.dll' does not exist

fleet raven
#

these errors don't matter

#

how long has the server been running? unreal servers break after ~2 days of uptime and must non-seamless travel or restart to fix it

raw quarry
#

this is on a new instance

fleet raven
#

anything interesting in the log on either side when the connect request happens?

raw quarry
#

i dont remember seeing anything, but I'll spin up another instance this afternoon and take a look

final swallow
#

hey guys, i'm having an issue with a Steam game session. I have a game session that has a maximum of 2 players, and when someone joins the session (with the creator of the session already in) and leaves, the session can no longer be found through normal FindSessions. it seems like the number of players isn't updated after the player leaves, and so the session never turns up in search results. is there something i need to do when the player logs out, in order to have the session public again for anyone to join? i'm already destroying the session when it happens

indigo coyote
#

ah here is the right room

#

any resources to learn turn based multiplayer in UE4? - something like chess

winged badger
#

@indigo coyote check pinned resources on this channel

indigo coyote
#

@winged badger where are you from... cz / sk?

#

just asking because of your nick name

winged badger
#

croatia

indigo coyote
#

ah ok

#

nice

#

thanks for the tip gonna browse the pinned ones

raw quarry
#

@fleet raven here is the full error log

#

there is a fatal error at the bottom, but it's a bit cryptic

#

it seems to occur when somebody logs in

fleet raven
#

well put the symbols in place so you see what the issue is

#

you need the pdb file in the binaries folder for it to dump a useful callstack

#

ofc you can't spawn if the server crashes

raw quarry
#

do you know of a good way to upload directly to my aws instance without having to reupload an entire new build?

#

if you're familiar with gamelift

#

maybe scp will work

fleet raven
#

I don't know, never used this service

jolly siren
#

Does anyone know how to get a smooth first person spectator experience? I've tried a lot of different cmc properties but none of them are helping.
For example NetworkSimulatedSmoothLocationTime

jolly siren
#

I set the spectators PC's view target to the character to spectate

#

SetViewTarget(FocusedCharacter.Get());

copper mango
#

It might help if you were to add some spring latency to the camera?

#

To hide it, because otherwise I don’t think it’s going to smooth it

#

The simulated proxy smoothing actually just smooths the mesh position of the character, the root position doesn’t get smoothed

#

You can see this by looking at how the capsule and mesh will diverge if you turn on show collision

jolly siren
#

@copper mango So there is no smoothing for the capsule? That explains why NetworkSimulatedSmoothLocationTime wasn't changing anything

#

I don't have a separate camera/spring arm or anything for the spectator right now. I just set the view target

#

By spring latency were you talking about a spring arm?

copper mango
#

right

#

add a spring arm to the spectator camera and give it a bit of latency, and that would hide the fact that the capsule isn't smoothing

jolly siren
#

okay awesome, I'll give that a go. Thank you for your help πŸ˜ƒ

copper mango
#

at least unless I was doing something wrong, I definitely noticed that the capsules just jumps on simulated proxies when a correction occurs, which is quite often

#

whereas the meshes will smooth over time

#

so I had a problem where my AI enemy widget component would jump around jarringly because it was attached to the capsule

#

and I changed it so that it was attached to the mesh and it fixed it

#

since the meshes were smoothing

jolly siren
#

right, that makes sense. I don't think I can use a component as a view target

copper mango
#

yeah

#

but the spring arm should make it seem smooth

twin minnow
#

currently trying to access the gamestate from the gamemode class but GetGameState is returning null, is there another way to access the game state from the gamemode class?

copper mango
#

are you on the server?

twin minnow
#

yes

copper mango
#

I usually just use

#

GetWorld()->GetGameState<AGameStateType>();

twin minnow
#

hmmm

#

I didn't specify the <...> part, let me try that

#

still didnt work 😦

copper mango
#

at what point are you trying to get the game state?

twin minnow
#

AGameState* GameState = Cast<AGameState>(GetWorld()->GetGameState<AGameStateBase>());

copper mango
#

is your game state an AGameState or an AGameStateBase?

#

you don't need to do the cast if you provide a template parameter to the GetGameState, it'll automatically do the cast for you

twin minnow
#

agamestatebase (the default)

copper mango
#

well then you can't cast it to an AGameState

#

because AGameState is a child class of AGameStateBase

#

isn't it?

#

yea

#

so if you want an AGameState instead of an AGameStateBase, you've got to change your game state class to AGameState

twin minnow
#

oh ic

#

lemme change everything to agamestatebase then

#

u sir

#

r a life savior

jolly siren
#

@copper mango How would you go about updating the spring arm to match the view rotation? My current setup doesn't have a separate camera component or spring arm. I'm just using SetViewTarget

copper mango
#

wouldn't it use the camera component on the spectator pawn?

#

or does it use the camera component on the actor that's the view target?

jolly siren
#

No I think the spectator pawn would only be for free cam

copper mango
#

ah

jolly siren
#

It would use the camera comp of the actor that's the view target. But ootb characters don't really use camera comps unless you create one

copper mango
#

so probably then your player character needs the spring arm/camera component on it, maybe you can disable it by default

#

and then if you spectate it enables it locally?

#

it wouldn't be replicating components so should work fine

#

assuming you can disable a camera component like that

jolly siren
#

yeah you can disable them

#

okay, yeah I think that is the correct setup

#

thank you

copper mango
#

sure, good luck

rotund sapphire
#

ive stuffed the camera system into the player controller probably a funny idea, but at least i no longer have hundreds of pawns running with cameras on their back for no reasons.

steady briar
#

the problem with fast moving projectiles in multiplayer is that it might go straight through something between collision checks right?

copper mango
#

I think the collision would do a sweep by default, so that shouldn’t be an issue

steady briar
#

hmm i thought it was just in general a bad thing to have fast moving projectiles. im not currently working on one but i was just thinking about it for later. was thinkin maybe a series of line traces and subtracting Z every bit of distance for drop

grand kestrel
#

We have real projectiles that move >100,000cm/s without any issue

winged badger
#

its continuous collision detection that does the sweep if enabled

random oxide
#

@fleet raven unreal servers break after 2 days and need restart ? omg this is ...

winged badger
#

its not just unreal

#

why do you think every game with persistent world has "daily maintenance"

random oxide
#

really ?

#

omg

winged badger
#

as time goes on, the float keeping track of it loses precision

#

and kaboom

random oxide
#

so the only solution is to write your own backend right

#

I am not used to restarting processes in general, for no reason so all this sounds very strange to me

#

only in case of updates

winged badger
#

well, i don't know of a game engine that doesn't have that issue

#

so you can trust that many people got annoyed by this in the past, and none of them solved it

random oxide
#

I know right, I've noticed those 6 hours maintenance they do which is rediculous

winged badger
#

6 hours is unusual

random oxide
#

black desert does that every week

spare glade
#

its more like 30 min or less for that sit

winged badger
#

something like EVE Online is common, if they don't push an update they are back up in 5 minutes

random oxide
#

not sure what they are doing ,... maybe defrag their win server lol

spare glade
#

unless ur updating

random oxide
#

ok this is not good

#

I mean for an mmo you really need your own backend otherwise this is not the way to go

spare glade
#

you will need a backend that keeps track of
player info
Store transactions
and Server List
those will be important

random oxide
#

these are easy

#

these will be done anyway

#

with external servers

#

I am talking about own coordinate system etc

winged badger
#

nope

#

unreal can do an MMO using middleware like SpatialOS

random oxide
#

I know that one but I wouldn't use middleware

#

I mean I can run Kubernates in this case as an alternative on my own machines and it would be free, but I don't like this idea either

winged badger
#

its not the same

random oxide
#

they are not but the end result may be what you want

winged badger
#

Spatial lets you split your... game instance between several dedicated servers

random oxide
#

this is exactly waht I have in the TODO list to write

winged badger
#

you either have a team of 100 then, or you are immortal πŸ˜›

random oxide
#

I think that is not a problem, here we got a huge problem now ... the "restart every 2 days" problem πŸ˜„

#

omg

winged badger
#

its not a huge problem, as all players are very much used to it

random oxide
#

maybe they are, I know what you mean

#

I am not !

#

πŸ˜„

spare glade
#

5 minutes of time every 48 hours isnt that bad tho πŸ€”

#

with server travel

random oxide
#

for me it is terrible

spare glade
#

then you have updates what are u gonna do then?

winged badger
#

if you have to do it every 2 days, better to do it daily

random oxide
#

5 minutes every week is terrible enough

winged badger
#

consistency

#

your players know you shut down every day at 11am their local time

#

they are fine with it

random oxide
#

I mean I reboot my machines every like 30 to 40 days and takes 60 seconds to be back online, and this is only due to core updates

winged badger
#

even make it a part of their strategy, some of them, as that typically respawns all NPCs

random oxide
#

no to me all this is wrong

#

I got to solve it

#

at least I am not making an mmo soon

spare glade
#

Also spatial OS solves alot of networking inside unreal, unreal i wouldnt say built out of the box is meant for a mmo
You need rep graph otherwise

random oxide
#

yes, one of the problems I got to solve is how to travel from one region server to the other, I got a plan, maybe unreal has something to help but I will see

#

but I would not go with spatialOS

#

if you can write those things why bother with 3rd party services

spare glade
#

because they took teams of people

random oxide
#

good for them and congratulations but

#

you know what I mean

#

Kubernetes is a grate solution for scaling, plus you got containers which you can restart at any moment and none will notice

#

BUT.... you get locked in a Google software

#

which this maybe running on your own machines and not google cloud, yo uare still locked inside making containers using docker and run it on Kubernetes

#

makes you need to run mysql inside there too,... makes all your system go with it

#

so is this problem affecting coordinats only ? or anything else ?

thin stratus
#

Why would anyone notice the restart of one Server?

#

The weekly updates and stuff of MMOs is usually hotfixing and balancing

#

You can easily start a new Server, move players over and restart the one in question

#

That's not an issue at all

#

and with systems like Spatial etc. player's wouldn't even notice

#

Also if you think you have the time and resource, feel free to code everything yourself, at best even the Engine

#

But if you are limited in resources and time, use middleware. Don't reinvent the wheel

random oxide
#

πŸ˜ƒ

thin stratus
#

I could easily code a backend like PlayFab or GameSparks, but it's a stupid idea given it would take a lot more time and money than just using what exists

random oxide
#

that is a choice

#

maybe someone has the time and money

thin stratus
#

I literally just said that

#

Also if you think you have the time and resource, feel free to code everything yourself, at best even the Engine

random oxide
#

1 solution is not the best for everyone

#

I mean you already sound like you would not agree with how I want my ssytems to work

thin stratus
#

Most people coming here, talking about making an MMO don't even know what Database to use.
That's when middleware is your best friend.

random oxide
#

which means that my solution would not be the right for you

thin stratus
#

I don't even know your system

#

I also never addressed it

random oxide
#

what most ppl do, I can say alot of things...

#

well I am not willing to use spatialOS anyway

thin stratus
#

That's all fine. Just if peeps here read this: It's totally fine to use it if you need to

random oxide
#

of course

thin stratus
#

And for the "Server's break after x hours" I don't quite get the problem.

random oxide
#

my choices are not advices

#

they are choices

#

why you got this so wrong ?

#

it is a problem, how can you not see it as one

thin stratus
#

Cause there are two setups where UE4 DedicatedServers are used:

Matchbased games, like UT, CSGO, Fortnite, etc.
And persistent games, like an MMO.

And Matchbased games, a Server never lives longer than a few hours at max.
Most CSGO Servers are scheduled to restart (if selfhosted) every night.

MMOs seamlessly move players across the Servers anyway. You go from outside into a town? Moves them into a Server or shard with Players for the town.
Even without loading screens. Either way, you can move players from Server to Server without them noticing, easily cleaning a Server and restarting it.

#

WoW even had a mod/plugin that let you ServerHop (not supported anymore), you didn't even notice you were moved despite creatures reloading

random oxide
#

movign players among server is not something I have tried yet, this may be a temporarily solution to the actual problem of needting to actually "restart (stop/start)" a process

#

but that doesn't make the need to restart a process not be a problem

thin stratus
#

Floating point issues exist for quite some time. This isn't related to Servers, you'd even need to restart your offline game from time to time.

#

You could probably just reset every single value that increments over time, but that is nearly the same as just restarting the server

#
  • you make sure you REALLY reset every value
#

So instead of trying to solve the floating issue, create something that properly refreshes servers

random oxide
#

resetting values is not the same as restarting a process

#

if that is a solution I take it

thin stratus
#

It's most likely not, cause a lot of things depend on these values

#

Internally of UE4

#

Even if it's just the gametime

random oxide
#

resetting values is fine

thin stratus
#

You can try to find all the values that increment over time and modify the engine to reset that

random oxide
#

why haven't the others thought about it and they restart the servers every day ?

thin stratus
#

Pretty sure that's pretty much impossible though

#

Cause it's just a random idea by me who probably forgets a big point in it

random oxide
#

alright I get the idea

thin stratus
#

I'm sure you know what floating point issues are

#

Even moving too far away from the world origin shows them

random oxide
#

32bit instead of 64

thin stratus
#

Generally things becoming less precise

random oxide
#

thus the 20k map size limit

thin stratus
#

Yeah and thus the World Origin Shifting UE4 has

#

That's just one example though

#

If you are unlucky it's lots of internal modules and plugins that depend on stuff that can't just be reset

#

Or even accessed (well without modifying large portions of the engine)

random oxide
#

that's for the mmo idea

thin stratus
#

At some point, cleaning a Server and restarting it is just way handier

random oxide
#

I paused this project to learn and solve the moving players from one server to the other seemlessly first

thin stratus
#

Yeah that's usually handled by having something else outside of the Servers maintain additional data

#

Like Position and State of the Player

random oxide
#

hm

thin stratus
#

If you move to a new Server inside of UE4, you usually have a scenario where you go through the full login process

#

With then spawning the Player at a Spawnpoint etc.

#

Like Unreal Tournament (always picture that when asking how UE4 DedicatedServers are intended to work)

#

So you gotta replace that with something outside

#

While still maintaining replication between Server and Client

random oxide
#

I am not sure if the engine itself using say "streaming volumes" can help on this, but I want to use regional servers... say 1 server each region

#

but the problem is when you cross this point you got to still be visible to the previous players

thin stratus
#

The Engine itself is very much focused on "You connect to a Server. You move Maps on the Server. You disconnect from the Server."

#

Not "You connect to a Backend. You get a Server assigned that you connect to. You stay connected to the Backend while the Server gets pulled away below your butt and replaced with something new."

#

Which is why a lot of people might even suggest not using UE4's DediServers at all

#

But that would also remove the whole replication system

random oxide
#

hm so it cannot jsut change server, it also needs to load map etc ?

thin stratus
#

The Seamless Travel of UE4 works like this:

  • Move Players to a very small map that loads as fast as possible.
  • Unload old map and load new map.
  • Once new map is loaded, move Players to new Map.
#

Which is usually either covered by Loading Screen or using teh Transition (small map) as some sort of Loading Area

#

That's a Travel on one and the same Server

random oxide
#

yeah the idea here is to avoid loading screens

thin stratus
#

Going from Server A to B is usually a hard connect

#

I wouldn't know where to start setting this up and I'm basically breathing the multiplayer part of ue4

#

I would most likely even didge dedi Servers

#

And look into stuff like SmartFox or well, Spatial (which does maintain replication of ue4 at least) and stuff

#

But yeah, you can do whatever

random oxide
#

3rd party solutions will always work one way or another

#

I void them when I can

#

others don't care and just go with them

thin stratus
#

Yeah I love creating my own solutions too and I would love to not use PlayFab for my client

#

But no resources available to let me create a backend

random oxide
#

damn

#

lol

thin stratus
#

Well I wish you good luck with this, I would suggest trying to get information on how SpatialOS works, maybe that pushes you into the right direction on how you can setup your own.

#

The HardTravel/Login stuff when moving to a Server is def the harder part to change in my eyes. Once you are on the Server and the Server has all information about you, it should just resume normal replication flow

random oxide
#

I do have a theory in my head but requires loading the whole world map on to a different server and from there move on

real yacht
#

i have created new Player State and set config in game mode to use that player state

#

player state is empty, only one var

#

when player open level (go to dedicated server)

#

i'm getting this error

#

LogNet: Warning: UActorChannel::ProcessBunch: SerializeNewActor failed to find/spawn actor. Actor: None, Channel: 11
LogNetPackageMap: Error: GetObjectFromNetGUID: Failed to resolve path. FullNetGUIDPath: [73]/Game/Blueprints/Game/PS_PlayerState
LogNetPackageMap: Warning: InternalLoadObject: Unable to resolve object from path. Path: /Game/Blueprints/Game/PS_PlayerState, Outer: NULL, NetGUID: 73
LogNetPackageMap: Error: GetObjectFromNetGUID: Outer is broken. FullNetGUIDPath: [73]/Game/Blueprints/Game/PS_PlayerState.[71]Default__PS_PlayerState_C
LogNetPackageMap: Warning: InternalLoadObject: Unable to resolve object from path. Path: Default__PS_PlayerState_C, Outer: NULL, NetGUID: 71
LogNetPackageMap: Warning: InternalLoadObject: Unable to resolve object. FullNetGUIDPath: [73]/Game/Blueprints/Game/PS_PlayerState.[71]Default__PS_PlayerState_C
LogNetPackageMap: Error: UPackageMapClient::SerializeNewActor. Unresolved Archetype GUID. Path: Default__PS_PlayerState_C, NetGUID: 71.
LogNetPackageMap: Error: UPackageMapClient::SerializeNewActor Unable to read Archetype for NetGUID 4 / 71

#

and btw. PS_PlayerState doesn't exists anymore, it's deleted and all references, i have new player state

thin stratus
#

native netserialize structproperty /Script/Engine.Actor:ReplicatedMovement (scriptstruct /Script/engine.RepMovement) failed
Anyone ever had this? Happens when the Character is moved from respawn point to lineup position

#

Only showed up in the Linux log, but it might also show up elsewhere

random oxide
#

@thin stratus never seen this in my linux logs

thin stratus
#

Yeah we are actively restarting the player and then setting loc and rot. And it doesn't seem to like that

random oxide
#

I do respawns but not what you are doing, maybe this is why I never seen it

#

by the way @thin stratus are you able to build linux dedicated server from a linux OS ? cause it was not working for me so I do it through windows

thin stratus
#

I only do it through windows

#

@random oxide

random oxide
#

yeah lol

thin stratus
#

Don#t even have UE4 on Linux

random oxide
#

I do ti works fine but cannot build dedicated server form it, they didn't make it possible

#

...yet

thin stratus
#

Even with a SourceBuild?

#

Crazy

random oxide
#

yes that is actually easier on linux

#

I mean if your graphic card is well supported by your distro you are good

#

but if you need a dedicated server build, you need windows to do that ... for now

#

I think same goes for mac

#

what you don't get on linux also is the epic launcher

thin stratus
#

Mac can only be build on mac or?

#

Also who the f builds a MacServer?

random oxide
#

I don't know I don't run macs

thin stratus
#

Me neither

random oxide
#

I mean if you wanna build a linux server from mac

#

you need windows πŸ˜„

thin stratus
#

Currently have just some ubuntu on my Alienware and the GPU isn't really working

#

But it's only for testing the dedi server

#

so don't care

random oxide
#

for dedicated server setup a headless debian and you are perfect

#

very stable

#

I personally always had problems with ubuntu server

thin stratus
#

It's gonna be Azure Linux Server in the end for this one. Just need some resource tracking and debugging on the laptop

#

Think they also run Ubuntu but not sure

random oxide
#

if you know ubuntu cli then it's the same on debian couse ubuntu is debian based

#

you will be remote anyway so you got to use cli

#

debian is no1 on their list I guess

#

(and centOS)

thin stratus
#

They are headless instances in the end though

random oxide
#

that's what you want

thin stratus
#

Nothing you want to access

random oxide
#

headless

thin stratus
#

It just runs if needed and shuts down if not

random oxide
#

it's server why have desktop environment

thin stratus
#

Yeah what I mean is, I won't even connect to it via console

#

It will auto setup and run when needed

random oxide
#

h you don't access it via ssh ?

thin stratus
#

If possible, no

random oxide
#

I see

thin stratus
#

Logs are accessible outside of it

#

(of the dediServer)

#

And that's basically it

random oxide
#

Azure control panel stuff it smells

thin stratus
#

Not my project

#

I just follow orders

#

I wouldn't touch anything with a DediServer requirement for my own stuff

random oxide
#

oh I love dedicated servers

thin stratus
#

Not the point. I know the scope of projects like these.
And being basically the only programmer on the project atm, I'm already annoyed

#

Not gonna do that to myself for company internal projects

#

ListenServer or offline it is

#

Anyway, on another note: What event could I hook into to clean up Widgets before traveling?

#

APlayerController::PreClientTravel seems to happen at a stage during SeamlessTravel at which the LocalPlayer is invalid

wary path
#

@thin stratus I had the same problem where to cleanup widgets. The solution I'm using is not great but the only one I found which worked in all cases. I use a widget on top of all other widgets during travel. Then after travel in begin play of the controllers I use "get all widgets with interface" to clean up all widgets.

thin stratus
#

Yeah I would love not working around the issue.

#

I did filter SeamlessTravel now and will see if that helps

#

Cause if the LocalPlayer isn't valid, it should also not have any Ui anymore

#

Cause that lives in it in my project

#

Thanks though

winged badger
#

@thin stratus i hooked on GameInstance's OnNotifyPreClientTravel

#

never had any problem with it

thin stratus
#

Are you accessing the LocalPlayer from there?

winged badger
#

no, but i did hook from the HUD

#

so i have everything i have to remove referenced in it

thin stratus
#

Yeah my Menus and Dialogs are in the LocalPlayer

#

Ah well, will null guard it now instead of checkf

thin stratus
#

(β•―Β°β–‘Β°οΌ‰β•―οΈ΅ ┻━┻

chrome bay
#

lol wtf

#

What a bug...

thin stratus
#

No idea how to get around that

#

Cause it literally crashes on a Particle Comp that sits on our pawn

#

Will try to remove all pawns before traveling tomorrow

jade gazelle
#

Is there any kind of relatively simple way to stress test a dedicated server and simulate a large number of user connections, without actually needing 50+ or however many connections?

#

Or is it kind of one of those things where you just need to do that testing in a real world scenario

remote pilot
#

hey guys I don't think I am in the correct section so sorry but I was wondering I was trying to work with a friend to create games in UE4 and I have no idea how I can work on it with us both on different computers anc accounts

#

and

meager spade
#

use a source control system

#

github can handle that or SVN or even perforce

jolly siren
#

Isn't SmoothClientPosition_Interpolate for capsule smoothing?
@copper mango said the following yesterday
The simulated proxy smoothing actually just smooths the mesh position of the character, the root position doesn’t get smoothed

#

I'm trying to get a smooth first person spectator experience. Right now I do
SetViewTarget(FocusedCharacter.Get());

To focus the spectator's PC on the character of the player to be spectated

But none of the smoothing properties on CMC seem to be changing anything. Such as NetworkSimulatedSmoothLocationTime

copper mango
#

Hmm but if you look at the client correct function it seems like it only smooths the mesh position

#

And that’s what I’ve observed

#

Not gonna be at a computer so a while so I can’t point out the function I was talking about

frigid gyro
#

Do save games save to the client by default?

#

if so how do i get the save game to only save to the server

winged badger
#

you call whatever function saves the game on the server side?

#

games don't save by default

chrome bay
#

Yeah Mesh position is the only thing that gets smoothed, you want to make sure the camera is attached to the mesh

copper grove
#

curious as to how do you guys push builds to multiple computers, i find it to be such an elongated process, even using a shared drive

#

testing mutliplayer in ue4 editor with various windows just isnt the same as well

#

would be cool if we could push a standalone build to another computer (from the editor)

fleet raven
#

I think there is a way to do this using the unreal frontend tool?

#

it can list like multiple computers to launch builds on

thin stratus
#

If they all have UE4 installed, maybe

#

I can see the logs live of the other PCs in the office

#

But it fails when trying to just deploy a build to a different pc for me

#

"fails" in terms of not possible

fleet raven
#

I read that there is some small service you have to install on the pc for it to show up there

#

but never used this feature

copper grove
#

ill look into that thanks

jolly siren
#

@chrome bay okay, I don't have a separate camera component/spring arm setup right now. I just set the view target to the character actor. Since it expects an actor and not a component.

chrome bay
#

I might be wrong but if the view target has a camera component it'll use that to look through I think

jolly siren
#

ahh okay, I don't use a camera component for first person. I use the ootb setup with camera manager

#

But that might be true. I guess I should add one for spectator only

chrome bay
#

Oh if not, you can override GetActorEyesViewPoint and set CameraStyle to FirstPerson in the cam manager

#

(APlayerCameraManager::UpdateViewTarget)

jolly siren
#

So I should return the third person's meshes location inGetActorEyesViewPoint ?

nova isle
twin minnow
#

has anyone come across this log message before?
LogNetPackageMap:Warning: UPackageMapClient::InternalLoadObject: Unable to resolve default guid from client: PathName: BP_WoodRamp_C_2554, ObjOuter: /Game/Maps/Level_BattleRoyale_2.Level_BattleRoyale_2:PersistentLevel

#

i'm not sure what it means, but when too many of these log messages appear the buffer overflows which leads to a server crash

worthy perch
#

Maybe sending a pointer to an object that doesn't replicate through an RPC?

twin minnow
#

oh

#

that's a good thought im gonna take a look at that

twin minnow
#

hmmm

#

i don't seem to be passing any pointers to any server rpcs

#

such a vague error 😦

fleet raven
#

could try throwing a breakpoint in there in a debug server build and explore what the context is

mossy hearth
#

@thin stratus Any special reason why you put your Menus and Dialogs in the Local Player?

spring swift
#

so I'm pretty sure my problem is simple but I'm having a weird problem. when i spawn a player anywhere, it spawns in 2 Pawns and i posses 1 of them... I've changed the default pawn to none and I've made a spawn system in the player instance. when a player spawns in it spawns 2 pawns, and u only use 1 so idk what's happening here 😦

winged badger
#

@twin minnow any subobjects created at runtime there?

thin stratus
#

@mossy hearth Found that to be a good place for me

winged badger
#

did you try hooking into GI->OnNotifyPreClientTravel directly from LocalPlayer @thin stratus ?

thin stratus
#

No, I only have PreClientTravel in the PC atm

#

If the GI calls that the same frame, then the LP is invalid anyway

#

Ha

#

The PreClientTravel of the PC calls the GameInstance function

#

So we can forget about that :P

#

@winged badger

winged badger
#

is the local player invalid, or is the reference from PC to LocalPlayer cleared?

thin stratus
#

But it's fine. I just removed the checkf and kept the nullguard.
The Menus are being removed and when the LP isn't valid, the ref to the Widgets dies off anyway

winged badger
#

i find second scenario more likely

thin stratus
#

Could be, I can try to hook it up directly via the delegate if I have some time today

#

Kinda weird that the PC calls the GI function

#

Specially since it's not guard by IsPrimaryPlayer

#

is this called 4 times in splitscreen? o.o

winged badger
#

LocalPlayer shouldn't be destroyed iirc

#

well, not the primary one anyways

thin stratus
#

What exactly is the TravelType? I have to admit I never had to use it and never questioned it

#

But SeamlessTravel requires TRAVEL_Relative

#

Think the other one is TRAVEL_Absolut

#

The Enum Comments aren't helping much either

#

TRAVEL_Absolut is the Absolut URL to a (new?) Server.
TRAVEL_Partial keeps the name and resets the server (what?)
TRAVEL_Relative is a Relative URL to an existing Server we are on I assume.

bitter oriole
#

Relative = same server, basically

#

Partial = no fucking clue

#

Absolute = full URL

#

It's basically a clue on how to unformat the URL, AFAIK

#

As in, if you say absolute with no IP as a remote client, it's probably going to travel to a local game

thin stratus
#

I think, TRAVEL_Partial keeps the Data that is passed when traveling (Options etc.) but uses them for a new Server or?

#

It's barely used even in the engine

bitter oriole
#

Really no idea about what partial does

winged badger
#

im guessing partial is convenience syntax for hard travel on same server

thin stratus
#

GameInstance uses it when it starts up

#

But no proper comments

gleaming niche
#

relative just copies from whatever it was before, instead of replacing port, rotocol, host, etc afaik

#

partial takes the base options, but doesnt keep the other stuff that relative does

thin stratus
#

Hm

#

So it's just a convenient way of keeping data but resetting the rest?

gleaming niche
#

i -think- so, it's kinda confusing

#

i believe partial will take all the options that were used before, but reset th e connection?

#

the only thing i know for sure is that seamless requires relative, anything other than relative and it's not seamless

#

lol

#

and that absolute is.. absolute, taking full address, and liek a whole new connection period

#

so i guess partial is like an absolute, but without resetting previous options? blah

empty axle
#

Hello, does someone know how to fix multiplayer disconnects like this:
LogNet: UChannel::ReceivedSequencedBunch: Bunch.bClose == true. ChIndex == 0. Calling ConditionalCleanUp.
I can see that UNetConnection::Close() is called from receiving bunches, but why one of them have bClose set to true is unknown to me.
The reason for disconnect in GameEngine is lost connection to host. Maybe you know how to better track this problem?
Dunno where to attach to debug it more precisely. Everything is happening in cooked versions, not in editor and it is happening in between 0 to 30 seconds from client joining.
Also strange is that sometimes like 1 on 30 tries the client won't get disconnected at all.

thin stratus
#

Does the Client show any errors in log?

#

You always have Server and Client log that you gotta check

#

Sometimes the client just crashed or similar

empty axle
#

Ok i will check them

thin stratus
#

I tried to go over all pawns and destroy them on PreClientTravel

#

But it's not solving it. Even though it's called before the crash happens, it still reports the HoverParticle (probably only spawned and autoActive particle) on a pawn

#

I assume it's still in the memory

#

how does one force garbage collection again?

#

Ah via UWorld

#

nvm, not even forcing garbage collection fixes this. my goodness

manic pine
#

ive an unreliable server rpc and a reliable server rpc... im calling the unreliable rpc first, then the reliable one, but the reliable rpc is still reaching the server first

#

can i flush the unreliable rpc somehow so its sent before the reliable one?

thin stratus
#

You can't make sure two RPCs reach in order

#

At least not afaik

#

two reliable ones maybe

#

But even that could be f*cked if the first one drops and has to be resend

manic pine
#

i know reliable rpcs are supposed to arrive in order(within some limit)

#

but i dont really need a guarantee, just something thats true 99% of the time

#

given no packet loss

thin stratus
#

Combine them into one RPC

manic pine
#

the problem here seems to be that the replication is storing the unreliable rpc for later sending

#

but immediately sending the reliable one

#

yeah not really an option as they are both engine rpcs

#

i could make a reliable wrapper for the unreliable one but... thats ugly, and could actually cause problems

thin stratus
#

If you are relying on two RPCs coming in in order (based on the engine) you might want to rethink the setup

manic pine
#

like i said, there doesnt have to be a guarantee, just that it generally happens...

#

its essentially about flushing pending moves

#

before an ability predictively changes some move data

#

its this or disable move combining/delaying, which would be terrible for bandwidth

#

so i need to tell the net driver to 'send any rpcs stored now'

winged badger
#

@thin stratus you crashing on the travel map?

thin stratus
#

Idk which map

#

Doesn't make a big difference as it's engine related

#

@winged badger

#

@manic pine ForceNetUpdate maybe?

#

I use this at least for Rep/RepNotify variables

manic pine
#

yeah, i tried forcenetupdate, flushnetdormancy, connection->flushnet

#

alas no joy...

#

maybe its actually happening server side, with the server processing reliable packets first

twin minnow
#

@winged badger yes I do use spawnactor in server rpcs occassionally

#

@fleet raven for some reason I can't recreate the issue locally

#

actually locally i was able to recreate my mistake

#

but now the log message is longer locally as opposed to when I ran the game on gamelift

:884][469]LogNetPackageMap: Warning: UPackageMapClient::InternalLoadObject: Unable to resolve default guid from client: PathName: BP_WoodFloor_C_278, ObjOuter: /Game/Maps/UEDPIE_1_Level_BattleRoyale_2.Level_BattleRoyale_2:PersistentLevel 
[2019.07.02-11.52.16:908][469]LogNetPlayerMovement: Warning: ClientAdjustPosition_Implementation could not resolve the new relative movement base actor, ignoring server correction!
fleet raven
#

oh

#

now we know what caused it at least

#

didn't you say that first message printed on the server

#

because that second one is a client sided error

twin minnow
#

yes

fleet raven
#

are you creating and destroying instances of this BP_WoodFloor at runtime? or are those all static

twin minnow
#

i am creating and destroying instances

fleet raven
#

so it could just be that it was referencing an instance that has been destroyed

#

theoretically that should be harmless and not crash your server

twin minnow
#

hmmm

fleet raven
#

what's the callstack for the crash

#

maybe it's totally unrelated

twin minnow
#

so far i haven't been able to crash my server with small games (3-4 players) but I remember when playing with more players the game would occasionally crash and I thought maybe this would be a possible pinpoint

#

so i will test with more people tonight and let u know, I could just be overreacting

#

thank u though

#

testing multiplayer is both interesting and mysterious

fleet raven
#

it's very difficult to test how a server handles many players because how am I supposed to run like 50 clients

#

...ones that do more than connect and then idle

twin minnow
#

very true

#

luckily i have some very nice friends πŸ˜‚

fleet raven
#

I wonder if they finished insights for 4.23

#

that should make profiling the server much nicer

twin minnow
#

oooooo

#

insights would be amazing!

fleet raven
#

I don't know what their plans with it are but from what I understand it's a new profiling backend and frontend and will replace that thing in the session frontend

red sand
#

@thin stratus

void APrometheonTeamState::AddPlayerToTeam(AController* Player)
{
    APrometheonPlayerState* PrometheonPlayerState = Cast<APrometheonPlayerState>(Player->PlayerState);
    if (PrometheonPlayerState)
    {
        if (PrometheonPlayerState->GetTeamState())
        {
            // In case the PlayerState still has a team assigned
            PrometheonPlayerState->GetTeamState()->RemovePlayerFromTeam(Player);
        }

        PrometheonPlayerState->SetTeamState(this);
        TeamPlayers.Add(Player);
        TeamPlayerStates.Add(PrometheonPlayerState);

        // Filter bots so we can get them easily later
        if (PrometheonPlayerState->bIsABot)
        {
            TeamBotPlayers.Add(Player);
        }
    }
}

Last time when you explained me this stuff
I forgot to ask, once the player is added to team, how do I differentiate players and their teams
Since there is only 1 array

thin stratus
#

I don't quite get the question

red sand
#

I mean, they are added to array when you call AddPlayerToTeam function on Post Login
But which team is the player in, how do I know that?

thin stratus
#

PrometheonPlayerState->SetTeamState(this);

#

?

#

a team should have a TeamNum

#

uint8

#

where 255 is FFA

#

And 0, 1, 2 etc. are teams

#

Then you simply add a TeamInterface to all actors that should return a team number

#

And in your GameState you can make a simple function like this:

bool AHLGameState::OnSameTeam(const AActor* First, const AActor* Second) const
{
    const IHLTeamInterface* TeamInterface1 = Cast<IHLTeamInterface>(First);
    const IHLTeamInterface* TeamInterface2 = Cast<IHLTeamInterface>(Second);
    if (TeamInterface1 == nullptr || TeamInterface2 == nullptr)
    {
        return false;
    }
    else if (TeamInterface1->IsFriendlyToAllTeams() || TeamInterface2->IsFriendlyToAllTeams())
    {
        return true;
    }
    else
    {
        uint8 TeamIndex1 = TeamInterface1->Execute_GetTeamNum(First);
        uint8 TeamIndex2 = TeamInterface2->Execute_GetTeamNum(Second);

        if (TeamIndex1 == 255 || TeamIndex2 == 255)
        {
            return false;
        }
        else
        {
            return TeamIndex1 == TeamIndex2;
        }
    }

    return false;
}
#

@red sand

#

Might want to use "Implements" though instead of the cast

#

Cause that cast fails for BP classes iirc

#

Or at least something like that

meager spade
#

you should really just be querying playerstate for all player<>player stuff, regardless if its server asking

crimson fiber
#

how to reset FBlueprintSessionResult?

thin stratus
#

@meager spade What?

#

@crimson fiber What exactly is your goal?

crimson fiber
#

playing around with advanced sessions, seems like Session.IsValid is not reliable test because you can't reset the structure

thin stratus
#

What is "Session" here? (type)

crimson fiber
#

FBlueprintSessionResult

thin stratus
#

Didn't know that had an IsValid function

#

It's just a brainless wrapper for the FOnlineSessionSearchResult struct

crimson fiber
#

looking further looks like FOnlineSession has no way to reinit as well

thin stratus
#

Why would it though?

#

It's mainly filled with data from the SessionSearch

crimson fiber
#

is valid is useless then πŸ˜„

#

no way to reset sessionsearch

#

no point to test it

thin stratus
#

No, you either try joining or refresh

crimson fiber
#

my man I went too far deep from this noob shit πŸ˜ƒ

#

trying to get up to date data from found session without beacons

#

like player list and so

thin stratus
#

SessionResults don't have any connection to the Server in the first place

#

They are just collected data from the MasterServer

#

Refreshing them is generally not a thing afaik

crimson fiber
#

but you can update list, find one with saved ID and get updated data

thin stratus
#

You might be able to use the SessionOwner data to query that specific session again from the MasterSErver

#

But idk if that's a thing with the AdvSessionPlugin

crimson fiber
#

what is master server?

thin stratus
#

Whatever gives you the Session Results

crimson fiber
#

hm I wonder how it works in null

thin stratus
#

In null it literally spams the whole LAN with

#

"HEY I WANT A SERVER"

#

And if someone is hosting they answer

#

But again, it only gives you the current state. Most people just refresh the serverList to get uptodate data

crimson fiber
#

yeah that's what I do at the moment

thin stratus
#

I do know, with a given backend (e.g. Steam) you can query a session based on the UniqueNetId

#

e.g. your friends session

#

Or any other as long as you have that id

#

so you can refresh a single session i guess

#

But no idea if that works with LAN

crimson fiber
#

could be a thing in any OSS

thin stratus
#

And no idea if that works with AdvancedSessionPlugin

#

As long as they implement it, yes

#

If the OSS doesn't support querying a single id, then no

#
  • sometimes the Interface is so crappy that you have to use the SDK directly
#

Had to do that for Oculus

#

Also I doubt it's really worth the trouble, cause you can do the same with just refreshing the whole list

crimson fiber
#

for sure unless we move to the multiple servers state I'm ok with mega updates

thin stratus
#

You would make sure to only query a handful anyway

#

Paging is a thing

crimson fiber
#

what's that?

thin stratus
#

It's making sure that you only query the first page of results

#

And not all 100k

crimson fiber
#

lol true πŸ˜„

thin stratus
#

Cause you literally don't care what is on page 2 until you click it :D

crimson fiber
#

well there is a FOnlineSessionSettings.BuildUniqueId after all

#

my guess it allows you to filter everything out even for 480 steam

ebon bramble
#

Wow everyone said multiplayer sprinting was super hard to do in unreal and you need crazy c++ mods to the player controller... But I just did it in blueprints and it wasn't hard at all . There isn't even any jerkiness. Literally just change the walk speed on the client at the same time you send the packet to the server that will change your wakspeed on the server and it's smooth as silk. (Client side prediction)

#

Smooth with 700ms roundtrip lag using Clumsy simulator

#

I think it's because it uses accumulated error to determine when to snap back and there is minimal accum error since both cli and Serv are sprinting for the exact same amount of time, just with a phase offset

#

\o/

twin juniper
#

hey... i need to make a multiplayer game from the puzzle template but i cant find any tutorials on this
i have read a document about multiplayer pinned here but i am new to unreal and new to multiplayer
can anyone help me with the 1st steps, please ?
a multiplayer chess game
in C++

ebon bramble
#

I'd say check out the multiplayer game example, it's included w ue4 . It's like a cowboy shooter

#

I'd also recommend that you build in blueprints first then convert some classes to c as needed

#

But that's just me

twin juniper
#

i preffer c++

#

the thing is in puzzle template there is no player controller

bitter oriole
#

C++ is a terrible way to learn UE4

ebon bramble
#

Most multiplayer games uses dedicated servers, check out the Dedicated Server Guide on the unreal wiki .. Google for that

bitter oriole
#

^ not really

twin juniper
#

@bitter oriole i have no problems with c++

ebon bramble
#

You'll end up booting up a dedicated server and then using 'open 127.0.0.1' on a client to join

#

Then use OnPostLogin to spawn a possessed pawn for the client

bitter oriole
#

That's not the point @twin juniper - you still need to learn UE4 and C++ is a terriblr way of doing it

#

There's no doc on C++

#

Learn with Blueprints, move on to C++ when you need it

twin juniper
#

i see

#

yea there is also more tutorials for blueprints

ebon bramble
#

If you want to do it in total c++ nobody can help you tbh lol

#

You'll have to be an unreal wizard

bitter oriole
#

As to dedicated servers they're only useful for real-time competitive games @ebon bramble - for a chess game it's completely pointless

ebon bramble
#

Well then will you have listen servers?

bitter oriole
#

Yes

#

You need neither performance, nor anti-cheating

ebon bramble
#

For a listen server I think all you gotta do is run the command: open levelname?listen

#

On the first client (listen server)

#

Then on the other: open 127.0.0.1

bitter oriole
#

... Yes ?

twin juniper
#

i will make dedicated servers for sure

#

coz of the future games

bitter oriole
#

There's literally no point

#

Dedicated is way, way, way harder

ebon bramble
#

It's not THAT much harder lol

twin juniper
#

this is so small game so i want to learn it

bitter oriole
#

it is really harder

#

You need to build from source to start with

ebon bramble
#

It will take another 50 hours to really do dedicated servers .. probably

twin juniper
#

thats fine

ebon bramble
#

But that includes packaging and throwing on a cloud server too so

#

It isn't horrible

bitter oriole
#

It's pointless, expensive, painful and time-consuming

twin juniper
#

great πŸ˜„

bitter oriole
#

But hey, whatever makes you happy

twin juniper
#

its for the knowledge ... i want that in future

#

anyway

#

in the puzzle template i cant find a player controller

#

so im confused about the multiplayer

#

isnt it like input stuff?

bitter oriole
#

No ?

#

It's about netcode

#

Multiplayer basically means every feature of your game needs a server version, a client version and lots of code to smooth it out

#

I usually suggest it results in 3x more code

twin juniper
#

ye

#

so what handles input

bitter oriole
#

Input is unrelated to multiplayer

twin juniper
#

im talking about the puzzle template

bitter oriole
#

Have you tried looking for "input" in the code ?

#

That might help

twin juniper
#

just lookin πŸ˜„

#

i guess i will have to create a player controller

frank portal
#

@ebon bramble yea what you use will work for low latency, but its def. not a proper way to do sprinting/other movement and the server will correct the client whenever the difference become too big. Especially for jumping it will be really bad and you will def. notice it.

bitter oriole
#

Seriously did you ?

#

PC is not your default input path

ebon bramble
#

@frank portal yeah but I tested with 700ms round trip and it's fine 😐 same w jumping. There is no rubber banding. I bet I can improve it too by delaying the client side prediction of the walkspeed in Ms by the client ping. So if the ping is 300ms, delay the client side predictive movespeed change by 300ms so the client and server simulations are both changing movespeed at very very close to the same time (as if the client side prediction has that same latency) . Hacky but works great . And in blueprints

#

I'm sure it won't be AAA quality tho for some weird circumstances

frank portal
#

you probably dont change the walkspeed a lot for sprinting, but yea its a really hacky solution which also shootergame uses and the server will def. correct you at some point ... yea you can delay it, but then you will press sprint and dont get a instant respond (ofc for a indie game its fine or for prototyping, but it isnt that hard to add sprinting in cpp)

twin juniper
#

ok i got something running

#

time to start messing with it

ebon bramble
#

@frank portal how can I learn about adding sprinting w c++

#

Oh NVM there are YouTube tutorials up the wazoo

#

Good ol YouTube

frank portal
#

yea there should also be a good forum somewhere, but cant remember if it handles sprinting (but it will help you to understand the fsavedmoves etc ^^)

pallid token
#

I'm getting this log warning when I'm trying to join a LAN session on the local IP address. However, I am able to join using the loopback address. It doesn't join the session, just goes black. Warning: OSS: Session (My Session Game) already exists, can't join twice

twilit swift
#

Hey All, I'm trying to set up voice chat with a dedicated server on gamelift. I used to have things set up for steam and my voice chat worked. When I switched over to GameLift, I started connecting to an IP rather than using create/join session nodes. I've now read on answerhub that Voice Chat only works if I'm using the session interface. my questions are:

Is there no "Session" when I connect via IP with gamelift? Doesn't there need to be an online session for players to connect to?
Anyone dealt with this sort of thing before?

twilit swift
#

Anyone successfully implement Voice Chat using OnlineSubsystemNull?

jade gazelle
#

Is there a way to keep a client’s pawn, controller, etc. temporarily alive after the client disconnects? I’m trying to synchronize some data to my database when a client disconnects but by the time game mode -> logout is called the pawn has already been destroyed

#

Additionally I kind of want a way to keep them in game w/o a controller for 15-30 seconds as a way to avoid disconnecting as a means of not dying.

winged badger
#

you can probably hijack the inactive player state

#

add a hard ref to the pawn, and override whatever function is destroying it

#

same goes for the controller

jade gazelle
#

Will take a look at that, thanks

winged badger
#

you will still have to manually swap controllers on reconnect

#

look at HandleSeamlessTravelPlayer for inspiration

jade gazelle
#

Well the way it is set up right now is that the server will reject any players that are already deemed β€œonline” by the database. It’s fine for my purposes to just delete the existing controller once 15 seconds or whatever have elapsed and then have them use a new one when they reconnect

#

All relevant and necessary data is queried from the database anytime a connection is made so I don’t need to worry about transferring data from old controller to new one

winged badger
#

the playerstate persists by default

#

just goes to inactive array

jolly siren
#

How do I get the location that the ootb "no camera" system uses when I do SetViewTarget? I'm trying to set my real camera component to that location

#

Without hardcoding the value

#

i.e. I'm trying to get the eye/camera location of a simulated proxy character

winged badger
#

maybe GetPlayerViewPoint

#

its replicated to some extent, on the PC

#

not sure if that includes SImulated Proxies

#

never actually used it myself

#

there are functions that grab the POV from the eyes as well, i think?

jolly siren
#

yeah that's what I've been trying to use GetPlayerViewPoint. I'm just trying to get the z value so I can set my camera there

rotund sapphire
#

Or, just put a socket on your mesh and call it a camera socket

cedar finch
#

So I was wondering if you can now access access session info and get a custom server name using blueprint? About a year ago I was told it wasn't possible in blueprint alone. Has their been any improvements? Right now I have it where the host of the server can enter a custom server name and everyone can see the name once in the game but I wish I could allow players to access that name before joining the session. I know I can use the "Advanced Session Plugin" but I was trying to made a game with no c++ and no plug-ins.

thin stratus
#

Nope

#

The exposed nodes are still as limited as they were a year ago

plush pendant
#

I'm not currently join on the Deckate server. Can you tell me why? I'm working on a project with examples of shooter games.

empty axle
#

Hello, maybe do you have problems with this:
UPackageMapClient::SerializeNewActor Unable to read Archetype for NetGUID ? After that my client is getting disconnected from the server, any idea?

fossil veldt
#

Hey guys, I have a quick question about listen servers and ue4. Afaik the process for starting a listen server in UE4 is to use the command open *map*?listen However this forces a hard reload of the map. So this got me wondering if there's a way that UE4 can start a listen server without reloading the map?

bitter oriole
#

IIRC no

fleet raven
#

theoretically yes (you could manually spawn a net driver and fix all the actors who did things assuming standalone) but that's not a normal thing to do

fossil veldt
#

Well my problem is that I would like to use a listen server for my game but when the host disconnects I have to do a host migration and this usually causes a hitch in the gamestate for a few seconds

#

So I was planning to have a "co-host" start running a dormant listen server that keeps a track of the gamestate

#

so if the client DCs then it can just move the clients to the new server

fleet raven
#

host migration is much more involved than that, what about all the data that wasn't replicated or actors that were out of scope for the client supposed to take over?

fossil veldt
#

Well I guess you would have the RTT in packets lost but apart from that wouldn't my solution work?

#

What else would you have to do to combat that issue other than what I said?

fleet raven
#

you're planning to have clients rejoin to the new host right? as in, they'll reload the map and join that new instance of the game

fossil veldt
#

No, I was hoping to somewhat be able to drop the current host and just start receiving packets from a new listen server

#

So I guess you would still have to wait for a handshake and there may be some discrepancies between the client and server gamestate

fleet raven
#

doing it completely live would be... hard... because the new server won't have your replication state and the netguids won't match

#

it'd replicate a second copy of the players and player states and everything else to you

fossil veldt
#

yeah that's what I meant

#

So the whole gamestate would be sent to the co-host

#

like quake does almost

#

so that they have the entire copy of the gamestate from before the RTT

fleet raven
#

no I mean, your client will become extremely confused with multiple copies of game objects existing when you try to change which server it is connected to without reloading the map

fossil veldt
#

Ahhh I understand

fleet raven
#

I would go as far as saying unreals networking was not designed for host migration and you're better off not trying to make some haxx

fossil veldt
#

Hmmm, yeah I've been thinking this

#

I was considering maybe RakNet is the way to go

fleet raven
#

having the new server and the clients reload the map would be one way of ensuring it is at least working

fossil veldt
#

Yeah, I could get a host migration to work like that quite easily I think but then people join and leave games all the time and I think if hosts are consistently leaving and having to migrate it might get a bit annoying

#

Am wondering how Call of Duty tackled this as host migration seemed rare

fleet raven
#

br_big_brain : when you start a match it starts a dedicated server on your machine behind the scenes and when you exit the match it keeps running

fossil veldt
#

Oh shit lol

#

Is that actually how they do it?

#

That's an amazing idea

#

why didn't I think of that

#

Ahhhh that's such a good idea

#

And then it just runs in background until the match finishes I guess

#

and then the game can do a reload

#

and switch to a new host

thin stratus
#

@fleet raven Can you not put like a "Kappa" or so behind the text? :D

fleet raven
#

I mean br_big_brain usually implies it is nonsense

thin stratus
#

Not for everyone it seems

#

Or it was double sarcasm :O

fossil veldt
#

Yeah sorry I am networking noob

#

Am just retard it seems

fleet raven
#

that said this could actually work πŸ€”

thin stratus
#

Yeah and could actually put you into the situation where people are really not happy

fossil veldt
#

I mean I figured the only downside would be client performance and latency

thin stratus
#
  • if the PC shuts down the server is off anyway
#

Dude, if you play a game

#

And you want to stop

fossil veldt
#

Yeah if you do an alt f4 then it would have to do a hard migration

thin stratus
#

And the server just keeps playing taking your resources

#

You'd not be happy

fleet raven
thin stratus
#

Imagine someone with limited internet :D

fossil veldt
#

Oh I was thinking of it as in if somebody leaves without closing the game

#

Not to actually keep it going in the background of the PC if the games closed

#

If the game closes then you would do a hard migration

fleet raven
#

nah it's an extremely stupid idea anyway

#

imagine someone with a slow pc doing that and then it lags their client

fossil veldt
#

Yeah but that person would have been the host of the game anyway?

thin stratus
#

Tomorrows News: "UE4 used as a bot net to host DedicatedServers on Client PCs."

fleet raven
#

not if it keeps running after they leave

thin stratus
#

:br_big_brain: Find out what clients have static ips and highest uptime. Use these to host DedicatedServer for other players to save hosting costs.

#

Who needs Amazon Servers kappa

fleet raven
#

this actually works if the clients like the game and are aware of the option

#

people make player hosted dedicated servers on vpses and stuff all the time

thin stratus
#

True, but it's too risky in terms of availability

#

For stuff like ranked games

fleet raven
#

that's true

fossil veldt
#

hmmm

#

Well what would you say the best real solution to this problem is then?

#

Just not use UE4 networking and go with something like Raknet P2P instead?

thin stratus
#

If you really need Host Migration, yeah you might need to go with something else than UE4's networking

#

But that is easier said than done

#

I would just build a game that doesn't require host migration

fossil veldt
#

I'm leaning towards doing Zeblotes big brain idea right now

fleet raven
#

please don't actually do that

fossil veldt
#

but it's a good ideaaaaaaaaaaa

thin stratus
#

It's not :<

fossil veldt
#

Ima look into manually spawning a net driver as a backup host, Ty for the help and advice guys πŸ˜ƒ

gloomy sedge
#

Hey, i'm trying to replicate a Countdown timer for my shooting game, I have the timer working, but it cannot get it to replicate on all machines. I currently have it set up as so;

#

The Event 'StartDownDownTimer' is called from the playercharacter currently for testing purposes

thin stratus
#

Is that in a GameMode?

gloomy sedge
#

Yep

thin stratus
#

GameModes can't have RPCs

#

...

#

Please don't tell me you watched the Lobby Tutorial from Epic Games Youtube channel

gloomy sedge
#

probs not

thin stratus
#

Either way, it's not supported cause the GameMode doesn't exist on clients

#

You can't call a ServerRPC in it

#

And what is "MainScoreBoard"?

gloomy sedge
#

Okay, so in which class shall i store the variables and events for the countdown?

thin stratus
#

The usual approachis to have the Timer run in the GameState

#

on the Server only

#

Or to have a timer on everyone in the GameState and the Server replicates the timeRemaining every 10 seconds via OnRep to keep things in sync

gloomy sedge
#

Okay, so i tried creating a new gamestate and setting it in the Gamemode, and when i click play, no player or ui spawns

thin stratus
#

That's something you gotta figure out. I have 0 idea what you are doing in general

#

Also if the naming isn't wrong, "MainScoreboard" is a widget or?

gloomy sedge
thin stratus
#

Yeah you can't pass them via RPCs either

#

They only exist locally

gloomy sedge
#

ahh okay, thats why i was getting an error ealier

thin stratus
#

The base idea is:

#

In GameState on BeginPlay: Start a Timer for everyone locally (including Server) that loops every second.
Have a "RemainingTime" variable that gets reduced by 1 every time that timer calls, until it's 0.
Have a "ReplicatedRemainingTime" variable that is set to RepNotify.
In the RepNotify function, set the RemainingTime with the ReplicatedRemainingTime value (that's for keeping stuff in sync).
The Server (check with SwitchHasAuthority) in addition to reducing the RemainingTime Variable in the Looping Timer Function, sets the ReplicatedRemainingTime Variable every time this here is true:

"RemainingTime % 10 == 9"

#

That makes sure that every time the Timer hits something with a 9 in it (29, 19, 9) it sets the Replicated variable on the Server, which causes it to call the OnRep function and keeps clients in sync

#

In the UI, your scoreboard, you get the GameState, get the RemainingTime and use that to display stuff

#

Both RemainingTime variables can be an integer