#multiplayer

1 messages ยท Page 392 of 1

vital steeple
#

thats true

worn nymph
#

yes unfortunatly you have to rebuild the engine each time when using source.

what i tend to do as its more efficient is to install both source and launcher versions of the same engine

then this way you can do 99% of the programming of the game in launcher version and only switch to source to build out the server when you want to test a build

#

@vital steeple

#

also if you want to use an existing project but switch to source. first build the source engine completely seperate on its own

then in your project you need to completely remove all auto generated folders eg binaries , intermediates etc including ones found in plugins

if its a bp only project you need to add 1 blank c++ class which you can delete later.

then right click project switch versions to source. this should auto generate the project .sln vis studio files.

i always do the build from vis and switch the logs to build only as its easier to see the errors and fix if there is any

thin stratus
#

To be fair, downloading the Engine update also takes time

#

Usually if you have Source Engine, you put that on your own GitHub Account (you fork it)

#

And the you simply merge the new update with your Engine (easier if you have no own changes)

#

And simply recompile

#

I mean, without own changes you can also go through the process of redownloading it

#

.>

bitter oriole
#

What I hate with source builds is the random full-engine rebuilds when unity build decides it wants to reorganize everything

#

Not going back to source myself, way too annoying

thin stratus
#

Yeah, we have to use source for some changes sadly

#

For now it works properly, haven't had an engine recompile

#

But if you only need it for the server, then it's probably better to just compile it with that once in a while and use launcher version instead

full bane
#

they did a good job speeding up the compile process though

#

in early source versions it took up to an hour

#

having it on an ssd now might have something to d with it, but I get it compiled in 15mins now

#

which isn't thaaat bad anymore

bitter oriole
#

I wish we had dedicated server available in sources

shadow lichen
#

Hello, I'm trying to make music from a Media player replicate in multiplayer
When I run in preview, music works fine. When I Launch the game, it doesn't seem to play anywhere, even to the host. Any idea why this might be?

#

Ah found an error that says "LogMediaAssets: Error: Failed to validate media source -mp3 song name-

gusty raptor
#

just brainstorming way how i should code my vehicle.. is it common that physics vehicles only run the physics on server? or also on client? when thinking at replicating vehicles..

full bane
#

driver and server usually

#

other clients only get a buffered velocity/transform

gusty raptor
#

so what about running physics on server only? so it would always be the same on all clients? or cant whith dedicated servers?

#

does anyone knows a good tutorial or any info about replicating vehicles?

winter plover
#

afaik if you only actually let the server run physics you might have some choppy movement

#

the way it's supposed to work is that inbetween updates the clients run the simulation for themselves

#

to "predict" basically

gusty raptor
#

ahh yeah right

#

but i quess just setting both client (as driver) and server to physics is not enough

gusty raptor
#

@full bane how can the server have physics if its a dedicated server?

#

is that possible?

full bane
#

sure

gusty raptor
#

aah, so wierd... im totally confused..

#

its also not editable at runtime?

thin stratus
#

Why wouldn't a Dedi Server have physics

#

It's just math after all

gusty raptor
#

its all math yeah but.. i mean... does a Dedi Server run a actual client aswell?? ive read it doesnt.

#

it differents from a listen server i think..

thin stratus
#

It doesn't have graphics

#

Nor does it add any client related actors for itself

#

such as PlayerController

#

But the rest works the same way

gusty raptor
#

my god im asking to manny in-dept questions though.. so sorry

thin stratus
#

+- some other things

gusty raptor
#

my question is pretty simple though

bitter oriole
#

Dedicated server runs pretty much everything

#

It just doesn't render video or sound

#

It has physics, textures, meshes, etc

gusty raptor
#

@bitter oriole thats pretty clear, and cool its like that ๐Ÿ˜ƒ

#

so, im having a SimpleVehicleMovementComponent and willing to replicate it.. what do i do?

bitter oriole
#

Now physics vehicle would have physics run twice : on the "piloting" client, and on the server. Remote clients would use interpolation only.

#

Don't know anything about SimpleVehicleMovementComponent

gusty raptor
#

@bitter oriole is this 'out of the box' ?

#

im so confused about what components and actor default setting to use

thin stratus
#

Well then experiment with them :P

gusty raptor
#

im in c++ mostly btw

bitter oriole
#

No idea. I've re-made my own movement component myself

gusty raptor
#

@thin stratus ive been experiment with it like 5 days ๐Ÿ˜›

thin stratus
#

Only? :D

gusty raptor
#

๐Ÿ˜„

#

but if u say experiement with it., it seems not clear

#

but

#

1 thing to say, i almost had the actual working thing with one client being a little jagging

#

however, i remade the code and dont remember it my god

#

actually its hard as any blueprint flag can easily break the network or physics

#

so i might just clear up my question again soon, and come back with it ๐Ÿ˜ฆ

vital steeple
#

@worn nymph makes sense. i really appreciate all the feedback!

#

@thin stratus also thank you for additional help. i appreciate it, guys ๐Ÿ˜ƒ

hidden thorn
#

I have an issue which I don't know how to fix, basically I have a replicated actor that is placed in the world, this is all good and it works all the clients can see it.

#

If I create a new blueprint and add a child actor component and set it to be that actor from before it doesn't show up on clients screens anymore.

#

and I am not sure why, anyone experienced this before?

jolly siren
#

Has anyone tested what happens if more than the NumPublicConnections number of players try and join a steam dedicated server session? Want to make sure that it doesn't allow them to join. I haven't tested this out yet.

winged badger
#

is child actor component set to replicate?

twin juniper
#

Hi all, could someone help me bind a text from the hud to a c++ funcion without use BP? any help is appreciated

#

or point me to some tutorial

hidden thorn
#

@winged badger I have the Blueprint Actor set to Replicates = true, but not the actual child actor component, I tried setting that to true as well but nothing changed.

#

When bReplicates is true the actor isn't getting spawned on the client.

#

through child actor

twin juniper
#

hey guys

#

quick question

#

how do you handle respawning?

#

I have my respawn function in the GameMode

#

and the respawn trigger (input) in the PlayerController

#

server respawns just fine, but unfortunately the client can't access the GameMode

#

been wrecking my brain for a few days on this

glacial pollen
#

You need to run the PC function on the server's side of it

#

So EventInput -> (Custom Event - Replicate server) Respawn on server ->
Respawn on server -> Get gamemode -> ect

twin juniper
#

oh man, thanks @glacial pollen !

glacial pollen
#

Sure

#

Ask away

twin juniper
#

I'll buy you a beer IRL ๐Ÿ˜ƒ

austere lintel
#

Hello, is there any good book about multiplayer on UE4? I don't need tutorials, i need a book. Thanks.

hidden thorn
#

I am having this exact issue but I can't seem to find a solution, and what that guy said didn't seemed to solve my problem

#
[2018.04.27-21.00.37:175][ 10]LogNetPackageMap: Warning: SerializeNewActor: Static actor failed to load: FullNetGuidPath: [7]/Game/Maps/Colorful_Scene/Colorful_Scene.[5]Colorful_Scene.[3]PersistentLevel.[25]Bathroom_GEN_VARIABLE_HouseDoor_C_CAT_6075, Channel: 5
[2018.04.27-21.00.37:175][ 10]LogNet: Warning: UActorChannel::ProcessBunch: SerializeNewActor failed to find/spawn actor. Actor: NULL, Channel: 5
vital steeple
#

do plugins work with source builds of ue4?

#

im getting an error when trying to generate visual studio files for my project regarding the low entry plugin

vital steeple
#

looks like i have to grab the source for the plugin to compile... which is a problem if a plugin doesnt have the source posted somewhere :/

#

this all seems really ridiculous just for a dedicated server executable :/

high nebula
#

player kills NPC. NPC tells game state that it was killed. Game state tells all player states they get experience. each player state (one for each player) then tells the controller it has gotten more exp, which tells the HUD, which tells the player.

#

Seems overly complicated.

#

I suppose I could just tell the controller, but I want every player to get exprience from the kill (co-op, one player might do an assist, and not actually make the killing blow)

toxic meteor
high nebula
#

^ yes that

thin stratus
#

@vital steeple Plugins needs to be recompiled for Source Engines afaik

thin stratus
#

@fossil spoke So much for trusting UT code :D AUTGameMode* UTGM = Cast<AUTGameMode>(GetWorld()->GetGameState());

#

Wait or was that Erebel?

#

:x

fleet sluice
#

Welcome to the dark side.

thin stratus
#

Is there any given reason or would simply calling "Destroy" on the pawn directly after unpossessing in the first loop be enough?

#

Ah well, they could have pawns in the scene that have no controller I assume

#

Like dead bodies

pallid mesa
#

Hahahaha ```
@DevilsD So much for trusting UT code :D AUTGameMode* UTGM = Cast<AUTGameMode>(GetWorld()->GetGameState());

#

Does that piece of code has a "//Fixmesteve" note XD?

fossil spoke
#

@thin stratus Hahaha what....

pallid mesa
#

Its a pity the project is kinda paralysed

#

At least you can file bug reports like that one

thin stratus
#

Na, it's also totally weird to have that code there

#

It's in a LineUp actor (lines up characters when requested) and they are restarting controllers that weren't handled yet

pallid mesa
#

Looks totally a wip thing to me lol

fossil spoke
#

Theres probably some extra cleanup reasons why they are destroy pawns like that

#

Would have to dig further into it to see why.

pallid mesa
#

I mean to me its always insteresting how do different developers approach the problem of the HUD - GameState load, didnt have an oportunity to look there, does someone looked already?

#

IE - you cannot cache references in begin play one or another. Because GS might load after or before the HUD.

winged badger
#

but BeginPlay is called after it replicates the MatchState

#

ReadyToStart

#

so GS is loaded and ready at that point

thin stratus
#

UT is older

#

It uses the HUD a lot

#

And basically pulls data on Draw

#

So HUD Class basically creates sub-HUDs (they didn't use many widgets but made their own widgets) and then ticks them in Draw

winged badger
#

don't know about that, my point was that while GS might load after the HUD with Unreal today, it will be there before the HUD calls BeginPlay

gusty raptor
#

anyone knows why its so hard to find any info about replicating PhysX vehicles?

pallid mesa
#

I had in the past delegates failing because of that matter @winged badger

#

don't remember exactly if it was GS or PS

winged badger
#

PS takes a while after PostLogin

pallid mesa
#

Thing was that getting the ps/gs from the begin play on a widget failed

#

and binding them in the GS/ps for the ui to know when it was ready was failing aswell

#

but not always

#

it wasn't something consistent

#

sometimes it loaded first, sometimes not.

#

I had to create a timer to retrieve the value and cancel it as soon as it is valid

#

back in... iirc 4.14

winged badger
#

i have done something similar for PS, but not GS

pallid mesa
#

prolly ps yeah, I don't remember exactly

winged badger
#

iirc PS won't be created until the Pawn is Possessed (don't take my word on this tho)

pallid mesa
#

uhhhhhhh

winged badger
#

and its never safe to access PC from Pawn or Pawn from PC on BeginPlay

pallid mesa
#

actually I might have the thing here to check what it was

winged badger
#

OnPossess(ed) is good tho

pallid mesa
#

yeah I use that already to cache my things

winged badger
#

GS should log any changes in the MatchState in the Output

pallid mesa
#

but I... was wondering if there was another solution than the timer

#

because for me when I made it, it was like the dirtiest thing ever hehe

winged badger
#

and until it changes to ReadyToStart i think it was, BeginPlay isn't called

#

possibly the most bizzare error you can do is forget Super::GetLifetimeReplicatedProps() in a custom GameState

#

no BeginPlay (at least on clients, not 100% for server)

pallid mesa
#

yes I got the project, here on the HUD (HUD base class) I'm skipping frames on begin play till Game State is valid

#

yeah I guess that what you said, GS won't call begin play until readytostart...

#

could be, dunno would have to check

#

but I though that the most common thing for begin play to do is to exec as soon as the actor gets created

#

gonna do a little test

#

the GS begin play gets called @ "EnteringMap"

vital steeple
#

@thin stratus thats what i suspected. i found Rama's guide. i guess i have to hope that Cultrarius is willing to share his source for his plugin. thank you for the confirmation, even if its not the answer i hoped for

slim carbon
thin stratus
#

Gnah, this freaking sql database

#

one sec

#

Try again @slim carbon

#

So, how does one effectively stop Input from being processed on the Server?

#

Would I just use "SetIgnoreMoveInput" to true on Server and the use "ClientIgnoreMoveInput"?

winged badger
#

is the ProcessInput() virtual?

#

can't check atm, but i probably go and override that one if possible

thin stratus
#

Yeah, that's a bit too much

#

I just want them to not have MovementInput process

#

Look is fine

#

But it seems like "IsMoveInputIgnored" exists, but is never used by epic

#

I could set the MovementMode to None

#

Seems like the Server is however not able to move if I set IgnoreMoveInput to true

#

Client simply ignores it

pallid mesa
#

why don't you just deactivate the cmc if using character

#

coming along stopmovementinmediately

thin stratus
#

There is a "TurnOff" function too

#

I just want to know the way that Epic basically gives us

#

I mean there needs to be one clear way of saying "Don't accept the clients movement input"

#

And weirdly enough "IgnoreMoveInput" is stopping the server from moving

#

But the ClientRPC that Epic gives one with the PlayerController, in addition, doesn't seem to work

#

Cause the client can still move

#

And I also can't even find where IgnoreMoveInput is used

pallid mesa
#

well I think deactivating or turning it off will be also benefitial for performance reasons, so it would be nice to consider doing so that way

thin stratus
#

I just don't want them to move

#

That's basically all. Just no moveInputs

#

I could simply do my own Variable

#

And plug that everywhere

#

BUT, AddMovementInput is replicating on its own

#

So I would need to use the MovementMode

#

But that sounds hacky

pallid mesa
#

weird, yeah IgnoreMoveInput doesn't seem to be used anywhere directly

#

just same some bool funcs here and there

#

but nothing implemented directly o_O

slim carbon
#

ty @thin stratus

thin stratus
#

Yeah and it is set on the client but returns false if queried @pallid mesa

#

I'm confused

#

But it's also not helpful then

#

Cause it's already true on the server

#

and still allowing movement

#

So that's also the wrong way

pallid mesa
#

@thin stratus I saw that ShooterGame makes use of it

#

maybe take a look there, they override completely the functions

#

so might work as you want

thin stratus
#

Will check

pallid mesa
#

I was wondering tho, why would that be there without needing an actual override, it should have a purpose

#

dunno maybe they made the stub for the end user to override and make use of it

thin stratus
#

Yeah well but where

#

AddMovementInput goes right into the CMC

#

Weird, they are also only slightly overriding it

#

To ignore spectator states

#
void APawn::Internal_AddMovementInput(FVector WorldAccel, bool bForce /*=false*/)
{
    if (bForce || !IsMoveInputIgnored())
    {
        ControlInputVector += WorldAccel;
    }
}
#

I like how that is not turning up in SearchResults

pallid mesa
#

what!!!?

#

that didnt show up on vax :(

#

I feel betrayed XD

thin stratus
#

Yeah It doesn't on GitHub either

#

Thing now is though, that this is executed on the client

pallid mesa
#

here in the shooter game they apply it directly on the controller when the match starts and ends

wary willow
#

Heh, I was actually going to start looking into this today, I don't want players to move at all in the beginning of the start of each game (for now anyway)

thin stratus
#

Here is the issue

pallid mesa
#

but its very plain

thin stratus
#

AddMovementInput is a Pawn Function

wary willow
#

I was just going to put a bool right after each input

thin stratus
#

Character doesn't override it

#

If there is a Component, it calls it on the Component

#

CharacterMovementComponent doesn't override it so we take the PawnMovement

#

Pawn movement just throws it back to the Pawn (still no character override)

#

And sets "ControlInput" if the inputMove is not ignored

#

That happens locally

#

Then the ControlInput is consumed by the CMC and later passed to the server

#

And no more checks happen here, so it doesn't matter if the Server has "ignoreMoveInput" true

#

So to make this work

#

One has to either use something else (what?) or get the "IsMoveInputIgnored" also checked on server side in the CMC

#

No idea about the "IsLookInputIgnored"

#

Ah, also checked locally

#
void APlayerController::AddYawInput(float Val)
{
    RotationInput.Yaw += !IsLookInputIgnored() ? Val * InputYawScale : 0.f;
}
pallid mesa
#

as far as I see this feature is intended only to be applied on the client, since the setters of this thing are purely client sided on SG, UFUNCTION(reliable, client)

#

so maybe your intention doesn't suit this property

thin stratus
#

They aren't purely clientsided

#

That's a Client RPC added in the PC

#

The normaly controller has that

pallid mesa
#

owning client rpc yeah, thats what I wanted to mean

#

unproper wording

thin stratus
#

There is a normal and a ClientRPC

#

But yeah

#

You are right, cause there is a ClientRPC, it is probably meant to be used locally

#

Maaaan, why is there no easy boolean to say "You aren't movement anymore!"

#

Well

#

bReplicateMovement to false but that's also shit

pallid mesa
#

well XD

#

maybe disabling the cmc at the end of the day wasn't a very bad idea, since the cmc is one of the most expensive components on the engine

thin stratus
#

What about this

#

Custom CMC Child

#

Overriding void UCharacterMovementComponent::ReplicateMoveToServer(float DeltaTime, const FVector& NewAcceleration)

#

Adding

APlayerController* PC = Cast<APlayerController>(CharacterOwner->GetController());
if(!PC || !PC->IsMoveInputIgnored())
{
    Super::ReplicateMoveToServer(float DeltaTime, const FVector& NewAcceleration);
}
pallid mesa
#

I think that would make it, some meh polling but it's cheap.

#

my internet exploded just when I was about to reply you lol

thin stratus
#

Yeah well it's already checking that on "AddMovementInput"

#

:D you have to place a bool somewhere

pallid mesa
#

then gg ! XD

thin stratus
#

Would also place it in the previous function but that's so big

winged badger
#
    /** Method called prior to processing input */
    virtual void PreProcessInput(const float DeltaTime, const bool bGamePaused);

    /** Method called after processing input */
    virtual void PostProcessInput(const float DeltaTime, const bool bGamePaused);
thin stratus
#

As far as I can see, it's still local

#

So calling "AddMovementInput" directly would bypass ProcessInput

winged badger
#

i don't think it would get anything at all from that PCs control input

#

sure if you went to bypass it intentionally, you could

pallid mesa
#

the input gets taken from the fgenericapplication

#

then viewport

#

then < <

#

and it gets added to the input stack on the controller

thin stratus
#

UPlayerInput::ProcessInputStack calls them

#

Anyway, a ServerCheck would still be nice

winged badger
#

and ProcessPlayerInput calls it

thin stratus
#

Actually ReplicateMoveToServer is still local

#

Ah, they moved the RPC to the Character

#

Bรคh

#
void ACharacter::ServerMove_Implementation(.........)
{
    GetCharacterMovement()->ServerMove_Implementation(.........);
}
pallid mesa
#

lol

#

I'm way to tired, something worth to write a note about. But again, I'm tired lol.

thin stratus
#

Welp

#

It even sends the MovementMode from Client to Server

winged badger
#

i don't see a single non assingment mention of IgnoreMoveInput, with the exception of the Get function for it

thin stratus
#

Yeah it's in Pawn

#

It doesn't show up for whatever reason

#

Line 623

#

Pawn.cpp

winged badger
#

but IgnoreLookInput makes an appearance in APlayerController

#
void APlayerController::PostProcessInput(const float DeltaTime, const bool bGamePaused)
{
    if( IsLookInputIgnored() )
    {
        // zero look inputs
        RotationInput = FRotator::ZeroRotator;
    }
}
thin stratus
#

Yeah in the InputProcess

#

I'm still surprised that the CMC doesn't check for that

#

Like how are competetive games making sure a pawn isn't moving

winged badger
#

why not just null out the MovementInput there if IsMoveInputIgnored ?

thin stratus
#

Even if the Player tries to force it

#

Cause that's still local

#

The first point where it information hits the server is in the CMC in "ServerMove"

#

Which moves the call to the Character

#

that RPCs it and moves it back to the CMC

winged badger
#

you need it only not to move, or is not having any input controls ok?

thin stratus
#

I need the Server to 100% disregard Movement

#

Including Jumping and such

#

Looking around is fine

pallid mesa
#

I just think you are thinking too much in that property... maybe is a good moment to look for another solution, simpler and easier, like we suggested together before, turning off the cmc or disabling it

#

I don't know, I still think is a reasonable thing to do

#

you can wrap the enable and the disable of the component in cute little functions so you can use them when you will. Also when the cmc will be disabled/turn off it won't add to the game thread much

winged badger
#

SetIgnoreMoveInput from AController worked for me, from BP

#

and ResetIgnoreMoveInput afterwards

#

took a while to find it

thin stratus
#

Yeah but it's applied locally

pallid mesa
#

but as cedric said that applies only on the client

#

so you could cheat around

thin stratus
#

If the Client sets the uint8 to 0

#

It's already not working anymore

#

And we have 3 seconds of start time where the player needs to stand still

winged badger
#

sorry, didn't consider the cheating aspects

#

you could null out the CMCs MaxSpeed, bCanJump and such

#

wrap that into a function

#

they won't be going anywhere

thin stratus
#

Fair enough

#

MaxSpeed and bCanJump are probably the only two that CMC handles anyway. After that stuff will probably be coded by me

pallid mesa
#

work arounds here, workarounds there, workarounds everywhere. It seems like that's the way this time XD

thin stratus
#

Yeah it really doesn't add up for me that there is no check in the CMC for that

#

In UT Epic just doesn't spawn the pawn

#

But well that's not an option here

pallid mesa
#

and why not disabling the cmc directly?

winged badger
#

you could spawn it, set it as view target, but wait to possess it?

thin stratus
#

It's done through GameMode::RestartPlayer

#

Would need to see what I need to override/replace

#

WIll check that tomorrow

#

Thanks for the discussion .have to catch some sleep! (:

winged badger
#

gn

pallid mesa
#

good night.

raven holly
#

Can you change the gamemode on shipping content?

#

Ah options

#
[/Script/Engine.GameMode]
+GameModeClassAliases=(ShortName="DM",GameClassName="/Game/BlueprintsLogic/GameModes/L_Deathmatch.L_Deathmatch_C")```
#

" that creates an alias to the mode so you can just use game=DM in that instance and it loads the proper mode when loading the level."

hollow creek
#

So, being new - very new - i went to try a tutorial. The official one, to be specific, which I've been lead to believe isn't entirely accurate anymore? Nevertheless, I ended up at the part where a host menu should be taking me to a lobby map, but instead it goes back to the main menu. Then when I attempt to go host a game again, it goes to a black screen and my cursor is lost. The logs say that it goes black because theres already a hosted game there, but the first errors that appears is LogGameMode: FindPlayerStart: PATHS NOT DEFINED or NO PLAYERSTART and I'm not sure how to fix that. In my LobbyGameplay BP, the guide had me make a pretty intricate bit of work to respawn characters, but never a ChooseCharacterStart override. So i unhooked the first and put together the latter, but it still has the exact same error

#

and ive attempting breaking one while hooking up the other both ways

slim holly
#

I was wondering about the CMC replication, could the network prediction be done with fixed latency value?

spiral badge
#

Anyone know a good tutorial for team death match setup?

slim holly
#

well, it's a FFA with team tags

#

only major difference is actually keeping track of team scores

#

and switching player color to match the team

spiral badge
#

Yeah itโ€™s easy in concept but not really easy on doing it xD

slim holly
#

it's not that complex ๐Ÿค”

#

adding replicated team variable on pawn or playerstate, OnRep changes Mesh material color param depending on variable content

#

upon death, check source of last damage and and report it to gamestate to see which team gets point

#

and team check on damage receive events if you don't want friendly fire

thin stratus
#

@raven holly You can set these alias up in the normal setting by now

#

No need to manually enter them via ini file

#

Project Settings->Map and Modes

#

And then some of the advanced drop down arrows

raven holly
#

oh ok

tawny raven
#

Alrighty, I'm most likely a rooDerp , but how do I not make my Server's User Interface(since he is a player, himself) not appear on the Client's screen?

thin stratus
#

@tawny raven Well, filtering the Server

#

If really only the ListenServer needs a specific UI, you could spawn it via the GameMode

austere lintel
#

Hello. I have one PC, so i can't check it. If i set DefaultPlatformService=Null, will i be able to use nodes Create session/find session to play within my home network on different PCs? I know that i can connect by "open ip", but i'm interested exactly in sessions. I think that it wouldn't work, because my subsystem is off.
Come from the other side: I want to use sessions in my logic to play LAN, but i don't want to use Steam or other systems, what should i do ?

thin stratus
#

SubsystemNULL allows you to use Sessions within LAN

#

If that's what you want to know

#

SubsystemNULL does NOT allow you to use Sessions over the Internet

#

@austere lintel

austere lintel
#

@thin stratus thank you, i know that i will not see my session on the same PC and this confuses me

sharp spire
#

Can foliage be handled in MP? (removing and adding instances) almost seems possible as long as the server handles it, right?

willow surge
#

Hi all. Iโ€™m sure this has been asked a million times and it might come across as a โ€œdumbโ€ question but what would be the best way to handle dedicated servers for a multiplayer game? I have integrated Mach making with the GameSparks plugin in my project and have tested it fine locally with 4 players (all from my own pc)

At this moment Iโ€™m stuck and canโ€™t figure out how to run a dedicated server and/or on what platform. I have seen the Amazon AWS/GameLift plugin but itโ€™s not pre-compiled b a binary version?

I also donโ€™t know after reading steam documentation if the steam platform itself actually runs dedicated servers or if it acts as a matchmaking/friends platform only.

I hope someone can help me on this topic a bit I should also note that my whole project is Blueprints only and I have no C++ knowledge what so ever.

Thanks in advance.

sharp spire
#

@willow surge i believe its done by running a CMD with proper configs (in the cmd)

meager spade
#

Steam can use both dedicated servers and listen servers (i.e one client is the host). Dedicated servers require a server and i am sure it works by using different ports if its the same server running it? but i havent got that far in my online implementation

sharp spire
#

it does require some open ports

meager spade
#

one instance of ue4 server on a port, means you can run multiple ue4 instances on different ports with different games running, as that is the way i believe it work

thin stratus
#

Afaik, Steam is backend

#

So it doesn't run the Server for you

#

You can run them yourself and they communicate with Steam's backend

#

Hosting a Dedicated Server is up to you, so if you Players should be able to host them locally, hand them the .exe

willow surge
#

Hi guys, yes I have read about the ports in the AWS documentation as it will start a new server with a new port automatically. I think this is just all a bit to much for me and there isnโ€™t much documentation on it (noob friendly) Iโ€™m happy with the way GameSparks does the match making and allows me to play against each other (client to client) but it doesnโ€™t use the UE4 networking code in any way so itโ€™s more like a always multicast system as far as i can see/understand.

thin stratus
#

GameSparks is also just a backend

#

While it has live code, that is more for using in frameworks that don't provide this already

#

GameSparks matchmakes two players and gives you the opportunity to react to that

#

Either by making one of the two host (ListenServer) or by telling a different service to host a DedicatedServer

#

Which would need to be automatic, cause you don't want to fire up the Servers by hand

#

GameLift would give you that, however keep in mind that this gets expensive fast

willow surge
#

Ahhh itโ€™s you ExI love your networking documentation ๐Ÿ˜ƒ

#

What would you recommend ? Personally for dedicated servers? (Cheap)

thin stratus
#

Cheap? Let people host them

willow surge
#

Okay up till how much players would that stay โ€œsmoothโ€ ?

thin stratus
#

Well, it really depends on what you want there

sharp spire
#

depends on the hosts network for listenservers

thin stratus
#

Why do you need Dedicated Servers?
Do they need to be cheat proof?

willow surge
#

Iโ€™m making a small battle Royale game and hope to have 25 players in one arena. I donโ€™t have the illusion of having 100+

sharp spire
#

oh that i see being expensive as i think you need a dedicated server to stop cheating :\

thin stratus
#

Yop

#

That will probably be expensive

#

Servers would need to be hosted away from players if you don't want cheating to be a thing

willow surge
#

Well Iโ€™m just a one man โ€œteamโ€ and just want 25 people to have fun,

thin stratus
#

If you don't care about cheating and you only want players to simply join and have fun, let one person host

#

So use ListenServers and not Dedi

willow surge
#

Okay then the GameSparks way should be enough?

thin stratus
#

Yeah, with a bit more logic you could also pass the players ping to the Matchmaking Request

#

And let then one with the best average ping host

#

Or simply take the first one from the particepants list

#

ยฏ_(ใƒ„)_/ยฏ

sharp spire
#

i need to look into this GameSparks and GameLift. What is its purpose?

thin stratus
#

Just keep in mind that the ListenHost has Authority and can cheat if he wants

#

@sharp spire GameSparks is a backend. GameLift a dynamic server host

#

For more info check their websites

sharp spire
#

fair enough thank you

thin stratus
#

anyway

#

dinner. o7

willow surge
#

Same here Iโ€™m eating and chatting, not very handy with kids....

#

Thanks for taking the time to answer. Iโ€™ll look into ping based hosting instead of the first one entering the lobby.

tawny raven
#

@thin stratus What do you mean by "filtering the server". So, the server is a player just like the rest of the connected clients and in one of the gamemodes, he's able to pick the side he wants to play as.

#

Also, sorry for the late reply as I went to bed right after I posted that question.

sharp spire
#

is it just me or is setting up GameLift is fairly difficult process?

#

Sorry, its simple, but the UE4 integration seems a bit complex lol

#

If anyone could shed some light on creating the plugin and UE4 integration with GameLift that would be extremely helpful! Thank you ๐Ÿ˜ƒ

#

so to my knowledge GameLift takes your dedicated server and runs individual server sessions ?

thin stratus
#

Yes, and GameLift has the ServerSide SDK as a Plugin already

indigo nacelle
#

First time opening the network profiler tool to analyze a game session, and I see that I do not know whether the values are good or bad. How do I know if these values are good or bad? (got 100 mbit/s download, 10 MBit/s upload speed broadband)

sharp spire
#

So does this stop cheating and allow lots of individual connections?

#

Does this end up less expensive on the dedicated with more players or simply just splitting them up?

#

Sorry so many questions ..

#

Sorry to be more exact: does this handle 4 servers with 25 players each better then a single server would with 100 players?

knotty ether
#

Hello. I am working on creating a multiplayer First Person Shooter game in Unreal Engine. I have a rough implementation of enemies which I can kill, and everything works fine. When I try to create AI trees for the enemies, I run into one major issue: I can't seem to find a way to reference the player. I want my AI to attack the closest player, but I can't find a way of getting a reference to all the players. What would be the best way to make the Enemies detect all multiplayer players in the level?

sharp spire
#

I think what youโ€™re looking to do is sensing if players are nearby and setting that pawn as a key in the AI

#

Try creating a collision on your pawn and on overlap set the key as your target

#

And when you have a target, branch off into combat

#

Well probably a โ€œgotoโ€ then โ€œattackโ€

#

And setup an end overlap to start a timer before it stops looking for the player or if the player is dead

#

Or if the length between vectors is simply too large

#

@knotty ether

willow surge
#

@sharp spire GameLift doesnโ€™t have a binary plugin you need to compile it, thatโ€™s where it stops for me. Iโ€™m not into C++ and coding I just want to build and design games with blueprints as soon as I see make an empty C++ class etc Iโ€™m done with it.

sharp spire
#

I see a uplugin file is that not relevant?

knotty ether
#

@sharp spire What I would like is for the enemy to be able to find the player at any distance. I have a service set to check through all of the player to find which is closest and set the target. I need a way to find all of the players on the map. Find all actors of class is slow(and doesn't work on the server), and I can't find where I would be able to have each player give a reference of themselves individually.

thin stratus
#

@willow surge @sharp spire GameLift's ServerSDK should be fully available

#

Just the Client side is not

#

And it doesn't do anything to the DedicatedServer directly

#

It just starts and stops them

#

It doesn't improve them neither does it make them worse

#

Also, it's good to avoid C++ for the start

#

But you can avoid it if you want to do Multiplayer

#

It's just too much stuff not exposed to BPs

#

So you can already get used to the fact that you won't be able to dodge it forever

#

@knotty ether GetAllActors works on the server totally fine

#

But it's not good to use it

#

Your AI can either overlap other pawns and get a ref like that

#

Or you look into the pawn sensing stuff

willow surge
#

@thin stratus I know I canโ€™t dodge it for ever but as a one man โ€œteamโ€ itโ€™s already so much work. I have php/java/html/XML experience and some .NET but donโ€™t want t get into c++ yet

thin stratus
#

If you want an array of all players ,then you'll want to fill a PlayerController array with PostLogin and such in the GameMode

#

@willow surge True, however Multiplayer with GameLift and such is nothing a one man team should do

#

I think a simple c4 server of gamelift, with the few free days you have per month, still cost 150+โ‚ฌ

#

And one can, depending on the game and how resource heavy it is, probably run a handful of dedicated servers

#

Although linux is cheaper i think

#

Well yeah, still kinda the same prices

#

Left number is cores, then RAM

willow surge
#

That would be a huge investment when starting, like I said Iโ€™m not a delusional indie developer I know itโ€™s out of my reach ๐Ÿ˜ƒ but I do need a online system. Iโ€™ll have to see how far I can get with the GameSparks only setup for now I guess.

thin stratus
#

GameSparks is really just for matchmaking (and other player data management)

#

You could also simply hook Steam into it and have people host listenServers

#

As long as you don't care about cheating it's all fine

willow surge
#

Steam only has limited BP access, I have seen a Steamworks plugin that exposed more to BP but that hasnโ€™t been updated for 2 years.

knotty ether
#

Ok. Thanks, that's all I needed to know. Turned out I needed to pass the enemy pawn by reference instead of just using the tick's actor.... Thanks again.

thin stratus
#

@willow surge UWorks?

#

Should give you full access

#

It's on the Marketplace

#

Costs a bit, but worth the price

willow surge
#

I know but then I might just as well get into C++ myself just to expose features that are already there ๐Ÿ˜ƒ cost vs time

thin stratus
#

Well, I'm pretty skilled in that stuff and to expose all the required functions and events, i would probably need so much time that I would be able to buy the plugin 10-20 times if I just use the time to work

#

If you only need 1-2 functions then maybe

#

But anything near the plugins amount of functions will def cause more costs than just buying it

#

Simply trying to give you the best options here.
If you want a fast and easy solution, that saves a TON of time, then Steam + UWorks and GameSparks for matchmaking would bring you pretty far with your multiplayer setup

#

And you could focus on GamePlay

#

You might not even need UWorks for the start anyway

#

You can host, search and connect to Steam sessions with the default nodes

#

And you could use AdvancedSessionPlugin to get a bit more control

#

I think that one also exposes some Steam stuff

#

Like FriendList

willow surge
#

Thanks Iโ€™ll keep that in mind, itโ€™s hard for me to trust the marketplace the last 3 packages I bought

*A didnโ€™t give support or dropped support soon after I bought them

*B have complete douchebags as developer and simply ban you from their support discord channel for asking questions and then tell you they will refund you (whiteout even asking it myself)

Itโ€™s not about the money itโ€™s about the trust in the marketplace content and saving time as a single โ€œwant to beโ€ game designer in between my other businesses.

#

UWorld does seem like a good alternative and, so does uetopia

thin stratus
#

Well the Programmer is on this Discord and very well known. So you shouldn't have any problems with that

#

(english double negative. never getting use to that)

willow surge
#

Your English is pretty good for a (German?)

thin stratus
#

Yeah German

#

Well, living together with a Belgian girl. We speak English all the time. So it improves :P

willow surge
#

๐Ÿ˜ƒ I would never nit pick on language or spelling errors ๐Ÿ˜ƒ

thin stratus
#

Na not saying that. :P I just tend to write something and forget the "not".

willow surge
#

And who knows if I really canโ€™t seem to get it all working I might as well hire you for your skills. I have read a lot of the topics youโ€™re involved in on the forums and here on discord. You seem very capable ๐Ÿ˜ƒ

#

The main problem for me would be is that Iโ€™m not using any of UE4โ€™s networking code due to GameSparks integration. Everything runs through GameSparks so thereโ€™s no authority anywhere or UE4 replication.

thin stratus
#

Ah well

#

Would not do that

#

You are just giving yourself more work than needed

#

UE4's network code is totally enough. You should only use the part of GameSparks that deals with Players, Skill and Matchmaking

willow surge
#

Itโ€™s to late for that as I based it of a Battle Royale template I bought. I did change a lot but Iโ€™m still dependant in GameSparks to handle everything movement/shooting/replication itโ€™s kind of s semi-dedicated server

severe widget
#

wait there's a template for UE4 that actually uses the gamesparks netcode?

willow surge
#

Why? Because it works? Because from what I have seen in the last UE GDC talks the engine will go to a similar system without all the relevancy stuff and just a list based network, something like a multi-cast by all system like Fortnite is kind of using.

#

And donโ€™t forget that GameSparks is part of Amazon now. So I canโ€™t see anything negative coming from this datacenter / server wise in the near future?

sharp spire
#

So GameLift actually starts and stops dedicated servers? ๐Ÿ˜ฎ using multiple ports I assume?

#

@thin stratus

thin stratus
#

Basically yes

sharp spire
#

And I guess my prior question would fall back on wondering if a single server running 100 players has any difference in cost than 4 servers on different ports on the same machine hosing 25 players each

thin stratus
#

Could have difference

#

Cause the single dedicated server had to handle 4 times the bandwidth

#

So the process

sharp spire
#

Right thatโ€™s what I was under the impression of

#

So technically in the long run as long as my host has the hardware itโ€™ll most likely run a little smoother with seperate servers

#

I read somewhere about a new open source that allows some type of cloud based hosting where each client ends up being its own host in one big world? It also claims to take care of individual objects like trees and such

#

I forget the name, but itโ€™s built for unreal engine

lost inlet
#

the gamesparks SDK likely doesn't replace any netcode

#

it'll just be for doing backend calls

#

gamelift is also overpriced, for any size studio

#

i'm usually fairly skeptical of BaaS companies but at least gamesparks and playfab were acquired by large companies that are continuing the product

#

gamelift is also only suitable for session-based multiplayer, not persistent worlds

thin stratus
#

Yeah the earlier conversation was not about open world. No idea why Pierce picked it up

#

Also I thought GameSparks actually has a NetCode solution? I just never touched it cause I don't want to rely on it while having ue4s NetCode already

lost inlet
#

no it doesn't, not at least in the plugin description

thin stratus
#

The plugin is garbage

#

:<

#

They used a SceneComponent before I told them to switch to a UObject or at least an ActorComponent

#

And it crashed if you stopped playing too early

lost inlet
#

it has a feature called "realtime" but that's for a connection to custom server logic

thin stratus
#

Yeah that's what the other guy above was using though

#

KillerSneak

#

At least he says he's using GameSparks stuff instead of UE4's netcode

lost inlet
#

reimplementing UE4 replication using that seems like a really bad idea

thin stratus
#

My words

#

Maybe he just means something else and words it wrong due to missing key words

#

ยฏ_(ใƒ„)_/ยฏ

willow surge
#

GameSparks does have โ€œnetcodeโ€ Iโ€™m using it as a replacement for UE4 networking.

#

Iโ€™m also using it to store user data like gear color. And Iโ€™m planning on using it to set values for weapons that are picked up.

#

GameSparks has a โ€œrealtimeโ€ api

sharp spire
#

I wonโ€™t be be using GameLift As i was just trying to understand its purpose

willow surge
#

Iโ€™m not using GameLift neither itโ€™s to expensive.

willow surge
#

@lost inlet itโ€™s still PvP based but with a โ€œrelayโ€ server from GameSparks in between. Like I said โ€œsemiโ€ dedicated but should run fine with up to 50 players. And thatโ€™s enough for what Iโ€™m aiming for.

toxic meteor
sharp spire
#

thats a very nice scene ๐Ÿ˜ƒ @toxic meteor click the drop down and set the owner of the actor, then create another event thats run by the server that runs your current event you posted.

#

thatll spawn it on the server, and for replication youll need to set each component to replicate aswell

toxic meteor
#

Okay thanks!

sharp spire
#

also youll need to promote the transform your using to a replicated variable and set it by the server

#

the server will return null or all 0's if it goes through somehow

toxic meteor
#

I'm planning on having the client use a line trace to choose where to place it, how can I have the server then set that as the transform?

sharp spire
#

im not sure how particles work with replication, maybe a simple toggle?

#

ill check

#

youll just have to create a replicated vector and create a server event with an input of vector (clicked location name whatever you want) and have it set the replicated variable in that server ran event

#

ill post an example if you need it lol

toxic meteor
#

No need, I got see what you mean

sharp spire
#

okay ๐Ÿ˜ƒ

toxic meteor
#

Thanks for your help; nearly got it working now just gotta do the transform

sharp spire
#

if you dont mind letting me know if particles are a simple toggle or not thatd be neat

toxic meteor
#

They are

sharp spire
#

thanks

toxic meteor
#

actually I didnt have dedicated server checked; looks like it isnt just checking the component replicates

sharp spire
#

what is it doing?

toxic meteor
#

Never mind scratch that; the other clients were out of culling distance lol

sharp spire
#

i think figuring out some type of repnotify will make it relevant when you get close enough

toxic meteor
#

Yeah not too worried about that part quite yet, the UE4 networking example map has some pretty good info on network relevancy

twin juniper
#

So for some reason some of my RepNotify functions arent being called properly

#

they are supposed to set equipment

#

on my players

#

but it looks like its not always being called

jolly siren
#

@twin juniper If the property gets replicated, the RepoNotify will get called. Watch out for instances where you update a replicated property on the server and then quickly update it again back to the original value. As this will result in the property not actually getting replicated (this is a common occurrence with bools). Just guessing with the little information I have.

sharp spire
#

where are they being called? @twin juniper

twin juniper
#

@jolly siren its a struct

jolly siren
#

Right, the same rules apply regardless of data type.

pallid mesa
#

One thing to be aware of is that it's possible for the clients to also not call the OnReps, if their local value of the variable is already equal to the value the server replicates down. For that to happen, someone would likely have also locally modified the value on the client though, which is usually ill-advised. Even still, that behavior can also be changed by modifying how you setup your replication statement:

// This will cause the OnRep to always be called on the client, even if they have the same value locally already (usually don't need to do this, depends on your usage) DOREPLIFETIME_CONDITION_NOTIFY(MyClass, MyVariable, COND_None, REPNOTIFY_Always);```
#

@twin juniper

heavy marlin
#

hey guys

#

im working on a survival game, like 835 million other people

#

if players have created 5000 building pieces in the world, with current UE4 networking, wouldnt that mean when a new player joins it tries to spawn all 5000 of those at once?

#

i mean i can make them visible but still the info is sent to spawn

#

*invisible

low pond
#

How do the online subsystems work with storing a persistent inventory?

thin stratus
#

Usually you don't use the subsystem for that. I mean there might be subsystems that can do that or people maybe using it like that somehow, but usually you use a server with database for that

heavy marlin
#

reductor thats nothing to do with it

#

you just persist the inventory

#

and do all commands through rpcs

#

if you want to go nuts you'll need pagination as well

low pond
#

Is persistence normally handled independently? Left to some sort of independent database?

heavy marlin
#

its handled in game

#

as long as it exists

#

i use sqlite to persist

low pond
#

I'm hoping to store things long-term, not just for a single running instance of a game/server

thin stratus
#

Keep in mind, that you might talk about a Database for one Server

#

While reductor maybe wants one for different servers

heavy marlin
low pond
#

and across multiple different servers

heavy marlin
#

ok then you want something else

thin stratus
#

Yeah, as said, then you want a Database hosted somewhere

#

Which you can access through a REST API maybe

heavy marlin
#

do it yourself with postgresql or mysql

#

or use google cloud sql or something

low pond
#

figured that might be the case, didn't know if there was an interface in part of the online subsystems to implement for this

thin stratus
#

Just some SQL Database that fits your needs

#

Na, the OnlineSubsystem is really more for the Session and Friends/Identity stuff

#

Steam has a cloud, but I think players can access that

#

So it's not save to store things there

low pond
#

There's also the steam inventory

heavy marlin
#

thats not what its for

thin stratus
#

That's more for the tradeables like the CSGO skins

heavy marlin
#

its for in store items

#

yeah

low pond
#

ya, not ideal

heavy marlin
#

its not just not ideal

#

its not what its for

low pond
#

it would be good to have a generic data store for a user

heavy marlin
#

at all

#

theres that firebase plugin as well

#

if you want a key/value store

thin stratus
#

Yeah, grab an SQL tutorial that you like and try to do it like this:

  • Use a HTTP Requests from GameServer to WebService (something that handles your Database and actually performs the sql requests)
heavy marlin
#

if you're doing anything of scale you really need to learn sql

thin stratus
#
  • Use the Response of the HTTP Request to send data back
#
  • Think about using JSON format as Epic has some functions that can convert a Struct to json and a json to struct
low pond
#

Implementing my own isn't really an issue, was just hoping there was an existing interface to re-use to keep it similar to the way devs expect to work with UE4

thin stratus
#

So if you have a struct class that has the same properties as your database row, you can easily send JSON back and forth and move between the JSON and your struct

#

Ah right

#

Sorry!

#

Never know the skill level of a user here :P so rather giving more info

low pond
#

all good, I'm guessing it varies quiet alot

lost inlet
#

also a game should not be connecting straight to an RDBMS

#

just asking for trouble

#

i don't know why so many people do it that way, there's even a very popular mysql plugin but i doubt the users of that plugin know much about information security

#

i also worry about some of these database plugins using copyleft code in them, especially the mysql one

twin juniper
#

// This will cause the OnRep to always be called on the client, even if they have the same value locally already (usually don't need to do this, depends on your usage) DOREPLIFETIME_CONDITION_NOTIFY(MyClass, MyVariable, COND_None, REPNOTIFY_Always);``` @pallid mesa thanks ill try it
austere lintel
#

Hello. I want to interact with some Actor both on Server and client (e.g. click on it). If I spawn it on server (actor is replicated), i can see it on Client but can't click on it. What workflow is correct ? Spawn exact copies on both sides ? or I miss something ?

slim holly
#

replicated gets created on client

#

and, depending on the interaction feedback you might need to do the interaction on client side then let server confirm it

austere lintel
#

@slim holly can you explain your first sentence, please?

slim holly
#

spawning replicated actor on server is also created on clients

austere lintel
#

@slim holly i was wrong, it is really creates on client, thanks

#

i thought it is like a ghost

twin juniper
#

@pallid mesa ugh and of course

#

u cant do REPNOTIFY_ALWAYS in BPs

pallid mesa
#

no u cant XD

twin juniper
#

ughhh

eternal fulcrum
#

Anyone use the XMPP module built into the engine?

jolly siren
#

Discord voice is god. Has anyone integrated it with ue4 yet? I am extremely disappointed with the ootb ue4 steam voip quality with 10 players

dull saddle
#

Hey guys, I got my line trace up and running for shooting other clients but how can I figure out which player killed another player? Like e. g. player 1 shoots player 2 and player 1 gets a kill from it.

novel oxide
#

@jolly siren BossKey productions had Discord voice integration in LawBreakers, don't think there's really a tutorial for doing something like that though.

jolly siren
#

ah okay, so if a player didn't have Discord then they couldn't use voip?

#

VOIP redesign is on epic's trello for future releases. Hopefully that happens sometime, because right now it's very poor.

eternal anchor
#

@thin stratus I would not recommend SQL for storing any player data

#

it's at best good for player login info/static data

#

player inventory has rarely static data, with SQL you need to know in advance exact data layout and then create schema for it

#

Document (JSON) data base is perfect fit, since it is schema less and will store any document you throw at it

thin stratus
#

No idea what inventories you deal with but mine have a fixed Layout. Think it depends on what exactly you save

eternal anchor
#

I can give you example

thin stratus
#

But yeah, feel free to use whatever database System you want

#

Don't have the time right now to discuss things so sorry if i recommended something wrong in your eyes

eternal anchor
#

you have weapons, armors, all of them can have varying amount of attributes/perks

#

not saying it's wrong, it harder to use, because you have to plan in advance the exact data layout );'

hasty adder
#

Borderlands I guess yeah thatโ€™d be a interesting gdc talk

#

How did they store player data on infinate possivle@weapons ๐Ÿ˜‰

eternal anchor
#

in general SQL will be better (better storage, performance)

#

but when you deal with not exactly defined data, then document data base is hand down better

#

if you end up with to few columns in table in SQL database you are screwed

hasty adder
#

Well Iโ€™d think a almost IP address style of attributes 100110001 like digit one is weapon one handed or two handed digit 2 is it single shot or fully auto etc

#

Decide the weapon properties in engine mayhapse

thin stratus
#

A bitmask

hasty adder
#

There yah go

wary willow
#

@jolly siren I tried to get Discord voice SDK, but failed ๐Ÿ˜ญ

#

I haven't tried again though. Last time I tried it was closed

hasty adder
#

I think we have all applied at one point to see that same message

#

Damn them@for@making you even fill it out before it says itโ€™s not available

jolly siren
#

@wary willow ahh okay, yeah I think I filled out an application for that too. I at least look at it.

wary willow
#

@jolly siren You have it?

jolly siren
#

nope. Forgot that it was a closed system; until you mentioned it.

wary willow
#

Ah yeah, it sucks

#

I wish I would have tried when it came out earlier

#

I literally only thought about signing up last December

#

For this game

#

Maybe in Jan

jolly siren
#

ahh yeah discord voice is so perfect. It would have been nice.

wary willow
#

I'm surprised there isn't a UE4 Discord SDK out yet

#

Maybe under NDA still

brittle sinew
#

There's a UE4 plugin for their RPC.

#

I'm not exactly sure where that fits into the whole Discord ecosystem, however

jolly siren
#

I guess I will try tweaking the MaxClientRate and MaxInternalClientRate to get the ootb voip working better.

twin juniper
#

@jolly siren i would love to use this if u find out how to implement it

#

discord voice my dude

#

Ive looked into it before

#

u have to like get a special license i think

#

and i didnt get approval

#

sadly.

jolly siren
#

yeah, it's a private system right now

twin juniper
#

really dumb though

#

No real reason for it to be private; from what I have heard it's pretty much a fully functional system.

#

@jolly siren Have you gotten permission to use it?

jolly siren
#

No, I can't remember if I applied or not. But I didn't really want to limit voip to only discord users. I hadn't tested ue4 voip with many people at that point tho since it was partially broken until 4.19

twin juniper
#

Yeah

#

I haven't gotten it to work at all.

#

Which is a shame.

#

When I take the steam audio data and try to play it on a sound component

#

it just plays nothing

#

but i am getting bytes, only when i speak

#

and when i dont speak, no bytes are being sent

#

ive debugged that much

jolly siren
#

You shouldn't have set anything up besides flipping the bool in config. And adding the push to talk stuff if you want that.

twin juniper
#

@jolly siren im not using onlinesubsystemsteam

#

=p

jolly siren
#

ah okay

twin juniper
#

ya

lost inlet
#

the steam OSS voice is pretty low quality anyway

#

the opus codec is implemented in the null oss

jolly siren
#

@lost inlet what voip solution do you recommend then? I would like it actually integrated so I can do team voip

sharp spire
#

is the owner of a replicated actor automatically replicated aswell? for some reason client 1 and the server can read the server spawned actors properties but client two cant read its properties

#

failing when casting to the actors owner but client 1 succeeds just fine.. lol

#

ill try avoiding casts and get back to you

#

got it.

raven holly
#

Why does unreal accept connections from this port

#

๐Ÿค”

#

It's a bot trying to port scan I believe

fleet sluice
#

@raven holly It's a bullshit message because whoever wrote that log doesn't speak English.

It signifies UE4 has recognized that IP:port combination as coming from a new potential client, as opposed to already connected clients or clients who are "currently" losing the connection and stopped replying. If you were to send a new packet using a custom utility, not related to UE4, you would see the same message.

UE4 then scans the packets to prevents DDoSs and malformed packets so you're safe anyway.

raven holly
#

Could I just block all ports except 7777?

fleet sluice
#

The actual handshake is supposed to happen right afrer that message.

raven holly
#

or the port range the game server uses?

#

I assume i'd need some open for steam

fleet sluice
#

Technically, yes, you can modify code to deny any other ports than X-Y range.

raven holly
#

I mean from a firewall standpoint

#

Not inside the code

fleet sluice
#

Ah, then probably yes, technically, but not a smart move. There 65000 UDP ports and 65000 TCP ports. If you blocked them all, you would have to manually add exceptions for any program such as browsers (80), Skype etc.

#

Discord...

#

Actually, let me rephrase that: you can block your OWN ports, you can't blocl the ports from where the traffic originates.

#

i.e. if you block 7777, it won't receive traffic from anyone at all.

raven holly
#

Yes well it's on a server so blocking discord etc wont be an issue ^_^

#

Only need ports open the server actually needs

fleet sluice
#

Yea, I misphrased that. Ports are like endpoints of a tunnel. You machine can either receive or not, on a particular port. But you can't decide where it receives from.

raven holly
#

Yeah I understand how the ports work ๐Ÿ˜„

fleet sluice
#

Ah ok. I just wanted to be helpful โœ…

raven holly
#

Thanks ๐Ÿ˜ƒ

twin juniper
#

Windows Firewall in a server has pretty much everything blocked by default

burnt meteor
#

hey guys i have created a fp and tp mesh and set the owner see only stuff the problem is i have the animations not synced how do i fix it?

sharp pagoda
#

@burnt meteor run the animations locally on the fp mesh and rpc to theserver to run the tp mesh animations

sharp spire
#

Use a master pose node and connect the main mesh to the bottom pin and all attached meshes to the top pin. Thatโ€™ll sync all animations without a delay

#

@Decode.#9604

#

Using the animation blueprint on multiple meshes in the same file wonโ€™t have that synced and will only get worse as the network gets worse

slim holly
#

em, animations desync locally because of delta time variations. how could one expect to sync'em over network?

#

Masterpose ^

sharp spire
#

Thatโ€™s what it was, game lag not network lag sorry Iโ€™m still a noob ๐Ÿ˜ƒ

#

But masterpose should solve his issue locally

#

Right?

slim holly
#

yes

#

and animations are local only anyway

#

they are visual representations of pawn actions

meager spade
#

what would be the correct way to replicate an anim montage in c++

slim holly
#

you replicate the condition that drives the montage

meager spade
#

the montage is played in the c++, not the animblueprint

slim holly
#

well what ever triggers it needs to be done on client and server

#

after server is done checking it can be done ofc

meager spade
#

AttackCount is replicated, but another client nor the server see attacks 2 and 3, but always see attack 1

stoic elk
#

hey guys, im trying to troubleshoot a major problem in our student project, the client doesn't seem load or possess is character in only 1 map, we use server travel and we can go back en forth in any level but this one. the map in question is bigger but so far i didn't find anything else

#

i suspect the client load before the server or something like that, but adding delay only worked in the engine, when i pack the projet it doesn't work

sharp spire
#

@meager spade your attacks labeled by Index, right? Have the server set that clients pawns AttackCount and the anim graph should correspond

#

@stoic elk try having the server start the loading process for the clients

meager spade
#

@sharp spire i solved it anyway now, i was using montageplay and a switch statement, i just forgot to make the server replicate the montage

sharp spire
#

Glad you solved it ๐Ÿ˜ƒ

stoic elk
#

@sharp spire after some test (since i'm not the one who programmed our game and the programmers are MIA since the beginning april) it seem it's deleting some widget the problem, i swaped the blueprint between the server and client and now the serveur player is stuck on the loading screen but can move. while the client character load in all the level

stoic elk
#

the serve see the client move in all the map wt hile the client doesn't see the server move in only 1 map

#

the movement of the serve doesn't seem to be replicated to the client only in this map, the more i try to fix it the less i undestand what is going on

winged badger
#

@stoic elk are the characters created by the GameMode/PC or are they loaded with the level?

stoic elk
#

each level have a customs spawners, each player enter the level as a spectator and if they are the server get character A and if client character B

winged badger
#

custom spawner is an Actor loaded with the level?

stoic elk
#

yeah

winged badger
#

and is it on a persistent or a streaming level?

stoic elk
winged badger
#

you have a separate spawner Actor on client?

stoic elk
#

yeah

winged badger
#

it can't spawn anything on the server side

#

its not owned by your PC, so you can't send a Server RPC through it

stoic elk
#

but it's working in all the other map

winged badger
#

is the setup the same?

stoic elk
#

i'm looking at it

winged badger
#

including sublevels, there is an engine... issue where the sublevels that are set to AlwaysLoaded won't become Visible on clients after ServerTravel

#

workaround is to load them manually (change from AlwaysLoaded to Blueprint, then call LoadStreamingLevel)

stoic elk
#

ok thank you , i'll check that right away

winged badger
#

imo, there should be no spawners of any kind on clients

#

unless they are spawning dummy actors that should exist only locally

#

(and i can't even give you a good example for that last one)

stoic elk
#

i'm just trying to make the projet "work" for a presentation. once it's done i won't touch it anymore

#

oh it's "working" Thanks @winged badger

#

i transformed the sub level as a blueprint and now it's working

#

i lost the element from that sublevel

#

but i feel close to a duck tape solution

stoic elk
#

ok i found the bug, it's the number of ai when you enter the level that's the problem

#

since the other level have max 10 ai and this one have around 30 that explain everything

stoic elk
#

so i can confirm that the problem was not relied to networking but the load of information generated by the ai that use way too much the tick event

sharp spire
#

can anyone tell my why with my game running in standalone, one as a listenhost and the other as a connected client, why the second clients movement stutters and hardly moves? :(edited)
it works perfectly fine in the editor with two windows

#

posted that in blueprints before, sorry

#

not trying to double post haha

#

its gotta be because there is no local movement going on, right?

#

it really should stutter this bad though... lol

#

i noticed if i move back to the server screen while my character is walking, it walks a lot smoother.. a solid 95% accurate

#

anyone? lol

sharp spire
#

figured it out in BP channel, its due to focused windows i believe

burnt meteor
#

@sharp pagoda @sharp spire @slim holly Thanks and sorry for the late reply ๐Ÿ˜ƒ

tough pumice
#

hey anyone have any experience with RPCs

#

for some reason my clients aren't getting my rpc calls

fossil spoke
#

Make sure your Actor is set to Replicate.

wary willow
#

And that it owns it

tough pumice
#

my actor is set to replicates

#

and i call SetNetAddressable and SetIsReplicated

#

my component is set to be relevant in the constructor of that actor via SetNetAddressable and SetIsReplicated

#
    void ServerActivateAbility(EAbilitySlot Slot);

    void ServerActivateAbility_Implementation(EAbilitySlot Slot);

    bool ServerActivateAbility_Validate(EAbilitySlot Slot);

    UFUNCTION(NetMulticast, Reliable)
    void NetMulticastActivateAbility(EAbilitySlot Slot);

    void NetMulticastActivateAbility_Implementation(EAbilitySlot Slot);```
#

this is my logic for activating an ability (which happens on a key press)

#
{
    if (GetOwner()->GetRemoteRole() < ROLE_Authority)
    {
        ServerActivateAbility(Slot);
    }
    else
    {
        NetMulticastActivateAbility(Slot);
    }

    return // dont worry abou tit;
}

void UAbilityComponent::ServerActivateAbility_Implementation(EAbilitySlot Slot)
{
    NetMulticastActivateAbility(Slot);
}

bool UAbilityComponent::ServerActivateAbility_Validate(EAbilitySlot Slot)
{
    return true;
}

void UAbilityComponent::NetMulticastActivateAbility_Implementation(EAbilitySlot Slot)
{
    ProcessAbility(Slot);
}```
#

for some reason I always get the owning character as authority when i click a button

thin stratus
#

Where is that AbilityComponent on?

tough pumice
#

its on a character

#

create in the constructor

thin stratus
#

Is that Character possessed?

tough pumice
#

they are the default character when you start the game

#

i am running three of them doing that networking simulation

#

so I believe so

thin stratus
#

Well, did you print some messages/create some breakpoints?

#

Which call is not working?

#

The ServerRPC or the Multicast

tough pumice
#

yeah, so when I call Activate Ability

#

it tells me the role is authority

#

then i put a break point on netmulticast

thin stratus
#

So you called it on Server?

tough pumice
#

that's what it seems like

thin stratus
#

Well, did you press the button on Client or Server

tough pumice
#

no.

#

i pressed the button on the client

thin stratus
#

Okay, so it goes into the ServerRPC first

#

And then into the Multicast

tough pumice
#

yep

#

multicast still says the role is authority

thin stratus
#

So the Multicast only reaches the Server

tough pumice
#

correct

thin stratus
#

And you are 100% sure the Component is set to replicate

tough pumice
#
    {
        AbilityComponent->SetNetAddressable(); // Make DSO components net addressable
        AbilityComponent->SetIsReplicated(true); // Enable replication by default
    }```
#

that's in the constructor of my character

#
{
     // Set this character to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
    PrimaryActorTick.bCanEverTick = true;
    
    AbilityComponent = CreateDefaultSubobject<UAbilityComponent>(TEXT("Ability Component")); 


    if (AbilityComponent)
    {
        AbilityComponent->SetNetAddressable(); // Make DSO components net addressable
        AbilityComponent->SetIsReplicated(true); // Enable replication by default
    }
thin stratus
#

You don't need the SetNetAddressable

#

That's only really used by Engine code when constructing BP components

tough pumice
#

gotcha

thin stratus
#

Might try without that

#

To make sure it's not causing any trouble

#

Not sure why your multicast doesn't reach the others

tough pumice
#

yeah its really strange

thin stratus
#

It should breakpoint once per player

tough pumice
#

that' wha ti would expect

thin stratus
#

So if hit continue it should breakpoint again for the client

tough pumice
#

that's been my test

thin stratus
#

since the Client seems to have 0 problems with call the serverRPC

#

Hm

#

Just try without the netaddressable first

tough pumice
#

yeah one sec

#

thanks for the help

#

trying to learn networking haha

wary willow
#

@tough pumice why not grab some Udemy tuts?

#

Or look at ShooterGame

#

And look at @thin stratus comp

thin stratus
#

Well to be fair, ShooterGame is a minefield

#

And his problem seems weird

#

What he showed so far should work

#

It's a reptlicated comp on a replicated character

#

The character is possessed

#

(so owned)

#

The Client calls Activate which results in a serverRPC

#

and then in a Multicast

#

But the Multicast only calls on server

#

(โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต โ”ปโ”โ”ป

#

Only thing that could be is that some of the points above aren't true

#

And the Activate is called on the Server

tough pumice
#

!

wary willow
#

!!!

#

I think he fixed it

tough pumice
#

my ability component is not on the replicated list

#

not fixed just yet

thin stratus
#

Strange

#

It's a UActorComponent, right?

#

Not a Scene one?

tough pumice
#

correct

#

the effect component seems to be replicated just fine

#

that's currently working

thin stratus
#

Weird

#

Anything you do differently

tough pumice
#

lol k fixed that

#

still the same issue

#

i accidently toggled replicates on the blueprint

tough pumice
#

one thing i noticed is that my role is always authority for button presses

#

is that expected?

#

I Figured it out!

#

I was using GetRemoteRole()

#

instead of using Role

#

sucks there is no getter for that

thin stratus
#

Does it all work now?

tough pumice
#

yeah

#

๐Ÿ˜ญ

#

thanks for the help

#

is the server call to multicast seem like an ok pattern?

#

it seems like a lot

thin stratus
#

Well the local client should be filtered

#

And should execute the ability directly

#

Cuase otherwise you have a lag

#

So you basically want to check the values required for the ability on the local client and execute all visual FX already then

#

And then you multiast and filter the owning client

tough pumice
#

that makes sense

#

does the client -> server -> multicast

#

seem like a decent pattern

#

assuming we do proper filtering

thin stratus
#

Yup

#

You should however also think about if a client that gets relevant should also get the notification of the ability somehow

#

Not idea if that's needed though

#

Cause Multicast is fire and forget

#

However gets into relevancy after it won't get the call

tough pumice
#

hm, i guess you need to also store state

#

it will most likely matter ๐Ÿ˜ƒ

wary willow
#

@thin stratus Hey there hot stuff... wtf is ServerStatReplicatorClass ?

#

My GoogleFu is not working

brittle sinew
#
 * Class used to replicate server "stat net" data over. For server only values, the client data is
 * is overwritten when bUpdateStatNet == true. For data that both the client and server set, the server
 * data will only overwrite if bUpdateStatNet == true && bOverwriteClientStats == true. 
 */```
#

Looks like it came from Fortnite

gleaming vector
#

ooooh, that code is extensible? sweet

wary willow
#

Ah...hmm

meager spade
#
    if (Subsystem != nullptr)
    {
        UE_LOG(LogTemp, Warning, TEXT("Found subsystem %s"), *Subsystem->GetSubsystemName().ToString());```
#

return NULL even though steam is set in the default engine and has the plugin enabled in the editor plugins window

#

thats the NULL subsystem not nullptr

grand kestrel
#

Where would you use server stat replicator class in practice?

#

I guess I'm wondering what epic use it for

opaque tinsel
#

sily question, but when handling respawn, is it done in Game State?

full bane
#

if your respawning system has a state that other clients need to see

#

otherwise it's perfectly fine to just do it in the game mode

wary willow
#

+1 Gamemode

lost inlet
#

@meager spade PIE or standalone?

#

editor will always return null oss

covert ember
#

If anyone can help, it would be greatly appreciated, So my game functions, but when you host a game, only LAN can see it in the server browser, and I am unable to connect outside of LAN, do you know how to make it so it can work online, not just LAN, is there a certain plug in? Code?

heavy epoch
#

@covert ember Are u using a OnlineSubsystem? and using blueprints? You can do this communication by your own, but in the beginning i suggest use Steam to work online

I recommend these lecture behind
https://docs.unrealengine.com/en-us/Programming/Online
https://docs.unrealengine.com/en-US/Programming/Online/Steam
https://forums.unrealengine.com/community/community-content-tools-and-tutorials/41043-advanced-sessions-plugin
And this tutorial for beggining: https://www.youtube.com/watch?v=TPakLkxc6f0

Hey guys, I still cant make the volume louder .. Anyway this time I show you how you can: - add Steam to your project - Host a Game Steam/ LAN - Search for a...

โ–ถ Play video
covert ember
#

benabled = false

#

I changed it to true

#

I think that was why steam was not working

meager spade
#
    {
        FOnlineSessionSettings SessionSettings;
        SessionSettings.bIsLANMatch = bEnableLAN;
        SessionSettings.NumPublicConnections = NumOfPlayers;
        SessionSettings.bShouldAdvertise = true;
        SessionSettings.bUsesPresence = bEnableLAN ? false : true;
        SessionSettings.Set(SERVER_NAME_SETTINGS_KEY, DesiredServerName,
            EOnlineDataAdvertisementType::ViaOnlineServiceAndPing);

        SessionInterface->CreateSession(0, SESSION_NAME, SessionSettings);
    }```
#

is how i am creating my sessions, but i can never find any sessions

#
    {
        SessionSearch->MaxSearchResults = 100;
        SessionSearch->bIsLanQuery = bEnableLAN;
        SessionSearch->PingBucketSize = 50;
        if (!bEnableLAN)
        {
            SessionSearch->QuerySettings.Set(SEARCH_PRESENCE, true, EOnlineComparisonOp::Equals);
        }
        UE_LOG(LogTemp, Warning, TEXT("Starting Find Session"));
        if (GameInstance && GameInstance->SessionInterface.IsValid())
        {
            GameInstance->SessionInterface->FindSessions(0, SessionSearch.ToSharedRef());
        }
    }```
covert ember
#

I can't find sessions either, I hope I fixed it now though

meager spade
#

i am missing something obvious i can feel it

covert ember
#

@heavy epoch also thanks for helping out, I am not sure if I fixed it yet though

thin stratus
#

@wary willow @grand kestrel iirc it should help debugging server stats on cloud hosted dedicated servers

#

Cause you can't really view them as usually you don't have access to the hosted server instance

wary willow
#

Ah hmm.. so Gamelift and such

#

Won't need that anytime soon I guess.

grand kestrel
#

Ah makes sense

#

Hope there's some resources on usage, could be useful for ours in Google cloud

raven holly
#

accessing gamelift servers is shit

#

you literally have to write like 3 commands in aws console to get the password, then ssh into it

#

its a pain in the ass

#

i stopped using gamelift

thin stratus
#

That's cloud hosting though

#

The instances aren't meant to be accessed

#

Doing so is hard cause you usually don't need to

#

That's why Epic added that class and other stuff

lean river
#

Yup cloud != vps
If you need more controll you should rent Lightsail from aws.
If you need more auto instances /w autoscale and other optimization then ec2

#

Glad to hear btw epic added replicated stat debug class ^^

worn nymph
#

yeah ec2 is cool never used it before but now i use their free tier to host and test my server while developing . only thing i nearly went over my limit by accident once because i left 1 running . you have to remember to terminate them or you still get charged.

lean river
#

This is why backend is usefull ;)
Like gamesparks or simple php backend.
With that you can auto call shutdown/server start things :)

bitter oriole
#

Quick replication question. I've got a component that's part of a replicated actor. It's spawned manually on each client on server, as part of BeginPlay.

#

Now if I want that component to replicate data, surely that doesn't work ? Should I create it only on the server, and setting it to replicate would create it back on clients ?

#

Noob question ยฏ_(ใƒ„)_/ยฏ

#

Really, the question is whether a replicating component created on the server is mirrored on clients.

full bane
#

haven't used dynamic spawning of components, but pretty sure you can just replicate stuff the same way you'd do with actors

#

replicated variables and RPCs

#

also if you create a replicated component on the server on runtime, it should also be spawned on all clients and just work out of the box

#

but yet again, haven't tested it yet

bitter oriole
#

So you agree that's what should happen - component is created on other clients too.

full bane
#

well, just like actors

#

if a replicated actor is spawned on the server, it automatically spawns a replicated version on all clients

bitter oriole
#

Cool. Thanks for the confirmation !

meager spade
#

why is she jerking?

twin juniper
#

Anyone know why it seems like

#

sometimes when walking towards a netcull distance actor

#

it culls out

#

then a few seconds later loads back in again

#

is this a engine bug?

#

lol

meager spade
#

AGameSession should i use that for my sessions?

hidden thorn
#

How can I change a variable on the clients computer only inside BeginPlay, right now because it is called in BeginPlay it will be called on all the clients and I just don't have any idea how to fix that.

meager spade
#

i just ripped out the ShooterGame's GameInstance and GameSession stuff, and implemented it into my own game. Host works so far, not just checking if Find Sessions works ๐Ÿ˜ƒ

twin vault
#

is steam the only platform which manages port forwarding stuff? any other which i could create a listen server/sessions out of the box

meager spade
#

GameSparks?