#multiplayer

1 messages ยท Page 660 of 1

rough kestrel
#

I see so this would be the case for using epic or steam like services then?

kindred widget
#

Or any online subsystem. That was just an example. It just lets you easily identify the player's actors

thin stratus
#

You should do this inside of the Character, in the "EndPlay" function.

#

Because there can be multiple reasons for it to be destroyed, other than actually dying

mossy kindle
#

Never knew End play existed

#

Thanks a lot

thin stratus
#

If an Actor manages another Actors lifetime (spawns and destroys it) you should always make sure you destroy it when the outer actor gets removed

lusty sky
#

Does endplay get called when you put the player to ragdoll?

mossy kindle
#

Maybe not

#

I think it calls when you call Destroy actor on the character

#

Ahhhhhh

#

Multiplayer is hard

thin stratus
#

Cause if your character gets destroyed without going through death and ragdoll, it still needs to kill off the gun

mossy kindle
#

How do i keep the stats intact even after killing and respawning the player?

#

And the crosshair no longer spreads with player's velocity

kindred widget
#

@mossy kindle Multiplayer is very simple when you learn to separate your machines. When developing on a class, consider how it's events will run, and how they'll be used on each machine. For the most part this is just client versus server. For more advanced classes you'll start doing prediction with client which will cause differences between the owning client, other clients and the server.

mossy kindle
bold finch
#

Hi guys, a noob question here, currently I modified my spawn using Controller instead of using GameMode. For ChoosePlayerStart I override it to spawn the player to specific position when the game start, so the players can have a good bird eye view of the map. Despite my PlayerStart's rotation has a little pitch down but it seems like only Listen Server follows the rotation, and my clients is just look at straight forwards to 0,0,0. May I know how to match the rotation when spawning the character? It seems like it always facing where the previous camera facing atm. It happens during the match too, after I get killed, the camera will look at where you previously facing.

meager fable
#

I have a blueprint actor that is placed on the level and I want to call RPC's on it but I get cannot call server rpc because there is no owning connection. How do I set it? Setting the owner to servers player controller on begin play didn't help

chrome bay
#

Whoever is calling the RPC needs to be the owner, and the Server needs to set them as it

meager fable
#

so changing the owner any time a client interacts with the object?

bitter oriole
#

That won't work well because changing the owner needs to be done on the server

#

Which you need to RPC first so that it does

#

See the problem ?

meager fable
#

yup

bitter oriole
#

Interaction needs to go through pawn or player controller instead, and have that class handle it server side

meager fable
#

I get the idea

#

thanks

kindred widget
#

Is there any default implementation for detecting if a PlayerState on a Client belongs to the ListenServer host?

chrome bay
#

noop, but you can get the owner player controller and use that

pure mango
#

Variable replication delay I noticed is like half a second to like a second sometimes
Does this only happen in the editor? Is it an editor thing

bitter oriole
#

No, it can be 50ms, 100ms, 1s, 10s

#

Depends on network

pure mango
#

My assumption is the editor artifically makes it like 0.5s to 1s for development purposes, is that right?

bitter oriole
#

No, it doesn't

#

You can configure it do so though

pure mango
#

Hm.. I thought there's no way replication can be this long normally so I thought it was artificially like this for the editor
I guess replication is really long

bitter oriole
#

Depends how much data you're replicating

pure mango
#

Just a primitive variable

bitter oriole
#

I wouldn't test in PIE though, since one of the windows will be out of focus and run slower

#

Get two machines, sync the project there and work with that

pure mango
#

Hm, another workaround is using Multicast

bitter oriole
#

Nah

#

State should never be replicated with RPCs

#

Because if a player joins during the game, then they don't get the updated state

#

Use replication, deal with the latency in your game code, and test appropriately

pure mango
#

State should never be replicated with RPCs? That sounds important to understand
So I have:
PlayerState with CanJump (is replicated)
PlayerController with Server_Update_CanJump event
BP_Checkpoint, on overlap will call Server_Update_CanJump and update CanJump=true for the Pawn that touches it

#

This is fine, right?

bitter oriole
#

Anything that is state should always go through replication only

#

Anything that is events (as in, can be missed without breaking the game) should be RPC

#

Let's say you're firing an automatic gun:

  • you would have start fire and stop fire as reliable RPCs from the client (only way to go since replication is server to clients only)
  • you would have the "is firing" bool be a replicated bool
  • you would have hit impacts be unreliable multicast RPCs
pure mango
#

Just to clarify, RPCs are events like Server_ or Client_, right?

bitter oriole
#

Yes, UFUNCTIONs with Server, Client or Multicast in it

pure mango
#

When you say "always go through replication only", you mean it gets updated on the Server with RPC?

#

Wait, you said state should never be replicated with RPCs
So you mean state in PlayerState?

#

How else can you update state if not with Server_ RPCs?

thin stratus
#

You are mixing stuff up a bit

#

State Updates shouldn't happen via multicast or client rpcs, because new players won't get the call if they join later

#

For that you should use replicated variables or even OnRep variables to have a function connected to the change

#

If your client does something that should notify the server to change the state, you need a server RPC of course to notify the server

#

But most of the time that's only needed if it's about some input or UI event that the server doesn't know about

#

E.g. press fire to fire the weapon, but once the server knows you want to fire via an RPC, the server can do everything on its own

#

Up to dealing damage and updating a health variable

#

Which then replicates down to the clients

#

"State" here means everything that describe a state. Not necessarily the PlayerState. But health, ammo, bIsOpen, etc

#

Where an RPC is more for one time fire and forget events.

#

E.g. the explosion of a barrel

bitter oriole
pure mango
#

I see, yeah

#

Like if the client wants to update CanJump in their PlayerState, they'd use a RPC Server_ call to update that
The server will update their PlayerState, and CanJump will be replicated to everyone else

bitter oriole
#

Yeah

pure mango
#

But one thing about Multicast
Multicast from what I understand calls both Server and Client, so there's no delay for the client
So a client updating CanJump via RPC Multicast_ will update their local CanJump and the server's copy as well (which will be replicated)
So it's fine to use Multicast, right?

bitter oriole
#

No, you should call a server RPC and modify CanJump locally if you want to (preferably while handling the case where the server overrides that through replication)

kindred widget
#

@chrome bay Yeah. Problem is you can only do that on the server. Just made a replicated property for it. ๐Ÿคทโ€โ™‚๏ธ

bitter oriole
#

Typically you would store data for each RPC sent, locally ; and then when that variable replicates you would look into your requests and see if the server agreed to your change

#

"I setCanJump to true 60 frames ago, and to false 10 frames ago, server just replicated CanJump to true, but I should keep it to false"

#

Or you can only trust the client (hacks), or only the server (lag)

pure mango
#

Hmm.. you're saying.. modify the client's local CanJump in PlayerState directly, while sending the Server_ RPC

bitter oriole
#

I'm saying it depends a lot

pure mango
#

Is there anything wrong with Multicast?

bitter oriole
#

Yeah, it won't do anything in this case

#

Multicast called from a client does nothing

#

Well, "Runs on invoking client"

#

Multicast is only useful to have the server talk to every currently connected client

#

Any client-to-server RPC is Server

#

You can simply assume you have 4 methods of communications :

  • client to server : Server RPC
  • server to client(s) for state : replication
  • server to that one client that owns the actor : Client RPC
  • server to all clients : Multicast RPC
pure mango
#

I see, according to the diagram, Multicast runs on Server and Client if called from Server
But Multicast only runs on invoking client if called from the Client

bitter oriole
#

You can usually do 95% of your game with server RPCs + replication

pure mango
#

I see, but too bad about the ~0.5s delay though

bitter oriole
#

The delay isn't a replication issue, it's a bandwidth + performance issue

#

Like I said, if you test in PIE one of your windows has 1fps

pure mango
#

But yeah, maybe PIE might be causing it

#

Yeah, I'll find out how to test it with another machine

flint star
#

Hey is it possible to pool replicated actors somehow?

elfin sail
#

wdym ?

#

what you want to pool ?

flint star
#

projectiles with movement

elfin sail
#

no need to pool

#

engine already doing that

#

even though you are doing it manually still no issue but ll be extra work

thin stratus
#

The Engine does not pool Actors by default o.o

#

Spawning and Destroying them is indeed expensive

#

Just pool them on the Server and start/stop replication etc.
Or just turn them off properly.

vocal ridge
#

Hey, in case you haven't figured it out already, OnLogout outputs a controller ref, you'll have to cast to the controller blueprint that you are using to access that info.

green delta
#

working on the player states and game state... this is such a pita

meager fable
#

how do you simulate lag? tried net.pktlag=10000 and net pktlag = 10000 and neither work

bitter oriole
#

Both work

#

Put them in your ini file

#

[PacketSimulationSettings]
PktLag=100

meager fable
#

should they work in console?

bitter oriole
#

DefaultEngine.ini

#

No idea

meager fable
#

because for me they don't

#

and I'm 1000% certain someone told me a command that works in console once

bitter oriole
#

No idea about that, the ini file works though

meager fable
#

guess I'll go with .ini then, thanks

golden girder
#

how to convert struct to bytes to send in udp?
Struct::SerializeBin doesnt work

bitter oriole
#

Don't multipost your questions

grizzled stirrup
#

The commands should work instantly if so, even if not in the .ini

#

There are actually already a range of settings that have been exposed to test without even using commands

#

There are min and max latency settings available when looking at the full set of MP settings

fluid summit
#

Hi! anyone who used VaRest before? i'm having some troubles getting one of the fields from a json response (i may have more chances of getting a response in here)

crimson valve
#

Do "reliable" function calls guarantee order of execution, or only that they are eventually executed?

chrome bay
#

Order is garaunteed so long as they are within the same actor (if reliable)

crimson valve
#

Interesting detail. Same actor only...

#

Thanks

fluid summit
#

Okey i got where my problem is with VaRest, my setup works ok with Postman but not with UE4 and VaRest, i think the problem is with VaRest and LocalHost, anyone knows about this by any chance?

peak sentinel
#

type this exactly, it should work

#

though 10000 is extremely too much even for testing

#

I test with 250 or 500 depending on the action

kindred widget
#

Yeah. 350ish is semi bad overseas satellite networking. Most things above that are kind of out of the developer's hands. So if it's over 500, people just need better providers.

peak sentinel
#

For a fast-paced shooter game it should not even higher than 100 for example

#

Its totally okay to blame player for the lag if your netcode is not terrible ๐Ÿ˜„

modern cipher
peak sentinel
#

I doesnt set the packet loss

#

Afaik there isnt any console command for that

peak sentinel
green delta
#

I'm stuck at a part where my logic that determines the winner is in the game mode however this is inaccessible from the client side...
We play rock paper scissors.
You choose Rock -> choice recorded in the player controller and the player state
I choose Paper - > choice recorded in the player controller and the player state
Since only 1 player can use the game mode, how would I come about triggering the "determine winner" logic?
I looked into game state but frankly, I don't understand at all how to use it for this purpose.

#

I'm starting to wonder if I should just make a replicated actor that acts like a judge

sinful tree
#

After each player chooses their option and sends it to the server, in game mode loop through all the players and verify their choice has been made - if all choices have been made, determine who the winner is, then replicate something through game state to notify players that the game is over and who the winner was.

green delta
#

how would i send it to the server? switch and if server continue with game mode logic?

sinful tree
#

RPC

lusty sky
peak sentinel
#

Ah, thank you

sinful tree
#

Whatever event you're using where the player is choosing their option, you send that through a "Executes on Server" event on the player controller for example. Once you're on an execution path on the server, you can access game mode.

glossy ledge
#

Has anyone used dynamic navmesh on a dedicated server? I'm running into an issue where it works on stand alone or listen server but doesn't update on dedicated server

#

not much info out there unfortunately

fluid summit
#

Okey, i finally got the full setup working (VaRest + MySql + Local Server + C# WebApi + FireBaseAuth) to save/read from MySqlDatabase into Dedicated Server.
There's quite a few things that i didn't saw anywhere else, i'm gonna do a video quickly explaining the basic setup when i have more time later

green delta
#

willing to pay someone for replication help >.< this started out simple and turned into a monster, dm me

bold oxide
#

Hello, I'm having a problem with network replication on my GameState BP, I can't or don't know how to properly replicate from Server to Clients.
I am changing an Array Struct on my GameState through my Server's UserWidget, unfortunately that Array Struct isn't replicated (even tho the array var is set to replicated) to clients.

fading birch
green delta
#

it's not the theory i have trouble with, it's the execution

#

so far my widgets and player controllers speak with each others on each player's ends.
Then, the player controllers add that result in the player state. So now the result is fully visible to anyone.
Now how in the world do I get this to the server's game mode?
If I have authority, then get game mode, cast, get results, multicast winner.
If I don't have authority, I'm remote... what do i do?

green delta
#

what the heck owns the player state? can I get a reference to the player controller from it? The get player controller array from the game state is 0...

fading birch
#

you call the RPC

#

AController owns the player state. So your PlayerController does.

#

Controllers only exist on the owning client and the server

#

if you need values replicated between other clients you want to use the player state for that type of stuff.

#

@thin stratus your site is down again.

green delta
#

what does "you call the RPC" mean?!

fading birch
#

RPC = Remote Procedural Call

thin stratus
#

For fucks sake

#

I'll just move it to the company server next weekend or so

fading birch
#

๐Ÿ‘

thin stratus
#

It's some common shit with WordPress running out of resources on the droplet I think

green delta
# fading birch RPC = Remote Procedural Call

Again, I can read that stuff all day, weeks at a time and I will not tell me HOW to do it. It's nice in the sense that it explains what can and cannot be done but not how it can be done.
Based on it, I'd do an RPC from my player controller to the game mode? But that isn't visible to the client.

#

how about this

#

Widget -> PC A

???????

Widget -> PC B

#

what is the ???? step to make them talk to each other

lost inlet
#

oh god wordpress. there's a static gen plugin for it which might make things easier

green delta
#

seemingly using a chat-like logic doesn't require any player state or game state and yet still works

lost inlet
green delta
#

give me the page number

lost inlet
#

it tells you how to do an RPC

fading birch
#

it also tells you the relationship of the different classes

green delta
#

no it doesnt ๐Ÿคฃ

lost inlet
#

bad reading comprehension?

fading birch
#

literally page 12

green delta
#

from sswires

lost inlet
#

page 66

fading birch
#

and page 61

lost inlet
#

there's a table of contents

fading birch
#

use the table of contents

#

@lost inlet ayyy

green delta
#

where is the "how to make things talk to each other using RPC"?

lost inlet
#

though WithValidation is actually optional these days

green delta
#

because I don't see it

lost inlet
#

???

fading birch
#

bro

#

read

green delta
#

again, beautiful theory

fading birch
#

the

#

document

lost inlet
#

in this case you just call Server_PlaceBomb() like any other C++ function

fading birch
#

please

#

like, actually read it

#

try to understand it

#

and ask specific detailed questions about stuff

#

we're here to help you understand

#

and we're giving you the info to do so

green delta
#

i'm just gonna put up my offer for paid advice and leave it at that or try again later. I get the theory, I don't get the practice and I have no working examples to learn from.

fading birch
#

what exactly do you want to do?

green delta
#

2 player connect.
multiplayer is activated.
Player A (server) presses a button on his widget -> player state updated with variable
Player B (client) presses a button on his widget -> player state updated with variable

How and where do I make Player A aware of Player B's choice to update the widget to see that result and then how and where can I evaluate the choices to decide a winner.
I initially thought I could do it using the game mode but that isn't available for the client. So what now?
You mentioned RPCs. Where? Player controllers? State?

#

like, this is not a difficult set up either. It's not like I want to replicate a battle royale and such. I just want to press a button and tell the other guy about it.

violet sentinel
# green delta 2 player connect. multiplayer is activated. Player A (server) presses a button o...

Player A (server) presses a button on his widget [calls server RPC which executed instantly] -> [on server] player state updated with variable
replicated variable will be updated on clients
Player B (client) presses a button on his widget [calls server RPC] -> [on server] player state updated with variable
replicated variable will be updated on clients

since it is a widget then playercontroller
for example let PC have a RPC ServerPressButton(Variable ) that will set PlayerState->Variable = Variable
and it will be called from widget OnButtonClick = GetOwningPlayer()->ServerPressButton(1);

can use OnRep to handle property update
(exactly same in bp, just easier to write it in discord this way)

pure mango
# bitter oriole Look up the tables here : https://docs.unrealengine.com/4.26/en-US/InteractiveEx...

Here's something interesting I figured out thanks to your link.

  • Let's say if the player presses H, it will spawn a Checkpoint Actor.
  • It should spawn and show up on everyone's screen.
  • Any player should be able to press H and spawn it, both players on Server and Client(s)

According to the chart, I need to run Multicast RPC on the Server. However, if I press H with Multicast while on a Client, then it will only run on "invoking client" which is itself.
So this trick/hack here works:
H -> Run on Server -> Run on Multicast -> Spawn Checkpoint Actor (shows up for everyone)

#

Alternatively, you can use Run on Server + Replication:
H -> Run on Server -> Spawn Checkpoint Actor (only shows up on Server)

But then in the BP_Checkpoint:

  • Self: Replicates = true
  • All variables: Replication = Replicated

This will cause it to replicate from the Server to all Clients (shows up for everyone)

bitter oriole
#

The second approach is the correct one

violet sentinel
#

depends

bitter oriole
#

Well, yeah

#

In the first case all copies of the actor are fully independent

#

And new joiners won't see it

#

Maybe you want that ?

#

But I figure usually you don't

#

Second case, it's a single actor that's replicated, will show up for new joiners, and you can actually have all copies talk to eachother

#

Probably more logical most of the time

pure mango
#

I see, I understand

tight glen
#

Anyone else have a bug where you can't turn on or enable to ai debugger?

#

Weird only way to get it to show up was to use the console comman EnableGDT

#

command*

pale nimbus
fading birch
#

Jump has functionality which calls the CharacterMovementComponent

#

which ends up calling LaunchCharacter iirc

#

it's been awhile since i've looked at that code though.

fading birch
violet sentinel
#

actors doesn't seem to replicate properly, i don't see host in client screen

pale nimbus
violet sentinel
#

start reviewing everything starting from replication params in pawns

fading birch
#

^

violet sentinel
#

after that spawning logic
after that client movement input rpc/replication

fading birch
#

gif was having issues loading for me also

#

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

#

I would check the function you're calling. If you're, for example, wanting the character to crouch, that's replicated in the character movement component. Something like sliding however, you'll need to manually implement all the replication steps for that as well as the integration into the CMC

pale nimbus
fading birch
#

Yes.

#

The CMC is quite complicated. Like, difficult to explain over discord complicated.

#

I would suggest reading through it. Look at stuff like the movement mode, enums, etc.

#

to get an idea of how it all works.

#

There's probably a youtube video or something that explains it.

#

nice!

#

much better than what I had xD

#

i'm 100% self taught

#

and just read through this discord and glean info all the time

pale nimbus
fading birch
#

that sounds like stuff isn't replicated then.

#

you're using characters?

violet sentinel
#

was downloading template project meanwhile

fading birch
#

in regards to characters at least.

pale nimbus
#

Is the top down template, and i didn't change the movement at all.

#

I basically tried to enable every "replicate..." Stuff i could find.

violet sentinel
#

if he didn't change the pawn blueprints from template to support multiplayer he would need to do that

#

since it is getplayercontroller(0) everywhere

#

๐Ÿ˜„

peak sentinel
#

AI controller and pathfollowingcomponent never runs/spawns on client if a a pawn/controller set to replicated, right?

pale nimbus
violet sentinel
#

yeah, ai always on authority only

fading birch
peak sentinel
#

I dont want to update pawn transform each tick so I thought maybe I can just send clients the pathfinding data and simulate movement but I cant bypass the AI only on authority firewall

pale nimbus
peak sentinel
peak sentinel
pale nimbus
#

Sorry, really getting confused

violet sentinel
pale nimbus
pale nimbus
violet sentinel
# pale nimbus That should be the default or am I wrong?

yeah, but that would not work in mp. you have to somehow send to server your intent to move
Controller part: https://blueprintue.com/blueprint/_n2mq804/ added rpc and a replicated variable (simply Replicated), converted function to event to be easier
Character part: https://blueprintue.com/blueprint/o3a1nl73/ added rotation and cursor sync between clients
here i replaced call of SimpleMoveToLocation with sending ServerMoveTo RPC (Server, Unreliable) and now they move

fluid summit
#

Hi! question about god practices.

I'm using VaRest to make http calls to my PhpServer through a C# webapi and connect with MySql on my dedicated server.
The question is, it's okey to let the client make the calls? or it always should be the server (run on server or run owning client) on the one making this ones too?.

fading birch
#

you should handle that authentication on your backend.

violet sentinel
#

depends. if it is internal data then dedicated server to backend. if it is a public client data then client to backend with auth

fading birch
#

It's ok for the client to make calls, but the game server should be the only one saving anything that would touch other players.

fluid summit
#

So client making calls is ok, but the values that i get from those calls should always be assigned using the server (and from there to the client)?

#

that makes sense

#

isn't it dangerous to expose the api calls to the client?

violet sentinel
#

you must have authentification

#

plus you still use proxy and not let clients directly interact with backend servers

lost inlet
#

uh what's that setup?

fluid summit
#

yeah, but i'm not sure how much data can someone scrap from a client version

lost inlet
#

php through C# web API, what does that even mean?

fluid summit
violet sentinel
fluid summit
lost inlet
#

is it a PHP or C# backend? ๐Ÿค”

fluid summit
#

Also firebase auth for user authentication, but that's just one call with VaRest to the firebase apis

violet sentinel
#

i guess he is using only database from mamp package lol

fading birch
#

i use a spring boot java application for my interface. I have only 2 public end points. Everything else is wrapped in a stupid level of security. My REST Api handles all of the calls to my MySQL database. Sounds like you're going for a similar approach there.

lost inlet
fluid summit
lost inlet
#

uh

fluid summit
#

i could be (most likely) wrong

#

jjaj

lost inlet
#

so is postgres

violet sentinel
lost inlet
#

and it's not owned by someone as bad as oracle

fluid summit
#

i'm okey with both options, but i don't want to change them later and my knowledge on that area is limited

lost inlet
#

HttpRequest -> web server -> database server, never skip the middle part

fading birch
fluid summit
#

yeah, that is for sure, i can't go to the database without the webserver, not sure about the client or the server making the calls

lost inlet
#

[thinking about all those MySqL CoNNEcToR plugins on the marketplace]

#

...which probably have GPL violations

fading birch
#

When a client connects to the server, the server then makes those calls on the client's behalf

#

and the client has his token removed.

#

until the client disconnects from the server, then they get their token back.

fluid summit
#

i'm not even using tokens for the webapi, i need to up the security quite a bit

smoky wing
lost inlet
#

relational is used a lot, unless you're some node.js bro

fading birch
#

I've used postgres before, I just prefer MySQL

lost inlet
#

"mysqli" isn't a RDBMS, it's a client library for PHP

fading birch
#

I did consider using DynamoDB since we're using AWS anyways.

fluid summit
#

i looked into the nosql vs relational database and for my case relation was the best, but depending on the type of game you want, you could benefit a lot more fore something like mongo

lost inlet
#

see the magic of the JSON column type for postgres

fading birch
#

mongo may suit your needs better.

fluid summit
fading birch
#

i haven't found the cognito or RDB prices to be too bad.

smoky wing
lost inlet
#

it's still just a client library, mariadb is the common mysql fork that you might be thinking of

smoky wing
lost inlet
#

buzzwords

smoky wing
fluid summit
fading birch
#

ah yeah

#

the free tier is pretty usable

#

AWS does get pretty damn pricey though.

fluid summit
#

are you using ec2 for the vm too? i'm doing a local setup with Hyper-V from windows

#

๐Ÿ€

smoky wing
#

just be careful of the free tier they can end fast. some people mentioned they get billed after 3 days

lost inlet
#

we use ECS for API deployments since it's a bit easier than managing VMs

fluid summit
smoky wing
#

ok i will keep the ip issue in my mind

#

i hope it's the only issue. i only run server locally for now

#

there is some someone mentioned this also :
You can apply for AWS Proof of Concept and receive credit of USD 300, and AWS Activate Founder of USD 1000 + Developer Support plan USD 350 if you are a startup. Espescially the proof of concept program, it's not hard to receive in my experience

#

i didn't tried them yet

fluid summit
#

You also have a program like that with epic services for grants, i think they are way more stricts with the requirements.

#

i may try to apply in the future when i have a working prototype, maybe i can get a few bucks for equipment and assets

smoky wing
#

yea i'll try also

#

BTW why u use pure Backend instead of ready ones

fluid summit
#

what do you mean with ready ones?

lost inlet
#

playfab i imagine

fluid summit
#

every single one is really costfull, with this setup i can get a game working for like 100players on a dedicated server with a MSI pc from home

smoky wing
#

yea

lost inlet
#

there are definitely benefits (and drawbacks) to rolling your own stuff

fluid summit
smoky wing
#

ok, i got it

#

isn't amazon gamelift also provide backend support

fluid summit
#

yeah they do, but it's mainly for a "instance based" setup with a listen client, not soo much for a dedicated server

#

at least that's the impression that i got after searching the tools they provide

#

i think it's the same for epic online services

fossil spoke
#

GameLift is not for Listen Clients...

#

GameLift is for deploying Dedicated Server instances.

smoky wing
#

they all for dedicated servers

fluid summit
#

oh maybe i got it wrong with the terms, i'm kind of new to multiplayer

smoky wing
#

searching in export data in EOS "EAS" i feel like they need to update it .. but it manages billions of users as they mentioned

peak sentinel
#

Anyone knows whats the size of pointers on RPCs?

#

I know Epic is using some kind of network ID (GUIDs?) instead of pointers but I dont know their size / compression methods

#

Hmm, found it

#

Nice

lunar portal
#

lol

elder sable
#

Is it normal to have 3 calls to a function when using prediction ? 1 server side, 1 client side (predicted) and 1 from server replication ?

eternal canyon
#

depends on what ur doing

lost inlet
#

When using prediction? As in the network prediction plugin or GAS?

elder sable
#

I want to make my pawn invisible from an ability with GAS

#

But i'm not sure how to do it correctly with HasAuthorityOrPredictionKey

rich sinew
lost inlet
#

it's experimental, that's why

fading birch
#

so is GAS technically ๐Ÿ˜›

elder sable
#

So 3 calls looks fine ?

fading birch
#

as long as each serves a purpose, yes

elder sable
#

Well i'm not sure that's why i ask :p

magic solstice
#

I'm attempting to cobble together a multiplayer game for the jam, however, I've run into a number of replication errors.
One of the most concerning being that players on the client side seem to be stuck in 1 location, almost like they're trapped in the capsule component?
Also players on the server can't see any animations or anything like that happening on the client side.

Would anyone know where to begin to look for those errors? (Bit new to network programming in general. Also everything is done in Blueprints, if that helps.)

karmic briar
#

basicly a new unified prediction system to solve both

peak sentinel
magic solstice
#

With a little bit of poking around, it would seem that my issue is on my actual character pawn class (which is like the Third Person class, but with some added features and what not).

#

It's weird, like I can jump around, crouch, and shoot no problem. But whenever I try to move in any given direction, it's essentially keeping me in 1 spot.

elder sable
magic solstice
#

Okay, at least for the movement, I seem to have found what my error is
Because I have multiple movement types (crouching, running, etc), I'm running a lerp on my walk speed and character movement walk speed on my Event Tick. So for replication, something isn't happening.

#

I'm gonna play with this for a few, but I still don't know why animations aren't being replicated on the server but work just fine on the client

pale nimbus
magic solstice
#

Ayyy I fixed it
"Is locally owned" wasn't being called
And it would seem now that I'm able to move, I see 1 other error with my respawns

So I still can't teleport (although that might just be cause I wrote it wrong), however, I can move. It's just that the movement only seems to be taking the capsule component as opposed to the entire character and its various children components.

rich sinew
#

Hi there, I am working on a game demo like Smash Bro, where I want to predictively knock back other players, but seems I cant predictively move SimulatedProxy(other players), any idea about that?

thin stratus
#

I've wrestled with the CMC a lot in the past, but I also did not really find a solution for this.

#

Most it can do is predicting autonomous clients. Simulated Clients don't even run the same function paths and often lack information about what is going on which then needs to be replicated separately.

#

Maybe with the newish prediction plugin, but not sure about the state and capabilities

rich sinew
thin stratus
#

It does

warped sundial
#

Hey everyone. I've encountered a problem with "BeginPlay" event not getting triggered in blueprints on custom player controller. Functionality attached to it works just fine. And googling didn't reveal much besides a possible cause of overriding "BeginPlay" in c++ without calling the super function (I don't have the event overridden). I have a suspicion that I missed some kind of vital information regarding player controller performance on client side. So what could cause the problem or what's the alternative to the event on client's player controller?

violet sentinel
#

always must call super (since blueprint event is invoked from it and other things)

warped sundial
woven sinew
#

Anyone also using Steam's playtest feature can't find game servers in-game ?

twin juniper
#

@chrome bay after some digging i realised that actors have a per connection net cull setting (although in the current repgraph this just inherits from global net cull settings for that actor), so with a bit of fiddling i can now do a per connection (or any other logic although obviously considerations re performance) to hook into the existing repgraph system and all the good 2d grid stuff

shut plaza
woven sinew
#

I mean Steam Playtest with another app ID, server browser works fine with normal app id

fluid summit
#

Hi! one question about where to save player data so it doesn't get lost between levels.

What would be the best place to save a player's ID? (the id is used to load the data on multiple places from a MySql database and it's unique to each player)

I'm looking into gameinstance, but it seems that the client game instance and the server game instance don't communicate with each other, so wouldn't that be a security risk?.

If so, what would be the best place to put that variable so that i can set it on the server and than replicate it to the client.

fading birch
#

You could store it in the server's game instance and then give it to the client's controller or playerstate.

#

probably controller so other players don't have it replicated to them, unless you specify owner only on the replication

fluid summit
#

I just tried to store it on the game instance of the player using a custom Method that executed on server and the gameinstance variables replicated, and it seems to work okey. (Each client gets their own id after login)
am i missing something?

#

(From the UI widget, i'm calling this method of GameInstance after doing the call to my loginApi)

thin stratus
#

GameInstance doesn't support networking

#

No RPCs, no Replicated Variables

fluid summit
#

but i'm seeing the variables updated on each client game instance correctly, what i'm missing in there?.

thin stratus
#

Idk but it's 100% not replication

#

If you want to persist data between Level Changes for your Clients while they are on the Server, you use the PlayerState or PlayerController

#

And you make sure your GameMode has SeamlessTravel enabled

#

Then you can use CopyProperties in the PlayerState and or OnSwapPlayerControllers in the GameMode to move data between them

fluid summit
#

yeah, i'm setting that one up, but i gave it a try to the gameinstance and i don't understand why they are getting updated on the clients

modern cipher
#

hmm break point on rpc never hits

thin stratus
#

You are probably calling it on everyone or so

#

But GameInstance is not replicated. Don't create RPCs and replicated Variables on them. It's redundant

fluid summit
#

oka, i'm gonna go with the playerController Approach and check later what's happening with this

fluid summit
thin stratus
#

Yes but then you'd need to know which direction yo ugo so you can cast the controllers accordingly

#

It's better to have a parent class for the two controllers that has the data that both share

fluid summit
#

that makes sense, thanks

bright kraken
#

is it an expected behaviour for the contents of a replicated TArray to arrive in wrong order?
eg:
server is 0 1 2 3
client is 3 1 0 2

pale nimbus
thin stratus
#

Unless we are talking about replicated actors, they might just not be valid yet when the array replicates

bright kraken
thin stratus
#

The order is probably correct

#

But the client can't resolve the id

bright kraken
#

If the client can't resolve the id, wouldn't it be null instead?

thin stratus
#

Yeah

#

I don't think it should get you the wrong order

#

That said, array OnReps should still call "again" when everything is available iirc

bright kraken
#

yep it does call again. though even after everything is replicated, the order is still incorrect, which is interesting.

pale nimbus
# violet sentinel

what you are showing is inside the normal Graph or inside the function that normaly contains the move to location?

violet sentinel
#

normal graph

pale nimbus
#

Ok now i get it

elder sable
#

How should i do to spawn actors server side and have a reference on the client side actors ?

violet sentinel
#

i don't think you can "link" server actor with client actor manually

elder sable
#

Yep i know they will be spawned, but i would like to store refs on the spawed actor client side, there is no way to do something like that ?

fluid summit
#

Hi! i'm having some troubles with seamless map travel.
I'm trying to carry some playerController Values when travelling, i'm using the following.

#

all my maps use the same GameMode, all player controller have the same base class.
Before changing maps, i edit the variables on the playerController and they are edited ok (i can do a simple print = controllervariable and it's the correct Id)

#

i do have seamless travel enabled on the GameMode

#

and i'm using "Event OnSwapPlayerControllers" on GameMode to carry the values, but this one is never triggered (i put a print and it never happens)
Transition map is setup

#

Does anyone have any idea what it may be?

#

Just in case, this is what i'm doing on the game mode.

#

(i tried without the custom event, it's the same)

meager spade
#

Controllers, GameMode, GameState, PlayerState etc gets destroyed

#

when travelling.

#

@fluid summit

#

if you want to carry stuff over, best to use either the GameInstance (if local), or PlayerState and override CopyProperties to copy what is needed to the new playerstate.

ebon plume
#

Working on an FPS controller and need to get some pointers on best practices.

Should I attach all weapons at runtime and hide/unhide them upon pickup/interact

or...

Use attatch to component ?

What do most games do in terms of managing this in BR / multiplayer games where you can pickup and drop weapons ?

fading birch
#

Generally you have an inventory on the player. When a player swaps to that item in their inventory, that's when you display/hide it.
You remove the item from the inventory when they drop the item, and add it when they pick it up.

fluid summit
# meager spade when travelling.

i think it should work with playerController Too (if using that event) but i can't get to trigger the event, i'm gonna give up and try with playerState

fading birch
#

the action RPG example has a decent setup for an inventory you can look at as an example.

#

and you're using C++

#

if you're using blueprint, there's quite a number of youtube vids that cover it.

ebon plume
#

c++

fading birch
#

i would use the RPG sample then.

ebon plume
#

currently i am just attaching to comp and using a bunch of casting methods and i feel this isnt a good setup for what im doing

#

Okay thanks. Ill take a look

fading birch
#

the RPG sample uses data assets

#

which if you're not experienced with those, it'll be a bit of an information overload at first.

#

but will help in the long run.

tardy umbra
#

Could anyone enlighten me on why a client's server RPC call would not appear to make any changes to the game even though I am certain that the functions are called on the server? I also know that when a listen server uses the same function it succeeds in making changes to the game that the server and client see

fluid summit
#

Okey, for some reason all my clients are servers.
(Upper left text server = has authority)

#

Okey this may be related

#

[2021.09.02-01.00.31:075][ 58]LogOnlineSession: Warning: OSS: No game present to join for session (GameSession)

#

they are not even running on the same server

fading birch
#

did you select listen server in the dropdown when beginning play?

fluid summit
#

i tried with both, listen and as client (on editor and stand Alone)

fading birch
#

as listen would definitely do what you want.

#

client starts a dedicated server for you

#

listen makes the first client the host.

#

and auto connects the 2nd client

fluid summit
#

yeah, i don't think in this case is something related to that

fading birch
#

[2021.09.02-01.00.31:075][ 58]LogOnlineSession: Warning: OSS: No game present to join for session (GameSession) means nothing in this case.

limber gyro
#

where are u calling hasAuthority? some one correct me if i am wrong but having authority does not mean u are the server

fading birch
#

yes it does

#

xD

#

that's how authority works

fluid summit
#

on HUD - > PlayerController (0) -> Has Authority

#

i think it may be related to how i'm handling the maps.
I start with a "login map" and after login, they are moved into "City map"
The server default is citymap.

fading birch
#

HasAuthority returns GetLocalRole() == ROLE_Authority

fluid summit
#

i think i'm losing the connection when changin map

fading birch
#

try starting it directly in your city map

#

are you using seamless travel?

fluid summit
#

i'm trying, but i'm not sure if it's working

#

if i start on CityMap, it works okey.

fading birch
#

seamless travel works fine in PIE

#

and your host will bring along any connected clients

#

then there's an issue when traveling from your login map to your city map

fluid summit
#

this is my travel, all before this is just api calls and HUD oriented.

fading birch
#

open level is a hard travel iirc

fluid summit
#

Both Maps use a diferent GameMode, but both have seamless travel checked, also i have a transition map (blank map)

fluid summit
fading birch
#

if I recall correctly

#

it's a shorthand way of saying, I'm not sure if that's entirely true, but I vaguely recall it is.

fluid summit
#

i tried executing "servertravel" as a comand and the name of the map, but nothing happens.

fading birch
#

oh

#

click the drop down arrow

#

in Open Level

#

make sure Absolute isn't checked

fluid summit
#

let's see

#

i doesn't change the map at all if i uncheck it

fading birch
#

do you have a transition map setup in your project settings?

#

actually hold up

fluid summit
#

yeah, it's a blank map

fading birch
#

why do you need to test a client travel for both from the login screen?

fluid summit
#

with a gamemode that has seamless activate

#

i'm not sure i understand the question

fading birch
#

why are you trying to test this from your login map?

#

that serves no actual purpose

#

your clients will never be connected to another player at that point

fluid summit
#

well, you need to login First and than move to the other map

fading birch
#

they haven't logged in yet

fluid summit
#

i'm trying to carry some values after login (IdToken) but while trying to do so, i realized that they are no even on the same server

fading birch
#

You can't really do it that way.

#

You need something like a menu map

#

in order to test your full workflow, you'll need to test using standalone with 2 clients.

#

Have 1 client host a game

#

and then you can connect to that map with open 127.0.0.1 in your console.

fluid summit
#

if i package the client/server and run them separatedly, that would be the same?

#

i'm trying to test it as if were end user

fading birch
#

you don't package a server when you're using them as a listen server

#

and I understand that

fluid summit
#

oh, this is a dedicated server setup

#

sorry i didn't mention

fading birch
#

oh

#

that's completely different

#

ok, so what you can do

#

is launch a dedicated server outside of the editor

#

you just need to launch the uproject with -server -log

#

the -log is important otherwise you need to force close it in task manager when you're done.

#

-log just lets you close the log window

#

once you have both clients in your city map, just type open 127.0.0.1 in both clients and they'll connect to the server

#

you should be able to do that in PIE

fluid summit
#

i'll try, but let me ask you something first, maybe the entire way i'm structuring this is wrong.

#

I want a login Map so that you can login user and password
after that, transition to the game map

fading birch
#

usually there's a menu between those.

fluid summit
#

i'm not sure if i even need to change maps in here, maybe i can just put the login HUD on the same map and hide it

#

what do you mean by menu, a hud?

rocky kestrel
#

What I'm doing wrong ๐Ÿ˜ฆ

fading birch
#

menu player controller

#

menu game mode

#

whole 9 yards

#

you can then have your menu connect to the game server for you.

fading birch
fluid summit
#

hmm, i'm gonna investigate the concept of menu on ue4

tardy umbra
#

Could anyone enlighten me on why a client's server RPC call would not appear to make any changes to the game even though I am certain that the functions are called on the server? I also know that when a listen server uses the same function it succeeds in making changes to both the game that the server and client see. Is there anything strange about playercontrollers that I need to consider? All of my networking code is in C++ right now

rocky kestrel
fading birch
fading birch
rocky kestrel
#

In Third person character I call input event -> then call it on sword(gun base) class(attached to player hand)

fading birch
#

yes I see that

rocky kestrel
#

Then In gun base class

fluid summit
rocky kestrel
#

hmm

fading birch
#

Steam or EOS would be fine.

rocky kestrel
#

gun base:

#

I'm really beginner with multiplayer stuff ๐Ÿ˜„

fading birch
#

oh

#

check Replicates

fluid summit
# fading birch Steam or EOS would be fine.

isn't that for games like fortnite? i'm trying to do something like a persistnat world (mmoprg) but without live replication on the actors, they shared data with a database.

fading birch
#

I would strongly advise against building an MMO in unreal

#

especially if you're working solo

#

but in that case, if you do decide to go down that path, you'll need to implement an outside of the engine system for getting servers for players. Then integrate that into your project and handle your connection there.

rocky kestrel
#

Thank you!

fading birch
#

that fix it?

fluid summit
#

i want no live replication, everything is updated with calls to the database, but if it's not without a server, how do i make the calls with a secure entity? (ie, if the client is the server, i'm screwed)
would something like that work with steam or eos?

fading birch
#

no...you'll need to be connected to a server.

#

If you want an offline game, then that's something differently entirely

#

never trust the client

fluid summit
#

basically, i'm trying to copy art of conquest

sinful tree
fluid summit
#

i'm okey with moving the scope, it's just for learning, but i want to be online, even if it's just a running squeleton

fluid summit
sinful tree
#

And to get something like that working, you'd want to probably make a call to a web API from the client which returns the server IP address of the login server for them.

tardy umbra
#

@fading birch Here are screenshots of the relevant code

fluid summit
#

if i start It on the same map that the server (citymap) it works fine, players are on the same map.
I'm not sure why i'm lossing it when changing maps.

#

the C# webapi and the Firebase Auth work perfect, i can access the database at any point on both maps, but i lose the connection to the server when opening a new map

fading birch
#

@tardy umbraa few things

#
  1. I hate your code formatting ๐Ÿ˜›
fluid summit
#

i think i'm gonna look a bit more into sessions with seam/eos and if not, just stay with starting up on the same map

fading birch
#
  1. You don't need to check authority in a server function
sinful tree
fading birch
#
  1. you have a redundant call to Server_MoveVertical if it's not authority. The client should be calling it there.
fluid summit
#

the server should be doing the calls

fading birch
#
  1. You need a function that's marked as c UFUNCTION(Client, Reliable) void ClientMoveVertical(float VerticalInput);
#

that looks like your missing step

tardy umbra
#

Sorry, a lot of those checks were for me to verify all of the functions are working as I expected. For 4) I have that already, but when called, it seems to just create an out of sync moving client with no intervention from the server

#

I plan on removing most of the checks after fixing the issue

#

When I call both Client_MoveVertical and Server_MoveVertical from the client there is still no change on the listen server's instance of the game

#

But I know that Server_MoveVertical is going through all of the functions I listed every time it's called

tardy umbra
fading birch
#

are you using a character?

#

what are you trying to accomplish?

tardy umbra
#

I'm using a Pawn. I'm simply trying to allow a client's PlayerController to move the pawn using the Server RPC

fading birch
#

I would use a pawn movement component then

#

or just use a character instead

#

and use the character movement component

#

as replication is handled for that

tardy umbra
#

Ah, does floating movement comp not have replication sufficiently built in?

fading birch
#

nope

tardy umbra
#

Jeeze, not sure how I missed that

fading birch
#

yes

#

well generally speaking

#

if it's public you can technically give it input from another class

#

I wouldn't go that route.

#

I would have a base weapon class

#

an actor is fine

fluid summit
#

I did a similar setup for a single player, it worked okey. Im not sure on multi

fading birch
#

but just have the player's controller fire the weapon

#

and just call the fire function on the weapon.

#

You can handle all of that via the weapon.

#

Add an alternate fire etc

#

you can always refactor down the road.

#

just mark the fire function as virtual

#

and override your logic

#

for charge type weapons, you can just check that the input is still pressed and run a timer

#

ie:

Fire()
{
  GetWorldTimerManager().SetTimer(YourTimerHandle, this, &AWeapon::OnChargeFinished, ChargeDelay, false);
}

OnChargeFinished()
{
  //Firing My Laser Beam!
}

StopFire()
{
  GetWorldTimerManager().ClearTimer(YourTimerHandle);
}```
#

actual 1s

#

better implementation

#

it can be yes.

#

:D

#

Yeah I would.

tardy umbra
#

Thanks for the help Djriff, not relying on floating movement solved my issue

fading birch
#

an excellent day for the developers

#

which owner are you speaking of?

#

attaching a component does not do that

#

you'll need to call Weapon->SetOwner(this); from your character.

#

well you're not exactly attaching it as a component

#

you're attaching it as an actor

#

via Weapon->AttachTo(this)

#

oddly enough

#

it checks if the actor it's attaching to is the owner

#

but doesn't actually set it

#

so just set the owner to your character when you equip it

#

and the null the owner when you unequip it

#

ez day

#

no, it just makes it so it had no owner.

#

the actor and the server will both have a copy of it.

#

replication just replicates variables across all instances of said actor

#

erm no

#

that would be the role

#

that determines who "owns" that particular actor

#

generally yes, authority is the server

#

ownership applies to the actor that owns the object.

#

for example, the owner of APlayerState is AController

#

no, the owner of an actor is either a nullptr

#

or another actor

#

it has nothing to do with networking

#

an owner for an object

#

it's useful for stuff like weapons, player states, etc

thin stratus
#

I'm not sure I can agree with what is explained about the Owner

#

Owner and Ownership is a huge part of Networking. So not sure why it's stated to have nothing to do with networking PE_PandaThink

fading birch
#

perhaps I misunderstood the engine code then?

#

I was referencing that when speaking about it.

#

when an owner is set does the actor then inherit the network role of w/e possessed it?

thin stratus
#

It's mostly used to define what connection owns the actor.

#

Very important if you want to execute Client and Server RPCs

fading birch
#

ah makes sense

#

my apologies for the misinfo

thin stratus
#

Server is also not always Authority

#

A local only actor can report true for having Authority on clients

fading birch
#

i did say generally

#

that's the one case i'm aware of it's not true

thin stratus
#

And for the role stuff, iirc only characters really use the Autonomous Role. Everything else, even if owned by a connection, should be simulated proxy and whatever the other one was. But not sure on this one. I barely use the roles.

thin stratus
fading birch
#

๐Ÿ‘

thin stratus
#

@tulip ferry

#

Feel free to scroll up and read a bit. And then ask questions if something is unclear

peak sentinel
#

Means something went wrong, either owner has quit the game or there is a mistake in the code

#

Usually you cancel what you're doing at that point

#

if(GetOwner() == false)
{
return;
}

eternal canyon
#

saves time when typing

thin stratus
#

Also it should be GetOwner() == nullptr

#

Mostly nothing. A null owner would still allow Multicast RPC iirc. It doesn't mean it's owned by the Server but in terms of RPCs it should be the same behavior. Owned by the Server, in case of a ListenServer, should mostly be handled to acknowledge that the server-client is the owner of it instead of no one or a nother client

#

When not talking about net connections then it's still useful to use the owner to build up a hierarchy of what spawned what and what manages what

#

E.g. an AI doesn't really care about Owners for RPCs, yet it makes sense to utilize an owner for Weapons spawned by that AI so you can check who owns a specific Weapon

peak sentinel
#

I need some sleep

peak sentinel
#

Can OnReps get denied (not called) if latency is ultimately high?

bitter oriole
#

Onreps are called locally when the value replicates

#

So they can't be denied

#

And the value will replicate at some point, just maybe later

peak sentinel
#

I guess meanwhile they can stack and run in very close times then

#

I made a pool-based and deterministic projectile spawning and so far its working great, but with extreme conditions sometimes projectiles are not visible, probably they stack and spawn together at some point

#

What about "packet losses" though? I noticed this only happens when pktloss=25 is set

empty axle
#

that is a very big packet loss btw

peak sentinel
#

Whats the ideal rate for testing?

empty axle
#

there is no ideal rate , but 200 ping and 5% packet loss I would consider as bad internet connection but still somewhat playable

peak sentinel
#

I see, thanks

#

I usually test with 250-500 pktlag and 10 lagvariance, but first time tried with pktloss

empty axle
#

that also depends on what kind of game you are making. Testing 500 ping for FPS is pointless as it is unplayable no matter what

peak sentinel
#

Fast-paced TPS, I expect lower than 150 ping for playable conditions from player

empty axle
#

seems reasonable

chrome bay
#

Yeah we have a hard-cap at 450 but it's pretty much unplayable at 300 or more

#

Most players expect that though, they'd been conditioned ๐Ÿ˜„

bitter oriole
#

100 ping is a realistic cutoff for mainstream and degraded network tbh

chrome bay
#

yeah

#

Another curse of 100 players is to fill up servers people gotta join ones further away

#

Another argument to not do that

thin stratus
#

Just add bots to fill the missing players PE_PandaRee

#

Pick a random user and their customizations from the database that is offline for the name and looks of the bot :D

chrome bay
#

Didn't FN try that ๐Ÿ˜„

#

To mixed response

#

Also that's only as easy as "Just add AI to your project" ๐Ÿ˜„

thin stratus
#

They match you in Rankeds against bots (really bad bots) when you lost the previous one

#

And they aren't even good at hiding that

#

The full 5 member enemy team is just bots

#

But yeah, only joking around

summer tide
#

Does it work if play montage on multicast only

rich dune
#

Hey, I'm currently testing a way to get a repicated airplane working. I added a Floating Pawn Movement and on Server Side the Plane is moving forward like it should. However If a Client tries to move it just wont. The Input values are correctly repicated and everything is replicated.

The same setup is working with a Tank and SimpleWheeledVehicle setup. Any ideas?

grizzled quartz
#

are you doing posses on server as well?

rich dune
#

Yes, the same way as with the Tank where it's working fine

grizzled quartz
#

are you using the same exact movement component for the tank?

rich dune
#

No for the tank wheeled vehicle and for the plane floating

grizzled quartz
#

im pretty sure it would work if you used character movement and set its movement mode to flying

#

but thats just a workaround

#

you can try multicasting the add movement input and see if that works

rich dune
#

Already tried, does not work. I can multicast or run only on server the movement input. nothing

grizzled quartz
#

is plane an actor?

#

oh its a pawn, mb

mossy venture
#

Hey. How do I replicate this back to the client? Currently this function resides in GameMode, which is called from a player controller. As you would imagine, it works on the server, but unsure how to get it back to the client.

grizzled quartz
#

@rich dune

#

check replicate movement and should work

#

same as templates that unreal includes

#

just get rid of your tick

#

because input axis already is like a tick

chrome bay
#

Only character movement has proper multiplayer support, none of the other movement systems do

grizzled quartz
#

if you check replicate movement then floating will work as well

chrome bay
#

Well the transform will replicate to a client if you set it server side, but that's about it

grizzled quartz
#

thats all he needs for a plane

#

thats why i suggested using character movement in the start

#

cause it has all the prediction stuff as well

chrome bay
#

Yeah. All the complex prediction logic etc. you only get via CMC

grizzled quartz
#

i just dont remember if you can add that movement component to anything else than a character (talking about c++ as well)

#

but i guess not since it has a lot of logic regarding character

chrome bay
#

Yeah they're tied together

grizzled quartz
#

if you see that little computer on posses node, it means that its a server node

#

and dont use get player controller, might return the host instead of the client

#

for testing purposes you can change it to a dedicated server

#

and if get player controller is the culprit, it will work fine there

#

oh wait not, since you are using that controller inside a GM, which only exists on the server

mossy venture
grizzled quartz
#

but still my guess is that you need to get the correct controller

#

that is trying to posses

#

because now you are getting controller at index 0

#

and its in GM and GM exists on the server

mossy venture
rich dune
grizzled quartz
#

works fine on my end

#

thats all i did for the pawn

#

or wait, now server cant see client moving ๐Ÿ˜„

#

brb, will figure this out

woeful pebble
#

Can anybody

#

literally anybody

#

just help me

#

understand how to make teas

#

teams*

rich dune
mossy venture
#

PlayerState should be a good place to put it.

fluid summit
# woeful pebble teams*

Hopefully I didn't go too fast. What if these were one of the lazy tutorials, like Ian Hubert's?

Intro: (0:00)
Game Mode and Player Controller: (0:23)
Spawning Players: (0:57)
Countdown timer: (2:11)
Disable/Enable Input: (4:26)
Match timer: (5:14)
Game State: (5:40)
Timer widget: (6:34)
Errors: (8:02)
Outro: (9:31)

Ask if you have questions ...

โ–ถ Play video
grizzled quartz
#

@rich dune which engine version are you using?

rich dune
#

4.26.0 Source build

mossy venture
fluid summit
#

Hi! one question.
I'm running a function on the server to change the Token ID for my playerController, after that i move to a new form, where i check if the TokenID is set.

The problem is that there's a small delay on the set of the TokenID, is there anyway to wait for the server to run one specific event before continuing the execution flow?

empty axle
fluid summit
#

yeah i just did that as a workaround, gonna leave it like that for the moment, thanks!.

fluid summit
#

Does anyone know why i may be getting this error? not sure if it's server related

#

The blueprints are from playerController

thin stratus
#

Not sure

#

But doing it on BeginPlay is also not smart

#

BeginPlay will call for the Server for all the Clients

#

So the Server is now adding multiple Widgets for itself

#

You need to limit this to locally controlled

#

And then the RPC "CheckUID" is also redundant to be an RPC as BeginPlay already calls on the Server

fluid summit
#

oh you are right, i'll ad a remote authority check

#

didn't knew that beginplay from controllers was called on the server

thin stratus
#

Do you have ListenServer or Dedicated ones?

fluid summit
#

dedicated

thin stratus
#

BeginPlay calls on every instance

#

Doesn't matter if replicated or not

#

And the Server has an instance of the Client's playercontroller

#

Okay if dedicated then the auth check is enough. Otherwise you need to keep in mind that a ListenServer does not count as Remote/Client, but still would want a HUD for itself

#

So IsLocalPlayerController would be wiser

fluid summit
#

that makes sense, thanks!

#

i think i got the problem, on checkUID i change the active Widget of the HUD.
But since i'm running ADDHUD on the server, if i run checkUID on server, it will fail to find a reference.

fluid summit
rich dune
#

FloatingPawnMovement is definitly broken and not replicating

#

is there a way to get character movement component into a pawn and not into a character

#

?

chrome bay
#

noop

#

FloatingPawnMovement doesn't work in MP, if you're using Blueprint you're fairly restricted to hacking a character pawn into what you need.

thin stratus
#

EDIT: Actually this question doesn't fit Multiplayer exactly. Freaking generic questions. nvm

fluid summit
#

i think there's escenarios where you may run into a client having server role (like if you are using a listen server) and maybe other scenarios, but mostly yes

#

that should be okey then

thin stratus
#

This is theoretically okay. But it can be that the Local Role is Authority on an Actor that is simply not replicated and exists only on the Client.

#

If you are already using C++, you should implement Sprinting through the CMC though

#

Yeah, your own CMC child

#

And then follow the way the CMC handles Jump/Crouch

#

There is some info about this here:

#

It needs a lot of boilerplate code

#

But it's needed if you want smooth movement

#

Not everything on that page is correct though

#

You should never send additional RPCs to communicate data

#

They do this in the Boost Dodge part

#

Which is wrong

#

In that example you can use the Acceleration that the Server gets passed to know the direction of the dodge

#

But all in all, the info is good enough to get started

rocky kestrel
#

I can't figure out why health bar is not updating. Damaging works. It's pvp.

#

Take hit function called in any damage

fading birch
#

damage only runs on the server.

rocky kestrel
#

How should I fix that :0

fading birch
#

store health either on the character via a component, a float on the character itself, or in the player state. Mark it as replicated, and then grab that value from w/e to update your health.

rocky kestrel
#

If I store health var to component how should I reduce it when take damage? in any damage get component and set hp var and and after that get that hp var and update health bar?

#

or update health bar in that component and only reduce it on anyDamage

rocky kestrel
#

Made it work!

limber gyro
pale nimbus
#

@violet sentinel Could i ask for your help again? your last help really got me closer to something that work but if you see the video below it's yet to start working properly. Basically the in the host everything is ok, on the client the character moves very slow, but if i change to the host tab suddenly it starts moving like it should. Also both characters inside the host tab rotate properly, the client character inside the client tab doesn't rotate. Any idea on what could be causing this?

violet sentinel
pale nimbus
#

I did not go into the steam part yet. Is all still hosted on me.

violet sentinel
#

so for now i'd say experiment session search options etc

pale nimbus
violet sentinel
#

oh, nvm. didn't watch full video

#

the template code sends move RPC while LMB is down every tick causing effect you see .

#

ask someone how to implement ARPG-like movement that would work in multiplayer

pale nimbus
violet sentinel
#

look at your player controller blueprints, try understand what does it do. you can get rid of VR/HeadMountedDisplay stuff to not distract you

pale nimbus
#

Ok thanks

twin juniper
#

hi all, I'm having an issue where in mutliplayer my camera will not rotate on a particular axis (the pitch value axis) on characters not on the server. This is regardless of how i set up 'use controller desired rotation' or 'use controlller roll/pitch/yaw' etc. What's confusing is I have the exact same (apart from a few constants) setup for adjusting my pitch and my yaw, but the latter works while the former doesn't?

#

Here is my code for turning left/right

#

And for rotating up/down

#

I checked 100 times for some setting that was different for pitch and yaw, can't find any

floral crow
#

If the server has a hard reference to an Actor that is replicated, but the client has no such reference (e.g. a UPROPERTY on game mode, which is not replicated), is it possible that the object gets garbage collected on the client?

The replicated Actor has bAlwaysRelevant set to true in its constructor

unborn trellis
#

I've added Ammo and Reloading into my blueprints, however the reloading is not replicating properly to the client (It works fine on the Server) and i'm just wondering if i've done anything wrong in my Weapon Blueprint or if i'm replicating something wrong here.

unborn trellis
#

Basically, right, in my game, i have the player shooting with the Ammo going down. That's fine and working on both the server and client, the problem lies with reloading the weapon. On the server, it reloads fine, on the client its broken.

So e.g on the client, i have 25 bullets, i shoot 5, so i have 20 now. If i reload, it displays 25 bullets but when i shoot again, it shows 19. So it's not properly updating

fluid summit
#

after reloading, are you updating the number of bullets on the server?. (maybe you update it when firing, but not when reloading)

unborn trellis
fluid summit
#

if you reload on the client and don't tell the server, your client will display 25, but when you shot, it will update to whatever the server have (20 -1)

unborn trellis
#

it's in a custom class called "Server_ShootInfo"

#

let me see if i can get a full screenshot

#

is there a way to show my blueprints in full without having to zoom out? it's a bit of a big blueprint, kinda

fluid summit
#

not that i'm aware

unborn trellis
#

Ok so this is the shoot info for Hit Scan, below is for projectile based weapons, it's similar to this however it's getting a projectile

#

The reloading works the same for that, however, let's focus on the hitscan part as im sure it will be the same for projectile weapons

#

this is the Weapon Blueprint

unborn trellis
fluid summit
# unborn trellis

i'm not sure if here you are doing it on the server, shouldn't you adding a custom event "Reload" that runs on server and call it when pressing "InputReload"?

#

if not, you are replicating the variable, but since it's not the server updating the value, it does not get replicated down from there

fleet viper
#

im pretty sure this is a very nooby question, but google didnt really gave a clear answer so here i am. The graph is located in my character bp (yes it does replicate) and when i press vault i want to execute a function within a component (also replicated ticked) that lerps the chars position. Problem is i need to change the location on client and server side if im not mistaken right? Thats why im trying to use a multicast but my character is always getting set back to its original location by the server

fluid summit
unborn trellis
#

aha yes! @fluid summit that's what i should've done!

#

Thank you very much my friend

#

it works now

fluid summit
unborn trellis
#

oh wait, it seems it's broken again ๐Ÿ™ƒ

fleet viper
unborn trellis
#

it works fine with the Assault rifle (hitscan) but with the projectile weapon (pistol) it just kinda breaks lmao

fleet viper
fluid summit
fleet viper
#

tho im still on client side and dont know how i would replicate this

fluid summit
#

i'm not so sure how timelines work on mp, here's some small tutorial i saw about it for opening doors (it's pretty much the same you are trying to do)

#

In this series we will be explaining how to add online multiplayer to your games. First we are going to explain how it works, then we will go into creating lobbies etc.

In Part 3 we go through how I made the online functioning doors you saw in part 2. Learn how to add replication to doors.

SUPPORT ME
Patreon I https://www.patreon.com/ryanlaley...

โ–ถ Play video
#

maybe you can get some insigth with it

unborn trellis
#

nevermind i fixed it again lol

fleet viper
coarse flame
#

is the "Level Blueprint" of a Server Level on the server or local? As in if i use VaRest to send a JSON from the bp level, in a Server Level, will the adress of that json request be localhost(Server side) or from my computer to the servers side?

sinful tree
coarse flame
#

So basicly i was thinking of creating a function in there, that will function to trigger a JSON Request to ship off data to store in a mysql database, and i was kinda hoping that i could make a rest api for the server, so that i can do a localhost, and be able for my games community to run dedicated servers as they wish

#

by you know, loading, unloading stats from the db

#

Basicly, what im tryina make rn, is that when player quits, his inv etc will store over there

fluid summit
#

Im running that exact same setup at the moment and is running okey, feel free to reach if you need any help

#

With regards to where make the calls, im not sure what im doing is okey in terms of security, prob would have to refactor later

sinful tree
#

I'd recommend you do it from game mode rather than the level blueprint. Level blueprints aren't really accessible from other areas, so there's no real easy ways to communicate into them, only out.

fluid summit
#

What if you make the calls on the hud (client only) and set the values after on server?

fluid summit
#

@coarse flame
So for the Dedicated server with MySqlDatabase using c# WebApi you will need the following.
-Build unreal source version (https://www.youtube.com/watch?v=TcovfE8IsHs&t=1293s)
-Add VaRest Pluging to your build (you can get the github version that matchs your UnrealSource here https://github.com/ufna/VaRest)
-Setup MySql and build a basic C# WebApi (https://www.youtube.com/watch?v=TcovfE8IsHs&t=1293s)

Hey guys,

In this tutorial we're gonna create a simple Web API with C# and MySQL.

โ–ถ Play video
coarse flame
#

Cheers, allready on step 3 lmfao

fluid summit
#

with that you have the basic setup and you will be able to make calls from inside the game with BP to your Api and access the database (this point may require a few more steps for the setup, feel free to reach at that point)

#

If i RepNotify on a Struct, do i get a notify even if i update only one member on it?

lost inlet
#

unless they are super simple

fluid summit
#

they are, it's just to explain some concept, also he's really good at explaining.

fading birch
#

seems fairly simple in concept

lost inlet
#

when you have as many features as our doors, it's desync city

fading birch
#

ah

#

I was thinking a literal door just 2 states

#

and i was like

#

that's not complicated at all

lost inlet
#

shootable hinges, variable open state, breaching, peeking

fading birch
#

oh yeah

#

that would complicate things a wee bit

#

just make it always relevant

#

ez

lost inlet
#

oh to make matters worse, there used to a bug in the engine which would cause actors in sublevels not to replicate after seamless travel

fading birch
#

ah yes

#

i'm familiar with that one

#

๐Ÿ™‚

#

was the bane of my existence for awhile

lost inlet
#

did you see our UDN ticket? took a while

fading birch
#

no i did not

#

i've only gone on the UDN like twice lol

fluid summit
#

sorry to interrupt (?)
Anyone have an idea of why this is not triggering OnRep for the Struct "UserProfile"?
new value != old value.

fading birch
#

you need to call the onrep

fluid summit
#

What do you mean? i tought that OnRep is triggered automaticly when modifying the values of the struct

#

oh i think i got it

fading birch
#

you can call the onrep to force the value to update on clients

#

the OnRep function runs on clients, not the server

fluid summit
#

it was a diferent problem, i was passing to the "Ref Struct" the new struct (it should be the one that needs to be modified)

coarse flame
#

Does anyone know how ark made theyr servers store via mysql?

#

For theyr dedicated servers i mean

#

like how are they connecting it to run via server

lost inlet
#

they do? I would've figured they would've used an API or something

fluid summit
#

it seems like they do

#
ARK: Survival Evolved Wiki

ARK's Web API is used by the client to get a list of official servers and display news. Each endpoint can be accessed by sending a simple HTTP GET request. HTTPS is not supported. Some endpoints are suffixed by a ".ini" extension, but their content is not in the format of an INI file. Endpoint names are case sensitive. All API endpoints are host...

lost inlet
#

or at least dumping data to that directory locally

fluid summit
#

3 hours trying to see why my Api wasn't taking the request i'm making.
I just remembered that you can't send a json body with a GET, you need a POST.

3 H O U R S

sinful tree
#

Oof

fading birch
#

well that's not entirely true

#

you can send a JSON body with a get request

#

just don't expect to save any of that data.

coarse flame
lost inlet
#

well isn't that what it does?

#

there's nothing about setting up a mysql database here, if there is persistence between multiple servers then it'll be an API rather than directly connecting to a DB

coarse flame
#

See, with that approach, i need to know how to make the api easly configurable in order for it to be able to be deployed at other places rather than just my IP being in the games JSON Request

lost inlet
#

I'm not sure what you mean by this, usually a game backend is pretty invisible to the user

coarse flame
#

Yea, but the way i want to do it is by letting players be able to deploy they'r own dedicated server right, and im looking for ways to save data, player locations, money, inventory etc, without storing it on the clients files

coarse flame
mossy kindle
#

Hey guys,
I am using a modular character for a game, where the player makes a character and then it gets saved to the save game. And it loads the mesh parts in character BP. Now the problem is that the mesh on every player is the same as the player's own mesh on the player screen.

#

Now how do i create it so that every player sees the mesh made by another player

coarse flame
#

Replication

mossy kindle
#

?

sinful tree
# coarse flame Yea, but the way i want to do it is by letting players be able to deploy they'r ...

The difficult part is the security of it all. By allowing anyone to run a dedicated server of your game and having your player data stored in a central database, you'd have to expose the API to your database to the public, which means that anyone could make calls to it, which in turn means people could spoof data and muck up other people's data or set their characters stats/levels to max, and give themselves copious amounts of items, and you can't necessarily "authenticate" dedicated servers run by others to make sure that the data is only coming from your game server, nor can you necessarily validate the values that they send are indeed the values that they should be.

You can't really work around this - it comes down to "never trust the client" which in this case would also be any dedicated game servers set up by the public.

If you don't care for these sorts of issues, and understand that eventually someone will be likely to do some bad things with your database, then you can just continue with a web API and allow third-party dedicated servers to communicate with it.

#

I want to mention a game that had some issues from allowing clients to be in control of the data: Diablo. You could join other player's games that were hosted on the machines of those players, but still use the save game files from other clients. What this would allow is for players to run their character offline, use a trainer and give themselves all the levels, stats and items they needed, and then join someone else's game with that character - cheating in such a fashion became rampant in the original Diablo, and persisted into Diablo II unless you used "realm" characters which were characters that were stored online & could only be used online on a Battle.net hosted server. Diablo III never had this problem as they completely removed offline play - you had to play with an online character on a Battle.net hosted server.

#

I'm sure there were still cheats on Diablo 3, but not to the extreme, nor accessibility of the first two Diablo games.

coarse flame
#

Sorry if im slow, its 6 in the morning ๐Ÿ˜…

sinful tree
#

Then you can do it as you've already figured out -> Have your dedicated servers communicate through a web API to your database that isn't accessible to the public, or program in a means for UE4 to communicate to your database directly or use a plugin that provides such functionality.

coarse flame
#

Alright

#

But what i dont get is how is arma and rust etc doing okey with it?

fading birch
#

If you're going to use publicly hosted dedicated servers, setting up a licensed server is a good idea. I personally wouldn't do that for anything that would include matchmaking as @sinful tree stated, you can't trust them to not muck everything up.

#

If you or a a cloud service you pay for (AWS, Playfab, etc) hosts your servers, you still control that and it's fine.

coarse flame
#

What do you meen licensed? AWS etc?

fading birch
#

as in you have a license server setup. People that want to host their own dedicated servers for players to join would need to apply/purchase a license to do so from you.

#

if you're just hosting them on AWS, then you don't need to worry about that as you're the one hosting the server still

coarse flame
#

Ah yeah was planning that route

sinful tree
# coarse flame But what i dont get is how is arma and rust etc doing okey with it?

I'm not familiar with those games. Rust from what I can see doesn't allow you to use your character across servers. Each dedicated server would have their own save game that contains the character data for a specific player. The specific player & character would be linked to an ID of some kind (probably Steam ID) and whenever the player joins, it reads their Steam ID and then loads them the character associated to that SteamID. Data would likely be saved in intervals and when the player is leaving or gets disconnected, again associated to the ID of the player. Many games that have the ability to allow players to run their own servers will do it this way. Any issues with cheating is strictly on that one particular server where the cheating was taking place and that data doesn't get passed around anywhere else, nor can the owners of the dedicated servers potentially muck about with anyone else's data.

coarse flame
#

Pretty much like that yea hah

#

How would i go about setting it up like that?

fading birch
#

i wouldn't bother with a sql database for that