#multiplayer

1 messages · Page 333 of 1

cursive herald
#

so basically think of it as player controller = controls who you are. playerstate = gives information on what state you are in (spectator, team, dead, etc)

#

and honestly a lot of your questions are design questions

#

do you want the player to pick who they drop in as?

#

or they randomly get a person and can switch to the other if wanted. Or do you want a period of time where people can choose? if so what are they looking at and how are they represented?

#

All of that will differ on your solution unless you want to support both ways.

#

but basically the player connects -> Player Controller is created and the gamemode has default pawn class that it will create everyone as

#

tons of ways to do this but a simple way would be to just make a default pawn that displays a hud that lets you choose who you spawn in as

#

but this would do that for all players not just the coop connectors

#

another way could be having that default pawn as your playable class now and overriding the functions in gamemode for the newly connected

#

basically on the server you check to see if any other controllers exist or get the player controller index

faint python
#

so its not having a player controller always

#

just when they connect and destroyed when not connected

#

but the new player doesn't get a choice they just take control of next available member

#

the player state will determine which character information you are controlling?

#

I think I understand

#

got to research player states now

#

thanks

cursive herald
#

😄

#

no problem

#

and yeah player controllers aren't always around so when the player leaves, replace the pawn's controller with an AI controller. I think the default is to destroy the pawn with the player DC

faint python
#

I want the pawn to stick around regardless of player 2

#

it does go back to ai control

#

but I'm talking to another guy

#

and he says a way to do this is using a interface

#

to go through an array of my actors and just possess each

#

the interface will communicate with each actor and I just take control of each

#

but I have 0 experience with interface blueprints

#

I'm sure its similar but I don't know where to start

#

and I got so much other stuff I don't know if I'll end up just messing everything else up or what

#

I already spent the last 4 months trying to figure so much out and its never enough

#

I need ice cream and a break

#

ttyl

hasty adder
#

Wonder if you could just on un posesses have Gamemode spawn a ai controller and possess it

#

Depending on game might cause some issues haha..

prisma shadow
#

can someone help me with replication?

fossil spoke
#

Whats the issue?

prisma shadow
#

i want to spawn a widget indiviually for each player, only appearing on their own screen, but when i create it and add to viewport it adds on all clients' (other players) screen

#

i tried run on owning client but doesnt work

fossil spoke
#

Are you using splitscreen?

prisma shadow
#

yes

#

i mean, its 4 different players

#

each screen is one player

fossil spoke
#

Use Add to Player screen instead

prisma shadow
#

no i mean , im not using split screen

#

im running 4 instances at the same time, 4 different players, they dont share one screen

fossil spoke
#

Ok

#

So you want an Widget to only appear on 1 clients window

prisma shadow
#

yes

fossil spoke
#

How are you adding the widget? Is it via an hit event or begin play or something like that

prisma shadow
#

begin play

fossil spoke
#

Ok well you need to find an way to filter out your other clients and only allow the widget to be created for the client you want it to appear on

#

PlayerState has an unique ID for each client

prisma shadow
#

will try it

#

what is game state used for

fossil spoke
#

GameState is used to track the progression of an Match and have that available to all clients.

prisma shadow
#

how do i assign the player state to the actors

#

every actor in game belongs to the same class

fossil spoke
#

PlayerStates are automatically created for each player

#

You can access PlayerStates in an number of ways

prisma shadow
#

but how is the actor controlled

fossil spoke
#

Not sure what you mean? Which Actor?

prisma shadow
#

when i create the widget to be added on the viewport

#

how do i select the current client (player)

fossil spoke
#

What Actor is creating the Widget?

prisma shadow
#

every one who is spawned

#

i put 4 player start on the map

fossil spoke
#

So an Character Actor is creating it?

prisma shadow
#

so 4 players of the same class is being created

#

yes

fossil spoke
#

Do you know which Player you want to have the Widget appear on?

prisma shadow
#

man

#

no

#

on the event begin play, the create widget must be called

#

all the player actors

#

belong to the same class

#

theres no way to know which one specifically is calling that

fossil spoke
#

On BeginPlay do and print string and pass in GetPlayerState

#

GetID

prisma shadow
#

yes, i got the player id

#

now how do i make the widget spawn to that player id

#

to the player on theplayer id

fossil spoke
#

If(MyID == ID) spawn widget

#

You need some sort of criteria for choosing the player

#

You have everything you need mate.

prisma shadow
#

the problem

#

is that the widget keeps spawning on all clients' screen

#

shouldn't the owning player have a value?

#

on create widget

#

how do u explain that

twin juniper
#

Is GetAllActorsOfClass constrained to network relevency on servers as well as clients? If called from server, wouldnt it return all no matter what?

fossil spoke
#

GetAllActors only returns the Actors that are instanced to that World. The server will only return the Actors it has in its World. Same for the Clients.

mellow cipher
#

Anyone here looked through OnlineSubsystemSteam much?

hasty adder
#

@prisma shadow when do you want a widget to show up? I didn't read this whole thread but I might have some info for you

prisma shadow
#

just when the player is spawned, on begin play

hasty adder
#

Usually is recommend ensuring then widget be spawned by the player controller.. So you want to find the right way to reference that and spawn it. For example.. Say you hop in a car and want a speedometer to show up. Well in the car pawn blue print. Event possessed gives you an opportunity to access the controller that just possessed it.. Then you can use that to create a widget and add it to that controllers viewport

#

Begin play depends on when that actor spawned not controller for example you join a server with people already playing your version of the other players pawns will spawn executing the begin play. Since to that client they just began play

#

What umg are you spawning that happens to everyone during begin play that you don't want?

prisma shadow
#

it's a hud showing the hp, image and name of the player

hasty adder
#

So this is something specific to them as a character.

#

Perfect for possessed override.

#

So in your player controller. Create an event add HUD for example.

#

Write the logic to create add to view port etc

#

Then in the character blueprint. You can use the override possess. And when controller is valid cast to player controller class you are using and call the event

prisma shadow
#

i cant access the default player controller

hasty adder
#

Let me see if unreal loads on this pos laptop.

#

It's modify slowly. Question what is the begin play in Thad starting this umg?

#

Third person character bp for example?

prisma shadow
#

yes

#

its a character from the character class

#

player character*

hasty adder
#

Good for thought. The character will be spawned before a controller possessed it. It's possible the event in begin play will end before its possessed meaning it's possible the hud is not added

#

Begin play starts when that class is spawned into world.

#

Still loading ...

prisma shadow
#

@hasty adder so i create the widget inside the player controller?

hasty adder
#

its easier to maintain control that way, i'm missing something,

prisma shadow
#

but you cant access the default player controller that comes with the project

#

do you understand about replication?

fossil silo
#

hey, does anyone know why "FindSessions" node would auto fail right when it runs?

hasty adder
#

Wish I coulda wrote more but was 2 am and sleep happened.

#

@prisma shadow to answer your question yes I will look into this more later when home again. Problem is some events are called from server and not client so controller is in accessible I can't remember what I did in this situation but I can assure you things like client HUD change and calling event to the client if controller == them are effective. But again need to visit, sorry 😃

wary wyvern
#

Hey, guys, is it possible to set one variable to be always relevant?

#

I asked yesterday about variable, wich stops to replicate. I do not know the reason, but maybe relevancy will help me somehow

brittle sinew
#

No, if the actor isn't relevant none of its variables will be replicated

#

At the same time though, if it is relevant there's nothing you have to worry about, its variables will always be replicated

modern dome
#

Hey there.
Do you guys remember oldschool games like Zelda 3 or Lufia, where you travel from Map to Map?
I would like to do the same, but in Multiplayer.
What do I need to know to achieve this?

#

I tried the Open Level Node, but it resets everything...

timid pendant
#

Im guessing you would have to call server travel from the dedicated server

modern dome
#

Oh. Blueprints have no functionality for that

blazing siren
#

I think you can use the console command

modern dome
#

And what about additional Parameters for the Map?

dapper galleon
modern dome
#

When I call "Switch Has Authority", will a Listen Server call the Remote Branch?

brittle sinew
#

"Has Authority" isn't about server or client.

#

It's about authority on the object the function is being called on

#

Yes, the server will have authority on all objects. But the client also has authority on their local PlayerController

modern dome
#

I see.

#

Thanks

#

So basically checking "Is Dedicated Server" is all I need to do?

twin juniper
#

@Raildex#6923 Authority means, you have the ability to change it. For example: A replicated variable, can only be changed by the server.

modest elm
#

why are my physics objects not synchronized with server & client?

#

anyone?

modern dome
#

AGameMode has a function "PostSeamlessTravel" which is called after a Seamless Travel.
Is there a equivalent for Blueprints?

slim holly
#

@modest elm because physics have too much time-sensitive data to be replicated

modest elm
#

so what's the solution @slim holly ?

slim holly
#

umm, there are solutions

#

but you're not gonna like'em

modest elm
#

im making a very simplistic multiplayer game, is it that hard to just setup the physics?

slim holly
#

technically yes

modest elm
#

can you please just point me to the right direction?

slim holly
#

sec I saw one panel talk about physics and networking

#

trying to find the link

#

it's long talk, but very informative about the issues and solutions

modest elm
#

thanks a bunch

agile lotus
#

Is the GameState's Player array repopulated during level change?

fossil spoke
#

GameState is generated each time an level is loaded. It will therefore get an new Player array

prisma shadow
#

in multiplayer games everything must be replicated

#

except some things who are only shown to the specific player

#

how do i set everything to be replicated?

modest elm
#

im stuck on that too @prisma shadow , all my physics are not in sync with server-client

#

people keep telling me i need to replicate it but i dont know what or how

fossil spoke
#

Physics is extremely expensive to replicate.

modern dome
#

When the Server sets a repnotify variable, will the notify be fired on the server, too?

lean river
#

Nop, only on clients and if server is listen server who actually client and server at same time repnotify will be not fired on listen server too

brittle sinew
#

@modern dome in BP yes, in C++ no

#

It's a little odd, haha. In C++ you usually just manually call it if you need it

twin vault
#

Can i use those match nodes between different game modes?

#

i have a game mode for the lobby and other for the actual game

#

wonder if it will work

modern dome
#

Seamless Travel is cumbersome with BP -.-

modern dome
#

So, it looks like there's a bug with Seamless Travel

#

I have an Actor which has Exposed String Values to determine to which map the Travel should go.
The Default Value is Entry (Standard UE map).
When I place this Actor onto the Map and change the Value to the same Map I am on, i can travel only once.

#

After the first travel, the Destination is "Entry"

#

it looks like the Edited Value is reset to the Default

brittle sinew
#

Did you add the actor to the seamless travel list?

modern dome
#

I am on BP 😂

brittle sinew
#

...that doesn't change my question.

modern dome
#

BP does not have that feature

brittle sinew
#

If the actor isn't on the list, the same actor doesn't get brought into the new map

#

It's not a bug or anything like that

modern dome
#

but the actor is there

#

it just has a default value

#

it is placed in the world like a static mesh

#

so it is automatically there

brittle sinew
#

Okay, so you established why it's there when you travel

#

But it's not the same actor

#

It's a new actor that came about from being placed in the level

#

Like you said, Seamless Travel is cumbersome with BP. You're not wrong about that 😃

#

You still have to use its features to use it though, and if you want an actor to persist through a seamless travel you need to add it to the list

modern dome
#

wait, why is it a different actor ?

brittle sinew
#

It's just a new instance of that same actor that exists in the level

#

Each time you load a level, all of the actors placed in the level get a new instance.

#

Seamless travel doesn't change that out of the box.

modern dome
#

That sounds wrong

#

when I load my Level on startup it has it's correct values. Why not on Seamless travel?

#

This implies I need to add every static Mesh to the Travel List, else they would lose their unique values

brittle sinew
#

I think I misunderstood your question somewhat, thought you meant you were changing them at runtime, oops

modern dome
#

Oh, ok. I didn't know how to rephrase it

brittle sinew
#

Nah, looking back you explained it fine, I kinda just glossed over it

#

What I said about the list and stuff would still apply if you're changing it at runtime, haha. But this issue does seem weird

modern dome
brittle sinew
#

Can you confirm the issue doesn't occur when seamless travel isn't on?

modern dome
#

Yeah, wait a sec

#

lol

#

it works now

#

Yep, i don't travel to Entry anymore

#

weird

brittle sinew
#

Hmm, magic

modern dome
#

Exactly.

#

but my shared camera does not work after a travel 😦

#

Is PlayerController BeginPlay executed after a seamless travel?

#

Because that's where my Camera is spawned

brittle sinew
#

No, that's part of the point of seamless travel

#

The PlayerController persists throughout it

modern dome
#

but GameState and GameMode fire BeginPlay after Travel

#

Meh, gonna find a solution 😦

brittle sinew
#

If you need to know when a seamless travel occurs, use APlayerController::PostSeamlessTravel

#

Not exposed to BP, but don't know what to tell you

modern dome
#

There are so many things I want to do before/after the Travel and nothing is really implementable in BP without any complications :/

brittle sinew
#

Yeah, there comes a point where you might just have to consider biting the bullet and going for C++ in some capacity :p

daring arch
#

Yo, quick question for you lot

#

Does anyone here happen to know of another networking solution for UE4?

#

Something I can just mash on top of the engine with C++?

wary willow
#

@daring arch yup

daring arch
#

oh? what is it?

wary willow
#

There are a lot actually

#

If you can find an SDK for it, you can use it

daring arch
#

Neat. Do you have any in mind?

wary willow
#

But off the top, for "true_ MP experience, SpatialOS

#

GameSparks can be used also

#

Somewhat limited, depending on your exact needs. But doable.

daring arch
#

I'm talking about something like Raknet

#

I just want something I can use to open two sockets and talk to another computer.

wary willow
#

Well since it's open sourced

daring arch
#

I want to avoid UE4's networking system.

wary willow
#

You can probably do your own hooks into UE4

#

You could probably make some money off of it

daring arch
#

Eh I'll keep looking. Thanks.

wary willow
#

If you did it as a plugin

#

@daring arch what are the reasons that you want to avoid it?

daring arch
#

I'm working on a multiplayer VR project and UE4's networking architecture is just plain balls for anything that isn't server-authoritative

jolly siren
#

ue4 has a xmpp implementation, so i'm sure it has a lower level socket layer too

#

yeah there is FSocket stuff https://wiki.unrealengine.com/TCP_Socket_Listener,_Receive_Binary_Data_From_an_IP/Port_Into_UE4,_(Full_Code_Sample)

#

gl

daring arch
#

awesome. Thanks!

dapper galleon
#

About Online Beacons: where should I spawn my AOnlineBeaconHostObject and AOnlineBeaconClient derived actors?

#

I understand that one is for the server and the other for the client, but where do I store and initialize em both?

dapper galleon
#

Hmm, seems like I simply spawn it when needed

obtuse zinc
#

Hey guys, quick question, when I am updating variables in the Player State, must that be done on the server?

#

Because right now I'm doing a simple variable set in the playerstate when you click on a button in the hud, but the server is showing it as the default value when i try to access it later

brittle sinew
#

Yes, replicated variables must be changed on the server

obtuse zinc
#

Okay, with a multicast call?

brittle sinew
#

No, replicated variables are automatically replicated to clients

obtuse zinc
#

oh

brittle sinew
#

It needs to be changed on the server though.

obtuse zinc
#

So if my HUD calls a function in my PlayerState, that's on the client. So how could i change it on the server? :?

brittle sinew
#

I'm actually not sure either way if calling a server RPC on the PlayerState works

#

I know the PC owns the PlayerState so it seems like it should, but I've never tried it

obtuse zinc
#

ok so ill give it a shot i guess lol

obtuse zinc
#

Yeah it worked, had to do a super convoluted thing though. The function in Player State is being called by blueprint, which then calls a Server function which then calls a multicast function

brittle sinew
#

If you're only setting a replicated variable, the multicast is unnecessary.

#

If it's not replicated, yes, you'll have to manually change it on all clients

obtuse zinc
#

ah i see

#

Can I do this?
UFUNCTION(BlueprintCallable, Category = "Team", Server, Reliable, WithValidation)

brittle sinew
#

I don't see why not, is there an issue?

obtuse zinc
#

No just making sure, looks weird lol

#

Thanks for your help man

prisma shadow
#

how do I cast to a custom player state class?

modern dome
#

right click -> cast to YOURSTATECLASS

#

@prisma shadow

brittle sinew
#

That "client first, approve later" method is what autonomous proxies are made for. I can't give you all the details of implementation as I haven't used it extensively personally, but I know that's the tool

#

That's how the CMC works, for example

prisma shadow
#

@modern dome i mean what to put on the object reference genius

modern dome
#

@prisma shadow ?

prisma shadow
#

try creating a custom player state class and casting to it

modern dome
#

and whats the problem?

#

you do realize a PlayerState is always created automatically

prisma shadow
#

that is the default player state class

#

reference

modern dome
#

no

#

it is the playerstate according to your GameMode

#

you have to cast it

#

Make sure your desired State is assigned in the GameMode

prisma shadow
#

inside the player controlle?

modern dome
#

yeah

#

only PlayerControllers (or the GameState where it is in an array) can access the PlayerState

#

pardon. That's not correct.
You need a controller reference to access the PlayerState

prisma shadow
#

player controller -> playerstate -> cast to my custom player state class

modern dome
#

exactly

prisma shadow
#

i have done that, but it seems like it returns the default playerstate class

modern dome
#

Is the PlayerState class set in your GameMode?

prisma shadow
#

yes

modern dome
#

is the GameMode used correctly?

#

i.e. is it assigned in your Project Defaults or in the World Settings?

prisma shadow
#

set in the default game mode in project settings

modern dome
#

then the PlayerState is set up correectly

prisma shadow
#

oh yeah it worked now

#

thanks

#

the game state can only access the player state as an array?

dapper galleon
#

The game state is not specific to a player, that's why

#

I mean, you should read eXi's compendium

prisma shadow
#

to set the value of a player's variable inside a playerstate, it's player controller -> get player state -> cast to playerstate class -> set value?

#

because it changes only one player's variable and nullifies all the other ones

dapper galleon
#

Does anyone know how does an online subsystem obtains a world context? My custom online subsystem should have a world associated but I'm not sure how to obtain one.

undone crane
modern dome
#

Make sure your traces are done on the server and not on the client. It looks like you trace on the client the shot was fired

undone crane
#

if that's the case, why does it usually (but not always) display on both screens? Also, any ideas for the other strange behavior, where a player will die on one screen but not on the other? Or not die at all when they're clearly supposed to?

modern dome
#

When shooting, execute a Run On Server Event which does the Tracing and Hit Detection.

prisma shadow
#

why does this function only prints the caller player's name on the player state?

undone crane
#

I'll try that Raildex; right now some of the logic is already on the server, but I'll try the rest there too

modern dome
#

It's common Practice to do things like that (Tracing, Hit Detection, killing people) on the Server

#

The Clients only receive replications of these things

undone crane
#

right, that makes sense; I just don't understand the inconsistency

prisma shadow
#

every player has a different value in the Namez variable, but when i call that function, it prints the name of only the player who called it, and the other players' name appear as None

#

why is that?

modern dome
#

@undone crane if you did the Hit Detection on the Client, the Location of Pawns can be different. Character Movement Component and the Movement Replication replicate only to a certaint degree

#

@prisma shadow Where are you calling this event?

prisma shadow
#

on the character class

modern dome
#

Is this event within the GameState?

prisma shadow
#

yes

#

what is going wrong?

#

it appears only the client's name and the others as NoName

dapper galleon
#

Did you set the player name through a client?

prisma shadow
#

through the client

#

the variable is replicated

#

do u speak portuguese

dapper galleon
#

Well, in fact I do

#

That explains quite a lot, but let's talk in private

undone crane
#

I think those bullet trails are sometimes not landing because the other player's aim might only be relevant when player 1 is looking at them? how do I adjust that setting?

chrome bay
#

Anyone had any luck sending an FArchive via an RPC?

#

Trying to get around the fact that structs don't really support polymorphism

viral mason
#

Should my first game concept be multiplayer?

undone crane
#

if you're up for the challenge

#

don't make it something that's going to rely on tons of players though, because chances are your first game will not have enough players to populate it

wary willow
#

So..

#

I have to completely disagree

#

Even if he's up for challenge

#

Makes absolutely no sense

#

Start off small

modern dome
#

When I spawn an Actor (A Camera) within GameMode, will it exist on all Clients?

wary willow
#

If you try to bite off more than you can chew too soon, you might end up hating your game concept

#

Or game dev in general

#

Crash and burn is a high possibility

#

So, do a single player game

#

@viral mason

#

Get familiar with the framework better

#

All the ins and outs, as you will

viral mason
#

Well, @undone crane it won't be a public game 😛

#

It'll be just for me & friends lol

wary willow
#

And after at least one complete game, try mp

viral mason
#

ok

wary willow
#

It's just way too much to handle at once

viral mason
#

😄 Ok

#

Ill follow a tutorial series now 😄

twin vault
#

i can do it

#

where is my coffe

viral mason
#

lol 44 yrs

twin vault
#

lel

viral mason
#

(not my actual idea)

#

😄

#

That's what happens if you select all of them

modern dome
#

Estimate = 1000$

undone crane
#

well it'll suck that I'll have to spend half a million dollars and 8 years making my game, but I'm going to do it, damn it!

twin vault
#

xD

dapper galleon
#

Hum, are you trying to call the multicast client-side?

#

ah, yes

#

Well, I couldn't say what's acceptable and what's not

#

but I notice this is somehow similar to a fake projectile implementation

#

I mean, the idea

sweet spire
#

i just spawn a projectile on both server and client, and replicate its movement for the smoothing

#

normally works fine af

#

if its homing u have to replicate target tho

#

oh shit sorry

#

i thought u ment physical projectile

#

erm u can actually

#

change the param's on the client

#

and have them update correctly from the server

#

on next replication

#

but then u might big issues

#

with high ping

#

peoples hp jumping up and down

#

oh

#

no idea then

#

no idea how your doing it but multi cast rpc does not sound like the way to go

#

but im no expert

#

If u want things to feel instant then u calc them on the client

#

and let the server override them

#

really?

#

i use FX

#

and i dont multi cast at all

#

ah i dont do that

dapper galleon
#

Well, should be acceptable since its just cosmetic

sweet spire
#

i let the clients handle it

dapper galleon
#

It's the same idea with the fake projectile

sweet spire
#

too much data goes to waste imo

#

But thats just me

dapper galleon
#

since the client projetile (the fake one) is just cosmetic

#

you could even look at the UT4 code which implements it, afaik

sweet spire
#

thats why i tend to replicate bools and stuff

#

instead of full fx and crap

#

i handle all fx on the client side depending on replicated conditions

#

u dont replicate the fx, u replicate conditional informationt

#

to have clients trigger it

#

thats what i do

#

example

#

If client has X weapon equiped

dapper galleon
#

Yes, that's what we all do

sweet spire
#

and begins firing the weapon

#

Bool is flipped

#

client grabs the vfx information from a data table

#

and plays it

#

just a random example

#

nope

#

Replication notify

#

when the bool updates & do X thing

#

your stuffs ticking all the time anyway dont forget

#

btw im not saying your wrong im right, its just the way i handle it to reduce bandwidth as much as i can

#

depends what your playing

#

impact or weapon fire

#

It just depends what your doing and what game you are

#

I compress all my data down as much as possible

#

bandwidth = money

#

and peformance

#

I cant really say everyone does everything differently

#

Example if target is firing

#

Make target pawn weapon play VFX

#

1 simple bool

#

when they stop on the server it sets bool to off

#

bool gets replicated

#

stops playing on client

#

its just me personally

#

like

#

i compress all weapon information and data, mesh, vfx, etc everything

#

inside of two bytes

#

well i use too, i use fname and byte now

dapper galleon
#

How do you compress the bool?

sweet spire
#

I dont compress bool's

#

i compress data as best as i can

dapper galleon
#

What's the size of a BP bool?

sweet spire
#

no idea

#

a normal bool is 1 byte

#

honestly eoinobroin i wouldnt worry about it too much

#

unless your making something mad with heavy traffic

dapper galleon
#

Hum, at least you know

sweet spire
#

hm?

dapper galleon
#

I thought you were going to say a bit

sweet spire
#

lmao

dapper galleon
#

lol

sweet spire
#

i should of

#

play on words ;p

dapper galleon
#

I don't really have experience with NetDrivers. Any thoughts?

SetActiveLevelCollection attempted to use an out of date NetDriver: GameNetDriver

DefaultEngine.ini:

+NetDriverDefinitions=DefName="GameNetDriver",DriverClassName="OnlineSubsystemUtils.IpNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
+NetDriverDefinitions=(DefName="BeaconNetDriver",DriverClassName="OnlineSubsystemUtils.IpNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
fossil silo
#

Anyone have an idea of why this is happening? Its only in a build, testing w/ 4 networked machines connected.

I get the NOT SUPPORTED errors for almost every element in the game, and I get the NOT PART OF ROOT CLUSTER error on a good chunk of them.

This is all new to this latest build, as I've been testing in multiplayer for days without an issue.

Warning: Object ParticleModuleLocationSpiral /Game/ParticleSystems/Bluetech/Panorama_XaviHouse/Blueprints/android_xavi_blue/xavi_emmiter/COL_BASE_XAVI_REVERB2.COL_BASE_XAVI_REVERB2:ParticleModuleLocationSpiral_2 (0x0000025565f6b8c0) from cluster ParticleSystem /Game/ParticleSystems/Bluetech/Panorama_XaviHouse/Blueprints/android_xavi_blue/xavi_emmiter/COL_BASE_XAVI_REVERB2.COL_BASE_XAVI_REVERB2 (0x0000025560fd3440 / 0x000002550f560f90) is referencing 0x000002550185a260 DistributionVectorUniform /Game/ParticleSystems/Bluetech/Panorama_XaviHouse/Blueprints/android_xavi_blue/xavi_emmiter/COL_BASE_XAVI_REVERB2.COL_BASE_XAVI_REVERB2:ParticleModuleLocationSpiral_2.DistributionStartLocation which is not part of root set or cluster.



FNetGUIDCache::SupportsObject: ParticleSystemComponent /Game/Maps/panorama_basedrop.panorama_basedrop:PersistentLevel.prettybits_Bluetech_Panorama_XaviHouse_Track16_C_1.ParticleSystemComponent_46 NOT Supported.
sweet spire
#

@inner iris well thats easy, there pawn's bool would replicate too all players, the second they confirm they are firing on the server all clients get a msg that triggers VFX

#

What are u spawning

#

Weapon fire

#

or bullet impact

#

Muzzle flash

#

ofc they would know where to fire the muzzle flash

#

on the end of the weapon

#

i mean where else is it gonna be

#

so?

#

because i assume

#

all muzzle flash

#

comes out the end of there gun

#

right?

#

well then

#

U should have a marker of some sort

#

like a socket

#

For that weapon

#

thats where it would be spawned

#

on the end of there gun

#

the client should already know where the end of the gun is

#

if your replicating that, its pretty stupid

#

Bool says you are firing weapon

#

Spawn VFX on the end of the weapon

#

dont turn it off until it stops

#

yup

#

they dont need to know

#

where the pawn it

#

If pawn A

#

is firing his weapon

#

Spawn VFX on the end of his weapon

#

his client will know where his weapon is

#

what

#

no

#

if the bool flips on

#

It will replicate too all clients in net distance

#

it would fire on every client

#

the bool gets sent to EVERY other client

#

its relevent information

#

easily tool

#

done*

#

when the bool is sent to every other client

#

every client says

#

Okay

#

Player 6 Is firing his gun

#

Lets spawn a VFX on Player 6 weapon, at the VFX Socket.

#

its not an issue they all have there own bools

#

Okay lets think of it like this

#

Let me pull an example up

#

We are just going to use the logic of health okay

#

Its the same thing as

#

When health changes

#

It gets replicated to every client right

#

But i need to update every clients HP bar for each other

#

so everyone knows how much every target has

#

so what happens is this

#

-whipping up bp-

#

So when a players health changes on the server

#

the pawns hp is replicated to each clients version of that pawn

#

now they have Health bars above there head

#

Since the state of there health has been updated

#

I need to update the visuals

#

I dont send a multi cast

#

This happens

#

It triggers an event

#

Each of the pawn

#

when there hp changes

#

Updates there own Hp bar

#

above there head

#

Same thing with weapon muzzle fire

#

U cant do this for everything obviously

#

But when player 4 fires his gun

#

His IsFiring gets replicated

#

It triggers a client sided event

#

to spawn muzzle flash on the end of his gun

#

So its the same as the hp pretty much

#

when state changes
update visuals.

#

So i have ships right

#

big flying ships

#

And when they fire there primary weapons that have muzzle flash

#

a bool called

#

IsFiring, is ticked on

#

and that pawn on every players client, starts firing Muzzle flash

#

It might fire for 0.2 seconds longer than it needs too

#

but it dosent not matter

#

its all smoke and mirrors

#

Plus here is another thing man

#

Not all RPC's will go through

#

Ul have too have all your VFX RPC's on reliable

#

and imo that is bad

#

veriables will be replicated through

#

even if they fail on the first tick

#

they will go through

#

the input comes from the bool

#

Every pawn on every client

#

has its own bool

#

that is replicated

#

They dont need the information

#

Think of it like this

#

If This replicated Pawn is Firing, Spawn a VFX on this Pawns Gun

#

something like this

brittle sinew
#

@sweet spire is right, but maybe not explaining it the best. (love you buddy)

severe widget
#

haha

brittle sinew
#

The "is firing" bool doesn't exist on some magic static level.

sweet spire
#

haha love you too u melon :p

brittle sinew
#

When replication occurs, the engine uses NetIDs to resolve a reference to the same actor on clients.

#

Using this, it links up the server and client actor.

sweet spire
#

Think of that as your weapon

brittle sinew
#

When this occurs, that RepNotify is called on the same instance of that actor, only on the client.

sweet spire
#

Your getting the location of where you would spawn the weapon

#

listen to lethal though, hes good with this stuff

#

omg its placee :d

#

i was doing a gud ol bad explain place as usual :p

severe widget
#

tbh if you're casting to a specific thing from an external location instead of letting the class handle itself- you're doing something wrong here

#

Lethal's got you in the right direction- use RepNotify

sweet spire
#

rep notify was my idea rip

#

It depends on the situation

severe widget
#

If you can do the same thing with a replicated var, no don't use multicast

sweet spire
#

If its so static like the end of a players gun, you can just bool is firing

severe widget
#

But you can also do a similar thing with multicast

sweet spire
#

Because the bool thats replicated, is owned by the instance of that client

brittle sinew
#

Here, I'll walk you through a basic thought process of the engine

sweet spire
#

It has nothing to do with the other clients, its "there bool"

brittle sinew
#

Might help

sweet spire
#

go lethal gooo

severe widget
#

Its just that rather than do something like Cast<MyThing>(thing)->DoAction; Cast<OtherThing>(extraThing)->DoOtherAction(); you'd wanna do something with an interface/dispatcher

sweet spire
#

dw eoinobroin, this is me 24/7 asking shit lmao

severe widget
#

That's not directly related though, so I'll let Lethal talk

brittle sinew
#

When I change a replicated variable on a replicated actor on the server, I notice it has ID f7a0f.

#

(arbitrary)

sweet spire
#

dw lethal had to explain to me yesterday how to count a value when u drop below 0 in a math sum, i dun goof'd and was fired

#

tired*

brittle sinew
#

I go to the client with this information, saying an actor with id f7a0f has a change on their bool variable.

#

The client finds this actor (if relevant), and applies the change onto that actor.

#

It doesn't occur on some singleton replication object or anything like that...the RepNotify occurs on the client's version of that same actor.

#

Which allows you to use self/this as a reference point to do what you need to with spawning and locating where to do that

#

You can think of the behind-the-scenes linking as magic if you want, for a lot of purposes that's fine, haha.

#

Just know that UE4 links the server and client versions of an actor, and allows them to be referred to across the network as the same actor.

severe widget
#

A similar thing actually happens with multicasts/client funcs - basically there should never be a need to cast to do networking stuff

#

Unless you're doing weird things at a really low level - in which case you'll know what you're doing

sweet spire
#

U could actuallt go as far as this

#

If pawn is firing

#

On client do line trace and plat muzzle flare

#

If wall or static is hit

#

Draw bullet impact

#

Play*

#

Obviouslt u wouldnt wann do player impact as it can be slightly off it can be misleading

#

So world and static impact is fine

#

Fine

#

But thats just me everyone knows me in here as im a total hoe for maxium peformance

#

No need to multi just bool it :)

#

Yup

#

Ud fire the fx on loop similar to weapon rof

#

Then have it stop on re notify is firing false

#

Im comparrison yes

#

1 byte vs god knows how much

#

Not all rpcs go through

#

I think its 1 byte

#

No worries man we all here to help each other

#

If lethal ever leaves im fucked

jolly siren
#

wow I cannot get particles/sounds to show up in replays. I just tried spawning the sound and particles locally, via a client rpc, and via a multicast rpc within character. they spawn fine in game but aren't in the replay for some reason.

prisma shadow
#

how to cast to the character owner of the player state?

dull yoke
#

If you're doing it at blueprint, just drag the PlayerState and there will be a Get Owner function inside it. Then you can cast it to your Character class or blueprint.

prisma shadow
#

that didnt work

dull yoke
#

Is that what you intend to do?

prisma shadow
#

bi

#

no

#

I want to cast to the character that belongs to that player state inside that player state class

#

its a cast from inside the player state class

dull yoke
#

Is this what you meant?

#

In my PlayerStateBP, I added a child actor and set its class property to my NXCharacter. Then to cast it, I have to drag "Get Child Actor" from it then cast it to NXCharacter inside BP graph

#

Sorry if I still didn't understand your question as my English is not main language. Maybe a picture would help.

prisma shadow
#

NXCharacter uses that player state class?

#

is that the player state set on the default game mode?

#

what i want is cast to the character that belongs to the player state

dull yoke
#

I think I understand what you want to do now

#

PlayerController / PlayerControllerID is what defines the owner of PlayerState and PlayerCharacter you are using

#

so by getting the playercontroller, you can get what it owns (PlayerState, PlayerCharacter, etc...)

#

PlayerControllerID of 0 is normally the main player

prisma shadow
#

but it's not the current player

#

because its multiplayer

#

its the player Owner of the player state

dull yoke
#

sorry, what I posted was for "local" multiplayer only. I'll keep you advised.

prisma shadow
#

ok thanks

dull yoke
#

I was able to make it work by doing this:

#

From PlayerState, I created my custom event that will be fired by a specific player:

#

And to trigger that, I call PlayerState.DoSomething from the Character I'm using:

#

Having 1 server, 2 clients: When I press Y on server, that character asks its PlayerState to DoSomething. Then that DoSomething inside PlayerState, find its owned character and perform Jump.

#

Then that owned character jumps as requested by the PlayerState.

#

Same happens on client1 and client2. They jump indenpendently.

#

Inside PlayerState, you can then cast the PlayerCharacter to your own as in this example:

fossil silo
#

Hey guys, was wondering if anyone could help point me in the right direction of how to destroy network players characters after they leave the game...currently I have an EventLogout on GameMode that grabs the controlled pawn from the passed playercontroller, but it doesnt get removed from the servers view...wondering if maybe the playercontroller is no longer controlling the pawn by this point? any ideas how to do this properly?

fierce jetty
raven holly
#

Hows the level streaming these days for multiplayer

#

I want to use it for a subway system

#

does it still require it to be loaded for everyone?

modern dome
#

Is there a possibility to wait for every player in Seamless Travel before the Map is loaded?
Players can already move although not every play has travelled yet

lament kettle
#

Yes @Raildex#6923

#

You can have in your game mode a variable that determines this, and a function that goes thru all player controllers, checking to see if "loaded" is enabled. And that value can be sent from the client to the server, when they you know.. actually load the map.

#

I'm sure there's a simpler way, but that's how I would do it.

dull yoke
#

Is this a good way to check when damaging an actor other than the attacker in OnDamage method in cpp?

void OnDamage(...)
{
if (GetOwner() == OtherActor)
{
// We do not want to hurt ourself, that's so emo.
return;
}
}

twin juniper
#

uhm

#

how are u getting the other actor?

#

if its a linetrace

#

u should be able to set the trace to Ignore Self

dull yoke
#

My melee weapon had a collision box which I use to check for OnOverlapBegin and get OtherActor from that

#

Maybe I could use that linetrace to check what part of the body of that OtherActor got hit and do a flinch anim based on the body part got hit

#

Though I have more serious issue in my animation where client animation are twice as fast then the server for AnimSeq. Anyone encountered the same issue and how to deal with it?

viral mason
#

Ok i have a bit of an issue

#

So I made a custom crouch movement system

#

If a client is the server.. that person can see others movement

#

If a client is not they cannot see the crouch movement

#

So if i have 3 clients.
Client 0(Acting as player & server) they can see client 2/3 movement fine
Client 1 Cannot see client 0 or 2's movement.
Client 2 Cannot see 0 or 1's movement

#

So to be clear, when I'm saying "cannot see movement" I mean.. they see it initiate.. then the movement stops immediately.

dull yoke
#

I'm guessing you are not using replication. When a client performs crouch, it is only performed in the client-side. the server does not know about it and can't tell other clients you performed it.

viral mason
#

No I am

#

I'll get you a small video/gif

#

Instead of performing the full action, they start to... then stop on other clients

dull yoke
#

If so, then I think I've read somewhere with similar issue as yours "See it initiate, then movement stops immediately"

#

let me check on that

#

try to post the video, might be useful for us

viral mason
#

You can see on the far right its just "shaking" or something

#

but the server (big window) can see it fine

#

I have a second monitor with the Client 2 which I'm doing the crouching on ^

dull yoke
#

This old forum post might be the same issue as yours?

#

The posts are not helpful until the end of the thread though

#

I'm just not sure what's the status of it now

viral mason
#

Damn, back in 2014

dull yoke
#

Sorry for asking, but you did use Run on Server and NetMulticast to replicate the crouch on clients?

viral mason
dull yoke
viral mason
#

I don't use animations 😛

#

I'm just moving the char down a little bit for now

dull yoke
#

ah, what node did you use for moving the char down??

viral mason
#

That's my entire crouch section

dull yoke
#

I'm no expert at replication yet, just still learning it like you. But can you try changing your CrouchClient from "Execute on owning client" "Execute on all clients"?

viral mason
#

Well

#

I have 2 events

#

CrouchClient & CrouchServer

#

If the client has authority (aka the server) then it'll run Crouch Server

#

If the client DOESNT... It'll run Crouch Client & Crouch Server

#

which might be my issue

#

cuz it's running twice.. and i have a player crouched boolean

dull yoke
#

I think that's just fine

#

But I'm assuming the "Execute on owning client" would only execute on the client that performs the crouch and would not replicate on other clients

#

So "Execute on all clients" might do the trick?

viral mason
#

I don't see an "Execute on all clients" option

#

(Top right)

dull yoke
#

Sorry, I meant Multicast

viral mason
#

I've tried Multicast for crouchclient event

dull yoke
#

Ah I think I Multicast fails because its being run on client (HasAuthority->Remote)

viral mason
#

If it's multicast its working the same as when i do "CrouchClient on owning client & then call crouch server"

dull yoke
#

Can you try to disconnect the CrouchClient and...

#

sorry, no don't disconnect

#

But from the end for CrouchServer, call CrouchClient (Multicast)

#

And from your "Switch Has Authority", its backward

#

when Remote, pin it to CrouchServer

#

The reason is, if you're on client-side (Remote), that's where you want to call the Server event

viral mason
dull yoke
#

yes

viral mason
#

Flickers the same way

dull yoke
#

then on at the end of CrouchServer, call CrouchClient so the event would be propagated to clients

viral mason
#

?

#

CrouchServer & CrouchClient both get sent down the same pathway

dull yoke
#

Let me bring up my editor

viral mason
#

Those 2 red nodes on the left side is crouch server & crouch client (below comments)

dull yoke
#

Yes, but right now the CrouchClient (Multicast) is being called on the client side because of the SwitchHasAuthority->Remote

#

that will be ignored since Multicast node has to be called from Server

viral mason
#

I've tried it like that

dull yoke
#

Here's the BP version of what I've done from my C++ code

viral mason
#

Odd, that doesn't work for me :/

#

uhm what

dull yoke
#

You probably might have a deeper issue?

viral mason
#

Such as?

dull yoke
#

Its working on my C++ code, though the client anim play rate is twice as the server though

#

I'm not sure, maybe the same issue from the forum I posted earlier?

viral mason
#

Just an FYI

#

I made a little print string node for both authority & remote "has authority" switch

#

So if remote it would print "Remote perms"

#

if authority, it would print "Authority perms"

#

And the server came back as "Authority perms"
The clients came back as "Remote perms"

dull yoke
#

yes, that's expected

viral mason
#

you have it backwards then

dull yoke
#

can I try to look at your BP again?

#

what do you mean?

viral mason
#

wait

#

Ok so i replicated what you did

#

so if authority, it bypasses others and goes straight to calling method and such

#

But if server crouches it doesnt seem to replicate on clients

#

So now..
Client 1 can see Client 2 crouch

dull yoke
#

yeah, sorry I was wrong about the authority

viral mason
#

But client 1 can't see client 0 (server) crouch

dull yoke
#

both remote and authority should call CrouchServer

viral mason
#

Authority -----> Server

#

Remote ------> Remote client (Remote from server)

#

I think i got it

severe widget
#

if both call CrouchServer... Just call CrouchServer

viral mason
#

I made remote call crouch me then call crouch server

#

then authority call crouch server

#

crouch me is the event for starting to crouch (the actual movement of it)

dull yoke
#

You can do what PlaceholderName just said, get rid of SwitchHasAuthority since both pins calls CrouchServer

viral mason
#

yayy

#

works

dull yoke
#

So the takeaway I learned from that before is, Remote can't call "Run on owning client" and "Multicast" since they'll just be ignored

#

It has to go through the server

#

Remote calls "Run on Server"

#

"Run on Server" calls "Multicast" (or "Run on owning client")

#

then that will be replicated to server and clients

viral mason
#

Time to cleanup the names 😄

#

"Crouch server" for both authority/remote 😦

#

I feel like I don't need an event to call the crouch movement

#

wait

#

Is "switch has authority" even needed if both Authority & Remote call "Crouch Server" @severe widget ?

#

Since regardless of authority it calls the same thing...

severe widget
#

what I'm saying

viral mason
#

Both authority & remote call crouch server event

dull yoke
#

Yeah you can get rid of that now (SwitchHasAuth)

viral mason
#

Alright, thought so

#

Cleaning up the names & such 😄

dull yoke
#

I still have the issue where AnimSeq are playing on clients twice as fast from the server. Not sure what's causing it as DeltaSeconds, CustomTimeDillation, GlobalPlayRate are all the same for server and clients. AnimMontage play rate are fine though.
https://www.youtube.com/watch?v=b9HOfGOlaH0

UE4 AnimSeq on client plays twice as fast on Clients(mid and right) than Server(left). The Server anim play rate is the expected. Checking the DeltaSeconds, ...

▶ Play video
viral mason
#

I'm still going to keep a switch has authority so I can easily add a call in later when they crouched

glad sedge
#

on the playercontroller how do I initiate the GameMode to respawn my PC's pawn?

#

Is it just an event that's called on the PC from the Gamemode?

#

I suppose it's actually defined as the DefaultPawnClass.

hard nymph
#

Anyone know if sessions are able to be created and joined without having to open a new level straight after creating the session/client doesnt need to travel to the server's level? Trying to configure creating/joining a lobby from my menu

modern dome
#

Following Scenario:

I have an Event. This Event should be called locally on my machine but also replicated to all other clients aswell. However I don't want my Machine to wait for the Multicast RPC but execute the Event separately.
Is it possible to exclude my machine from a Multicast?

jolly siren
#

just add an if in the multicast to not execute its logic if it is locally controlled

inner iris
#

Just referencing Battlegrounds (a UE4 game) and it seems no matter what server region I was on, the gunshot sound, muzzle flash and trace / bullet impact FX are all called instantly on the client (of course the server would also have to also do the trace to verify if anything hit and actually deal damage).

This brings up the question of if on your client, you were perfectly on target and you see the bullet hitting where you were aiming (an enemy for example) but on the server, your aim or the enemy could have moved enough in the time it takes to call the logic on server and send the info back to the clients to have the shot miss.

#

Is this just general "desync" and considered better to give players instant feedback (calling all cosmetic cues of the shot locally instantly) even if the result is not the same as the server's version of the shot?

#

I know this is a common area of frustration with some games "where are my bullets going?", so I wonder if it's either a design choice to wait for the server to respond before firing but have a more consistent response when shooting or have the client fire locally instantly but deal with frustration where you see shots landing that didn't actually hit at all?

fossil silo
#

hey guys, ive been testing my multiplayer for a bit, with super smooth movement on all clients, then allof a sudden today, the clients are jerking in their movements...Any ideas what may be causing that sorta issue?

vital steeple
#

is tehre a reason onrep notify is a little slow? It seems to take about a full second

dull yoke
#

@inner iris, you are correct that its a design choice. You have decide whether you want a more accurate, more cheat proof but delayed response to the players specially on those with slower connection VS less accurate and less cheat proof but more responsive to players which gives better gameplay experience. All Lan/Online FPS games I've played decades ago doesn't have that kind of server check where players would experience and think "where did my bullets go?" so I can't say much about Battlegrounds.

#

@fossil silo, I'm experiencing the same issue. I'll let you know if I found something about it. Also, please let me know if you found what's causing it.

inner iris
#

@dull yoke watching some GDC vaults (Fighting Latency on COD BO3) it seems that a lot is done on the client visually to give a smoother experience but with lots of super optimised prediction tricks to help iron out inconsistencies and issues. Really interesting stuff but since UE has its roots in shooters, it probably already has a lot of super optimised netcode.

#

Regarding the jerking movement question @fossil silo I recently had a similar issue- when doing any actions that weren't part of the character movement component like sprinting or crouching. I fixed it by calling the same sprint or crouch function instantly first on the client and then on the server- it made the movement feel super smooth with no choppiness. I guess before, the client had to wait on the server to apply the movement so it was super choppy. Not sure if you have the same case here but all movement is silky smooth since I did things on the client first (not sure if that is common practice)

fossil silo
#

interesting @inner iris thank you for the feedback

#

and yes @dull yoke ill letcha know 😃 and thanks

dull yoke
#

I fixed mine by fixing my other issue which was client AnimSequences plays twice as fast from the server (i.e., walk speed is normal but walk anim is twice as fast)

#

I don't know what's causing it though, tried to remove all BP nodes and recreated a simple Walk blendspace on my AnimBP but still clients' walk anim are still fast.

#

The fix was to completely recreate my AnimBP from scratch, copy my original nodes, recreated some AnimBP variables that got lost from copy-pasting and now anim speed are same for all server and clients.

reef berry
#

@inner iris If you're referring to pubg by "Battlegrounds", all of the shooting logic is client side. For instance there is a bug that some players don't load buildings in some games, and are able to kill people through walls, etc. I disagree with having 0 server side checks, as movement is client side too (you can walk right through anything), but I also don't run a game with 400k concurrently active players so don't know how much more of a server strain it would put on it.

raven holly
#

Alright.. question about ping

#

So usually this is how you calculate ping? But i dont actually think this is correct.

#

Anyone have some insight on this

#

When i use cmd it's like 30 less

wet oriole
#

Hello guys, i want to know on a Windows Server 2012 R2, do i need port forwarding to use open [IP] command to join dedicated server ? or i just need to add a rule in windows firewall ?

raven holly
#

if you get it from a provider you dont need to port forward, just windows firewall @wet oriole

#

unless you use AWS

#

then you need to do their firewall rules

wet oriole
#

@raven holly Ok thanks, I think i should add that dedicated server to firewall rules and make all port available, right ? because i to run different instances from dedicated server .exe

modern dome
#

@raven holly Isn't the Ping in the PlayerState already in ms?

#

I wonder why it's a byte and not an Int tho

#

you might aswell convert to Int before multiplying.

#

Yep, convert to Int before multiply

#

and you should get your ping

mellow cipher
#

^

inner iris
#

@reef berry Wow so PUBG lets the client decide if they hit something?? That's pretty crazy- seems like the one thing that is always a big no no to prevent cheating.

I guess it would work like this- client fires trace locally, if it hits enemy, run server RPC that deals damage after somehow confirming the hit or possibly just deals damage and doesn't even confirm?

modern dome
#

There is an uncompressed float which holds your exact ping, but it's probably not accessible via bp

raven holly
#

@modern dome yeah i get ping from player state but its inaccurate af

#

off by like 20ms

#

20-30

modern dome
#

@raven holly

raven holly
#

is that in player state?

modern dome
#

yeah, but you probably need C++ to access it

raven holly
#

link

raven holly
#

what does compressed ping mean

#

🤔

#

rounded?

modern dome
#

that's your byte ping

#

divided by 4

#

The Ping you get from Player State = ((byte)(ExactPing/4))

raven holly
#

HMM

#

would it be any different

#

someone should test

dull yoke
#

@inner iris, all lan/online FPS games I've played (decade ago) always seems to use client-side to check if they hit something since server checks are very expensive so you they only do server checks for the most important things in the game. To compensate against cheaters, they install an agent on your computer that monitors if there are processes that tries to modify their game state in memory. Though of course, not everyone likes it.

raven holly
#

i do both

#

client for accuracy, server for verification

inner iris
#

@dull yoke I'd say a gunshot would warrant a server check since it determines if a player lives or dies, no? Would there be anything more important than that in a game?

If you do pass on the information from the client, would the server need a "snapshot" of the frame the client shoots (client + enemy position in the world to retrace to make sure the shot was possible)?

#

Lots of time traveling in MP logic it seems 😄

raven holly
#

i send hit data to server re-do the trace to check if it hits a wall etc on server

inner iris
#

But what if the target has moved enough in the time it takes for the server to run the trace that the shot misses?

#

A fast moving enemy for example

#

It wouldn't replicate the exact same positions that the client's shot took right?

raven holly
#

if they hit it on their client, it should hit

#

this is what games mess up

#

they compromise for protection when really they fuck their players

inner iris
#

It seems a few frames can make all the difference- the server, the client and the enemy all have a different idea of where they are currently

raven holly
#

think about ping of both players

inner iris
#

So for something moving fast, it could be something different for all of them and hit on the client but not on the server

raven holly
#

youll end up with a h1z1 hit reg

inner iris
#

Yeah exactly

raven holly
#

when only 20% of bullets register

#

i trust my clients to send their hitscan to the server

#

server just checks for walls inbetween their hitscan

#

to prevent removing walls hack

#

aimbot can be detected through other means

#

hs ratio, distance to player

inner iris
#

Ok so this eliminates a lot of the shots missing , but what if the client who is sending the hitscans is super laggy and is seeing players before they have moved behind cover, shooting them and then dealing damage

#

When from the enemy's perspective they were completely behind cover

raven holly
#

but if you want a good PVP game you have to trust if the clients hit something, let them hit it

#

true

#

you can check a few things

#

check the actors distance from the hit location with some error allowance

#

e.g 2 metres

inner iris
#

Good idea

#

Then don't count any hits past that distance?

#

Nice I'll try that out

raven holly
#

yep

#

i use that as well as the object checking

#

if either fails itll stop the calculation and it will use the servers trace instead

#

so itll still impact something

inner iris
#

Great info

#

Thanks a lot!

raven holly
#

np man 😃 #powertoanticheating

inner iris
#

It seems H1Z1 definitely doesn't have a lot of this kind of stuff properly implemented

#

Laggy players always have a big advantage

raven holly
#

h1z1 is server side hit trace

#

so when you shoot, server does the trace not the client

inner iris
#

Ah yeah, explains the delay for hitmarkers sometimes

#

They still fire the cosmetic stuff right away on the client though right?

raven holly
#

yep

inner iris
#

Just waits for the server to actually deal damage

raven holly
#

yeah well thats normal

#

hitmarkers are sent when the player receives the damage

inner iris
#

Ah yeah but the actual traces are done by the server so the client is less accurate

dapper galleon
raven holly
#

well in my game anyway

#

but never trust what the client does 100%

inner iris
#

Thanks @dapper galleon !

raven holly
#

always do some sort of check

inner iris
#

Will do, super interesting stuff around this- interesting to see what exactly is left on the client for responsiveness etc all for the illusion of a smooth experience

raven holly
#

and theres different things you can do, but depends on hitscan vs projectile

inner iris
#

I'm using all hitscan right now to minimize pain 😄

raven holly
#

yeah its a pain you bascially have to do everything 3 times

#

1: owning client, 2:server, 3: players around you

inner iris
#

Ugh yeah sounds like a big pain

raven holly
#

but its worth it

#

if you have all 3 its great

inner iris
#

Yeah some things are much nicer as projectiles

#

What logic do you call on the players around you?

raven holly
#

depends what kind of game

inner iris
#

Do they also simulate the projectiles on their client?

raven holly
#

what we talking about

inner iris
#

I'll be implementing non hitscan weapons for grenades/rockets so will eventually be adding them

raven holly
#

pubg?

inner iris
#

When you mentioned you have to do everything 3 times for projectiles

#

The 3rd reason

raven holly
#

your grenades would be replicated actors

#

projectile actors

#

on the server

inner iris
#

So you wouldn't simulate the projectile on the client?

#

Or would you interp between the client's simulation and the servers sim?

raven holly
#

well you would want to run away from a grenade right? lol

#

if you seen it coming

#

that would be a client authoritive grenade then

#

kinda bad

inner iris
#

Yeah 😄 I mean would you spawn the actual projectile on the client and then on the server after or just on the server and deal with the slight input lag?

raven holly
#

if the person who threw it was lagging the grenade could just randomly appear and boom

#

just the server and compensate for lag with throwing animations

inner iris
#

Another amazing idea haha damn

#

So the client has a nice wind up anim when pressing the throw grenade button

raven holly
#

so when you are pulling the pin, it spawns the actor on server, then when you throw away it goes

inner iris
#

Server throws, client winds down

#

Feels smooth on the client

#

Genius!

raven holly
#

😉

inner iris
#

Love these clever but simple tricks to hide the latency

#

The GDC talk on COD BO3 had some similar stuff where they'd have the head of the player offset in the direction they were running for more accurate hit detection

#

They saved something like 90ms of percieved latency that way

raven holly
#

nice

modern dome
#

Does someone have a lot of time and patience for me?

#

I actually want to implement something pretty easy:
Seamless Travel with fade in/ fade out.
But I can't make it work somehow

dapper galleon
#

how are you trying to do it?

modern dome
#

I want to have it the following way:

  1. Players play around in Map
  2. One Player touches special Actor that initiates the Seamless Map Travel(TravelActor has targetmap and location)
  3. Local Player fades to black and notifes everyone it wants to initiate a Travel
  4. If Server faded to black, wait for all clients to fade , too.
  5. If all faded to black including Server, do the actual "servertravel mapname"
  6. Server waits for everyone to finish travelling (World should not tick yet!)
  7. If everyone travelled (Use OnHandleStartingNewPlayer Event for this?) , begin world Tick and fade in everyone's screen
#

I tried using the GameState, but I have problems notifying the Server that everyone faded to black, because it said only one player is ready.

I then tried to communicate between PlayerControllers with RPCs, but that didn't work either

dapper galleon
#

So your problem is how to know every client has ended the map travel?

modern dome
#

both actually. I don't know how to notify the server that everyone did somethign

dapper galleon
#

Did you notice GameMode::PostSeamlessTravel()?

twin juniper
#

is there a way

#

to limit a multicast to run on ALL - the local client who called it?

#

becaue im getting it called twice basically

#

for my chat box

#

its sending it on all clients, but then twice on the local client

jolly siren
#

run the function locally on the local client and then put an if statement in the multicast to not do anything on local client

twin juniper
#

@jolly siren what would i do

#

how would i check if its local

#

in th emulticast?/

jolly siren
#

IsLocallyControlled

twin juniper
#

ok ill try it

twin juniper
#

@jolly siren didnt work 😭

jolly siren
#

show code

twin juniper
#

1 sec

#

rebooting editor

jolly siren
#

PC only exists on local client and server

#

so that makes no sense

twin juniper
#

o

#

ya

#

Rofl

#

lemme see

#

@jolly siren yeah so every time i send it

#

it sends the msg 4 times

twin juniper
#

i think i got it

#

i just changed it to use a repnotify

#

i created a repnotify variable called "Chat msg" on the character

hushed maple
#

Just wondering, has anyone tried hooking up their game with Wocommerce API?

#

For exanple, buying a digital item in Wocommerce unlocks thr asset in game. I want to use this as a main game mechanic but I'm not a coder

dapper galleon
#

Should the client be able to call run on server rpc on the game state?

slim holly
#

I think not

dapper galleon
#

@slim holly Looks like it doesn't. Thanks.

glad sedge
#

Is it safe to put game win triggers inside PlayerState?

#

i.e. 10 kills to win, sort of thing?

inner iris
#

The rules are generally defined in the GameMode and tracked by the GameState- PlayerState is per player and doesn't track global score. You can get an array of PlayerStates in the GameState and determine if a player has won there (please correct me if I'm wrong, also still learning)

glad sedge
#

Yeah that's what I'm doing now.

#

I create a TMap via my constructor in gamestate that creates a reference to each player .

#

Though I might come at it a different way to handle player leaving / joining.