#multiplayer

1 messages · Page 518 of 1

rich ridge
#

And call interface functions

hollow iris
#

Yea, that sounds spicy. Haha

rich ridge
#

That's the approach which makes code testable

hollow iris
#

Implementing interfaces in C++ was giving me problems, looks like I'm gonna have to take another stab at it.

rich ridge
#

No I m doing the same thing and using interface to interact with no problem

hollow iris
#

I think I was just setting it up wrong tbh.

rich ridge
#

Check this out how I m using interface to do API call, and my API call is inside some viewmodel

#

My work is still incomplete

#

But few parts are working

hollow iris
#

Thanks! Will look into it. 🙂 Hard to find good references online.

#

Always love seeing how different people are coding. Haha

rich ridge
#

My design is inspired from MVVM pattern

hollow iris
#

(Had to google that.) That is very similar to the approach I have been taking lately.

rich ridge
#

Cool

rotund sail
#

Hello! Are there some best practices for replicating shooting? I'm not simulating balistics, so I just send hitposition to server which then validates whether there aren't any obstacles in the way. For broadcasting the shot to everyone, I'm currently torn between using RPC or replicated property. For multicast RPCs, I can't exclude the owner client, which needlessly consumes bandwidth (I already play all impact effects the moment the player shoots to avoid visible lag). However, with property replication, it will replicate each player's last shot to players who have just joined the game, even if the the shooting happened minutes ago.

winged badger
#

what kind of a game @rotund sail

rotund sail
#

Multiplayer shooter?

#

Or what do you mean?

winged badger
#

FPS, TPS, isometric camera?

rotund sail
#

TPS

winged badger
#

how many bullets do you expect to fly around?

rotund sail
#

Well, there are SMGs, so I'm trying to be conscious about bandwidth

winged badger
#

so not expecting people to be waist deep in bullet shells after 5 minutes?

rotund sail
#

The main focus will be PVE, so there will be situations where a player is shooting mobs, while no other players are around - which is a strike one for RPCs

#

Hopefully not! :D

winged badger
#

you can't use a replicated property to nofity server of somethign

rotund sail
#

Oh I know, I'm mainly talking about replicating from server to other players

#

I use RPC to let the server know I shot at something already

winged badger
#

Multicasts will check relevancy

rotund sail
#

(Sorry, should have clarified)

#

But the relevancy for multicasts is only distance to the source, isn't it? Or can you make a multicast that is not relevant to the owner client?

winged badger
#

but with a replicated property its pretty awkward replicating the instant effect properly

unique kelp
#

well, you can solve both of those issues, but of course it needs additional info, which is not ideal

rancid barn
#

you can do an owner check

rotund sail
#

But the owner check is done only after receiving the multicast on the client

winged badger
#

it is

rotund sail
#

Which means the RPC was already triggered and bandwidth used

rancid barn
#

you still need to inform the client that their shot was correct

#

so that you can correct if it was wrong

winged badger
#

here is the most obvious problem with replicated property: its callbacks will execute when they don't need to, causing stuff like dead monster playing dying montage from OnRep_Dead to get up and play its dying montage when you run into relevancy range

rotund sail
#

I'm not too concerned about showing blood on the target's face even when the shot actually missed, honestly

#

Yeah, that's what I bums me out about using the properties :/

winged badger
#

i do full simulation on my simulated proxies

#

they do get few things from the server (target/targetvector, firing mode, trigger pressed)

#

and then they guess the rest

#

my game is a isometric camera 8 man coop shooter that uses among other things, weapons like miniguns

#

so i can totally get away with it

#

i only do reduced damage in simulation to lower the chance of server having to correct any visible healthbar upwards

rancid barn
#

that's clever

rotund sail
#

Yeah, I thought about just replicating trigger pressed/released and having clients guess from the direction the gun is pointed... but that could lead to watching the player missing every shot, yet the mob falls dead

#

If it was pure PVE, I could get away with that, but there is PVP aspect too, even if not as prevalent

winged badger
#

it depends a lot on how many players, how many bullets

#

but with PVP part you'll need to replicate them

#

either way

rotund sail
#

I just find it strange that you can set property replication to ignore owner, but not multicast RPC

winged badger
#

strongly recommend giving the validations on server some room to fuck up tho

#

like validating line of sight by throwing a trace to target 30+ UU short of target and declaring it a success if you didn't hit anything

rotund sail
#

Oh I do validate it

winged badger
#

point being: it will keep occasionally failing if you don't leave room for error

#

when it shouldn't

rotund sail
#

Currently, for the owner -> server, I have two RPCs, actually. One for missed shots - those have no validation, server just replicates them (because who cares). One for hits - then I send the pointer to the target actor, along with relative location

#

So I'm not telling the server "I've hit something at this point in the world" but rather "I've hit this mob/player in the head"

#

The only time the validation of that can fail is if the mob has moved behind an obstacle before the RPC arrived on the server

rancid barn
#

I actually have a quick question, I noticed when my client spawn an actor for itself (for visualization/menu purposes) that the localrole for the client is ROLE_Authority

#

this breaks all of the authority gates I have on whatever actor is getting spawned

#

is there a built-in way to just hard tell if someone is a client or not? Without it being relative to whatever spawned the object?

winged badger
#

netmode

rancid barn
#

would it be (myactor::GetNetMode() == client)?

winged badger
#

but it generally shouldn't matter if the locally spawned actor think it has authority

#

because it does

#

its not static

#

so myactor->GetNetMode()

rancid barn
#

The specific case is that it's a card game. Players have cards in their hand and on field, and the server spawns and manages these. You can, for example, search for a card in your deck and the selection option brings up cards, but only for you. Normally I have authority gates on any of the card movement logic because the cards moving is purely cosmetic (the server just does all the rules by looking at arrays)

#

so if I spawn a local "UI" card, the movement logic all gets turned off, because all the movement is gated behind role < authority

#

So yeah I guess I'll need to use GetNetMode

#

looks like that worked, thanks!

zenith yarrow
thin stratus
#

If the API doesn't list a call, then no.

zenith yarrow
#

@thin stratus yup checked the API, there was nothing to cancel the invite. I was wondering if anyone has done anything related to cancelling the invite before, thanks for checking though...

bitter oriole
#

There is no option in the Steam client to cancel an invite

#

If there's no API either it means it's simply not a thing

dire cradle
#

How can I make camera shakes not replicate? They play on both server and client without a replicated event

bitter oriole
#

I'm pretty sure they don't, tbh

dire cradle
#

I just realised its not the camera shakes being replicated but its the function that they're in. Its supposed to only execute on the owning machine and not replicate to others

#

But it plays on everyone

bitter oriole
#

Yeah

#

You probably call it everywhere

#

Things don't accidentally replicate

dire cradle
#

After a little bit more inspection I found it's not replicating, a variable that should be unique for everyone is always same for everyone which causes the problem.

#

I thought camera shakes are being replicated but its something totally different

bitter oriole
#

Nothing at a level lower than gameplay framework replicates at all, generally speaking

#

Meaning other than stuff like pawn, player controller, game mode...

#

Basic classes and engine feature never have any replication at all

chrome bay
#

Playing camera shakes is a client RPC

#

Unreliable, thankfully, but an RPC nonetheless. If you call it from the Server it'll cost a bit. Calling it locally client-side is fine though

#

UGameplayStatics::PlayWorldCameraShake() legit results in sending an RPC to all the players.

bitter oriole
#

If you call that specific camera shake utility

dire cradle
#

This is a pure function that should return the state of the player with booleans, the problem is it returns the same values for everyone. How can I make this function unique to everyone?

chrome bay
#

Yeah depends what you're using to play the shake

bold dune
#

That won't unique. I imagine there's something wrong with your logic elsewhere.

dire cradle
#

I'm not sure where the problem is, I tested the function by itself and it works correctly, unique for everyone. But when I use it inside another function it returns the same values for everyone. I have no clue

twin juniper
#

I'm trying to setup the Steam subsystem, in the logs I can see that it returns sessions when I use the "Find Sessions" node in BP, but they're all from different projects, I'm using the default 480 app id.
What project configuration am I missing?

rocky totem
#

if i want to spawn an actor for only a single client can they just call spawnactor locally?

ivory lintel
#

@rocky totem maybe you need to do a RPC to the server and then make other RPC to own client

#

====

hey guys...i'm trying to do a multiplayer action combat system
I'm getting my targets doing a trace that run on server after called on anim notify state in client side

#

sometimes I notice that miss some hits....the animation is playing but don't do damage or getting the target

#

whats the better way to do this?

#

all RPC that involve damage and getting targets already checked as reliable

misty spruce
#

Can somebody give me advice on developing a multiplayer game on UE4? I've seen tutorials on using steam and using source code. These appear really complicated. Is there an easier way to host a game? Can discord host a game I've developed since it has server capabilities? I'm not seeing hardly any tutorials on integration using UE4 with discord?

bitter oriole
#

Some basic answers : Discord doesn't host games, Steam doesn't host games, and you probably don't want to host games

#

If you're doing a multiplayer game, do a simple one that's not competitive (PVP) and use listen servers

#

No source code required

hoary lark
#

yes you can spawn a local actor @rocky totem

if you want to have your own private appid @twin juniper ... well, you have to buy your own appid lol

#

it's giving you games using appid 480 HaroldHaha

twin juniper
#

you've never done multiplayer have you 😄

#

admit it!

#

steam expects more info, like a project name, and with that it would return the right servers to me

#

What appid does shooter game use anyways? I've seen its not 480

misty spruce
#

Thanks Stranger! My plan was to do a simple multiplayer third person shooter with 2-3 players just with friends on different computers. Either I would host the game and they would join or with game copies they could host the game and play among themselves. Yet, everything I'm seeing appears to limit the hosting to myself. Do you have any recommendations of any good tutorials that would allow simple server set up as you suggest?

bitter oriole
#

Look up listen servers in UE4

#

No separate server at all, just one player acting as host

misty spruce
#

Thanks! I'll check it out

hoary sandal
#

how can I identify two different actors with the same class in a multiplayer game

#

I'm spawning these actors and I'm using the player ID to associate an owner

#

the problem is inside the actor I want to run different logic base on which client spawn it

#

initially I was going to do an authority check but this has to run on a dedicated server

misty spruce
#

With the exception of a vague brief UE4 documentation page, I'm not having much luck finding tutorials on listen servers. Everything is focused on steam dedicated servers. There are plenty of tutorials telling how to setup projects for steam servers, but they don't show how they work with steam when completed. I have a bunch of noob questions like, do I upload my game to steam and people access it there? Or do people access my game through my computer? If they are accessing my computer through steam what's the point of steam? Do I need to buy server hardware to host a game if its through my computer? If I'm the server, can my friends access the server when I'm not there?

cunning vale
#

steam allows people to download your game

misty spruce
#

More questions... What is this whole steam ID thing? Is this limited to people who want to sell games? What if I want to just use steam to host a free game for a few friends? What are the requirements for getting the steam ID?

cunning vale
#

and steam allows your players to advertise their games to each other

#

someone will still need to host the server

#

if you host a server on your computer it has to be on to keep working

#

steam id is a number you get from steam when you pay them to put your game on their store

#

if you just want to play a game with some friends you don't need steam at all

#

using the steam infrastructure is limited to people that want to sell games yes

#

but you likely don't need it

misty spruce
#

Thanks Thexa you answered many of my questions! What do you recommend besides steam if I'm not planning on selling?

cunning vale
#

use the null subsystem and connect to each other directly by ip

#

so basically use the defaults

misty spruce
#

do you have any tutorials you'd recommend that deal with this

cunning vale
#

I mainly have experience with steam, not so much with unreal, sorry

misty spruce
#

no problem, thanks for your help!

cunning vale
#

good luck!

limber gyro
#

Guys, having a bit of an issue replicating a variable, its a simple INT inside the character class that get incremented when the player lands a projectile hit

#

before spawning the projectile there is a owner var that is set, so i spawn the bullet inside the character with an RPC and i set the bullet owner like, owner-this;

#

cant do the arrow cause my keyboard is dumb

#

it works the first time the player is hit and it stops working after i change its value

#

debuging tells me that the server and the other clients still think the varaible holds the same value before i changed it localy

#

but i set it to replicate properly

hoary lark
#

Are you trying to set a variable in a client and have the server know the value? Variable replication only goes from server to clients, never the opposite. RPCs are the only route to move data "uphill" to the server

limber gyro
#

ye thats what i figured with a little test that i just did

#

i thought they went both ways

#

is there anyways i can make the server change it without having to call an rpc, i mean its a bit annoying to make a method just to var=0;

misty spruce
#

when first getting into designing online multiplayer games is it better to stick with blue prints or do I need to start learning how to code c++? Blue prints seem easier and have more tutorials whereas I'm struggling to find much in the way of C++ in UE tutorials.

grim pelican
#

I'm gonna lose my mind. Does anyone know how to replicate root motion?

#

I've tried with the anim blueprint

cerulean escarp
#

I'm trying to test out server joining with a packaged game but whenever I launch my dedicated server from the editor and try to join from the packaged game it can't find the server. when I get on the client that launches in the editor it finds the server as expected. any ideas why this is happening?

dark edge
#

@hoary sandal Calculate whatever ID you want it to have on the server and set it from there.

cerulean escarp
#

I should probably note that when trying to directly join using the dedicated server's IP and port, it throws a PendingConnectionFailure

dark edge
#

Same machine or 2 different machiens?

cerulean escarp
#

same machine

dark edge
#

What are you joining, Lan IP, Wan IP, 127.0.0.1, or localhost?

cerulean escarp
#

I believe Lan or Wan IP

dark edge
#

Those 2 are different.

#

I'm asking are you trying to join a 192.168.X.X IP or your public external IP?

cerulean escarp
#

whatever the one that the dedicated server log says it's running on

#

192.168

dark edge
#

hmm

#

Try these scripts, can you start and join this way? Doesn't fire up the editor, just launches game standalones.

#

You gotta edit for your version and uproject file.

cerulean escarp
#

I'll try

cerulean escarp
#

well the server showed up and I could join

#

although when I joined the game it didn't seem to load the map properly so I'll have to take a look into that

#

thank you!

#

nvm I forgot to change the map name

#

I can't seem to join from a packaged game still

#

only from the editor or if I run the .bat you gave me

#

ah I found the issue

#

if a client with steam enabled tries to join, they get immediately kicked from the server

median marten
#

Hi all, any idea is ACharacter::Crouch network replicated?

frank portal
#

@median marten yea it is replicated

hoary sandal
#

the mesh is invisible the collision is there and everything is updating

#

when I try actor instead everything works just fine

median marten
#

@frank portal Thanks!

gritty pelican
#

TreesStaticMesh = NewObject<UStaticMeshComponent>(this, UStaticMeshComponent::StaticClass());Will it be created everywhere if I create an object on the server?

#

Or I will need to re-create on the client

hoary sandal
#

@dark edge as far as I know the ID lives on the player state, you mean that I should get it and pass that as an integer to the player character?

dark edge
#

@hoary sandal I mean whatever way you're calling them Thing1 and Thing2, just make it a replicated variable on the actor and let the server set it

sand tangle
#

Hi! I could need some assistance in getting projectiles replicated from client -> client/Server. Server -> Client works.

My Code: https://pastebin.com/6MHv28rw

#

Do I need to have Reliable Server Functions for LineTraceFire() and ProjectileFire() ?

sand tangle
#
void AWeaponMaster::ServerLineTraceFire_Implementation()
{
    LineTraceFire();
}

bool AWeaponMaster::ServerLineTraceFire_Validate()
{
    return true;
}

void AWeaponMaster::ServerProjectileFire_Implementation()
{
    ProjectileFire();
}

bool AWeaponMaster::ServerProjectileFire_Validate()
{
    return true;
}
#
void AWeaponMaster::ProjectileFire()
{
        if (GetLocalRole() < ROLE_Authority)
        {
            ServerProjectileFire();
        }

        if (ProjectileClass != NULL)
        {
            FVector MFloc = WeaponMesh->GetSocketLocation("MF");
            FRotator MFRot = WeaponMesh->GetSocketRotation("MF");
            FActorSpawnParameters SpawnParams;
            SpawnParams.Owner = this;
            SpawnParams.Instigator = GetInstigator();
            AProjectileMaster* const Projectile = GetWorld()->SpawnActor<AProjectileMaster>(ProjectileClass, MFloc, MFRot, SpawnParams);
            WeaponData.CurrentAmmo -= WeaponData.ShotCost;
            LastFireTime = GetWorld()->TimeSeconds;
        }
}
#

or am I doing something wrong now?

chrome bay
#

Well at the moment if you call ProjectileFire() on the client, both the client and the Server will spawn projectiles

sand tangle
#

hmm

chrome bay
#

Probably want this:

{
    if (ProjectileClass)
    {
        if (GetLocalRole() < ROLE_Authority)
        {
            ServerProjectileFire();
        }
        else
        {
            DoFiringStuff
        }
        }
}```
#

Have a look at the ShooterGame weapons

#

Bit outdated but same principle

sand tangle
#

Thanks! I will look at the ShooterGame Example. One question though

#

in my Projectile Class I'm trying to add this with #include "Net/UnrealNetwork.h" in the header-file: ```
void AProjectileMaster::GetLifetimeReplicatedProps(TArray< FLifetimeProperty >& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(AProjectileMaster, ProjectileMesh);
DOREPLIFETIME(AProjectileMaster, ProjectileMovement);
}

#

I'm getting error: Member function not declared

#

why?

chrome bay
#

I suspect you need to declare GetLifetimeReplicatedProps() in the header

#

Also move that include and code to the CPP not the header

sand tangle
#

I didn't need to declare it in Character or Weapon class :/

bitter oriole
#

First things first, move it to cpp

sand tangle
#

that's done

bitter oriole
#

Make sure ProjectileMesh & ProjectileMovement are UPROPERTY(Replicated)

#

And IIRC, rep notify don't trigger the declaration of GetLifetimeReplicatedProps(), so you need one regular Replicated UPROPERTY

#

Or declare it yourself

sand tangle
#

Aha, okey 🙂

meager spade
#

^Rep notify does triggger it at least in 4.24

bitter oriole
#

Ah, that's nice

#

Used to be that it didn't and you needed at least one regular Replicated in the class or parent

ivory lintel
#

Hey guys...i'm trying to do a multiplayer action combat system
I'm getting my targets doing a trace that run on server after called on anim notify state in client side
sometimes I notice that miss some hits....the animation is playing but don't do damage or getting the target
whats the better way to do this?
all RPC that involve damage and getting targets already checked as reliable

chrome bay
#

Does anybody know where the default properties are set for UNetDriver?

#

Things like NetServerMaxTickRate and bClampListenServerTickRate etc.?

#

Can't seem to find where the defaults are kept

#

Oh wait, nvm

fleet raven
#

so is that "add client" button in PIE supposed to work?

#

it just crashes the editor whenever I use it

#

did the same in 4.23

chrome bay
#

There's a button for that? I had no idea

fleet raven
#

it appeared in 4.23 but as far as I know it never actually worked

winged badger
#

i did see it working

#

but never used it myself

#

it was a very basic networking project, on TPS template tho

#

it was 4.23

lavish pulsar
#

hi
since i can't ask every player to change his port to 7777 on my listen server game
can i "port forward" their routers using c++

hoary lark
#

Only the host has to do it.

#

If you really wanted you might be able to implement upnp into unreal but many people who know what upnp is really don't like it affecting their network devices

dire thunder
#

is there a simple way (other than epicleaderboard) to create an online leaderboard that is multiplatform? or if the only way is complex does anyone have a way to do it (ie documentation or tutorial). Ive looked around for a while and the only one i can find is epicleaderboard but it is abandoned and doesnt have features i need

lavish pulsar
#

@hoary lark more informations about the upnp method please

winged badger
#

whats wrong with using steam?

#

its socket connection will do NAT punchtrough automatically

#

but in any case - to avoid port forwarding you do need at least one publicly exposed server to make introductions

ivory lintel
bronze arch
#

Guys how i can find more info about UE4.21 "DDoS Detection and Mitigation"?

meager spade
#

@ivory lintel UE4 can do anything if you want it too

ivory lintel
#

I am trying to do a multiplayer action combat and dont like replication results

bitter oriole
#

You'll probably want your own movement replication entirely for something that's not a FPS/TPS type game

random verge
#

@bronze arch proper ddos mitigation is usually at the hardware level, not so much directly in your application.

#

you would do that in the firewall normally

ivory lintel
#

Standard movement component is for fps or tps only?

bronze arch
#

i know but i want to also use that for UE4

bitter oriole
#

@ivory lintel It's a general purpose movement system, primarily used in Fortnite (now) and in Paragon, and UT (before)

random verge
#

why? software attempts at preventing ddos attacks will be inferior and honestly unneccessary

bronze arch
#

so thats useless option ? thonk

#

then why they did that

random verge
#

if your game will be hosted on professional servers, they will also be behind hardware firewalls which are incredibly powerful.

bitter oriole
#

@ivory lintel It's a good option for games where characters are walking, which is a lot of games. If you need something very fast-paced with a lot of ability-based actions, it's not really ready for use as is

#

You can try doing changes to it etc

random verge
#

to be honest, having your application attempt to handle a ddos attack is probably going to only make it worse lol. having a firewall solution simply denies the traffic all together.

ivory lintel
#

I want to do a combat like warframe or devil my cry

#

In multiplayer...just a simple 1x1 its good

bronze arch
#

i see, thanks then i'll leave that option

bitter oriole
#

There is nothing simple about multiplayer, ever. 1v1 isn't much simpler than 10v10

#

You'll need some work

#

Movement is half of a good game

twin juniper
#

movement is the less trouble thing

bitter oriole
#

You can look at Anthem for a game that spent something like 50 man-years working on movement alone

ivory lintel
#

I have some working on my system

#

This alright handle collisions per bone

twin juniper
#

hope its not the whole skeleton

ivory lintel
#

All things working fine. Works with AI and 1x1 or similar

#

Have frontal block

#

Stats like HP, MP a and SP

#

Dashes etc

#

Do YouTube can see a short video To help me improve the system?

#

Do you*

limber gyro
#

ops

#

wrong discord

chrome bay
limber gyro
#

sorry

#

can some one delete that post

#

nvm i just did

chrome bay
#

Not only does it seem to completely bypass the Max Rate setting (hits like 24Kbps), it also seems to handle saturation a lot better.

#

That said, I'm sure the legacy net driver used to be able to handle higher spawn rates. Maybe it's a bug in 4.24

fleet raven
#

the replication graph example code is really bad

chrome bay
#

That's just the shootergame one

fleet raven
#

yeah

chrome bay
#

But either way I didn't expect the difference between the legacy driver and the rep graph driver to be so stark

#

As in how it handles saturation etc.

fleet raven
#

you got epic things like

chrome bay
#

It's the editor environment so take it with a pinch of salt, but Rep Graph seems a lot more resilient

fleet raven
#

ok? why? what does that do? how is this useful example code?

chrome bay
#

Hah yeah, I found out why that is in a 3rd-party video

#

Apparently Rep Graph doesn't like it when you create a very large rep-list on the fly. Not really explained though..

fleet raven
#

and what's with the seemingly random numbers?

chrome bay
#

Hell knows

misty spruce
#

I'm trying to package a project but I keep getting this error and the package fails. What is causing this?

#

UATHelper: Packaging (Windows (32-bit)): ERROR: System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Users\Owner\Documents\Unreal Projects\MultiDemoBackUp1\MultiplayerTemplate 4.21\Intermediate\Build\BuildRules\MultiDemoBackUp1ModuleRules.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

bronze arch
#

Ladies and gentlemens, im stucked about that much bytes send from UE4 replicated movement system. Guess i missed optimization about that?
Server side AI actor makes 17461 bytes from replicatedmovement component
thats so much bytes than RPC's.
Need your help. thanks!

#

also was 20frame net update while profiling this (Imagine 100netfreq with this bytes asweat )

meager spade
#

that seems about right

bronze arch
#

Really o.O why so much bytes for just location and rotation vector3

meager spade
#

how many AI?

bronze arch
#

4

meager spade
#

framerate?

#

oh you capped it to 25

bronze arch
#

netfruency?

meager spade
#

20*

bronze arch
#

yeah its 20

meager spade
#

net priority should be 1

bronze arch
#

but then sometime attack rpcs doesnt work

meager spade
#

that does not affect rpc's

#

RPC's are seperate

bronze arch
#

mean replication graph

#

oh really

meager spade
#

yes RPC's are sent and processed seperatly

#

the replication of the actual actor, and its properties is those values above

bronze arch
#

so whats work with net priority? is for movement?

meager spade
#

no net priority is how often that actual actor will replicate

bronze arch
#

ah yeah you also mean replicated variables

jolly siren
#

Net update frequency does affect unreliable multicasts. But no other rpcs

meager spade
#

^ i remember that now, thanks for jogging my memory

jolly siren
#

np 🙂

meager spade
#

@bronze arch what is the actual thing thats costing

#

replicatedmovement property

bronze arch
#

so thats why it doesnt work multicast attacks when i set priority 1

meager spade
#

by the looks of it

#

ReplicatedMovement is a property on AActor

bronze arch
#

just using ai move to

meager spade
#
    struct FRepMovement ReplicatedMovement;```
#

this is what is costing you

#

probably around 40bytes tho per Actor per Replication

#

but your values is the combined

#

not the single value

#

1016 times

#

that property replicated

#

and that value is the total

#

which is 17 bytes

#

per property

#

compressed

#

which is good, so what is the problem?

bronze arch
#

i thought maybe there some more compression or optimization for that

meager spade
#

nope

#

its already compressed

#

and optimized

#

FRepMovement contains quite a bit

#

LinearVelocity, AngularVelocity, Location, Rotation, plus some enums. so 17bytes is pretty good

#

what you could do if your not worried about precision

#

adjust these

#

but if things break, don't blame me 😄

bronze arch
#

i see, but i saw some setting on here "save bandwith"
thought maybe i can save some bandwith, well

meager spade
#

i mean your issue is not that

#

you highlighted a single property

#

as being super high

#

we have 100 ai

bronze arch
meager spade
#

and we didn't change anything, and have 0 issues

#

bandwidth is good aswell

#

think you are over thinking it

#

and over optimizing for no reason

bronze arch
#

okay im calming down, sorry :D was overreacted for that

#

im also learned some infos about that. Thanks mate

meager spade
#

np

#

once you have the game in a good working state

#

i would then profile your net performance

#

and see 🙂

twin juniper
#

you use some database @meager spade?

meager spade
#

no, not yet at least

stark hull
#

Has anyone tried Live Coding with C++ Multiplayer? Everytime I compile it seems that it doesn't get the latest changes :/

#

I'm on 4.24

cedar finch
#

If anyone knows of a way to create the classic "Mirror light reflection puzzle" in multiplayer please let me know. I can't seem to get the light to replicate correctly. When the light reflects it sometimes isnt synced up over the network. https://i.gyazo.com/8aadf20034948fb475f949a0e2dc69b3.jpg

dark edge
#

@cedar finch Beam traces with reflection?

#

er line traces rather

cedar finch
#

i'm using linetraces but I can't get the replication perfect for when it reflects. It seems to be off by a little bit as you can see in my picture above.

dark edge
#

@cedar finch You need to double check the geometry of the reflectors and the trace vectors

#

Or just do the tracing on the server and send results to clients

#

I'd start by printing the rotation of the reflectors and all the trace directions and looking for inconsistencies.

twin juniper
#

If I program the server side for "spawn projectile" and in the player controller i use "spawn projectile multicast" will it work? trying but not working still trying to understand server-client diagram

desert glacier
#

Try a Run on server with a switch has autority in The Two Bluprint (Player controller and The other)

twin juniper
#

do you have a recommendation what other blueprint should be? @desert glacier

#

can i use both sides in the controller?

twin juniper
desert glacier
#

OK, So just the player controller

thin stratus
#

@twin juniper

  1. Multicast on PlayerController makes no sense, it only exists on a maximum of two entities, Server and OwningClient.
  2. Replicated Actors should only be spawned from the Server.
twin juniper
#

and i was downloading your compendium 5 minutes ago just because im stuck on that lol

thin stratus
#
  1. Try to never use GetPlayerController or GetPlayerCharacter unless you are 100% sure that you are referencing the correct controller/char. You should otherwise always get the controller/char from the current actor, given it supports it.
#

E.g. if you are inside of the Character, on the Server, and you want the controller of that character, you use GetController. If you'd use GetPlayerController0, you would end up with the server's PC, which is wrong.

twin juniper
#

I understand, is that why virtual joystick always controls the server?

#

Keyboard input replicates but not virtual joystick

thin stratus
#

If you are referencing the controller via GetPlayerController, then that could cause this,yes

#

If you are already in the PC just use "self"

#

That references the instance of the object you are currently in

twin juniper
#

I understand now, thanks a lot

lavish pulsar
#

@thin stratus your ue4 networking pdf document helped me a lot
i recommend it for everyone

thin stratus
#

Glad it helps (:

twin juniper
#

i read your compendium, finished the RPCs and ownership and still confused about what should i use for my movement input @thin stratus (sorry if i disturbing you by adding @ )

#

virtual joystick is only activated by project settings, and using server side to execute and using client replication to send it to server

thin stratus
#

What are you even controlling with these

twin juniper
thin stratus
#

If they are characters then it's enough to just call AddMovementInput.

#

The CharacterMovementComponent deals with replication of input

twin juniper
#

it is already, still not working and also other one is "set control rotation" and its not working too

jolly siren
#

Does FTransform_NetQuantize strip scale?

meager spade
#

never heard of FTransform_NetQuantize

jolly siren
#

ah you are right, sorry that's our own custom type 😆

meager spade
#

😄

#

does sound interesting tho

#

it probably quantizes the scale 😄

jolly siren
#

Is the standard way to quantize a rotation to use FVector_NetQuantize?

winged badger
#

if you don't need roll

#

FVector_NetQuantizeNormal would do

#

you can't restore roll from FVector

jolly siren
#

Thank you Zlo 🙂

winged badger
#

its 0-1, 16 bits

#

per component

meager spade
#
{
    switch (QuantizationLevel)
    {
    case ERotatorQuantization::ByteComponents:
        Rotator.SerializeCompressed(Ar);
        break;
    case ERotatorQuantization::ShortComponents:
        Rotator.SerializeCompressedShort(Ar);
        break;
    }
}```
#

if you are packing inside a struct

#

looking to cmc, Zlo was right FVector_NetQuantizeNormal CompressedRotation(Rotation.Pitch / 180.f, Rotation.Yaw / 180.f, Rotation.Roll / 180.f); @jolly siren

jolly siren
#

Awesome, thanks guys 🙂

chrome bay
#

Even if you decide to use projectiles, using bNetTemporary and/or NetUpdateFrequency of 1.f I could spawn like 300 of the things without going above the default 10Kbps limit

#

Crappy test setup but you see the point

mental timber
#

Yeah. One of my main goals was to get away from projectiles as much as I could. But I couldn't get the behavior I wanted, so I resorted to keeping them until Adriel showed me otherwise.

#

I didn't want to transmit so much data for every position update. So this new system is an awesome step in the right direction

chrome bay
#

Yeah you don't need too for sure. I use Dormancy pretty heavily on my projectiles.

#

They only send an update when I explicitly tell them too, i.e. when first launched, when they bounce off of something or when they die etc.

#

You can get quite a lot out of them, the biggest cost difference at that point between using actors vs a data-method comes from having all those different actor channels open, checking for rep etc.

#

Data method is great if you want to go mental on reducing overhead, but bit harder to get flexibility. Not an issue if 95% of the game is regular ol' bullets though.

dark edge
#

@mental timber You should always strive to only replicate the bare minimum amount of state needed to recreate the world. For example, my game has modular vehicles with arbitrary configurations, tons of parts, and is entirely physics driven. The only replicated state is the physics state of vehicle chassis, and the control variables (Throttle, Steering, Aim, etc.). If i tried to replicate the state of everything it'd be huge, but it's only 2kBps doing it this way.

#

So if your bullets are fairly predictable, just replicate their start position and initial velocity values. Everything else should be derivable from that.

mental timber
#

My goal was to have bullet mechanics that could hit something if it were to move in their way after the trigger was pulled. So, in flight, their path is interrupted.

#

If I can do that, then I'll be successful.

dark edge
#

You need bullet drop or no?

mental timber
#

Yeah. I'm aiming for a realistic feel and trajectory.

dark edge
#

K. I'd ignore drag unless you're going for reaaaaaally long shots, as it'll mess with the math.

mental timber
#

And eventually I'd like to affect position with wind, too. But that's a bonus after all other features are done

dark edge
#

but do the approach I showed, but use a Verlet integrator as it'll be more predictable.

#

X is are your positions, A is gravity + wind. Velocity is derived, not calculated. Sec, I'll whip up a gin

#

gun

mental timber
#

Ah, vector math 😩

#

Or some kind of math

dark edge
#

I'll whip you up a gun, sec

#

Yeah vector math is the name of the game for gamedev, learn it

mental timber
#

Thanks!

#

And yeah, math seems quite crucial to all this

dark edge
#

You're on the latest unreal right?

#

4.24

mental timber
#

4.23

dark edge
#

best update lol

mental timber
#

Yeah, i have it installed. Just not using it for my current project

#

And haven't bothered to update it

#

Probably should

dark edge
#

oh if its installed you can look at this BP im making then

mental timber
#

For sure

meager spade
#

how do people solve this?

fleet raven
#

what's happening there

meager spade
#

so if i spam the quick bar

#

ie cycle weapons rapidly

#

with high ping, then it changes the weapon once the server runs it

#

see it better here

#

its equipped locally,

fleet raven
#

I solved it by making the equipped weapon part of the state that I predict/reconcile atomically

#

no idea how others solve it

meager spade
#

yeah but i think its the attachment

#

as nothing else is replicated

#

to owning client

fleet raven
#

isn't there some way to disable that?

meager spade
#

not sure, i mean i dont need to attach on server

#

i can just have simulated attach it themselves

#

shouldnt cause any issues, as i dont fire anything from the weapon server side, and nor do i run animations server side

#

so the weapon doesn't need to be attached oh wait, relevancy

#

ffs

#

dang

unique ocean
#

Anyone know how roll the player camera in blueprint? I'd imagine I only want to do this client side, as it's just visual feedback for the player.

#

I'm basically rotating the camera to indicate the player is wall running, and I was able to get it working without pawn control rotation, but this led to slower/laggier general movement.

#

Or if there's potentially a way to just not have the roll of the camera replicate.

#

@dark edge index? :p

dark edge
#

lul

brittle slate
#

I’m working with a dedicated server and the advanced sessions plugin, is it possible to join another session within the dedicated server and load into that session.

hardy ferry
#

Has anyone run into issues where, when using the advanced sessions plugin, "Play with new process" loads steam just fine...
Yet in a compiled build, it does not load steam?

tawny crest
#

anyone knows how i can change each player's health bar's color based on whether they are an ally or enemy ?

dark edge
#

@tawny crest First you need a way to tag them as ally or enemy

tawny crest
#

i gave them a team tag on spawn

#

ive been messing around but it seems that the server is the only one that actually changes the enemy/ally's health bar color

dark edge
#

Who owns the bars? They a widget on the character?

tawny crest
#

widget component on the character

silent phoenix
#

Is there a difference between (Run on owning client) and UFUNCTION(Client)? I'm just starting to learn c++ and im not getting the same result

hollow stirrup
#

UFUNCTION(Client) is the c++ version of Run on Owning Client, yes

silent phoenix
#

I'm trying to set render depth on an actor when player overlaps its collision. In blueprint i just set it on a simple run on owning client and it only happens on one client but in C++ it is still happening on all clients.

UFUNCTION(Client, unreliable)
void SetRenderDepth();

void ABasePickup::SetRenderDepth_Implementation()
{
SkeletalMesh->SetRenderCustomDepth(true);
}

#

Is this an ownership issue? This function is being called when a component overlaps its collision. So I guess technically its being called by the server? Do I need to pass a ref of the pickup to the overlapping component and call the function from there somehow?

jolly siren
#

The overlap event will be triggered on the server and clients

#

So it sounds like you are just calling the client rpc directly on all clients

#

Why do you need an rpc for this?

silent phoenix
#

I only want it to trigger on the client that overlapped the collision

jolly siren
#

Then check to see if the character is locally controlled

#

You dont need an rpc. And the server doesn't need to be involved. Unless you need extra security.

silent phoenix
#

Maybe I will have to play around some more but I wasn't able to get it working without rpc either. always enables it on all clients

#

I really appreciate you taking the time to reply thank you

jolly siren
#

Right you need to add a check that only runs your code for autonomous proxies.

silent phoenix
#

Like this ?

if (Role == ROLE_AutonomousProxy)
{
    SkeletalMesh->SetRenderCustomDepth(true);
}
#

oh wait role of the overlapped comp?

#

Ayyyy. Got it working. Thank you so much.

silent phoenix
#

Interesting. I just realized I had a "Is Locally Controlled" node in my blueprint. ROLE_AutonomousProxy is the equiv?

cedar finch
#

Hey guys. I'm still working on replicating my laser mirror puzzle. It seems that when the laser hits a mirror the calculations from then onward are slightly off which means the more reflections, the more off the angle is. What I do is take the impact point of the first line trace and set that as the "cast Origin" then I set the "Cast Direction" by getting the Impact Normal and using "Mirror Vector By normal." How can I replicate this so those two variables will be the same for all clients?
https://i.gyazo.com/4200080673ca640478d2e263307b87ee.jpg
https://i.gyazo.com/425bd553cc82b747c8cdeec4e698f1f5.png
https://i.gyazo.com/c661eacbf814fc5d55e95fcd1bdbd875.png
https://i.gyazo.com/685f3be9028d43b9c75f6232512e148f.png
https://i.gyazo.com/214b40f02cabdc8fed7e3a04df5a62bc.png

vivid seal
#

working a bit on extending the character movement component and am confused a bit on some things.

game is an fps/rpg type of thing with spell casting. some spells are movement abilities like blink or a superjump, or modifying a movement speed variable. my spell casting event flow is that the client initiates a spell cast, it is checked, client prediction is performed, and then the server rechecks and performs the server version. for stuff like damaging spells, this is simple as the client just predicts particle effects or hit markers, while the server implements the actual damage. for movement, i want to use the SavedMoves that the CMC uses, but I'm unsure how to predict the movement and then make sure that the server verifies the actual spell cast went through to perform the movement. do i need to pass a SpellCastID as part of the SavedMove? what happens when the move arrives before the spell cast RPC? anyone have any ideas?

dark edge
#

@cedar finch Do the tracing on the server, replicate out the beam segment end locations and use that for drawing

cedar finch
#

That's what I thought but it's run on tick so how can I do it without destroying the network?

dark edge
#

Just make 2 replicated arrays of vectors. I'm pretty sure they'll only replicate out when they are changed. So only when things are turning

#

Or you can find where the imprecision is coming from and do some rounding to keep it from magnifying.

twin juniper
#

Does Shooter Game have any form of rewind when it comes to validating player hits?

bitter oriole
#

Not that I know of

#

Rewind in UE4 is hard to pull off

dawn nova
#

Hey guys, what's the best way to verify if replication of the entire map and its actors has completed? For now the players have to stay frozen until this completes, but id like to display a loading screen during this

#

I'm looking for some event I can bind to or maybe a function I can override

bitter oriole
#

On each client, check on tick that all replicated vars have valid values, and then tell the server with a RPC

dawn nova
#

Hmm, that's going to be a bothersome solution because there are quite a lot of replicated vars.

bitter oriole
#

That's what you got

dawn nova
#

Is there not some kind of event when the level and its actors have replicated for the first time to the client?

bitter oriole
#

Replication is not atomic, so there is no one event for an entire actor

#

Individual variables might replicate at different rates

dawn nova
#

What is exactly causing players to stand in place for a while before they can play? Does it wait for all variables on the client to be replicated first?

#

As in the character

chrome bay
#

Does anybody know if FFastArraySerializerItem can have a NetSerialize() function?

#

I would assume it does... but asking just in case

chrome bay
#

Turns out ya can. Lovely

twin juniper
#

Why do we need "run on client owner only" rpc instead of not replicating it?

bitter oriole
#

That's a weird question

#

Client RPCs are server->client function calls

#

No replication would be not doing anything at all

twin juniper
#

I understand

#

It will happen in client but data never will be sent to server and it will stay as a visual thing only, right?

bitter oriole
#

Client RPCs are to be used when you need the server to call a method on the client

#

So the server calls it

#

Calling a client RPC from the client makes no sense

twin juniper
#

thanks

odd iron
#

Hello guys i have this method idk what is wrong when im hiting the actor both server and Client getting dmg

#

i've tried to replicate Current Health samething

rigid zinc
#

does anyone know how to set up a module/class for dealing with a backend sql server, and if so could you point me in the direction of some up to date resources, thanks

rose egret
#

@rigid zinc it depends.you want the GameClient connect to sql server directly ? its not appropriate though. u need something like master server.

rigid zinc
#

no, we'll have a game server

#

clients have no access

rigid zinc
#

thanks

chrome bay
#

Anybody finding that the PacketSimulationSettings don't work at all in 4.24?

#

bah NVM, clumsy seems to work way better

meager spade
#

clumsy?

chrome bay
#

Works right out of the box even in editor. So handy

turbid tree
#

Hey, is there any case of replication degredation since 4.24? Everything was fine for me on 23...but since the update the replication esp the initial one(dedicated server) takes a long time. I am going to play with Insights today, so any pointers where to look or if somebody dealt with this before would be welcome 🙂

sand tangle
#

@turbid tree Are you using blueprints?

turbid tree
#

mostly yes

#

nothing touching replication in c++(yet)

#

I am more than happy to go into the debugging myself, I enjoy a bit of network torture 🙂 just curious if anybody had the same issue ... already testing if some of my "bad" network state stuff is not persistent or enabled by accident..and no luck there so far I blame something in the engine that probably was deprecated and I was using it 😄

#

The project started at 4.14 and got upgraded every time there was a newer version of the engine

sand tangle
#

I had problems with delays and lag after upgrading from v.23 to v.24. Never really figured it out, but added all the replication nodes again, and it worked normally. Trying to stick to c ++ now. ;)

winged badger
#

i'd never consider blueprint networking

#

its very restrictive, you don't have any optimization tools, its verbose and the OnRep is clunky

turbid tree
#

It works fine as far as I know.. obviously once I move out or prototype I will need to go c++ but for what I am doing now it is fine

winged badger
#

no custom serialization, no structs in any usable form

turbid tree
#

@sand tangle What do you mean by "added all the replication nodes again" like all the custom events recreated and such?

#

I would rather not go that route 😄

winged badger
#

(set a RepNotify variable locally on client in BP, and watch the OnRep fire on that client)

turbid tree
#

@winged badger I am all for doing networking in c++ but I sort of need to iterate stuff now and BPs are just... well faster in that sense 😄

#

but it is down the line 🙂

winged badger
#

that is just a matter of practice 🙂

turbid tree
#

nope that is just matter of compilation 🙂

winged badger
#

takes 20 seconds for live coding to compile, not too bad

turbid tree
#

try that on Linux 😄

hoary lark
#

found your problem

turbid tree
#

😄

winged badger
#

but the difference is when you get stuck on a replication race or some such

turbid tree
#

Tested on Windows as well same issue

winged badger
#

c++ becomes very much faster then

turbid tree
#

I am not arguing your point 🙂

#

I agree with you 😄 .. just saying that at this point in time the breaking point was the upgrade from 4.23... and I want to figure out what why and how 🙂

#

So no help here... Insights it is 🙂

winged badger
#

doing the 4.22->4.24 soon

turbid tree
#

(sorry that came out saltier than I ment it :D)

sand tangle
#

Something happend to replication in 4.24, with blueprint. Yes, I did recreate most of the custom events and such, to make it work again. Only using blueprints for animation now. C++ is more cleaner, easier to read, faster ++.

turbid tree
#

🙂 I will try that if I cannot figure it out using Insights... my only pointer right now is

LogNetPlayerMovement: Warning: CreateSavedMove: Hit limit of 96 saved moves (timing out or very bad ping?)
#

very bad ping on localhost is fun 🙂

#

Was that at least for me?:D

#

I can still check 😄

grizzled stirrup
#

No sorry I had another question

turbid tree
#

yeah figured 🙂

grizzled stirrup
#

If you are spawning an actor like a PlayerState (a replicated actor that holds data but isn't visible in the world but is still attached to the player), am I free to just spawn it the same way the controller spawns the PlayerState, but then not bother attaching it to the pawn (as in this case it's just reading some simple data from the pawn) and let it just sit at the origin?

#

In this case it is a system like the ultimate ability system in Overwatch. The derived classes each have a unique ability which spawn other replicated projectiles actors etc. but the ability logic itself (ability name / cooldown / icon etc.) is purely data only and doesn't need a visual representation in the world

#

I thought it would be better to have a separate generic ability class rather than cluttering up the character

#

But the problem with separating it out is that it still needs to be spawned in the world if it is to replicate properly, so that brings the question of attaching or just letting it sit at the origin

gray scroll
#

Are there alternatives to gamesparks?

#

For storing players data such as inventory

gleaming vector
#

playfab

meager spade
#

is the only way to increase RPC per netupdate via a cvar?

gleaming vector
#

as far as i know

twin juniper
#

It always says "accessed none" about branch, what should i use instead of these references?

pallid mesa
#

it says server side.. but you are multicasting @twin juniper thinkspin

twin juniper
#

I know

pallid mesa
#

I think there are some conceptual flaws going on there

twin juniper
#

First time i was learning i misunderstood replication then i decided to name it like that lol

pallid mesa
#

what do you want to do?

twin juniper
#

I made a collision box to player

#

When an enemy collide that box

#

Player must turn to enemy

pallid mesa
#

okay so why are you setting this onrep variable on a multicast?

#

your references don't exist in the context within you are calling them

#

that's why it fails to get them

#

because they are not valid

twin juniper
#

For now an error occurs due "cube reference"

pallid mesa
#

you shouldn't replicate to server the event tick

#

mainly because tick fires in the server and in the owning client in this case

#

so what you are doing there with that server rpc is wrong

twin juniper
#

what should i do?

pallid mesa
#

so... it depends on how you want to lay out your logic

#

but most importantly you need to understand replication contexts

#

basically you want to rotate your controller towards an enemy location, right?

twin juniper
#

yes

pallid mesa
#

or something similar to that, okay. So if you go step by step

#

you need to ask yourself

#

does my cube exist in the server?

#

yes/no

#

if it does, I can use the cube reference in the server

#

however since we know event tick fires in both server and owning client

#

we would need to constraint only to authority

#

reminder: onreps are like multicasts

#

you set them on the server and they execute on the clients

#

however they are even better than multicasts

#

they execute as soon as the variable gets to replicate

#

which is convenient to avoid any kind of data race

#

so you should ask to yourself these questions

#

specially about context

#

"does this thing exists in this context"

#

"if so, let's use it, and let's see how I can carry on references along the network"

twin juniper
#

i understood

#

what about replicated variable?

#

where should i initialize that

pallid mesa
#

a replicated variable is the same, you set it on the server

#

it will eventually replicate to the clients

#

but you don't know when

#

with onreps you can know when the variable replicated

#

it's the shame of blueprints

#

once you get networking contexts everything will be much easier, at least for you as developer

#

but it is crutial for you to understand it

twin juniper
#

they tell what is client and server side and examples of replication but i couldnt find a way to replicate some specific things

pallid mesa
#

such as?

twin juniper
#

this one

#

i only found changing materials and meshes for replication, also read compendium that exi's

pallid mesa
#

this one is another use case, a generic one it looks to me.

#

yes compendium is a great reference

#

he explains there how to replicate variables

#

and contexts

#

maybe you missed something important?

twin juniper
#

yes could be

pallid mesa
#

now, let's try to tackle your problem

#

try to apply what I told you about server shenanigans

#

check where the cube exists

twin juniper
#

you're asking if its replicated or not by existing, right?

pallid mesa
#

the cube is an object in the world, right?

twin juniper
#

Yes

pallid mesa
#

where do you get the cube reference?

twin juniper
#

created a variable for it

pallid mesa
#

but the variable will be empty if you don't fill it with anything

#

you need to tell the variable what it is pointing at

#

a variable is just a container

#

of a type

#

if the container is empty then there is no fun

#

you need to put into your container the real world actor

#

how?

twin juniper
#

by "set" ?

pallid mesa
#

exactly

#

now, how do you get it?

#

querying to it

#

you can query an object in numerous ways

twin juniper
#

cast or get all actors of class maybe?

pallid mesa
#

through a hitscan, direct referencing, all actors of class... ect.

#

be careful with all actors of class, don't use that too much it is a bit expensive

twin juniper
#

okay @pallid mesa , you really helped me, thanks a lot

pallid mesa
#

any time :)

#

I preffer you to wrap your head around it

#

instead of giving you the easy way

#

that way you can learn better all the concepts

twin juniper
#

i'll read the compendium again

pallid mesa
#

take a look at the variable replication section

#

I don't know if eXi cover worlds in his compendium

#

he might but I am not sure. Either way that shouldn't affect you too much

twin juniper
#

okay, thanks again 🙂

knotty ore
#

We are building a card game to accompany our main game but we are having the card game be multiplayer. Can a single dedicated server handle multiple sessions of 2 players?

#

or does each match have to have its own dedicated server instance?

#

because the latter is crazy sounding in logistics

chrome bay
#

Each match has it's own server instance

#

But you run multiple instances on the same machine

#

The only alternative is to create a meta system specific to your game, where many players join the same server instance and the game mode sorts them into pairs

#

Technically speaking however, those players will all be in the same match as far as the engine is concerned.

bitter oriole
#

There is little reason to use dedicated servers for a card game, to be fair

#

You can make the game fully client authoritative, and have each client report the game log to your own server if you want to investigate cheats

pallid mesa
#

uh, that's a great idea

#

backend reliance

#

you don't even have to rely on a OSS

bitter oriole
#

OSS is fine for matchmaking etc

#

Dedicated server is what you don't need. Biggest drawback is, no exiting mid-game and other player(s) keep playing

#

Which should be fine for a card game

chrome bay
#

Yeah dedi for a card game does seem like overkill

bitter oriole
#

If Splatoon doesn't have dedicated servers, your game probably doesn't need them 😬

chrome bay
#

Unless you expect a ridiculous influx of players (I hate to break it to you, but don't) - I wouldn't bother unless you know you need that kind of support

knotty ore
#

okay so then i would need to tie to steam or google play or something to handle central control for match making.

#

so clients can find each other.

bitter oriole
#

The most convenient for your users is indeed to use that platform's OSS for matchmaking, yes

knotty ore
#

thats the part i am trying to wrap my head around is what do i need for central control.

#

OSS?

#

sorry new to this MP stuff

bitter oriole
#

Online subsystem

#

Here's my advice : start small and simple with no dedicated servers, Steam for matchmaking, on PC, and build from there

#

Build the game, make it fun

#

That's the hard part

#

Once it's fun and you have people who like playing it as a demo or something, then you can work on infrastructure

knotty ore
#

oh the game has already been made. 😂 we had quite a lot of good feedback on it

#

but its only Single Player

#

it was apart of our main game and we had a lot of request for MP on it

#

so were rebuilding it now. :)

inner iris
#

bMultiplayer = true

#

Should do the trick

knotty ore
#

but the only MP experience i have is ark and dnl modding

bitter oriole
#

So let's break it down

knotty ore
#

lmfao. why didnt i think of that

#

that makes so much sense. 😂

#

thanks Unreal!!!

bitter oriole
#

Multiplayer has three components : multiplayer gameplay (usually the hard part), matchmaking / friends / social, and (if that's a competitive game) the whole anti-cheating, ladderboards, ranking, servers infrastructure

#

Start with the first one

#

That's purely UE4 work

#

Basically play in editor with two players

#

Then, you can add matchmaking so that people can play with e.g. Steam

#

And then, you can look at cheating, scoring, ranking, etc

#

You can do the second part without Steam, too

#

It's just some work to add

knotty ore
#

well we have the MP part working

inner iris
#

Very good advice and just a small thing to add, do decide if you are going with a dedicated server setup or not, I'd recommend the same as Stranger and use Steam and skip dedicated servers, but the MP code does have to be built a bit differently if the listen server host is also playing

knotty ore
#

but its only client to client

#

we have some things not replicating properly

#

but thats sorting them out.

bitter oriole
#

What do you mean "client to client" ?

#

UE4 doesn't support that with the built-in networking

#

Do you mean listen server ?

knotty ore
#

yeah

#

if you port forward to the device (computer) we can play each other

bitter oriole
#

Cool, so you have the hard part done

knotty ore
#

but thats not feasable for an online matchmaking game. lol

#

and were using the built in ue4 subsystem.

inner iris
#

Steam subsystem works great to match players searching for sessions without port forwarding manually

bitter oriole
#

You just need to drop Advanced Sessions in your project and implement friends

knotty ore
#

i was thinking that would be compatible with others but i guess not. :/

bitter oriole
#

The built in OSS is only for LAN

knotty ore
#

ahhh okay

bitter oriole
#

It doesn't have friends, or matchmaking outside LAN

#

It's a debug tool

knotty ore
#

:(

#

lol

#

okay so Advanced sessions is the steam Subsystem?

bitter oriole
#

No

#

It's a plugin for easy session management

knotty ore
#

oh! okay

bitter oriole
#

But you tell me you use the OSS already, so you don't need that

#

Just enable the Steam OSS and you can start using the friends API

#

Or matchmaking, etc

#

But I'm guessing you're not actually using OSS and just using "open ip" instead

knotty ore
#

yeah u mean console command open ip

bitter oriole
#

Yeah

knotty ore
#

yup

bitter oriole
#

If you're using that, you're not actually using any OSS right now

#

Again, OSS is not multiplayer, it's matchmaking, achievements, friends

#

You don't need it, it's just cool to be able to join your Steam (PS4, Xbox, Switch...) friends

#

So if you want to use friends, it's the only way, and you can look at Advanced Sessions for a primer

#

You also have the option to implement your own online service entirely yourself, build a database of players, a HTTP service that your game connects to, and be completely paltform-independent

#

You'll need a lot more work, but you won't depend on Steam or another

rose egret
#

you could use services like playfab, aws, ..
or write your own backend for matchmaking , friendship, inventory, ... which I did 🙂

#

btw if its a turn based game you could write your game server without UE4

bitter oriole
#

It's much easier to just not have any server

#

If it's a competitive game, you can just have each client upload the game log to the server and validate the game only if reports match

#

Which can be a dumb PHP server somewhere

#

On free hosting

rose egret
#

I would rather use nodejs or c# 🙂

#

cause I already have written all the plugins 😆

bitter oriole
#

You can use whatever you want no matter how shitty, is my point

twin juniper
#

1>The selected platform/configuration is not valid for this target.

#

anyone knows how to fix this problem while trying to build server

knotty ore
#

Yeah this is matchmaking essentially is all i really need to start with. Platform independent would be ideal.

bitter oriole
#

@knotty ore You need to think about the intended experience. Not just one single valid answer here.

twin juniper
#

1>------ Derleme başladı: Proje: dedicated, Yapılandırma: Invalid Win32 ------
1>The selected platform/configuration is not valid for this target.

#

help please

bitter oriole
#

Basically, if you want both to use the platform's (Steam, console, phone...) friends system, and platform-independent gameplay, this isn't something I know how to do

#

You can either build your own friends and achievement system, or drop platform independent, or wait for EOS to finally exist one day and work like annonced

knotty ore
#

hahaha

obtuse forum
#

What is the 'proper' way to use a UMG widget to make a change to the GameState and show the change to all players? Should I make RPCs from Widget>ROS in PlayerController>ROS in GameState>ROC each Playercontroller>Eventdispatcher back to widget ?

chrome bay
#

Widget should call a Server RPC that is a member of the player controller

#

In terms of changes, personally I find it preferable to just have the UI poll the game for info each tick.

#

Touchy subject with some folks but frankly if you want to make a fully event driven UI in a multiplayer game enjoy spending your life debugging it.

obtuse forum
#

thanks

thick jungle
#

heey guys, working on a card game. Does anyone have any clue how to build a queue or lobby system?

#

(or a tutorial for one or so)

#

I built one in C++ before we migrated over to UE4, but I have no clue where to plug it into the existing game's code

maiden vine
#

Hi all. Can Someone tell me if there is something I dont know about blueprint when creating a widget in a scene component then try to access it from the scene component. I get access none. any advice appreciated thx

bronze arch
#

hello guys, its bug for 4.24 or not idk but have trouble about variable replicated structures for everyone.
When i trying to send a structure with array(10) to client. it looks like i lagged or dropped from server. cant walk or do something till 5 or 10 seconds. after 10 seconds i can walk but some data didn't loaded cause lag or drop.
when i unreplicated it, then everything will works but then i cant get that data from server.

#

it was work perfectly before upgraded to 4.24 from 4.20(Bad choice i know)

#

if its not bug from engine, how i can fix this? Thanks to who can help me

chrome bay
#

I'm having a few issues with 4.24 so far. Server seems to be redundantly sending properties multiple times in my case. disabling properties for replication is more expensive than just letting them replicate pointlessly etc.

#

Not sure if my specific case is unique to 4.24 though

#

Too far in to turn back now

winged badger
#

@chrome bay how bad is it?

chrome bay
#

So do you know.. about five minutes after typing that... I found my problem

#

After banging my head against the wall for 24+ hrs

winged badger
#

Considering hopping to 4.24 next week

#

The power of 🦆

chrome bay
#

just one silly mixup of true/false cost me a nights sleep 😢

winged badger
#

knows the feeling

chrome bay
#

I also posted a massive post on UDN about my findings which I'm now going to have to shamefully close

winged badger
#

I had a bug that didnt happen only on DebugGameEditor today... fun times

chrome bay
#

The irony is it's the most in-detailed post I've ever made.. net profile screenshots and graphs and everything. Godammit

winged badger
#

At least print it out and hang it on a wall then 🙂

rose prawn
#

Hi people, I have an important question.
At high ping rates, server starts to correct player's location. There are some options to disable these corrections called
**- Ignore Client Movement Error Checks and Correction

  • Server Accept Client Authoritative Position**
    I'm not sure if I should enable them. Is there any risks if I enable these settings?
dark edge
#

@rose prawn the risks are cheating, and whether or not that matters depends on if your game is successful or not

rose prawn
#

I don't really care about cheating

#

I'm mostly worrying about if it could cause any gameplay problems like having huge location distances between server and client

dark edge
#

I suppose there might be some problems with client to client collision. If both clients are "right" then what do you do if they both say they're in the same place?

#

And the remote view is going to be twice as old since it's gotta go client to server to client. so basically, the experience is better for the controlling client, and worse for everyone else.

rose prawn
#

Thanks for the answer, I guess I need to look for different solutions :)

bronze arch
#

Tried in empty project with much structures line with array. it happens same bug like i said. Guess 4.24 bug. how i can send report for that?

winged badger
#

you doing BP or c++?

bronze arch
#

Blueprint

#

never c++ :c

#

open empty project, make 8 line structure with image and strings

#

and make variable with structure in bp, and convert to array

#

make array 10 times in server and try to send to client

#

then all rpcs and variables stops in some seconds

winged badger
#

you're sending an image reference or image data?

#

that is way more data then i feel comfortable sending

#

is the data static and known at compile time?

bronze arch
#

to see easier. in my project work like this

#

or let me say other rpcs doesnt work when receiving structures

#

in that 4.20ver. works other rpcs same time receiving structures, idk what changed till 4.24

winged badger
#

what does your output log say?

bronze arch
#

didnt look letme try again

plush wave
#

How on earth would my ENetMode be Listen Server, but my EPlayNetMode be Standalone? Shouldn't these two be in sync?

bronze arch
#

how i can get very bad ping while local networking lul

bitter oriole
#

Bad code

bronze arch
#

but in the screenshot how it could be bad code

#

only structure and array

bitter oriole
#

Too many moves creates on each tick, etc

bronze arch
#

but you know there no moves except one character

#

its empty project mean UE4 thirdperson content

#

but i cant imagine while doing with public network

#

it would be completely broken

plush wave
#

Ok so determined that somehow on Engine tick my world is set from standalone to listen server SetPlayInEditorWorld()?

#

This has to be a mistake because the rest of the engine thinks it's still in standalone

#

I didn't even think the engine allowed changes to the net mode at runtime??

bitter oriole
#

Well of course

#

When you're playing alone, or joined to a server, or listen server, you have different net modes

#

(These would be NM_Standalone, NM_Client, or NM_ListenServer)

thin vessel
#

How does one set the ownership of an actor to a client's pawn?
Seems like if I call MyActor->SetOwner(this) on the Client, it's not replicated to the server, and so fails. But if I call it on the server then this is the server version of my client pawn... which means ownership remains with the server.

bitter oriole
#

Needs to be done on server

#

There is no such thign as a server version of a pawn

#

If the owner is your pawn on server, it's also your pawn on client

#

Since pawns replicate

thin vessel
#

I must be misunderstanding something else then. I'm using the Gameplay Ability System and have it setup to locally predicate. The abilities are given to guns that are then triggered by a player.
I was setting the owner of the guns to the player's pawn, but the everything happening in the ability was displayed on the server. Debug lines, particle effects, and audio now show up only on the server, whether the player is a client or not.
Note that I'm not running dedicated server atm.

bitter oriole
#

I'm just saying " if I call it on the server then this is the server version of my client pawn... which means ownership remains with the server" is not a thing

thin vessel
#

Ok, that is good to know.

bitter oriole
#

You should be calling SetOwner on the server to change ownership of an actor

#

Once you've called SetOwner on the server, provided both objects (owner and ownee) replicate, you'll be able to RPC on the object from the client, as soon as the ownership replicates

thin vessel
#

Another follow up question then, assuming I have correctly done everything above, if I call IsLocallyControlled() on the weaponActor owned by the client's pawn, I will receive a true result when I'm on the Client and false when I'm on the server?

bitter oriole
#

Dunno if IsLocallyControlled() is implemented for Actors, IIRC it's a Pawn method

thin vessel
#

Well darn, that is unfortunate.
Ok, say I did something like

APlayerPawn* pawn = Cast<APlayerPawn>(weaponActor->GetOwner());
pawn->IsLocallyControlled();
//Would this return true on client, false on server?
bitter oriole
#

If you've set the owner of the weapon, on the server, to the pawn that you currently control locally, then yes, after ownership replicates, it should return true on client and false on server

thin vessel
#

Ok, good to know, thank you.

eternal briar
#

Hi people! I have a question about Oculus Quest and networking:
-We are making a multiplayer experience where a server is hosted on a Windows PC. It is not a dedicated server so the Windows player joins in as a 1st person character.
-All the joining clients are using Oculus Quest VR headset.
-Now, everything works great when up to 2 Quest clients have joined in. When a 3rd Quest connects, one quest randomly gets disconnected. (In most of the cases, it is the 3rd one). We have optimized and profiled lots of times and the bandwidth used is coming out to be relatively low. Has anyone ran into this kind of problem? Am I missing something that can cause disconnects like these?

cedar finch
#

What is the best way to play an explosion FX when something is destroyed? I created a "bind event to OnDestroy" and play the FX but clients cannot see the FX play unless I make the events "Reliable" which I don't really want to do. Am I doing this wrong? https://i.gyazo.com/e4c09ab555e0ed065e60128434ab8b99.png

hollow stirrup
#

RepNotify

near dove
#

Hey guys! Anyone knows why sometimes when I spawn a client on my server, the camera child of the client character controllers, gets parented to the server character controller?

tall pine
#

Hi guys,

I'm working on a schedule system that will trigger certain event at certain time. I'm thinking that the schedule manager should only be able to start a schedule on the server.

So a couple of questions:

  • Should I create the manager so that it only exists on server? If so where? In GameMode?
  • Where will I initialize it? (loading up all the schedule, etc.)
  • Do I replicate the manager actor down to the client? Since the client at some point will want to check to see if a schedule is active or not. Or is there a way for the client to just call the server and ask about the event?

Thanks!

ebon nimbus
#

Im having some issues getting my player to look in the direction that the playerstart is set. Im rotating the player controller to the playerstart rotation. Is there a setting in my player controller or possessed actor that's messing this up? This is only happening for the clients.

urban dew
#

is there any templates out there for "persistent" worlds, like large MMO map, where everything is saved?

#

can be hosted online for players to join

steady briar
#

so im using physics to move an actor. instead of the Replicate Movement, im working on something else. basically, periodically i have the server set a replicated variable to its location. on the autonomous/simulated proxy OnRep of that variable, i check the distance. if its greater than my tolerance, i set the proxy's location to what the servers location is. weird thing though... when it stops moving and the difference is 0.000, the location stops being updated by server (which is fine since theyre the same anyway)... but the actor snaps to a weird location. then when i move it even 0.0001, it snaps back to where it was before... moves just fine and all that... but then when it stops and the server stops updating, it snaps to a weird spot again. no idea why o.O any ideas?

twin juniper
#

When I move the client it doesnt get input very well

#

When I press A it goes forward sometimes

#

I think it gets the rotation control for servers settings. Any idea?

winged badger
#

add input vector to the pawn in direction of its/camera forward

#

CMC will RPC that to server under the hood

twin juniper
#

didnt understand the adding to the direction of its/camera forward

winged badger
#

input axis nodes provide float -1 to 1

#

you multiply that float by Pawn's GetForwardVector for AxisForward

#

and with GetRightVector for AxisRight

#

and plug it into AddMovementInput

twin juniper
winged badger
#

yeah, that make rotator needs to be deleted, along with add input vector node

twin juniper
#

but you said add input vector, did i connected it to wrong node?

#

ok i think its working now, when i deleted the rotator thing 😄

#

so the problem was make rotator

#

thanks @winged badger

winged badger
#

you do have example and template projects from epic where this already works

twin juniper
#

its default 3rd person project

#

just studying replication on it

#

as i understand its clashing with server's rot again

steady briar
#

i got super annoyed trying to forcefully rotate the character. gave up <_<

twin juniper
#

lol

#

its my amateur work please dont be annoyed

winged badger
#

without a ref it needs to be inside the Pawn blueprint

#

or needs a reference to pawn or camera

#

shooter game is more advanced example project

#

also, read:

fringe sinew
#

Any resources about using player stats properly? D_D

#

Except the compendium @_@

maiden vine
#

Ok I found my problem. Anyone know How to test client 1 and 2 with something other than Get Controlled Pawn. My blueprints think since I have Only 1 controller (my keyboard and mouse) I am always and only Client 1's Controlled Pawn when I press play.

#

I dont want to have to build a actual server just to test my blueprints...geez

#

any help thx

cerulean escarp
#

could you send a pic of your blueprints where you use get controlled pawn?

#

might not need to use that

#

@maiden vine

maiden vine
#

I can soon

#

I dont understand how am I going to test both clients lol

twin juniper
#

Anyone have any tips on how to package a project using dedicated server for shipping

#

project works fine with development builds just fine

#

same goes with server

#

yet it does not work if I build it for shipping

#

I couldnt really find helpful info on documentation or anywhere

cerulean escarp
#

what doesn’t work about it?

twin juniper
#

I can connect to server just fine with dev build

#

yet I cant connect to server via shipping build

#

server doesnt even see the attempt

cerulean escarp
#

is it a steam enabled game?

twin juniper
#

yeah

#

but even if not

#

I cant do it with no steam as well

cerulean escarp
#

and are you running the server on the same steam account as the client?

twin juniper
#

server is dedicated

cerulean escarp
#

yes I know

twin juniper
#

well I didnt check that

#

but I cant join it without steam as well

maiden vine
#

when I first create widget also

#

using get controller node from character BP

#

with breakpoint I can tell by hovering over get controlled pawn its grabbing the opposite of what I want, and Im just testing the two clients

twin juniper
#

when you create the widgets do you set their owner ?

maiden vine
#

yes get controller pure cast to player controller plugged in to owning player

#

on create widget node

#

its like no matter what cant find a way to get the character of choice

#

something i dont know

#

thought someone would have a method for this

#

you know how you can walk with default pawn client 1

#

but if I click client 2 window then walk with that character is problem on begin play

#

I control client 1 so blueprints not right

#

Gotta be a different node or something for testing both

#

right? lol

#

I even tried the check box for routing 1st gamepad to client 2 no diff

#

not that I was believing that would do it

#

thx for the tries

bronze arch
#

tried 4.23 too. its same.

#

my network speed is succ rn

little bloom
#

I am attempting to utilize scene components with behavior to make a framework of modular behaviors that can interact. I also want it modular at run time so additional components can be added. Adding my custom comp replicates to the client, an on rep variable triggers behavior, the client receives it and runs a rotation lerp, but the client does not actually update the rotation client side, nor can it change the rotation of a client spawned mesh attached to it

lean flint
#

whats the best way for clients to get what "player number" they currently are?

#

i have my game mode set each player controller ID as they connect, but i dont know how they clients get this information

meager spade
#

tell them it?

#

or set there playerstate property to there id from the server, and have it replicated to client

lean flint
#

what property in playerstate do i set? i can get an ID from it but i cant set it

last grail
#

Promote to variable then set it

#

If you can’t find one already

#

I haven’t messed much with player state

lean flint
#

ok cool i made a custom playerstate for this and it seems to work so far, thanks guys!

jolly siren
#

Is there any way to mark a actor that exists in the level to not be created on dedicated servers?

cerulean escarp
#

blueprints or c++?

jolly siren
#

either way

cerulean escarp
#

you could use the isDedicatedServer to first test if the server is dedicated, then if it is, set the actor to not create

#

I can’t remember if you can get isDedicatedServer in any actor

#

might need to do it in a gamemode

jolly siren
#

you can, it's just GetNetMode

cerulean escarp
#

ooohhh I didn’t know that

jolly siren
#

But I'm talking about an actor that was placed in the world

#

Not one that I am spawning dynamically

cerulean escarp
#

oh

#

well you could do if it’s a dedicated server, destroy this actor upon start

jolly siren
#

right, that's what I'm doing

cerulean escarp
#

not sure if that’s what you want though cause it would still technically have spawned

jolly siren
#

Just curious if there was a property, but I don't think there is

cerulean escarp
#

yeah I don’t believe so

grizzled stirrup
#

Does CopyProperties() in APlayerState only get called on the server?