#multiplayer

1 messages Β· Page 465 of 1

winged badger
#

i remember seeing the introduction post

karmic briar
#

rn my options from people suggesting me is spatialOS

split gust
#

from what I see, SpatialOS is a middleware + server hosting allowing you to stich together multiple servers and doing player migration between them

manic pine
#

any of these bigger titles actually use spatialos?

winged badger
#

it is fairly new, so i don't imagine many games using it are published yet

karmic briar
#

from what i've heard spatial now have a free one that people can test right?

winged badger
#

but then again, thats just guesswork

bitter oriole
#

@karmic briar Be sure to do some calculations on target sales, too. If you sell 10K units, you'll be able to run on a single server

karmic briar
#

okay i'll keep that in mind

#

any suggestions other than spatialOS

bitter oriole
#

Not doing an MMO ?

#

A global single shard MMO, anyway

#

Destiny or Sea of Thieves look a bit like MMOs, but servers have 16 players max

karmic briar
#

im planning with distributed one with multiple server like with spatial handle the workload

#

there's one with similiar called DAT

urban dew
#

Where do you guys find people to help you test multiplayer features? Been struggling to get people to test with which is kinda slowing down the dev side.

karmic briar
#

well i go to mmo forums and asked people there

#

and other discord server i have and friends

bitter oriole
#

Part of why you do PR for your game as soon as it's test-play ready

#

Build a community, get a Discord running, have a forum or something

#

You want that anyway, no matter what kind of game

karmic briar
#

well i do not have one atm maybe i'll build one

urban dew
#

forums needed? or is discord enough

#

as far as PR goes, ads? or pages?

bitter oriole
#

Discord, Twitter, weekly gifs, monthly devblogs in text or video

#

And yeah a forum of some kind is still pretty nice

#

The Steam forums might be enough once you're close to Early Access or something

urban dew
#

thanks stranger πŸ˜ƒ

karmic briar
#

what do u guys think of this framework

winged badger
#

at a glance... don't like "and a plan to support Unreal"

#

in any case, if you have 2 experienced network engineers, shouldn't you set them to doing research?

bitter oriole
#

They're probably not neutral enough cause they work at Spatial

#

πŸ™„

solar stirrup
#

I'm curious, is there a way to override what happens when an RPC validation fails?

neon dust
#

how much performance (ram) does a single dedicated server takes?

bitter oriole
#

RAM is far from the primary performance metric, and it's impossible to say

#

Depends a lot on your game

#

And the current level

neon dust
#

for a map like an overwatch or paladins sized map

#

or other asked

#

how much servers can i run on 1 machine?

#

just the average?

#

(5v5) player

bitter oriole
#

@neon dust You need to profile it, there is zero generic answer to that

#

Probably 1 to 2 CPU cores and between 500MB and 5GB RAM per instance

#

Depends on your game and level

neon dust
#

yeah, i know xD but only wanna know the minimum ^^

#

but thanks ^^

bitter oriole
#

Minimum is 1 CPU core and I guess 200MB RAM

#

if you're loading an empty engine

#

Then you're going to load a level and it might shoot past a GB instantly

#

🀷

neon dust
#

ok

solar stirrup
#

ARK Survival Evolved takes 6GB+ for a single server instance

ruby meteor
#

How are you supposed to implement custom replicated crouching? I am running into an issue where I have to adjust the characters mesh location upwards after reducing capsule half height (makes sense), I run that logic on the crouching client, then the server and then all other clients, works as expected, but the mesh relative location won't change on the other clients, probably due to this bug: https://answers.unrealengine.com/questions/222168/mesh-setrelativelocation-is-not-working-in-network.html Any workarounds?

urban dew
#

this is the flight for one of my spaceships, it works perfectly

#

however for any player who isn't the host

#

it's slightly

#

stuttery

#

little laggy

#

for the host, it's perfect

shut gyro
#

Does anyone know if Epic Online Services is going to support Oculus for cross-platform play?

chrome bay
#

Don't see any reason why not. The SDK doesn't tie you in to any existing storefront or service.

bitter oriole
#

Though it might not interact with the Oculus account or friends in any way

thin stratus
#

Just saying

#

(posted 4h ago)

urban dew
#

is spatialos easy to implement?

#

multiplayer isn't my specialty, not sure if i'd need to hire someone or not

winged badger
#

@urban dew considering you still have problems with most basic networking (sorry to say, but it is true), i wouldn't expect it to be easy

urban dew
#

nah fair enough call πŸ˜‚

#

coming along nicely though, only got a couple networking bugs to fix up before multiplayer is smooth πŸ˜ƒ

winged badger
#

think additional layer of networking ontop of everything unreal comes from

urban dew
#

better question, how long do you think roughly it'd take most competent people to set it up, so I can get an estimate on cost πŸ˜›

winged badger
#

i just glanced at their demo

#

and i have no idea what the scope of your project is

#

also "most competent" people tend to be both booked and expensive

urban dew
#

Not worried about the cost, it's all apart of budgeting, aslong as I have an estimate πŸ˜›

#

and can forward plan

winged badger
#

still no idea on your scope

#

i only picked up it has to do with planets and spaceships

manic pine
#

if used for big scale, it doesnt seem like something you can just tack on to your project

#

looks more like something your game needs to be designed to

urban dew
#

it's an rts Zlo, servers upto 8 people

#

quite basic

bitter oriole
#

You don't need Spatial

winged badger
#

then you don't need spatial

bitter oriole
#

You don't need servers, tbh

#

Not dedicated servers

manic pine
#

maybe he wants a solar system for each player ?___?

urban dew
#

might be getting it mixed up with a different playform

#

that creates a server upon request?

#

platform*

winged badger
#

spatial is for stitching multiple dedicated servers together

#

and estimated time is in months

urban dew
#

ooh

#

i was thinking of amazon gamelift

#

my bad

#

ignore that 😊

gleaming vector
#

spatial is coming along nicely

#

i'm excited to see their work offloading AI

manic pine
#

wouldnt the overhead of all that become insane

#

its a neat project, but not gonna hold my breath until i see a working implementation for a decently sized and complex game

round roost
#

is there a way to rep stuff only to a specific player? i dont want to do a rpc to a controller for every single thing and i have a lot of objects that are only visible to certain players

#

like for example particle systems inside a gameplay cue

gleaming vector
#

i mean, the overhead is a problem yeah, but when that overhead becomes less expensive than just running stuff on the server it's an appealing option

#

yeah, there is a relevant to function in AActor

#

zale

#

i forget what it's actually called one sec

round roost
#

do you mean relevant to owner? but what if something is relevant for 2 players for example

gleaming vector
#

no, it takes a viewer and returns true/false if it's relevant to that

#

so you can filter by like, team

#

or per-player

#

or however you wan to do it

round roost
#

oh wow.. that would have saved me so much trouble.. do you know what its called?

#

not blueprintable i guess?

gleaming vector
winged badger
#

note that using a replication graph makes that function never called

gleaming vector
#

yes, because repgraph replaces it

thin stratus
#

You might not have the SteamDLLs in the Binaries folder of your Server?

#

The Packaged folder

winged badger
#

dedi shouldn't use the steam client tho, no?

thin stratus
#

The message also comes up if you don't have steam installed and the binaries are missing

#

And you don't have Steam running on that PC right?

iron lotus
#

hi there! what is good dedicated server for starter ?

#

i'm mean provaider

gleaming vector
#

i don't recommend searching for a provider if you don't already know what you need

#

I would run your dedicated server locally or on a simple cloud service until you discover how many resources you need

#

most of them will cost a decent amount of money

iron lotus
#

i want server for max 50 players

#

landscape 5x5

gleaming vector
#

your big 3 cloud hosting will likely cover you during development

#

AWS/Azure/GoogleCloud

#

you'll have to spend money

#

once you figure out how much and what resources you need, you can probably talk to a dedicated server hosting service and get a cheaper deal at scale

#

but, generally, when I see a question like yours, I can't help but comment about the fact you are asking the wrong question here

#

you want hosting, obviously, but i think a better question is where to start

#

there are a lot of unknowns when deciding how to host dedicated servers

#

really you should be asking yourself "what kind of servers do I need?"

#

50 players is kind of a heavy workload

iron lotus
#

50 players with vehicle, not character

twin juniper
#

Roy Awesome when you say to host locally do you mean a PC a home network? I wonder what Kind of mbps you need for that? probably top tier USA speeds?

gleaming vector
#

do you know how much information you are sending when 50 players are in a server? do you know how you plan on scaling? Are you releasing the server bins?

twin juniper
#

in my case it's only 2-10

iron lotus
#

i'm really don't know from what start network support, think about spatial os

#

but can't setup 4.22 engine

gleaming vector
#

@twin juniper so, during development, you almost never need a dedicated server until you have more players than your server size

#

especially for smaller projects

#

it's a waste of money to get a dedicated server early on

#

just open the port and host it on your home connection

#

if you start running up against bandwidth counts or processing power

#

that's when you start considering it

iron lotus
#

@gleaming vector i'm just finish game and test it with steam with 4 players, now first day when i'm think about dedicated server, but don't know what is best way for my.

gleaming vector
#

because like, during development, you are going to make a lot of builds and are going to restart that server often

#

and there will be significant gaps of time where people don't play it

#

if you go about it this way, you will start to gather a lot of data... how much processing power you are taking up per-player... how much information you are sending across the network

#

as you start to understand those bits, then the selection of a server host becomes really easy

#

but, if you are set on picking a server provider... Azure is good

#

it's a fantastic starting point

#

since you can trivially upgrade the hardware a server is running on

#

you will be spending money though

#

@iron lotus as I said, host it on your computer to start

twin juniper
#

i'm using steam host-listen/listen and any client's connection is choppy/laggy/jittery(when moving) ; although the host sees the clients as moving smoothly... unless both host and client are on the same network. Clients move smoothly then. That's not a limitation of client-host is it? I've got something configured wrong probably?

gleaming vector
#

you may have configured something wrong

#

is it choppy in like, shootergame?

twin juniper
#

i've never installed shooter game. I can give you a couple steam keys if you want

#

it's smooth unless the player moves then they backtrace or i'm not sure how to put it

gleaming vector
#

i am pretty busy

#

so, iw ont be able to help you test

twin juniper
#

I'll give you the keys without expecting anything in return. There's just an eppilepsy / trippy warning attached

#

also I think since 4.22 on server travel (level load) i just noticed I'm having an issue where clients will crash with fatal error has anyone experienced something similar

#

this is a method i use to move between levels for client-host.

#

you help people with information so much Roy Awesome. you deserve all the steam keys and if there's an epic store equivalent those too

#

im updating to 4.22.2 now i didnt notice anything in patch notes relating though

iron lotus
#

@gleaming vector Spatial Os bad way?

gleaming vector
#

i haven't used it in like 3-ish years

#

before they even started working on the unreal gdk

#

it looks fine, but there are probably some major pain points

#

i just don't know what they are because I haven't used it

#

I am, however, incredibly excited by their progress

#

and cannot wait to have an excuse to use it

twin juniper
#

@gleaming vector what source control do you recommend? I was trying to set up GIT and was having issues so I put it off to try again later

gleaming vector
#

if you have the money, perforce

#

i'm using plastic though, for my projects

#

i like it

twin juniper
#

tru

iron lotus
#

@gleaming vector after testing in local pc best way for me is azure right?

gleaming vector
#

that's what I would do

#

but, like, it really depends on your needs, and you wont figure that out until you run locally for a while

iron lotus
#

@gleaming vector thank you

red musk
#

What's the best structure for me to create per player UI (like healthbars and stuff) once all the players have been connected?

#

I was initially just doing it in the player controller, but that doesn't work for the other players on the client

gleaming vector
#

the HUD

#

it's client-only

#

can see the local player controller

#

best place to do that

grizzled stirrup
#

In ShooterGame to prevent a stale pickup respawn sound from playing when a client enters relevancy, they use this bool to determine whether the sound should be played (the sound plays if the bool is false): const bool bJustSpawned = CreationTime <= (GetWorld()->GetTimeSeconds() + 5.0f); It does seem to work but I have no clue how because as far as I can see, it's not possible for the creation time to be greater than or equal to 5 seconds in the future

#

Any help understanding why it works would be great

vivid seal
#

Hey guys I had 2 questions: 1. If I add even a small amount of PktLag my movement gets insanely jittery but only client side, server still sees smooth movement. I fixed this a little by reducing the update rate of the character movement from 100 to 50 but it still happens when I turn or strafe quickly. On a related note, 2. I want to check if my character is rooted/stunned before actually inputting movement. I want to check this on server but asking the server if I’m rooted and then sending the movement input creates s lot of input lag on any latency. What’s the best way to work this system in?

rigid cosmos
#

Hi anyone has any idea on how should I go about doing this.
Said I have 2 clients, and I want those clients to have a box with random letter on it, however the random outcome must be the same on both clients(hence, same text on both clients).
When client 1 click on the box, I want the box on client 1 to move up, but that same box on 2nd client to move right.

#

My first attempt was to random the letter on server, then pass that outcome to clients, and then clients will spawn a box with the letter that was passed down from server.
Now clients will be the owner of a spawned box.
The problem is that, when the client 1 clicked on the box, that box will move up, but I can't get the box on client 2 to do anything because it's a difference instance and don't have any connection with the box instance on client 1

#

My 2nd attempt was to spawn the box on server and then replicate it down to clients, now the problem is every change made on client 1 will be the same on client 2.
And I can't make the box to behave differently, because it will get corrected by the version on the server to be the same on every clients.

thin stratus
#

You have to mark the Actor as Replicated but not Replicate the Movement.
Then you have to Replicate the Text Variable, which is the easy part.
For the Movement you have to make sure you only replicate the act of moving, not the actual direction.
So when Player1 Touches the Box, it tells the Server "I TOUCHED THE BOX" and the Server tells the others that the box moved.
Then the Player2 can also move the box but with its own direction vector.

#

PlayerStates are recreated and copied over on SeamlessTravel or?

#

They aren't fully persisted, right?

manic pine
#

been a while since i looked at that part, but arent they perisisted until you reach destination map, then copied over to new ones?

#

yeah, in HandleSeamlessTravelPlayer it seems like the PS follows the controller over

winged badger
#

@thin stratus

void AGameMode::HandleSeamlessTravelPlayer(AController*& C)
{
    UE_LOG(LogGameMode, Log, TEXT(">> GameMode::HandleSeamlessTravelPlayer: %s "), *C->GetName());

    APlayerController* PC = Cast<APlayerController>(C);
    if (PC != nullptr && PC->GetClass() != PlayerControllerClass)
//...
    else
    {
        // clear out data that was only for the previous game
        C->PlayerState->Reset();
        // create a new PlayerState and copy over info; this is necessary because the old GameMode may have used a different PlayerState class
        APlayerState* OldPlayerState = C->PlayerState;
        C->InitPlayerState();
        OldPlayerState->SeamlessTravelTo(C->PlayerState);
        // we don"t need the old PlayerState anymore
        //@fixme: need a way to replace PlayerStates that doesn't cause incorrect "player left the game"/"player entered the game" messages
        OldPlayerState->Destroy();
    }
thin stratus
#

Yeah figured as much, now I no why my TeamState survives but has trouble accessing the PlayerStates in it

#

Guess I have to simply remove old playerState and add new playerState on CopyProperties

#

That should solve my random crash >.>

#
if (TeamState)
{
    // Remove this old playerState from the team
    TeamState->RemovePlayerFromTeam(Cast<AController>(GetOwner()));
    // Add the new playerState to the team
    TeamState->AddPlayerToTeam(Cast<AController>(HLPlayerState->GetOwner()));
    HLPlayerState->SetTeamState(TeamState);
}
#

I hope the owner of both PlayerStates is valid at CopyProperties, it should technically

fluid flower
#

Wait what happens if the map you're traveling to is supposed to use a different player state

#

I'm now worried about my stuff breaking after map change

neon dust
#

ate there good hosting services to host cheap?

bitter oriole
#

Depends what you call cheap I guess

#

Cheapest is listen server

neon dust
#

or one of the cheapest?

#

or popular

#

like aws,, etc.?

bitter oriole
#

AWS being the most well known you can estimate your costs based on that and keep looking for cheaper options

#

This stuff changes over time anyway

neon dust
#

ok

#

cause i wanna host on 1 dedicated server 100-200 players

#

but i donΒ΄t know if unity servers are more performant

bitter oriole
#

200 players is beyond what UE4 can do

neon dust
#

hmm

bitter oriole
#

Hell, 100 players is hard enough

#

Mordhau had a hard time getting their servers from 48 to 64 players

#

Anyway, a lightweight UE4 server that works with an average CPU and 4GB RAM will cost you $25 a month

#

Let's say you can have 50 players on that, you can host your 200 online players for $100 a month ; if your game goes for $20 on Steam, you're making $10 per copy so it's only 10 copies per month to pay for servers

#

Bit of a rule of thumb : if you sell 1 000 copies, you can count on maximum 100 players at launch, maximum 50 a month later, and maximum 10 a year later

manic pine
#

and one dedicataed player 10 years later

bitter oriole
#

Yeah

#

Basically 200 player games need to sell 50k units to keep a healthy player base

vivid seal
#

does spatialOS help with server capacity at all? i keep hearing about it but have no idea what it actually is or what the pricing is like

bitter oriole
#

Pricing isn't public so it's expensive

#

And it's not really about capacity, it's more about having a seamless world divided into instances that talk together, from what i understand

#

I mean it does a lot of things, it's a complete solution from hosting to saves

#

But mostly the important part is "many servers in the same world"

vivid seal
#

all ive seen are their promo videos which are obviously insanely positive and make it sound super useful, and im not near releasing anything, but i do enjoy learning so i was really curious about what makes that software different from typical servers, so thanks for the explanation

bitter oriole
#

I guess if you're building Destiny, it makes a whole amount of sense

vivid seal
#

yeah, i am one of the idiots that wants to make an mmo in ue4 as my first game so it caught my attention lol

bitter oriole
#

Well at least you're aware it's idiotic

#

πŸ˜›

vivid seal
#

i mostly just enjoy making the systems, its really interesting to me and im not interested in game dev as a job so ive got no deadline or expectations, i just like trying to figure shit out and eventually i'd like to get something small up and running for some friends just to see if i can

#

server stuff is just interesting to learn about

bitter oriole
#

Multiplayer is great. The basic problem with MMOs is that short of multi-million-dollar marketing, you're not getting the players that make it a MMO

vivid seal
#

well that and the fact that people who still play MMOs have probably the most ridiculous standards for games youll see anywhere, speaking as an MMO player

bitter oriole
#

Anyone can come up with a nice game, and a barebones title like Sea of Thieves does have a whole lot of players

#

Still, if you design a MMO, you need the players

manic pine
#

didnt i see pricing for spatialos

bitter oriole
#

Oh right

#

Sounds reasonable, basically twice AWS for a larger service

vivid seal
#

nice that they have a free tier to learn how to use it and demo before actually buying

manic pine
#

yeah though to me it seems like if you actually want to use these 'new' features, youll be making your game from teh ground up around them

bitter oriole
#

Absolutely

manic pine
#

before you know it, theyre bankrupt and youre left without a game ^___^

vivid seal
#

F

bitter oriole
#

Spatial OS did cause Unity games to get pulled offline momentarily for licensing issues

manic pine
#

nasty

#

do you know of any titles to actually use it?

#

anything bigger i mean

#

specifically, using it for the big world stuff, or the distributed processing

#

not just as another host service

vivid seal
#

tbh i doubt it, if you have to build ground up around them then most large games that are out now probably started before it was a good option right?

#

probably have to wait a bit

bitter oriole
#
manic pine
#

yeah, and big publishers/devs might be vary of relying so much on a single third party for their product

vivid seal
#

i think we'll start to see some big stuff in the near future now that its getting more buzz and some time has passed

manic pine
#

ooh, due this year

#

gonna be an interesting experiment

bitter oriole
#

As I usually say around here, if you're not an established company with employees dedicated to online, don't do dedicated servers

#

And yes that does mean no MMO or competitive shooters or battle royale

vivid seal
#

if we start getting 400-player BRs then im gonna have to upgrade my pc

#

or live with 12 fps i guess

manic pine
#

even with this scheme, 400 player BRs are gonna have issues when too many people end up in one location at the same time

chrome bay
#

meh

#

big numbers always means you have to make sacrifices elsewhere

#

does anyone actually want a 400-player battle royale game?

neon dust
#

@bitter oriole is unity in this topic better?/cheaper?

gusty lily
#

hey. using steam advanced sessions, is it possible to update the player count somehow when new players join a game? players who search for games seem to always see '1' as the number of players. It would also be neat to be able to update extra settings such as current map name after server travel. I can't find a way to reference/update the online session in blueprint though (blueprint only project)

bitter oriole
#

@neon dust 200 players in Unity won't be easy either and you probably will have mostly the same hosting costs

#

I mean, AWS is cheap

#

I don't even know if it's the cheapest, but $30 a month per instance is cheap

#

OVH has "gaming" VPS with 32GB RAM and a fast i7 going for $80 a month, I figure you can run four UE4 dedis on that

#

@neon dust Basically you need to think a bit about your business model here

neon dust
#

yeah

#

it should be an game like overwatch

#

5v5

meager spade
#

can someone help me with a slight replication issue ? πŸ˜„

#

i have a function PlayReplicatedMontage, which can be called on client and server

#

now the issue is, for a client, when he its a navlink it plays the montage on the server and then the client plays it via a onrep

#

thing is, if PlayReplicatedMontage is called on client for say a melee attack

#

the onrep will cause it to play again

#

if i put a check in the onrep for !IsLocallyControlled() then the server initiated montage (navlink one) doesnt play on the client

#

i need a way to ensure it plays on OwningClient but only if owning client is not alreadying playing that montage

urban dew
#

this is the flight for one of my spaceships, it works perfectly
however for any player who isn't the host
it's slightly
stuttery
little laggy
for the host, it's perfect

#

anyone know what could cause it

rotund sapphire
#

UKaos, Then just store the current played montage, with a timestamp how long it goes. When the onrep comes you can verify the same anim sequence is running already, and just skip the double play because timestamp will indicate it is running already.

bitter oriole
#

@meager spade Just make the replicated variable ignore owner.

meager spade
#

i did that

#

then it still skips owning client

#

as in owning client wont play vault montage locally

bitter oriole
#

Call it directly when it's started from the client

meager spade
#

call what directly?

#

the vault is server side only

#

its a navlink

bitter oriole
#

You need to play it directly on the client when you hit

#

And have the replicated trigger set to ignore owner

meager spade
#

so a Client call?

#

wouldnt that mess up if the client calls PlayReplicatedMontage?

bitter oriole
#

Just a plain regular function call

meager spade
#

right but the client doesnt start the montage

#

its the server

bitter oriole
#

Why wouldn't the client start it ?

meager spade
#

cause navlink callbacks are server only

urban dew
#

asked same question for 3 days, my blueprint must just be beyond repair :P\

meager spade
#

and when the player hits a navlink the server plays the montage of vaulting

#

which needs to be played on owning client aswell

#

:/

bitter oriole
#

So like, play it on the client

meager spade
#
            {
                LocalMontage.bPlayBit = ReplicatedPlayBit;
                PlayMontageSimulated(ReplicatedMontage.AnimMontage, ReplicatedMontage.PlayRate, NAME_None);
            }``` this might fix it
bitter oriole
#

@urban dew It looks like you're trying to move something from a client ?

urban dew
#

it's a actor "spaceship", its designed to fly from one location to a different

#

the target destination does change

rotund sapphire
#

icejaff, it's possible. also there have been long list of reports of jittering listen server/client combos, so maybe that.

urban dew
#

ahh

meager spade
#

then playmontage simulated does this ```PlayMontageSimulated(UAnimMontage* Montage, float PlayRate, FName StartSection)
{
float Duration = -1.f;
UAnimInstance* AnimInstance = GetAnimInstance();
if (AnimInstance && Montage)
{
Duration = AnimInstance->Montage_Play(Montage, PlayRate);
if (Duration > 0.f)
{
LocalMontage.AnimMontage = Montage;
}
}

return Duration;```
#

should work

bitter oriole
#

Jittering is just bad netcode

urban dew
#

it is ontick

#

firing like every 0.02 seconds

bitter oriole
#

That has nothing to do with your issue

meager spade
#

do you adjust by deltatime?

urban dew
#

its very smooth for host no matter how many ships, but non hosts, jittery

bitter oriole
#

So, obvious candidate for your bug

#

Do you replicate location ?

urban dew
#

yes

meager spade
#

btw ReplicateMovement will do nothing for a standard actor

bitter oriole
#

If you replicate location (or rotation or transform generally) and have a client move the object + tell the server about it, that can't work without some work

meager spade
#

fyi

bitter oriole
#

Because you will move the object, and then the server will replicate the location

#

From your point of view that will happen at time of move + ping, in time

#

But the location will be that of time of move, which was "ping" ago

#

So it will go back

urban dew
#

then execute on server, so that way it updates the location for all?

#

ahh got you stranger

meager spade
#

yeah but it really doesnt do anything (replicate movement)

#

void AActor::OnRep_ReplicateMovement() {} <

urban dew
#

so whats the best way to go about fixing it? is it as simple as making "not replicated" in the function?

bitter oriole
#

No

#

A correct implementation that works well and prevents cheating is somewhat hard to do

#

If you don't care about cheating, and don't have collisions with other players, it's easier

#

You need to think about your remote client like this : it has its own life, and might not get any network for a second or two

#

All your code must keep working well when net drops

#

Two general solutions :

  • Your client does whatever the fuck he wants and has absolutely no replication for itself ("ignore owner" flag on everything rep'd), he just tells the server about it
  • Your client does stuff locally, tells the server about it, and when the server replicated back, the client does processing to check if the server said something different, which is called rollback + replay
urban dew
#

ideally the second, but im just confused how that would work for something like this as it doesn't belong to a player, i thought server updating its location, would be ideal

bitter oriole
#

If it doesn't belong to the player it's even harder

#

It probably should

urban dew
#

I use the player to replicate its spawn to the server

#

so you think I should set the owner of the ships?

#

upon spawn

bitter oriole
#

I mean if the ship is something a player will control forever, yeah absolutely

urban dew
#

oh no, its apart of an RTS, essentially, ship spawns at one of your planets, and flies to an enemy planet, and then gets destroyed

chrome bay
#

@meager spade OnRep_ReplicatedMovement() definitely does do something for a base actor class

#

ActorReplication.cpp: void AActor::OnRep_ReplicatedMovement()

#

If it didn't we'd be seeing that crop up all the time on the forums πŸ˜„

urban dew
#

still a little confused, so is it hard to get this to replicate properly? or is it just a server issue?

bitter oriole
#

It's not an "issue", it's something you need to think about and pick the best compromise in your network model

#

You could have everything happen only on the server

chrome bay
#

multiplayer iz hard

bitter oriole
#

You can also have everything happen on the client and just give high-level commands to the server

#

And you can do a bit of both

chrome bay
#

Movement is arguably one of the most complex things to do in MP, which is a bitter pill at first since virtually any game has some kind of player-controlled movement

#

I'm gonna do a card trading game next guy tapping his head gif

bitter oriole
#

To be honest, it's a lot of an UE4 issue too. A generic rollback / replay movement component would help.

chrome bay
#

I have something so similar to that now. I need to roll it out.. though it has it's own limitations

#

The general idea was to just have a system where you say "this is how to move the object" and "this is all the vars I need to do it over the network"

#

and the networking side of it is silently handled behind the scenes

#

But when I realised that collision resolution is really crappy / difficult when not using a physics engine I held off for a while

bitter oriole
#

I'm just in the process of rebooting my game project, and dropping all kind of physics from the existing code is sure going to feel weird after all that time.

#

Probably a good feeling overall since it's always been shitty

chrome bay
#

Yeah I really wish I could get rid of the physics-reliant version I use atm. I'm basically doing what FN does at the moment, but I hate it. Spend so much time making the prediction/replay side of it work, only to get stumped by collision in the end

#

one thing that caught me out early on was that MoveComponent only cares about the root body when using skeletal meshes, so you have to do a fairly comprehensive engine mod to make it factor in all bodies.. but then it gets messy 😦

manic pine
#

were they doing something with physics objects replication in this new physics system coming?

bitter oriole
#

The only physics I will have in my rebooted project will be "fall vertically to the ground with one or two bounces" and god that's amazing

#

Not even sure I need that

chrome bay
#

@manic pine they haven't detailed specifics on that yet.. but I really frigging hope so

#

If PhysX allowed you to simulate just a single object in the context of the rest of the scene, it would be reasonably easy to do

#

But it doesn't because f*ck you that's why

#

Thanks PhysX

#

If the engines native physics engine allows you to do that though... oh the possibilities

manic pine
#

and better performance, integration with other engine systems etc

#

yeah

#

could turn out great

chrome bay
#

actually gonna dig up my thread on that and spam it to epic devs on twitter

manic pine
#

or it could end up much like what we have already, just with a 5% performance boost

#

^___^

chrome bay
#

Haha yeah most likely.. hey guys you can destroy everything but you wanna move a physics pawn in multiplayer lol gtfo

#

This problem has chased us since the damn 90's and we still don't have a solution ffs

manic pine
#

we must go back to lockstep networking

#

well i guess thats pretty much what theyre doing with this craze over streaming games

chrome bay
#

deterministic lockstep would be cool.. if a little unresponsive for a shooter or something. Mind you a lot of games I played with that system don't really suffer as much as you'd think

#

Would be perfect for me though 😦

manic pine
#

yeah and its better now than it was back then, since we usually have okay latency now

#

but yeah, not my first pick for any kind of fast paced game

#

or anything where you directly control camera with mouse really

#

would certainly make development a lot easier though

fleet raven
#

lockstep without client prediction = πŸ’©

manic pine
#

but a well-synchronized poop

solar stirrup
#

Small question, are you able to use both Epic's and Steam's subsystems at the same time or would I have to make two different builds? The team I'm working with is discussing the possibility of releasing on both the EGS and Steam

chrome bay
#

different builds

#

Well, you need some intermediate subsystem if you want both of them to talk to each other. That kind of thing doesn't come cheap (at least not until epic completes it's Epic Online Services stuff anyway)

solar stirrup
#

argh

chrome bay
#

To have them working together you'd just use Steam / EGS as a distribution platform - then have your own OSS

#

Which is extremely expensive to support and build, but thankfully Epic are trying to make that a free thing

solar stirrup
#

Just checked, Epic's online stuff has just about nothing that Steam offers so far πŸ‘€

#

That's going to be a PITA if the team wants to release on the EGS first

bitter oriole
#

Right now most devs can't release on EGS either so it's not much of an issue

#

But yeah, Epic's will lag behind for a long time

solar stirrup
#

ouch

#

Welp off to tell the team an EGS release would be suicide for us

bitter oriole
#

I mean if you have negotiated an EGS release with Epic, I'm sure you can find a technical solution

#

If not, EOS will have most major features by the time EGS actually opens to devs

solar stirrup
#

Is there a date for when they open up to devs?

bitter oriole
#

Not that I know of, but "this year" IIRC

solar stirrup
#

Aight well if it's this year it should be fine

split gust
#

The EOS roadmap has them practically beat Steam by the end of the year

#

For online services of course :o

#

Depends on how useful the server side matchmaking will be though

bitter oriole
#

It's more of a "doing most of the main things" than "beating" tbh

#

Steam will still do much more stuff both for players and devs

grizzled stirrup
#

@winged badger hey remember you mentioned calling SetReplicates(true); in the constructor would break my actor? I'm looking around and it seems that's how UnrealTournament sets all of its inventory / projectiles to be replicated

#

Would you say it just doesn't call some aspects of the function but is still fine to use?

#

Maybe there isn't much of a difference, but it does seem the roles getting assigned is important

#

Also on a UE4 wiki this line mentions it: If you want a component on your actor to replicate you should call SetReplicates(true) on the specific component in your class constructor

#

So it seems fine to be called in the constructor?

urban dew
#

@bitter oriole i found the solution for earlier

#

i changed the function to not relpicated

#

and it fixed it because of component relpicates

weak fog
#

Potentially dumb question for anyone familiar with SeamlessTravel and the SeamlessTravelActorList:

It seems I can add actors to my SeamlessTravelActorList, and then seamlessly travel to my next map...but how do I then retrieve the SeamlessTravelActorList? It doesn't seem to live on GameMode, and I'm really struggling to find any documentation on this

idle blaze
#

I'm running LineTraceSingleByChannel and something strange is going on: the server only seems to get a hit if it happens on camera. If it happens while the server is facing away from the trace, no hit registers. Any clue what's going on?

worthy wasp
#

@idle blaze - are you using RPC events or SwitchHasAuth (ListenServer?)

idle blaze
#

@worthy wasp I'm using RPC, and this is in C++.

worthy wasp
#

You should always pass through your start/end fvectors. 99.9% of hte time - Server will be completely out of sync with Client when it comes to transform of both actors as well components. SOME components arent even tracked by server - hence the need to pass through the args.

#

you can safely rely on client for hit detection - and use the server as a AUTHENTICATED hit

gaunt steeple
#

I was using Simple Vehicle Template. When I played the game on Dedicated Server mode it started jittering, can anyone help me with this?

worthy wasp
#

@weak fog - AGameMode isnt a load-state capable class - it reinitializes on travels. FYI - UGameInstance is the ONLY class that is load-state capable in the game framework.... thus any data that you wish to save between state changes need to be mapped/retrieved into/from the UGameInstance class

idle blaze
#

Interesting, thanks. Could you clarify what you mean by using the server as an "authenticated" hit?

worthy wasp
#

@idle blaze - so we do FPS shots (Called HITSCAN in trade terms) in 2 modes in multiplayer -

FIRST: FromClient -> SingleLineTrace to calculate a CLIENT driven hit

IF HIT (on client) -> ServerRPC::HitScan(FVector Start, FVector End)

SECOND: ServerRPC HitScan -> Raytrace with the passed args

#

now

#

whil this is COMPLETELY SIMPLIEFIED HERE....

#

do realize - you will have network lag

#

which is wher eyou need tos tart doing Lag Compensation

#

i've not gotten this far with my studdies yet....

#

but basically to my understanding - every player stores an array of N# of frames BACKWARDS in history of their location

#

on this SERVER HIT - you would calculate how many frames have passed due to lag (DONT KNOW HOW TO DO THIS YET) - and then see (ON SERVER) if the hit went through to the TARGET - where it was standing N# frames ago)

#

its quite indepth

#

again - i havent yet achieved (or even started this) study yet

#

and by authenticated - i should re-clarify it as Authoritative

#

IE: the server confirms you actually hit the person (cheat/hack-proofing)

idle blaze
#

Awesome, thanks again.

worthy wasp
#

you bet - sorry its so complex - simple answer to your question is - Server is either DESYNCED or not even tracking the CameraComponent

weak fog
#

@worthy wasp Does this mean I should totally ignore the whole TravelActorList thing? It seems like that’s the preferred way to transfer data upon ServerTravel, but I can’t find the way to retrieve it afterword

worthy wasp
#

sorry i wasnt clear enough - take the array list (Tarray AActor*) and simply store it into the gameinstance

#

retrieve it upon the new map load success

weak fog
#

Yeah that's what I was thinking. Then couldn't it just be any arbitrary array at that point? Does this mean the SeamlessTravelActorList is kinda pointless?

worthy wasp
#

i dont understand your thinking..... sorry.

Tarray<AActor*> ThisList = AGameModeBase::GetSeamlessTravelActorList();
YourGameInstance->SetTravelActors(ThisList);

On game map load succes s - retrieve this list.

Again - i have 0 idea what your wanting to do with this list - your original question was how to keep the list live when traveling maps - answered.

weak fog
#

yeah I get that, sorry. It just appears in the (admittedly sparse) docs that I've found that SeamlessTravelActorList (which is a UE4 native thing, not something I made), auto-persists upon SeamlessTravel enabled GameModes

worthy wasp
#

in retrospect - a seamlesstravel means that a playercontroller does NOT disconnect from the server - and reconnect upon map travel....

To my knowledge - the entire framework still lies the same - all classes re-initialize after a game map is loaded (IE: ServerTravel). Your ONLY source of persistance is with the UGameInstance class

#

as far as I know - even when a seamless travel happens - the playercontroller is still re-initialized upon map travel. it just doesnt disconnect/reconnect like in a NON-seamless - which is basically running AGameMode::PostLogin() - a very VITAL function towards MP Frameworks.

tall pine
#

On a character, if I call GetMesh()->SetVisibility(false), will that character mesh become invisible for everyone? Or just locally?

thick shale
#

just locally

tall pine
#

sweet thanks!

solar stirrup
#

a Client rpc will run on the server if the server is the owner of the actor right?

winged badger
#

it will run as if it wasn't a rpc

tall bridge
#

Is here someone who can help me in my Project (Multiplayer - Blueprints)? i am from germany, so german people are welcome

solar stirrup
#

what's the problem?

tall bridge
#

I just need someone who helps me to programm in my private project the lobby system

winged badger
weak fog
#

Anyone ever successfully overridden GetSeamlessTravelActorList? Attempting to do so but running into some problems. Seems like there's very little info on doing this

https://api.unrealengine.com/INT/API/Runtime/Engine/GameFramework/APlayerController/GetSeamlessTravelActorList/index.html

Edit: Also it's kind of a misleading name. Something like GatherSeamlessTravelActorList would be more appropriate

I plan on writing a medium post if I can get this working, just to get some info out there and save someone my struggles lol

Called on client during seamless level transitions to get the list of Actors that should be moved into the new level PlayerControllers, Role < ROLE_Authority Actors, and any non-Actors that are inside an Actor that is in the list (i.e. Object.Outer == Actor in the list) are a...

urban dew
#

can you change the public connections inside a already launched server?

glacial pollen
#

Why does this happen on listen server?

#

Owning player and camera references are valid... yet the output is null

worthy wasp
#

@glacial pollen perhaps server is trying to run this? Server has NO ability for widgets AT ALL

glacial pollen
#

Listen server does

#

its a client playing as a server

worthy wasp
#

Not as server.....

glacial pollen
#

Yes...

worthy wasp
#

No

#

U need to switch has auth branch

#

And go off cluent

#

Listen server is both client and server together

glacial pollen
#

What are you talking about?

#

A listen server is ONE instance

#

it does not have a "remote" in that sense

#

(I wish it did)

worthy wasp
#

Sorry man it is what it is

#

What i said is correct

glacial pollen
#

No

#

ITS

#

NOT

worthy wasp
#

Ok good luck dude

glacial pollen
#

bye

worthy wasp
#

Sorry u dont listen well to valid points

glacial pollen
#

ONLY DEDICATED SERVERS CANNOT HANDLE GUI

worthy wasp
#

Lol

#

I wish u were right for ur sake

#

Ask cedric he wrote the book

#

When he confirms what i said make sure u send me a bitcoin

glacial pollen
#

Dude, ignoring the whole role thing. ANYONE can create a widget. EXCEPT for a dedicated server because its headless

worthy wasp
#

SERVER role cannot make widgets - prove me wrong.

#

Listen server has 2 roles... fyi

glacial pollen
#

Listen server only has 1 begin play. That role is Listen server

#

aka AUTH

worthy wasp
#

Which is server. Fyi begin play runs as both server and client on all actors flagged for replication

glacial pollen
#

NOT FOR LISTEN SERVER *

worthy wasp
#

Ok dude ur clearly showing ur age and intelligence here

#

Good luck ass hole

glacial pollen
#

bye

worthy wasp
#

U may wanna read that doc again

#

Practice some

#

Gitgewd

glacial pollen
#

There is your proof

#

before you claim my system is broken

worthy wasp
#

I never said ur system was broke

glacial pollen
#

I'm having a SINGLE issue with one actor component

#

Other than that, my widgets work fine on listen server

#

Thats from the compendium.

#

Works fine

worthy wasp
#

Are u switchhasauth off of beginplay?

glacial pollen
#

Its lying to me, its not server

#

its client 1

worthy wasp
#

Ill assume of course not.... then ill further explain to u that ur widget ONLY draws because BeginPlay runs in both client and server roles in a replicated actor.

glacial pollen
#

but still in "standalone mode"

worthy wasp
#

So ur piggybacking off of the client role of beginplay.... nothing u do purposefully

glacial pollen
#

Dude, just stop

#

it was the client

#

Notice Char_Mech? thats listen server, Char_Mech1 is client

#

This is the client

#

still in standalone mode

#

but autoconnect is turned on

#

so this shouldn't be happening

#

So the issue was this call was the listenserver's begin play for the clients copy

#

I realize, what he said was in line with this, however his clarification was extremely poor

raw quarry
#

i'm having an odd problem with physics on my server.. the client works properly, but the server is showing a velocity of 0 every other tick and on the other ticks it's double what it should be

#

here's an example of when I jump

#

printing the z velocity on the server

#

I'd much appreciate any ideas

glacial pollen
#

Turns out, NotDotProduct is a friend of mine in my DM's, but due to a name change, I didn't realize this. Teaches me to be nicer.

fleet raven
#

well he was wrong though

#

am I understanding it correctly that a property on a character replicated with COND_SimulatedOnly will send to everyone except the client controlling it?

#

since that client would be autonomous

urban dew
#

been trying to fix this for hours and im just lost

#

its just not changing the values at all

weak fog
#

If anyone was wondering about my GetSeamlessTravelActorList stuff from before (or if anyone is searching this in the future), I did actually solve it. I can change levels (while swapping all 7 Framework Components) while also retaining any and all data that I want, server or client side (without using GameInstance). I plan on writing a Medium post on this soon as I wasn't able to find the proper info anywhere

nocturne berry
#

hey guys, i'm trying to exclude steam from my dedicated server because i'm connecting to my servers from the IP i get in matchmaking.
the code below is what i'm using in my .Build.cs file

using UnrealBuildTool;

public class UnrealProject : ModuleRules
{
    public UnrealProject(ReadOnlyTargetRules Target) : base(Target)
    {
        PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
    
        PublicDependencyModuleNames.AddRange(new string[] {
            "Core", "CoreUObject", "Engine"
        });

        PrivateDependencyModuleNames.AddRange(new string[] {
            "InputCore",
            "OnlineSubsystem",
            "OnlineSubsystemNull"
        });

        if(Target.Type != TargetType.Server)
        {
            // Steam Integration
            if ((Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Linux))
            {
                if (Target.bUsesSteam == true)
                {
                    PrivateDependencyModuleNames.Add("OnlineSubsystemSteam");
                }
            }
        }
    }
}

and this is the code in my Server.Target.cs

using UnrealBuildTool;
using System.Collections.Generic;

[SupportedPlatforms(UnrealPlatformClass.Server)]
public class UnrealProjectServerTarget : TargetRules
{
    public UnrealProjectServerTarget(TargetInfo Target) : base (Target)
    {
        Type = TargetType.Server;
        
        ExtraModuleNames.Add("UnrealProject");

        bUsesSteam = false;
    }
}

but the server logs still give this Warning: STEAM: Failed to initialize Steam, this could be due to a Steam server and client running on the same machine. Try running with -NOSTEAM on the cmdline to disable.
and the clients can't connect to the server by open [IP], it kicks the clients out.

any idea what could be the solution?

kindred sandal
#

Is there any differences between Google Play OSS and Google OSS ? and which one provides ServerAuthkey ?

winged badger
#

@nocturne berry someone had the same problem yesterdeay or day before

#

i think there was a solution involved as well

urban dew
#

@woeful anvil thank you, what do they both do?

#

i tried the force net update, and switch has authority

#

it still didnt work :\

nocturne berry
#

@winged badger i think u're refering to @woeful anvil
i saw his solution (changing the port) and i tried it.
the game tries to connect but doesn't connect :/

urban dew
#

this has delayed my project over a day now, im so stumped

#

it's just not updating the value ingame at all

#

anyone know what could cause it

#

i just put some prints in to find whats going wrong

#

and changed to multicast

#

it's just not changing the value at all

winged badger
#

@urban dew if this is a commercial project, i would seriously consider hiring a network engineer

urban dew
#

i've actually almost finished all the important replication thing

#

I only have 3 more known networking bugs

#

"
resource point not working
planets not being destroyed
warp drive spawning, but not taking away ship count or registering as a warp planet
"

#

when if figure out how to fix this, it should fix problem 1 and 3

#

then it's more polishing, ui, and stuff

winged badger
#

you do unreliable Server RPC, then you check Authority, which is pointless after Server RPC, after that you set a few replicated variables (with no input sent thru original RPC, so im questioning if server could have handled this without client sending anything), then you do a reliable and again Server RPC from there

urban dew
#

i only did check authority as someone suggested it last night

#

1 second

#

as far as client goes I am firing it from the rts controller

winged badger
#

anything connected to server RPC event executes on Server only

urban dew
winged badger
#

so authority checks and server RPCs connected to Server RPC don't make sense

urban dew
#

then ive got this as the current one

winged badger
#

and that is ticking/on a timer?

urban dew
#

it's fired from a hud button

#

which gets all selected actors (rts click drag box)

#

then it's supposed to -70 from "Ships" variable

#

for every planet

winged badger
#

and where do you sent an array of selected planets to the server?

urban dew
#

2 pictures up in the rts controller,

#

it then checks if the selected actors are planets

#

if they are it runs the event

#

ResourcePoint

#

if I put it on multicast, it does change the value briefly before being changed back

#

which tells me it is an issue with the resourcepoints event

winged badger
#

didn't cross your mind to send the entire array in one RPC?

urban dew
#

confused? its run on the hud button being clicked so it goes hud>contoller>selected planets> planet> event

#

that method does work for almost all spawning methods in my game

winged badger
#

you loop through all selected planets

#

and for each one you send a reliable server RPC

#

instead of sending one RPC with the entire array as argument

#

and then doing the looping server side

urban dew
#

isnt that what im already doing?

winged badger
#

no

#

server RPC is sent separately for each array element

#

which is pretty bad

thin stratus
#

Are these Actor Planets even owned by the Client?

#

Just asking

urban dew
#

not owned no

thin stratus
#

Then you can't perform ServerRPCs on them anyway

urban dew
#

world objects

winged badger
#

and they should be owned

thin stratus
#

Actors have to be owned by the Client who's connection is executing the ServerRPC

urban dew
#

my other events are working in the planets? with no issue?

thin stratus
#

Idk what is working and not working, maybe you just don't notice it

#

But a Client has to own the Actor to perform a ServerRPC

#

And otherway round ClientRPCs need a Client owning the Actor, otherwise there is no Client to target

#

Looking at how you used RPCs in the past, you are most likely using them incorrect

#

Could totally be that the RPC in your Screen is called by the Server somehow, and you would never notice the RPC not working properly cause well it's not even needed

winged badger
#

therefore, do yourself a favor and hire someone who can do this full time if you plan to release before 2222

#

*2022

thin stratus
#

Or hire someone who explains this stuff properly to you

winged badger
#

or does both πŸ˜„

urban dew
#

i fixed it

#

thanks to you guys πŸ˜‚

#

looked back to the replication done before

#

and how the client cant run the rpc

#

seems to of fixed the issue πŸ˜ƒ

winged badger
#

there is about 95% chance your entire network just explodes at some point

bitter oriole
#

Be sure to try all of this with at least 100 PktLag while in development

urban dew
#

is there way to change "lag" stranger?

#

and probably zlo πŸ˜›

bitter oriole
#

Look up PktLag

urban dew
#

but at that point I can hire someone to fix it for me πŸ˜›

#

im just trying to get it all "working"

#

for now

bitter oriole
#

As long as you're working/testing on a single computer, you need to set PktLag to at least 25 for best-case scenario, 50 for slightly less perfect

#

That's just to detect really obvious issues

#

Then you'd use clumsy and real-world test to actually test

urban dew
#

oh, my game is approved on steam already, I do most my tests with other players πŸ˜ƒ

winged badger
#

i run 500 when testing client side simulations πŸ˜„

bitter oriole
#

Just giving advice here @urban dew , can't know if MP code works unless it's tested with latency

#

Since like half of all MP is lag compensation of sorts

urban dew
#

I know, I really appreciate the advice stranger, you've all been a massive help over the past couple weeks πŸ˜ƒ

#

have been learning slowly πŸ˜›

#

picked up unreal massively, multiplayer is still my massive downfall

thin stratus
#

Quick check and you are doing 2 ServerRPCs in each other again

#

:D So yeah, your Code will f*ck up at some point

#

The second RPC is again not needed

#

And you are again calling an RPC per Planet

#

Instead of one with an array

#

But you'll notice eventually

real yacht
#

is this correct way for pickup to be collected on server

#

pickup is in level, so it's not owned by any client

thin stratus
#

Please refrain from pinging users without any direct reason

#

I'm working, I'll look into the chat whenever i have time

real yacht
#

ok, sorry

urban dew
#

I want to assign a team to a player as soon as they join the game, I'm currently doing this in the gamemode, and it does work, however, only sometimes

#

what would a better way to do this be?

winged badger
#

overriding HandleStartingNewPlayer

#

accessing the PlayerState from the PC ref

#

and setting the replicated team variable inside the PlayerState

#

(calling the parent of HandleStartingNewPlayer in the process, ofc)

urban dew
#

do I do the overriding in the gamemode?

winged badger
#

yes

urban dew
#

im not sure if its related to the override, but my HUD class isn't default being on the player anymore?

#

is that normal

fossil plover
#

I've been working on a moba style ability system ie: ability cooldown state persists on and after death, other players may glean information about the state of your abilities, etc. This has lead to a lot of trouble cleanly handling cooldowns. To me this says I should decouple the ability from the player character somewhat, maybe holding the current abilities in the playerstate and calling them via the playercontroller? I'd appreciate any thoughts or direction I could get here cause it's a bit tricky πŸ˜›

twin juniper
#

How'd you go about making an end game screen/level? Like in any multiplayer game, after the game is done. You get the widget stuff telling you how much points you have, maybe showing your rank progression etc. Would I do that in a new level, where I'd server travel over there, so the player/game states survive, and display all the info

#

Or would I stay in the same level, and just possess some camera thats looking away from the map, and display the widgets there

#

Or would I perhaps save all the data in a file at the end of the game, client travel to a new map via OpenLevel, read the file and then display the info?

urban dew
#

usually it's just a simple level transfer

#

and display saved data

winged badger
#

@fossil plover PS is a good option]

#

it persists even after disconnect, its publicly available, and its owner by the PC so you can still RPC through it

fossil plover
#

exactly my thoughts

#

good to hear i'm hitting some of the beats lol

twin juniper
#

So you'd save the data in a file, use Client travel, then display said data?

#

probably using the save game object?

wanton pebble
#

quick question, replicated my lean and now my client stutters when walking

twin juniper
#

I couldn't find the reason why its acting like that any idea pls ?

urban dew
#

check the zorder is my guess

#

they might have the same?

twin juniper
#

what do you mean by zorder its not widget ?

#

I made the movement but idk why this one does not work

urban dew
#

oh nvm

#

looked like a 2d widget

winged badger
#

you're querying client only information server side

#

(the mouse position)

wanton pebble
#

any idea why my client stutters when inputting the mouse?

idle flame
#

Hey,
I'm having troubles with replication. Let's say I have two class A (GameState) & B (An actor). They are both replicated to all clients.
On my server side, A will be created first, and then B will be created.
When a client connect to the server, I can't know if my class A will be replicated after or before my class B.
But, in my case I need the class B to be replicated after my class A. Because in my B class constructor I need to get informations about replicated variable of my A class.
Someone knows if ue4 provide us a way to solve this kind of problems pls ?
Sry if I'm not very clear, my english is not very good ^^

#

btw, in my case the variable I need to be replicate first is the seed of the game.

solar stirrup
#

Pretty sure the GameState is created before actors spawn @idle flame

idle flame
#

not on clients

#
  • variables replicated of gamestate are also not replicated before actor are
winged badger
#

@idle flame make a copy of the variable in class A, set it on server, and make it replicate only Initially

#

if you do that in the frame A is spawned, the variable will be there on BeignPlay on clients

idle flame
#

@winged badger Thx, but that's not my problem. I know that if I set a variable to replicate in initially in a A class it will be there when spawned for clients.
I want to access a replicated variable in A Class from B Class on client side. But actually, when I try to access the variable of A class from B Class, B class is created first, so it can't access A class to get the variable.

red musk
#

Hi friends, I am saving a list of player states to my GameInstance prior to changing levels, after I change levels though the list of player states has an unexpected amount of entries and the data seems to have been erased, despite being in GameInstance

#

Anyone know what would cause that?

#

Simple example:

  1. Host match in main menu screen -> GameInstance now has 1 entry (the host)
  2. Start Match, loading into gameplay level
  3. GameInstance now has 2 (??) entries, both seemingly default
plucky horizon
#

I suspect what I want isn't an easy thing. I'm coming here to verify if that is the situation or not.

I have a projectile, which is replicated, it has a child actor component. Which is not explicitly replicated, but obviously each replicated projectile has one. I want to replicate values on one of those child actor components to the other. I don't fully understand replication so maybe just maybe.. it is easily accomplished??

twin juniper
#

@plucky horizon can you give a concrete example?

plucky horizon
#

How so?

#

like, just explain what is happening? functionality wise?

twin juniper
#

Your question isnt exactly clear, what do you mean by you want to relpicate values on one of those child actor components to the other

#

So a concrete example of what you are trying to achieve would help

plucky horizon
#

I want the values to be the same

#

That is what replication is no?

twin juniper
#

no

#

its not

#

Replication means replicating a variable from the server to all the clients

#

So if you want the values to be the same, why not set them to be the same?

plucky horizon
#

I don't see a good distinction between the server sending the data to all the clients so that they all have the same data.. and "the data is the same"

twin juniper
#

If your projectile has a variable called speed that is set to 200

plucky horizon
#

aside from that I'll continue writing my example

kind wave
#

I'm getting the error ""LogModuleManager: Warning: ModuleManager: Module 'OnlineSubsystemOculus' not found - its StaticallyLinkedModuleInitializers function is null."" when deploying my project to quest, has anyone else run into a similar issue?

plucky horizon
#

I have a projectile which has an actor attached to it. That actor (let's call it B as it's the second class here) spawns things(C objects) when the projectile collides with stuff. I want B to have certain variables set from the client side to multicast to all the other B's which are standins for that B. Then B would use those values in spawning the C's.

Since the B objects aren't replicated, presumably they will be slightly different (so to speak) so I need the non-default values to replicate. Whereas if they were I'd have 1 projectile and 2 B objects on every client. So I need the values to replicate, not necessarily the objects. But again I don't fully understand replication.

I feel that the initial question was A LOT easier to follow and understand than this. But you asked for it.

kind wave
#

I'm using the oculus online subsystem plugin and it's in my build.cs file

twin juniper
#

@kind wave did u enable the plugin from the editor?

plucky horizon
#

If that is still too esoteric.
Projectiles have lasers attached as components. The lasers spawn laser segments on collisions. The laser has properties for setting properties of the segments. I need the lasers to have the same property values cause it will be more performant to replicate data from there opposed to N segments since there will be far less lasers than segments.

kind wave
#

@twin juniper yep

plucky horizon
#

@twin juniper actually I don't think you can actually say replication is a server to client activity since NetMulticast is an option. Server Client is just the defacto paradigm

meager spade
#

works both ways

#

well clients send to server, server sends to other clients

#

client doesnt technically replicate per say replication is the from server to all other clients

#

client just tells the server what he is doing, server handles replicating it to all other clients

plucky horizon
#

Mmm I would expect that from an architectural stand point

red sand
#

Is there a way to migrate host in listen server
like the current host leaves and stuff

gleaming vector
#

no

#

not built in

#

i think a few people here have done it though

#

it's not clean

red sand
#

so there's no plugin or any tutorial available for it?

gleaming vector
#

no

#

you are pretty much on your own

red sand
#

damn that sucks

crimson swan
#

Yes lack of any kind of host migration for listen servers is a big problem. If someone could figure out a solution for this I reckon they could make a killing on the Marketplace

worthy perch
#

Do you need a server to hold the data between migrations?

mellow cipher
#

This apparently got fixed but I'm still having issues with it in .22.1, the net.ShareShadowState still fixes it though

red sand
#

@worthy perch yeah that and don't want game getting interrupted when it switches the host of server.

red sand
#

Maybe @thin stratus can create it

crimson swan
#

Even restoring to a previous check point would be better than nothing

idle flame
#

Hey,
I'm having troubles with replication. Let's say I have two class A (GameState) & B (An actor). They are both replicated to all clients.
On my server side, A will be created first, and then B will be created.
When a client connect to the server, I can't know if my class A will be replicated after or before my class B.
But, in my case I need the class B to be replicated after my class A. Because in my B class constructor I need to get informations about replicated variable of my A class. The problem is that on client B is created before A.
Someone knows if ue4 provide us a way to solve this kind of problems pls ?
Sry if I'm not very clear, my english is not very good ^^
btw, in my case the variable I need to be replicate first is the seed of the game.

winged badger
#

i already told you the only reliable solution to this

#

you can alter NetPriority

#

but

#

if a packet gets lost, your game breaks

idle flame
#

@winged badger y I saw but I also answer you ^^ Ah ok didnt understood that the first time

winged badger
#

the alternative is clumsier

#

A checking if B is there client side and B checking if A is there

#

then when both are around, start whatever logic depends on it

idle flame
#

That's exactly what I was doing in the tick function of both class

#

I was checking is the other class was replicated and if so I was doind my logic

#

@winged badger But do you think it's good to put logic like that in the tick function ?

winged badger
#

its not

#

but

#

when you spawn A and B

#

if the same object spawns both, it can reference both A and B at that time

#

which means it can copy B's variable in A or the other way around

#

and as long as that variable (your seed) is replicated it will be available by the time A or B call BeginPlay client side

#

and that approach can't break

#

if your concern is replicating the same variable twice, it doesn't really matter, seed would be one integer, so 4 bytes per client once per game

#

you could also have replicated a pointer to the GS in your B, with an OnRep function

idle flame
#
which means it can copy B's variable in A or the other way around
and as long as that variable (your seed) is replicated it will be available by the time A or B call BeginPlay client side
and that approach can't break ```
That's exatly what I was looking for THX !
pliant hollow
#

So I was fiddling around, and I noticed that somehow, the server was only updating client's character position (and I suppose rotation) once every two frames. Does someone know why it is so ?

#

To illustrate my point, here is the Z position of a Client's controlled character falling being printed every frame:

worthy wasp
#

@pliant hollow - not sure how you think its failing being printed every frame - as i see a steady stream of Server->Client the whole way there.... but I will say that it is 100% common for hte server to be desynced with local client as far as transforms go. This is nothing abnormal in any of my experiences

bitter oriole
#

@pliant hollow Replication rate varies

#

It can actually never be updated for three seconds when the connection drops a bit

#

Large part of why multiplayer is so hard

modern swift
#

hi all any one try to setup unreal server on google cloud compute?

#

I have set the firewall rule to all port and run the server on cloud shell, but still cant connect through internet

worthy wasp
#

definitely sounds like a firewall/port issue - have you tried a TELNET from your PC to see if the port IS open?

modern swift
#

connect fail , but I already created the rule in firewall

worthy wasp
#

again - did you telnet to ensure the port @ destined IP IS ACTUALLY open?

#

whats your IP/PORT?

#

for this server

modern swift
#

I trying to restart the instance, it can connect on port 80

#

but cant connect to 7777

pliant hollow
#

I guess I was surprised by the lack of prediction for the character (using the velocity to keep updating), though I vaguely remember reading about that.
What I fail to understand however is why in the absolute best condition (testing with server and client on the same computer), location replication only occurs every two frames.

bitter oriole
#

It's replication, it's never going to run at 60fps

glacial pollen
#

@idle flame I have a body part system, that requires all body parts to be replicated before doing final calculations, so:
PlayerController : Create CharReady_REF variable
CharReady_REF_ON_REP : Tell customization menu to spawn character
BodyPartCompSystem : Create BodyParts_REF variable
BodyPart Begin Play : Add self to BodyPartCompSystem.BodyParts_REF
BodyPart Begin Play : Start CheckBodyPart_REF timer
(on client) CheckBodyPart_REF func : Loop through BodyParts_REF -> IF ALL VALID -> Set CharReady_REF in PC, which call the ON_REP function which starts the "spawning" of my "full" character

#

(When you spawn an actor on the server, the client in my case, will know about it, before actually getting the whole actor, which caused me pain, because I would have a reference to an actor I could not access)

#

For you:
PC: Create A_REF Variable
B: BeginPlay start a timer
Timer : Check if PC->A_REF is valid
If valid -> Continue initialization

A: Set PC->A_REF = self

#

@pliant hollow One thing I recently because aware of
Clients "Forwards momentum prediction"
Server "Interpolates between two updates"
Hence Clients will always be guessing
While server will always be "late"

pliant hollow
#

Yeah, your answer made me realize that the server is probably receiving multiple packages for movements for a single character in the same frame and just playing them back to back, which makes sense and explains what I'm looking at

glacial pollen
#

There is functionality for "merging" multiple updates in a single tick if I recall correctly

#

(character movement I think)

pliant hollow
#

I hadn't realize it was a possibility, but now that I know about it, it explains some of the strange things I've been experiencing with overriding this part of charactermovement for advanced movements

#

Thanks, I'll take a look

fluid flower
#

Has anyone found a workaround for the steam session not showing the right number of players when player hosted?

wanton pebble
#

hey, i've got a question

#

i've got a rotator that i'm replicating, it replicates fine

#

but when setting it

#
    //Replicate Look Rotation

    if (Role == ROLE_Authority)
    {
        SelectFloat();
        ServerSetViewRotation();
        ViewRotation.Roll = SelectFloatReturn / 3.0f;
    }
    else
    {
        SelectFloat();
        ServerSetViewRotation();
/*        ViewRotation.Roll = SelectFloatReturn / 3.0f;*/
    }```
urban dew
#

Having an issue in multiplayer, 2nd client freezes and crashes on map start

#

it doesnt happen in editor testing

#

best way to debug it?

#

client freezes and wont even alt f4

raven viper
#

Hi!Ε±

#

Anyone here has worked with cpp http requests?

urban dew
#

has anyone else experienced this?

#

im wanting to know what could be causing it

cedar trellis
#

Hello here! I have been looking for guides/tutorials to set up a LAN party game system from scratch in UE4 but didn't find any good resources so far. Does somebody have some advice on that? Thank you πŸ˜ƒ

twin juniper
#

I know a udemy class that goes through just that, plus many other very useful multiplayer aspects + intro into working with steam, if ur willing to muster up 12 bucks or something like that for it

cedar trellis
#

Ah, I'll dig into Udemy then πŸ˜ƒ Thank you

twin juniper
#

you could just ask for a link

#

it aint rude

cedar trellis
#

...Well, if you have one I wouldn't say no XD

twin juniper
#

They have the course in blueprints or c++

#

what do u prefer?

cedar trellis
#

Mostly BP

twin juniper
#

Damn I lied, theyo nly have it in c++

cedar trellis
#

Eeeek :p

twin juniper
#

I have

cedar trellis
#

Well, I'm no programmer but can give a try

twin juniper
#

the perfect thing for you

#

there is a plugin

#

fully blueprint

cedar trellis
#

link?

twin juniper
#

Its host + join server button

#

u can study it

#

let me find it one sec

cedar trellis
#

Yeah I prefer the step by step hand-holding of tutorials, but if reverse-engineering is the only option I'll take it :p

twin juniper
#

A lot of multiplayer stuff is figure out on ur own thing

#

not a lot of coverage

#

what do you think this is? the unity community?

cedar trellis
#

rofl πŸ˜„

twin juniper
#

Alright so

#

I have no clue where to find it, but I have a copy of it on my computer

cedar trellis
#

I just wanna make a spectator camera option for a second computer πŸ˜„

twin juniper
#

so can send u the file directly

cedar trellis
#

Sure πŸ˜ƒ

twin juniper
#

Uploading the file as we speak, will pm it you

cedar trellis
#

XD

twin juniper
#

πŸ˜„

cedar trellis
#

Comforting.

twin juniper
#

thank you

cedar trellis
#

Will this make me drop all my loot on the map?

twin juniper
#

will make you drop your pants

cedar trellis
#

Indie devs have no pants.

twin juniper
#

check ur pms

tribal shell
#

searching someone for replication bp (i will pay)

fossil spoke
urban dew
#

I've done more testing, this is what the 2nd player looks like
their game just freezes and crashes
it only happens when I have an event handle start new player

#

anyone know why event handle start new player is causing this?

twin juniper
#

Can we see some code in said function?

limber mortar
plush granite
#

How do I set the Online Subsystem?

limber mortar
#

I feel like my line trace should hit that firestop volume
return a valid actor
and not generate flame
but it keeps generating flame. There is a switch has authority in front of the line trace

#

think I got it

twin juniper
#

@plush granite you do that in the DefaultEngine.ini file

limber mortar
#

yes I tested with a bigger volume and fixed it

plush granite
#

@twin juniper Dude Ive tried everything to get it to not load the native OSS on iOS

fleet raven
#

just disable the plugin

#

it can't load if it does not exist

plush granite
#

How do I do that??

fleet raven
#

plugins manager?

plush granite
#

wow thanks

twin juniper
#

or where/what do i click into to investigate?

fossil spoke
#

Your accessing a index outside of the bounds of an Array.

#

This will typically only happen with C++ code, as the BPVM will catch that type of exception.

twin juniper
#

@twin juniper If a variable might be null or empty, always check first

#

that goes for arrays too

#

if(array.Num() > 0) use array

potent prairie
#

also I dont think server can grab player controller at index 0 in multiplayer games

#

pretty sure you should be casting to the player's controller and running the travel command in there from the server

#

or rather maybe first cast to gamemode from the overlap authority, and then the gamemode casts to the player controller and runs the travel command there?

twin juniper
#

this was working in 4.20 i haven't checked it in a while. Idk what i could've done to break it because I haven't touched it. Possibly some variable elsewhere in the character bp is trying to carry over and failing idek. Half of what you two said makes sense i'm noobie thanks. @fossil spoke @twin juniper is \containers/array.h somewhere I can click into to read what it's complaining about where is line:611 is it a line of code somewhere I'm BP

#

How big is your code?

#

If its not too much, Im sure its not hard to figure out where you are using arrays

#

And from 4.20 to 4.22, some engine stuff changes

#

You might be using something deprecated

#

@twin juniper

urban dew
#

@fossil spoke how long does it have to be before I repost my question?

fossil spoke
#

If its still on the page wait until its buried behind the Load Messages thing

twin juniper
#

His question is fairly buried to be honest πŸ˜„

potent prairie
#

it wont work if you're trying to access player controller at index 0

urban dew
#

im confused on if i can share it or not :now :3

#

ill wait another hour

#

but god dam it im so fucked rn, no idea what is wrong

potent prairie
#

@twin juniper try it with the method I outlined. If you get the same crash, then it's a crash caused from another part of the game

limber mortar
twin juniper
twin juniper
#

@potent prairie casting to player controller what is the object?

#

controller pawn

potent prairie
#

With the overlap you can get the overlapping actor/character, cast to its controller from there, send the controller to the gamemode, gamemode calls the teleport function from the player controller

#

Thats how I do it

urban dew
#

im so confused

#

can I do this from the gamemode or not?

#

because it works in editor

#

but not in a built client

#

maybe the rts controller hasnt actually spawned yet?

potent prairie
#

I would do that on the onpostogin because yeah maybe it hasnt spawned yet

#

Wouldnt*

urban dew
#

i tried onpostlogin

#

and it was crashing the game for the non host

potent prairie
#

Yeah add a small delay see if the crash stops

#

But you probably shouldnt be doing that particular function from the onpostlogin

torpid girder
#

I am trying to find out how I can authenticate players, right now in development I use device I'd,

timid moss
#

Hello guys. I am trying to understand the whole sessions system right now and right now my goal is to be able to have a UI where you can host a Session and then have another computer find that Session after it is made, and then join it, putting them in the same level. So I notice most people do this using the steam online subsystem with a listening server, but for me I want to use a dedicated server with the null subsystem. So my question is, is this possible to do it this way rather then doin it with the steam online subsystem with listening server?

winged badger
#

@urban dew that is not a BlueprintImplementableEvent, that is a BlueprintNativeEvent

#

HandleStartingNewPlayer

#

which means there is a default implementation in c++

#

and unless you feel like doing the whole thing by hand in BP you have to call parent function

#

@potent prairie server can always get something with GetPlayerController[0]

#

what depends on the type of server really, but it is better to avoid that function unless you understand exactly what it does

#

and once you do, you don't really need it, so there is that

potent prairie
#

Yeah I know I just think its easier to tell people not to use it at all for multiplayer games. As you said you dont really need it

winged badger
#

its confusing enough to most without someone saying also I dont think server can grab player controller at index 0 in multiplayer games though πŸ˜„

#

two most common mistakes are: using it on dedicated server, and assuming that it will have the same return on server and client if connected to an RPC

potent prairie
#

Im used to working with ded servers thats why i said that but youre right

north swan
#

Hi guys. How would I go about DisableInput() on a dedicated server? calling it on client or server doesnt work either way for me

north swan
#

Oh, I think I got it. I failed ofc.

dense ocean
#

Anyone have issues with steam subsystem suddenly not working?

#

I'd appreciate any ideas

timid moss
#

Guys does the "open [ipAddress]" console command require a session to be made? Like will I not be able to join a server using that console command if I don't create an official session using the create session node?

wanton pebble
#

this only happens on my client

#

FPS is fine

#

what could be the issue?

#

(time dilation .25)

plush granite
#

LogModuleManager: Warning: ModuleManager: Module 'OnlineSubsystemIOS' not found - its StaticallyLinkedModuleInitializers function is null.
I get this warning on my iOS device. This is because I unchecked enabled from the plugins manager.
I'd like to keep the "Online SubSystem iOS" plugin enabled and just have it NOT load instead, anyone know how I can do this?

urban dew
#

im getting an issue with "event handle starting new player" the 2nd person to join the servers game freezes and crashes

#

does anyone have any idea how to fix, i have no idea what is causing it

#

the host works fine

#

(only host works, all other players freeze)

wheat eagle
#

Hello I'm trying to activate the steam Invite UI when a button is pressed and I tried using "show invite UI" from advanced sessions but nothing happens. I'm running the game as standalone and I'm connected to steam.

winged badger
#

@urban dew i told you what you need to do... twice

urban dew
#

you told me about onpostlogin, im using starting new player now

#

it seems to work better except the freeze

#

im not sure what you mean by calling the parent function?

winged badger
#

right click the node, add call to parent

#

and no, i didn't tell you about PostLogin

#

without it, this piece of code doesn't run

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();
            }
        }
    }
}
lime skiff
#

Being a beginner with UE4 multiplayer: Epics online game service will support Player data storage ( https://trello.com/b/ZR7VrLb3/epic-online-services-roadmap ). This leads me to the question: Do you know, if it is feasable to use the object reference feature of Unreals save system for storing persistent player data on a server (e.g. with GameInstance as root) - i.e. storing UE4 save files directly in the player data storage? I'd like to avoid a manual conversion of object references -> text data (e.g. database) when saving and text data -> construct objects when loading since UE4 save system does this already very well (I've used it only locally so far).

urban dew
#

@winged badger would I add it like you did? or add it at the end of all my blueprint?

winged badger
#

doesn't matter in this case

#

unless

#

you want to reference the Pawn via Controller, then it would be better to run the parent first

urban dew
#

@winged badger You are an incredible human being, If I wasn't already married I would profess my love to you now

#

thank you so much!

hushed loom
#

I have a question how to handle the matchmaking

#

?

twin juniper
#

That is the most vague and broad question ever asking in the history of his discord

urban dew
#

First, you see how many players are wanting to join, when enough players, you make them join a server together.