#multiplayer

1 messages ยท Page 506 of 1

steady briar
#

sounds about right

winged badger
#

and all you need to do is following:

#

1 - server sets new combat mode

#

2 - OnRep function, which is just UFUNCTION() without any additions fires on all clients setting the boolean to match the servers

#

3 - inside that OnRep, you call a UFUNCTION(BlueprintImplementableEvent) void CombatModeChange(bool InCombat):

#

sending it the value of IsInCombat as parameter

#

4 - you replace that multicast node in BP with that EventCombatModeChange

#

and that's all, everything works

steady briar
#

ok so part of why i got so stupid with my thing here... is... theres a need to make a client function that all it does is call the multicast right? to go from C++ to BP. i dont think u can make a BlueprintImplementableEvent that is on the server, so theres a go-between?

winged badger
#

you can make one just fine

#

and server should call it separately whenever changing IsInCombat boolean, preferably from a function void SetIsInCombat(bool NewCombat);

#

as the OnRep doesn't happen on server

silent phoenix
#

Hey team,

If i have a spline mesh that may end up extending for very long distances would I be better to split that up into multiple splines for performance or would keeping one actor be better regardless of size?
and is there anything else i could do to improve multiplayer performance of spline meshes that are modified at runtime and could potentially be very long

winged badger
#

c++ or BP and how long is long?

steady briar
#

@winged badger im a bit thrown by that last part.

winged badger
#

which part?

steady briar
#

are u saying CombatNotify and EndCombatNotify (the things changing the bool) should be run on server and then call another function... on the client? i dunno my brain just goes in circles with that part

#

and the "you can make one just fine" part. make a simple go-between function? or a multicast BlueprintImplementableEvent

winged badger
#

ah, didn't pay much attention to those as they are largely irrelevant for networking here

silent phoenix
#

Hey Zlo,

Blueprints, 8129x8129 landscape.

#

in theory could go around and around the landscape but likely never would

winged badger
#

how many spline points?

#

would you guesstimate

silent phoenix
#

Spline pointed currently being spawned every 2 seconds of motion

#

I guess that is the better question. How many points should i limit the spline to before forcing a new spline

winged badger
#

that is barely 300kB/hour

#

you do have a limit of 40kB per package tho

#

and one vector is 16 bytes

#

i'd leave myself a buffer there, so say 1024

silent phoenix
#

How did you calculate that? Sorry i've only started learning unreal engine 3 months ago ๐Ÿ™‚ I would love to learn that. Any resources you could recommend lol?

That should be plenty though.

The only way I could get this working was by executing every addition to the spline mesh as a multicast but I'm assuming that there is a way I can instead run this on the client only and update the other clients every 'x' amount of seconds of something.

Is there anything you would recommend I take a look at to improve network and gameplay performance?

winged badger
#

you can cache the spline points as vectors locally

#

after say 30 seconds, you send a Server RPC with an array of vectors

#

let the others catch up

silent phoenix
#

Ohh yeah I think I remember seeing add spline as an array eh?

winged badger
#

no idea about that

#

but you can reconstruct one from Vector points

silent phoenix
#

I'm pretty sure there is a node just for that lol but either way could set that up

winged badger
#

for this, i doubt you need tangents and roll

silent phoenix
#

I do have an issue with the spline mesh on hills. the mesh is always flat when i would like it to curve with the hill. I assumed I could fix it with one of those lol

#

Thank you for your help though ๐Ÿ™‚

winged badger
#

it should pretty much do that by default

#

if your SplineAxis is set correctly

silent phoenix
#

My spline axis? Sounds like it isn't set correctly lol

#

Not sure what you mean

winged badger
#

i don't recall what function is called, but it does start with Set and ends with Axis

#

it basically determines how your mesh is layed out along the spline

#

or rather which of its up/forward/right vectors is running along the length of the spline

silent phoenix
#

The only thing i can find is set forward axis in the details panel of the add spline mesh component node which is set correctly

winged badger
#

aside from that

#

you can set points up vector to be the hit normal of the HitResult when you trace downwards into the ground from the SplinePoint vector

#

and you don't need to replicate that, each client can do its own damn trace ๐Ÿ™‚

silent phoenix
#

Already got the linetrace happening on the client ๐Ÿ˜›

winged badger
#

i mean when it gets replicated points from other clients

#

it can do a trace down to determine the up vector at that spline point, instead of having it replicated to it

#

if you're not doing that already

silent phoenix
#

well right now im running a line trace to detect if the player is on the ground and if it is its adding the spline mesh point every 2 seconds currently so i was thinking I could just use that same line trace info

#

I found the nodes Set Location at Spline Point, Set Tangent at Spline Point & Set Up Vector at spline point.

Set up vector will do the trick i think?

winged badger
#

to hit normal

#

yes

silent phoenix
#

Thank you so much I will work on this tomorrow when I have some time ๐Ÿ™‚ Now I can say I did something today lol

novel citrus
#

Hi , We are looking to create a mobile multiplayer, I am not sure which subsystem should i go for.
please help

viscid bronze
#

I run the delete weapon server everytime i want to delete the weapon base of a specific character (the player's character), because if I don't the weapon base will float in the air even if the character blueprint is destroyed

however, if this script is run on the server player, it will destroy it on the server, but not the client; but if it is run on the client player, it will not destroy it at all.

#

pls help

faint dock
#

sounds like the weapon is not replicated

viscid bronze
#

hmm ill try that

#

you mean the weaponbase blueprint itself?

#

@faint dock

faint dock
#

the weapon you want to delete must be replicated

#

the actor

viscid bronze
#

alright

#

@faint dock

#

it still doesnt work like this

faint dock
#

wait you do a multicast for the delete?

#

just delete it only on the server and make the weapon replicated

viscid bronze
#

does the pic of settings above count the weapon as replicated
do i have to replicate movement

faint dock
#

i dont think you need movement

viscid bronze
#

alright

#

still doesnt work

#

this is in a widget blueprint btw

faint dock
#

cant you do this on the player?

#

also only use get player character if its local

viscid bronze
#

idk
i was following the blueprint multiplayer guide by Unreal
this is basically the OnClick of a button that switches characters

#

is there a function that can detect when a blueprint class is created

#

because this switch character is basically destroying the old class then making the player possess a new blueprint class

faint dock
#

try a print text on the end of DestroyActor and see if it even get this far

viscid bronze
#

alright

#

ok so the function is only running on either the Server or Client1, depending on who switches class

faint dock
#

how the event is server only ?

viscid bronze
#

idk the custom event is set to Run on Server Reliable

#

but it still only executes on the client that is switching blueprints

#

aka pressed the button

faint dock
#

i think you cant do rpcs in widget

#

just tested it my self

#

no wait

viscid bronze
faint dock
#

ok looks like rpcs dont work in widgets good to know^^

#

so you have to do it in the player

viscid bronze
#

right
ill go and try that

#

wait so i threw this script in the parent player controller class

#

how do i access it from the widget now

faint dock
#

get player controller

#

not sure but i think you cant do rpcs in the playercontroller class too

viscid bronze
#

ok then ill put it in the gamemode is that ok

faint dock
#

i would do it in the playerclass

#

do you have a parent for the players then you only have to do it one time

viscid bronze
#

0_Base is the parent class

#

for Blue, Red, Yellow

faint dock
#

they are children?

#

den use 0_base

viscid bronze
#

i am

#

this is in 0_Base

faint dock
#

and now call it from the widget

viscid bronze
faint dock
#

use get player character

viscid bronze
#

ah alright
its running on the server now
thanks

umbral loom
#

#offtopic virtualbox can't do DX11 so virtual machine is out of the question? ffs.

faint dock
#

no idea also not a good channel for this kind of question

bitter oriole
#

@umbral loom Virtual machine for what purpose ?

umbral loom
#

@bitter oriole for multiplayer. so i launch one instance (on vm with second steam account), hit launch session obviously on spacewars id......... then I launch it not on vm in main machine, and see it in the list of games.

bitter oriole
#

You'll probably need a second machine anyway at some point.

umbral loom
#

arg

#

i fully understand copyprotection stuff, i don't want random fks being able to copy my game, but damn this makes it hard to even test stuff.

bitter oriole
#

Doesn't have much to do with that

#

And everyone will be able to copy your game

umbral loom
#

๐Ÿ˜‰

bitter oriole
#

It's not exactly a new problem

umbral loom
#

so I guess my question is why can't that game launch in a win10 virtualbox instance

bitter oriole
#

Because VB either doesn't support HW acceleration, or you didn't set it up properly for that

umbral loom
#

leaning towards the forward, I have it set up for 3d acceleration, and the error message is: "DX11 feature level 10.0 is required to run the engine"

bitter oriole
#

Yeah, it is

#

You need HW DX10 to run UE4

#

Try VMware instead

umbral loom
#

which virtualbox doesn't seem to support no matter what is clicked. ffs. is there a free vmware I can use to launch the vb vm?

bitter oriole
#

VMWare isn't free, no

umbral loom
#

grumble

#

i guess i need to find one of my friends who has a corporate license

#

smfh

grizzled stirrup
#

Speaking of testing your build on 2+ different computers on Steam, does anyone know if it's possible to have steam auto update after you push the build live without having to close, wait and reopen steam on each of the computers?

#

Have found this to be a bottleneck when trying to test multiple builds

bitter oriole
#

You can just wait, but restarting Steam is much faster

grizzled stirrup
#

Ah so it does eventually happen

#

But not fast

#

Got it

bitter oriole
#

However, you don't need to push builds in the first place

#

You don't even need a Steam ID for your game

umbral loom
#

i don't have one of those friends with a vmware license. dag nabbit

grizzled stirrup
#

Testing steam callbacks

#

Is it possible without directly using steam?

bitter oriole
#

No need for any of that

#

You do need Steam

#

But the Spacewar default ID works fine

#

Just have the game on two machines and run it with different Steam accounts, no packaging even needed

grizzled stirrup
#

I've found it's actually way faster to download the ~20 MB update from steam rather than copy the whole file across

#

Ah so like the whole editor project?

#

And do launch game?

bitter oriole
#

Whichever works best, but yeah

grizzled stirrup
#

That could work if I duplicate any changes on both machines

#

would just depend on the complexity of the changes

bitter oriole
#

Just push and pull in source control ๐Ÿ™‚

grizzled stirrup
#

True! thanks!

umbral loom
#

why can't there be an easy test method for indie devs that don't have budgets for second machine or vmware??!!

bitter oriole
#

Because games aren't made by one person alone

#

So no one really cares about that particular setup much

#

Besides, you don't need to test the Steam callback setup every day of the week

#

And multiplayer games need, well, multiple players for much of the development, so naturally you have multiple machines

umbral loom
#

I have, alone, done that. def not every day of the week that's true. i don't want anyone else to test it until I know it works.

bitter oriole
#

Let me rephrase

#

Games that matter aren't made by one person alone

#

๐Ÿ˜‰

umbral loom
#

nobody gives a fuck about the thing I'm trying to do alone.

#
  • you rephrased
bitter oriole
#

You'll need playtesting all along the development so find a close friend to test it

umbral loom
#

smfh

#

games that matter. as if the only games that matter are AAA games.

bitter oriole
#

No one said that

#

But UE4 is absolutely not made for single developers by any stretch

umbral loom
#

iirc the last huge ass game that was shitty and sold big was .. what, angry birds? made by how many ppl?

#

you're right

bitter oriole
#

Angry Birds was no solo effort by any means

#

The closest to solo that still was a hit game is probably Stardew Valley

#

A single-player, pixel-art game that was like 7 years in dev

umbral loom
#

disagree

bitter oriole
#

On what ?

umbral loom
#

that it was any kind of hit

#

i had to look it up.

bitter oriole
#

It sold 3.5 million units

umbral loom
#

shrugs

#

god i wish i could make something that sold that hard at $2 or even $20 or $59.99 a copy.

bitter oriole
#

Steam's average is less than 1,000 copies across all titles

#

So don't hold your breath

umbral loom
#

I'm not.

rain coral
#

Hey, I've reparented my Pawn class to the Character class, and I notice that the mesh component on simulated proxies zeroes out the rotation every time they move. Anyone familiar enough with the Character class to understand why?

umbral loom
#

does the rotation get moved to the parents?

rain coral
#

The parent of the mesh (the capsule) doesn't have any rotation in my game code, if that's what you're asking. I only need to replicate the movement of the character, not the rotation actually

umbral loom
#

sounds like the rotation handling is undefined and defaults to zero.

rain coral
#

Here's an example. The character on the left is a client. The rotation is controlled by how they aim, hence why the rotation doesn't need to be replicated. But once the client moves, and when replication occurs I suppose, the mesh rotation is zeroed out, somewhere in the Character or CharacterMovement code.

uncut pier
#

Hey. What are the best resources for learning to make a multiplayer game with UE?

jolly siren
#

The pinned Network Compendium, Shooter Game, Unreal Tournament, and everything else pinned in this channel

uncut pier
#

Today I learned about the pin button. ๐Ÿ˜… Thanks!

jolly siren
#

np ๐Ÿ™‚

dark edge
#

@hoary sandal that should work.

hoary sandal
#

@dark edge it doesn the only issue is that the the value is not the same for the two meses

silent birch
#

Hi

dark edge
#

@hoary sandal not the same on one client or on all? As is it won't be the same across the network as you're running the random everywhere. Run it on server to set a color and use repnotify to apply the color.

hoary sandal
#

@dark edge I have two meshes one for the hand in first person the one the player sees and one for the player 3rd person, I basically want the same color on arms and body, but different between players

dark edge
#

@hoary sandal you gotta generate the random color on server and use it everywhere. Use RepNotify to apply it.

hoary sandal
#

ok going to try that thanks ๐Ÿ™‚

hoary sandal
dark edge
#

That should do it.

hoary sandal
#

yeah it does work thanks again I didn't imagine it being so simple ๐Ÿ™‚

#

ohh can I ask you one last thing, we are trying to wrap up the game for the mega jam here

#

I have this small inventory system, once the client uses the piece it would destroy on the server as intended but the client still has the widget

fluid flower
#

has anyone else experienced worse connection quality with Steam recently?

#

before I could connect to a lobby session in 3s, now it takes 20s+, and a ton of packet drops etc. I even tried an older build of my game which was fine, is also now super bad at connecting etc.

ebon bramble
#

In my game, the server totally manages the array of item slots (struct)

#

And i use RepNotify heavily

#

I use repNotify on that array of item slots and trigger a refresh event on the client.

#

So then the client can call methods like requestEquipItem or request SwapItemSlot to move an item to a diff slot

#

And then the server actually does all the logic and checking, and then edits the array, and then RepNotify triggers and the client gets the new array from that and rebuilds the UI

#

That way cheating is prevented too of course

#

The client has a limited API if you will

#

(Those 'request' methods are repped to the server of course. )

peak star
#

@ebon bramble how to you make it so the repnotifies only go to the people affected?

#

So it doesnt spam in a massively multiplayer setting?

ebon bramble
#

You can pick onlyOwner

#

Under repnotify

peak star
#

In the replication conditions? I never knew how those worked

ebon bramble
#

And make that InventorySystem component be a subcomponent of the character actor

peak star
#

Cool :)

ebon bramble
#

Yes

#

That's how I do it

peak star
#

What does its component-ness have to do with replication in this context?

#

Oh because owner

ebon bramble
#

It doesn't.. just that if it's owned by the actor and the actor is owned and possessed by that player then

#

Yea

#

Ownership

peak star
#

It knows who the owner of the connection is vecause it is a component righr?

ebon bramble
#

Yeah it just worked for me. I guess all components of an actor inherit ownership of the playerstate that owns the actor

#

Something like that

peak star
#

So then the rep condition knows to only rep to the player that owns the actor that has the component

#

Sonething called outerchain?

ebon bramble
#

Yeah I don't know all the details I've never had issues related to that its just worked and been mostly common sense, intuitive

peak star
#

Nice

#

Thanks for the info

ebon bramble
#

Seems like it does a good job guessing ownership lol

peak star
#

In c++ people talk abour Owner in terms of climbing outerchain whatever that is

dark edge
#

@ebon bramble do you feel like RepNotify is the preferred way to do things if possible? I'm thinking it is, although it sometimes is picky about structs.

ebon bramble
#

Yes unless you want to get into C

#

Well you can also use explicit method calls but RepNotify is convenient and reduces verbosity . It only reps what it needs to do the most part .. deltas

#

You can always optimize more in C im sure but there can be significant time investment there, trade-off . I don't know C well

#

You are right in that repping arrays of structs can cause issues unless the structs are small . Keep them small w no substructs

#

I've had a twenty second lag spike because I was an idiot and repped a giant nested struct array with like 50 fields lol

#

Refactored that real quick

#

So my item slot struct is like 4 primitives

#

Itemname, quantity being two

marsh shadow
#

so in bp how do i make the server switch/restart a level

#

witout kicking everyone on the server

#

tried servertravel

worthy perch
#

Need seamless server travel.

#

Set that in the GameMode. It's just some bool.

marsh shadow
#

i activated seamless server travel in the gm

#

@worthy perch

#

so do i use execute console command?

nocturne prism
#

Any body have any idea how I could keep track of racing placement in a multiplayer racing game

limpid agate
#

Removed incompatible build: ServerBuildUniqueId = 0x00000000,

#

anyone know what causes this with steam?

dark edge
#

@nocturne prism spline is probably the approach.

nocturne prism
#

spine?

dark edge
#

I would use a spline to build the track, then it should be fairly easy to project car position to place along spline.

#

Or you can just use collision boxes if you just need time splits and not constant position

nocturne prism
#

Ive seen the collision box approach I don't really think I need the constant position? any pros cons to both approaches?

limpid agate
#

are there alternatives to steam for onlinesubsystem that can be implemented relatively quickly?

light fog
buoyant wedge
#

Hello guys I have problem with a list of connected user. I have made the list in a event tick because I wanna add late the ping, but the array don't stop e create every second the same player. I need to be sure in the list there is only unique user name.
Any one can help? Thx guys ๐Ÿ™‚

winged badger
#

you need to clear verticalboxcenter at the start of that

#

if you want to go with that appraoch

buoyant wedge
#

If I clear. The list remain empty

winged badger
#

recreating player list on Tick is pretty terrible

#

you can setup a notification system, even in BP, for when a player joins/leaves

#

and if it looks empty, its because you're doing it on Tick

twin juniper
#

what is the best place to learn server optimization In mobile games because from the looks of it even the character movement is giving me a pain

#

in a LAN game

#

does anyone have any tips on what I should look out for fast paced game networking and some links to helpful stuff :/

#

thanks in advance

winged badger
#

it doesn't have to be the bandwidth

#

CMC can jitter for any number of reasons

twin juniper
#

well its not just jitter

#

its a problem with the clients

#

i didnt even touch the CMC tbh

#

and vanilla version is very bad at it in mobile

#

what are some tips to avoid this, or should I just try to go for a custom CM

buoyant wedge
#

@winged badger thx. Where I put the notification? In the game mode? Sorry I'm new on ue4 and programming

supple basalt
#

@twin juniper describe the problem exactly so that people could actually help you :)

twin juniper
#

Client Inputs AddMovementInput as usual and server doesnt respond very well

#

only replicating movement takes 4 kb/s

#

and AWS recommends 2kb/s for mobile games

#

I am not using AWS but

#

even if only movement takes 4kb/s

#

how should I get around it

#

my problem is when I join my session on a phone from another phone

worthy perch
#

4kb/s is just the default minimum amount, I think.
You can lower your minimum and that should probably get your 2kb/s if you have nothing.
I don't know why there even is a minimum.

twin juniper
#

there is too much packet loss

#

and character moves like 2fps and its not even smoothing

#

even tho I played around with the network properties of CMC

winged badger
#

you're not sending any reliable RPCs on tick, are you?

twin juniper
#

no not at al

#

just to test it out

#

I shut of all of my inputs

#

and stopped replicating all my components

#

only movement input is there

#

and yeah

#

and let me try it on a vanilla template

#

yup

#

its still there

#

I was expecting it to not

#

but yeah

#

im using 4.23

#

just open an empty project

#

and set play mode to listen server

#

and an extra client

#

and watch how the client moves on the server

rain coral
#

@twin juniper Any specific settings I should test with? Two characters look very smooth, with Net Update Frequency reduced from 100 to 20

twin juniper
#

humm I just did it with complete defaults

#

let me try with 20 tho

#

thanks

#

umm

#

it does look smooth on local but other clients are seeing it weirdly

rain coral
#

I just reduced it to increase chances for jittering, but I'm not that experienced with network settings

twin juniper
#

I am not experienced as well I only know the idea of writing my gameplay code in multiplayer

#

never got into advanced optimization tho

rain coral
#

Hmm, what I see isn't jittering, but it does extrapolate the movement on the simulated proxies, then when stopping it has to go back a little

twin juniper
#

that is there yeap

supple basalt
#

If the packet loss is too much (bigger than 10%), the available bandwidth is too small and RTT is significant, you won't be able to do much about it as that is textbook bad internet conditions.

twin juniper
#

well there are too many computers logged in to the router

#

im in an office

#

but surely it should not affect that much

supple basalt
#

Single process in editor with 2 or 3 players looks ok?

twin juniper
#

you dont use single process

rain coral
#

I'm in an office with 30+ computers too, but good internet at least

twin juniper
#

mine is ok to in single process

supple basalt
#

@twin juniper the emulation is fine on NullSubsystem as long you don't use statics

#

@twin juniper oh cool

twin juniper
#

but I also tried it

#

after packaged game

#

apk to mobile platforms

#

and its still there

supple basalt
#

If you are using WiFi, I expect a lot of packets to be dropped no matter thr signal strength

twin juniper
#

even through LAN connection ?

supple basalt
#

Have you tried Client Authoritative Movement enabled? Does it help? (You shouldn't ship with it enabled)

twin juniper
#

well

#

I saw that and tried

#

didnt notice any changes at all

#

I thought it would fix it since it would use client location right ?

#

nope

supple basalt
#

LAN should be ok, especially with Client Auth enabled. Never seen those happen..

twin juniper
#

let me get back to you

#

in a few minutes

#

I will try it in a packaged build :/

#

um

supple basalt
#

What's the listen server's or dedicated server's fps / tickrate? Maybe it does a lot of late updates or has a jittery update (time it takes)

twin juniper
#

u talking about this one right

supple basalt
#

Yep, those too

#

I usually set them from an .ini and I think it was also some kind of floating point threshold to be set or else it still won't let the client be authoritative (set it to 999999.0f). Can't remember for sure the variables name.

#

Do some tests and come back to us :)

twin juniper
#

sure thanks

rain coral
#

Alright, so I'm stuck on an issue. On Character, the rotation of the mesh component (and capsule for that matter) is reset every time movement replication occurs

#

I have a lightweight example project to demonstrate the issue. Anyone experienced with this?

bitter oriole
#

What do you mean "reset" ?

supple basalt
#

@rain coral that going "back movement" mentioned by you a while ago sounds like mispredicted extrapolation probably. I don't know if it can be disabled / enabled. Maybe some other guys know. Didn't notice it in unreal, is there something like that implemented in CMC?

#

Well put a memory breakpoint on the rotation and see from where it gets overwritten.

bitter oriole
#

It's not interpolation

rain coral
#

@bitter oriole It zeroes out the rotation. So in my example I've rotated the mesh, not the root. When movement replication happens, the mesh is set back to (0,0,0)

bitter oriole
#

Are we talking about the local rotation of the character mesh ?

rain coral
#

@supple basalt That wasn't an issue I presented, more a note on what I noticed when trying to help unrealemir figure out his problem. But the docs say that the simulated proxies are extrapolated

#

@bitter oriole Yeah

supple basalt
#

@rain coral oh ok, I see :) regarding to your problem, I usually use memory breakpoints to get a callstack on the problem. Else it can be really hard to track it down. If you are using BPs, R.I.P..

rain coral
#

If anyone want to see what I mean. A, D keys for movement, press spacebar to rotate the mesh, then move again after, and the 'other player' will be reset. On the server it's constantly reset

#

@supple basalt I can't breakpoint the Character source code though, don't have the debugging symbols for that part of the code. I do use C++, but in this example project it's blueprints

winged badger
#

you can with DebugGameEditor

#

just fine

rain coral
#

Ahaa

winged badger
#

or DevelopmentEditor, its just better to use Debug

bitter oriole
#

If the mesh is the root mesh, there is no way to do this

supple basalt
#

Ok. Epic doesn't recommend BPs for large projects and never for multiplayer, it's in their "BPs vs C++" article in the online docs. The symbols are large in size, but they are really worth it.

bitter oriole
#

You should handle rotation in the CMC

#

And please don't listen to that stupid advice

#

Epic uses Blueprint heavily in large projects

winged badger
#

yeah, but backbone is always c++

bitter oriole
#

Sure enough

winged badger
#

if you are manually altering rotation client side

#

and haven't RPCed that to server, or incorporated it into the FSavedMove

#

that is what i'd expect would happen @rain coral

supple basalt
#

@bitter oriole I was just telling what they are telling us, didn't want to offend anyone :P

rain coral
#

I use C++, so the BP vs C++ isn't relevant to me atm ^^
@bitter oriole It's the mesh that is included with the Character class. Handling rotation in CMC, do you mean that it has its own pipeline to rotate the mesh so to speak?

bitter oriole
#

@supple basalt I doubt the documentation says Blueprint are unsuitable for large projects

#

@rain coral Root mesh rotation is effectively the actor rotation

#

So yes, CMC updates that every single time, by design

#

It can't work any differently

#

The rotation of a main character component is a gameplay concern, it's handled by CMC internally and you should drive that from the player input

rain coral
#

What I'm trying to do essentially, is rotate the bird in the bird cage, but not the cage. It seems strange to me that the bird's rotation in this metaphor should be forced

supple basalt
#

Quote: "Network Replication: Replication support in Blueprints is straightforward and is designed to be used in smaller games or for unique one-off Actors. If you need tight control over replication bandwidth or timing you will need to use C++."

bitter oriole
#

What's the bird cage in this scenario ?

rain coral
#

The actor

supple basalt
#

As I said, these are recommandations, they don't say BPs are bad, we are using them too when it makes sense :)

bitter oriole
#

@supple basalt Blueprints work perfectly fine with multiplayer and are use extremely heavily by Epic

#

Of course you won't write character movement in BP

#

But don't recommend not using BP in large projects

supple basalt
#

We mostly use them for UI and for leven design / data driving the mission scripts.

bitter oriole
#

@rain coral You can't have different rotation on actor vs root actor component.

supple basalt
#

But not for netcode.

bitter oriole
#

If you need an additional mesh that doesn't rotate, that's easy

supple basalt
#

But I somewhat agree with you, there is no right answer.

bitter oriole
#

You can agree as much as you want as long as you don't tell people not to use the main engine tool ๐Ÿ˜›

supple basalt
#

Heavy usage of BPs with no best practices taken for them can be bad in the long run though.

bitter oriole
#

Anyway, blocklist and life goes on

rain coral
#

A Character is structured hierarchically like this: Root (Actor) -> Capsule -> Mesh
The mesh isn't a root component in this case. Seems like the Character component shouldn't concern itself with the rotation of the mesh, only with the root

bitter oriole
#

What's the root component of the actor ?

#

"actor" is not a root

rain coral
#

Then the capsule is the root

supple basalt
#

Main engine tool, haha.. ok, whatever. Didn't want to upset you, I'm sorry ๐Ÿ˜›

bitter oriole
#

In this case it is weird that it resets rotation

#

You do use the Character class too, right ?

rain coral
#

I have uploaded the example project if you have an idea what causes it.
Yeah I use the Character class here

#

An alternative could be to rotate the Actor itself. But I don't need to replicate rotation in my game, it can be calculated based on something else that I replicate. So if I were to do this, I would want to bypass rotation replication altogether. Somehow?

winged badger
#

its not really weird if the flow is:
1 - client uses input to adjust rotation, but not via CMC
2 - client doesn't RPC new rotation to server
3 - client moves via AddMovementInput, server still considers original rotation to be correct and overrides the client

bitter oriole
#

The easiest fix is to disable rotation inheritance on character mesh

#

That way you'll control it all the time

rain coral
#

@winged badger In my example, the rotation is RPCd, but it's overridden on the server's simulated proxy. You can see it rotating for a frame, then snaps back.

@bitter oriole Aha, rotation inheritance on the character mesh sounds exactly like what the issue is. How do you disable that?

bitter oriole
#

On the rotation field in Blueprint

#

IIRC

#

Set it to "world"

rain coral
bitter oriole
#

No

rain coral
#

The issue persists

bitter oriole
#

If the issue persists, then the character class is controlling the mesh directly

rain coral
#

Yeah, I'm quite sure it does, behind the scenes. It's quite rigidly designed in that regard

#

But let's say that this is bound to happen. Can you think of a way to skip replication of the actor's rotation, when I use the CMC replication? The rotation can be calculated on the client, and I want to spare the network traffic

bitter oriole
#

You can do this by either modifying the CMC in engine source, copying it as a new class and reimplementing Character/CMC yourself with modifications, or working around it

rain coral
#

Alright, I'll try to figure out a way to reimplement this then.
Thanks for assistance =)

ember slate
#

Any idea how does one go about stopping the player from WASD movement from server side?

bitter oriole
#

Probably want to explain that question

supple basalt
#

@ember slate call DisableMovement on the CMC.

ocean geyser
#

ok possible dumb question, im doing a line trace from a weapons muzzle (socket) currently to be the projectile, but when i go to shoot (dedicated server with client holding the weapon) the line trace goes straight down. out of curiosity i printed out the Z axis of the socket on both the client and server and they are very different, the client is correct at like 300-450 depending on where im at, but the server shows -300/-450 depending on where im at. if i play as the server the line trace is correct, starts at the muzzle and goes where it should but its only if dont have the player as a server that it messes up. the weapon is attached by the grip at a socket on the characters hand, any idea what the cause could be?

FVector MuzzleLocation = MeshComp->GetSocketLocation(FName("s_muzzle"));
FRotator MuzzleRotation = MeshComp->GetSocketRotation(FName("s_muzzle"));
FVector EndLocation = MuzzleLocation + MuzzleRotation.Vector() * 1500.0f;

UE_LOG(LogTemp, Warning, TEXT("ACTOR HIT: %f"), MuzzleLocation.Z);//shows different on server and client
#

the X axis is the same on both

ocean geyser
#

yep the Z axis for the character and weapon is the same on the client and the server, it just seems like its the socket location's Z axis that is off for some reason which makes 0 sense as everything else is correct

winged badger
#

You using that broken VS2019 compiler?

#

Fixed a week ago

ocean geyser
#

its possible as i havent updated it in about 2 months, never had issues before though

toxic brook
#

Hello,

I'm trying to send large arrays or FTransform through an RPC regurlarly. When I do that, new players cannot spawn in the game. If I reduce the array size to a small number (5), everything works fine.

What are the limitations and what logging should I enable to debug this? I do not get any errors on the server or on the clients of why the player did not spawn. If I debug the PlayerController, the ClientRespawn receive a nullptr Pawn.

Is there an Engine.ini configuration that I should make to make this possible?

Thanks

winged badger
#

How large?

#

Nothing wrong with that code @ocean geyser

#

As long weapon is in same position

#

It works

ocean geyser
#

any thoughts? i raised the socket up by about 500 units in the engine and tried again to see the change in the Z axis, the client is correct (at a little over 700) but the server showed it as 240. its like it cant keep track of the Z axis, it also never seems to change as it moves slightly during the breathing animation so as long as you dont move the value never changes on the server, idk what the heck its reading from but its not right but the X axis is correct

winged badger
#

Aim offset animation applied only on client?

ocean geyser
#

no aim offset currently

winged badger
#

Or broken compiler, print location and rotation of the socket pre trace to find out

ocean geyser
#

when the player picks up a weapon it changes their animation but its visible on other clients due to a replicated variable. i think you just solved my issue though, its probably using the old animation(arms down by the players side) on the server

meager spade
#

server not playing animations

#

server will be in T-Pose

#

or A Pose

#

verify Visibility option in skeletal meshcomponent

#

i don't trace from the servers position, i have the client send in the position, cause i don't want to play animations/adjust bones on the server

toxic brook
#

@Zio 70 transforms

winged badger
#

That wont break replication

#

Transforms are not ideal for replication though, as you sre sending scale as well

toxic brook
#

@Zio Is there a LogCategory that should print my spawning error. I sent only translation and rotation and I got the same thing. After a certain number of it in rpc, the other clients could not spawn.

ocean geyser
#

@meager spade found the issue, in the animation blueprint i call a c++ function that checks whether or not the player has a weapon (the weapon variable is replicated so i just do a nullptr check), if the player has a weapon then it sets a boolean in the animation blueprint to true which makes it go to a different set of animations like this. this works fine on all clients as they can see the change but the server doesnt. the only time it works correctly is if i have the server be a client as well, if the server is also a player then other players can pickup and use the weapon like intended, but as dedicated it just fails

supple basalt
#

@ocean geyser so it breaks only on dedicated?

ocean geyser
supple basalt
#

Is the MeshComponentUpdateFlag set to AlwaysTickPoseAndRefreshBones?

ocean geyser
#

testing now, it was not

supple basalt
#

You could enable it on the dedicated server and see what happens

ocean geyser
#

negative, same issue. i think im just going to go from the clients muzzle position for now, not sure how easy that would be to cheat though

winged badger
#

Very

#

As you dont have information to validate

ocean geyser
#

could pass in the transform from the client, check and see if the location is within X range of the servers

#

that way people wont be shooting from wherever they want

winged badger
#

Either way you need to fix the animation on dedi

ocean geyser
#

yea. still have 0 clue what the heck is going on with it, the server knows there is a weapon in hand so idk why it doesnt seem to change what animations its using

winged badger
#

Most FPS allow client auth shots, as the game feels more responsive that way

supple basalt
#

If you are doing the logic in C++, just breakpoint the dedicated server and see what happens with that boolean.. is it ok?

winged badger
#

Those that cant do quality valudation are swarming with hackers

ocean geyser
#

hold on i think im about to attempt to fly out the window, think i forgot to do something

#

wait nvm -_-

meager spade
#

Fortnite uses passed in locations from the player

#

but it does checks to ensure its within valid tolerances

supple basalt
#

Battlefield also. They can always run aimbots anyway.. :)) but not on consoles.

ocean geyser
#

anyways, i have a weapon actor and an OnRep variable (a reference to the weapon) so when its null i have a function return false (meaning player does not have a weapon) and when its not null it returns true, this functions is blueprint callable and called on the animation BP to set a HasWeapon boolean in the animation BP so other players can see the change in the players animation who picked up the weapon. i dont have a replicated bool as that would just be something else being networked and this seems to work fine on clients but not on the dedicated server. literally any other scenario is fine. i think im going to stick with going from the client and doing checks to make sure that the client isnt trying to shoot from out of range if that makes sense

meager spade
#

It does not blindly accept: the server does a lengthy verification to prevent cheating. This is more the area of the anti cheat team so I can't really give too many details. High level, its checking things like rate of fire, max number of targets, distance and angle to hit target, etc. It does do a trace but its more for ruling out impossible shots / penetrating buildings ("yes you could have hit that") rather than authoritatively deciding what was hit ("based on my view of the world, this is what you hit").

#

from dave ratti

ocean geyser
#

not to shabby

#

so my guess is (with fortnight) the client sends the line trace and if it makes a hit the server checks to see if the start position of the line trace if within tolerance of the players muzzle(or wherever it comes out of in that game) and checks to see if the end position where the hit was made is even possible (such as no trees or anything blocking the hit)

meager spade
#

yeah

#

client sends who he thinks he has hit

ocean geyser
#

welp i will be rewriting to go that route

meager spade
#

that is how i do it

#

i use gameplay abilities aswell

#

and i use the same method fortnite did for there hitscan weapons

#

but it all depends on how many players you want

#

like fornite did it that way cause to have server animate and transform bones for 100 players

#

would be expensive on the server

viscid bronze
#

I have a blueprint that attaches a weaponbase to a characterblueprint by making it a variable EquippedWeapon inside it.
The weaponbase has script for firing inside of it, including raycasting and particle effects and sfx.
Currently, the raycast result seems to be printed accurately from both the server and client. But the particles and sfx only exist on the player who fired the weapon.
However, how do i make a firing system that requires the client to call to the server, then it executes on server, and still calls the hits each respective player correctly

ocean geyser
#

Id set the owner of the weapon to the player who is holding the weapon to make RPC calls a little easier. might be worth having a OnRep boolean that toggles true/false each time you fire with a function that plays the effects and such each time you fire (with exception of the client that fired) so the effects and such only happens on clients where the weapon is relevant. not sure if this is correct but just a thought

#

if its a small game you can probably multicast just fine as you wont have players 60 miles away needing to know that another player fired their weapon

viscid bronze
#

my method of firing is a bunch of script in the character blueprint and calling in a function from the weaponbase

#

@ocean geyser

ocean geyser
#

create an event, under replication set it as multicast. multicast events need to be called from the server so you would also need a server event to call the multicast event

#

so client left clicks, calls server event, server event calls multicast

viscid bronze
#

thanks! do you know how to replicate the particles and sfx too

winged badger
#

you respond to either a multicast or a callback that someone is firing

#

you do not replicate either

ocean geyser
#

not sure with particles, but for example when i animate the weapon (such as the bcg cycling) i multicast it so all clients can see it

winged badger
#

as the asset is defined on the weapons CDO, so you don't need to

viscid bronze
#

but the other players arent seeing the particle effects

ocean geyser
#

they will if its multicasted, it will run on all clients

winged badger
#

whatever you do to replicate the shot itself @viscid bronze

#

can be used to trigger the particle effects locally

#

you just need to know when to show them on simulated proxies, everything else is the same

viscid bronze
#

but i already put this infront of my fire event
the particle effects are inside a custom event called from the weaponbase though

winged badger
#

thats the vanilla input->server-multicast setup

#

also doesn't show the relevant parts

viscid bronze
#

okay

#

@winged badger

winged badger
#

GetPlayerCharacter[0]

#

seems like the culprit

#

you start firing then some other player checks his character for IsAiming... etc

#

not your character, his

indigo brook
#

Do you guys have any cool blueprint muliplayer resources (other than the standard Epic games playlist to make a simple multiplayer game using steam?

winged badger
#

best stay away from GetPlayerController[index] and GetPlayerCharacter[index] until you know exactly what they do and when its safe to use them

#

they are not required

#

check pinned messages on this channel @indigo brook

indigo brook
#

Will do @winged badger

viscid bronze
#

@winged badger but now what will i replace them with

#

for the cast to blue

winged badger
#

there is always a... relative relationship

#

if not you can always make one

#

weapon is attached to the character? GetAttachParent or something similar to it

#

i have a replicated pointer to my OwningCharacter on the weapons

#

that i set at the time of spawning the weapon

viscid bronze
#

how do you do that
also if i use that vanilla input-> server-multicast setup
if the other player has the same character class it fires his weapon too

winged badger
#

the RPC arrives on a correct instance of the character

#

but then when you handle it

#

you're checking the variables in the wrong one

viscid bronze
#

okay how do i fix this though
sorry if this is stupid i am pretty new to unreal

#

@winged badger

winged badger
#

get a relative reference from weapon to the character

#

not a static one, as those don't work in MP

#

there is a node that lets you get an Actor the calling Actor is attached to

#

that works

#

GetAttachParent or some such

viscid bronze
winged badger
#

that should work

#

note: i am not certain that is the only error, as you have non-replicated IsReloading and CanFire too

#

that might not allow for execution to even come this far

#

(that should work as long as weapon is attached to the character)

viscid bronze
twin juniper
#

hello, im trying find something related to database integration with server for ue4, does someone can recommend me some solution?

winged badger
#

as long as weapon is replicated, it will replicate the attached owner

viscid bronze
#

Yeah its set to "replicates'

silent birch
#

How to locate client 2 in a session?

ocean geyser
#

player array

silent birch
#

I tried but I did not find this node

#

In player state?

#

@ocean geyser

ocean geyser
#

client 2 should be the second element of the player array

silent birch
#

But where to find this array ?

ocean geyser
#

gamestate

silent birch
#

OK thanks

#

The player array has only one node get but no set

#

There is no other way to do it?

ocean geyser
#

you only use it to get the player array, you dont set anything to it. you really need to stop with the multiplayer stuff for now. youve had some very simple previous questions that could be solved by anyone with moderate experience with UE4. stop with multiplayer, stick with singleplayer stuff until you get more experience with UE4 to where your comfortable and have learned as much as possible, then consider multiplayer

silent birch
#

I know very well the get and the seven, but with this get I do not see how I will have the player 2

ocean geyser
#

player 2 should be the second element of the player array

silent birch
#

OK I will try

#

I did not find how to get the player 2

ocean geyser
#

dude........look up player array

silent birch
#

Yes then?

ocean geyser
#

the second element should be player 2......just get the second element of the array

twin juniper
#

he probably doesnt know use the array nodes

silent birch
#

How to recover the second element of the table, after I will not bother you for such simple things

twin juniper
#

use the Get node, give the index 2

#

or 1

silent birch
#

I already used array, and that several times

twin juniper
#

the get node that references the array

#

not the get player array node

silent birch
#

OK, I will try. Thanks

twin juniper
#

like that

silent birch
#

So you gave me two methods?

twin juniper
#

its the same

#

just the variables are different type

#

the array nodes adapt to the variable type them are connected

silent birch
#

Index 1 is specified to indicate Player 2 not true?

twin juniper
#

you re trying do an split screen?

silent birch
#

No

twin juniper
#

this player array is "Player State" class

#

so it's not player controller

silent birch
#

Player array is in game state, not player state

twin juniper
#

just hold the mouse in the connection

#

it will show the variable type

#

"player state object"

silent birch
#

So the second screenshot is the right method?

ocean geyser
#

he meant it holds a list of player states

silent birch
#

OK @ocean geyser

ocean geyser
#

the screenshot you sent gets the second element of the player array which is what you asked

silent birch
#

Thanks it works

slender yarrow
#

can someone explain this to me? What actually is UNetDriver? This has been the nemesis of this project since i started it.

bitter oriole
#

These are two different errors

#

The one in yellow means you tried to RPC from a non-player-owned actor

#

First error is self-explanatory, "is locally controlled" is only for Pawn

slender yarrow
#

where im confused in the picture is that it says PlayersState is not an actor, but then it says it IS an actor in the log.

#

engine is contradicting itself?

bitter oriole
#

Where do you see this ?

#

Playerstate absolutely is an actor

slender yarrow
#

a pawn is an actor too isnt it?

bitter oriole
#

Yes

#

But any actor isn't a pawn

#

"is Locally Controlled" is a Pawn method, not an Actor method

#

Doing this in PlayerState won't work, since PlayerState is not a Pawn

#

If you want to check that the PlayerState is local, you should get the Pawn from PlayerState and then call is locally controlled

#

This will work

rotund sapphire
#

I've rethink my sentences and delete them instead. Nevermind.

slender yarrow
#

Im still wondering why that warning is being thrown in a playerstate. its weird. Im doing a has authority check from Begin Play

#

and then calling a Server function from Remote

bitter oriole
#

You have two different errors. Not just one.

#

But fix the first one

slender yarrow
#

yeah one for each character logged into the ded server i guess

#

C_0 C_1

bitter oriole
#

The first error is that Is Locally Controlled does not exist for Player state

#

So it simply can't work ever

slender yarrow
#

yeah i understand that now

#

i deleted

#

this is what i was talking about

#

this is causing that warning

#

but i dont understand why

#

OOPS

#

from remote not authority

bitter oriole
#

"remote" can mean many things

#

You have to call this from the player owning this instance

#

Calling this from another client will cause the error you have

slender yarrow
#

so its calling it for all clients then

rotund sapphire
#

from the playerstate you can try, getowner() -> isvalid(true) -> cast to player controller -> get controlled pawn() -> isvalid(true) -> here you can check pawn is locally controlled or not.

bitter oriole
#

Just check the owner first.

#

Get the pawn from player state, check islocallycontrolled, if true then call RPC

#

Two nodes instead of that authority check.

slender yarrow
#

what about has net owner

#

i used that in the past and it got rid of owner warnings

bitter oriole
#

Maybe

#

More than one way here

#

You can also get the first local player controller and check if his PState is the current one

slender yarrow
#

ok I got it. I checked if Get Owner = Get Player controller

#

thanks for the help

bitter oriole
#

Beware that the server will have multiple PCs.

slender yarrow
#

i did that check locally

#

It seemed to work

twin juniper
#

Has anyone messed around with spatial os?

vestal thistle
#

Hello does anybody know if I need to have the binary build on my computer to run Unreal Engine Dedicated server?

hoary sandal
twin juniper
#

How can I join my dedicated windows64 server via android client ?

#

I made server work with local mode

#

but no response in online mode

twin juniper
#

nvm did it

strange tangle
#

how do i make it so that it doesnt spawn the hud widget for everyone on the server, only the one who switched to Blue class

silent birch
#

With this node (switch has authority) @strange tangle

#

Try it first, but I'm sure it will work

strange tangle
#

@silent birch

silent birch
#

Or do it with a custom event for customers and for the server no custom event

dark edge
#

@strange tangle how do you tell if you are the blue class?

#

Begin play, if IsBlue, spawn the hud

strange tangle
#

@dark edge this is put in the Blue class

silent birch
#

Or you can use the node (is server with a branch)

#

@strange tangle

dark edge
#

@strange tangle does it being a server or not have anything to do with it? or should every blue class spawn the blue HUD?

strange tangle
#

every blue class should spawn the Blue_HUD

#

@silent birch hold on'

dark edge
#

Then just spawn it at begin play, no condition.

strange tangle
#

that just spawns the hud for everyone else in the server though, regardless of what class they are

#

@dark edge

thin stratus
#

Ehm, peeps please...

#

In which BP are you doing this?

#

@strange tangle

strange tangle
#

Blue (a child blueprint class of 0_Base blueprint)

#

@thin stratus

thin stratus
#

Why does this BP create your HUD?

#

(trying to understand if you can adjust this)

strange tangle
#

@thin stratus because i want to make this hud appear the moment the players switches classes

thin stratus
#

So 0_Base is a Character child?

strange tangle
#

no 0_Base is the parent blueprint class

#

Blue is its child

#

@thin stratus

thin stratus
#

Yes but what is 0_Base a child of

#

Just Actor? or Pawn? or Character?

strange tangle
#

character

#

@thin stratus

thin stratus
#

Alright, do you understand why this creates a UI on everyone?

#

(sorry, am working at the same time so repsonse time is slower)

winged badger
#

first think you need to understand @strange tangle is that the instance of character on server and the instance of that character on clients are largely independent of each other

#

they run all their code, collisions... etc locally, with few exceptions

#

only real connection between them is a NetGUID (how they are uniquely identified over the network), which is used for RPCs and replicated variables

#

running the code independently of other instances of the character on other machines very much includes Tick() and BeginPlay()

#

so server spawns a Character, it runs BeginPlay and starts ticking

strange tangle
#

@thin stratus kind of vaguely do
i think its because player controller index is 0 and everyone is 0 so it just makes it appear in everyone's screen

winged badger
#

it sends a packet to the clients that they should spawn an Actor of that class, at that Transform, and assign it that NetGUID

#

when a client spawns it, it runs BeginPlay and starts Ticking on that client

#

so every Character, from every player runs their BeginPlay

#

on every machine, including the server

#

and every Character creates a HUD Widget, assigns its ownership to local PlayerController

thin stratus
#

@strange tangle To put it short, no, this is not the reason. Using PlayerController 0 is not the best, that's true, but the main reason is because you are doing this On BeginPlay of a Replicated Actor.

winged badger
#

so you don't have one HUD Widget, you have as many as you have players

thin stratus
#

Zlo's explanation is more detailed, not gonna repeat that

winged badger
#

and the one from the player that joined last happens to be on top

strange tangle
#

ok ill read through it and understand it

thin stratus
#

You can't do this in the Character's BeginPlay at all though, cause it's too early to check which instance is the one of the local player.

#

What you can do, in Blueprints, is use "OnPossessed" (it's an event that already exists) and perform a ClientRPC, that then creates the Widget.

#

In C++ you'd have the chance to do this at more streamlined events, but well.

winged badger
#

preferred solution is to create a class derived from HUD

#

PlayerControllers will instantiate one for themselves, only locally

#

all you need to do is make a blueprint deriving from HUD

thin stratus
#

They want to have it created per CharacterClass. So it's not bad to do it here I guess.

winged badger
#

and set it as your game HUD class in your GameMode

thin stratus
#

At least in terms of being more or less complicated

winged badger
#

and then create the widget in BeginPlay of the HUD

#

it will be local, and it will insulate your widgets from the network

#

which is good, since they are not replicated anyways, nor is the HUD

#

HUD can directly access your controller (GetOwiningPlayerController) and Character (GetOwningPlayerPawn)

#

which also saves you from using GetPlayerController[0], which is a function that many many people use incorrectly

#

and when they do, it thoroughly breaks their game

#

side note: when accessing a controller from pawn possessed by it, use GetController() function

strange tangle
#

alright. but my character has to switch between HUD classes as it switches between blueprint character classes. will that still work even if i set it as the game HUD class in GameMode

#

@winged badger can do

winged badger
#

HUD in terms of game framework

#

is a class... designed to manage your widgets

#

it can easily be made to re-instantiate the HUD widgets if you jump characters

strange tangle
#

okay. alright
so a blueprint class with HUD as parent class?

winged badger
#

aside from the game menus, and the widgets attached to Actors in world space

#

(latter are housed by widgetcomponent on the actor)

#

i highly recommend creating all your widgets from a HUD derived blueprint

#

yes

strange tangle
#

alright good hold on

#

how do i put in an already existing widget blueprint into a HUD blueprint class

#

@winged badger

winged badger
#

HUD class is not a widget

#

its a manager for them

#

so you create a widget and add it to viewport from inside the HUD, in the simplest scenario

strange tangle
#

ok. thx

hoary sandal
#

hey guys I'm thinking on buying a multiplayer template on the marketplace to learn while I play around with the package, is there any you guys recommend ?

silent birch
#

A person? For help you with your game @hoary sandal

rotund sapphire
#

I think most MP template will teach you a bad practice here and there, which unfortunate. However, Allar's generic shooter was a rather good one, unfortunately no longer available to buy. Maybe there is ShooterGame too from epic's learn tab, but it's a cpp only project, that might be difficult for some to adopt. But in the sense where you should focus your efforts when creating mp games, cpp (and therefore shootergame) should be one good example for you to learn from.

hoary sandal
#

@silent birch no I meant if there's any multiplayer templates that you guys recommend in the marketplace

silent birch
#

OK

#

A Passover?

hoary sandal
#

@rotund sapphire I downloaded the multiplayer shootout, It though me a couple of thing such as the usage of game instance to handle states, I been browsing for a bit these are the two that I have seen that caught my eye

gray scroll
#

on begin play i m spawning an actor on owning client

#

for clients... its spawning twice

#

but for server it spawns once only

#

any idea why?

#

if i do a switch has authority before... it doesnt spawn for clients at all

tough totem
#

Is there a way to not replicate gameinstance variables? So that every player has his own variables?

gray scroll
#

no

tough totem
#

is there another way to travel variables between levels?

rotund sapphire
#

EliteNas i think you're better off spawning on server only and wait on client until the object will be replicated. Dont spawn on client.

gray scroll
#

@rotund sapphire but its a in game menu

rotund sapphire
#

@tough totem you can't replicate in gameinstance, but you can make stuff in playercontroller and gamestate to replicate, so for instance on beginplay you can use these classes to force some variables on clients, and use the server version of gameinstance to store / retrieve the data from.

gray scroll
#

@rotund sapphire should i spawn in game menu for each player on server too?

rotund sapphire
#

If that makes any sense for you then just do it.

gray scroll
#

It doesnt because each player in vr with have their own in game menu

#

Thats too much stuff for server to handle

rotund sapphire
#

But i think you're better off syncing some shared data in gameinstance by using the playercontroller/playerstate/gamestate (PS and PC is better if data will be personal), and the game menu actor will access the info using the local gameinstance or whoever holds the data.

#

It's a system you will desing around the requirements :)

tough totem
#

@rotund sapphire My problem is, that the clients have different values in variables in one level. Now I want to travel these values (when the player travel to another level) with the player to the new level. Tried to do that with playercontroller but I heared that the playercontroller resets on level change

rotund sapphire
#

there is a mechanism implemented for playerstate to travel with maps you can use that too in this case.

tough totem
#

ok I will give it a try

fleet raven
#

all of the source code is right there

wheat magnet
#

how to use firebase in unreal engine, or any other alternative of firebase in unreal?

shy flicker
#

Hi everyone! Im starting with multiplayer stuff and I've been trying to do a rock paper scissors. Simple. The issue is that from the server it doesn't detect that the variable changed on client. Any help? Is is not just as simple as mark the variable as replicated?

left parcel
#

If you wan't to change a variable from client : Create a custom event, set it to : run on server and make it reliable, then from that event you modify your variable, if variable is set to replicate everyone will se the new value

shy flicker
#

@left parcel Worked! I tried what you told me before but I created the custom event on a widget blueprint because it's where I was triggering it. Created the custom event on the pawn and called it from the widget and it worked. Thanks!

past totem
#

changed switch has authority graph to this, this should work to support both multiplayer and singleplayer right?

#

or are there any other possible issues? (I'm building my game for multiplayer but also want singleplayer to work)
please ping @ me if you respond, thanks

worthy perch
#

In Standalone, the client will have authority. I don't understand the logic in your pic. That sequence is wonky and probably shouldn't be allowed to compile.

past totem
#

yea but in singleplayer client wont ever execute and I need visual stuff to work, so I made it so if it's singleplayer it will execute both @worthy perch

worthy perch
#

HasAuthority should be true in singleplayer.

past totem
#

yes but if I play a particle for example, I play it from 'remote' and not on server
@worthy perch thats why I need both to execute if it's singleplayer

worthy perch
#

Then don't even do an authority check. Unless you want to support a dedicated server, in which case you play the particle if you're not a dedicated server.

fleet raven
#

@past totem how did you get your bps to look like that?

past totem
fleet raven
#

thanks, I'll have to check that out later

safe flame
#

Is it still not possible to build dedi server without building the engine from source?

past totem
#

correct @safe flame

#

it's pretty easy tho

#

just takes a bunch of wait time

safe flame
#

I remember trying that and every change in my project, I needed to rebuild the engine, and I couldn't solve that, so I gave up

#

But for testing I can just build the game and run it as a server?

past totem
#

what kind of change?

safe flame
#

Any blueprint change iirc

past totem
#

that never happened to me

safe flame
#

It was like 2 years ago when I started so maybe I messed something up

#

But i dont wanna try it again just yet

past totem
#

oh I posted the wrong link

#

use this guide

#

very simple

safe flame
#

I think i saw you can just add launch parameters to the shortcut and launch the game as a server

#

Yeah I remember using that

rotund sapphire
#

You can also use editor's project launcher for compiling and cooking data for both dedi server and client only. If you plan on nativization then do it separate profiles, otherwise you can do it in a single one. No need to compile the server/client from VS it will do it for you.

#

Yes the guy working on the openworld project had this stream for fun he create a server instance that works with character movement component but it's a bad idea spending your years on such a project unless you're overqualified for doing anything else but server coding.

past totem
#

oh I remember seeing this

#

he even mentions how dumb idea it is in the start

rotund sapphire
#

agreed

#

Yes that is exactly what we are talking about.

#

LAN you can use tcp, online you can risk udp it not much different (relatively speaking). You may also want to consider implementing advanced routing techniques that allow two player across to world play the game. steam sockets is one way, webrtc another but it's very advanced topic man.

rotund sapphire
#

Fortunately for you it is 100% open source you can read the engine code and figure it out. This will be your first challenge, and if you succeed you may have a chance build a custom server out of it after all.

modern swift
#

if I replicated TArray of Ustruct , it seems wont replicate when the struct's property change

#

seems it only replicate when the whole struct add/remove from the array

worthy perch
#

I think that's because NetDeltaSerialize doesn't recursively check the members of the USTRUCT you're replicating.

winged badger
#

use FFastArraySerializer instead

#

its documentation and example of implementation is in NetSerialization.h header

modern swift
#

thanks let me check

meager spade
#

structs do replicate

#

the members have to be UPROPERTY

#

inside it

#

for it to replicate the changes made

viscid bronze
#

Can someone teach me on how to use a blueprint derived from HUD?
I want to use it for managing different widget blueprints depending on what character blueprint the player is using.

modern swift
#

Is that a way to call a function for a specific group of client?

#

from server

modern swift
#

can I set more than one owner for an actor?

tough totem
#

anyone know how to travel between levels with all clients? So for example I have a level were all clients are (Lobby). Now I want to open a new level (uses seamless and got a transition map) and send all clients in the lobby to this new level.

tribal shard
#

I'm having some issues updating a widget on all clients. I've previously used a text widget and updated it using setText and that worked just fine, but I cannot get it to work using a web browser widget with loadUrl. It seems to work on the host only. I'd appreciate any help.

woeful ferry
#

I can't find this node in 4.23 with advanced sessions

nocturne prism
#

question I have four player start but Sometimes I won't always have 4 plaeyrs how can I make my first two players spawn and the first two player starts?

woeful ferry
#

@nocturne prism What do you mean?

nocturne prism
#

nvm I got it working I was trying to make my racers spawn and specific player starts based on how many player I had compared to max players

#

so for instance I have 4 max players but if I only had two during that race I wanted them to spawn at the first two positions

pallid stone
#

Hi guys, got a question regarding Fonlinesessionsearchresult. You can use that to get the FOnlineSession and then get the owning user name when finding sessions. How do you do essentially the opposite, of when you join a session, on post login, you give your owning user name?

silent birch
#

To invite someone to join you on a session, is it a plugin?

pallid stone
#

Nope, just c++. I want to make a lobby that displays a widget with the players name when they join in a scrollbox. But I don't know where to find the owningusername of the joining player, or currently joined players.

silent birch
#

Can be through the server name node

pallid stone
#

And how do I access that? Is it in uworld?

shy flicker
#

Hi everyone! I'm trying to spawn some particle effects when i shoot from my weapon that is an independent actor. The problem is that Clients doesn't spawn those particle effects if events are created on the weapon actor, but it does if i create them on the player event graph. Any logic behind that?

pallid stone
#

Yeah your location is set to 0 0 0

#

So it's spawning the particle effects at location 0 0 0, either in world space or relative space to the attached component

shy flicker
#

But if it's attached to a socket, particle should spawn on socket location and be attached right? Or am I wong?

#

Even if I set a world location it still doesn't work at all ๐Ÿ˜ฆ

pallid stone
#

Is the particle too small?

shy flicker
#

Even with 1 scale doesn't work. I'm going to put in on the character and moving on but it's weird. Thanks!

twin juniper
#

Why do I get this error when I use the UProperty macro?

worthy perch
#

Does it compile successfully, if so, just ignore it.
Ignore the Error List entirely. Real problems and warnings show up in the Output log when you build.

twin juniper
#

Yeah

#

It was private

#

Are properties even necessary if you are running a c++ only project?

#

I'm currently trying to figure out how to spawn this actor on the game's startup

#

Also this should probably be in #cpp I accidentally went down here

ebon nimbus
#

How do I assign teams in blueprints? Iโ€™ve been trying to give a value to playercontrollers whenever onpostlogin is called in the game mode

outer radish
#

If I have a class BP_Item, which on 'interact' event interface modifies a player pawn variable that is set to replicate, is there any reason why onrep only fires on server?

#

Player pawn interacts with item_BP, which fires that event. However the player 'FEquipped' variable is not being changed. Any help would be appreciated

winged badger
#

its what blueprints do

#

OnRep there is not so much a replication as much as a setter callback

outer radish
#

And as always RIGHT after I make a post, suddenly the answer is revealed to me. I didn't have 'set component to replicate' checked. -.- Solved

winged badger
#

you could set a variable locally on a client, and its OnRep would fire on that client

outer radish
#

Im trying to avoid running anything on the client

winged badger
#

i run everything i can on client

#

server needs its CPU

outer radish
#

How do you avoid cheating?

winged badger
#

i have less of a problem there, as its a co-op tactical shooter

outer radish
#

If you for example allow client to add items to inventory, anyone with cheatengine can have unlimited items

#

oh

winged badger
#

but i do have some sanity checks when client RPCs stuff over

#

in c++ a server RPC has _Validate function as well

#

and it will autokick the client if it returns false, like he shot a target 10k away with weapon that has 2k range

outer radish
#

Is a simple operation as I showed that CPU intensive? I'm more worried about network bandwidth

winged badger
#

its not

outer radish
#

my game is very loot heavy so it probably adds up

winged badger
#

if this is not a learning project, i do recommend starting with c++

#

BP doesn't have access to any of the advanced networking tools

outer radish
#

true, but the tough dedicated server stuff I've already handled, if I need to delve into cpp more I will

#

I kinda hate it

winged badger
#

i will admit its an acquired taste

outer radish
#

a lot of math heavy stuff is preferred in cpp jsut cause nodes are a pain when doing things liek that

winged badger
#

but after a while you don't mind it at all / start to prefer it in many situations

#

its not just the math stuff

#

also anything that has to do with structs

outer radish
#

tell me about it -.-

winged badger
#

and handling collections

outer radish
#

yeah i agree with you, but frankly my project will be delayed a lot fi I attempt to become proficient in cpp

winged badger
#

in c++ you can one-line something like sort this array of actors by distance to something

#

in BP its 2 screens worth of nodes

outer radish
#

lol

#

custom functions exposed to BP is good enough for me in those situations, for now

ebon nimbus
#

Where should i be assigning team ID to players?

polar lotus
#

Should my variables such as PlayerName be set as replicated for my playerState in a multiplayer game?

ocean geyser
#

yes

winged badger
#

PlayerState already replicates PlayerName on its own though

#

@ebon nimbus that depends on how you decide which team the player belongs to

ebon nimbus
#

That line isn't even worth typing out.

winged badger
#

if you are assigning them automatically as they log in

#

is different from letting them choose team in lobby themselves

#

either way, as controllers aren't replicated, you should have the TeamID in PlayerState

#

and override Find/ChoosePlayerStart functions for the spawn locations

novel citrus
#

Hey Guys I am using GameSparks for Android and IOS platform to build a listen Server , I want to know is it possible to create a listen server using game sparks, Just like steam.
I have created and authenticated players using game sparks services .
I dont know what should be done next should i host sessions ?
and try to join with other authenticated users . Will Game sparks handle the connection between different clients automatically.
Can some one please guide me in a direction , thank you.

warm summit
#

hey guys, just wondering if anyone has tried to implement multiplayer on a mobile platform here? kind of struggling to find any information on it online, I'm trying to have a host to 2-6 player connection through bluetooth. any points in the right direction would be a big help :) (Copied from an old post, of which I happen to have the same problem)

novel citrus
#

@warm summit Hi , I think to do the bluetooth connection you would need to set the subsystem to null , and do the bluetooth connection with a bluetooth plugin then , you can follow each step exactly like you will do to create session on steam.
I have not done this, but i think this should work.
as this is the way to do for LAN multiplayers.

bitter oriole
#

Bluetooth is not going to work for that

#

AFAIK it doesn't support IP networking

novel citrus
#

My bad.@warm summit ,This wont work for Bluetooth , but this would definitely work for LAN

#

@bitter oriole Hey as you here , Do you know anything about multiplyer using subsystem ?

bitter oriole
#

Never used GameSparks or Android or iOS

novel citrus
#

Have you done this , in some other way.

#

oh, no android and IOS.

bitter oriole
#

No

thin stratus
#

@novel citrus Afaik, GameSparks doesn't have any MasterServer stuff to host Sessions.

#

So, at least by default, you can't host and join sessions with it.

#

If they do, then your best bet is to ask them and not the UE4 part of the problem :P

novel citrus
#

@thin stratus thanks for clarification.
Do we have any subsystem which supports this.

thin stratus
#

Afaik, not yet, Epic Games own would probably allow it somehow, but CrossPlatform isn't supported in that way.

#

Each Subsystem handles their own Sessions, and even if you handle the Sessions outside of the Subsystems, connecting is forbidden as the UniqueID is different for, e.g., IOS and Android.

#

So you need an extra Subsystem for this and afaik we don't have one.

#

And it's not only about just having a custom UniqueID and someoutside server, cause even if you make your own Subsystem that pulls that off, you can't access the IOS and Android Subsystem stuff out of the box anymore.

#

So your custom Subsystem would need to somehow wrap the other two.

#

tl;dr If you can't pull that off, don't do Crossplatform Sessions or wait on Epic to release their system.

bitter oriole
#

Which is likely going to be 2021

novel citrus
#

@thin stratus If i want to host for Android platform only will there be any solution then.

thin stratus
#

Yeah, using Googles Subsystem

#

They should have some Room/Session System

#

Might not be included in ue4s implementation though. You'll have to check the subsystem files

novel citrus
#

So there will be a possibility using Google Subsystem.
I will take a look into that.
At last some direction.
Thanks

viscid bronze
#

This is my script for switching the HUD widget when the player clicks the the button Blue. However, on the client players it works normally, and on the server the old 0_Base_HUD doesn't disappear, but gets overlapped with the new Blue_HUD.

Pressing button P to print string prints 2 before onclick and 1 after onlick on the server, while simulating with 2 players.

https://cdn.discordapp.com/attachments/221798862938046464/648459865924042752/unknown.png

novel citrus
#

@viscid bronze Are you doing a listen server , Check if the widget is not getting created for server as well as for client on the Host machine.

#

HUD will only create on client . so in the begin play you would want to check if the code is running for server or client , and you want to do these specific things for client only.

viscid bronze
#

@novel citrus yes. i am doing a listen server.

#

i think it is creating only one 0_Base widget for clients, but creates 1 for each client on the server for the server client

#

The beginplay is in the Player Controller.

novel citrus
#

Well on the host machine , as there are two codes running , one for client and one for server . so you would like to check if this is client or server , and for server you dont want to create any UI

#

for server this should be true,

viscid bronze
#

okay. ill try

novel citrus
#

I am forgetting something .
I had this issue in my game . and the problem , was on server machine , i was creating UI two times , one time for server and one time for client.

pastel thunder
#

Guys let's clear my doubt... Does STEAM host our Mobile games also....โ‰๏ธ๐Ÿ˜”

bitter oriole
#

Steam does not host game servers

novel citrus
#

@pastel thunder Hi Akhter2000 welcome to the club NO

bitter oriole
#

And Steam does not do mobile

pastel thunder
#

So, what does setam do?

bitter oriole
#

Sell your game

#

And matchmaking

#

And friends / achievements

pastel thunder
#

And who host our games?

bitter oriole
#

Your servers you mean ? You do

pastel thunder
#

Yes

#

Who controls our movement location firing or not such kind of things

bitter oriole
#

Your game servers that you build

novel citrus
#

@pastel thunder There are two Types .
Dedicated and Listen Server.

Dedicated is hosted remotely and all the players will connect to it. and Listen will be like player vs player , where one of the player will be hosting and other will be joining.

bitter oriole
#

You need to rent server hardware, put your game server software on it, etc.

#

You can avoid needing dedicated servers by using listen servers, but this doesn't work for all games

pastel thunder
#

@bitter oriole can u tell me company from there we can take rent?