#multiplayer

1 messages ยท Page 337 of 1

severe widget
#

At a stab, I'd say something to do with hashes.

granite jolt
#

ok as a follow up question, which is considered the most performant system to use in multiplayer as an alternative to using TMaps? Array + Struct?

thin stratus
#

Technically yes

rare cloud
#

you can also use TMap and make some function to update it on client

granite jolt
#

I thought about manual replication but wasn't entirely sure it would fit the system

charred crane
#

so...weird issue. I have a component that I'm having a server RPC set to visible...but it's not being set visible for the server itself. ideas?

#

When the server executes the non-rpc function it replicates fine to clients.

sterile pebble
#

that sounds strange

charred crane
#

and when the client calls the RPC the server sets it visible for the client, but not for itself...but its multicast.

sterile pebble
#

did you check that component marked with replication checkbox? And the owner actor? Also, do you handle rpc as reliable or not?

worthy wasp
#

Not sure how to fix this - i'm attaching an actor to another actor (motorbike) and on the client it looks completely different than it does to networked clients... the location & rotation is CMPLETELY off with eachother.... How can i sync these? I'm looking all over - cant find squat on the issue. i've debugged printed the Transform - both server AND client match transforms for both the actor (attached) transform as well the motorbikes socket (the attachment point) transform.... yet the attached actor is CLEARLY different from local to networked clients.

        GetOwner()->AttachToComponent(HoverBikeRef->BikeMesh, FRules, "BikeSeat");
        AsCharacter->ForceNetUpdate();
#

the above code is run AS SERVER

thin stratus
#

AttachToComponent is not replicated afaik

#

Means you might need to call it on everyone

#

Also make sure if your sockets are animated it might be that the skeleton doesn't update on the server if the client is not visible

#

If that's the case then there should be a boolean for that

worthy wasp
#

the client is visible though to the networked clients

#

i can clearly see it from a networked player - but the locations/rotations of the attached actor differe from local to networked

#

@thin stratus when you say there should be a boolean for that - what do you mean?

thin stratus
#

Did you try to attach it in a multicast /onrep

worthy wasp
#

no i was attachign on server

thin stratus
#

There is a boolean on the skeletalmesh i think

worthy wasp
#

i can switch it to a a replicated bool & do OnRep

thin stratus
#

That is for ticking the bones even when they are not rendered

#

Or something like that

worthy wasp
#

oh

#

let me look...

thin stratus
#

Try the attach first

worthy wasp
#

ok sure - FWIW - i also tried setting the whoel component to bReplicates True/False - neithe rmake difference

timid pendant
brittle sinew
#

I'm pretty sure you're using the wrong node

#

Well, actually I'm not really sure

#

Initially, I would think "get object array field" sounds like you're getting something in an array

#

But it's returning an array

#

I would look at the plugin source and make sure the function is doing what you want it to

timid pendant
#

Yeah its supposed to return an entire array from the array name

#

I tried every get array node from varest also

pallid mesa
#

exi, i saw you said that checking authority on a server rpc event makes sense, like, is it a joke or i am lost on something? xD

brittle sinew
#

@timid pendant could you put your full JSON response on something like pastebin?

#

It looks to me like your brackets are messed up, to be honest.

timid pendant
#

Yeah sure

brittle sinew
#

The log says the JSON data is invalid

#

Actually I might just be dumb

#

Hehe

#

But still, the log says it's invalid, and that's an engine log, not a plugin log

worthy wasp
#

@timid pendant i'm using VAREST currently - had a world of troubles with JSON Object Arrays- i dont clearly see your post from that link above - what erors are you having? you say you cant get an array from VAREST?

timid pendant
#

Yeah and same for the json query

#

Its a valid json data

#

@worthy wasp I will make a blueprint with varest quick and show you the error

worthy wasp
#

likewise i have my project open with my working json events - so hit me up when ur ready

timid pendant
#

Alright

worthy wasp
#

@thin stratus - i did a NetMulticast RPC - debug strinnged to make sure it was running across all clients (it is) and this is still the outcome with the attachment:

http://puu.sh/x6PvF/e1c5c4945f.jpg

#

i'm going to set a boolean and move the functionality of the attachment to the OnRep of the boolean like you suggested.

#

there is however something i'm noticing

#

the instant that i attach myself to this bike (i'm obviously changin ownership from the CharacterPawn to the BikePawn)....

#

my AnimBlueprint is erroring out here:

#

RiderComponent is no longer valid

#

this was in the original character pawn class

twin juniper
#

@thin stratus so for some reason, im using a client rpc

#

yet its being called on the server

#

??

#

HAX

#

ALso

jolly siren
#

not hax

#

client rpc from server runs on server

#

if it's a server owned/unowned actor

thin stratus
#

@twin juniper The image showed a ServerRPC

#

Also what erebel said

twin juniper
#

wait wut image

#

but yea

thin stratus
#

Ue4 docs

#

:P helps reading them from time to time

twin juniper
#

true

#

i dont have the luxury to sit down and read it tho

#

lol

jolly siren
#

it's like 2 pages

oak sluice
#

Hi, I can't seem to find a way to disconnect my client from a dedicated server, I didn't create a session.
Tried combinations of destroying the Player controller from client / server, open level, destroy session, nothing works..
Any leads will be very welcome ๐Ÿ˜ƒ

#

Hmm .. guess I only had to specify absolute path to open level ..

worthy wasp
#

@oak sluice - forgive me .... you are joining this map right? in my project (Dedicated server in the cloud) i have the following - which loads the player into the world - however you funciton it....
http://puu.sh/x6U93/af28d1fd20.jpg

#

the IP address is of course - where you would interject wherever your server lies

oak sluice
#

@worthy wasp I got it to work, just had to tick the absolute checkbox on open level

#

thanks!

worthy wasp
#

are you using an IP in OpenLevel ?

opaque tinsel
#

hey guys im currently replicating ledge climbing, my client player cant move to the left or right when ledge climbing

worthy wasp
#

@opaque tinsel - can you go into detail about your movement code?

opaque tinsel
#

So if players are hanging, they are able to move left or right

#

and it works properly on the server, but on the client, when the player tries moving left or right, they would stay in place and the camera would just move left and right really quickly

worthy wasp
#

this dedicated server? @opaque tinsel

#

sorry was on the phone

opaque tinsel
#

no this isnt

worthy wasp
#

hmmm

#

how are you calling the CLIENTS input to do this wall climbing?

#

also i just noticed

#

your SERVER rpc's are indeed MULTICAST

#

which wont run unless theyre called FROM SERVER

#

so are you calling these 2 movement functions from server?

opaque tinsel
worthy wasp
#

problem i see is you're doing all this work on net multicast

#

i'm no networking perfectionist - but you should at least change the multicasts to server - for the movement functionality

#

after your movement functionality is done - you'll have to pass args into a multicast rpc - to set location/rotation for everyone else to view.

#

by doing this s- your clients should be able to execute this -

opaque tinsel
#

i see, that indeed fix it,

#

thanks

brittle sinew
#

Just a heads up @oak sluice, the code that threw that warning we were talking about just vanished

#

It was introduced in 4.16.2, and it's gone in 4.17.0 ๐Ÿ˜ฎ

#

X-files tune plays quietly in the background

#

I imagine it stirred up something that wasn't intended, possibly relating to your issue ๐Ÿ˜„

#

(to be fair, it did say it was a temp fix)

sweet spire
#

Lethal question for you

#

When im adding controller pitch or yaw, im using the player mouse POS, but the server does not know about the player mouse POS, so its causing jitter as they are fighting each other, any ideas?

loud sage
#

Playing around with some netcode, but why does a world context that can get me the gamemode not get me the gamestate? (it gives me a debugbreak/error)

#

A gamestate should be on the server & clients and a gamemode on the server, so how come my server isn't able to access the gamestate? ๐Ÿค”

thin stratus
#

Maybe too early?

sweet spire
#

send help cedric

brittle sinew
#

@loud sage yeah, it's most likely a timing issue...GameState and PlayerStates aren't available immediately

loud sage
#

Ah, that makes sense ๐Ÿ‘

pallid mesa
#

ah no, still der :v

#

LogNet: Warning: UIpNetDriver::ProcesRemoteFunction: No owning connection for actor WeapGun_C_1. Function ServerStopFire will not be processed.

worthy wasp
#

@loud sage - the way i do it in blueprints (Picked up from Mike Allar's Generic Shooter pack) is to cast to the gamestate/playerstate & on Fail - delay .2 and cast again. this way - it repetitively does it till the gamestate becomes available. In THEORY - there's no need to worry about a infinite loop - because the gamestate or playerstate does come up within a few frames.

#

if you're worried about it i- you could always do a for loop (10 iterations or so) but then when 10 hits - y our chance of hitting the gamestate/playerstate are gone....

loud sage
#

Smart, I could do taht in c++ too (I think)

worthy wasp
#

aye - while(!Cast<AGameState>(this)) perhaps? I dont know if that would work - i've nto done this in C++ yet

#

'this' would have to be replaced with whatever code gets gamestate....

#

UGamePlayStatics:: or whatever the method is to get gamestate

#

i think you said: GetWorld()->GetGameState()

twin vault
#

I wonder if its possible to create a single player / listen game with a inventory system which cant be cheated

#

meaning players cant get items in singleplayer then go play in multiplayer

#

but i dont want them to cheat and have everything

thin stratus
#

Then you need to store their items away from them

#

In a database that you host on your own servers

#

Or for example using a service like GameSparks

twin vault
#

but then i wonder if the client itself tells when he got a new item, i guess it would be easy for a cheat to make the same thing

inner iris
#

Quick question regarding updating values on client / server: I'm shooting an auto weapon which fires locally and then runs on server after to reduce perceived input lag. However the server updates the ammo count, so since the client is say 100 ms ahead of the server, it might fire off a few extra rounds before the server stops the fire due to no bullets left in the clip. The solution here would be to decrease the ammo count on the client in the same way the server is doing it, but wouldn't this result in the client's clip being decremented twice? Is there a way around making a new variable that is the local client's clip size and decreasing/checking that separately?

twin vault
#

i have no idea how cheats are made so idk :d

inner iris
#

@twin vault The server would check if the client has that item on the serverside inventory, and if not, it's disallowed.

#

The actual receiving new item would be done on server to prevent just that cheat

twin vault
#

yeah if i would use dedicated servers i guess that would be easy, but i was thinking about singleplayer to not force having to be always connected to the server

#

think diablo, you can get itens in singleplayer then go to multiplayer (although diablo can be easily cheated)

inner iris
#

In that case I'm not sure, if nothing can verify if you got the item legitimately then it's pretty hard to prevent them getting it

thin stratus
#

@inner iris No it would not get decremented twice

#

Server would override the client

#

Removing input lag is always done by doing the same action BLIND on the Client

#

So you check on the Client "EnoughAmmo?" "Yes?" "Ammo-- and Shoot"

#

And do the same on the Server

#

But the Client is only allowed to do effect stuff

#

Like hit decals etc

#

And server actually processed damage

#

@twin vault If they host their own Servers, then it might be really tricky

#

That's why WoW etc have their Servers hosted away from the client

twin vault
#

Yeah

#

i dont even know if its possible

thin stratus
#

Games like Torchlight just don't care

twin vault
#

i might ass well let them cheat

thin stratus
#

If you want to cheat, cheat

#

Exactly

twin vault
#

yeah]

thin stratus
#

I would even give them a cheat menu

twin vault
#

haha

thin stratus
#

The easier it is, the more likely they won't do it

#

maybe convert it into a way of getting their own weapons through steam shop

#

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

#

Modders love that

inner iris
#

Thanks @thin stratus works great ๐Ÿ˜ƒ

#

A bit of glitchiness on my UI as the server and client fight to set the value but I might just make the UI retrieve the client's version of the number on the bind

#

One last question- is it safe to set various child weapon blueprint variables in the construction script (recoil/spread/clip size etc.) or should I run an RPC after it has been spawned in the world setting those values?

thin stratus
#

You mean for different weapons?

inner iris
#

Yeah

#

Different child BPs

#

Of a master weapon BP

thin stratus
#

Depends, I usually made a new Child for each weapon and filled in the base values

#

Like in the Class Defaults

inner iris
#

Yeah I'm setting those in the construction script

thin stratus
#

No need to use the script for that

inner iris
#

Just not sure if that's safe for cheaters etc

#

Oh there was a bug that reset all my child actor variables at random

#

That's why I'm doing it in the construction script

#

But it's fine to do it there and not have those values set and confirmed on the server when spawned?

thin stratus
#

Technically yes

#

Because the Server should always be the one that has the last word

#

Even if the client changes clip size etc

#

he won't do anything with it

#

And yeah, that bug exists for ages

inner iris
#

Cool thanks a lot for the help

versed bloom
#

Fast question, looking for gold

#

Multiplayer game for Steam. Using the demo App ID 480, giving loads of errors and log shows loads of mismatches of other devs using it.

DO I JUST CONNECT TO A HOST PC DIRECT BYPASS STEAM WHILE IN DEVELOPMENT AND WAIT TILL I SUBMIT TO STEAM FOR MY OWN APP ID? WHAT DID YOU DO? oops caps, sorry.

solar flower
#

@versed bloom When is it throwing errors for you? Have you not been able to get the Steam subsystem working?

sweet spire
#

How do u handle things like get hit result under mouse cursor for multiplayer

civic belfry
#

I just posted that if anyone wants to take a look. Basically, my large static meshes are jittering when moving around in the level

#

dedicated server

sweet spire
#

sounds like your movement is fighting each other

sweet spire
#

Anyone got any tips for sending mouse target data too a server with out RPC

timid pendant
#

Has anyone ever used the low entry json and http plugins and do you find it better than VArest ?

harsh turtle
#

So, I have GetWorld()->GetGameState()->PlayerArray, but I'm not sure how to figure out which controller/pawn is associated with each PlayerState

tropic moat
#

it looks like there is no getter for AController in PlayerState,
in APlayerState::PostInitializeComponents GetOwner is casted to AController, so that's one way to get it
@harsh turtle

harsh turtle
#

@tropic moat thanks much!

sweet spire
#

hmmm i think my rep notify var are not sending too anyone else but the owner D:

harsh turtle
#

@tropic moat ๐Ÿ˜ฆ As a client connected to the server, GetOwner() returns null for all player states except the client's.

tropic moat
#

that's by design

#

on clients you have only local PlayerControllers

#

only server has all PlayerControllers

harsh turtle
#

Ah. I'm trying to show the health and name of other players on all clients. I'm currently storing the health in the pawn. Any suggestions on how I might recover the health from the pawns?

tropic moat
#

how are you showing it ? you should be able to get your health value directly from your pawn

sweet spire
#

Replicate Health
Get pawns too set references too where ever u want too store it, ie if they have floating health bars get them too set it there

harsh turtle
tropic moat
#

you can store your health in the PlayerState or do what Halcyon is suggesting

sweet spire
#

let me throw u a fab example

harsh turtle
#

I was hoping I could avoid storing it in the playerstate.

tropic moat
#

you can also find all pawns with type ANativeCoopCharacter

sweet spire
tropic moat
#

and use them directly, you only use PlayerController to access your pawns,

sweet spire
#

Everything has its own floating health bars with this function

#

then the floating bars can get the health value directly from the set ref

#

tldr each pawn Sets its own Floating hp bars reference too its self, by calling the built in function

onyx haven
#

How do I replicate things without having to create events all the time?

fossil spoke
#

Use variable replication?

twin juniper
#

How bad is it

#

to run a server rpc every frame, but gate it by an if statement

thin stratus
#

@onyx haven As long as you are on the server, just set replicated variables. Otherwise you are forced to use RPCs

#

@twin juniper Well, does it need to run on tick?

#

Generally okay, but make sure it's not reliable

pallid mesa
#

here, sounds on ShooterGame are not something they take care of with that much love

#

at least for footsteps

#

they don't really have a system to play different footstep based on surface type

#

they just use generic sounds on notify inside the anim graph

thin stratus
#

Yeah but diff sounds on diff surface is quite eas

twin juniper
#

this behavior is only present in shootergame

summer nova
#

what the fguck lol

thin stratus
#

You want to know how that works?

twin juniper
#

no clue at all

#

give us the run down xD

summer nova
#

it creates a bunch of points wich are basically the bounding box, then traces against them

#

if all of them fail, then it goes to shit and stops replicating

#

ill keep that one in mind, its a very interesting thing

#

to check if something should replicate or not depending on its view, or whatever you want, really

#

this is done in the server, and it has the isssue of teleporting the player if you are lagging. It also has the issue of doing a good amount of traces on net tick

#

as its a n squared thing

#

every player against all pawns

#

if you have 10 players, then its 100 checks, and each of the 100 checks does a bunch of traces

twin juniper
#

ouch

thin stratus
#

That's new to me too

#

Thought they do it via IsNetRelevantFor

wintry cove
inner iris
#

Is that replication culling system implemented to optimise network load? Seems like it could potentially show things that would seem incorrect to the client unless the traces are super consistent and start replicating the actor whenever it is seen again.

thin stratus
#

I think that's more for wallhackprevention?

inner iris
#

Ah makes sense!

sweet spire
#

or would rep notify bool be better

lament kettle
#

Should I be creating the Inventory manager within a blueprint actor or should all of the code be within the player state?

#

I'm thinking of Inventory Actor and manipulating that within the player state.

sweet spire
#

depends how your gonna use it

#

anything u put in the player state gets sent too everyone

#

do other players really need to know about everything happening in someone elses inventory?

hasty adder
#

I guess if your using client authority system you'd want to make a solution for wall hacking

modern dome
#

How and where can I store ServerTravel per-client Data?
I mainly want to store which Player controlled which pawn before ServerTravel.
I am not using Seamless Travel though

#

Docs say Clients stay connected to the Server. What does that mean?

rare cloud
#

@Raildex#6923, the server didn't log out and reconnect the player

modern dome
#

@rare cloud What does that mean?

#

If they do not get logged out, does that mean I can reference the PlayerControllers across ServerTravel?

#

Nah, that doesn't make sense

rare cloud
#

it mean if you use ServerTravel and override function like CopyProperties from your PlayerState, data will be keep accross ServerTravel

#

because the player isn't log out

modern dome
#

Ah ok. That makes sense.
I guess I try to transfer who possessed who over the Options

rare cloud
#

you can't reference PlayerControllers because ServerTravel will change the map or reload it, well you create a new UWorld, well everything is delete from the old world

modern dome
#

yeah, that's why I thought it is useless to reference them

rare cloud
#

but there is some gate like CopyProperties where you pass old data to new object

#

no, because server travel can log out player and reconnect it during the process

#

but it isn't the case

modern dome
#

I am currently thinking about using the OptionsString to transfer this kind of Information.
For example:
?MemberA=UNIQUE_NET_ID_OF_PLAYER_1?MemberB=AI?MemberC=UNIQUE_NET_ID_OF_PLAYER_2

rare cloud
#

OptionsString is used for Log in

modern dome
#

But also for Map Travel

#

from the Server

rare cloud
#

well yeah you can pass informations, but you can also use a Payload on your GameInstance

#

I guess it will be easier

onyx haven
#

@thin stratus How would I set replicated variables to replicate a spawn emitter?

thin stratus
#

Depends on what would cause it

#

This is also about: Does the emitter need to exist only for people who were there when it got created, or does it need to be created for people who come in late?

onyx haven
#

need to be shown to all clients

#

@thin stratus

thin stratus
#

Well you have two ways:

First, you need to be on the Server for both ways, so if you aren't yet, get there somehow (ServerRPC).

Then:

If the Actor itself is replicated, perform a simple Multicast.
Set it to reliable if it's important (effects are not really important!).

If the Actor itself is not replicated, you need a dummy Actor that is replicated that has your Emitter in it.
Simply spawn the Actor from your ServerSide and the replication will kick in and do the rest.

OR

If the Actor itself replicates, use an "OnRep" variable that suits your needs (e.g. a Boolean).
In the OnRep function, enable or disable the Emitter based on the Boolean value.
#

@onyx haven

onyx haven
#

oh got it, thanks

#

just another thing, do you know how to replicate the blendspace?

#

guess only works with variable replication

thin stratus
#

Replicate the variables that drive the blendspace

#

(not inside the AnimBP, as that thing is not replicated)

onyx haven
#

only set them to replicated?

onyx haven
#

@thin stratus

jolly siren
#

have replicated variables on the pawn

#

and use those in the anim bp

vital steeple
#

anyone noticed any funkiness when you scale a replicated actor mesh over a server RPC?

#

it seems to skip really bad, only showing a few moments of the scale (which is run on a 2 second timeline)

sweet spire
#

prob need to start both and lerp them

#

and have them suync up

#

sync

modern dome
#

So, I tried to use the PlayerId within the PlayerState to distinguish between Players between ServerTravel
Unfortunately, the PlayerId changes after a Travel.

Sooo.... Any other suggestions?

#
LogTemp: Warning: My PlayerId Now = 320
LogTemp: Warning: Option Value and current Player Id are Equal (Ignore Case) : False```
#

๐Ÿ˜ฆ

thin stratus
#

Using a Subsystem? @Raildex#6923

#

Otherwise you could use the OnCopyProperties thingy

#

Or overrideproperties

#

can't remember anymore

#

You could use that to save your own unique ID

hasty adder
#

ahh add force... dedicated server acts so different

#

even with a Ticket -> Delta Time * desired force --->add force it is super fast on a dedicated server

#

woops .. .never leave a dedicated server running when you hit play in editor haha

vital steeple
#

@sweet spire lerping them on a multicast works except it doesnt execute on the server

modern dome
thin stratus
#

@modern dome Na, that one doesn't stay if you change map. At least not in non seamless travel

modern dome
#

which one now? PlayerId or FUniqueIforgottheType ?

#

There are two IDs

thin stratus
#

Hm PlayerID was the one you used before. I don't know if uniqueID is even set properly without a subsystem

modern dome
#

Is Null not a proper Subsystem?

thin stratus
#

No, it's a placeholder. It only allows you to see sessions in lan and connect via ip

#

You can try and print the uniqueID

#

Interested in what that is without a subsystem

#

Might be that it also gets set anew after travel

#

Since non seamless travel let the clients reconnect

modern dome
#

I'll try this when I am at home

#

Are there any other SubSystems except for Steam I can use?

thin stratus
#

Everything that has user accounts

#

GameSparks for example

#

They allow login via device, actual login data, steam and consoles

#

But technically you could just save a unique ID on the server and client and let the client pass that to the server on connect

#

So the server can compare

#

You could save the playerid from the initial join

sweet spire
#

@thin stratus question for you network wizard, just curious for things like session key on login authentication, how would u handle making them expire in a database? can u do that via like sql or does it need to be handled via client

modern dome
#

@thin stratus Whew. UniqueId seems to be the Client's Computer Network Name + some Value and it works for Local Multiplayer It seems.

#

Thanks. I can now assign the Pawns to the controllers thanks to that

#

?PartyMember0=DESKTOP-H1CEPAI-EBE502744116D5D8A9C9B19105C3B3C0?PartyMember1=DESKTOP-H1CEPAI-B9E6187343086C4EF26B7B90A1CE449A?PartyMember2=AI
my current String ๐Ÿ˜‚

twin juniper
#

is somebody using google cloud compute engine to host a server? i got my dedi running already, but it is not answering to open ip, nor is it listed in steams server list. any hints?

ruby epoch
#

How to create spectator mode with blueprints?

#

I use Set View With Blend

#

but thats looks really bad

#

any ideas?

vital steeple
#

@ruby epoch i just had the player posses a spectator pawn and created a hud that spawns on begin play. is that what you mean?

ruby epoch
#

I want to when player is dead, he able to spectate his teammates

#

I used set view with blend

#

but its looks awful

#

so, how can I spectate from POV of other characters

#

@vital steeple

vital steeple
#

well im not sure if theres a best practice, but what i would do is create a spectator pawn, have the dead player posses it, then somehow bind the location of the spectator pawn to a teammate

ruby epoch
#

problem is I have 2 meshes for each player, hand and body

vital steeple
#

you would probably need an array of each team, i suppose you could use a custom player state with a team variable and for loop through the player list (in the gamestate) and if the player == same team then attach to player. then on mouse left click, go through loop again and skip current player or something

ruby epoch
#

oke

#

so

#
  1. create spectator pawn
#
  1. attach to teammate
#
  1. PROFIT
#

ok

#

lets try

vital steeple
#
  1. spawn spectator
  2. posses
  3. destroy old actor
  4. attach spectator to player on team
#

thats a good place to start IMO

ruby epoch
#

I dont want to destroy old

#

he can beeing alive again

vital steeple
#

oh ok

ruby epoch
#

its possible to spawn pawn in blueprints?

vital steeple
#

yes, but it has to be a server RPC

#

only server can spawn actors

ruby epoch
#

I can spawn actor

#

but I cant spawn pawn

#

LOL

vital steeple
#

are you checking in the world outliner to make sure its not spawning?

ruby epoch
#

my bad

#

sorry

vital steeple
#

sup?

ruby epoch
#

All fine

#

thanks

#

need just to implement that idea

#

๐Ÿ˜„

vital steeple
#

im using a possesed character to spawn an actor through a server RPC and set owner as that possessed character. that actor has a component that runs a server RPC on creation. output log says its not able to run the RPC because it has no owning connection on that spawned actor.

#

does the component not know that its parent is owned by another actor, so it doesnt know how to run it through that connection? IIRC components know if their owner has a connection by simply going up the heriarchy of the containing actor... maybe it doesnt know to keep going past its root and find the owner of it's owner?

vital steeple
#

basically i need to change a replicated value but i cant seem to set an owning connection for this actor

sudden stream
#

Hi there, anyone know if it's possible to disable the default PlayerController behaviour whereby the possessed pawn is auto-destroyed upon client disconnect from the server? (via Blueprint only)

brittle sinew
#

In BP only? Doesn't look like it

sudden stream
#

Yeah, that's the impression I'm getting from Forums/AnswerHUB

grizzled summit
#

Hello together ๐Ÿ™‚
I want to build a matchmaking function for my game, as known from MOBA games. (Join a queue and wait till enough players joined -> then the game starts / map changes from the main menu to the actual game)
And I'm not sure if using the session system is the right way.
What do you think? What would be the best solution to build something as above described?

twin juniper
#

buy uworks

vital steeple
#

nevermind. i found a work around by running stuff on the player for a few functions instead of the actor. its messier, but at least it always has a connection ๐Ÿ˜ƒ

grizzled summit
#

@twin juniper you don't think there is a solution without using steam?

twin juniper
#

wait u dont want to use steam? do you want to use a dedicated server?

grizzled summit
#

yes I want to use a dedicated server

twin juniper
#

sorry man i gotta go for an hour, sry

grizzled summit
#

no prob, thanks anyway ๐Ÿ™‚ ๐Ÿ–

twin juniper
#

so with uworks you could somehow accomplish it over steam. there also is gamesparks, another 3rd party that would solve those things for u (free up to 100k users for indies afaik). building from scratch.. there are online beacons that can help with that, but i have no experience using those yet. im dont know, but i want to believe unreal tournament (source) might have something similar implemented already.

#

i know im not of great help, all i can help with is uworks, srry @grizzled summit

#

i can lead you to a github source that is allowing the usage of beacons in blueprints

#

would have to dig deep in the archives though, just tell me

grizzled summit
#

I meanwhile was reading my self through many forums. As It looks (even using Gamesparks) I have to build a server software that is able to start a dedicated server as soon as for example 20 players queued for a match. And then those 20 players have to connect to the dedicated server the server software "assigned" to them. Pretty tough job I guess but it sounds like a solution ๐Ÿ™‚ even though you didn't help that much, you helped me more than you think ๐Ÿ˜„ thanks a lot for your answers ๐Ÿ‘

twin juniper
#

paragon uses beacons

grizzled summit
#

ah great that looks realy nice
thanks a lot!

twin juniper
#

if you have any success, pls share!

grizzled summit
twin juniper
#

that doesnt look too complicated, even though i never heard of UParty lol

#

but you know.. the big issue with matchmaking for me is that the server costs could explode and kill everything

grizzled summit
#

your right, this is a real issue =/

twin juniper
#

i have no idea how games that offer matchmaking solve it.. propably with dlcs, cosmetics or sth

#

and i really doubt the community would host a server for matchmaking, cause they could never play on it hehe

grizzled summit
#

I guess this is the solution. If you take a look at games like smite: they are F2P and just offer cosmetics. Currently they (HighRezStudios) are releasing two new games (also f2p). They won't do that if there isn't much money earned with those games

twin juniper
#

true

grizzled summit
#

so lets see what I will come up with ๐Ÿ˜„

twin juniper
#

maybe im misjudging the costs somehow. i had a dedicated running today and it was at 0% cpu usage. i dont know but could u have several instances on the same dedicated server?

grizzled summit
#

I currently have no idea

#

but afaik you have to start a dedicated server for each match instance

#

tomorrow I will start with this project, as soon as I'm done, we will know much more in detail ๐Ÿ˜Ž

twin juniper
#

i am running on a google cloud server right now and the estimated costs are like 50-80$ per month for 1 instance

grizzled summit
#

that would be pretty tough if there is no other way to do it

twin juniper
#

i was in love with the idea of matchmaking as well (at first). i ditched my project now, cause of all the issues i found

#

and doing something with dedicated servers people would host themselves.. also singleplayer could be something ๐Ÿ˜›

grizzled summit
#

thats true somehow
let's see If I change my mind in the end too ๐Ÿ™ˆ

#

I'm leaving now, thanks a lot for your help again ๐Ÿ–

twin juniper
#

always, cu!

wary crow
#

Hey all, any of you use the XMPP functionality built into UE4? I'm curious about Epic's decision to use libjingle instead of libstrophe under the hood, mostly because there doesn't seem to be any documentation on the former.

night jay
#

Anyone else dealing with spikes in bandwidth?

#

I honestly don't know what's causing them for me, those RPCs you see are in the default character movement component

jolly siren
#

what version?

night jay
#

Maybe, I'm using 4.16

#

What's weird is this

#

Why the hell does the frag grenade need to replicate the playerstate

#

or the primary and secondary weapon

#

or the player's health

#

I don't understand

#

The grenade spawns with the player as its owner

#

Maybe that's what's causing it?

slim holly
#

Ownership has caused me headaches before

#

allthou, you only need instigator right?

night jay
#

I guess so

#

I'll experiment later

slim holly
#

not sure tho what grenades network relevancy needs to be ๐Ÿค”

night jay
#

All it does is just throw the grenade on server, replicated movement and when u throw it an even t is called that it's activated on server and once there's an event hit it will explode a few seconds afterwards

twin juniper
#

i learned that 416 movement component is bugged as hell. i had huge problems using it. i switched to a blank 417 movement component and it worked perfectly fine

#

if anyone ever has issues, update the character to a newer version.

slim holly
#

didn't they make generic threats about fixing the movement component sometime soon?

#

since it has been [a mess] for a long time now

twin juniper
#

i didnt find any information about the issue itself tbh

jolly siren
#

@twin juniper what issues?

twin juniper
#

that hte movement component is bugged

jolly siren
#

right..

#

I meant what bugs?

twin juniper
#

ah, sorry. i had client side lag that was totally unusual. even on lan clients they lagged in a pattern that didnt seem like your normal lag. dont know how to explain

brittle sinew
#

Do you mean the CharacterMovmentComponent?

#

If so, I doubt 4.17 had anything to do with it, as it hasn't been changed since June and those were pretty minor changes

#

Guessing it was another part of the engine or just your project

#

Well, I might take that back haha, there was a change that dealt with client-side smoothing, but I'd never had an issue like that in 4.16 before personally

inner iris
#

Oh have to check that out! Have had some frustrating subtle jitter regarding movement on 4.16, thought it was on my end- will try on 4.17 and see how it goes

timid pendant
#

Hello I have a dedicated server and when i launched it said the varest plugin is not found so I took the plugins folder and pasted it into the server directory and now it gives this error

#

Do I have to edit my server.target.cs and add the module there?

hasty adder
#

Does the editor load with the plugin ok?

#

You shouldn't need to copy things around just use the front end to build it all out my server target doesn't have anything for varest

#

But works

timid pendant
#

Yeah the editor does

#

When I built at first it said the varest plugin is missing. So i just added the plugins folder and it gave that error

hasty adder
#

Where did you put the folder?

#

Should be in project name/Plugins/Marketplace/

timid pendant
#

I fixed it by doing the server build in visual studio. Before I used the package manager to build it inside the editor

twin juniper
#

hey

#

do events like Add Impulse need to be multicasted?

#

i dont know what the limitations are of the default Movement replication on char mov comp

#

because if it just needs to be called on the server

#

then iw ould like to know

slim holly
#

@twin juniper I'd say impulse replication does not compute very well

#

at least I never got it to work at over 100ms simulated latency

#

it's either painfully delayed on clients+ jerks the player, or server can't keep up with it and tries to correct it twice, making it rubber band

#

but my testing was done with Characters(and charmovement), it might work fine on regular actors

#

but duly note, it still has delay in it

twin juniper
#

hm

hasty adder
#

You just trying to do a thruster of sorts on a character?

slim holly
#

you would use AddForce for that one

obtuse zinc
#

im thinking of ways to handle a player dying, and deleting the actor and spawning a new one causes some annoyances with their weapon and having to respawn all of that stuff as well. Would it be bad practice for me to instead unpossess their actor, hide it, then move it to spawn and possess it again?

slim holly
#

I just bound a ForEach loop to destroy any equipment upon actor removal

#

I mean OnDestroyed event

#

you probably want player to have option to change starting loadout right?

#

I think it's the faster way, instead of updating owners and instigators to existing weapons to get damage output right

#
  • reset any conditional variables like ammo
obtuse zinc
#

so as of right now i dont plan to allow them to change their weapon on respawn, they choose a weapon at the start of the round and theyre use it for the round

slim holly
#

right, so then I would suggest resetting the characters

#

I think epic uses those for respawning

#

then you would only have to switch between spectator pawn and game pawn

obtuse zinc
#

so you're saying dont kill the actor and spawn a new one every time, just reset them

slim holly
#

yea

obtuse zinc
#

ah okay

#

thanks

slim holly
#

I think gamemode baseclass has tools for that ready

#

never used it myself tho

twin juniper
#

@twin juniper By blank do you mean making a new Character class from scratch and porting over all logic or just converting project to 4.17?

#

Because I've seen the client lag during 4.16

#

And it's extremely irregular

#

Very annoying in VR...

#

i made one from scratch

#

we actually are testing that right now, i can tell u more in about 1hr

twin juniper
#

@twin juniper when we ported the project to 417 the problem remained and then i swapped the character to a new default 3rd person template char and it worked like a charm

#

im compiling and uploading, will take like 20min

#

Hmm that seems like alot of work for a random chance of improv...

#

I have many months of work that would have to be ported, and the baseclass has cast references everywhere

#

in our case it is not an improvement, but mandatory. the issues we have are ridiculous

#

let me paste u 2 videos

#

it seems like the higher your ping, the worse the issue

jolly siren
#

yeah I'm interested in seeing as well

twin juniper
#

btw if u only have a slight jittering it might be solved with r.vsync 1

#

i got very sensetive now ๐Ÿ˜›

#

*became

#

UE4 Has autism

#

Destroy() on ACharacter, then spawning a new Character and possessing it seems to keep the same movement mode as my old CharMoveComponent on the OLD actor

twin juniper
#

yeah it seems to work now using a new 3rd person char template instead of just updating to 417

twin juniper
#

that

#

is by far

#

the dumbest shit unreal has done

#

#autism

#

set one character to be flying, it sets all of them

#

WHY IS IT STATIC??

#

Engine modification #4 is now in session

hasty adder
#

Looks like the potential mechanics of a puzzle platformer game to me

twin juniper
#

no not that

#

the fact that unit8 savedmovementmode is static

#

static = shared

#

i think shared is a better name for static variables lol

#

becuase its shared among all instances of that class type

tropic moat
#

wow, i had to check it out myself

#

it is only used in PreNetReceive and PostNetReceive though

#

you can override both of those functions and get rid of that

twin juniper
#

@tropic moat you talking to me?

#

or someone else lol

tropic moat
#

only last line is relevant to you, other two were just me talking to myself

twin juniper
#

yea

#

@tropic moat what do u override it with tho

tropic moat
#

original code, but skip the part with SavedMovementMode, that would be my first step

#

to be honest that static variable is used to change one bool, bNetworkMovementModeChanged

#

it would be best to see how it is used, to find out why that static variable is even needed

twin juniper
#

@tropic moat couldnt u just

#

removed static

#

Lol?

tropic moat
#

that requires engine modification

twin juniper
#

thats fine

#

ive already made 3 other changes

#

this would be the fourth

tropic moat
#

then change that static variable to a member variable

brittle sinew
#

@twin juniper are you sure that variable actually has any effect on the movement mode used, however?

#

It doesn't change the movement mode within ACharacter, and UCharacterMovementComponent never pulls the value

tropic moat
#

it may trigger ApplyNetworkMovementMode for multiple characters

brittle sinew
#

I mean, I'm looking at the functions, and all it does is set two bools related to network updates on the CMC, but within the CMC there's not one mention of the variable

tropic moat
#

it's used in ACharacter::PreNetReceive and ACharacter::PostNetReceive

brittle sinew
#

Yeah, I understand, those are the functions I'm referencing

#

I'm saying I don't see how that has any effect on the actual movement mode of the CharacterMovementComponent

#

To me, it just looks like it's used for networking and seeing if the movement mode changed

#

I understand the fact that it's static looks like it would do something bad, but I just don't see where that would actually happen

tropic moat
#

i'm also not sure if this is really the cause of his problems but thanks to that variable, one character may trigger ApplyNetworkMovementMode for many
looks wrong to me

brittle sinew
#

Yeah, it does look a little off to me as well.

#

I just don't see it causing the problems they're describing

twin juniper
#

@brittle sinew it would explain

#

why after i destroy my character after death

#

why its still in swimming mode

brittle sinew
#

Why?

#

Why would it explain that?

#

That's my point

twin juniper
#

Because its not destroying the mode

brittle sinew
#

Yes, but UCharacterMovmementComponent::MovementMode never gets set using this value.

twin juniper
#

MyActor->UnregisterAllComponents()
MyActor->DestroyActor()
Char = World->SpawnNewCharacter()
Ctrller->Possess(Char);

#

if i do that

#

it should NOT

#

keep the same movement mode

#

that i had

brittle sinew
#

Are you even reading what I'm writing

#

I understand that

#

I agree, it shouldn't do that

#

But this variable is never used in deciding the MovementMode to use.

tropic moat
#

what if new character get replicated data from old character ? and then that static bool triggers apply movement ?

brittle sinew
#

I'm not saying your issue isn't valid. I'm just saying this likely isn't the cause of it

tropic moat
#

just a speculation of course, remove that static variable, check if bug still exists and if yes, look again

brittle sinew
#

Well @tropic moat, then it uses ReplicatedMovementMode

#

Not the static variable

tropic moat
#

yeah, and it was Swimming

#

because old character died while swimming

twin juniper
#

^

#

thats the only time it does it

#

lol

tropic moat
#

i'm just guessing here

brittle sinew
#

@twin juniper I thought you said you were using Destroy over DestroyActor?

twin juniper
#

ive used both

#

but yeah currently

brittle sinew
#

AActor::Destroy calls UWorld::DestroyActor, but it also does more

twin juniper
#

im using destroy

brittle sinew
#

Well that's not what you just posted above

#

:p

hasty adder
#

Isn't it normal when a player is unpossess they maintain there last known movment.

#

Like usually you have to adjust it to how you want it or possess the pawn with an ai that will return to an idle stance

#

I mean games way back network disconnects usually resulted in the llayer running off into a wall if the pawn wasn't destroyed on the disconnect

twin juniper
#

Im going to try

#

just turning that variable to not be static

#

and see what happens.

brittle sinew
#

Personally, I would try to step through UCharacterMovementComponent::SetDefaultMovementMode and see if it's setting the movement mode to swimming there

twin juniper
#
// Static variables for networking.
//
static uint8 SavedMovementMode;```
#

Lol

#

Just noticed the comments they had

#

Also

#

there should be no way now that i think of it

#

that that should be an issue

#

because its in ACharacter

#

and my character gets destroyed

twin juniper
#

@brittle sinew so i removed it

#

now it works

#

._.

#

Time to add this to my UE4 Autism Fixes Spreadsheet

brittle sinew
#

Fair enough, guess I'm eating my words :p

twin juniper
#

@tropic moat just case you wanted to know the results im pinging u

#

It makes no sense tho

#

like i understand ur point

brittle sinew
#

Might have to do with it not activating the movement update? Dunno

twin juniper
#

I should make a video

#

just showing it lol

#

before and after

brittle sinew
#

Let's just hope it didn't break two other things

#

๐Ÿ˜‰

twin juniper
#

yea

#

LOL

#

thats why im keeping a spreadsheet

#

so i know exactly what ive changed

#

For example inside of InstanceBody the InstanceCount or something is uint16, Ive changed it to int32

#

because otherwise it wont go above int16

#

for each instance

#

and whenevr u doa trace it will return -1 on ones which are above the number

#

damn my typing is bad.

tropic moat
#

yay it worked

twin juniper
#

@brittle sinew btw to do Steam Authentication, you dont actually have to modify the engine code

#

The other day i found a way to do it without modifying OnlineAsyncServerSteam

#

heh another thing btw

#

evidently it seems like OverlapEnd() is called when Destroy() is called

#

thats really lame

vital steeple
#

anyone else get errors and issues when trying to replicate a player camera?

#

i started using controller rotation which sort of works, but has some weird glitches of its own

#

im also seeing this error as soon as i replicate the camera

void canopy
#

Hi Devs ! Any Idea what "UIpNetDriver:ProcessRemoteFunction: No owning connection"

#

I just googled

#

got it

civic belfry
#

ugggg is there some kind of trick to launching your player character in multiplayer? I'm trying to do a wall jump mechanic and it works great on single player. When I run with the dedicated server it starts to work then the server seems to correct itand puts the player back on the ground

#

Tried Run on server, multicast, reliable/not reliable... never works!

#

better screenshot:

slim holly
#

yea launch is physics based movement, which is not covered by default character movement @civic belfry

civic belfry
#

ahhh good lord

thin stratus
#

Set Velocity directly

#

Or maybe use an Impulse?

civic belfry
#

lol that was my next question

thin stratus
#

I use an Impulse for a Dash in Protoball

civic belfry
#

now I'm wondering how jump works lol

thin stratus
#

But used directly velocity in my Rope Swing game

slim holly
#

lemme see what I used

thin stratus
#

Jump sets the velocity iirc

civic belfry
#

ahhhh ok

slim holly
#

yea seems I used SetVelocity too

#

but you need to do the math to make it smooth

civic belfry
#

ok, sounds like a good direction to take for sure. Much appriciated!!!!

thin stratus
#
bool UCharacterMovementComponent::DoJump(bool bReplayingMoves)
{
    if ( CharacterOwner && CharacterOwner->CanJump() )
    {
        // Don't jump if we can't move up/down.
        if (!bConstrainToPlane || FMath::Abs(PlaneConstraintNormal.Z) != 1.f)
        {
            Velocity.Z = JumpZVelocity;
            SetMovementMode(MOVE_Falling);
            return true;
        }
    }
    
    return false;
}

#

So they just set Velocity.Z

slim holly
#

I used this:

#

but my game is 3rd person so I use up vector

thin stratus
#

Yeah most games just jump in Z direction

#

I set the Velocity in my game to move me towards my grapling hook position

#

Mostly seems like modifying velocity directly is the best

slim holly
#

oh right

#

@thin stratus did you do the velocity set on both client and server?

civic belfry
#

ahh so would I need to make it multicast to update all of the clients that my character is jumping, or just the player and the server?

slim holly
#

I modified the default jump logic to support walljumping

#

which produces OnJumped event, which technically is multicast

civic belfry
#

ahhh yesssss its working!

#

need some math, as predicted, but I'm wall jumping!

slim holly
#

now I have an issue: Starting a match, I have custom sub-gamemode enum on gamestate which is used to select which UI to create for players when they join in. However...

#

it uses default value for host

#

I assume it's because of execution order, how to get around this without using delays?

thin stratus
#

I think so, yes

#

(server and client velocity)

#

But iirc, only owning client and server

#

But it was a jam game, Might have done things wrong while rushing the project

slim holly
#

I wish OnRep would trigger on Listen, would make this so much easier

civic belfry
#

perfect, I had most of the math already. adding my current velocity to the wall jump vector that I already had is working really well

#

haven't tested with 2+ players but this is looking good ๐Ÿ˜„

slim holly
#

I suggest testing around 150-200ms

#

that's when stuff starts to break usually

civic belfry
#

oh yeah I was reading about that 'test latency' thing earlier, definitely will do!

slim holly
#

net.pktLag= iirc

civic belfry
#

quickly realizing I've been taking multiplayer for granted in games LOL

#

I've been doing single player for a long time, never expected it to be this intense

slim holly
#

๐Ÿค” hmm, only inherited OnRep Functions can be turned into events

#

I wonder why that is

inner iris
#

Haha yeah as soon as latency gets involved it's another story to the default PIE multiplayer.

#

A lot of fun to try and get it feeling as good as possible even in unfavourable laggy situations

night jay
#

K so I have some issues with rubberbanding I'm trying to solve

#

My character can dash towards an enemy

#

I'm just doing a timeline which lerps character positions

#

then updates character location of the player dashing

#

First I just put the dash on the server but, that causes a delay and unresponsiveness for clients

#

So I tried making the client perform the dash locally too

#

But the local dash almost always goes further than it's supposed to which in turn the server corrects the client's position which causes rubber banding

#

So I need a way to sync rid that rubber banding while keeping responsiveness on the client

slim holly
#

you could add some extra distance to server side

#

otherwise you will have to make it static

#

static as in you need to know destination and traveltime, then adjust the travelspeed on server based on ping so that the character lands on the dash goal position at same timestamp

night jay
#

That's creates an unfair advantage because you will have lower travelspeed with higher ping

slim holly
#

technically yes and no

#

dash being avoidance skill, so it would be more effective with higher ping, it also has the start delay to balance it out

night jay
#

This dash is a dash towards an enemy to attack him

#

Get close and go for the kill

slim holly
#

hm

#

well, you could add small slowdown at the end of dash to give it time to sync

#

most games do that

#

to simply prevent fast traveling with skill spam

#

like, 0,2 sec should be fine

#

which should sync for 200ms of latency

#

beyond that, rubberbanding is players issue

#

imo

night jay
#

It's not really a player's issue when the game is causing it

#

Best solution I think would be you'd try to sync client and server during the dash

#

But I dunno how I'd go doing that

slim holly
#

yea but there is only so much time you can cover with network prediction

#

you can't fight time

hasty adder
#

lol... got my magnet effect working now i need to sort out the auto disable and such when its not in range haha

thin stratus
#

When did Epic turn SteamSubsystem into a plugin? (Version)

#

Is Allar's Blog Entry still working with 4.16?

#

Someone recently setup steam by that?

night jay
#

4.13

#

iirc

thin stratus
#

Hm, what exactly did change? Most of the install steps remained, or?

#

Like changing build.cs and inis

thin stratus
#

Awesome, thanks buddy!

night jay
#

np

past bear
#

I have a question about handling actors placed in the level - I can't seem to get it to replicate anything to a client and it's just on the server.

OnBeginPlay, I check if we're on the server, and if so run a quick algorithm, then call a reliable multicast function

#

said reliable multicast function never gets called on clients?

toxic flare
#

can we see a screenshot?

#

/pastebin

past bear
#

you wouldn't see anything in a screenshot - the setup is described above

#

essentially there's a reliable multicast function behind an 'IsServer' check, and I don't get why that function is only ever run on the server

#

(yes it replicates, and it is always relevant)

toxic flare
#

Odd, A multicast RPC should always call on the clients and serves when called from the server.

#

*server

#

who owns the actor

past bear
#

it's placed in the world

#

so I assume the server

#

as for which actor owns it, I have NFI

toxic flare
#

and your running a dedicated server? Or are you running a peer to peer game?

past bear
#

at the moment it's a listen server (testing in PIE)

#

removed the server / authority check and it still only ever gets called on the server

#

I just don't get it, can you not replicate actors placed in the level? Surely you must be able to

toxic flare
#

I'm pretty sure (98%) that if the actor is set to replicate it should not matter how its placed in the world as long as its either spawned on the server / placed in the world

past bear
#

Log:
LogBlueprintUserMessages: [ObjectiveVolume] Server: !!! DO SPAWN OBJECTIVE !!! - X=135624.063 Y=539515.375 Z=6956.313
LogBlueprintUserMessages: [ObjectiveVolume] Server: !!! SPAWN OBJECTIVE CALLED !!! - X=135624.063 Y=539515.375 Z=6956.313

#

ARGH

#

I think the function is getting called before the clients connect

#

this explains everything

toxic flare
#

ah well , that would explain everything!

#

in that case maybe wait for player to join then call the function on the server

#

there should be events for players joining in the game mode

past bear
#

yeah

#

need to rearrange some of this old game logic, heh

toxic flare
#

sometimes all you need to do is talk it out to yourself to come to the answer ๐Ÿ˜ƒ

thin stratus
#

@past bear You use OnRep varaibles for that

#

Or make sure everyone is connected

past bear
#

yeah, can do it onrep

#

but tbh, this stuff shouldn't be happening before everyone has connected

thin stratus
#

Usually you delay the start of the game

#

Via your GameMode

#

There are functions you can override to handle that

#

It would wait till your custom condition is met

#

and then call BeginPlay

#

afaik

#

@past bear

twin juniper
#

Hey uhm

#

Is it possible to move an OnRep function to be called in another class?

#

For example, say I have a ENUM in my GameState, but i want it to change something on clients locally

#

So I have ACharacter, and AGameState, gamestate has Enum repnotify and when it changes i want my onrep to be called from the Character class

#

not the game state

#

i dont think this functionality is currently possible but i would ove to hear what u guys know.

thin stratus
#

Why would you need that

#

Let the onrep function just get the character and call the function

twin juniper
#

Well for what im trying to do

#

im trying to do a weather syste, but i want the server to make a choice of what weather to spawn

thin stratus
#

Why does that need to be in the character at all?

tropic moat
#

i use events for cases like that, OnRep calls broadcast and everyone interested binds to that event

twin juniper
#

every character has a PArticle SYstem component

thin stratus
#

OnRep can be limited though

twin juniper
#

and i want it to locally set what particle to use

#

if that makes sense

thin stratus
#

Yeah so get the Character in the OnRep

#

And set the variable

twin juniper
#

Yeah but how would u get "the" character?

#

o

#

wait

#

im an idiot

#

OnRep functions are client sided

#

so if i just called to get the local character

#

it would only return that character

#

ok yeah that makes sense

thin stratus
#

Yeah :P

eternal anchor
#

does anyone tried to run Unreal Server on Windows Nano ?

twin juniper
#

Nope

#

I haven't

vital steeple
#

so no one has had problems replicating a camera component?

sweet spire
#

i dont think iv ever needed to replicate a camera comp

hasty adder
#

Aim offset? Woes @vital steeple

vital steeple
#

i just had trouble using the camera for a server side trace, it sees the position of the camera but not the rotation, so ive been using controller

#

but when i use controller, their appears to be a weird sway (like gun bob)

#

all the tutorials i lookup show using camera as both the origin and end (using forward vector) as their server RPC trace

#

but when i do that, like i said, it just doesnt get the forward vector, only the origin

#

so i guess im just curious if doing this totally wrong and the tutorials ive watched are outdated

slim holly
#

you can just replicate the trace end location ?

#

and drive animation from that

hasty adder
#

Usually you set a rotation value that's replicated in the character from the controller rotation or camera rotation

#

And update it when the camera changes rotation such as if input on the movement != 0

#

There's usually no need to replicate it's rotation since tech the camera is a personal thing. The yaw is usually replicated by character movment

vital steeple
#

hrm

#

i suppose i could run a client side trace on the camera and then replicate the two points and have the server run its own trace

#

or do your way inphidel, because replicating the camera is overkill

#

just seemed like the way all the tutorials did it...

#

(not replicating but just running traces directly from the player camera with a server RPC)

#

anyway, thank you for the ideas, i'll figure it out ๐Ÿ˜ƒ

hasty adder
#

Was the tutorial for multiplayer?

vital steeple
#

just multiple youtube tutorials i looked through. i dont think the official one covered trace rpcs

#

mostly just the menu, game creation, chat, and other stuff thats pretty universal

#

and i htink the fps multiplayer example is mostly in c++

#

what im working on now isnt quite as lightweight as a normal trace, since its on tick (its for a building placement "blueprint" that you hold to choose where you want to put your building)

#

so it has to update every frame and does cool stuff like rotate when you right click... anyway, i didnt want to spam the server with updates on it every tick. instead i just have it replicate the variable when you want to place the building so it only has to replicate the data once

#

looks liek the sway in the mesh is still there but whatever, its good enough for alpha ๐Ÿ˜ƒ

#

whats weirdest is that the trace doesnt sway, just the mesh, and the trace determines the positon of the mesh...

#

wahtever, not important. thank you for your ideas ๐Ÿ˜ƒ

hasty adder
#

It's small data going with the same packets as far as I know

vital steeple
#

i just figure anytime i can optimize network traffic, i should try

#

so if something seems unnecessary, i'll try to find a work around

solar flower
#

I'm calling a multicast RPC from the beginplay of my BP_Spawnpoint.

It's working on my server, but not on my clients (I assume because they're still connecting?). Is there anyway to check if all playercontrollers have finished loading the level after servertravel?

#

It works when i add a 2 second delay before the call.

vital steeple
#

i call stuff on beingplay from the playerstate

#

that seems to work

#

but yeah it definitely seems to take a moment to actually create the playerstate

#

sometimes its one or two seconds, sometimes as much as five or six

#

my chat system uses playerstate to store the text log, so i actually ahve the chat box spawn when the playerstate begins play

#

i dont know if theres a best practice, but i generally avoid using beginplay for things that seem to take a bit to spawn and instead i like to use custom events as a sort of begin play that triggers when i call it

#

@solar flower

solar flower
#

@vital steeple Thanks for the response, sorta figured that. Is there a way to wait for all players to have the level loaded before spawning anyone?

#

Also, since you mentioned playerstate, I'm aware of it but haven't seen a reason to use them yet. Is there any reason i need to? I'm storing everything in PlayerControllers, GameModes, and GameInstances currently.
IIRC, clients can see playerstates from other connections and are replicated.

fossil spoke
#

@solar flower @vital steeple There is nothing wrong with using BeginPlay. You just have to keep in mind that in an Multiplayer environment it takes time for information to propagate due to connection speed etc etc. You never assume that something is going to be instantaneous unless you have good reason or understand otherwise.

#

@vital steeple As for your chat box, i would Spawn it when an Players PlayerController is created and use Events to propagate chat messages from the Client to Server and then Server to Clients. Storing an Log locally is fine but you shouldnt replicate that log and use it as an means to recieve new messages as you could possibly be sending the entire log each time it changes.

#

You only really want to know about new messages and then you can append those new messages to the Log locally as they come in.

solar flower
#

@fossil spoke But how would you get around clients missing multicast RPC calls from beginplay? I feel like this is going to happen in several other actors, so is there a way to hold off the level starting until all playercontrollers are ready?

As a side note, I'm still trying to parse through the networking code, but when I hear Reliable i think TCP and i assume the unreliable is UDP. Is Unreal switching protocols when you mark functions as Reliable or Unreliable?

#

If the RPC call was queued I wouldn't have any issues, but it's dropped entirely.

fossil spoke
#

@solar flower Yes Reliable is TCP

#

Calling an Multicast on BeginPlay without giving consideration to clients not being fully loaded is what i was talking about.

#

Its your responsibility to ensure that you avoid "race conditions" like that.

#

If you have an Actor that is performing Multicast RPCs on BeginPlay you may need to rethink your design.

#

As far as im aware there is no way to find out if an Player has fully loaded the level from Blueprint.

solar flower
#

@fossil spoke Hmm, well i'm trying to set environment materials. It's not all that important how quickly they're set, but i'd like to keep it readable and modular and putting a 'set environment materials' function in my playercontrollers seems bad practice.
Is there a timeout limit for players to connect?

#

Wait a sec...The server will always run it's beginplay ahead of clients, right?

fossil spoke
#

Yes correct

#

If its an Dedicated Server then you will have an Arbitrary time for when the first client even connects

#

Depending on your game, it could be 30 seconds, it could be 2 days.

#

If you have something that is dependant upon the current state of the Game that needs to be replicated or passed to clients, then using the GameState as an proxy to fascilitate those parameters is ideal.

solar flower
#

@fossil spoke Not using a GameState either, what exactly separates it from the Game Mode or Instance? Or in other words, why would i need it? I feel like all my RPCs are dependent on the current state of the game and need to be replicated.

fossil spoke
#

The GameState is designed to ferry replicated information from the Server to all Clients, functionally it is very similar to the PlayerState

#

Ideally it is used to keep track of the state of an current game.

#

For exmaple.

#

If i was playing Capture the Flag

#

I would put on the GameState the current score for each team.

#

This means that when the Score is changed by the Server, it is automatically replicated and available to every player via the GameState being shared to all Clients

#

The clients are free to access and use information held on the GameState at all times (such that it is valid)

#

I use the GameState as an bridge between the Server and the Clients for game critical messages and information.

#

An further example.

#

Generally i need all clients to know when another client has just been killed (for killfeed and other information/events to trigger)

#

When the Server detects that an Client has just died, it asks the GameState to Multicast an Delegate call to all Clients with relevant information about the death of another Client

#

So that they can all do stuff about that

#

The ability for the GameState class to be accessable and replicated to all Clients means that, if for example the Score is changed, an new connecting Client, will always recieve the current most up to date score when they finish connecting.

#

There is no need to tell that Client manually that the Score is currently X, when they finish connecting.

solar flower
#

Ah I see, I think i've put similar functionality in plain actors or level BPs before.
Is there only one GameState (like the gamemode) and it exists on the Server?

#

But is visible to all connections

fossil spoke
#

No, GameState exists on the Server and all Clients

solar flower
#

So every connection would run the Tick

fossil spoke
#

PlayerState is slightly different, the Server and all Clients have access to every other Clients PlayerState

#

every connection would run the Tick Not sure what you mean?

#

GameState is an Actor, every Actor Ticks unless told otherwise?

solar flower
#

I meant that the clients run the GameState events locally as well? Sounds like they do. And these "state" classes are just there to allow more separation between game network logic and actor functionality?

fossil spoke
#

Yes, GameState exists on the Server and all Clients every Client has an GameState Actor. As for running events locally depends on how its setup.

#

Yes the *State classes are there to help fascilitate more network focused functionality from general Actors you could say that.

solar flower
#

@fossil spoke Thanks man, clears it up

fossil spoke
#

Epic has alot of documentation on both GameState and PlayerState classes and their intended purposes (as well as other just as important classes) you should check that out.

solar flower
#

will do

raven holly
#

Anyone know why this would break sometimes in multiplayer?

rare cloud
#

@raven holly, if you want to change player speed of the character do it on your character bp/class

#

I mean the logic is, player press the sprint button, call an RPC which change the speed of the player on server side

#

and you only need to put your speed var from the charachter on your anim graph

#

there is no gameplay feature on an anim graph

raven holly
#

this is for animations

#

animation blend space "speed"

rare cloud
#

oh ok, normally forward vector and velocity is correctly replicated

#

I will confirm for velocity

#

@raven holly, the get velocity function is get from the RootComponent and sadly the ComponentVelocity var isn't replicated

raven holly
#

because im using this to check if the player is walking backwards

#

and sometimes the player will walk backwards on the spot

rare cloud
#

maybe you can get it from the CharacterMovementComponent

raven holly
#

it works sometimes, but sometimes it gets stuck

rare cloud
#

@raven holly, yeah the Velocity from the CMC seem to be correctly replicated

#

UMovementComponent has a FVector Velocity variable, which are updated by the CMC

raven holly
#

hmm

#

maybe that one is more reliable

civic belfry
#

Do you guys avoid nesting too many child blueprints inside each other? Seems like the more child BPs I use, the more buggy things become

modern dome
#

@civic belfry what do you mean by that? Using ChildActorComponents or having a Hierarchy of Blueprint classes?

twin juniper
#

hello

#

please

#

can I run 5 dedicated servers on a single machine with 5 ips? Or the steam doesnt allows it

civic belfry
#

@modern dome like having a blueprint in a blueprint that has blueprints in it

#

hierarchy I guess

thin stratus
#

Usually you have 1 BP Class and extend it via Components

#

And IF you have a second BP that you want to combine with the first one, you usually attach it

#

Or you use ChildActorComponent

jolly siren
#

@twin juniper yes you can

twin juniper
#

@thin stratus how do u avoid lag duplication of widgets

#

somehow, when the client lags, while dragging an item, it creates a dupe

#

any ideas how i could patch this up

#

it doesnt make a dupe in my db

#

but still

#

If anyone knows, pls assist

thin stratus
#

Lag duplication of widgets?

#

Never had that

#

Also, does anyone know how I can check if a PlayerState is just a dummy?

#

When people leave, UE4 creates a dummy PlayerState for them to reconnect and get their values back

#

But I don't want to add that to my widget lists, like playerlist

#

usually I check on BeingPlay if the owner is valid (serverside), but current system calls beginplay locally on everyone to add the widget entries

twin juniper
#

@thin stratus So, client lags while dragging a widget, after lag, there is now two of that widget. (One in the pre-drag, and one in the new slot)

#

What do you mean check if its just a dummy

thin stratus
#

I explained what a Dummy is

#

If you lave a network game, UE4 creates a PlayerState, in case you reconnect

#

That PlayerState lives for a few minutes before it gets destroyed. It also calls BeginPlay etc

twin juniper
#

o lol

#

i didnt read that

#

Could you have a timestamp

#

on it?

#

thats created in beginplay

thin stratus
#

Hm, I could simply instantly destroy it

#

but I assume it might still shortly flicker the new entry

twin juniper
#

So im assuming whats happening is players are being disconnected but the playerstate dummy is staying

#

and u dont want that

thin stratus
#

It's not staying

#

It's newly generated

#

it's a placeholder afaik

#

Imagine you get a DC

#

The placeholder has your kills/assists etc in it

#

If yo ureconnect in time, you will get that stuff back

twin juniper
#

yea

#

but its not getting it back?

night jay
#

playerstate is unused

#

I believe there's a bool checked somewhere

#

making it marked as inactive

twin juniper
#

its not very useful to him tho

#

if u cant say where lol

night jay
#

pretty sure its the gamestate that keeps track of inactive playerstates I'm not sure

twin juniper
#

uhm

#

game state has a list

#

of all player states

#

@thin stratus I believe you'd want to check TArray<class APlayerState*> InactivePlayerArray, AddInactivePlayer(APlayerState* PlayerState, APlayerController* PC) and FindInactivePlayer(APlayerController* PC) in GameMode.

#

not 100% sure but what you might be interested in is OverridePlayerState(APlayerController* PC, APlayerState* OldPlayerState)?

thin stratus
#

OverridePlayerState is a function I exposed to BP iirc.
The InactivePlayer functions are, iirc, not exposed to BPs

#

guess I have to expose them then

#

ty

twin juniper
#

@thin stratus if you're doing this exclusively on the auth world (dedicated server, listen server owner, standalone), you could just do the path of least resistance and do a UFUNCTION(BlueprintCallable, Category="Game") TArray<class APlayerState*> GetInactivePlayerArray() const
that allows you to get the list from BP. If you need it to be event driven then yeah your solution would work CuteNew

thin stratus
#

On the server I can simpyl check if the Owner is valid

twin juniper
#

would be slightly slower than just getting the list, but that would work too haha

night jay
#

Expose em and PR pls

#

Expose em and PR pls

#

Expose em and PR pls

thin stratus
#

I would. I would love to expose even more

#

But then again, most things are blocked off with "Put it into a plugin."

#

So not gonna spend time on it atm

ruby epoch
#

Iam using set view target with blend

#

for specting for teammates

#

all looks fine

#

but I cant see horizontal moves

#

how to fix that?