#multiplayer

1 messages ยท Page 552 of 1

fathom dust
#

I guess that needs a follow up question: are blueprints synchronous / run-to-completion or can parts of a graph be scheduled to run later without you specifying an explicit delay? Do they write down guarantees someplace?

meager spade
#

there is no multithreading in bp. You can use tasks which wait for a delegate to fire before continuning execution

#

but its all synchronous (even tho its called Async Task, it basically binds a delegate and waits for a callback

fathom dust
#

oh but the delegates are on an event queue

meager spade
#

delegates are fired synchronous on the game thread

#

when you call a delegate, it runs everything bound to that delegate in the same frame

fathom dust
#

that part is reassuring ๐Ÿ™‚

#

why should I be suspicious of BP event ordering inside GameModeBase?

#

Shouldn't they all then be synchronous and deterministically ordered?

faint lotus
#

This is probably the wrong place to ask this, but I'm not entirely sure what the right place to ask this would be, and since I'm dealing with this issue on a standalone server, I figure this is as good a place as any: Is there a way to turn off the automatic reporting of script-warns to windows event logging? I'm running a playtest server that keeps getting knocked over by script-warns (which I know need to get fixed, but that's largely outside of my control right now) ballooning the Windows Event Log process' CPU usage.

#

And, yes, I suppose "Run your server on Linux" is, technically, a solution, but I was hoping for a config flag or something.

copper crypt
#

[I've managed to make it work] - edited
Hey, so I'm trying to make multiplayer work on a certain mechanic about player movement

#

So this "Simple Move to Location" is working fine as offline, but can't make it to work in multiplayer.
I've managed to make multiple things work like this

thin urchin
#

anyone know the best way to "replicate" all axis of rotation on a ACharacter, since pitch does not seem to replicate

sick frigate
#

Hey all I'm working on a kind of infinite runner with procedurally spawned floor tiles, because I want multiplayer of some sort what class do you think i should use for the floor spawning logic?

#

Does Game State make the most sense or should i try and make an actor work?

#

I had everything in gamemode which was of course silly because it doesn't exist on clients : )

faint lotus
#

This is probably the wrong place to ask this, but I'm not entirely sure what the right place to ask this would be, and since I'm dealing with this issue on a standalone server, I figure this is as good a place as any: Is there a way to turn off the automatic reporting of script-warns to windows event logging? I'm running a playtest server that keeps getting knocked over by script-warns (which I know need to get fixed, but that's largely outside of my control right now) ballooning the Windows Event Log process' CPU usage.
Ultimately just trying to suppress scriptwarnings to fix this for now.

winged badger
#

log <LogCategory> Severity

#

can make it not log anything below severity

#

there is also a way to put that into defaultengine.ini as defaults

winged badger
#

thanks @chrome bay that worked

somber glade
#

is there a way to check if you're in a session? Like "bool bActiveSession" or something to that effect? I noticed when testing some 2 player listen server stuff, if the client is kicked in PIE and forcefully disconnected the Session doesn't get cleaned up unless you run a destroy session. In case the session isn't cleaned up properly I've added a destroy session to the main menu, but of course if there isn't one, it generates a warning. Not a huge deal, but if there is a way to verify if an active session exists that would be great.

rose egret
#

whats the easiest way to bind the locally spawned actor with the server spawned version.
I spawn a bullet actor in local client instantly. then send a server rpc and spawn it on server as well.
I want to tell the UE hey in local client just map that NetGUI to the locally spawned actor instead of spawning another one.

winged badger
#

its not that simple @rose egret

#

there is a way to force the engine to map server to client spawned actors

#

but you would have to prespawn a pool of bullets that way

#

and would also get some serious corrections when it replicates

rose egret
#

oh didnt think of correction ๐Ÿ˜ฆ seems its not much easy

winged badger
#

for bullets i think you're better off in simulation mode

#

you could set the owner on the replicated bullet server side when spawning it, and have the replicated versions do nothing if the owner is locally controlled

rose egret
#

its not just bullet. for my weapon pickup. I may need to spawn it locally as well.

winged badger
#

we spawn our entire level client side

#

force the engine to treat all actors as if they were loaded from package

#

but we don't do that after BeginPlay

#

afterwards we go for normal replication

rose egret
#

do you have any sample code ?

winged badger
#

its basically spawning the level from the same seed

#

overriding IsNameStableForNetworking and IsFullNameStableForNetworking to return true for actor instances that are about to be spawned

#

setting BNetLoadOnClient and BNetStartupActor to true

#

and having them spawn with exact same matching names

#

also, not letting server replicate any of the actors while they are being spawned

#

by overriding IsNetRelevantFor

#

but we don't call BeginPlay on the world before every player fully finished spawning the level

#

and i don't think you'd be able to pull it off after BeginPlay was called

quaint viper
#

I try to spawn my character on custom team spawns and did it like this, but only the server spawns correctly the clients not. Does someone have an idea, why this doesn't work. This will be executed in the gamemode and the event is replicated to the server and is reliable

fleet viper
#

do you use findplayer start etc.?

quaint viper
#

i have sertan player starts for both teams an search for them

#

with get all actor of class

#

got it. The problem was i let all character at the begin of the game spawn, but the clients haven't joined then so the just stay were they are

untold swift
#

Does anybody now something about OnlineSubsystemOculus? It looks like sessions found only with matchmaking pool. Advanced sessions always fail at find session node.
Is there any major change in 4.24.3? (compared to 4.20)

thin stratus
#

Does Oculus have anything else than matchmaking pools?

#

Been a while since i touched that

untold swift
#

With the 4.20 version we have used AdvancedSessions plugin as default for both steam and oculus OSS, and it worked "out of the box".
Now it only 'kinda' works when i create a matchmaking session, then update the advancedsession extra settings

unkempt tiger
#

can I send arbitrary struct pointers SomeStructType* Struct through RPCs?

#

or will that just not replicate?

#

oh probably not gonna work ya

light fog
#

my session has a limit of max 4 players. When the lobby has 3 players in it and then 2 people join at the same time, due to long loading times both can join before the server updates the current players within it allowing 5 people in the lobby. Was thinking of kicking the last person that joins via PostLogin and a simple check of amount of people in the server but i cant find a way to kick people via blueprints ? Any solutions..

thin stratus
#

@untold swift But you used these Subsystems on their own, right?

#

You didn't mix them to have crossplatform, or?

#

@light fog Are you actively setting "MaxPlayers" to 4 in the launch options of that server?

#

Because UE4 has a system for this in place already

woeful ferry
#

Hey!

I have a small issue, the variables inside a component don't replicate. I have checked that the component is set to replicate, its owner is set to replicate.

This event runs on the server.

thin stratus
#

Needs more info. How are you calling that function? What Actor are we talking about?

crimson orbit
#

Noob question: suppose I'm trying to make an online checkers or ludo game, how can I allow a client to be able to move pieces? I thought making the tokens' movement function an RPC (Server, Reliable) would allow remote clients to be able to call it. I'm using a mouse button press and release event and projecting the cursor into the screen to move the tokens.

woeful ferry
#

Red = parent
Black = child

The parent fires the event "On Turn On Object" on all it's childs on the server side.

#

All it's childs are the ones connected via a cable

#

The event that sets it to true is ran by the server, but its variables won't replicate to clients.

tardy orchid
#

any tutorial for nameplates for a fps shooter?

#

I've managed to make them work using widget component in singleplayer but can't seem to get it working in multiplayer

#

if I do space=screen then everything works in multiplayer but the nickname doesn't dissapear when the player is behind something

woeful ferry
#

@thin stratus Found the issue, a parent had set the component to not replicating inside a blueprint.

light fog
#

@thin stratus Yes ive set the max public connection to 4 yet it is still happening :/

#

its takes event OnPostLogin so long to fire from joining session being triggered (around 5/6 seconds ide say) this gap is too big!!

thin stratus
#

MaxPublicConnections is a Session term

#

I'm taking about the Options you pass into a server or into a listenServers OpenLevel node

fleet raven
#

say the property you made a notify function for is a string, this will copy the string to the temporary parms and then never destruct it

fleet raven
#

same issue with structs

chrome bay
#

Looks like FMemMark has some custom overrides for new, and frees the mem with Pop()

fleet raven
#

that will delete the FString object without calling the destructor, leaving the memory it allocated to hold the copy of the string data in limbo

chrome bay
#

Ahh I see what you mean. Hmm

fleet raven
#

guess I'll submit a PR to fix it

brittle tulip
#

Hey, quick question i have this bool that keeps track of whether i was jogging before I started sprinting. Would I need to replicate this to both the server and client? My guess is yes

#

(This is done in the character movement component)

rose egret
#

is there anyway to send Client RPC to a specified client other than owner ?

#

other that redirecting or by PC

#

thats what I am already doing

void ReloadStart()
    {
        for(APlayerController* pPC : allPlayers)
        {
            if(!this->IsNetOccluded(pPC))
                pPC->ClientPawnReload(this);
        }
    }
chrome bay
#

The only way is how your doing it

#

Which is why a replicated property would be better

#

Also, nothing is culled on the Server - so the call to IsNetOccluded is superfluous

#

Oh nvm, just re-read. But yeah, a replicated property makes a lot more sense here

rose egret
#

I have the same problem with replication. I can't have custom condition per connection.
and that's so weird.

chrome bay
#

Yeah you can't, there are specified conditions and that's all

#

But the point is that properties will only replicated to relevant actors automatically

#

So you don't need to control that

rose egret
#

I need to stop sending of some redundant properties when characters are behind wall but still need some of them like fire event etc

#

the default conditions like SkipOwner, OwnerOnly, are not enogh for me ๐Ÿ˜ฆ

chrome bay
#

You can't do that - but you don't want to anyway. Per-property checking of conditions for each connection would be far more expensive than just replicating it

#

A bool for example is a single bit, it's nothing

rose egret
#

๐Ÿค”

chrome bay
#

Conditional replication works based on the type of connection, COND_Custom simply exists so your can turn replication of a property on or off inside PreReplicate(), but that's also for all connections.

#

Premature optimization and all that.

#

Plus I feel like that has the potential to create a lot more problems than it solves.

#

Keep it simple ๐Ÿ™‚

rose egret
#

better to try compress it more instead

#

๐Ÿค”

chrome bay
#

Property replication is cheap, trying to skip replication of a bool or something based on whether a player is behind a wall or not is fruitless

#

In the grand scheme of things it'll probably cost more than it'll save

#

It'll also cause a lot of sync problems. What happens when a player emerges from behind the wall etc?

#

Or late-joins - in the case of those RPC's above

rose egret
#

I considered a big BBox for that. seems working

chrome bay
#

UT's character class has 49 replicated properties, plus all the base properties from the actor.

#

And they don't bother with it - and their target FPS was 120

rose egret
#

what about replicating movement ?
is that sane to have 40 relevant characters for each connection ?

chrome bay
#

Sure, we have 100 at times

#

Not at 120hz of course

rose egret
#

I already pause the replication when characters are far from the viewing client and and behind wall. plus some extra value when he the viewer has sniper ๐Ÿ™‚

chrome bay
#

Replication Graph is the quickest way to get benefits

rose egret
#

but the problems is shooting, reload, .. doesn't work well

#

๐Ÿค”

chrome bay
#

If you have high player/object counts

#

Look at ShooterGame's code for handling weapons.

#

It's dated but still viable

rose egret
#

yea I saw that.

#

another question. how you do implement client prediction for a fast peace FPS game. for realod, weapon switch, weapon pickup, ...
I am already using my homemade solution which seems buggy in some cases.

#

I am thinking about moving to GAS

#

๐Ÿค”

chrome bay
#

@meager spade is probably the best person to ask when it comes to GAS for shooter-y games.

#

strictly speaking you don't need complex prediction for weps IMO

#

you want certain things to feel responsive, ShooterGame has that. Reloading/shooting is mostly unaffected by lag for example.

#

ShooterGame is not the best approach but it works

#

Uses an unnecessary amount of RPC's

rose egret
#

๐Ÿค”

meager spade
#

i use a RPC per shot lol

#

all firing is done client side

#

including who the client hit

#

don't run animations on server nor do i do any re-winds

rose egret
#

I am doing the exact same .

#

๐Ÿค”

#

I have some problems with Ack / Nack of the action local client performs.

dark edge
#

@meager spade are you using GAS with your guns or just all your own systems?

rose egret
#

for instance
player press reload.
reload task in done instantly on local client.
a server rpc is send to do send the action to server.
the local client do the reload but after it he cant do anything till verification.

#

I dont have things like revert rollback ,,

#

I dunno how to say it but when I get packetloss and lag I get into trouble

meager spade
#

@dark edge GAS for the actual hit/targetdata/effects/cues

#

weapon logic (like firing state, firing modes) are all external to gas

#

like this is for my Weapon shot from my FireMode

#

my weapons also don't use direct bindings to ability system

#

basically, Controller tells pawn to fire its current weapon

rose egret
#

๐Ÿค”

meager spade
#

weapon goes to firing state if possible, if its ranged weapon, it activates the firemode

#

Automatic, single shot, burst, etc

#

this then calls FireSingleShot if its hitscan per shot, FireProjectile if its projectile or FireCartridge if its a shotgun

#

server side of the ability, sits there waiting for target data to come in

rose egret
#

nvm I am gonna go play apex to refresh my mind

shrewd tinsel
#

how to build dedicated server?

#

does it build everytime i play game in editor?

fathom dust
#

if I have a replicated property in my C++ PlayerState class, and I want an actor to be able to respond whenever that property changes, what's the best pattern?

#

do I just use ReplicatedUsing=OnRep_MyProp and trigger a multicast delegate inside OnRep_MyProp?

polar lotus
#

whenever I have a lot of multiplayer simulations running on my PC

#

like 3 clients

#

and a server

#

some RPCs dont get called unless they are marked as reliable

#

is this normal?

#

or is my network pipe getting too clogged?

rose egret
#

@fathom dust whose that 'an actor' ? if its your pawn then

    void OnRep_MyProp()
    {
        this->GetPawn<AMyPawn>()->OnRep_PlayerState_MyProp();
    }
rich hare
#

does anyone have a clue as to how one would create a local multiplayer character select? My idea is to have a widget that all 4 players use at once and preferably select with a cursor system (a la smash/ rivals of aether) to simplify navigation. I've seen tons of ue4 games such as street fighter v, dragon ball figherz, soul calibur 6, hell even yoshis crafted world use this system. so what are these devs doing that we somehow have not documented?

rotund granite
#

Coming from Unity, what would you say is the closest thing we can get to the Dot Net TcpClient in UE4?

tacit flume
#

Hey guys anyone know if UE changes some graphics/performance settings when you enable splitscreen? I have a problem where the landscape in splitscreen starts showing black artifacts i think it's shadows etc going mayham but not sure. Works fine when solo online/offline.

fathom dust
#

@rose egret I've got a few different pedestals with buttons on them, I'm just making rock paper scissors to get my head around replication. One set of pedestals per player. If you choose a move, your pedestals all react by changing colour to show which one you've selected

#

I ended up just having a dynamic multicast delegate called MoveChanged that broadcasts in a setter for my PlayerState::Move, and the Pedestal actor sets up a server-only listener on the delegate in its owner's player state

#

It's hacky and I'm not a fan of it TBH but it means I don't need the state to know about actors in the scene

inland hedge
#

What am I doing wrong? I have:
BP_Furnace
It has a boolean: Enabled - RepNotify, replic.condition: none
It has an event, "PlayerWantsToToggleEnabled" - Run on Server, reliable
Another event, "ToggleEnabled" - Multicast, reliable

On the event of "PlayerWantsToToggleEnabled", boolean gets switched (validation logic comes here, I expect this to run on the server).
On the "OnRep_Enabled" event, the "ToggleEnabled" event is ran.

Event ToggleEnabled: Check if Enabled is true, and change mesh accordingly.

It only seems to work on the server. If I run the event on a client, all I see is the event "PlayerWantsToToggleEnabled" being fired on the client, and nothing else.

#

Basically what I want it to do is;

Client 0 -> server [I want to enable furnace XYZ]
Server -> [validates] -> enable furnace -> Tell clients 0, 1, 2, 3 that furnace XYZ is on
Client 2 -> server [I want to disable furnace XYZ]
Server -> [validates] -> disable furnace -> Tell clients 0, 1, 2, 3 that furnace XYZ is off

meager spade
#

you doing a server rpc on it?

#

@inland hedge

#

if so then it will never work for clients

#

unless the client OWNS the furnace (ie, server has set the owner of that furnace to the player who wants to interact)

mystic pilot
#

@inland hedge Shared some code about using/interacting with a non-owned client side object and routing it to the server via the player controller.
At this point, its as if you are just calling a function on the server and you just what ever it is you wanted it to do on the server.
No predictions or fancy checks going on - that'd all be up to you.
https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1781168-modular-interact-system

inland hedge
#

Aaah, thanks @meager spade , I thought it might have something to do with "ownership"

#

I am using blueprints ๐Ÿ˜ฆ no idea how to get those RPC to work.

#

I'm used to writing my own packets and protocol in my multiplayer games but this is the first time I'm trying UE4

#

Thus I'm stuck at using blueprints because I want to get to know the system

#

I don't know the API

#

That code looks clean, but I wouldn't know where to start writing it D:

calm monolith
#

my character spawns in as a spectator how do i fix it

devout flame
#

gamemode settings?

mystic pilot
#

Make sure game mode has a default character set, the map has a spawn point and delayed start on the game mode is disabled.

#

For starters ๐Ÿ˜›

topaz kindle
#

hello everybody !, i am stuck on creating game session with cmd for 2 days now and i really need your help ๐Ÿฅบ
do u know what does this means ? and how to fix it ?

fossil spoke
#

@topaz kindle You need to delete some Fleets you have to many.

topaz kindle
#

@fossil spoke is there a command to clear all fleets or i have to do it from web ?

fossil spoke
#

Oh your trying to create a gamesession.

topaz kindle
#

yes

fossil spoke
#

Sorry i missread the error

#

Ok

#

So

#

A Fleet defines how many concurrent instances (GameSessions) can run at once.

#

You currently have set 4

#

You must have already requested 4 gamesessions before

#

And they havent closed yet, meaning your Fleet is full.

#

In the AWS GameLift frontend.

#

You can easily check where a Fleet is up to.

#

The maximum number of GameSessions cannot be greater than the Active Server count for a single instance..

topaz kindle
#

my fleet is empty

fossil spoke
#

You havent created a Fleet to use then.

topaz kindle
fossil spoke
#

Thats not a command, thats a parameter to the create-game-session command

#

Its specifying which Fleet to create a GameSession on.

topaz kindle
#

well, and when i create a fleet it is asking to select a build ! but the build drop down list is empty !

fossil spoke
#

You have to upload a build of your Game Server to GameLift so that it can create instances of the Server.

#

Do you understand what GameLift is?

#

Have you read the AWS GameLift documentation?

#

It explains this process.

#

I recommend you read through this.

topaz kindle
#

yes, but the tutorial i am following , he didn't upload a build or a create a fleet . he tested it locally i dunno how

#

and it worked with him with those commands and it printed Healthy !

fossil spoke
#

GameLiftLocal is a waste of time. Its extremely limited in scope and can be difficult to setup correctly.

topaz kindle
#

yes, that is what i was trying to do according to the tutorial

fossil spoke
#

Its been a long time since ive had to deal with GameLiftLocal and i cant remember exactly how its meant to be setup.

topaz kindle
#

well, thanks in advance. ill skip "GameLiftLocal" Step. i can't try on it anymore.
i opened those documentations few hours ago to check for what i have missed, but i didn't find a clue, thanks again โค๏ธ

meager hedge
#

Hey all, maybe someone here can help me out with this. I'm trying to do something very simple with Steam online sessions and ue4, that is just updating player names in a lobby. I successfully have people joining lobbies but only in the backend part. However, I'm getting a very weird issue. In the game mode class I've defined (and I know is active through some debugging) the Event OnPostLogin is not calling at all when another player joins the session. Am I doing something wrong?

somber glade
#

game mode only runs on the host/server you don't need a switch has authority there.

#

That also looks like it's your main menu game mode. Is that the game mode that's active on your Lobby map?

#

@meager hedge

meager hedge
#

yes

#

also checking authority never hurts

#

despite the fact it shouldn't run on clients

somber glade
#

It's an unnecessary calculation.

meager hedge
#

regardless, that doesn't tell me why onpostlogin is not running on the server when a player successfully joins

polar lotus
#

ugh

#

I used to have this issue

#

its back again

#

my client movement is choppy again

#

its choppy on the server and client

#

in addition to this, for some reason, some RPCs are not getting called

#

it seems like my network pipe is clogged

thin stratus
#

Doing reliable rpcs on tick?๐Ÿ˜…

polar lotus
#

I don't think so

#

But I am replicating each players control rotation

#

I'll have to run a network profiler and see whats going on

winged badger
#

super easy to clog the network, one designer put the net priority 100.... by accident on one trash mob

#

result was that no short lifespan actors, like explosives, would replicate later in the game

lavish cypress
#

Is there a normal way to trim down the amount of data that's replicated by a default UE4 class, e.g pawn? Deriving from Character, overriding PreRep() and not calling Super seems to be the easiest way to decide what should be replicated

winged badger
#

not really, 4.25 started with the push model, but its largely incomplete

lavish cypress
#

could you point me to where I can read more about that?

winged badger
#

i don't know, still on 4.24 here so it was not relevant

#

iirc you can decide which variables replicate, but you can't decide if you want to push an actor to be evaluated for replication in the first place

#

which is the bigger issue, as the CPU time server can spend evaluating actos is capped

#

so you can end up with network congestion without having any bandwidth problems

lavish cypress
#

which is where rep graph comes in

winged badger
#

rep graph is just a more convenient way to handle relevancy

#

it helps, but its not a magic bullet

#

about 80% of my replicated actors replicate via fastarrays in custom network managers

#

and have the bReplicates false

#

which makes ~1800 Actors replicate via 16 Actor channels, and it improved the network performance a lot

#

since that upgrade our 8 player co-op game works just fine with 16

lavish cypress
#

Interesting

fossil spoke
#

@lavish cypress Push Model is pretty easy to start using.

#

Its a couple of Macros

lavish cypress
#

DOREPLIFETIME_WITH_PARAMS?

#

cool ty

trim kindle
#

Would it make sense for me to remove replication limitation which allows server rps only from owned actors? The game is top down non-competitive coop and there are various objects which all players can interact with. Relaying all the interaction with these objects thru Pawn/PC seems messy.

#

I am not sure how deeply is ownership integrated into replication. I imagine it as just removing some checks from the client and server code.

winged badger
#

no, it would not

#

ownership allows for Server and Client RPCs

#

even if you could hack it to let Server RPCs through from non-owned Actors

#

what would the target of Client RPC be?

#

you don't really need an overabundance of relaying either

#

you essentially need an Interact() and AbortInteract() functions which are Server RPC

trim kindle
#

Maybe actor with same id on the server could be a target.

winged badger
#

not having all your interaction go through the same pathway, that would be messy

trim kindle
#

I get to this issue because I would like to use character movement when character has no Controller. For example crouch the characters from the client.

#

Because of not having an owner, SetCrouch does not work.

#

And i also can not use custom RPC to call it on server as the actor does not have owner.

#

maybe I should do the RPC in PC?

winged badger
#

if your controller is controlling several characters

#

at the same time

#

make a component for the ones that aren't possessed

#

server also knows that those characters aren't possessed and can crouch them itself

#

also, even if your controller is no possessing a particular character

#

as long as you call SetOwner on the Character server side with PC as Owner

#

it can RPC through them just fine

trim kindle
#

okay, thank you! I will probably try something with managing the ownership manually

winged badger
#

if you have a bunch of characters that your players can control/possess freely

trim kindle
#

yes, up to 10

winged badger
#

the round trip is going to be a problem

#

with frequent changing of ownership/possession

#

as you can't do anything before server executes its side of the code

#

and in theory, character can show as free to 2 or more clients, but they can all try to select/possess it before server marks the character as spoken for and that replicates

trim kindle
#

I see, in that case it would make more sense to do the server order RPC in PC and let it crouch chars

#

and not rely on ownership much

winged badger
#

and there is nothing you can do about that problem above

#

in this particular scenario, no form of client prediction will help

trim kindle
#

In my option, it would make sense to be able to have RPCs even for non-owned actors. Not for all of them, maybe some specially marked ones. Unless security is top priority

winged badger
#

they are net addressable, so just make a component on the PC to manage non-possessed characters

#

and put the logic there

#

avoids clutter

trim kindle
#

so basically that's the good old approach of stuffing everything to PC but with dividing it into components for better readability, correct?

winged badger
#

not quite

#

your PC keeps track of hovered character

#

doing an example here, doesn't have to be exact

trim kindle
#

good example, as currently I have selection comp in PC which keeps track of selected chars :)

#

and there is multicast_CharSelected(char)

#

in the comp

winged badger
#

so if you press C while you have a Character under mouse you do MyControlComponent->ServerCrouch(SelectedCharacter);

trim kindle
#

I see

#

that makes sense

#

I will try something like that

#

thanks for the help!

winged badger
#

you can optionally handle possessed one in the PC

#

with prediction

#

and that one would react to C when there are no Characters under mouse, or it is the one under mouse

#

for example

trim kindle
#

yes, even in the Pawn

#

I remember Epic was working on some general prediction system

#

Is it still a thing?

winged badger
#

it wears dipers

trim kindle
#

hehe

#

good to know

humble zealot
#

anyone here using advanced sessions?

#

If I disconnect from the game, I can't rejoin from the server browser

#

I assume cause it still thinks im in game?

twin juniper
#

How do I decide which client is the listen server?

#

Or is it chosen at random?

chrome bay
#

Nobody is chosen, the player chooses to host, then other players can choose to join.

#

In Editor, the editor viewport is the host player.

twin juniper
#

But what if its not in the editor?

#

Is it the first player that launches the client.

#

Which is the host?

loud tangle
#

Hi Guys and Girls, can you help me with an issue with an animation in the network. I use on rep notify for this replicated variable and on rep notify I play a montage. This works On the server Only but the clients don't see it, and on Client To server the Owning Client and The Server Sees it. I would like to make it work on all. can this be done like this without replicating the animation? As I would like to avoid that.

#

If for example there are 3 players and 1 is the host, 1 plays the animation and sees only him. 2 plays the animation and only 2 and 1 sees the animation, the same for 3. But I need it all to see the animation.

#

Like the animation should play on all clients. Because the variable is replicated from the server to clients

chrome bay
#

Where does that code exist?

#

Animation Blueprints don't support replication

loud tangle
#

this is in the character

#

I am not doing that in animation blueprint I play a montage

#

But I would like to avoid multicast an animation

#

this is why I work with a bool variable but it is like it is not multicasting.

chrome bay
#

You don't need a multicast if you have a replicated bool already

loud tangle
#

Yes I tried that

#

but does not work ๐Ÿ˜ฆ

chrome bay
#

one sec

#

The RepNotify function is where you would play the montage

#

It's not really ideal, though. The rolling should be integrated into the characters movement system

loud tangle
#

Yes there I play it trying now thank you

#

But i would like to integrate other animations as this one too ๐Ÿ™‚

#

so not ok that too

chrome bay
#

Extending character movement for multiplayer is mostly a C++ endeavour, unfortunately. That's the only way to do it 100% properly.

#

Then you just drive animations based on the movement state.

loud tangle
#

Not working ๐Ÿ˜ฆ

#

The rolling this way works only on the server

#

It is like the replication does not go from the server. with rep notify

tardy orchid
#

yoo, what's the best way to do nameplates in a multiplayer fps, I'm trying widget component with space=screen but this way the nick name doesn't dissappear when behind cover so should I try work it out or find a different way to do this?

nimble basin
#

Can anyone tell me how to create the dedicated Server AppID on the steamworks site to distribute your dedicated server build with?
Step 1 from the official documentation for how to do this doesn't work for me: https://partner.steamgames.com/doc/sdk/uploading/distributing_gs
Specifically there is no "Create new Tool" button from the instructions.... Step 1: under AppID landing page > "Associated Packages and DLC" > "Create new tool" button.

#

but I've done that before and it never gets me anywhere..

hybrid crown
#

Hey guys, i don't understand how Force Net Update node (or cpp) work.

For me an actor tick X time per second (net update) and force net update allow you to force a tick, between two tick.
But when i use force net update, it's not happening on my testing,

How it work precisely ? thanks !

foggy hinge
#

FNU just tells UE to replicate the data on the next frame. This allows you to reduce how often the server needs to check whether the actor needs its network state to be updated (NetUpdateTime)

#

FNU has no influence over tick.

hybrid crown
#

thanks @foggy hinge, yeah, ofc i speak about NET tick (net update)

#

not tick of an actor (sorry for the confusion)

#

So, FNU should be only used (to work) on a client side, right ?

#

not on server.

foggy hinge
#

Server side.

hybrid crown
#

hum...

#

so i've got an issue.

#

Imagine i net update an actor every 10 seconds (for example, and it's on my test).
When i FNU on my server a variable, she is not replicated on the next frame, but on the next net update

#

and it's what i don't get.

foggy hinge
#

Any dormancy rules set?

hybrid crown
#

awake.

loud tangle
#

Hey there DevSquad, today we've just released our FREE steam multiplayer fundamental course which will teach you how to use the steam API and the advanced sessions plugin to create the logic for your game to host, join and search for game instances within your project.

You ca...

โ–ถ Play video
foggy hinge
#

Ah hm... relevancy rules? Replication graph rules?

hybrid crown
#

no replication graphe, actor for the test is always relevant.

#

so but if you tell me FNU should update on the clients between two net update

#

then i probably do something bad, i will check back my code

#

thanks for the clarification james.

foggy hinge
#

Well, it should update clients on the next net tick

nimble basin
#

@loud tangle Thanks, i checked it out.. it looks like basics for listen server setup stuff, but doesn't get into dedicated server, and setting up steamworks to distribute dedicated server. Thanks for the link anyway.

#

I've been going off of this guide which someone had shared and works pretty well so far, but i can't get the steamworks api to do anything with my dedicated server build.

loud tangle
#

@nimble basin thx will check that too ๐Ÿ™‚

dusk aurora
#

Hello! I am new to developing games, I was wondering if someone can help me get started with a game?

#

a multiplayer game* lol

meager spade
dusk aurora
#

oh, sorry!

meager spade
#

if you have a specific question or need some tutorials then ask, but asking for others to help this is not the channel ๐Ÿ™‚

loud tangle
#

@dusk aurora first make a game plan see on the web how to do it. Then organize all your stuff and keep to the plan

#

then you'll know what to ask specificaly.

polar lotus
#

this is the kind of issue I am experiencing

loud tangle
#

@polar lotus it seems your movement component is not replicated.

polar lotus
#

I tried that

#

it does nothing

#

it seems to only happen in a real session

#

lile

#

like

#

When I simulate in editor with 1 client, it does not do that

#

but If I package the game and run it on 2 real computers, the client does that

#

@loud tangle

thin stratus
#

Do you simulate lag in the editor?

#

This looks like you are modifying movement speed somewhere

#

And you aren't replicating that change properly

polar lotus
#

I tried simulating lag in the editor

#

it acts the same way

crimson orbit
#

if I want to get all the player controllers currently connected to my game and assign actors to each of them, at what point should I do it?

#

Can't do it on beginplay, so is there an event which fires once all players have connected to the server?

polar lotus
#

There is OnSwapPlayerControllers

crimson orbit
#

thanks I'll check it out

thin stratus
#

it acts the same way
Being the laggy way or the working way?

loud tangle
#

I have the same when I set the variable of speed and that is not replicated

#

So for example I have the default speed to walk then I set the speed to run on client

#

so the client runs but the server set's your position to the server's position as on server yo uwalk

polar lotus
#

@thin stratus laggy way

#

I have an older version of my game that doesn't do that I think

thin stratus
#

Are you modifying the MaxWalkSpeed of the MovementComponent?

polar lotus
#

not at all

thin stratus
#

What YLok wrote is usually what happens

#

So I would try to print the speed of the player, both MaxWalkSpeed and Length of the Velocity

#

And check if that is equal on both

polar lotus
#

I need to replicate my MovementComponent?

#

The older builds of my game worked fine without it

thin stratus
#

Hm, not sure you need to

#

I mean, theoretically you need to

#

But they offload the RPCs to the Character class

#

Either way, you have to make sure that you replicate movement speed changes

#

Also please do what I suggest for debugging

#

Otherwise I can't help you

#

MovementSpeed is not replicated by default, even if you replicate the component.
In BP only you have to make sure to use a RepNotify float and let the server set it, so you can then set the MovementSpeed with that variable in the OnRep

#

That said, this is still not the perfect solution, cause you will have small corrections at higher pings when starting and stopping to, e.g., sprint

polar lotus
#

Im going to try running an older version of my game that did not have this issue

#

and see what changed

thin stratus
#

... or you could print the speed values

#

And let us know what the result is

#

So we can further tell you what it could be

polar lotus
#

I'm positive It's not the MaxWalkSpeed

#

I checked all references

thin stratus
#

Okay, then I'm positive you'll figure it out alone (:

polar lotus
#

you're telling me MaxWalkSpeed would be the only thing causing this?

loud tangle
#

You Try to change it then test

polar lotus
jovial stream
#

When i'm trying to change the gamemode when opening a new level, the gamemode wont change, did I input the wrong string?

#

Nevermind I forgot the _C at the end

#

its working now

shrewd tinsel
#

how come i cant find any sessions? my ports are fowarded and stuff

#

i can only find on lan

#

do i specify what online subsystem i want to use just by adding the config lines to DefaultEngine.ini?
if i do not specify any online subsystem, will it find any sessions?

#

@exi plz halp

thin stratus
#

@jovial stream You can setup aliases for the GameModes under Maps and Modes in your project settings

polar lotus
#

steam should not need you to PortForward

thin stratus
#

Then you don't have to type the wholempath

shrewd tinsel
#

do i need to specify any online subsystem to be able to find sessions?

thin stratus
#

Which one do you have specified atm?

#

@shrewd tinsel

#

Generally speaking, you need one that supports it. E.g. NULL doesn't, Steam does.

#

Steam however also needs you to actually sell the game on their platform, get an appid, etc etc. Not for testing but when finally releasing at least. You can also try to get Epics EOS to work, which should be free (?)

gleaming vector
#

anyone have a good way to just sync an animation's play time?

#

i've got an object that just animates, and I want it to be in the same spot on all clients (it's a ferris wheel)

winged badger
#

sync the network clock, use it to sync the animations

#

should get within few ms

gleaming vector
#

that's what I thought

#

but im not sure if the best place to put that is in the animbp

winged badger
#

you have to RPC for the network clock sync

#

so def. not the anim BP

gleaming vector
#

no, there is automatic clock sync

winged badger
#

the replication via GameState?

gleaming vector
#

GetServerTime

#

yeah

winged badger
#

can do better with just 10 lines of code

gleaming vector
#

it syncs every 4 seconds or so

winged badger
#

that one can get all over the place

gleaming vector
#

hmm, ok

winged badger
#

you just send an RPC with client timestamp, server sends the RPC with original client timestamp and its own timestamp back

#

difference between original and current client timestamp is roundtrip, estimate its half time to get to server, half time to get back

#

and you get a delta of server's world clock to client's

#

normally, it will be accurate to about 1/10th of the ping

thin stratus
#

GAS system sync montages

#

Not sure the code is bugfree

#

But they sync based on montage position

#

So you could check that

delicate zinc
thin stratus
#

Should happen in the AbilitySystemComponent_Abilities.cpp in the OnRep_RepMontageInfo or something along that line

#

@gleaming vector

gleaming vector
#

yeah, hmm

winged badger
#

can the client interact @delicate zinc ?

delicate zinc
#

Yes but only the sever seems to see the interaction

gleaming vector
#

i'm trying to find the lightest weight way of doing this

winged badger
#

so your states for actors after they are interacted with are not replicated (properly)

delicate zinc
winged badger
#

i originally added network clock sync for 1 purpose, now it has 10

thin stratus
#

@gleaming vector Can only suggest looking at their implementation

delicate zinc
#

Idk how to tell the client that it just interacted

gleaming vector
#

yeah

winged badger
#

so its not a wasted effort

thin stratus
#

@delicate zinc Well that's okayish for the start. Your UsableActor has to properly replicate whatever the OnUsed is doing to it

delicate zinc
#

How would I replicate it?

thin stratus
#

Additional step would be predicting the interaction for the local client. In addition to the serverrpc

#

Idk, that depends on whatever actor and its info

#

Replicated variables and rpcs :P like always

delicate zinc
#

Sry I'm still decently new

thin stratus
#

Yeah that won't replicate

#

Make a color variable and set it to RepNotify

#

Set the color variable on the interact event

#

The replication of it will trigger rhe OnRep function that gets automatically created when you set the variable to OnRep. In that function you can then set the VectorParam on the Dynamic Material

#

If any of the above is unclear, please read my compendium, which is pinned to this channel

delicate zinc
#

Okay, thank you I understood everything you have said. Thank you so much

thin stratus
#

Make sure the Actor is set to replicate and that this interact event calls on the server!

delicate zinc
#

okay, thank you,

shrewd tinsel
#

@thin stratus im not using any online subsystem, just opened ports and created a session. should work, shouldn't it?

fathom dust
#

@thin stratus hey thanks for writing the compendium!

shrewd tinsel
#

yeah totally

meager spade
#

@gleaming vector We actually ripped out the GAS implementation and it works well for syncing animations there will always be delay, ie client A will always see it slightly different from Client B. But does a slight slight difference really matter?

gleaming vector
#

the bigger problem is that the animation drives a collision volume

#

that players stand on

meager spade
#

yeah then that's going to be an issue, i mean unless you made the collisions volume client side only, with a RPC when they enter it?

gleaming vector
#

it's a ferris wheel

meager spade
#

so they walk on and start the ride?

gleaming vector
#

yeah

#

it's always rotating

meager spade
#

ah

gleaming vector
#

im wondering if the play is to have a curve animation

#

and sync the curve value

meager spade
#

i mean that seems really hard to do considering you would need to know everyone's latency when the ferris wheel starts playing its anim

gleaming vector
#

yeah

#

latency isn't going to be the biggest issue

meager spade
#

framerate drops?

gleaming vector
#

because i have a non-standard situation where the client is being hosted in the cloud and the video streamed back to a browser

meager spade
#

o_0

gleaming vector
#

so, the client and the server are both in the AWS cloud

#

in the same data center too!

#

latency is like 1ms max

rich hare
#

has anyone successfully created a local multiplayer character select? More specifically, a menu that allows for multiple people to operate at once without having to take turns. I've seen tons of ue4 games such as street fighter v, dragon ball figherz, soul calibur 6, hell even yoshis crafted world use this system. so what are these devs doing that we somehow have not documented?

inland hedge
#

why would you need to document that?

#

p1 controller controls p1 selector, p2 controller controls p2 selector

#

done? i guess? ๐Ÿ˜…

cedar finch
#

What would be a good approach for getting a random integer in range and replicating it? I want to randomly pick an integer so I can play a sword attack based on that integer, but I want everyone to see the same anim. So I need to replicate the integer. I just want to do it the most efficient way because this will be used/spammed over and over by players pressing the attack key.

meager spade
#

use a seed

#

player has a unique randomstream set by the server

#

then you use that stream

cedar finch
#

Ahhh That sounds like a good idea. Let me try that out. Thanks ๐Ÿ™‚

inland hedge
#

hey UKaosSpectrum, nice to see you here ๐Ÿ™‚ thanks for the link you sent yesterday - but I'm a giant noob at C++ and think I'm doing this wrong

#

I didn't have a PlayerController.cpp so I made a new one

#

I can compile the interface without a problem

#

now I'm adding the functions to my (empty) controller, and also had to add stuff to the header file (i guess?)

#

but I think I'm missing some crucial step, or the 2 pieces of example code you've written down aren't matching up

#
if (GetLocalRole() < ROLE_Authority)
            {
                IUseableInterface::Execute_ClientUse(UseTarget, this, UseType);
                ServerUseActor(UseTarget, UseType);
            }
            else
            {
                IUseableInterface::Execute_ServerUse(UseTarget, this, UseType);
            }

basically this part

#

its stating "Execute_ClientUse", "ServerUseActor" and "Execute_ServerUse" do not exist

#

but if I rename them to match the Interfaces' methods, the arguments no longer line up - what am I missing?

#

@meager spade shameless ping :3

meager spade
#

show me your interface

inland hedge
#

I love it when you talk dirty to me

UINTERFACE(MinimalAPI)
class UUseableInterface : public UInterface
{
    GENERATED_BODY()

    UUseableInterface(FObjectInitializer const& ObjectInitializer)
    {}
};

class SCAPEVALE_API IUseableInterface
{
    GENERATED_IINTERFACE_BODY()

public:
    UFUNCTION(Category = "Use", BlueprintNativeEvent, BlueprintCallable)
        void Use(class AController* Controller, FName UseType);

    UFUNCTION(Category = "Use", BlueprintNativeEvent, BlueprintCallable)
        void ServerUse(class AController* Controller, FName UseType);
};
#

its the one you wrote on that forum topic

#

like, there's an actor param missing in this interface

#

or there's a useless actor param in the usage of the interface

#

but I feel like I might be missing some magical step because the misalignment seems to big for the two files to be supposed to be together ๐Ÿค”

meager spade
#

hmm

#

gimme 10-15mins

#

let me finish what im doing so i can focus

inland hedge
#

allright ๐Ÿ˜„ take your time โค๏ธ

rich hare
#

@inland hedge in umg, there can only be one focus cursor at a time on blueprints alone

inland hedge
#

Oh, i have no idea about UMG ๐Ÿ˜ฆ sorry

#

I was thinking plain game development ๐Ÿ˜… im very unexperienced with UE4

rich hare
#

i mean ive been doing this for 2 years and i feel like i only have 2 weeks of experience

inland hedge
#

yeah the UE4 API is so extended, doesn't make it easier

rich hare
#

at the same time there is probably some convoluted custom c++ involved with a system like the one im describing

inland hedge
#

well that would actually be really easy in plain old code

#
foreach (playernumber) {
    playerAimingSpot[<playernumber>].x += player_input_right[<playernumber>] - player_input_left[<playernumber>];
    playerAimingSpot[<playernumber>].y += player_input_down[<playernumber>] - player_input_up[<playernumber>];
}

in pseudocode

fleet mason
#

srry guys I asked in the wrong channel

#

lol

pine kernel
#

guys is anyone good at networking who can help me ? im having an issue with my game i put the open IP Adress here on Intro_umap i forwarded the ports for unreal my server connects but after 20 sec i get ConnectionTimeout. i tried to add [/Script/OnlineSubsystemUtils.IpNetDriver] ConnectionTimeout=300000.0 to my DefaultEngine.ini but it doesn't work on 4.25

novel tartan
#

anybody know how to convert modular character creation in singleplayer to something with multicast so that others players can see it? would prefer to see the blueprint coding so i can better understand how it works. i heard that i also need like a game instance if i switch levels so that the changes they selected in character creation carry over? really not a lot of information about this and i dont like the ue4 documentation on the subject, so id prefer someone to just send me something theyve done to get it working.

somber glade
#

It depends. Are you going to have them choose the modular components after joining the multiplayer session or are they going to be chosen locally before joining?

novel tartan
#

well, the way this character creator im working off is seems to be set in local first off.

#

so i imagine it will just be converting it through multicast after its done

somber glade
#

Okay, if you're going to do it locally, the first thing you need to do is save the configuration in the game instance. have you done that?

novel tartan
#

so it needs somesort of save system where the float values get represented...

#

and im not entirely sure how to represent that yet

somber glade
#

it doesn't need a save system unless you plan to save the configuration between play sessions.

novel tartan
#

i think i need to set somesort of actor thing, where the guy is invisible at first,

#

but then it imports the changes that are associated with the user?

#

yeah. i plan to have that.

somber glade
#

Well then first you need to look up how to create a save game and write that to file and load it.

novel tartan
#

so i need somesort of backend with a user database. and im pretty sure with enums i cant do that, i need to do something else for that.

#

create a save system. thats a good start.

somber glade
#

You need to create a save game asset to hold all the variables you want to write to file.

novel tartan
#

and then when the game loads, it'll load the values you set in character creation?

#

login screen 'enter' username/ p.w > load level > load character variables > replace default character with the character creation material > spawn in level

#

something like that?

somber glade
#

This is an example of the save game asset I use for the game settings. Things like antialiasing and texture detail are saved and set outside of normal variables in UE4.

novel tartan
#

ahh, so this is like an options menu

somber glade
#

This runs on the game instance when the game starts.

#

to create a reference to that save game asset.

#

You need to create a similar save game asset that will hold the configuration for your modular character.

novel tartan
#

is that save game asset something that comes with unreal already

#

or something i need to build

somber glade
#

Yes, just create a new blueprint and create it as a child of save game

novel tartan
#

hmm okay. . .

#

oh you have a parentclass for svegame

#

with unreal already

#

?

#

or am i mistaken

somber glade
#

Unreal comes with a savegame parent class built in

novel tartan
#

okay, thats really good

somber glade
#

before you get into this, have you used UE4 before?

novel tartan
#

yes, but its extremely difficult

somber glade
#

Okay well once you create the save game asset, you need to go in and add variables that you need. You'll need to decide what kind of variables you need to save the profile information.

novel tartan
#

i obviously know somethings but i have a great amount of blindspots because distance learning makes it too hard for me to ask questions to teachers

somber glade
#

I'd start with that first. Once you have a working save system that reloads your saved configuration you can start to think about replicating that for multiplayer.

#

You can't simply just load the data. Once you load the savegame, all that is doing is restoring those variables. You'll need to create something on the character or somewhere else to take that data and apply it to a character in game and restore the actual character.

polar lotus
#

I have a multicast RPC that is not getting called all of the time on the client

#

Like

somber glade
#

is it set reliable?

polar lotus
#

Yes

#

it works on the server

somber glade
#

have you added a print after it to verify it's not being called on the client?

novel tartan
#

okay, ill work on that. for now, i think that is what i need. do you mind if i dm you in a couple of days or so once i get something working? i dont really have a lot of people who know a lot about multiplayer - especially for this thing.

polar lotus
#

I can try

somber glade
#

Sure, I'm not an expert or anything, I dabble at most, but I'll help you if I can

novel tartan
#

dabbling is better than nothing

#

dabbling is exactly what i need

pine kernel
#

so no one can help me ? my server is fine but i get connectiontimeout after 1 min

thin stratus
#

@shrewd tinsel No. UE4 doesn't magically show your Sessions to the world.

#

@fathom dust No biggie, glad it helps!

shrewd tinsel
#

@thin stratus i see, so online subsystem is for when you don't want to type in server ip address to join, it allows to see all created sessions, right?

thin stratus
#

OnlineSubsystemNULL: Direct IP Connection, LAN Sessions (which is actually a Broadcast Message, asking whole LAN if they are hosting).
OnlineSubsystemXYZ: Depending on the support for it: Direct IP Connection, LAN Sessions (same Broadcast Message stuff), Online Sessions.

#

Depends on the Subsystem you want to use. Steam is usually used for PCs, but come with the whole 30% stuff of course.

shrewd tinsel
#

right, thanks

#

are there any open source free simple basic online subsystems?

#

anyone used amazon online subsystem?

#

if i change something in the blueprints, do i have to rebuild server?

trim kindle
#

From CharacterMovementComponent documentation: it provides a framework to help developers create custom networked movement. ... IMHO it is all but framework... it is huge spaghetii class with everything stuffed together

tacit pecan
#

Hey... if i open up a third person template and start a 2 player session the walking and running animations are replicated but in my project im replicating the same anim bp and using the same skeleton but the animations arent replicating... does anyone know how to fix this?

novel tartan
#

there is a basic git somewhere out there which contains the multiplayer level from the tutorials by using steam. and a few others. just try searching for those.

twin juniper
#

How can I assign a level/map to a specific player or group of players and put them in the same level while keeping another group in a different level/map? Because I want players to be able to que up together so I don't want to assign them a level at random

#

I have a lobby system where players can join a que and it will use matchmaking to grab the two players in que and move them out of the lobby and into a game level. But I'm not sure how to grab them and move them from lobby to a level together.

#

And have the level be instanced for them alone.

chrome bay
#

A lobby is normally a separate server or connection altogether

#

Players join the lobby, then the authority within that lobby connects to a game server.

gusty slate
#

Hello everyone :)
What is a suggested way to identify each player on the MainGameState for example to keep scores?
Can I simply keep it in a custom PlayerState and have clients retrieve the info from there for UI and other behaviour?

chrome bay
#

yep, player state is the place

gusty slate
#

๐Ÿ‘ Always to the rescue Jambax ๐Ÿ˜›

twin juniper
#

A lobby is normally a separate server or connection altogether
@chrome bay Is it possible to keep it all in one server?

chrome bay
#

Not really, but you don't really want that anyway

#

Otherwise your game server will be chugging as it tries to manage all the lobbies as well regular game traffic.

twin juniper
#

i see. so I should make two separate servers. One as a lobby server and one as an in game server.

#

Then do I launch an instance of a game server for every new que?

chrome bay
#

Queueing is different to lobbies

twin juniper
#

Well once the queuing is done

#

I'm assuming a new instance of a game server

#

has to be spawned

#

or launched

chrome bay
#

no - but you need to have a connection to the game server to be in it's queue, so that it can tell you when to start joining.

#

We've done that in HLL with beacons

twin juniper
#

So the queueing portion is like the gateway from the lobbu connection to the game server connection?

chrome bay
#

There are a few parts to it:

  • Game Server - the actual game you want to connect to and play
  • Lobby Server - usually a player-hosted listen server, which other players can be invited to.
#

As for queuing, a player or a group of players finds a game server they want to connect to, then they request to join it - usually with a lightweight connection like a beacon. The game server then tells the players in the queue to join it once there is enough space available.

twin juniper
#

What about the initial connection when the player first logs in? What would you call that?

#

Because the way I want to do it is when players log in, they see a que button they can press. Then their MMR is used to determine who to put together.

#

And moves them to the game server.

chrome bay
#

Not sure what you mean. In the case of game servers, you either have dedicated servers which are running all the time, or players can host their own local servers which other players can then join.

#

Matchmaking is another beast entirely

green delta
#

has anyone dabbled in secondary servers or server migrations for listen servers? should this be implemented in a save file or game instance? there doesn't seem to be much else that persists to hold the data once the host disconnects :/

twin juniper
#

Okay let's scrap mmr from there, players are picked at random when they hit the que button.

#

And two are selected and moved into the game server.

chrome bay
#

That's not how it would work

#

They hit the button, then the player tries to find a server, then they try to join it

twin juniper
#

I see..

chrome bay
#

If you want matchmaking, then you need to also host permanent matchmaking servers so that they can join players who are looking for sessions together

twin juniper
#

And can a single game server host multiple game instances?

chrome bay
#

no

twin juniper
#

a dedicated

#

okay

chrome bay
#

dedicated server = one instance of a running game

#

Ignore matchmaking, you don't need it unless you have half a million players

#

and it's monumentally complicated

twin juniper
#

So I should use players as listen servers

#

to host the game

chrome bay
#

that's up to you

#

Either players can host their own servers and other players can find and join them, or you can pay to host permanent dedicated servers online which players can find and join.

#

Or both

twin juniper
#

Yes my only concern with players as the listen server

#

Is it makes it easier to hack

chrome bay
#

The advantage of dedicated servers is that you can guarantee some degree of security, listen servers give no such garauntee

twin juniper
#

because whoever the listen server is is controlling the game in a sense

chrome bay
#

But the downside is, they cost a lot

twin juniper
#

yah..

chrome bay
#

honestly for indie games, just make a server browser

#

players will thank you for it

#

And add a "quick match" button for the lazy

twin juniper
#

How would that work?

chrome bay
#

Quick match is basically just "find the first empty server and try to join it"

twin juniper
#

In terms of the server browser it's just random people hosting servers right?

chrome bay
#

It can be anything

#

When a player hosts a game or a dedicated server is spooled up, it registers itself with the online platforms "master" servers - (so Steam master servers, for example)

#

Then you can use the steam SDK to get a list of all running games, and players can choose one to join

#

The ShooterGame template and Multiplayer Shootout template do exactly that.

#

(both on the Learn tab of the launcher)

twin juniper
#

Okay thank you for all the info :) I'll try and figure something out.

chrome bay
#

Check out the templates and read up on the engines' Online Subsystems and Sessions stuff.

#

It has everything you need

tardy orchid
#

hello what's the best way to do nameplates in a multiplayer fps, I'm trying widget component with space=screen but this way the nick name doesn't dissappear when behind cover so should I try work it out or find a different way to do this?

chrome bay
#

Hide it when they are behind cover?

#

You need to do that yourself

tardy orchid
#

yeah so I was thinking either do something for the nick to disappear when the player is behind cover or try space=world and both these ways seem to have their own problems so I was thinking which one is the best way

trim kindle
#

Hello guys, I have one more question :). I am doing very simple

SafeMoveUpdatedComponent(Adjusted, NewRot, false, Hit);

Velocity = (UpdatedComponent->GetComponentLocation() - OldLoc) / DeltaTime;

in character movement's PhysCustom(), however Velocity is not replicated to simulated clients. Is there anything specific I need to do to enable that?

#

Maybe update Velocity in SimulateMovement(), not sure about it

#

I was expecting it to work out of box as that is what PhysFlying() is doing

grim lintel
#

Hi all. I have a quick design question related to multiplayer. Can someone provide me some real world examples when I would use PlayerState vs. Pawn in terms of multiplayer?

#

I was reading through the network compendium but still not 100% sure

dark edge
#

@grim lintel some implementations get blurry but I like to put something like health on the pawn but score on the player state.

#

Like if you were making Mario, your extra lives and stored items would be on player state. The Mario pawn would hold something like if it's big or the active item

grim lintel
#

@dark edge Thanks that helps a little. I think what confused me from the network compendium was the statement that we want something like Health on the Pawn (replicated) to prevent cheating. But then we have something like Score on the Player State, which I assume I would also want to have cheat protected. Or in other words: From that example I wasn't sure why I should treat health different than score. Same goes with the argument that those both would qualify for me to be something I want other players to know about.

#

But your example makes a bit more sense to me

mystic pilot
#

@inland hedge I didn't supply the header declarations related to ServerUseActor() is all.
Gotta leave something for you to figure out ๐Ÿ™‚

tacit jetty
spice snow
#

I'm having some issues replicating shooting using RPCs.

#

This appears to work as intended when playing as the server, but as a client, i see the shots fired twice

#

with one not taking pitch into account

#

is there anything wrong with the blueprints ive shown here?

#

when I shoot as the client, all the server sees is the one without pitch

dark edge
#

@spice snow is your projectile replicated?

spice snow
#

it's hitscan

#

whereever it hits, it spawns an explosion (which has "replicates" checked) and does damage

dark edge
#

That there's the problem. It's responding the explosion locally and also responding on the server, replicated, which means it'll spawn locally again

spice snow
#

i see

dark edge
#

Also, whatever is driving pitch is probably not being replicated correctly. Are you deriving your aim direction from anything other than control rotation?

#

You are already not predicting the shot so just do the shooting on the server.

spice snow
#

i use the forward vector of the camera

#

i see

#

so i should just run it on server?

#

not multicast?

dark edge
#

I mean, it's going to feel horrible with any amount of lag, but since you are not predicting your shots right now, it won't be any different.

#

If you want a really simple predicted shot technique, run the shot locally, then send the data about the shot to the server, which can multitask it out. A multicast, make sure that it isn't locally controlled before doing the shot, that'll keep the owning client from doing it again.

#

If you're not wanting to bother with that right now, just do the shot on the server, and replicate the particle effects etcetera.

spice snow
#

alright, i have it running just on the server, but still pitch is not taken into account

#

which is strange since the shooting gets the forward vector of the camera

#

wait, maybe i can pin the start and end of the line trace to the event

inland hedge
#

@mystic pilot yeah thanks ๐Ÿ˜„ actually the Kaos guy explained to me yesterday, I didn't know about the generated Execute_ functions so I was kind of baffled at the mismatching signatures

spice snow
#

alright, i think i finally got it working

#

and passed that through the server

#

now its all fully replicated

#

is this a good way of going about it?

#

hold up, its still happening twice haha

floral crow
#

What's the proper way to shutdown a dedicated server after required GameHasEnded conditions are met? (e.g. all clients have disconnected)

#

Right now dedicated server processes keep running forever unless manually terminated, and I'm struggling to find an official way terminate them via code

severe widget
#

otherwise you keep burning resources without a process up

#

you'd want to return a meaningful code so you can log it/raise it

#

That's only really a guess though, if anybody else here has a better suggestion for terminating a dedi?

#

fallback would be that you run https://docs.unrealengine.com/en-US/API/Runtime/Core/GenericPlatform/FGenericPlatformProcess/CreateProc/index.html < this guy and invoke a shell script that waits an amount of time before consigning the server to the scalability gods.

If you just don't want the server up... like, why not reset the level? There's a function to do that, and if you're paying for a server to be up it may as well be ready to go

Creates a new process and its primary thread.

swift cargo
#

Hey guys, i got super lost in a rabbit hole and i have no idea where to start over.
Is it possible with NO plugins or dedicated server to run a server on 1 pc, and play the same game on that pc AND also have other people connect to you on your server?

#

It works with my OWN pc and people on my network but when i package the game and send it to friends its impossible for them to connect to me.

#

someone pls help

#

I have been looking and looking through so much stuff trying to figure this out, what DO i need? i can i get away with?
i just want to make a little game that other people can connect to, LAN is the only thing that ever worked. what am i missing?

obsidian cargo
#

Are your friends outside your LAN?

#

If so you'll need to have them connect to your external IP and do some port forwarding

bitter oriole
#

Or use Steam for matchmaking & NAT punch.

obsidian cargo
#

Look up NAT punch through for more details

#

It's not an unreal thing

#

@swift cargo

swift cargo
#

@obsidian cargo
what port number should i be doing?

bitter oriole
#

7777 is the default

#

But it's not usually a good idea to use port forwarding since your users won't do it

brittle tulip
#

I want my character to walk, jog and run. I know I need to do this in a custom movement component, but should i also be decreasing stamina in the TickComponent() override

obsidian cargo
#

@swift cargo Port forwarding is just a shortcut to get your game working for you and your friend. You can choose whatever port you want. For final implementation you'll need NAT punch through.

swift cargo
#

@obsidian cargo
I tried pord forwarding, it didn't work for the situation with me and my friend.

#

Maybe it was a issue with the engine ini

#

I set it to use steam subsystem but didn't use any functions related to it.

obsidian cargo
#

Sorry I can't help with anything beyond general suggestions. I'm very new to Unreal myself.

swift cargo
#

Ye

#

Thanks tho

#

Any explanation on the implementation NAT punch through?

#

@obsidian cargo

chrome bay
#

@swift cargo The only way they will be able to connect is if they know your IP address btw, and they connect to that directly.

#

You won't be able to connect by just "finding" sessions, for that you will need an online service with a master server of some kind.

potent cradle
#

Hi everyone,

I'm trying to educate myself on constraints in terms of scaling complexity in the game world (on a single dedicated server).

I've followed a few discussions on the amount of replicated actors you can have on a single server. While researching this topic, the screenshotted thread came to my attention.

This raises a few questions for me that I'd be very grateful to have answered by someone more knowledgeable than me. That is:

I've always imagined the issue being centered around network bandwidth, whereas the thread says upgrading to a very beefy server solves part of the problem, whereas @bitter oriole (hope the ping is ok) mentioned that it's more an issue of it not being manageable on your client.

I can't put these things together, because it conflicts with my original interpretation of the constraints being concerned with bandwidth, that is causing you to typically be limited to say, 100 players. Is it maybe multiple things that are an issue? To which degree is what causing the limitations in this problem space?

chrome bay
#

The fastest way to see why it's also a problem for clients, is to put 100 basic characters into an empty map, and watch the FPS tank even in singleplayer

#

The issue is partly bandwidth yes, but the server and clients also need to be able to run and process all of that in the first place.

#

Then you add all your other gameplay systems on top, etc etc... you can see where it's going.

potent cradle
#

Hmm, that makes me think

#

Having hundreds of boids is performant with this tool

#

But, replication isn't enabled for this, because of the bandwidth concern

chrome bay
#

But boids are not even close to animated characters when it comes to complexity

potent cradle
#

No no, you're right. But would that mean that for simple things, it wouldn't be an issue bandwidth wise?

#

If your argument is "FPS will drop with many actors"

chrome bay
#

Well it would definitely still be an issue

potent cradle
#

As the FPS isn't the issue in this particular case

#

So it's multiple factors that constrain you

chrome bay
#

Yep, it all feeds in.

#

And it's very dependent on your game and what it does.

potent cradle
#

And it's very dependent on your game and what it does.
Would you be able to give some examples to demonstrate precisely that point?

#

I'm working on a survival game, if that helps

chrome bay
#

Well it's as I say, it's hard to give any specific example of what will and won't work because it's dependant on the rest of your game

#

The character movement system is very computationally expensive, as a starting point.

bitter oriole
#

@potent cradle 100 players is very hard on network performance, server performance, and client performance. All these things need solving for 100 players (let alone more than that).

chrome bay
#

100 players is a massive challenge. Take it from someone working on exactly that.

bitter oriole
#

Basically for 100 players you might enjoy rebuilding your own character class from the ground up, without the character movement component

#

Well, "enjoy", maybe not

#

"need to"

chrome bay
#

๐Ÿ˜„

potent cradle
#

Thanks guys ๐Ÿ™‚

I'm fine with trading players for AI, say, 50 players and n amount of AI. Can you say a few words about how the impact of AI actors that need to be replicated differs from players?

bitter oriole
#

AI or player has the same cost really

chrome bay
#

Maybe more so, depends on the complexity of your AI.

#

It's not all bandwidth/network related - huge numbers of characters are just computationally expensive, that's the way it is

potent cradle
#

Let's assume I manage to reduce complexity in terms of computational performance, and it's mostly the network performance that I am worried about when I try to answer that question.

bitter oriole
#

The only cost that is lowered through AI is your marketing budget, because 50 concurrent players is more than most indies ever see already.

chrome bay
#

100 players is still very heavy on the network yes

#

Whether AI or not

#

Also what Stranger said, 100 player indie is insane

#

Aim for 10

#

The reality of getting 100 concurrent players is next to nil

potent cradle
#

Sure, I mean, I'll let the AI scale to fill up player spots in the world. That's fine really.

#

Valid point though

bitter oriole
#

Aim for 2, more like

#

Actually aim for 1 but let's not be negative

chrome bay
#

yeah, multiplayer indie is a sad state of affairs this decade, unfortunately.

#

Not that we try to discourage anybody or anything...

potent cradle
#

yeah, multiplayer indie is a sad state of affairs this decade, unfortunately.
In what sense?

bitter oriole
#

Did you look at average sales on Steam ?

chrome bay
#

^

potent cradle
#

Nope

bitter oriole
#

Well, consider lucky to do 1000 sales (likely 10 concurrent users on launch day and then 2)

potent cradle
#

Fingers crossed ๐Ÿ˜„

chrome bay
#

Beware survivorship bias too

#

PUBG, Ark, RUST, etc, they're very much outliers

potent cradle
#

Oh sure, I mean, chances are always low you pull it off

#

The journey has been wonderful though, even if it ends up crashing and burning

bitter oriole
#

Yeah, working on games without needing them to sell is really nice

chrome bay
#

yeah just be sure to keep your goals in check ๐Ÿ˜„

potent cradle
#

sCoPe CrEeP

bitter oriole
#

Some recent data on Steam

potent cradle
#

I do have some hope for the niche I'm in

floral crow
chrome bay
#

Multiplayer just makes everything at least 4x more work.

potent cradle
#

4x the fun too though ๐Ÿ˜„

chrome bay
#

I've been doing 100-player indie for three years now it's anything but ๐Ÿ˜„

potent cradle
#

Can I see your project?

chrome bay
#

But, definitely a learning experience

potent cradle
#

That's dope though

#

Wow

chrome bay
#

It's taken a lot of people putting in lots of cash to get it where it is, I still think it's an outlier in itself.

bitter oriole
#

The TLDR on Steam is that 20% of games have a semblance of a playerbase (handful of players), and about 5% have a real playerbase (about 50 players or more)

chrome bay
#

Yeah, the figures are very discouraging ๐Ÿ˜„

bitter oriole
#

They're not really, you just need to do "play with friends" multiplayer as an indie without funding / large team

chrome bay
#

Release a couple of small games before going big, even getting to the finish line on a small game is a huge achievement.

#

You'd also be surprised how much stuff you forget about until it comes to that time too...

potent cradle
#

I'm excited

chrome bay
#

Haha ๐Ÿ˜„ It's definitely not my project BTW.. just one of a team

potent cradle
#

They're not really, you just need to do "play with friends" multiplayer as an indie without funding / large team
L4D style scope? Co-op type of thing. I think you made a point about listen-servers.

chrome bay
#

people love horde modes..

#

(including me)

bitter oriole
#

Ideally, 3/4 players cooperative on listen server

#

That you can still play alone, of course

potent cradle
#

It doesn't fit exactly for my game, but the point of keeping it smaller initially is making me think. Maybe I'll choose a lower agent count in my initial build. And gradually scale up.

bitter oriole
#

What I'm saying is that, a game that fits 1 to 3 players cooperatively, has a 100% chance of being playable all the time. A 4v4 competitive game has a very large (>80%) chance of not being playable most of the time. Assuming you're an average Steam developer with a ~4 person team and some experience.

potent cradle
#

That's one way to solve it, another is to employ a lot of AI that can scale depending on the current player count

#

That's the strategy I'm thinking of taking

#

I'm fairly confident I can get at least 20 concurrent players, knowing the niche I'm in and my state at launch compared to other similar games.

#

Even if it dips to 1 though, it'll still be fun with an AI filled world. I don't want the fun of the design to be dependent on the amount of players in the world, to the degree that I can influence it.

chrome bay
#

It's a shame multiplayer isn't something you can easily tack-on after the fact

potent cradle
#

Yep

chrome bay
#

Maybe in another universe...

potent cradle
#

~~Far away...~~A long time ago...

chrome bay
#

Keeping the CCU up has a lot to do with momentum too these days, being able to quickly update and fix etc.

potent cradle
#

Yeah, especially for multiplayer games

chrome bay
#

sounds silly but you're almost better off releasing earlier rather than later now IMO

potent cradle
#

Yeah, I'm trying to nail down a solid first build and then build it out further from there

#

Smaller scope

#

Your team did the same?

chrome bay
#

Honestly, I'm pretty sure we were winging it in the early days. Our route was Kickstarter -> Publisher -> Early Access

#

I joined post-kickstarter, but they already had a sizeable community by then which helped.

#

But generally we done major updates every 6-8 weeks (give or take) for the first year

#

So just as people start getting bored, they get new toys to play with

potent cradle
#

That's a lovely cadence

#

I've seen games not release updates often enough, even if the build is buggy

#

That hurts a community

chrome bay
#

Yeah if you lose that momentum, your players start losing faith - but you gotta be bringing in the money to pay to keep it going, so it's catch 22

#

short-term achievable goals and all that

potent cradle
#

I was hoping the early access train would help fund further

chrome bay
#

Yeah probably ๐Ÿ˜„

meager spade
#

do i get a discount key for HLL? ๐Ÿ˜„

#

can try :D

#

Anyone know why steam would still allow lobby connections even though the lobby is locked?

thin stratus
#

Does anyone know how OnRep calls tie into the Actor LifeCycle when HotJoining?
I noticed OnRep's calling before BeginPlay. Is there an Event in Actors and Components that is guaranteed to call before OnReps?

#

(Also, OnRep's calling before BeginPlay is such bs...)

chrome bay
#

@meager spade wish I could give one ๐Ÿ˜„

#

@thin stratus PreNetInit possibly?

meager spade
#
    virtual void PreNetReceive();

    /** Called right after receiving a bunch */
    virtual void PostNetReceive();```
chrome bay
#

Looks like PostNetReceive() is before rep notifies too

#

(looking in FObjectReplicator::PostReceivedBunch())

meager spade
#

there is also /** Called right after calling all OnRep notifies (called even when there are no notifies) */ virtual void PostRepNotifies() {} but this is after onreps are called

chrome bay
#

all the things

thin stratus
#

These seem to be for any OnRep though or?

#

This is specifically for HotJoining, where a Replicated Actor spawns on Clients and then causing OnReps

#

Cause these call Pre BeginPlay.

#

I mean, I can check if HasActorBegunPlay in the functions you mentioned, but I don't know how save it is to access things in those functions.

chrome bay
#

Yeah I don't think there's anything post-begin play

thin stratus
#

Haha, such a shit system

chrome bay
#

Can you initialize in PostInitializeComponents() or something?

meager spade
#

too early

chrome bay
#

yeah I guess it depends what you need begin play for

thin stratus
#

Here is an example. Pawn's OnRep_Controller. Tells Components "Here is the Controller of the Client.".
BeginPlay hasn't called, so anything you try in there can not rely on BeginPlay

#

So you always have to build these weird pairs of "Do it on BeginPlay once, and make sure BeginPlay has begun in the OnRep."

chrome bay
#

Unless the match has started BeginPlay wouldn't be called either right?

#

I.e. they join something "InProgress"

thin stratus
#

Even if the match is running this happens

chrome bay
#

yeah

thin stratus
#

Yeah but it's shit. Because what if you retrieve something on BeginPlay, like a pointer and the OnRep needs to use that

#

Pointer would be invalid for the OnRep of a HotJoiner

chrome bay
#

Yeah you'd just have to grab it in the on rep I guess too

#

Race conditions... yolo

meager spade
#

that is what i do ^

#

i have the same situation with Ability System

thin stratus
#

Yeah... not always sure how secure that is, because I don't know how much before BeginPlay this call

#

Somewhere in the Actor creation code it must trigger the onreps

chrome bay
#

Trouble is you can't rely that much on Begin Play anyway

#

What if one actor reps before the other, etc.

thin stratus
#

But you always have that freaking issue or?

chrome bay
#

Yeah all the time ๐Ÿ˜„

#

Actors coming down in random orders etc.

#

No degree of determinism to it at all

meager spade
#

for one specific actor in my game i have a timer that polls if the other actor has begun play or not, its silly, but they both need to have begun play :/

thin stratus
#

ComponentA inits in BeginPlay. ComponentB accesses ComponentA and needs it to be init, but ComponentB's BeginPlay called before As.
You would always need to setup some sort of Boolean + Delegate pair IsInitialized + OnInitialized()

meager spade
#

and can't guarantee order

chrome bay
#

Well components are less of an issue because they all come at the same time

#

And they will execute begin play based on whatever order they were serialized into the actor IIRC

#

but for actors, no such garauntee between different ones

#

So yeah, lots of global events or callbacks to bind to if they rely on each other

thin stratus
#

Yeah even on the same actor, components might call in an order that is breaking it

#

Sad

chrome bay
#

Oh yeah totally

thin stratus
#

I also noticed OnRep_Controller doesn't always call

chrome bay
#

But it doesn't seem like a solvable problem for the most part.. you'd need endless layers of "begin play, post begin play, post post begin play" etc..

meager spade
#

you can force it to always call

thin stratus
#

There is a chance that the PlayerController calls ClientRestart, and thus setting Pawn->Controller = this

#

Yeah but just the idea, that Epic codes something that is ot guaranteed to call

#

Because they somewhere set the controller by hand

#

Causing the client to say "Yo this is the same pointer, not gonna call OnRep"

chrome bay
#

The pawn/controller is thing has a lot of that tbh

thin stratus
#

;-;

chrome bay
#

To get around issues where one reps before the other

#

But yeah I've always had to code around race issues between whichever order actors decide to replicate in

#

It seems to be a more prominent issue in HLL just because of the sheer number of actors, I guess issues show up more often

meager spade
#

i just do this cause i had the same issue ๐Ÿ˜„ DOREPLIFETIME_CONDITION_NOTIFY(UKaosAbilitySystemComponent, KaosAvatarActor, COND_None, REPNOTIFY_Always);

chrome bay
#

haha yeah that's handy too

thin stratus
#

Can you override the Controller rep condition notify in your own character?

chrome bay
#

Yeah there's an override macro IIRC

thin stratus
#

Hm, that's good

#

I was relying on "PawnClientRestart" which seems to "always" call

chrome bay
#

If there's no macro though you can do it directly, just by copying most of the macro code

#

SetPawn() at the controller-level is quite reliable

#

That works quite well for me

thin stratus
#

Needed an OnRep_Controller in the pawn/character

#

But I will set it to call always

#

Makes way more sense

chrome bay
#

player state hold a ref to the pawn now too. It's a three-way clusterbomb now ๐Ÿ˜„

thin stratus
#

I cri every tim

chrome bay
#

tbf my only remaining complaint with gameplay framework is the gamemode itself

#

so

#

many

#

functions

#

some of which seemingly do almost the same thing

floral crow
#

Actors coming down in random orders etc.
@chrome bay @thin stratus I had a truly eye-opening experience when I realized GameState was replicating after other 30 or so in-game objects. I had to redo my entire initialization process after that moment

chrome bay
#

Yeah, some actors like that it's worth putting global events in place

floral crow
#

I assumed something as Core as GameState would be guaranteed to replicate first. Newbie assumptions ๐Ÿ˜…

chrome bay
#

Nothing in multiplayer is certain ๐Ÿ˜„

#

been scorched many times

#

Feels good once you make it resilient to that stuff though

thin stratus
#

Does declaring the DOREPLIFTIME for controller again in the APawn child override the parent?

#

Cause I can't find a macro that overrides. Only one that overrides active, which is not what I want

#

Okay seems like the code is made to find already registered variables and set them up again

chrome bay
#

Ah one sec