#multiplayer

1 messages ยท Page 364 of 1

merry hemlock
#

so they are using the same instructor class but that instructor is set to replicate

#

what is confusing is that the VR (server host) still gets seen as remote and gets painted yellow

#

annnnd I can't connect at all now

#

I tried packaging the game and running it on two different machines (it's development build)

#

loads up fine on both

#

console command to host

#

console command to connect

#

doesn't work

elfin tartan
#

Does anyone know why animations "jitter" on laggy clients over the network? it's as if when they skip updates or packets, the animation literally freezes while it waits for the next move. This makes a laggier client look even laggier and is really silly. Is this an option I can turn off somewhere? (please @ me if you reply, I may not see it otherwise!)

blissful thorn
twin sorrel
#

is there a node or something that could run things on server rather than a whole event

zinc loom
#

Yiiiiew!!! My pull request got pushed to Master :)

#

Stops graphical RHI modules being built against dedicated server targets - so the binaries will run on cloud instances and headless machines

sterile pebble
#

does ue4 store network data somewhere? Like if I need to compare data in time? Or I should make such system by myself?

tough gyro
#

anyone know where to find that bigass pdf about networking that someone wrote?

pallid mesa
#

Look on pinned messages and look for cedric_eXi network compendium @tough gyro

tough gyro
#

thanks

fierce birch
#

@tough gyro as you love these video tutorials, you probably want to know that udemy has two paid courses on ue4 multiplayer now ๐Ÿ˜„

#

oh crap, my link broke

#

oh well

tough gyro
#

fuck videos ๐Ÿ˜›

fierce birch
#

I know ๐Ÿ˜„

zinc loom
#

Meepmeep what data are you trying to compare ?

sterile pebble
#

@zinc loom Position.

#

I think it's easy to add my own map and store time-position values, but it could be already done somewhere inside character movement component or unreal network code

pallid mesa
#

I think it kinda does till it gets consumed

#

Because of how addmovementinput works

manic pine
#

positions should be stored in the stored moves for a char

zinc loom
#

So CharacterMovementComponent could be extended upon to log

manic pine
#

which is used to replay back moves in case of server/client disagreement

pallid mesa
#

No code in front of my face rn, but seems like it could have something over there on cmc for you to use

zinc loom
#

It would be your best bet as it already has some replay functionality already (eg stores position internally)

#

If that's too hardcore and you just need positions, could do a timer to log getworldposition, but also: what's the data for?

sterile pebble
#

I'm going to look into StoredMoves

cold sparrow
#

guys, can someone explain me this:

#

why names are switched for each client? (Dedicated server, 2 clients)

#

each own characted on each client is _C_0

jolly siren
#

right the local character will be 0

cold sparrow
#

so, object names on each client are different then, right?

jolly siren
#

yes

bitter oriole
#

Names are local

#

They're a function of the spawn order

jolly siren
#

each client has their own instance of the characters anyways

cold sparrow
#

hm... how unreal knows which object corresponds to which on each client, by some GUID?

bitter oriole
#

(Whoops, confused PC for PlayerController)

jolly siren
#

lol

cold sparrow
#

edited to client

bitter oriole
#

So basically @cold sparrow , this is a large topic

#

The general idea is that everyone is pretty much independent

cold sparrow
#

ok, I always thought that object names will be synchronized

bitter oriole
#

In the case of pawns, the Game Mode class spawns a pawn for every player, and the player controller knows which pawn is his

#

The PC (player cont.) and pawns both exist on the server and client

cold sparrow
#

Right

bitter oriole
#

So it's pretty obvious which pawn is yours - the player controller is associated to it when it Possess() the Pawn on the server

#

And that link is replicated to your local game

#

The name isn't super useful in UE4, really

brittle sinew
#

To answer your question directly @cold sparrow, yes, replicated actor references are resolved via GUID.

cold sparrow
#

oh, thanks.

brittle sinew
#

If your object isn't stably-named, you can't rely on its name to be the same across clients.

cold sparrow
#

FNetworkGUID

#

ok, I was debugging some network code in the game and I noticed some wierd behaviour, so I used display objects name on self. Well, learned something new. Thanks guys!

cold sparrow
#

finally! something uniques amoung all clients:
player state -> player id

vital steeple
#

it seems like running things off "onrep" is really slow sometimes. like it seems like theres a straight up full second of wait time.

#

wouldnt that negatively impact things like binding players health to onrep? like wont players just die several hundred milliseconds after their health actually drops to 0?

raven holly
#

@vital steeple what version?

#

that has been fixed in 4.18 i think

#

or coming to 4.19 cant remember

vital steeple
#

4.17

raven holly
#

rep notify delay was fixed

#

yeah

vital steeple
#

ok phew

#

it seems instant sometimes but other times it seems pretty bad ๐Ÿ˜ฆ

raven holly
#

use the node 'force net update'

#

when the server detects a death

manic pine
#

the server should be killing the pplayer

vital steeple
#

shouldnt it just force net update every time a player takes damage?

manic pine
#

so technically it shouldnt matter for that part

raven holly
#

no shaq

vital steeple
#

is that too demanding?

raven holly
#

the update is based off what you have set the frequency too

manic pine
#

net updates are dynamically adjusted when the value doesnt change

raven holly
#

^

manic pine
#

you can disable it, though it'll increase bandwidth use

#

or you can set the minimum higher

raven holly
#

but when you want something to update quickly, use force net update

vital steeple
#

ok so just for critical moments

#

use force net update

raven holly
#

yeah

vital steeple
#

ok cool. thank you very mcuh ๐Ÿ˜ƒ

#

aaaah much better!

#

theres no weird "skips" or pauses when players and buildings take damage

#

you guys rock ๐Ÿ˜ƒ

raven holly
#

np

bitter veldt
#

hey there

#

when I look at these online lobby tutorials for unreal engine 4

#

i was wondering who hosts these lobbies

#

is it the player who hosts them

#

or is it a server ran by the game devs or whatever?

cedar compass
#

@bitter veldt It depends on what you want to do. If you want it to be custom, local games for groups and such, then you have the player host it. If you want matchmaking and mmos and such, you need to host your own.

bitter veldt
#

@cedar compass will just be doing local games/online games (4 players - inviting friends from steam etc)

#

do you know any tutorials or documentation that can point me in the right direction?

cedar compass
#

@bitter veldt Check out the Advanced sessions Plugin. There should be tutorials for that and it really helps if you don't want to use use a lot of c++.

bitter veldt
#

ah im already familiar with advanced sessions and have it installed, just wanted to know if there is documentation on this specific thing

#

the videos I watch just show how to do stuff and don't really explain things very well

twin juniper
#

i have question what i have to change to convert this systems skills system , inventory system ,and quest system the single player to multwiplayers

#

Unreal Engine Version: 4.12.5 Template: Top-Down Template In the former videos we added the ability to equip and unequip weapons to our character. However th...

โ–ถ Play video
#

i have to change all begin to player to custom event???

#

and put replay to the server ???

grand kestrel
#

That guy mispelled his YT channel

twin juniper
#

ok

thin stratus
#

Why would we know what you need to do for that?

#

Usually you code Multiplayer Systems from ground up for Multiplayer

#

Changing existing code from others from Single to Multiplayer is just not worth it

#

And if you need to ask as such as vague question, you should stop doing Multiplayer and that size and go back to learning the basics

ivory parcel
#

Has anyone managed to get SteamSockets to work ?

twin juniper
#

I gonna convert the bp to c++ code

twin juniper
#

when i try to replicate springarm rotation as i would do with camera, somethimes it does work and somethimes not

#

with camera everything is good, but if i use spring arm it doesnt work

#

but it worked out once when i was toggling alot of settings on springarm and then didnt work again

#

wow and now it works though i didnt change anything

faint fable
#

find session node left with max results 0 should find all availble sessions ?

#

@twin juniper that would only replicated on the server cause all others would be remote. (right?)

twin juniper
#

but i fixed it by just toggling some things and reseting them to normal

faint fable
#

Use a branch on event tick that is localy controlled? if it is set the rotation and update too all otherwise it shouldn't do anything

#

The way you have it now: Is server ? then update. Meaning no clients will update if controlling this.

#

if you just plug in the remote then everyone will just update it even if they aren't controlling the object

opaque tinsel
#

Has anyone had any issues where if you were to play with dedicated server check, the camera would go crazy for a few seconds then spawn the player in correctly. I tried without the dedicated server check and it spawn correctly. Also with dedicated server check, i realize that some of my animations that plays is buggy such as dashing forward or any direction would play the animation but not move the player. It works before but now doesnt. Anyone know whats going on?

cedar compass
#

@opaque tinsel Well the dedicated server makes it so that the viewport viewport is a client, so that behavior is what a client will see, probably.

opaque tinsel
#

well i tried with 2 players, and it seems like both the server and client is doing this

cedar compass
#

With dedicated server settings?

opaque tinsel
#

yes

twin juniper
#

@thin stratus what you suggest ???

twin vault
#

no reason to replicate things that are only visual stuff, also dont RPC on tick, validate and execute the code locally @twin juniper

twin juniper
#

@thin stratus converting the bp to c++ and put the server do i make in singleplayer a find a away to put the cliente interact with server ??

#

@thin stratus where you from ?

merry hemlock
#

Okay, I've looked through a bunch of unanswered UE hub and there MUST be a way to do this - how do I deploy/launch across a local area network using the editor's Project Launcher (I'm using the recommended settings by project artemis so I know it is possible) ...however my device WILL NOT show up in the device manager on either machien despites connecting every other way -

merry hemlock
#

has ANYONE encountered this? @thin stratus can you take a look at this?

merry hemlock
#

Failed to add the device!, that's all it says when I manually add an IP that I can directly ping

brittle sinew
#

Any hints in the console?

#

Worst case scenario, you might just be able to throw together a script that rsyncs it to the other computer, but I get the appeal of having in-editor support

merry hemlock
#

checking now

#

Nothing even makes it to the console

#

it's like Epic doesn't care about that particular feature

#

there's almost no docs on it

#

it's not a dealbreaker, I have sync dropbox folders so the moment I save one one machine the other gets the changes, i use that method for editor testing and I just copy the packaged build to a network folder.... manual backups every few hours otherwise

calm plaza
#

Hello, friends. Question for anyone able to answer. So, I'm spawning an item on the server, then calling a multicast in order to replicate disable sim physics, no collision, and attach to player character. The problem I'm having is that unless I delay for approx .2 after the spawn, I will get an error saying "Accessed None" in reference to the actor that was just spawned. Thoughts on what may be occuring here and how to fix this in a less janky way than upping the delay? Thanks

brittle sinew
#

Use a RepNotify on the actor variable (if you have one; if you don't, make one)

#

Replication isn't guaranteed to be done in orderโ€”you can never rely on it over the network

#

RepNotifies are made for this purpose; they allow you to call a function exactly when something replicates

#

@merry hemlock I've got no real idea on that, sorry

#

Haven't tried to use it myself

manic pine
#

satr, cant you just do all that in the object's beginplay on the clients?

calm plaza
#

@brittle sinew Are Repnotify's multicast automatically or do i need to call a multicast seperately?

#

@manic pine ill give that some thought. Thanks!

brittle sinew
#

They're not really multicast per se...they occur on each client individually when they receive the information

#

It's not like it's one RPC going to all clients

#

I agree with @manic pine's idea though, I didn't immediately consider that

#

If you don't need to replicate something, don't. ๐Ÿ˜ƒ

manic pine
#

ye, the less replicated the better

calm plaza
#

gotcha. problem is the actor is an item that can be picked up if it already spawned in the level. Once picked up (and held by the character, saves an inventory version. If you select that item from the inventory its spawns the physical version of the item and attaches again to play. So, I dont think Begin Play would work for me.

#

Unless I'm misunderstanding your suggestion. Which is entirely possible.

#

@manic pine @brittle sinew Thanks for you help.

grand kestrel
#

@merry hemlock Don't spam @ someone!

merry hemlock
#

Whom did I spam @?

#

2- the person I did @ , I did it ONCE. If he has a problem with it, I'm sure he'll either ignore me or put a stop to it, him being a MODERATOR

  1. This isn't your job or your channel. Go away if you have nothing constructive to add. The mods police this, not you.
#

Here, let me spam @grand kestrel you, to make sure you read this. Now we are 1 for 1, meanwhile, no one here has learned anything about multiplayer in unreal or shared any news

grand kestrel
#

Oh wow

#

I mentioned the wrong guy

#

But holy shit that attitude lol

#

GL

#

What a douche

#

Almost tempted to @ a mod as you so clearly pointed out that I am not just to help you out

merry hemlock
#

If you are talking about Pedro, let the mods handle it

#

it's not your job

grand kestrel
#

I think so

merry hemlock
#

report him or me all you want but when you enter the chat, all it does it clog the channel

#

let them DM him and handle it

fossil spoke
#

Is there an issue here guys?

grand kestrel
#

Well

#

I was attempting to tell Pedro not to spam @ people (cedric) and accidentally @ blake instead

#

Who then went onto being a flaming ass

#

So I guess that's up to you if Blake needs a moderator ๐Ÿ™„

fossil spoke
#

Why dont you both just let it go and move on....

grand kestrel
#

My goodness

#

All I said is don't spam @ someone

#

Didn't need that

#

And for the record Blake, I wasn't moderating as you accuse me of, it's just really annoying when someone spam @'s you

fossil spoke
#

I agree it was an little over the top

#

But seriously.

merry hemlock
#

But the person didn't spam you

fossil spoke
#

Just let it go, move on.

merry hemlock
#

moving on

grand kestrel
#

Yeah.. just.. maybe tone it down and pull your head in in the future

merry hemlock
#

devils, have you ever played with the project launcher?

fossil spoke
#

How do you mean?

merry hemlock
#

specifically deploying across lan

#

forwhever reason I can't get the device manager to pick up my other computer

#

even though I am pinging and hosting successfully

#

as well as transferring between network folders

fossil spoke
#

You mean the FrontEnd?

#

SessionFrontEnd?

#

I dont use Launch very often no

merry hemlock
#

well yeah but before I do that, I need to get the computer to show up in device manager

#

it was recommended to test this way from a page in 2016 on a VR game called Project Artemis

fossil spoke
#

I dont dev with VR so im probably not the one to ask.

merry hemlock
#

this was more of a multiplayer issue because the editor can't fidn the other machine

fossil spoke
#

Ok well why dont we see if we can figure it out

#

Im assuming you have the Editor open on both machines?

#

Im also assuming thats an requirement

merry hemlock
#

yep

#

already opened

#

session fronthends ...but don't you have to handle this on device manager first

fossil spoke
#

And both machines are set to be Shared?

merry hemlock
#

make sure both machines are visible?

fossil spoke
#

Are they both Shared?

merry hemlock
#

yes

#

I CAN see them on session fronthead but NOT device manager...weird

fossil spoke
#

Did you notice the Add an Unlisted Device

#

?

merry hemlock
#

it always failed

#

you can see i'm trying to add the IP of the other machine

fossil spoke
#

Did you try using the Mac Address instead?

merry hemlock
#

I did not try that actually, that's a good idea

fossil spoke
#

MAC Address maybe more useful as it wont change if the device is disconnected/reconnected unlike an internal IP might change.

merry hemlock
#

makes sense....you have to do some real hacking to change it afaik

#

is it the link-local address?

fossil spoke
#

Cant remember, if you type in ipconfig /all i think it appears

#

Maybe not

#

It maybe the Physical Address of the Adapter

#

Been an while since i needed one actually lol

#

Yes its the Physical Address

merry hemlock
#

just to make sure...i'm supposed to add the machine i WANT to connect to right? It seems absurd for add device to mean anything else but at this point it just is like, dead

fossil spoke
#

That doesnt look like the right address

#

Yes i would assume you want the device to connect to

merry hemlock
#

why does it say that I wonder

#

you see above there is a % in the local address

fossil spoke
#

Like i said, that doesnt look like the right address

#

Check my Physical Address

merry hemlock
#

I need to convert it that's the problem

brittle sinew
#

There's a link on that page to one that goes backwards

merry hemlock
#

or do I need to leave off that %10 maybe?

#

yeah but it didn't work

#

Please note that of the various IPv6 notations, the one this script will expect is fe80::xxxx:xxxx:xxxx:xxxx.

#

fe80::a49e:f462:91e:23c6%10

#

i'll try without the 10%

mild hull
#

ipv6 and mac are 2 different things

brittle sinew
#

That third sector of it looks off

merry hemlock
#

i agree but it's what ipconfig gives me

brittle sinew
#

Should be 2 bytes, but it's only 3 hex characters

merry hemlock
#

ugh

#

forgot how big of a difference ipconfig is vs ipconfig /all

#

no idea still fails

deep geyser
#

anyone messed with the HTML5 exports, im able to connect to myself via chromium and firefox but i just see a black screen

#

apparently multiple people are having the problem just cant find any answers or ideas around

#

nvm got it had to change AA setting from none to tempAA game started right up wicked

frank quartz
fierce birch
#

@frank quartz wonder if I could ever figure out what all lock up the editor in PIE or after it

#

it's been a constant struggle since ~4.13 with that

#

it doesn't always happen on every project, so it has to be some specific setup (and usually it goes away if you wipe intermediate + saved folders and regen the VS solution

#

you traced yours into HMD stuff tho

bitter oriole
#

So, there is a PreClientTravel

#

Is there a PostClientTravel ?

#

Well, there is BeginPlay.

pallid mesa
#

Hehe

sharp arrow
#

can someone help me

#

idk how can i make the day/night cycle to be multiplayer

winged badger
#

i'd implement a time/clock variable or component in your GameState class and set it to replicate

#

then use that to drive your day/night

#

also EventTick -> SetElapsedTme = GetElapsedTme + DeltaTime is much more straightforward way to keep the time

lyric garden
#

Would this be an appropriate area to discuss automated matchmaking without a dedicated server using steam with without forcing players to open ports just to play?

winged badger
#

might be a good idea to check out the UWorks plugin fo that

#

otherwise you are stuck using Steam sockets for connection (it does work with listen servers tho)

lyric garden
#

We were using it, however given the difficulties with documentation for the specific items, and having little to no prior experience we are finding the task more than difficult to achive matchmaking, leaderboards, steamid, player name, player avatar with a simple click to create/join game without the need to open ports.

Long story short: We're trying to have one button to utilize a method for the player to automatically match with another user that's doing the same thing without having to port forward or create a lobby to then start the match.

This has proven to be difficult to achieve even with uWorks for reasons beyond my comprehension.

#

We are able to pull up the devAPI to allow both users to integrate to steam, but when trying to join the game with one another, this results in no results(aka unable to find the other parties listing).

icy nacelle
#

Hey guys, I'm having a little problem with replication. Here's two bugs which I think may be linked to my chat system. I'm running a dedicated server with 2 clients messaging eachother, which sends notifications to the chatbox widget.

  • The notification widget only pops up for Client 1
  • When sending messages, both clients are named '0'

Here's the first of three screenshots, in this I am getting the owning player to later add to a structure for the message that will be sent.

#

In this second screenshot, I am breaking the structure and getting the authors name from the Player ID.

#

And in this third screenshot I am throwing up a notification (a box that increases alpha) when a message is recieved that is not in the channel the client is currently focusing on.

#

Any ideas where I could be going wrong? I thought I had a good understanding of network replication but it seems like this is something I just cant get my head around alone.

mild hull
#

you are missing the important part, how does the client sent the message to server and how does the server distribute them

icy nacelle
#

The client sends the chat message to BPI Chat system, and any listeners who are watching that channel will pick up the message.

#

I dont think the problem lies with that though? Messages can be sent just fine. I think the problem lies with the author of the message not being referenced properly

mild hull
#

so you get message on both clients but the notification doesn't work?

bitter veldt
#

ay there is it possible to imake somewhere where i can invite someone from my steam friends list to join my lobby using blueprints?

icy nacelle
#

Yep, messages appear for both clients

#

@mild hull Thats why I think its a problem with the message ID not having the correct owning player

mild hull
#

where do you call the notification?

icy nacelle
#

3rd image

mild hull
#

from where do you call that

icy nacelle
#

In the gamestate

#

The player controller -> Game state (adds the channel message -> Notify the channel has updated) -> UI_HUD

mild hull
#

isnt all the information you need already containt in the message you send in OnChatChannelUpdated?

icy nacelle
#

of the BPI?

mild hull
#

if the message reaches everyone, cant you check if its is for another channel and notify the ui from the client?

icy nacelle
#

Thats what I'm trying to do / have done

#

If I share screen with you, I can show you?

mild hull
#

cant you recorded and send it?

icy nacelle
#

Sure..

mild hull
#

and i only noticed now, why are you looping through all player controllers in Pop notification?

icy nacelle
#

Oh, that was something else I was trying and forgot to remove, ignore it ๐Ÿ˜ƒ

#

On second thought, I'm probably going to function better when its not 4:30am. Thanks for the help. I'm going to pick this up tomorrow and try and rack my brain. Thanks!

#

@mild hull Thanks for the help bud. If you dont mind, I'm going to take another deeper look at everything, and if I cant figure it out, I'll drop you a line?

mild hull
#

k, good night

twin juniper
#

I have a class that causes a crash when spawned. If I recompile the class, the crash no longer occurs. I save the class, restart the editor, and now the class will continue to crash the game until I compile it again... !?!? This only happens when I'm playing with several clients in editor

twin juniper
#

Hmmm so it only happens with one particular child of the base class... the only difference is the mesh

thin stratus
#

@icy nacelle you're doing a few things wrong as far as I can see

#

Makes more sense to talk about when you are available. Ping me

winter plover
#

So I've been struggling with getting ragdolls to replicate the last couple of days, I actually made a bit of progress and got them to be roughly in the same pose as the server, which is good enough for my purposes. Anyhow I just noticed, that when I run the game as a dedicated server, the ragdolls seem to be all messed up and not simulated properly, they hang around weirdly in the air for a long while. Do skelmesh physics not get properly simulated on a dedicated server?

thin stratus
#

There are booleans to update meshes on dedicated servers

#

However I can't recall them, so try to check the components, meshes and animbps

winter plover
#

bEnablePhysicsOnDedicatedServer?

#

thats what I'm using rn, doesnt seem to have an effect tho

thin stratus
#

There should also be something about updating bones

rare cloud
#

@sharp arrow, IIRC there is a Server time variable on the GameState

#

AGameStateBase::GetServerWorldTimeSeconds()

winter plover
#

@thin stratus found it, it was the MeshComponentUpdateFlag

#

it werks now cheers

ivory parcel
#

So, My game is appearing on the steam master list but all servers are responding with Rules failed to respond for server What does this mean ?

ivory parcel
#

Resolved, was a problem with engine edit

green cedar
#

Anyone have experience with Advanced Sessions/UWorks plug ins?

#

I'm looking to start working with one of them, and I'm curious if anyone has recommendations/thought

#

s*

opaque tinsel
#

Hey guys, i have a countdown timer that plays on both the client and server when they spawn, however theres a 1 second difference between both of them. Is that normal and is there any fix for it?

merry hemlock
#

For a local listen server setup, is there anyway to stream a level volume to a client without loading it on the server's machine?

woeful finch
#

curious question, can you use the same server for multiplayer connection as you do for p4v?

#

(I have no conception about how servers work)

brittle sinew
#

You could use the same server for a dedicated UE4 server and a Perforce server, sure.

#

It probably wouldn't be the best idea, however

woeful finch
#

ELI5? haha

brittle sinew
#

VPSs and software like Docker make it much easier to virtually separate your services, which makes maintenance much easier

#

Basically, you set up virtual computers that do one thing, and if one dies, your others don't

woeful finch
#

Ahh. Makes sense!

brittle sinew
#

Running them within the same OS is a pretty rigid solution

#

You could still run them on the same physical server, though...that is, the hardware itself

woeful finch
#

appreciate it!

merry hemlock
#

if I'm on a lan during a listen server, when I want to open a map, I simply open it and it will load on the client's side correct?

mild hull
thin stratus
#

Well the server can only load his own savegames

#

To load a clients savegame, you would need to let the client server rpc that to the server

silk pilot
#

I only have 2 windows up

thin stratus
#

Select one and see if it resolves

silk pilot
#

It started when my "is locallly controlled" node stopped working. It always returns false on any client i put it on

#

and none of my meshes or animations are working. or my ai controller. lol BUT it was working fine a couple days ago

winter plover
#

are you actually checking them clientside?

merry hemlock
#

So, there's nothing wrong with making your transition level the persistent level if you are streaming in level?

#

I'm not sure how you could so it either way but the docs I just read didn't seem to mention a persistent level

thin stratus
#

Well, the TransitionLevel is usually some new map that gets loaded between ServerTravel if it's seamless

merry hemlock
#

I think I'm confusing level streaming with seamless travel

merry hemlock
#

How does the persistant level relate to the transition map?

rain coral
#

is there a callback for when pawns have spawned in the level, when testing multiplayer?

wary willow
#

@rain coral "spawned" ?

#

As in the actual spawning of pawns that players control?

#

If so, no. You can control that rather easily though since you know when that occurs. You can just create an ED if you want.

#

If you mean OnPostLogin, then there's that.

rain coral
#

OnPostLogin is too early, since only player controllers exist at that point. when testing multiplayer, pawns are spawned automatically unless I as you say override that functionality

#

I guess the problem is if I override SpawnDefaultPawnFor I only return the pawn to spawn, it yet hasn't happened ๐Ÿค”

thin stratus
#

So I'm wondering. I have Customization Data on GameSparks.
When the PlayerState gets initialized, I'm quering that on the Server and save the Data (few names and floats) in it.
Now the Character would need to get that data when ever he's respawned.
BeginPlay wouldn't work, as it's not possessed yet. OnPossessed would work, if the PlayerState is also Available on the Clients when that happens

#

(Multicast OnPossessed)

#

I could pass the data to the Client in that Multicast, but that's a chunk of data every time someone respawns

jolly siren
#

I have various things that I have to do in multiple places because of conditions like that. For example I do some things in both BeginPlay and OnRep_PlayerState

#

And then I just check and see if it was already done before doing it again

#

Might be one of those times @thin stratus

#

I call them "network race conditions"

thin stratus
#

OnRepPlayerstate is what I aimed for now

#

Currently trying this: PlayerState gets the GameSparksData, fills it into an OnRep Struct.
In the OnRepStruct, I set a boolean to true, so the client knows everything is proper.
Could also check the Struct values, but /shrug
In the Pawn, OnPossessed, I get the PlayerState, set an OnRep PlayerState variable (BP doesn't have the native one) and in there I check the boolean and get the struct.
If the boolean is still false, I start a timer of 1 sec

#

For now at least

manic pine
#

why dont you give it to the character on the server after spawn

#

ive found this to be true:

void FunctionRunOnServer()
{
    AActor A = GetWorld()->SpawnActor<AActor>();
    
    A->SomeReplicatedInt = 5;
}

void BeginPlay()
{
    if(!HasAuthority())
    {
        if(SomeReplicatedInt == 5) // True if this actor was spawned in FunctionRunOnServer
        {
        
        }
    }
}
thin stratus
#

Because that's gambling

#

I don't think that's actually meant to work every time

#

If at all, you'd make it repnotify

manic pine
#

possibly, but i think its intended... isnt that what'd be considered 'initial replication'?

#

which tehre's even a separate rep condition for

#

would be nice to have an answer from UE team on that one, because I'm using it here and there(though with Deferred spawn)

thin stratus
#

Well then you'd probably need to ask on the forum/answerhub

#

Server here is unofficial

bold heron
#

Hello Everyone! I've hit a small snag. I'm creating an array of render targets and am drawing to one of them. Then I want it to replicate to the client. The array is set to replcate and the drawing happens on the server. Any reason why there would be no update on the client?

thin stratus
#

Well, any reason a render target would replicate its changes? :P

bold heron
#

I thought about that and during the training stream they said there isn't any reason it wouldn't

#

So I guess it would be because it's set to replicate, it should replicate it's changes. I'm just not sure if that's a correct assumption or not

#

First time trying to replicate a render target so I'm not sure if there are special rules for them or not.

acoustic aspen
#

guys how do i replicate add impluse?

inner iris
#

@acoustic aspen if itโ€™s super gameplay important you can replicate movement from the server and sync up a clientside impulse to appear smooth

#

Replicating physics does seem to be an expensive and inconsistent thing to do though

#

Many games just let all clients do their own local simulations for small physics props

acoustic aspen
#

Can I replicate the transform while doing physics on client side?

inner iris
#

Yeah you should be able to! Havenโ€™t done it personally but youโ€™d need some smoothing / interpolation logic to avoid popping

acoustic aspen
#

thanks

pale thorn
#

Is that correct? So the "good" option is more secure and the correct way?

inner iris
#

Event begin play runs on server and client- it would likely be better to run that function as in the โ€œBadโ€ example but with a switch has authority node before it, making sure only the server runs that code

#

Thereโ€™s no need for an RPC in this case (feel free to correct me if Iโ€™m wrong)

#

Keeping in mind that since it would only be initialized on server, youโ€™d have to replicate those properties down

#

So you might need to run a different clientside init function for cosmetic things that donโ€™t affect gameplay

pale thorn
#

Wait... So i would add a switch has auth node and make what? Call that function on the Client from there (ClientInitAttributes)?

inner iris
#

If the init function is setting important values like health, movement speed etc, then use a switch has authority node after event begin play (which is run on server and client), and call the function from the authority output

#

Then assuming those important properties like health are replicated, the client will get the correct values from the server

pale thorn
#

Ooohh

inner iris
#

I mean you can do an RPC like in your first example if you really want, but it's basically wasting resources- instead of the server directly calling the function right away, you would be saying as the client "hey server please call this function" , sending that request to the server and then having it call it

#

Actually looking at that screenshot again, there's definitely no need for that 3rd RPC at all

#

The values will automatically be replicated down to the client if you set them up

pale thorn
#

Oohh.... good to know. Used to get a knot in the head... thanks gonna play with it!

inner iris
#

Defintely takes time to sink in- really easy to go on a complex route and realize it's possible with much less logic

pale thorn
#

Works...fine! Yep!

acoustic aspen
#

how do I simulate something in client and send it back to server

inland fulcrum
#

Hey, i'm relatively new to UE 4, well, i've been coming in and out for years now. I'm often hearing that 'multiplayer is hard to do' 'You shouldn't make your first game have any sort of multiplayer at all'. But I'm wondering, just exactly how hard is it to make your game have a multiplayer function?

slim holly
#

easy, once you actually grasp the concept how it works(it's just not sending data between A and B)

#

next step is to design code that works with time delays

bold heron
#

@acoustic aspen still need help?

acoustic aspen
#

yeah ๐Ÿ˜„

bold heron
#

Do you understand ownership?

acoustic aspen
#

nope

#

I used setowner on my guns and stuff

bold heron
#

Ok so lets start a little more basic. You have 2 roles Autohrity and remote

acoustic aspen
#

oh thats what you're talking about

#

I know roles lol

bold heron
#

Ok excellent

#

So with RPC usually you can only go from server to client

#

But there are a few exceptions to that

#

The main one that is most commonly used is through the player controller

#

A player controller can make requests to the server. and the server can then handle those requests and multicast the results to everyone

#

the base documentation is here

#

as long as the client owns the actor, it can call a server function

acoustic aspen
#

I'm just stuck on trying to make throwing stuff for clientside less jittery

#

its a physics method

#

addimpulse

#

I simulated on client

#

then called on server

bold heron
#

yeah that's a little harder. You will want to look at your net update frequency and update the minimum but it's going to increase you bandwidth the higher it is.

#

If you spawn the object on the server (and it replicates to the client) the ownership is on the server. So a client can't send the notification to the server.

#

It could be routed through the player controller if you really wanted to though.

#

Generally you would simulate on the server and update the position on the client since the server would spawn the object.

#

That method would work out of the box

#

then it's just tweaking values for performance vs simulation accuracy.

#

the UE4 physics engine is not deterministic so the simulations are not guaranteed to match if you just replicate the add inpulse event.

acoustic aspen
#

I'll work on other things then lol, I don't wanna deal with custom physics and stuff

bold heron
#

Replicated physics is kind of a can of worms most people don't want to deal with ๐Ÿ˜ƒ

acoustic aspen
#

for gernades should I just use physics and not projectile phsyics?

bold heron
#

I don't use projectile physics so I'm not sure what it does.

#

having a 100% accurate simulation probably isn't required though since it just needs to come close enough

thin stratus
#

@inland fulcrum Multiplayer is so hard at the start cause it brutally requires you to know ue4s framework. You need to know what classes are available, when they are available, where they are available. You need to learn a few layers of networking, such as replication, ownership etc. And then apply all of that.

#

It's too much for the average ue4 beginner

inland fulcrum
#

Oh hey I recognize you

#

and I see

#

Well, thanks for the clearup

thin stratus
#

Singleplayer you can store your kills nearly everywhere. Multiplayer you soon find out that you can't get passed the PlayerState

#

Just as an example

twin sorrel
#

anyone know why setting events to reliable causes my other events to not work properly?

grand kestrel
#

Trying to make AI run exclusively on client (and not at all on server) anyone got a starting point for me?

#

Wont be used in the final product, it's so we can spawn hundreds of servers and have them run on AI to simulate clients for stress testing

#

Hoping someone has been in the same boat

#

Guess I'll start removing all the client checks

manic pine
#

cant you just spawn some aicontrollers on client

mild hull
#

or write some random walk logic into tick of your player controller

grand kestrel
#

Welp, they do more than just walk

#

And yeah probably

#

I'll try

twin sorrel
#

Hey guys, i'm setting the rotation of my projectile, although it isn't moving towards the way it's rotated. Anyone know why? Note that setting the spawn rotation works, although i am attempting to rotate it in the projectile's event tick.

#

Not sure if it's a problem with repliccation or

#

i'm able to use the built in homing mode in projetile movement, although i would prefer make something more custom

grand kestrel
#

How do you guys do recoil? We have everything server authorative but I'm not sure that it's viable for recoil, needs to happen instnatly not delayed by latency

worthy wasp
#

@grand kestrel - recoil is simply adding a small (AND I MEAN SMALL) amount of control rotation to the character - which is not even remotely close to being in sync from client to server anyways.....

In a perfect world - you would run line traces on client - passing in the start & end points to the server for authoritative HITTING of your bullets. while you are on client - add the recoil effect - as its local and happens right away - and in the next fire - will take into account for the start/end points on the server authenticator next iteration.

#

hopefully thats not as garbled as i think it is lol

inland sun
#

Probably a simple question, but How can I set a map to act as the main lobby for players so they can go to other levels and come back to the same one they left from before

worthy wasp
#

if your doing an actual PHYSICS bullet actor - - i wish you the best of luck ๐Ÿ˜ƒ

#

@inland sun - bSeamlessTravel = true (GameMode) & simply change maps. the FIRST MAP (Lobby) they need to connect to in order to load it.

grand kestrel
#

I don't need any help with applying recoil, I'm just asking how you can be sure that players can't remove it by hacking'

inland sun
#

doesn't it make it so each map they go to becomes a new session? I am trying to make it so that if someone leaves the main lobby map and then wants to return they come back ot the same map everyone else is located.

#

brain hurts thinking about this stuff lol will save it for tomorrow

worthy wasp
#

@grand kestrel now thats a good point - i didnt think of.... maybe make the floats that control the yaw/pitch of the recoil as Replicated - so they cant edit the values?

grand kestrel
#

Nope

#

Latency will make it feel horrible

grand kestrel
#

Every part of my shooting system is fully server authorative, it's just recoil that is more like an effect as it's applied following a shot and it's applied specifically to the client

#

It's a tricky one

#

I guess the client could send the rotations applied by recoil and the server could go "yeah nah" if it suspects foul play

zenith yarrow
#

Can anybody tell me why the client does not travel to the correct map if I use steam online subsystem but does travel to the listen servers current map if I use online subsystem NULL ?

I am using ServerTravel after a session is created to transfer the host to a map

ServerTravel(TEXT("/Game/Maps/TestMap/MapName?game=/Script/GameName.Gamemode?listen"))

Then After finding a session I connect the client to the session using JoinSession, and after joining call client travel on the client...

FString TravelURL;
if (PlayerController && Sessions->GetResolvedConnectString(SessionName, TravelURL))
            {
                PlayerController->ClientTravel(TravelURL, ETravelType::TRAVEL_Relative, true); 
            }
inner iris
#

@grand kestrel for the AI question, why not just spawn them as you would a regular player on server to stress test?

grand kestrel
#

Yeah I was probably over thinking it

inner iris
#

I have a behavior tree that basically does the same things a regular player does, and the AI use the same pawn as the player does. The only difference in logic is the shoot start location code in the controller

#

Also probably will give you a better idea of performance if using a dedicated server with the AI as itโ€™s more load on your client to simulate the behavior

#

Also for the recoil, yeah itโ€™s likely best to do it instantly on the client and then validate on server (within an allowed tolerance). Thereโ€™ll always be some innaccuracy and hackers who remove recoil could probably still get away with it sometimes. As long as thereโ€™s a few checks, it should work for the most part!

grand kestrel
#

@eoinobroin#6833 Thanks for the input, I'll play around with it tomorrow

manic agate
#

Guys, I need some help. I need to set an ID to each pawn spawned in a multiplayer game... for example, the server's pawn (supposing that the server has a pawn) would have 0 as ID, while the first client that joins will have 1, the second 2, and so on... This id needs to be stored in each client, meaning that a client will know its id and those of the other pawns.

My question is, how can I set the ID from the server so that it will be present in each pawn? I'm trying to understand WHERE the client's pawns are spawned, so that I can set the ID there using SpawnActorDeferred and replicating the ID, but I can't find where I should do it...

zenith yarrow
#

@manic agate maybe you can increment a int in AGameMode::PostLogin(), and then simply use that name as and ID ?

#

oh sorry, you said each pawn not PC...

manic agate
#

@zenith yarrow that would work, but I need to set that ID when the pawn is actually created, and in the PostLogin() method the user pawn isn't actually created

#

That' right ๐Ÿ˜„

twin sorrel
#

if i enable replication on the actor, and the position of the actor on the client and server are different, will the server attempt to update the client's data with the server location?
or will it forever stay out of sync?

zenith yarrow
#

Any idea what actually changes the map on the client after client travel? I am still trying to figure out why steam OSS does not transfer me to the correct map after joining a session...

#

@manic agate Coundn't you use the integer set in postlogin when a new player joins to identify him on the server, the server has an array of all the PC's right? and the first PC is the server, so the incremented int could be taken as an ID right? so just use that int as an id when you spawn pawns for players

#

@manic agate you are spawning pawns on the server, right?

manic agate
#

@zenith yarrow That would work, but I still don't understand WHERE unreal spawns the default pawns for players ๐Ÿ˜…
Also, about your problem, I can't help you out there, I still haven't mess around which map travel ๐Ÿ˜ฆ

zenith yarrow
#

@manic agate naw, that was something I asked earlier. As for spawning as far as I know you can either spawn on client, which means nobody but that client will see the thing, or you can spawn on a server with a RPC, which ensures that everyone connected to the server sees the thing...

#

the players are spawned on the server by default I suppose, if you are making a FPS game I would recommend you check out the shooter example in the learning section of unreal

manic agate
#

Thanks, I'll try ๐Ÿ˜ƒ

inner iris
#

@manic agate might be a good idea to spawn in as a spectator or no pawn by default and write your own pawn spawn logic in the GameMode so that you can set up properties like that exactly when youโ€™d like.

zenith yarrow
#

@manic agate you are welcome, also @inner iris has a good point...

manic agate
#

@inner iris Good idea. I'll look into that too!

inner iris
#

Itโ€™s pretty handy for respawning and other repeating events too- you can reuse a lot of the logic

manic agate
#

Do you remember what methods should I override?

#

I'm looking at the code right know but I don't understand where I should spawn the pawn inside the GameMode class. There is a SpawnDefaultPawnFor() but it only gets fired for the server's pawn, apparently

inner iris
#

I didnโ€™t override anything- just let the default code spawn me in the level with no pawn, set my camera location to something nice and create a countdown widget

#

Then I created new functions in the GameMode to spawn the pawn, find the right team location to spawn on, init all properties and UI, and then possess when the game begins

#

Then when you die you can use the same function, and any logic that has already been set (like team spawn locations) wonโ€™t need to be set again

manic agate
#

Mmm I see, I think I'll try that!

#

Thanks!

inner iris
#

No problem ๐Ÿ˜ƒ

lost fiber
#

is this the right channel to ask for packaging with steam? I'd like to ship with current steam sdk (141) and not the ue integrated (139). But how can I do? I think i need to "clone" the onlinesubsystemsteam plugin from engine into my project and adjust it to use the 141 and recompile, right? I think this information is outdated: https://docs.unrealengine.com/latest/INT/Programming/Online/Steam/

An overview of Online Subsystem Steam, including how to set up your project for distribution on Valve's Steam platform.

bitter oriole
#

You need to overwrite the UE SDK in the sources with yours

#

And rebuild the engine

#

And possibly fix the onlinesubsystem stuff if there were API changes

lost fiber
#

i don't want to rebuild the engine, only the onlinsubsystemsteam plugin

#

i thought this is why everything went to plugins and not tight closely to the engine core itself

bitter oriole
#

Dunno, I haven't needed a more recent Steam SDK myself. But since the plugin is part of the engine, my guess would be that you need to rebuild the engine, whether it's in a plugin or not.

lost fiber
#

Ok, thanks - I go with 139 then.

bitter oriole
#

Why did you need 141 ?

lost fiber
#

not really a need - more a want ๐Ÿ˜„ when i've read the doc I thought it is staight forward to use a new sdk but trying to follow i did'nt get it to work - so just wanted to ask if anyone uses newer sdk or the one shipped with ue.

bitter oriole
#

I actually don't know what's the difference. I know I have a shipped game on Steam with the regular SDK, and since many games aren't updated I guess there is basically never any breaking change

merry hemlock
#

Just doublechecking - I have a listen server - I execute a Open Level node (say on my gamestate)....that's all I do....what happens to the connected client?

chrome bay
#

Anybody know if FDateTime::UTCNow() is good enough for rough network clock syncronisation?

#

Trying to syncronise an ocean simulation, but it's important for vehicle prediction etc. that the simulations match as close as possible.

brittle sinew
#

@chrome bay have you looked at AGameStateBase::ReplicatedWorldTimeSeconds? It seems like it would fit well in this scenario

#

I'm guessing the function you mentioned is local to each client, so even though most computers will be on an NTP server, it still might be pretty off

chrome bay
#

Yeah, UTCNow gets the time without daylight savings, so probably from some central server or on windows

#

RepTimeSeconds might have to do, and I'll have to sample it and extrapolate time as best as possible

#

So long as it's fairly close it should be good enough

#

Vehicles in Multiplayer are a pain in the godamn ass

twin vault
#

any way to know from which subsystem the player is connecting from?

chrome bay
#

@twin vault Don't think so, the point of the OSS is that it's platform-agnostic

twin vault
#

no chance of PlayerID conflicts between subsystems?

chrome bay
#

It's probably possible (albeit really rare). Each subsystem has their own idea of what a PlayerID is though, but I suspect most of them are just using a number

twin vault
#

yeah i created my db's key as PlayerID, SubsystemID

chrome bay
#

Ah I see so it's for your own Databases?

twin vault
#

ye

chrome bay
#

The other way around it would be for users to create a special "My Game" account which they login to and maintain your own user ID's

#

But of course most people don't like that

opaque tinsel
#

anybody knows how i can get the number of players in game?

chrome bay
#

@opaque tinsel FOnlineSessionSearchResult.Session.SessionSettings.NumPublicConnections

merry hemlock
#

@twin vault thanks - how is the transition level different from level streaming? Is there still blocking done?

merry hemlock
#

half blueprint question - why wouldnt' I want to do a pure cast to game state if I never change the gamestate ever?

#

I'm trying to think of instances when it would fail? but multiplayer confuses me still

agile crane
#

Alright. I've been asking for help since a long time here for how to being able to join and find people online on a server browser and people could be able to create their server. I don't c++. I want to know what kind of thing I need to do for my game to work online, and it works lan perfectly. Please someone tell me how! Don't just shit on me like last time some people did, I tried dm UE4 they read my dms but they do not respond and I'm getting depressed.

Like what do I need to do? Do I need to buy a hosting site and if so, which? Do I need to do a dedicated server and it will works online? If so, I saw some tutorial for dedicated server and hosting it with my pc but I won't be able to open the server everytime, I need some sort of a website that host the server everytime.

#

I'm getting soooo depressed and annoyed by how there's no tutorial about that and just tutorials about lan shit. I have enough. I already made a lot of works in my multiplayer game and I need to get it ready soon. Someone please explain to me please and whoever helps me good I will pay you via paypal So don't be useless please thanks.

jolly siren
#

@agile crane There are 2 options. Dedicated servers or listen servers. If you want to go with dedicated servers then you can get hosting from someone like AWS or DigitalOcean to name a couple. You would setup the dedicated server on their system. If you want listen servers then you don't need extra servers. One of the players playing the game would play the role of host in that situation.

agile crane
#

Thanks for explaining. I still did not really understand about listen servers, how do I setup a listen server?

#

If you could explain what is it I'll appreciate it thanks.

#

@jolly siren

jolly siren
#

The network compendium already covers that

agile crane
#

I sounds a bit excited. About DigitalOcean is it only c++? Is there any tutorial to setup it for UE4? since Idk anything about c++ so I would not be able to set up it myself. @jolly siren

jolly siren
#

Dedicated servers in general need to be built from source. So yes you at least need to know how to download source from github and package it.

agile crane
#

But... does DigitalOcean make the dedicated server theirself inside the site or we need to make it ourself and then buy the site?

#

also

#

is there a way to buy the thing without needing to buy it every month, so I could be without worrying

#

cause all I see is month and month, why cant I just buy it for like 3 years or so?

jolly siren
#

DigitalOcean is just a cloud computing platform. You rent a vm from them essentially.

agile crane
#

Okay

#

Did not answer my question, can I buy it for a years or multiple years than a month? Or is there any free demo to try it?

jolly siren
#

...

#

You can probably prepay for more than a single month

#

go to their website and figure it out

agile crane
#

Oh okay cool

twin vault
#

gcloud have a 300 dollar demo

#

but not available worldwide

agile crane
#

Oh

#

Is there any good dedicated server tutorial for DigitalOcean? Or any dedicated server tutorial could work?

agile crane
#

Time 2 work now I guess

#

is there any tutorial for setup digital ocean after doing the dedicated server?

jolly siren
#

DO is just a cloud vm like i said before. It will be the same as setting it up on your own machine.

#

i.e. section 3 in the wiki

agile crane
#

okay

#

Also

#

will it auto detect the lan blueprint and will it work online? Like, everything in lan works, and after buying DO and making the dedicated server, will it auto work online? Or do I will need to change some of the blueprint?

#

I made everything in blueprint and I use advanced session btw.

#

@jolly siren

#

Sorry for tagging.

jolly siren
#

idk what you are talking about. Try it and find out.

agile crane
#

I mean, my game works lan

#

and after making the dedicated server and buying digitalocean, will it works online?

#

Or do I will need to change some of the blueprint?

#

@jolly siren

worthy wasp
#

can do the FindFriendSession just fine.... cant seem to get a good working code syntax for the binding of the delegate

brittle sinew
#

What are you running into when trying to bind it? (what have you tried?)

worthy wasp
#

well for starters i am only familiar with Delegate.AddDynamic(this, &NSpace::Function)

#

so i tried to bind the delegate property there

#

there is no AddDynamic to it.

#

secondly - the AddOnFindFriendSessionComleteDelegate_Handle() - is weird inputs

#

i have no idea whaht to do - i just simply want to run a custom function to join the found result returned from the delegate

#

unfortunately shootergame isnt using FindFriendSession at all - the group i'm on definitely wants to have this funcitonality in the project theyre developing.

#

only thing i've found that gies any clue to what to do is that wiki doc... dont see anything in answerhub regarding issues in past with this ๐Ÿ˜ฆ

jolly siren
#

You probably want AddUObject

#

Matchmaking->OnMatchmakingComplete().AddUObject(this, &ThisClass::OnPartyMatchmakingComplete);

#

see UT source

worthy wasp
#

@jolly siren - ok that clears up the delegate binding - except one of hte parameters of the delegate is FOnlineSessionSearchResult

void JoinFoundSession(int32 LocalUserNum, bool bWasSuccessful, const TArray<FOnlineSessionSearchResult>& SearchResult);

TypeDef error ๐Ÿ˜ฆ

#

apparently you cant use anything that isnt U in a blueprint exposed function?

#

even if i hav eit as a C++ function - its still undefined type

jolly siren
#

yeah FOnlineSessionSearchResult isn't a USTRUCT

worthy wasp
#

i see it inthe OSS plugin as a full on class

#

i dont know how to use it then in this function as an arg - and it has to be there as its the return of ht delegate

#

Engine source (Runtime) forward declares it in 2 places: GameInstance & OnlineSession classes..... i cant seem to do it in project ๐Ÿ˜ฆ

merry hemlock
#

how is the transition level different from level streaming? Is there still blocking done?

worthy wasp
#

@merry hemlock - its defined as the necessity to unload the current map and transition to a new map. in order to unload (bSeamlessTravel) from one map - you have to have a map loaded in order to move to another.....

merry hemlock
#

but does it work like level streaming in single player?

#

like, for VR, is there blocking?

worthy wasp
#

not sure what you mean by blocking. the transition map is in all intensive p urposes BLANK

#

placeholder for the pawns to reside whiel transitioning to new map - unloading the previous

polar bridge
#

is AGameMode::Logout reliable enough that i can depend on it to save some information about the player back to my database, or should I also put some timers in that periodically save too?

merry hemlock
#

@worthy wasp Does it block I mean does it load and you can't move and the computer hangs until the level is complete?

merry hemlock
#

Question about using two instances for testing Lan multi-player.. Is possible to go run a break on the client side? How do I know which blueprint instance I'm looking if I'm looking at a blueprint?

grand kestrel
#

Isn't SpawnActor meant to spawn a copy on both server and client? Howcome it only spawns it on server?

#

Guess I have to call it on both

#

Just wanted to make sure something isn't wrong

glossy wasp
#

@grand kestrel Do you have the actor checked as Replicated, and the spawn is happening on an event that executes on the server?

grand kestrel
#

Ah lol forgot that its not replicated by default

#

Was a big derp

#

So next question, if I spawn a controller and call possess.. it doesn't possess on the client, only server

worthy wasp
#

Possess needs to be called from server anyhow

#

its a server auth function natively - if client runs it it wont do anything.

#

@grand kestrel

grand kestrel
#

Uh-huh

#

I'm not new to networking

#

Naturally I'm calling it from the server

#

it doesn't possess on the client, only server
Like I said

worthy wasp
#

i dont understand - you drieclty said: "So next question, if I spawn a controller and call possess.. it doesn't possess on the client, only server"

#

i tried to answer you....

#

so no offense meant in me trying to help you

grand kestrel
#

It possesses on the server, logically I'm already calling it on the server, I'm saying that when I call possess on the server it possesses on the server and not the client

worthy wasp
#

what kind of visual errors are you getting?

#

do you float in air?

#

fall through floor?

#

maybe your guy looks squashed and kind of hovers in air above ground?

grand kestrel
#

NM lol

zenith yarrow
#

@worthy wasp I had referred to this great tutorial by @thin stratus , when I was looking trying to learn steam integration, it is a tutorial on how to get friends from steam into unreal using steam oss you can find more info on it -> here

worthy wasp
#

many thanks bud!

#

will bookmark it andd read up on it! โค

zenith yarrow
#

You are welcome mate!

rancid current
#

ey guys! I've got an issue! I'm trying to replicate the forward vector of my character's third person camera, but no matter what I do It wont replicate the Z vector at all to the other clientsx.x it replicates it to the owner and the server but not to other clients.. so it works left and right but Z axies are at 0 for other clients x.x
https://gyazo.com/e4db033b3052348f9236d3978e02699d

verbal wave
#

when I need owner in beginplay. there often is a latency here for client

#

this doesn't work. but adding a 0.2s delay fixes it

#

it's quite inconsistent. I could loop a delay here but is there a cleaner way? like OnOwnerSet or something. can't find it :\

#

I'm replicating the pawn reference right now but I don't want to replicate variables unless it has real meaning

wary wyvern
#

Should ask here, I guess..

How do I setup dedicated server to be public? Right now it is available through local IP, and in order to make it public I have to create session, wich I don't want. Is there any configs to make my server not LAN?

bitter oriole
#

@wary wyvern You need more than just a config for that. An actual, always-online server has to be available to provide clients with a list of game servers.

#

Steam provides that service

#

PSN, Xbox too

wary wyvern
#

I know that, my service will provide client with an IP

#

But right now all I need to do is to make my server to be public, not LAN

#

I know I can do this by creating game session with bIsLan=false;

#

But I want to make it without creating session, if it is possible

bitter oriole
#

If you're not using sessions (meaning, you just start your game as a server and you connect directly with "open <ip>" on your client), then it shouldn't need more configuration

#

LAN vs not LAN is a session thing

#

I'm not sure you can filter by LAN/not LAN when you create a server, basically. It should accept any kind.

#

Maybe I'm mistaken, but can you confirm that this is your issue ?

wary wyvern
#

Without creating session I'm not able to connect within public IP

#

If I create a session, I can do this.

#

We've tested it, my public IP is ok and ports are forwarded, so it might be configs and Lan mode

bitter oriole
#

@wary wyvern When you talk about LAN, you're talking real LAN, or locally on the same computer ?

#

I'm really surprised that there is a difference on this

wary wyvern
#

I mean LAN, my home network

#

Other computers are able to connect, but that is all

#

I want to make it available for others.. Looks like I have to create sessions((

bitter oriole
#

Well, sessions are a better long-term approach, unless you plan on not shipping your game on a major platform, but I'm really surprised that this is an issue

thin stratus
#

Session don't have anything to do with an IP connect

#

Just saying

#

Sessions are mainly for saving the data about a game so others can see that, for example, in a serverlist

#

Or just for matchmaking etc.

#

You can always connect directly via IP, LAN and Internet

#

@wary wyvern

wary wyvern
#

@thin stratus Yeh, but how do I set my server to be public? I mean available to connect with public IP. Right now I'm only able to connect with local IP in my home network

thin stratus
#

You only need to open port 7777 in your router

#

Then check online what your router's public ip is

#

Then you host with "OpenLevel MapName?listen" (node) or "open MapName?listen" (console)

#

Then others can join via "OpenLevel YourPublicIP" (node, not 100% sure that this works) or "open YourPublicIP" (console, which works)

#

Where console means the node "ExecuteConsoleCommand"

#

@wary wyvern

bitter oriole
#

@thin stratus What I gather is that this only works for local clients in @wary wyvern 's case

#

Which sounds like a bug to me

thin stratus
#

No known bug like that

#

Open IPAddress is working, if Port is open

bitter oriole
#

Yeah, that's what I was saying to him ๐Ÿ˜ƒ

#

There isn't a public/private setting for servers

#

There is for sessions (ans he's not using sessions)

thin stratus
#

Firewalls of PC and Router can also block incoming connections

#

Yeah, "?listen" will make your PC listen for connection on port 7777

wary wyvern
#
You only need to open port 7777 in your router

I've alredy done that. Other users are able to connect to my session with public IP. But if I do not create session, conection become unavailable through IP

thin stratus
#

There is no "public"

#

Are you using any kind of subsystem?

wary wyvern
#

Nope. I have disabled it right now

thin stratus
#

Steam could break things

#

NULL should be fine

wary wyvern
#

Okay, I'll try Null)

wary wyvern
#

@thin stratus Still not able to connect, even with null subsystem, bIsLANMatch = false inside gamesession.. Ports are open, firewall disabled..

#

Okay, find the problem.. It was in my router ip settings.. Thank you for help, guys!

thin stratus
#

Told you it's not UE4 related :D

wary wyvern
#

Yeah, sorry)

rancid current
#

Ey guys! How would you replicate the forward vector of a camera to the server and then to the other clients? ๐Ÿ˜„ pls help thanks!

#

I've been trying since morning (now its night) to get the fowrard vector of my camera to replicate to other actors with no luck ;-; anyone could help ?

late sundial
#

@rancid current i dont know if this is what you are looking for. example this is very basic melee system im using it works nice.

#

with get control rotation you can get the forward vector

rancid current
#

alright I will try that! thanks lots @late sundial

#

well same as the camera vector this wont replicate to other clients (THO i tried to replicate rotation and floats through the same way and it works with no issue) but vectors are like nop lol anyways thx for the example will try more tomorrow!

late sundial
#

ok, i dont know what kind of mechanic youre trying to do so hard to say more.. no problem good luck

rancid current
late sundial
#

what does it show if you change control rotation to this

rancid current
#

Exactly same issue thats how i have it initially replicates to owner and server but not other clients wtf xd

late sundial
#

hmm weird, it replicates only on 1 client but if theres more it just shows 1 and 0. i dont know what happens there for the numbers, hopefully someone who knows more can tell about that.

rancid current
#

hmm weird my other camera works tho o.O my first person camera replicates values right

#

welp using my fps camera did the trick xd done

lost inlet
#

GetControlRotation will always return 0,0,0 for other clients

#

because you don't know what their controller is

#
{
    return Controller ? Controller->GetControlRotation() : FRotator::ZeroRotator;
}```#
muted sigil
#

So I'm using BP and I'm trying to set it up to, at the end of the game (deathmatch), find the player with the heighest score and announce them as the winner. Right now I've got a blueprint I've placed in the level that has a map of FirstPersonCharacter to Integer, character being the player and integer being the score. Whenever a player gets a kill, it adds a key/value for them in the map in the blueprint. Then when the game is over, it gets the values as an array, I use Max Of Int Array to get the highest score, and then use the index of that value to get the key (player). Theeen I get the player's name which is held in a variable and then print that out, along with the score. But after getting a kill and the match ending, it just prints out " won with a score of points!"

merry hemlock
#

The player controller 0 on a gamestate - that is always the server (if listen server) or is that still the client? If you call an event on a server and it is set to multicast, if it targets PlayerController At Index 0, that will get everyone, because it's replicated from the server and all clients treat their player controllers as 0? I'm trying to keep track of who is what from game mode to game state .... the gamestate isn't owned by the player so my thoughts so far are that player 0 should be server since it owns gamestate?

brittle sinew
#

Calling a multicast on a PlayerController doesn't really make sense, because PlayerControllers aren't replicated to all clientsโ€”they're only replicated to the owning client

merry hemlock
#

I have a unique use case so most of the time I want it to happen to everyone ...there are a few exceptions for minor things though

brittle sinew
#

Even if you call a multicast on an index 0 PC, it will still try to target that same PlayerController on each client (not each client's local PC), and it will fail, as it doesn't exist on clients

merry hemlock
#

These events originate from the gamestate

brittle sinew
#

Why not just multicast on the GameState?

merry hemlock
#

What is the actual function I would use?

brittle sinew
#

Umm, not really sure what you mean by that

#

You would need a multicast RPC that is called from the server.

#

And just as a note, the index 0 PlayerController is not always the server's PC.

#

It usually is due to the timing of its spawning, but there's no inherent guarantee that that will always be the case.

manic pine
#

this trend with always using index-retrieved playercontrollers is very weird

brittle sinew
#

Yeah, it's just a quick hack that seems to work fine

#

If you're on a client I understand it, because yeah, there is only going to be one PlayerController

#

If you're on the server though, it's really bad practice

manic pine
#

yeah i guess, i just never find myself lacking the reference when i need it

#

maybe its a blueprint thing

brittle sinew
#

From the perspective of a beginner, I understand it's much easier to go "why do I need to worry about making all these references and casting and stuff when I can just type 'Get Player Controller' and it all works?"

#

I don't have anything against someone thinking in that manner, it's just that they're not properly informed

manic pine
#

yeah i guess its a product of design based on lack of information

winged badger
#

multicasting in a PlayerController is a really bad idea, since you are telling all client machines to execute your multicast function on their copy of your PlayerController

#

so unless the machine that calls that multicast is the only connected client, there will be at least 1 client that does not have its own copy of your PlayerController

#

and then things will just break

merry hemlock
#

So what is a better practice @winged badger ? Do I use the PlayerState list to obtain the proper reference, or cast to gamemode from my gamestate to get a PlayerControllerArray populated on OnPostLogin?

winged badger
#

only the server has the true state of your game, so actors should replicate variables that are needed for the clients to keep their simulation of your game up to date

#

for example, if you had a Light Switch that has bOn boolean

#

good practice would be to replicate that boolean, with RepNotify (which defines a function that is called when variable is replicated)

#

and then use that function to update client visual state (as in, turn on the lights)

#

multicasts are suicidal for any class that does not exist on every client (like the PlayerController and GameMode)

merry hemlock
#

So where would that function be located that actually updates the lights? It would a RepNotify existing on their client BP?

winged badger
#

there is no server and client BP

#

they are one and the same

merry hemlock
#

I mean like a Player Controller's BP

#

the client instance

#

I'm trying to practice using the proper terms as my understanding is still a thing in progress

winged badger
#

lets say you want to press E to turn on the light and your player pawn has the reference to the LightSwitchBP instance you want to affect

#

you would go from input event E (Pressed) -> to call your CustomEvent named, say, LightSwitchToggledServer (which is replicated to server and is reliable)

merry hemlock
#

And since it's replicated, it is called on the server's instance of that light (and from there, to all other clients?)

winged badger
#

then in the event you would Get a reference to the LightSwitchBP -> SetOn (true)

#

bOn would replicate to the clients

#

and they would call their OnRep functions to actually turn on the lights

#

if you did the same with multicasts

#

then if a new client connected after you turned the light on, it would have no idea that you turned it on, as it was not connected when multicast was called

#

but when it connects, the LightSwitchBP would replicate its bOn variable, and OnRep function would be called

merry hemlock
#

That shouldn't be an issue as I will only have 2 players for quite a long time (LAN mvp ) but I feel like it's important I know that, so thank you

winged badger
#

multicasts are great for stuff that does not depend on state and needs to be run on every client

#

like playing an animation

#

and btw, if you multicasted from host PlayerController, its not just that it would not work, it would break the client's connection

merry hemlock
#

What about events not related to the client, like making an AI controller move or playing a sound that should be heard by all? If I'm triggering those events on the GameState, do they just need to set to Replicate on the red node (and also the actor's themselves need to replicate enabled on their class settings)

winged badger
#

AI controllers exist only on server

#

so no replication is possible there

#

firing sounds is a good candidate for multicast, but an actor responsible for the sound in the first place (like a character being responsible for its footsteps) is a better option then a GameState to call it

merry hemlock
#

Is it possible to use a break and step through a blueprint if you are checking for replication and other testing for multiplayer? How do you target the appropriate blueprint instance? Normally I juse use the existing blueprints that are open before runtime, do I do something like use the world outliner once play as started?

winged badger
#

i don't know how to answer that question well

merry hemlock
#

Or do you just essentially put print nodes on every replication event you want to check?

winged badger
#

good part of my project is in code

#

and Visual Studio breakpoints behave differently

stable idol
#

On the client, how do I know which PlayerState in the PlayerArray is mine?

winged badger
#

your PlayerController has a reference to it

stable idol
#

omg thought I'd tried looking for it there. Thanks!

twin sorrel
#

if the position of a player on the server and on their own client is out of sync, will the positions eventually be synced? Sorry if it's a really nooby question.

winter plover
#

if they are replicated yea

#

replication basically sends the server version of a variable to relevant clients whenever it changes

#

with positions/vectors they are usually simulated simultaneously server and clientside to prevent choppy movement for the client, while it's waiting for the server to update again

#

Charactermovement is automatically replicated afaik, nothing you gotta worry about there

wary willow
#

Sooo...

#

Why does OnPostLogin... 1700ms...

#

spike?

#

I'm about to kill it for my demo, since it's a single player slice anyway...but

#

I am curious as to why is causing that

#

Why is it so high when a player joins

raven holly
#

@wary willow Check under the tree

#

What is causing it

wary willow
#

oh, closed out of it already, I'll check it later later

#

I found my problem BPs anyway

raven holly
#

I wish epic would comment on the [/Script/OnlineSubsystemUtils.IpNetDriver] config

#

๐Ÿ˜

compact gulch
#

hey guys... does nayone know the difference with the macro of UE_SERVER and WITH_SERVER_CODE

#

UE_SERVER seems to be the correct one but didn't work

twin sorrel
#

was wondering if anyone knows why?

#

i think the server is trying to set the position to what it should be, but i have no clue why it would be out of sync

winged badger
#

if it feels like rubberbanding, odds are you are replicating an actor component you shouldn't

twin sorrel
#

oh

#

maybe

#

i was dealing with replicated meshes and collisions apsules

#

ill try to set that back

#

dam

#

did nothing

#

But yeah, defs feels like rubber banding

winged badger
#

it would have to be one that has a FTransform

twin sorrel
#

yeah

#

i think it was fine before i restarted the engine

winged badger
#

speeds on your server and client not beeing synced could also cause the problem

twin sorrel
#

only if i'm using stuff to do with time dilation though right?

winged badger
#

no, if your server thinks your character's speed is 500 and client thinks its 700

#

client will simulate at speed 700 and server will correct its position every time replication happens

twin sorrel
#

yep

#

hmm

#

it could be the code i use to keep the speed below 500?

#

in the blueprint i showed

winged badger
#

we had a problem like that when the root component (capsule) got replicated

twin sorrel
#

yeah, i just unreplicated all of the ocmponents and it didnt fix it unfortunately

#

i may aswell try the thrust with a staticc value

winged badger
#

i have to run

#

sorry

twin sorrel
#

well, atleast i found the problem

#

i appreciate the help @winged badger

twin sorrel
#

anyone figured out how to remove jitter present in dedicated servers when changing velocity quickly?

ripe raptor
#

Unless I am mistaken

#

Up until recently, multicasts weren't being fired on the server, right?

#

You'd have to do MyMulticast() and then MyMulticast_Implementation() right after to have it fire on both client and server, right?

brittle sinew
#

What is "recently"? I can't remember that ever being a thing, and I've been around since like 4.8

#

Are you thinking about OnRep?

#

You do need to manually call that on the server in C++ for that to fire on the server

#

(not in BP, however, IIRC)

ripe raptor
#

hm, I was pretty sure that was the case for multicasts too

#

obviously I'm wrong

merry hemlock
#

Commands like ?Listen or open IP address can always come from a widget itself, since the player IS the server before they are connected, right?

merry hemlock
#

Sanity fading

#

Unreal just seems to laugh at me anytime I try using Switch HasAuthority

thin stratus
#

TextRenderers don't just replicate cause you click on that boolean

#

If there is no logic to replicate the text in that, then ticking that doesn't do anything

merry hemlock
#

Thanks , I was going to go crazy

#

so how do I replicate that, I set the text on the remote node

#

what was wrong with that blueprint ?

thin stratus
#

Are your two windows even connected to each other?

merry hemlock
#

yes

#

movement is being replicated because they inherit from character ,not pawn

thin stratus
#

What you BP currently does is: For the Server, do nothing despite the Print.
For all clients, change the text to I am the Client

merry hemlock
#

I thought that was what Remote did

thin stratus
#

Switch Has Authority decides per instance if that instance is existing on Server or a Client

merry hemlock
#

so wait, it will think it has authority because it's the client's pawn BP?

thin stratus
#

No, you have 2 Players. Server and Client.

#

These replicated sphere you have there exist in total 4 times

#

Server's sphere exist on Server and replicated on the client.
Client's sphere exists on Server and replicated on the client

#

Now, if we take "SwitchHasAuthority" on the Server's Game.
His own Sphere will show "I am the host", cause we are on the Server, so SwithcHasAuthority will use "Authority".
The other sphere will also show "I am the host", cause that instance is obviously also on the Server.

Now the Client's game has his and the other sphere both on his end. he is remote, so these two instances will go the "remote" path.

merry hemlock
#

so there are 4 pawn instances to keep track of???

thin stratus
#

Well, per game 2

merry hemlock
#

probably reveals my ignorance but isn't there a "IsTheFrickingServer" node anywhere?

#

I was copying this from the network example map

thin stratus
#

Client sees two players. Server sees two players

#

Make it a total of 4

#

And yes, "IsServer" is a node that exist

merry hemlock
#

but that won't matter if it doesn't replicate

thin stratus
#

Well, replication is more a process

#

If you place a box into the level

#

You don't have to tick "replicated" to make it exist on everyone

#

If it's not replicated, it is not connect. So the Server and Client instance (see image above) aren't connected.
For both players, it's an object in their world which they can change, delete, etc.

merry hemlock
#

right now it's just the pawns/players that are giving me issues

thin stratus
#

If however you do enable replication on that block, it would be connect. So you can use the server to destroy the actor or replicate variables in it, which then arrive on the client version

#

And that applies to all actors

#

Well, if your Pawn is replicated

#

And the game spawns it (e.g. gamemode Defaultpawn)

#

Then you can replicate variables and RPCs in it

#

Switch has Authority will work in replicated and non replicated actors

#

It's simply telling you if you are on the Authority or not

merry hemlock
#

So i need to make those events here then....and they will be called on the instructor BP if the....

thin stratus
#

That stuff there is spawning code for VR and non VR Server/Clients

merry hemlock
#

that's the game mode though

#

the first player that joins is the host, so it chagnes the IsServer variable to false

thin stratus
#

Yes

#

But that's a handmade variable

merry hemlock
#

the gamemode now fires this event if the connecting player isn't the server (it's at the end of that big blueprint before)

thin stratus
#

After it posessed?

#

Well this will only call on the Local Client, so the one that is actually owning the Pawn

merry hemlock
#

that explains why it's not working then

thin stratus
#

You'd want to set a RepNotify text variable

#

In which you set that text to the renderer

#

And that Text should get set on the Server side, right after spawning it

merry hemlock
#

Here's where I get confused

#

Server Side makes me think Game Mode because that only exists on server

thin stratus
#

Correct

merry hemlock
#

So how do I set the text on the pawn BP but have it be server side?

thin stratus
#

Well, knowing you are on the Server in the GameMode, cause that hting doesn#t exist on clients, you know that ,every function, which is NOT a Client RPC or Multicast obviously, will run on the Server

#

So if you spawn your pawn

#

And you have a function in that, which is not an RPC

#

"SetText" or so

#

And you call that from within the gamemode, after spawning the pawn

#

that call will still be on the server version of the pawn

#

RPCs are to hop between Server and Client versions

#

If you don't use one, you'll stay on that specific side

merry hemlock
#

Why can't I find RPC anywhere....?

thin stratus
#

So if you call "Set SomeText", where "SomeText" is a RepNotify Variable", right after you spawn the Pawn, it will still happen on the Server

#

It's explained in my compendium

#

RemoteProcedureCall

#

You can imagine that as your Remote from your TV, sending a call to your TV

#

"Power off", sents it to your TV, that does things on it.
If you see your Remote as your Server and the TV as your client, you'd have the same thing when using a ClientRPC

#

Created by making a CustomEvent and setting it to RunOn...

#

Basically what you have in your latest screen

#

But as said, no reason to use that

#

Set a RepNotify text variable

#

with "I AM THE CLIENT"

#

And in the OnRep function, you use that variable to set the TextRenderer

#

OnRep functions are auto created when you set a variable to repnotify

merry hemlock
#

So the text variable needs to be on the actual game mode?

thin stratus
#

Na, in the Character

#

But after spawning your pawn/character in the GameMode, you can easily access that, right ?:P

merry hemlock
#

sorta, how do I get the actual OnRep Event to come up

#

I've made the variable, RepNotify and compiled the Bp

thin stratus
#

You mean how to show it?

#

You should see it in the functions on the left

#

OnRep_VariableName

#

Doubleclick it

#

And put your logic in it

compact gulch
#

hi . to those who has used dedicated server before... do you face issue where the server reuqires directx to run?

thin stratus
#

It will be called on all instaces of that Actor (so Server and all Clients) when the Server sets the variable and the value arrives at each player

#

I only faced that once, with GameLift

compact gulch
#

yeah i'm getting that in EC2 now

thin stratus
#

There I added a silened installer for DirectX

compact gulch
#

so u put it in the volume?

thin stratus
#

You need to install Directx and the C++ Restributles

#

Or how ever that is called

compact gulch
#

it seems directx won't install

#

after installing it's asking again...

#

did u finally pack the 'image' together with the redistributable?

thin stratus
compact gulch
#

ic an't quite imagine installing it at every instance

#

@gentle drum

thin stratus
#

EC2 instances are static

#

You usually don't kill them

merry hemlock
#

Thanks @thin stratus I'm sure I'm not done with questions but it's finally working

compact gulch
#

ic

thin stratus
#

GameLift is hosting new instances based on settings and demand

#

And has a way of installing these quietly

#

if you put an "Install.bat" file with it

compact gulch
#

ic.. the one with commandline?

#

right. right

thin stratus
#
vc_redist.x64.exe /q
dxwebsetup.exe /q
compact gulch
#

so it worked after that?

thin stratus
#

So game + 2 files + install.bat and it does work

compact gulch
#

i got the VC_redist to work.. but it's still pestering me for DX

thin stratus
#

For GameSparks shit I also had to add a certificate

compact gulch
#

oh what's this go tto do with gamesparks tho?

thin stratus
#

Nothing, just so you don't wonder why there is a AddTrust... thing :D

#

In the screenshot

compact gulch
#

yeap yeap .. got it

thin stratus
#

Our Servers communicate with GameSparks, so they need the certificate

#

As it's not present on a fresh instance of gamelift

compact gulch
#

oooo

thin stratus
#
vc_redist.x64.exe /q
dxwebsetup.exe /q
start "" certmgr /add AddTrustExternalCARoot.crt
#

Install.bat actually looks like this

compact gulch
#

so you put the certificate in the image? ic

merry hemlock
#

So replicated is for things to GET to the server, REP Notify is for things to get from the Server to Everyone else? Something like that?

thin stratus
#

Yeah, GameLift lets you upload a build of your server

compact gulch
#

btw. we manage to got all our backend done thanks to a lot of your advice. I also see your chat with the Gamelift support. really helpful

thin stratus
#

It's basically what you see in my image above

#

Well, i hope so. That was annoying for me. Doesn't have to be the same shit again for others