#multiplayer

1 messages Β· Page 666 of 1

chrome quest
#

Are there any docs or resources on how ue4 implements their networking protocol. I'm guessing it's a layer on UDP but I'd like to go through the implementation

#

Oh? Thanks man

#

Unfortunately what I'm looking for specifically isn't there.
Glen Fiddler discussed it in his series of blog posts but I was looking for actual code implementation.
I'm messing around with a server meshing system and was looking for help.

#

God, I'm slow.
Now that I think about it, you were being sarcastic, weren't you?

chrome quest
#

Ah, I see... Sorry about thatπŸ˜ƒ

thin forge
#

In a game Im starting to make, I want multiplayer to be implemented from the beginning. After looking at the options, I want to make it support both p2p and dedicated configurations(for something like Gamelift or AWS) and possibly even listen servers. Can that be done? I read that ue4 will take a lot of extra work to support p2p as it has a client/server model at core. But EOS has a p2p option?

thin forge
#

But aren't a lot of AAA games p2p at least partially? And there also seems to be no other way lower cost, if the kind of game itself is the main constraint.

bitter oriole
#

Unreal doesn't do true P2P

#

Listen server is the closest way

#

EOS or not EOS has nothing to do with it at all

thin forge
#

what about steamworks p2p, is that any good?

#

also can it be integrated easily

#

i know that it relays all traffic through their own servers. i think @twin juniper called direct p2p nightmare tier because of NAT issues?

#

so can i use steams multiplayer service in ue4 and also keep the option of dedicated server open?

#

i just read that steams service is only for matchmaking , achievements etc. not for gameplay

#

so its like EOS i guess

#

So if i write a listen server, can i also run it as a dedicated server on AWS, or gamelift?

#

ah that would be a good idea, lan parties and such

#

So listen server isnt a separate process. But what does this, from a previous post mean? :
switching between dedicated and listen isn't particularly hard. If you're writing things that don't assume the server has a player (you shouldn't do this anyway) it's incredibly easy to test both dedicated and listen servers.

#

"dont assume that server has a player?"

#

alrite will do

bitter oriole
#

Steam just gives you matchmaking

#

It gives no shit about your multiplayer infrastructure

#

It doesn't host servers

#

It doesn't provide netcode

#

It gives you sockets, which you'll use with dedis or without, it doesn't really mater, though they're useful for competitive gampelay in P2P, which you can't do with Unreal

#

Your choice is dedi server (competitive game, >5 players) vs listen server (not competitive, <=5 players) AND Steam vs EGS vs GOG vs PSN vs idk

#

These choices are completely independent

thin forge
#

that means i can only choose dedi then 😩 . for dedi i think there is another choice to be made? aws/azure or playfab/gamelift

sick frigate
#

Nothing but i'm working on a crouch feature in a competitive game and we can't drop a packet on this feature especially when i'm polling at a low hertz

bitter oriole
#

If the crouch is an analog axis (why ?) then yeah it needs unreliable

#

That's kind of the way it is imho

#

If it's a boolean action, make it reliable

dull lance
silent valley
#

And replicated variable would be the usual way to communicate this

sinful tundra
#

Any1 have any insight to my issue?

plucky sigil
#

what is the proper/good way to replicate animtion ?

wheat magnet
# plucky sigil what is the proper/good way to replicate animtion ?

you can google this question for more suggestions.
https://www.youtube.com/watch?v=zZWc-WUafXM&ab_channel=Uisco

In this tutorial I go over how set up animations that can be replicated in multiplayer in 2 minutes. In this video we set up a simple emote system when the character presses the emote button he will do his animation and this can be seen in multiplayer as well.

How To Add Custom Character : https://youtu.be/WW7cXj_Cksw

Join the discord : https:...

β–Ά Play video
bitter oriole
#

Splatoon is famously P2P

#

Though the console was supposed to help with cheating

thin forge
#

i thought about it again, dedicated server is a high price to pay for competitve gaming and leaderboards. Can i use listen servers and matchmaking through steam or EOS for everybody ? And shadow ban cheaters?

#

it would still want it to be competitive though.

lost inlet
#

you would never use listen servers for anything designed to be competitive

#

the host player will have an advantage, even without the ability to cheat

#

the steam and EOS p2p is basically listen servers with NAT punchthrough, you would still have a host

#

since UE4 only supports client/server model

thin forge
#

yea i learnt that. its a tough world for indie multiplayer it seems ☹️

lost inlet
#

you can't make a competitive multiplayer game on a shoestring budget

#

or by the sounds of it, no budget at all

woeful lantern
#

hello, do somebody knows why "InteractClient" is not working ?

mortal anvil
#

how to make pubg match making system in depth ? "for mobile development"

peak sentinel
#

So since everyone talking about both UT and ShooterGame is outdated, anyone knows where can we find examples of latest patterns?

#

Not talking about Unreal Engine specific

iron solstice
#

Hi guys, I have a noob question to ask about about a weird bug I've been having in my own project regarding multiplayer
When I click play, all clients are frozen in the air, they receive inputs just fine and are able to look around, it's just that physics don't seem to work. Only clients face this issue, the listen server is able to walk around just fine.
I have a very basic custom Player Controller, and a basic custom Character that the Player Controller possesses.

Is there a setting that I'm meant to turn on to let my character replicate gravity or something? This bug is very strange to me, because the default PlayerController possessing my custom Character allows him to fall normally

pallid mesa
peak sentinel
#

Yeah seems like GAS and such 'gameplay' modules/patterns are getting unavoidable if you want to follow Epic's way

#

Thanks

elder sage
#

would a bpi be the best way to handle a player dying in a pvp game?

twin juniper
#

So… I have a question for the Advance Session Plugin users- How do I get all currently connected players in the session? (pls ping so I can see the message) And thank you in advance πŸ™‚

lime skiff
#

Maybe the actor was created/replicated to the client accidentally before.

#

Do you use a 3rd party solution for that? I'm looking into options to save (player) state locally (maybe with savegame or a local copy of a data server) & remotely.

tacit bough
#

Anywhere I look I read that to make a real multiplayer game you NEED to go with C++ because of performance issues. What's the basis on this? Has anyone really tried doing it and realized they have to switch to C++?

#

I'm thinking of making a prototype 6v6 round-based multiplayer game and I'm thinking about learning C++ further or just do it in BP.

crystal crag
#

@lime skiffNope, the owning actor has always been the inventory system actor (ARaevinInventorySystem) and it always has had the bLoadNetClient = false set in the constructor

crystal crag
sick frigate
tacit bough
#

simple question.

How come I run this BP code and the nothing happens?

Neither the client nor server travel to the map defined.

#

and running this makes only the SERVER travel to the new map:

#

I've got seamless travel enabled too

royal sparrow
#

I want to start creating Unit Test for my game using the Functional Test actors. How would you go about running a test under a scenario where there is a dedicated game server and at least one client?

twin juniper
#

I've got more of a general question. The easiest way for me to handle a tree falling over and destroying what it lands on is to do line traces. So the server would be doing these traces and only sending when a result was found, right? Like server-side the tree might fall on a player and when it does it sends that update to everyone else. Is that too heavy?

winged badger
#

better to do a sweep with a cylinder

#

and you can RPC the hit results to clients, its fine

elder sage
#

how am I supposed to create references to things like game modes or player states?

elder sage
#

I did that but it says it's not compatible

woeful lantern
#

what do you want to do with this ?

elder sage
woeful lantern
#

where is that node located ?

elder sage
#

that's in the game mode

woeful lantern
#

the target can only be gamemode then

elder sage
#

so how am I supposed to message my player state to update what team the player is on?

woeful lantern
#

can you show me the nodes from "join team" ?

elder sage
#

this is in my player state bp

woeful lantern
#

can you find something if you search ps test like here ?

elder sage
#

yeah I already tried to cast and that just failed

woeful lantern
#

did you set your player state class in the gamemode ?

#

because that's why is giving me fail on the cast

elder sage
#

I did not actually

#

lol thanks

woeful lantern
#

you're welcome

woeful lantern
kindred widget
#

@woeful lantern My first guess would be ownership. This looks like a chest like container or something. Client needs to have ownership to call RPCs

elder sage
#

can I change the player name in blueprint or is that just c++?

#

*through a player state

winged badger
#

@elder sage you need to cast to your custom PS type there

woeful lantern
winged badger
#

that is just APlayerState reference, not APSTest

kindred widget
#

You shouldn't. Have your character or playercontroller call a default interact interface function on the item from a server RPC from the character or controller, the interaction function can be implemented in the lever and called on server.

#

By default a client only owns their PlayerController and PlayerState, and whatever pawn their controller has possessed. So usually these can be used to call basic interactions with the world through server RPCs and then state replicated back.

woeful lantern
#

so i should do the repilcation on the character ?

kindred widget
#

The RPC, not the replication.

#

Lever's replicated state should be in the lever.

woeful lantern
#

ok

#

i will try

red salmon
#

I have a problem regarding a cancel connection button when I press the button I destroy the session but that doesnt cancel the connection so I have to load the menu level but the problem is when I go back to menu it resets my widgets and I dont want that. I want to when I cancel connection to remain in the server selection widget. Is there another way to cancel connection without having to "open level"

slim nebula
#

Did you solve the problem? I'm blocked on same problem πŸ˜‚

steel fox
# slim nebula Did you solve the problem? I'm blocked on same problem πŸ˜‚
slim nebula
elder sage
#

I'm having trouble figuring out what i need to do to update the scoreboard for everyone in the match

#

it only updates for the one who dies, whether it's client or server

#

I know that it's because I put the "update score" logic following my health/death check, but where should I put it to avoid this?

#

I now have it to a point where I can go from my game mode, because that's where I decide what scoring to give, to each player's widget

rapid bronze
#

There's GameState for that

woeful pebble
#

how do i connect to a mysql database?

bitter oriole
#

With PHP

#

On your Web server that your dedis connect to

slim nebula
#

@steel fox I read all that articles. My conclusion is to replicate the input of the object (the booleans like move forward, move backward, turn left, turn right) with RPC. What was your conclusion? πŸ™‚

steel fox
slim nebula
steel fox
#

Else you can set the variable to replicated and update it through Server RPCs, use FVector_NetQuantize and of course, if you have many posessable pawns update it only when needed, for a few players I think it should be ok

slim nebula
#

How long was the RPC's interval? Sorry for many question πŸ˜…

slim nebula
steel fox
#

I've tested it with 50 updates per second and it was fine, tried simulating network lag and somehow it worked but the corrections were obvious, I think you can find the ideal updates per second for your case doing some testing in different network conditions -> https://www.unrealengine.com/en-US/blog/finding-network-based-exploits

Unreal Engine

Recently, I had an email conversation with a Gears of War fan about the differences in networking quality between each of the three games in the series. One thing that we can point to in terms of increasing the quality of the networking experience is our use of the Unreal Engine’s built in network simulation features.

slim nebula
elfin sail
#

what is the best to way to manage to players list ?

#

where should I replicate them

chrome bay
#

There already is one, AGameStateBase::PlayerArray

#

Contains a list of all active player states in the game

elfin sail
#

okay only states

#

or character and controller also

chrome bay
#

You can't access other controllers

#

But you can get the pawn from each player state

elfin sail
#

great

#

thank you so much

#

great help

finite goblet
#

Is replication data sent out to all connected players in the same tick?

#

for Replicated variables

elfin sail
#

depends on client ping

#

i guess

chrome bay
#

It'll be sent on the next network frame, which is (usually) the last thing to happen in each frame - IF that actor is compared that frame

#

Whether they receive it or not depends on networking

twin juniper
#

hello guys so today i started my first ever multiplayer game so i followed this tutorial to add Amazon Gamelift
https://youtu.be/PIg2q0wEPJc

so i installed UE 4.26.2, did all the steps which shown in the video but iam getting this error "Server targets are not currently supported from this engine distribution."

Watch Part 1 here: https://youtu.be/tOy0xYaP3wA

This video is the second part of an extensive and informative tutorial on how to integrate Amazon GameLift with Unreal Engine, going over concepts such as building the GameLift Server SDK library files, adding the GameLift Server SDK plugin to a UE4 project, and packaging a Unreal Engine dedicated...

β–Ά Play video
#

can any one know what happen exatly?

#

this is my output guys

empty axle
#

@twin juniper you can't package server without source version of the engine

twin juniper
#

what you mean i didnt get u @empty axle

twin juniper
#

ya i did all this steps

#

from the follow video tutorial

royal sparrow
#

You didn’t make a Server target.cs file

#

It’s in your error output

#

Open up the documentation above and go through step 2 again. There is an issue on how you set that step up or you missed it

twin juniper
#

ya its with same steps

#

even if i build this code from vs by selecting development server also iam getting this error

royal sparrow
#

copy and paste your GameNameServer.Target.cs into chat please

#

I know you definitely are using a source build since you would not have gotten that far without one

twin juniper
#

// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;
using System.Collections.Generic;

[SupportedPlatforms(UnrealPlatformClass.Server)]
public class Amazon_GameLiftServerTarget : TargetRules
{
public Amazon_GameLiftServerTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Server;
DefaultBuildSettings = BuildSettingsVersion.V2;
ExtraModuleNames.Add("Amazon_GameLift");
}
}

thin stratus
#

Are you sure they are using the Source Build?

#

Did you maybe forget to actually assign the Source Build to the Project?

twin juniper
#

Amazon_GameLiftServer.Target.cs

thin stratus
#

The error is quite clear

twin juniper
#

source build?

royal sparrow
#

I'm thinking he wouldnt have been able to get that far if he wasnt using a source build

thin stratus
#

You can't build Dedicated Servers with the Launcher Version

#

You need the one from GitHub

#

That you have to build yourself

#

And then switch the Project to use that

royal sparrow
#

Try this - Close out of your project right, right click your gamename.uproject and then click switch engine version

#

and whatever is defaulted in that box would be what its opening up on

#

It should say Binary/Source build located at "...source build location"

twin juniper
royal sparrow
#

Follow that step I just put above that last message

royal sparrow
#

If it looks like this, you are using a source build. If it says 4.26/4.27 you are not

#

Yes

twin juniper
#

ok i will check

#

@royal sparrow

#

i got this

empty axle
#

so you are not using source build engine

royal sparrow
#

^

empty axle
#

it's the first requirement in the doc that I sent

twin juniper
#

ya

royal sparrow
#

Click the dropdown and see if you have an option like my screenshot shows

twin juniper
#

but i thought both are same

#

so now i have to download engine from git and do same? right

royal sparrow
#

If you haven't already then yes. Download the engine from git and then build it

twin juniper
#

ok

#

after downloading same like right click on .uproject file and select version and select source version?

royal sparrow
#

I misunderstood you earlier. I thought you did this already. This is the first step. Pro tip, I just download the releases since its faster imo then pulling their whole repo into git

#

You have to build the engine first and then yhou can select the source

#

Just make sure you follow the instructions in the readme. I've built the engine quite a few times and I believe it is something like this(should still read the readme).

  1. Clone or download repo
  2. Run setup.bat
  3. Run GenerateProjectfiles.bat
  4. Open UE4.sln
  5. Build project
twin juniper
#

what about the project which i just did all the things like coding and all

#

no use?

#

and also which source i have to download i can see 10 repos here

royal sparrow
#

There is one called UnrealEngine

twin juniper
#

first one?

royal sparrow
#

Not sure, don't have my phone to mfa login. It should just straight up be UnrealEngine.

#

Almost identical if memory serves corerct

twin juniper
#

this one?

royal sparrow
#

thats correct but delete that screenshot

#

Its against TOS

twin juniper
#

ok

#

but it says 4.27 but in Amazon gamelift says its supp for 4.26 only right?

royal sparrow
#

perfect. Alright, thats the repo. Follow the instructions in the readme and you should be up and running soonish depending on your computer. My dev computer builds it in 15-20 min and my test pc builds it in about 5 hours lol

#

What version is your game using?

twin juniper
#

4.26

sharp plover
#

Currently set the player character to be attached to the horse and send the horse inputs, however on other clients you see him still trying to linear interpolate the velocity

royal sparrow
#

@twin juniper Click "+214 releases" -> scroll down to "4.26.2-release" -> Click assets and then click "Source Code.zip"

granite plume
#

I have a simple demo I'm trying to make work: 1) When a player triggers a volume, I want that player to own some actor Prop and 2) I want the client (not server) to be the owner when this happens.

From what I understand, just setting the ownership from the server should work, because the players are by default autonomous proxies, and anything they own will have the same role. Is this true?

sharp plover
red salmon
#

I have a problem regarding a cancel connection button when I press the button I destroy the session but that doesnt cancel the connection so I have to load the menu level but the problem is when I go back to menu it resets my widgets and I dont want that. I want to when I cancel connection to remain in the server selection widget. Is there another way to cancel connection without having to "open level"

lucid pewter
#

I am doing a multiplayer event on ListenServer and I should reproduce for all clients some changes to the BP_Sky

elder sable
#

I'm trying to start a game from a steam lobby, i start the session but i don't know what i should do to start the game on clients. Should i call a RPC on each players or there is something automatised in UE ?

vague spruce
#

sup. i'm building a persistent world and i got player inventories (and other stuff) that i wanna save, and obviously this will all need to be set up server side that makes calls to an API.

that being said, for now i don't really need this functionality and instead i can just save player's inventories to hard disk using an unreal archive. how would i go about replicating this to other players? do i just make a bunch of server RPCs when the player connects?

fossil spoke
#

However this is extremely easy to manipulate.

cosmic yoke
#

hello, if i run Set Actor Rotation on the server in a character, shouldn't that issue an update for the client through the replication system?

vague spruce
#

@fossil spoke only need it to test out gameplay for a vertical slice demo, not a full fledged game. game will have a proper api eventually

#

thanks for the suggestion, that works

#

is there a way i could do this on the server? maybe keep the server alive the entire time?

#

and if the player spawns in again, restore their player state?

fossil spoke
#

Servers can also use the SaveGame system

vague spruce
#

this just blew my mind, this is true

fossil spoke
#

So if you want to handle it that way.

vague spruce
#

so i just save all the player states to hard disk!!!!

fossil spoke
#

Avoids all the unnecessary Client stuff

#

Store whatever you need i guess.

vague spruce
#

i've got another question. i need to keep the player's pawn around when they disconnect for a couple of minutes. off the top of your head you have any idea where this would happen? would i be doing this on the game mode?

fossil spoke
#

Im not sure if OnLogout is called before or after the Pawn is destroyed.

#

You maybe able to unposssess the pawn in this event

#

Which should stop it from being destroyed.

vague spruce
#

hmmmmm ok cool ill look into it

#

super good info appreciate it brother

fossil spoke
#

Are you using C++?

#

Or blueprint only?

fossil spoke
#

Though if your only using Blueprint im not sure this is available.

#

Generally I think only a change in Velocity causes the Character to update to the Client

cosmic yoke
#

we do a launch character before the set actor rotation

#

i tried the force net udpate and doesnt do anything

#

set actor location works fine without anything

#

set actor rotation doesnt do anything

#

right now the only way i kind of got it to work was making a client rpc

#

but doesnt trigger every time

fossil spoke
#

It maybe because the PlayerControllers ControlRotation is forcing it back to where the Player is looking, negating the request to set rotation directly.

cosmic yoke
#

10 % miss

#

the use controller yaw is set to false

#

so it shouldnt use the control rotation

#

its a third person template

fossil spoke
#

Is it a one time thing?

cosmic yoke
#

yes

fossil spoke
#

Odd

cosmic yoke
#

i know

#

i'll show you my simple test

#

it only rotates in the server

#

not the client

#

even with the force net update on the server

fossil spoke
#

Is there something stopping you from setting the Client Rotation as well?

cosmic yoke
#

not really, but i wanted the replication system to do that for me to save an rpc

fossil spoke
#

You dont need another RPC.

#

Just call SetActorRotation before the call to ServerRotate

#

The Client is predicting that the Server is going to perform the same action.

cosmic yoke
#

only the server has the rotation

#

it's a precalculated thing

#

that is done on the server

fossil spoke
#

Right so thats why i asked if there was something stopping you from doing that lol

cosmic yoke
#

i was answering regarding using an rpc

#

i can pass the rotator on the rpc

#

and the client does the rotation

fossil spoke
#

Whats this ultimately achieveing?

cosmic yoke
#

it was so we didn't do the processing of getting the rotation on client and the server, but we can try it like that

fossil spoke
#

But are you like trying to move the character in the direction of the Launch?

cosmic yoke
#

we're trying to make the character rotate in the direction of the launch (excluding z obviously)

#

the launch is done on the server

fossil spoke
#

You should be able to calculate that on both by using Velocity.

#

Velocity is just a Vector pointing in a particular direction, they can be converted to a Rotator.

#

Both the Client and Server will have the Velocity.

cosmic yoke
#

when the player presses the jump key it does an server rpc to launch, so i should only be able to check the velocity after the rpc has been executed because only then will the velocity change, and it should also be a one time thing on the client

fossil spoke
#

Yeah its not an ideal situation. Im unsure why setting the rotation doesnt result in a change on the Client.

cosmic yoke
#

yeah it's weird

#

thanks for you help anyway πŸ™‚

elder sage
#

How am I supposed to replicate my scores to each player's widget reliably?

fossil spoke
#

Create the "Score" property on the PlayerState (I think it already has one by default).

#

PlayerStates exist on all Clients.

elder sage
#

So where would I put my event to update the score? I'm unsure how to go from the game mode or game state to the player state for each player

#

I guess I should also say that this is for a pvp scoreboard, so I'd need both individual and team UI stuff

sacred spire
#

i am somehow not seeing any packetlag and delay with net -pktlag=500 and netemulation.pktlag 500

#

any ideas?

lament minnow
#

hey folks, i'm having a bit of an issue with my networking of a simple pong like game. so i have most things working, but one aspect i want is to let the local player control his paddle directly. so for the local pawn i disable replication so it'll ignore server replications, and this seems to work mostly fine. however it seems the proxy does not respect the constraints i have set for the physics object(only movable along the x axis), and when getting hit by a paddle it incorrectly moves the paddle back. any help on how to achieve this behavior correctly?

sacred spire
#

am i suppose to run the command net pktlag in server only or client?

#

anyone can clarify?

peak sentinel
#

I use it on both

sacred spire
#

the correct way should be on client only, right?

#

i mean does it even make sense to run it on server?

peak sentinel
#

It does make sense

#

If you're using listen server it will be normal computer too

#

Host can have lag too

sacred spire
#

i see, you have a point on listen server

vague spruce
#

sup fellas. anyone have any good workflows on how to test servers? as in, sure i can launch the server and the client all at once from PIE, but how do i go about launching a server and testing clients individually on it? should i package the server, run it and then run clients or some shit?

#

seems like a weird workflow because now i have to package the server every time i want to run a test

#

i guess i could try some configuration options in my IDE using UnrealEditor.exe -Server but idk

#

i actually i think i'll make a script for this. i'll rebuild my project and then run the script in my configuration. cheers

twin juniper
#

hello guys so i downloaded source file from git and i did all the steps but after i create one project and if i open it its saying this

#

what is this exactly guys

#

how to clear this

thin stratus
#

What does that have to do with multiplayer

#

Please ask your question in the right channel, then you'll also get help quicker

twin juniper
thin stratus
#

That'll be either #engine-source or #cpp as you are having problems with building the engine

thin stratus
#

Yeah well turning on your PC is step to build multiplayer. Doesn't make this a hardware channel, does it :D

twin juniper
#

hahaha

summer tide
#

LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor BP_Range_AI_Aggressive_C_2. Function ServerSetCurrentAnimSetting will not be processed.

#

Any idea what this means? So I'm calling multicast from ServerSetCurrentAnimSetting .

empty axle
summer tide
elfin sail
#

i have 100 players in my game

#

and i need to sort their positions

#

where should i do that

#

on server or client ?

empty axle
empty axle
empty axle
#

those are all requirements, it should work

elfin sail
#

on basis of the positions

#

its kind of racing game

empty axle
#

and I would lower that 100 players limit in your game to something lower unless you have a whole studio with you

elfin sail
#

i do need players postions

#

i just need a variable like coverd distance

#

from player state and sort the players on the basis of that

#

yes i am with studio i have to write it down but yeah goal is 100

#

but first i have to run only 50 players

thin stratus
#

If it's a race, then it's usually along a path

#

Which means you usually get that "covered distance" by checking how far along the player is along that path

#

That path can be a simple spline

#

You can query the max length of the spline

#

As well as query the length of the spline relative to a location ( the player )

#

Then you can sort them by that value

little flame
#

Hey is there a way to replicate this play montage function and also keep the ending outputs like on completed and blend out? I need those for my ability system to tell it to stop the ability once the montage finishes. If I try doing it using it the normal way using a multicast and run on server, it loses the output nodes from the play montage. Does anyone know a solution for this?

thin stratus
#

Montages should already be replicated via the ASC

quiet fjord
#

Guys to replicate the rotations and avoid jerking is fine like this or you should also apply a multicast to the rotation

gusty lily
#

hi. currently trying to work out why the tickrate isn't getting clamped for the listen server despite setting this in defaultengine.ini. If you know about this stuff, here's the forum post: https://forums.unrealengine.com/t/clamping-tickrate-for-client-and-listen-server/253110

eternal canyon
#

So U would have to lock their fps

#

And they would also have to be able to reach that fps

gusty lily
#

thanks. but have a look at the ini in my thread - i did find some commands that i was pretty sure did successfully clamp it.

rich dune
#

Hey, anyone know how to set the character rotation in multiplayer? I want to align the player with a ladder but neither set control rotation not set actor rotation will work.

chrome bay
#

@gusty lily If you have a maximum tick rate coming from somewhere else, it will I believe override the listen server tick rate.

#

See UGameEngine::GetMaxTickRate()

#

The parent implementation may overrule whatever you set

#

Net tick and game tick are locked for listen servers, AFAIK

#

But if you've done something like 'SetMaxFPS', that will overrule it AFAIK

hexed pewter
#

Is client side prediction the hardest thing in making a multiplayer game?

meager spade
#

not really

#

GAS helps a lot

peak sentinel
#

Not the hardest but its hard depending on the logic imo

dark edge
# meager spade not really

Is there a super easy gas projectile implementation floating around yet or is it still a pretty tough problem to deal with?

#

That is, predicted shooting with fairly slow projectiles

meager spade
#

hmm yeah, so when i was researching that the client spawns a fake visual only projectile, all other clients also spawn this fake visual projectile

#

but the server spawns an invisible projectile, that actually does the damage

#

but in the end i didnt bother, and just fire the projectile server side

#

shot is still instant feel to client, (muzzle flash, etc), but the actual projectile just comes from server

dark edge
#

Is it a replicated projectile or does everybody just locally fire the same projectile but only the servers does damage?

meager spade
#

only server does the damage

#

you should never predict damage, it leads to bad things

dark edge
#

Yeah I think that's where I'm at right now. I suppose the only other alternative would be client-side hit the Texan with server just checking that the hit was plausible

#

Hit detection, not hit the Texan.

meager spade
#

well, for my hitscan weapons, client tells the server who he has hit

#

projectile weapons (Sniper/Rocket Launcher/etc) then the projectile itself handles that

#

so projectile relies on the server view of the world

#

hitscan on the client view

#

can get away with a bit on projectile weapons as you need to lead your shots, etc, but for hitscan, you don't really have too.

dark edge
#

I've actually been looking into a global projectile system, just haven't quite figured out how I would do the visuals. It's a subsystem with a pool of projectiles as raw data, and it just does stepwise line traces per tick. Basically if your projectile velocity is high enough it devolves into a hitscan weapon. It's super fast and lightweight, but I haven't quite figured out how I would do the visuals. I'm thinking either a global particle system, or a pool of particle systems, or something else

#

Been reading too many ECS books, it's infecting my development style

peak sentinel
#

Roy Awesome had a ECS niagara system that works well

#

I guess if you use burst-counter like system and create one projectile manager subsystem for each connection, it'll work well

#

I dont use ECS because I dont have thousands of projectiles but I have hundreds of them, firing projectiles inside of OnRep locally works well in my case

#

I'm also thinking about writing a new projectile system from scratch but for now I dont have any bottleneck on my device, maybe after I test on target platform

clever plinth
#

Would GAS make the following easier? (Somewhat new to unreal and have not tried it yet). I have a system where the player can pick up certain objects and carry them. The actor that can be picked up has a component which contains the logic to handle the "object side" logic, while the player pawn has a component to handle the "player side" logic. When picking something up, I have a simple request-response RPC to the server where it checks if nobody else has picked up the object yet, and the replies to the client. The state of who has picked up what is maintained server side and then replicated to clients via state in the object component. This seems to work fine, but for these types of patterns does GAS considerably simplify things?

lost inlet
#

GAS does the very opposite of simplifying

clever plinth
lost inlet
#

are you trying to implement an inventory system?

#

because you didn't use that word in your message even though it sounds kinda like it

clever plinth
# lost inlet are you trying to implement an inventory system?

Pretty much. I already have it implemented, but it's a bit more general in that the player can pick up different types of things that go into different "inventories", so-to-speak (which is why I made it a component). They can hold something in left and right hands, but fairly different types of things

peak sentinel
#

I think inventory is not an area of GAS

#

GAS, is 'ability' thing, like 'action's. And also helps about attributes which is values like health, mana, energy etc

sinful tree
#

GAS would be useful in an inventory sense if:
A) You wanted to restrict players from picking things up because they're under certain effects. Effectively, making the "Pick Up" action an ability.
B) You wanted to grant players effects or abilities when they equip items.

GAS wouldn't really help with how the items are stored, more what the items do.

clever plinth
#

Maybe my only answer will be to dig through the implementation, but does anybody know: If I transfer network ownership of an actor on the server with SetOwner, and then write to a UPROPERTY that is replicated with COND_SkipOwner, is there the possibility of still seeing a replication update to the new owner on the next iteration?

twilit flint
#

Can I spawn Actor on client if this actor is not replicated ?

#

Only for local purpose

peak star
#

@twilit flint yes I do this all the time for things like explosions and effects

#

Or things only the local player should see

#

Just make sure the client is the one spawning the actor and not the server.

twilit flint
#

thx

#

I have problem with world context

#

dunno why:(

twilit flint
#

how this can be null 😦

harsh lintel
#

I'm using Open LEvel node with the listen option, is there a way to know if the map I'm currently in is already "listening"?

clever plinth
slim nebula
#

When I attach the player's character to some scene component (both on authority and remote machine), its movement gonna be weird. I thought that was occurred by synchronizing movement between authority machine and remote machine. So I set the 'replicate movement' option as false on attach, but it is still weird. What's the matter?

#

I'll try to set the movement mode as none when i attach it.

elder sable
#

When i ClientTravel, what's happening server side, Is GameMode::Login supposed to be called on the host/server ?

slim nebula
slim nebula
#

On authority machine, it looks good.

#

On remote machine, it looks weird.

crisp sable
#

Question re: World Composition/Level Streaming in multiplayer.
Let's say I have a large level that's broken into 100 tiles ( each tile being 500m x 500m)
If I have 2 players, in different parts of the map. For example, PlayerA is in the top left corner of the map, PlayerB is in the bottom right corner.
Does each player have to load the assets of the tiles in BOTH the top left corner and the top right corner?
Is it possible to make PlayerA only load the relevant assets in his tile?
If I have 100 players all in different parts of the world? Does that mean every player has to load basically a shit load of tiles?!?! Doesn't that defeat the advantage of using level streaming?
How does Fortnite do it?

peak sentinel
#

Try using 'base' movement

#

I'm not familiar with CMC in deep levels but I know attaching is not a solution

silent valley
crisp sable
tropic snow
#

Why can't client shoot dead bodies (no ragdoll), but the server can. When hit blood vfx splat shows up.

slim nebula
kindred widget
#

@slim nebula I'm not 100%, but that looks like something where you'd attach the character's mesh to the raft at a location, and let the raft set it's animblueprint. Disable the character class, set the capsule to ignore all collisions, and disable CMC. Possibly attach it to the raft as well. Then possess the raft directly. Things can still shoot and hit the player's character mesh and the character's pawn class would still exist to take damage and whatnot. Then on leaving the raft, you can just place the capsule at the controlling spot, reattach the visual mesh, and reset it's normal anim blueprint. Couple of easy functions and it'd let you keep your stuff pretty modular.

slim nebula
quaint nacelle
#

I have the problem that the server of my game has an option that the clients must know before beginplay is called. What I currently do is parse the command line for the option on the server. This sets a variable on the GameState in its constructor. Replication is enabled for this variable. Clients that are connected to this server spawn actors based on this variable during beginplay. However, I noticed that the variable is not being replicated in time for the beginplay call in the clients. Is there any way to delay beginplay until the variable is replicated? Or should I use an entirely different approach?

kindred widget
#

@quaint nacelle Typically you can just run the logic from the set variable's OnRep if it's for a client only spawning of something visual. Although I'm not sure why your clients have to care about spawning things that are based on server state? Traditionally you should be spawning replicated things on server for these clients, which would already have the data you've set.

leaden bone
#

@kindred widget The variable in question here is a path to a replay file on disk. Each client will consume this file and do all setup and spawning locally.

kindred widget
#

Ah, in that case, likely just do it OnRep. Of if you really need to use Beginplay, initialize the variable to something invalid, check on beginplay if it's valid somehow, and don't do anything if it's not except set that beginplay has ran. In the OnRep, check if Beginplay has ran, and if so, run it.

#

Alternatively, you can do it dirty and just check on a timer if the OnRep has been received after beginplay and stop the timer when it's received.

leaden bone
#

@kindred widget We'll look into that. The help is very much appreciated, thank you.

boreal wadi
#

This might be something I’m overthinking but using games like COD when you have a multiplayer game that has a story mode, is the story mode played on the clients machine only or is it played on dedicated servers? If the former how does it work? Is it as simple as having a menu that separates the two types of game play.

Further what about games like destiny that which is online only and has a β€œstory” mode that you can play. How do you separate out PvP from that state where it’s single player but sort of like Coop?

I ask this because I’m trying to decide which direction to go

chrome bay
#

Because COD and Destiny being what they are, there's a good chance you're always playing online on a server for co-op purposes. If there is no co-op, then my guess is you're just playing offline.

#

Gears of War just had you playing the SP campaign in "listen server" mode, so that other players could join your game. There was no dedicated server for story mode.

#

If you have no co-op, just play offline. If you do have co-op, playing as a listen server is probably best. You won't be reaching destiny scale anyway.

#

And it's wasteful to use dedicated servers for that kind of thing, where having a level playing field/cheating is less of a concern.

#

Answer really is that "it depends" though.

bitter oriole
#

Not familiar with recent COD but Destiny has a very complex server architecture

chrome bay
#

Yeah doesn't surprise me at all.. not familiar with the game but I know it's basically all online

bitter oriole
#

Destiny has a mix of P2P and multiple layers of servers for activities and player data

#

You essentially log in to a main character server, then into instanced world servers that I understand aren't a single server either

#

And the core gameplay is P2P IIRC

#

So they essentially put cheap stuff that needs strong authority on their servers and offload the expensive, less authoritative gameplay to clients

chrome bay
#

makes sense

bitter oriole
dark edge
bitter oriole
chrome bay
#

Nice!

bitter oriole
#

My 3000 hours in that game might as well help people

chrome bay
#

πŸ˜„

boreal wadi
#

I appreciate it guys!

elder sable
#

Hi, when i serverTravel from a lobby map, all clients are connected to the new map but the host has no playercontroller, i'm not sure how i should handle the host, by creating the PC and calling postlogin manually ?

elder sable
#

Listen

chrome bay
#

Definitely not

#

Means some part of the travel process isn't being done right

elder sable
#

Mhh i just have a ServerTravel when the host click a Start button, clients are connected, the host aswell but the host just has no PC/Pawn (only a camera and can't move)

#

I'm using sessions aswell, i don't know if it has an impact on that

chrome bay
#

If you're in the same map you should have a PC at least

elder sable
#

I have 2 maps, one lobby map and one game map, everything is fine for the clients but not the host, PostLogin() is never called for the host, i guess it's a problem

chrome bay
#

Might be that login or prelogin is failing for the host for some reason

#

Not really sure what happens after that

dark edge
#

@elder sable are you overriding any functions in game mode or doing anything weird regarding pawns and controllers?

elder sable
#

I override PreLogin PostLogin InitNewPlayer

#

I call the base function each time, i don't think i'm doing something weird but i will check that :p

dark edge
#

Just dig through those and make sure you're not doing some sort of has authority check that never returns or something like that

elder sable
#

Yep i know what to check now, thanks for your help πŸ™‚

gusty lily
twin juniper
#

Hi. I want to rotate my character to cursor location before it executes an ability.

Right now every tick in my playercharacter class updates CursorToWorld decal (like Topdown template) with a new location based on cursor. However this location always returns 0,0,0 from server POV. How would I go about solving this? Much thanks.

#

btw location returns 0,0,0 because PC->GetHitResultUnderCursor(ECC_Visibility, true, TraceHitResult); like the server doesn't have a cursor at all

meager spade
#

you need to send that info to the server

#

we have the client send an unrealiable RPC with the mouse position to the server

glad sedge
#

I'm doing a tut at the moment, and I'm struggling with the concept of reping to simulated proxies.

#

In this tut, they approach what gets replicated in, sort of, three parts - Autonomous, Server and Simulated.

#

My question is if something is getting rep_notified to something via server, wouldn't the simulated get that info too?

#

Or is it only the autonomous clients that get the update?

twin juniper
#

actually probably better to only update server cursor location before performing an attack rather than every tick

uneven vault
#

any tutorials on how to make Find a match with dedicated server setup for mobile games? where each match has random map/new people etc..
or an addon on ue4 marketplace?
I've found Multiplayer with Blueprints (AWS) but too expensive and not sure if it's worth it

meager spade
#

we send it every frame @twin juniper

#

but we send it as a FVector_NetQuantize

#

as it does not need to be super precise

#

another thing you could do is like you said, just wrap the location into the rpc to server when activating the attacking

gusty lily
#

@elder sable there’s a function something β€œhandle new players” I think works for server travel / new map. Not at computer so don’t know exact but I use this in my listen server game

#

You can replace post login with it

royal sigil
#

Hey guys.
I have a replicated UObject, but when it destroyed on server it does not call PreDestroyFromReplication. Any ideas how to destroy them on clients whenever it is destroyed on server?

winged badger
#

@meager spade its throttled slightly, not every frame

#

no more then 20 times a second

#

do your logs confirm that?

peak sentinel
#

But I know nothing more, some other guy who has knowledge about CMC should guide you further

pallid mesa
blissful totem
#

What's the best way to restart a task when a blackboard actor changes.

#

That is, if Target Enemy changes from Unit A to Unit B, I would like to abort this task and, let the the BT realize it should start this task again.

#

nevermind. It was just setting the decorator to "On Value Change"

Edit: also, wrong channel...

violet sentinel
#

If pawn is possessed by AI then IsPawnControlled would return false on clients. is there any other thing to check if pawn controlled by either player or ai on client ?

dull lance
#

^ aren't AIs tasks and stuff server only?

#

what would be purpose of checking the status on client be

violet sentinel
#

yeah, thats the problem. ai controllers exist on server

#

but i need to let clients know if the pawn is controlled at all. but seems like would have to add a bool just to replicate control state

dull lance
#

just do IsLocallyControlled

#

you also have a version of that but for playercontroller

#

also, there's an onrep for when the player state is replicated

#

maybe handle that switch there?

#

unless ofc your ais can switch aicontrollers

violet sentinel
#

on server i have pawn controlled by either player, ai or nothing
on client i need to see if pawn is controlled

#

for now added replicated bool that is set onpossess/onunposses on server

crimson valve
#

If I want to assign my players different pawns when they join, where should I do that? Specifically I want the first player to be a VR pawn, and the later ones to be spectator camera ones

gusty lily
#

You could have logic in your res pawn code that counts the number of pawns in the world and selects different class to spawn with accordingly. @crimson valve

shy kelp
#

why si the pawn not turning? im using pawn sensing a a move to

#

it works in single player

smoky wing
#

i need to ask which is the better or comparison between gamelift and playfab

elder sable
harsh lintel
#

if an actor is replicated, and it has a child mesh component that is not replicated, and the actor moves, does the non-replicated child mesh component moves too?

dull lance
#

yes it does

#

if you're replicating movement for the actor

#

[either through a movement comp/breplicatesmovement/other method]

elder sage
#

Could somebody help explain the difference between game modes and game states, especially in the context of a multiplayer game

peak sentinel
#

First thing to know gamemode only exists in server

elder sage
#

And that means that only the dedicated server or host player will run an instance of that blueprint, right?

#

I'm a little iffy on what should be replicated, but I'm pretty sure about that one at least

hallow fiber
#

So does an instance of everyone's game state exist on every client / servers instance?

#

Or does the game state only exist on the owner

peak sentinel
#

If replication is involved, it means the class is communicating with others

#

Gamemode only exist is server so it does not need to be communicate with others

#

So no replication needed for it

#

When you join a session as client, you connect and communicate with servers world/instance

#

When server do something on its own instance, like spawning something, you'll see it because it will be automatically replicated to you or if server change somethings position you will see it too because server keep sending data to other clients automatically

#

But sometimes you need to tell the server something like "I changed my position" then you send RPC and that RPC is the messenger between your world and servers world

hallow fiber
elder sage
#

So if I have an fps and want to run a line trace on the client and then communicate that I hit someone to the server, and everyone else through the server, that's an instance where an rpc is appropriate?

peak sentinel
#

Weapon class

#

Think like this

#

You have a listen server, and one client so you have two players

#

Each player has a world

#

If you spawn something replicated, client will use server's instance and communicate with it by using RPCs

#

if you spawn something not replicated it will only exist on spawners world

#

so no one will be able to communicate with it

#

gamemode is just a normal class created by Epic to handle game's rules etc

#

you can create your own class and replicate it

elder sage
#

Yeah tbh I understand the concept of replication as you're explaining it

peak sentinel
#

and handle your own things

elder sage
#

I guess I'm asking more where I should transition from my game mode to the individual game states as scoring happens

#

And also I don't know how exactly to maintain references to all player's game states that the game mode can access

peak sentinel
#

All players dont have game states

#

Everyone has one

elder sage
#

So like how "get player controller" gets the player's singular controller, unlike something like a widget where you'd need a reference to that specific entity

peak sentinel
#

Pawns holds their references to controller, when you do damage, or notify players someone is dead etc. you should also send the killer player in that damage function or such

#

So as server you can access its controller, then cast it to playercontroller then get its playerstate then add score etc.

elder sage
#

And to update the UI from there, could I use a repnotifiy in the player state?

#

I kinda ran into a roadblock last time where my death event was connected to my scoring in a way that caused only the dead player's UI to update

peak sentinel
#

Umm, not with OnRep I guess because OnReps also updated by late joiner

#

Oh sorry nvm

#

Yeah just do what you've said

elder sage
#

So even something like "onrep set UI to equal score variable" to put it crudely?

peak sentinel
#

Yes

#

Store the widget reference in your HUD

elder sage
#

So I currently have a bunch of stuff following my onrep for health, including player death, should I cut that path short by making a death sequence earlier than that?

#

Sorry I don't know much about huds, only individual widgets

peak sentinel
#

What am I doing is I have an OnRep for my health and if I have a negative or zero value for that I call a delegate and every class handle its own logic

elder sage
#

I'm almost thinking (typing) aloud at this point but I think I should do what I said to be able to replicate that event easily

peak sentinel
#

Characters delegate stopping movement, preventing weapon from fire, HUD creates a widget, playercontroller prevents input

#

etc.

#

They all subscribe to players healthcomponent's delegate on beginplay

#

Delegates are event dispatcher in BP

elder sage
#

I want to be able to pan the camera around while dead, kind of like Destiny, should I not do anything to stop the controller from taking inputs in that case?

peak sentinel
#

Its totally up to you

#

I unpossess pawn when I die

#

And possess a spectator pawn

#

You can do your own logic

elder sage
#

Also a good solution

#

I'll figure that out, but I honestly just want something playable so I can start testing stuff

#

If I want to track player scores individually through the player state, but then want to add them together to create the team score, is that a better solution than having a separate team score variable that updates with all player score updates?

peak sentinel
#

Track team scores in gamestate

#

just add the same score to the gamestates teamscore variable

#

when you're adding to playerstate

elder sage
#

So despite the name, game states should be used to track in-game modes, right?

#

Like if it's death match you would change the game state to "GS_Deathmatch" or something equivalent and store all of your mode-related logic in there?

peak sentinel
#

Idk, totally depends

elder sage
#

My initial question was actually about the difference in usage between game modes and states and I think I still don't get it

peak sentinel
#

I'm sorry then either I'm sleepy not understanding you or having trouble with communication

elder sage
#

No, you've been helpful about other questions haha

peak sentinel
#

Have you read eXi's PDF? He explains the question very well

elder sage
#

I read a good portion of it, but I'm not sure if I should read it entirely even if I don't understand it practically, or if I should go one section at a time

peak sentinel
#

I think you should read it entirely, at the one of the beginning sections the directly explains the role of GameMode and GameState

elder sage
#

Okay, I'll do that then

peak sentinel
#

Its a must-read paper for before deep diving into practice btw πŸ˜„

#

%10001 recommended for everyone, even for experts

slim nebula
# slim nebula On remote machine, it looks weird.

After googling and reading engine code, I've solved this issue. I decide not to use AttachActorToComponent Function. After the player interacts with the paddle, each machine (remote, authority) calculates the player's location on their tick. I refered to these followed links:
https://forums.unrealengine.com/t/attaching-a-player-to-a-player-causes-jittering-in-networked-game/29394/9
https://forums.unrealengine.com/t/mutiplayergame-problem-how-to-attach-a-passenger-to-a-car-how-to-solve-jitter-on-client/131895/2
https://answers.unrealengine.com/questions/790345/attaching-client-to-moving-pawn-annoying-jitter-he.html

elder sage
#

What can I do to get a reference to the client's player controller instead of all of them individually?

kindred widget
#

@elder sageFor what use case?

elder sage
#

I think the issue I'm having with my UI health bar seemingly not updating is because it's actually creating a number equal to the number of players because it fires each time a character spawns and then gets their controller

#

what I have so far

#

I've made sure that the progress bar update isn't the issue, the health variable isn't either

kindred widget
#

Part of your issue is that this event only ever happens on the server.

fading birch
#

why would you not just drive all that logic in the hud to begin with?

elder sage
fading birch
#

that's fair πŸ˜›

elder sage
#

I wanted a reference to the hud to update it through the character

kindred widget
#

Also, if you have any C++ ability. I strong recommend making a static getter for the local controller via GameInstance->GetFirstLocalPlayerController()

#

GetPlayerController0 works, and is fine for testing, but it has some multiplayer bugs that aren't quickly apparent, and also don't always happen. May be frustrating to debug later.

elder sage
#

so is the idea that I should set it up in a way that means I don't have to do that?

#

also now that I look at it maybe the issue is that the reference is being set several times sequentially?

#

because the beginplay/onpossessed runs for each character that exists?

#

I actually initially wanted to do it the way I'm attempting so I could avoid casting to the HUD for the reference every time the health updates

#

although I have a quick idea

fading birch
#

well, for starters, I would do that in the UMG itself.

#

and just update the widget when that value changes.

#

are you using BP only?

elder sage
#

so far yeah

upbeat basin
#

If I use a listen server instead of a dedicated server and connect a player to another, I will have 2 game states, one on the connecting client and one on hosting client that has authority, right? Contrary to dedicated server, where there will be 3 instances of game state, one for each clients + the server itself that has the authority?

kindred widget
#

It's annoying that pawn's Restart doesn't have a BIE attatched to it in native code.

fading birch
#

@upbeat basin correct.

elder sage
#

would that work to reduce how much I cast for that reference?

upbeat basin
elder sage
#

so I went to print the array length of all of that widget created and see this

#

event receive draw hud is a tick function, it turns out

elder sage
#

what is the most direct path to a reference to the PlayerState of this character?

bitter oriole
#

Character should have a get player state function

elder sage
#

yes but it's actually turned into a generic actor reference it seems

bitter oriole
#

So cast it

elder sage
#

am I doing something wrong here? the event is only running on the server, likely because it's coming from the game mode, but I'm not sure how I should trigger an event for all players

elfin sail
#

can we get local player state in game state

#

directly

chrome bay
#

no, easiest way is to get the first local controller

elfin sail
#

hmm okay

#

thanks

#

UGameplayStatics::GetPlayerCharacter()

#

what it will return

#

my character or first character ?

#

any idea

empty axle
#

you know you can take a look into inners of that method right? Or at least look at the arguments or comments there

#

/** Returns the player character (NULL if the player pawn doesn't exist OR is not a character) at the specified player index */

chrome bay
#

Yeah just take a look

elfin sail
#

okay

#

i looked

#

sorry

fathom dust
#

anybody know offhand how I'd get my dedicated server to automatically submit crash reports?

bitter oriole
#

You can set up the built-in crash reporter to talk to your own server

#

Or you can replace the crash reporter with a custom one

fathom dust
#

if it's running on a server someplace I won't have the UI handy to press send

bitter oriole
#

There's an unattended setting in ini IIRC

fathom dust
#

oh nice, thank you - I'll take a look

#

Looks like for 4.26.2 in \Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp on line 218 and 228 it checks for -unattended and -crashreports command line flags, so I'll try launching with those

dark edge
lost dune
#

Can someone help? my behavior tree (on monsters) are not executed , there is nothing in the checklist.

#

I run the BT server side

#

The AI controller ( first image) is set in the Mob , (second image)

#

What i miss?

#

the mobs are placed in world

elder sage
#

However, I was running into an issue where the bpi I was messaging from my player state to my game mode would only update for the host player, and it doesn't seem to have replication options

dark edge
#

@lost dune have you placed a breakpoint On The run behavior tree node to check the everything is all good by the time that gets executed?

thin stratus
#

Cause that's an AIController and AIController don't exist on Clients

#

And if they do, the Client is usually not owing them.

lost dune
#

Now my BT is executed , but the decorating return always false

#

have aggro decorator is not tried

#

the screen stays like that

karmic mango
dull lance
lost dune
#

How to end a task? Im new wuth this

slim nebula
tropic snow
#

Why doesn't the client recognize the server mesh collision after the server plays a death animation and gets up (to resurrect).

#

the client still thinks the server is in the ground...

#

But the mesh (server) is standing up and bullets fly through him.

#

I shoot the ground where he laid and the server gets hurt. Is this like a root replication problem with montages?

#

I replicated the functions and model but no go.

winged badger
#

collisions are local

#

server having collision on something in no way means client has the same

#

thats on you

glad sedge
#

Via simulated proxy I'm doing a CubicInterp that's used to set Velocity

#

Without moving or adjusting anything, the pawn goes mental

#

And, eventually, results in a NAN on the actor transform

#

It's a custom CMC, so Velocity is really just a number.

#

I thought it might be a uninitialized variable but I can't see to find one

#

Anyone experience this before?

glad sedge
#

Ah, turns out the alpha I was using would go beyond 1 and cause issues. Clamping sorted it.

peak sentinel
#

Enum replication (enum class uint8) is considered as single uint8 right?

#

When value changed it will only send one byte

gray gust
#

Hi
Can I make dedicated server for handling matchmaking , leaderboard ... For unreal engine ?

empty axle
gray gust
#

And I wanna build this dedicated with golang

#

@empty axle
Is there any tutorial for connecting my own dedicated to unreal system ? Or it is simple like creating request from unreal to my server

empty axle
#

I doubt there is one. You need to engineer it by yourself

#

And yes you can use http requests to communicate with that server

bitter oriole
#

You said "matchmaking"

#

Unreal does no such thing

#

Unreal does multiplayer, which you will always use Unreal servers for

#

Matchmaking, leaderboards, are handled by platforms (Steam, etc)

#

Both are completely independent

gray gust
#

Oh because of the internet they just make players connecting to each other nothing else

#

I was confuse

#

@empty axle
@bitter oriole
So for connecting and overall in game like movement shooting etc we use unreal multiplayer system and for matchmaking , scoring ,... We use our system or pre built system ( and they use simple http request ) . Right ?

empty axle
#

yes

gray gust
#

Thanks β™₯️

bitter oriole
#

You can decide to roll your own if you want to for some reason, of course

gray gust
#

And one me question . Unreal multiplayer system is like server client ?

#

Or host user ?

bitter oriole
#

Yes

gray gust
#

Yes for server client ?

bitter oriole
#

Both

gray gust
#

Oh

#

So I decide to use which one to use ?

bitter oriole
#

Yes

gray gust
#

Thanks both of you

bronze torrent
#

Hello, im trying to make a simple fps game. I have got a line trace system that can detect when a target is hit, the health goes down but the UI stays the same. Is there an easy way of setting this up?

winged badger
#

try looking at the shooter game from epic

#

quite a few popular released games used to be shooter game when they first started

bronze torrent
#

like the shooter template?

bronze torrent
#

how would I set this up? @lucid sedge

winged badger
#

accessing UI from game code is pretty bad practice

#

any changes in your Health should go through SetHealth function, which will also broadcast an EventDispatcher OnHealthChanged with inputs of CurrentHealth, MaxHealth and if you need it, PReviousHealth

#

when your widget is instantiated, you inject a reference to the object its representing into it

#

simplest way, in case of overhead health bar is just accessing GetUserWidgetObject from WidgetComponent on BeginPlay, casting it to your Widget type, and setting self to a variable in Widget you create for that purpose

#

then OnConstruct in Widget, you bind to the Pawns? OnHealthChanged, and the Event handling it adjusts the UI

bronze torrent
#

Ill try this out and see where i get, thank you.

winged badger
#

you also do it when the reference to the Pawn is set

#

the binding

#

and you immediately re-intiialize the UI whenever its context is changed

#

if its not an overhead WidgetComponent, best call into your HUD and tell "i want the widget to this character created"

#

then in WIdget you create a reference to your Character, you make it InstanceEditable and ExposedOnSpawn

#

so HUD can inject the reference into the Widget at the time it instantiates it

#

also note, since this is multiplayer

#

Widgets are in no way replicated

#

so to update clients, you need to have Health variable run RepNotify, and broadcast new health value from OnRep_Health function

modern cipher
#

in my inventory if i want to play a sound after certain events such as using or destroying an item
I play the sound locally right after sending the server rpc to use or destroy the item
assuming that it will always succeed even tho it might fail for some reasons and the sound is still played

how do you guys do it?

bronze torrent
#

how do i do it the simpler way because im kinda struggling here (im quite new to game programming in general) @lucid sedge?

kindred widget
#

@lucid sedge It is bad, and there's a reason for it. Game Code doesn't change as much. UI can. If you cannot generally rip out your entire UI and replace it without affecting game code, you're doing it wrong.

kindred widget
#

Alternatively your gameplay logic could just call a delegate, and any widget you want to can bind to it. Then even your main widget can be replaced with a few clicks and no issues with it missing.

bronze torrent
#

I got a question, how would I go about replicating my wall run for multiplayer?

chrome bay
#

Requires a fairly deep integration with a custom character movement component to do it properly

#

Fairly sure UT has some limited wall-running implementation

cinder brook
#

Heys guys, Anyone knows a good alternative to SpatialOS ?
They seem to kill the service for small developers....

bronze torrent
chrome bay
#

Sprint is usually a bit easier because the CMC already has the concept of modifying max speed, and that's built into the rewind system

#

I'd look at the UT source to see how they implemented it

bronze torrent
#

where can i find this?

chrome bay
#

On Epic's Github

keen kraken
#

Hello! Is here the right place to ask about the ReplicationGraph?

chrome bay
#

Sure

keen kraken
#

Basically i watched the shooter game example code (nodes) and couldn't really figure out how you can tailor a node which serves (gathers) actors for a group of connections (players) so i want to be able to sync a specific actor only to a group of players and it should be always relevant (no spatial culling or similar) is there some example code how to achieve this? UShooterReplicationGraphNode_AlwaysRelevant_ForConnection::GatherActorListsForConnection is bit confusing because it seems to be called once? and process all viewers? right now i don't really understand how the nodes are called once for sync tick or sync tick for every active connection. any info about clarifying it more would be great.

chrome bay
#

The nodes themselves are either global or per-connection, what you can't do is create a node that deals with a group of connections. What you'd need to do is create a per-connection node, and add that actor to the list of actors in that node.

#

However from what I remember, if you have any spatial culling at all - it will always take affect over any nodes. Last I checked you couldn't have an actor that was spatially relevant for some players, and always relevant for others.

keen kraken
#

so i can modify GatherActorListsForConnection and add this actor every tick and it should work?

chrome bay
#

The actor is only routed once, the node keeps a reference to it

#

And the replication graph appends every actor from the nodes for that connection

keen kraken
chrome bay
#

Could work yeah

#

Note there could be more than one viewer per-connection - e.g. split-screen play in a networked game

keen kraken
#

yea i see multiple viewers are about split screen and vr and similar i guess?

chrome bay
#

Just split-screen

keen kraken
#

but in my cause it's not important ok

chrome bay
#

Alternatively, you would add a global graph node that handles adding that actor to different connections

#

e.g. we do something like that for actors which are only relevant to their matching team

keen kraken
#

is there a global node in shooter game? so i can check it out or there is no difference? on how you add the node to the system

#

only*

chrome bay
#

The spatial node is a global node IIRC

keen kraken
#

ok thank you!

#

now i do understand it a bit better <3

chrome bay
#

Or even UReplicationGraphNode_AlwaysRelevant - that's a global node for any always-relevant actor

bronze torrent
#

okay so i have found something very weird with print strings. I placed them at the end of my wall run to check which side of the wall they thought the character was on, no matter what the server always thinks that the character is on the right side

#

so the right wall works fine but the left one does not @chrome bay

chrome bay
#

Must be down to your implementation, can't really help there

quiet fjord
#

Guys I have a question, the player's rotations are replicated by default in the player or you have to do the rpc and replicate its variables?

twin juniper
#

can someone answer a few basic questions for a multiplayer beginner?

chrome bay
quiet fjord
#

then, it is not necessary to do anything

#

?

chrome bay
#

noop

quiet fjord
#

thanks for clarifying πŸ™‚

twin juniper
#

i dont know if any of you played a souls game where you can join a session in progress

#

up until a player decide to start a listening server, the game behave like a single player game?

chrome bay
#

Probably

#

Souls is P2P I believe

#

Or at least, doesn't use dedicated servers for players in each others' worlds

twin juniper
#

yeah i think is p2p

chrome bay
#

So yeah, in UE you would just have each player be a listen server from the start

#

Unless they've disabled online player for whatever reason

#

I don't think you can switch between listen/standalone on the fly without changing to a new UWorld, but never tried it

twin juniper
#

theres a way to stop a listening server i assume

#

if they disable the option, no connection allowed

#

can listen servers still joins other sessions, right?

chrome bay
#

Yeah but they become clients then

twin juniper
#

of course, as long as i can restore the server once the connections is interrupted i cant see the problem

#

am i missing something?

chrome bay
#

If you're hosting a game, you can tell all of your clients to go to another one. Servers joining other servers and bringing all of their players gets complicated though. Lots of ways to do it.

#

Usually you would use beacons to create reservations for e.g., that's quite complex in itself

#

Similar to party systems really

twin juniper
#

mmm

#

thank you jambax

upbeat basin
#

Is it possible to test steam oss with appid 480, with a cooked game? My presence is updated when I launch the game using command line, but when I cook the game and run the executable, it doesn't change anything

bitter oriole
#

Confirm that shift+tab opens the Steam overlay to diagnose

upbeat basin
#

Adding the steam_appid file fixed the problem, thanks

round yew
#

Hi. I have some code that needs to run even when no one is connected to my server (dedicated), but it doesn't seem to work, how can I fix that?

round yew
#

I run it on a EC2 aws instance, if that's the question?

#

And I use the exe properties to select the start map

sinful tree
round yew
#

In BeginPlay I init a looping timer calling a function every 2 minutes. That function makes a graphql request (If a condition is true).

round yew
#

Its the BeginPlay of the map's mode, The parent class is GameMode

round yew
#

Ok never mind, dumb error. I had a non-handled cast failure..

dull lance
#

<@&213101288538374145> cross posting by @lucid sedge

nimble parcelBOT
#

:triangular_flag_on_post: Ujjwal#1773 received strike 1. As a result, they were muted for 10 minutes.

finite portal
#

Well I'm back, for what now feels like, my daily question. haha. In my PlayerController, I'm keeping a reference of my CameraActor that the player will possess for the entirety of the game. I'm trying to RPC this to the client so it too has an accurate CameraActor reference. Here's how I'm doing so:

{
    Super::OnPossess(aPawn);

    if(HasAuthority())
    {        
        UE_LOG(LogTemp, Warning, TEXT("PC OP"));
        CameraReference = Cast<ADefaultCameraActor>(GetPawn());
        if(!CameraReference)
        {
            UE_LOG(LogTemp, Error, TEXT("CameraReference in PlayerController#OnPossess is nullptr"));
            return;
        }
        CameraReference->SetPlayerControllerReference(this);
        
        //Now replicate to client
        SetCameraReferenceClient(CameraReference);
    }
}```


```void AArcanumGenesisPlayerController::SetCameraReferenceClient_Implementation(ADefaultCameraActor* CameraActor)
{
    CameraReference = CameraActor;
    if(!CameraReference)
    {
        UE_LOG(LogTemp, Warning, TEXT("Set Cam Ref !CR"));
    }
    else
    {
        UE_LOG(LogTemp, Warning, TEXT("Set Cam Ref CR Good"));
    }
    CameraReference->SetPlayerControllerReferenceClient(this);
}```

Through my debug messages, I know that CameraReference in OnPossess() is not nullptr. However, when it arrives to the client in SetCameraReferenceClient(), it's a nullptr. Any ideas?
dark edge
#

@finite portal why is camera reference not just a replicated variable?

finite portal
dark edge
#
#

Try the OnRestart approach.

finite portal
finite portal
clever plinth
#

Maybe a dumb question but I have read some conflicting info on this: Do all members changed of a USTRUCT replicate simultaneously if they are modified simultaneously?

twin juniper
#

hello guys, i asked this before and i got a replt but im still confused, lets try again

#

im a complete beginner when it come to multiplayer but i do understand how networks work. im thinking about implementing a multiplayer like souls game, where every player has his own world and can become a server for other players to join

#

how could i go about implementing this? every player should start as a listening server? can i make them clients at runtime?

dark edge
twin juniper
#

but where is this information stored?

dark edge
#

What information?

twin juniper
#

whater you are a server or a client

dark edge
#

If you join a session or open an address, you are joining as a client.

twin juniper
#

so this stop the server since you are now a client or you have to handle it manually?

dark edge
#

It'll stop your local server, yes. Or rather, you will be loading a new map. You will have to save your local progress to disc

#

So yes, you need to have a hard load when joining. It's not going to be 100% seamless out of the box

twin juniper
#

theres no way around, i get that

dark edge
#

In our game we only have two hard loading screens, beginning of the game and when you join a session. But there's no reason to not have hard loads, we just decided against it for the aesthetics

twin juniper
#

since as i said, im a beginner to mp and still confused on how ue handle it

#

how do you debug this kind of stuff in the editor?

dark edge
#

If you're a beginner don't try doing anything fancy. You debug it just like anything else, but you will have to learn about sessions if you want to have some sort of friends and matchmaking setup

#

You can start using sessions without C++ in lan mode. You'll need to bust some code open to use steam

twin juniper
#

so i cant debug two listening servers in editor

#

the second one will always start as client

dark edge
#

Sure you can. Dig into the startup settings. Also don't start as listen, start as standalone, but have your first map load your gameplay map as listen.

#

Play in editor will be decent but you'll want to test as standalone, just right click the u project file and hit launch game.

twin juniper
#

thank you so much adriel

harsh lintel
#

if I do Open LEvel with Listen option, what does the listen option means?

twin juniper
dark edge
#

Listen = Player and host/server

twin juniper
#

yeah but how do you connect to it? the only way is using sessions?

harsh lintel
dark edge
twin juniper
#

whats the port

#

cant find nothing online πŸ˜…

fading birch
#

you don't need a port

dark edge
fading birch
#

just open 127.0.0.1

#

or open 127.0.0.1:12345

twin juniper
#

its probably too late to do this kind of stuff for me, i swear i tried that

#

its working, thank you guys

twin juniper
#

i dont think there is a boolean, you either keep track of it if you want to know from the instance that opened the level

#

or you know that if the server actually respond with something

fading birch
harsh lintel
fading birch
#

No

elder sage
#

Does unreal have support or integration for teams that I'm just unaware of? Or is there a starter guide in the 100+ page pdf?

eternal canyon
#

or do u mean more like source control?

elder sage
#

I mean is there a "team" system, before I go and try to figure one out the harder way

#

I don't know enough about the engine to know if it has this, but something that lumps actors in to easily target able groups would be great

eternal canyon
#

I dont think so

elder sage
#

So should I just do something in my gamemode where when someone logs in, it gets their player index and then puts them in a "team" array?

#

Also I'd need to figure out the best point to apply custom collision channels to each team, for line traces, and would also like to create some kind of color filter for the player

#

Although dynamic material instance sounds right for that

fading birch
#

just store the team value in the player state and assign it there.

#

and on your line traces, just check that.

#

i'd use an interface

mystic patio
#

Adding on, if you really need the trace to not be blocked by teammates, then you can set up a couple of custom collision object profiles, one for each team, so the trace goes through teammates. But only if truly needed.

#

And assign accordingly depending on which team they end up on

elder sage
#

Yes, I do want to be able to shoot through teammates. Should I just assign the collision profiles when they log in or something?

elder sage
mystic patio
fading birch
#

And just make a helper function to check if they're equal

elder sage
#

Good idea. All of the "team A?" bools in the tutorials I see just seem lazy

vivid seal
#

anyone ever done client predicted root motion outside of AbilityTasks? I'm not using GAS and I'm assuming AbilityTasks require GAS to work

elder sage
#

So in theory, would I be able to do something like assign each player a team solely for them in a free-for-all?

mystic patio
#

Sure why not! Two players would be able to hurt each other if their two team values are inequal. And in a free-for-all case, you wouldn't need multiple collision profiles, your traces wouldn't need to pass through anyone.

elder sage
#

How would the bit about collision profiles work if I were to also implement team modes, though?

#

Like, is having the local player be on one "team" profile and the rest on the other feasible while replicating the actors?

mystic patio
#

It might take some experimenting since it depends on who's doing the collision checking, clients or server or both. I suggest just getting started without worrying about shooting through teammates at first, worry about that later. Get it working all good except for the shooting-through part, then use the new information to inform how to proceed when you get there.

elder sage
#

Okay, I'll do that then

fair lantern
#

Does anyone know how to fix this? only does it on listen servers

severe axle
#

Hello guys. I'm confused a little about ActorComponent replication. I have a component, which is responsible for procedural animation based on the timeline. I set IsReplicated to true, but seems like component is not replicated at all. Do I need to replicate every function/variable in my ActorComponent class or what?

empty axle
#

It would be really bad if setting component to replicated would automatically replicate every property and method from it

violet sentinel
#

Do arrays keep order and nulls when replicating ?

#

having array of actors, each may have value or not but order is important

dark edge
severe axle
pure vigil
#

Attempting to use ServerTravel to transition from a lobby to the game. All players transition fine, but it seems some data does not persist. I am using the PlayerName in the PlayerState. I created my own PlayerState child and have a variable (enum) there to determine the player's role in the game (player, spectator, etc). When the travel completes, the name persists just fine but the role variable is lost. Is there anything I need to set for this variable to ensure it persists through a level transition?

#

(seamless travel is enabled on my gamemode)

#

Ah, figured it out. I had to override CopyProperties and manually set my variable to copy after the transition

lament minnow
#

i'm having a bit of a problem with same process testing of multiplayer session's. when I host the game in one window, and try to search for it in the other one, I get 0 search results. if i uncheck run in same process then i do find the other session as expected.

pure vigil
#

Yeah multiplayer sessions don't work great in PIE, I think unchecking that is the only way around it. And even with that unchecked I've noticed some inconsistencies. I generally end up running instances of the game manually, using a .bat file to execute it

"path to UnrealEditor.exe" "Path to uproject file" LevelName -game -log -NOSTEAM
lament minnow
#

ok, i wasn't sure if there might be an easy solution.

#

thanks

pure vigil
#

And if you need to run a dedicated server you can do

"Path to UnrealEditor.exe" "Path to uproject file" LevelName Port=7777 -server -game -log -NOSTEAM
jade verge
#

Hi there,
could anyone explain me what "Warning: SetReplicates called on non-initialized actor Default__SExplosiveBarrel. Directly setting bReplicates is the correct procedure for pre-init actors." is supposed to mean? I tried to google it, but there is no information about the warning

pure vigil
#

Are you calling SetReplicates in the constructor?

#

I think you should just use bReplicates = true in the constructor

elder sage
#

Does anyone know how to make good spawn point logic? At a minimum, I'd want to compare each player start's distance to each enemy, and then I'd like to check line of sight for each as well

gaunt umbra
#

Got a generally 'interesting' question about ServerEvents, Security & Server Overload/Performance

Maybe someone has experience or expertise in that sector.

Please take a look at the Screenshot for better visualization & understanding.

rapid bronze
#

Everything client side can be tampered with really iirc

#

What stops a client from it?

gaunt umbra
elder sage
#

So if the client wants to fire and tells the server that, the server checks how much ammo the client has and can prevent it if they have zero

rapid bronze
#

You can check if a call was made too many times on the server and if that happens kick the person out or close the exec on server

elder sage
#

Maybe delegate is the wrong word

rapid bronze
#

But that sounds like a generalized solution, doubt you would want a check like that everywhere

elder sage
#

So people can cheat engine their health as high as they want, but if the server is the one that checks their health and basically just says, "no, you're dead by now," the most the client can do is more or less pretend to be alive in their own game instance

#

In reality, someone can cheat and do whatever they want to their client as long as the server communicates what it needs to to the other clients

#

Obv kicking them is ideal, but it really doesn't matter if they effectively just un-replicate things for themselves

gaunt umbra
rapid bronze
#

I doubt honestly

gaunt umbra
#

so basically make database with calls - add +1 on every call - if exceed certain number disconnect - if high amount ban

or on the server itself, something like requests per minute allowed

thx for the talk

rapid bronze
#

Yeah, a Macro would be good for restricting to a max, in the end if you have heavy code behind it, better going through the Macro than always executing the heavy code if it happens

#

Never trust the Client with anything

elder sage
#

Really, if you want something competitive, the best you can do is make it dedicated and never trust the client with anything except their inputs

twin juniper
#

anybody knows how to stop a server after has been started?

grand stratus
#

hello guys, i created a multicast rpc function that is called inside a server rpc function i made too

#

the problem here that if iam the server that called the server rpc

#

the multicast function only perform task for server only

#

and cant see any other player to perform the tasks

#

but if i was a client who called the server rpc function the multicast function perform the task for only this client and server

#

so other client are left without anytasks performed for them

grand stratus
#

any help would be appreciated

sinful tree
grand stratus
#

i have an interact interface function that i call the server rpc function placed in player controller

#

and thee multicast function called inside the server rpc is also placed in player controller bp

sinful tree
#

Player Controller only exists on the single client and the server.

#

So a multicast RPC would only ever go to the one client.

grand stratus
#

i tried to call it inside a actor

#

in the level

#

and it do the same

#

but i dont think that is the problem

#

cause the server rpc is the one calling the multicast one

#

so iam on server side before calling the multicast one

sinful tree
#

When you're calling a multicast on a player controller, you're calling on that specific player controller, and since that specific player controller only exists on the server and the client owning it, it won't go through to other clients.

grand stratus
#

yeah i know that

#

but if iam in aa server rpc

#

in a server rpc

#

i have all player controllers

#

since iam the host

sinful tree
#

Right but if you're RPCing WITHIN a player controller you're referencing only a single player controller.

#

Doesn't matter if you're server or not.

grand stratus
#

so what can i do

#

where should i call it

sinful tree
#

If it's something all clients need to know, then a Multicast from Gamestate would usually be the place to go.

#

If it's about a specific player, playerstate

grand stratus
#

so should i put the multicast function only in game state

#

or both the server rpc and multicast rpc

#

i need to spawn system for all players

#

so all players can see the effect

#

so i think i will uyse game state ,right?

sinful tree
#

That sounds like you should be spawning a replicated actor.

#

Rather than using an RPC

grand stratus
#

let me try this

#

but how can i make the system replicated

#

its a niagra system

#

iam spawning it

sinful tree
#

What type of effect is this? Like is a player being hit by something, are they shooting something? What is happening that causes this effect to appear?

grand stratus
#

just this effect appear when a player press e

#

but this effect should be seen by all players

sinful tree
#

And all players could potentially press e and make this effect appear?

grand stratus
#

yes

#

but if a player pressed e

#

other cant press untill the effect ends

sinful tree
#

ok, so that for sure sounds like you want some gamestate control.

I assume all players will be using the same character BP?

grand stratus
#

u mean the pawn right?