#multiplayer

1 messages ยท Page 310 of 1

heady merlin
#

Conan exiles is also using their own network solution

#

they said they spliced their mmo system in

hollow quartz
#

Any chance you have a link to the thread? I'm trying to figure out how to set those values myself. Althought Conan is using a different server backend so I dont know if the networking is coupled to those vars

cyan bane
#

Scroll down and you can see Scooper, the dev, address it

hollow quartz
#

Im trying to increase the amount of data the server can send to clients myself, but I can't seem to affect it

cyan bane
#

Because I own the game, and I too have these issues, but having worked with the engine I'm confused as to why

#

Clients need to change values too

hollow quartz
#

Its possible they are using those vars with their networking implementation, and likely that during transmission of lots of data the server fps would drop

heady merlin
#

it could likely cause network saturation

#

that is a large bandwidth pipe they gave users in that thread.....

cyan bane
#

But you're saying servers will prioritize sending data over having a stable framerate?

hollow quartz
#

Dont know enough about replication to say one way or the other

cyan bane
#

Well it does make sense if you're trying to keep all players in sync

heady merlin
#

I don't think it actually lowers servers tick rate, unless it literally cannot process replicating everything

#

server doesn't update everything on every frame for everyone

#

there is a queue with importance and last update taken into account

cyan bane
#

This is what the dev is saying that has me confused:

"The downside is that the server is now allowed to spend up to 700kbs a second per connection doing replication(networking) of data to the clients. Which means it will spend a lot longer time doing it each frame than it did before. Which means lower server framerate, and everything else in the game will suffer from it, like AI behavior not being able to update as frequently as it requires"

heady merlin
#

update rate is total bandwidth /

#

but there is still a max update rate setting

#

default is what..100htz? on components

cyan bane
#

I think he's just talking about onload

heady merlin
#

no

#

the dev is talking about runtime

cyan bane
#

Yeah, but when a building comes into view and needs to load

#

not values that need to be kept updated every frame

#

like movement data

heady merlin
#

thats not how that variable works though

#

that is in effect all the time

hollow quartz
#

same difference to the engine

#

thats actually the exact issue im facing right now building a multiplayer voxel world. Each 16x16x16 chunk is an actor that replicates an array of 4096 ints. Takes a good 1-2 seconds per actor with default bandwidth settings. Makes new player loads insanely long. I dont know if there is a way to increase bandwidth for users who are in a joining state or not, doesn't seem like it. Might just be a matter of finding the right ratio between load time / server performance. But I'm just getting into this stuff and might not have a clue ๐Ÿ˜›

#

I dont even know if UE4 compresses UPROPERTYs for replication or if I need to do that myself

cyan bane
#

Why are you giving clients data on every block?

#

Wait, is it procedural?

hollow quartz
#

Yeah, and ideally would have latency compensation so the client would like to know what the blocks are when editing, vs. just sending visible blocks (which still takes a long time)

heady merlin
#

Twitch

hollow quartz
#

What I found was any array over 512 took forever to replicate

heady merlin
#

I made a voxel plugin awhile ago with multiplayer

#

You need to compress the data.....

cyan bane
#

If it's procedural only send data on the blocks/chunks that have changed

hollow quartz
#

Been working on that this morning @heady merlin , using FCompression but getting kinda lackluster results

heady merlin
#

I compressed with a custom RLE, then ZLIB, then chunked it over the network

hollow quartz
#

Any chance I could peek at your code?

heady merlin
#

there is a max size to replicated arrays in engine btw

#

have to chunk it

#

sounds like you are blueprint?

hollow quartz
#

Im doing this as a learning exercise so appreciate the tips, dont really know what I'm doing

#

C++

heady merlin
#

if you are doing it as replicated array on an actor for each chunk...

#

oh

#

you can do WAAAAAAY better in c++

#

for one thing, storing the voxel data as RLE to begin with

#

means you just replicate the array itself, chunked

#

also what are you storing in that int?

#

a better approach btw would be a master "terrain" or "volume" actor, with subcomponents for each chunk of the voxel data

hollow quartz
#

Well so I thought about doing RLE but have no experience with it, my first idea was that I could avoid having to replicate the FVector position of a voxel but just sending all of the voxels by type, as an array of ints, and the position can be extrapolated from the array index

heady merlin
#

that is the correct way to do it, but you need compression then to send it

hollow quartz
#

I have a VoxelWorld actor that spawns replicated VoxelChunk child actors

heady merlin
#

if you have sparse arrays you can send initial pos of first and then strings of voxels too though

#

yeah the chunks shouldn't be actors themselves

#

higher overhead

hollow quartz
#

oh ok

heady merlin
#

you using that community procedural mesher?

hollow quartz
#

URunTimeMeshComponent yeah

heady merlin
#

I rolled my own but his is good if you don't want to

hollow quartz
#

his seems to be fast enough for now at least

heady merlin
#

its not ideal for voxels

#

but its great overall

hollow quartz
#

I want to do marching cubes or dual contouring eventually, I figured it might be good for that

heady merlin
#

MC is terrible

#

DC is good

#

but MC is really easy to implement

#

and DC isn't

#

also for DC your entire approach will need to change

hollow quartz
#

Can you elaborate on having the chunks as components on the main world actor vs having chunk child actors?

heady merlin
#

you'll have go to octrees

hollow quartz
#

Yeah thats on my list to explore after I solve this replication stuff

heady merlin
#

subcomponents just have less overhead than a full actor

#

also that places everything under one master actor

hollow quartz
#

would I just extend UObject and slap em on the world actor?

heady merlin
#

RuntimeMeshComponent, subclass it

#

add your voxel data

#

and then attach those to the master actor

hollow quartz
#

and those will replicate individually?

heady merlin
#

you want to manually replicate

#

the built in one will not do what you are looking for

hollow quartz
#

RPCs then?

heady merlin
#

can be

cyan bane
#

There's also smaller optimizations you can make. Like if a chunk is entirely air or is entirely buried and contains no visible voxels, don't send anything at all.

heady merlin
#

RLE already would handle that well enough

cyan bane
#

But i guess that would only work if you are working with both horizontal and vertical chunks

hollow quartz
#

If not RPCs, you'd use sockets manually to replicate them?

heady merlin
#

yeah

#

or could rep a custom struct

#

but you likely need to chunk everything and send in portions

#

then compile back together

#

my data was smaller than yours though on the default type

hollow quartz
#

What would a replicated custom struct look like? How would you chunk it as a whole struct? I'm probably getting over my head here

heady merlin
#

I didn't go that route

#

so can't off the top of my head

hollow quartz
#

So chunked might be something like, 4 replicated/RPC'd arrays versus one, each compressed?

heady merlin
#

yeah

hollow quartz
#

or however small the chunks need to be

heady merlin
#

I ran RLE, then ZLIB, if the zlib was larger, flagged it as RLE only

hollow quartz
#

I see, any thoughts on using replication vs RPC for this? Should I bother trying to use replication?

heady merlin
#

replication has potential issues

hollow quartz
#

Did you do RLE manually or is there a built in utility?

heady merlin
#

rpc or direct socket is likely what you want

#

manually

#

voxels RLE can be far better than general RLE

#

lots of micro optimizations you can make

hollow quartz
#

right, until i need to send other data along with em

#

more than just block type

heady merlin
#

can fit more than block type in that int

#

if you want full 32 bit color, RGB, A = part alpha, part data

#

if you don't mind 16 bit color, far mor eto work with, or less array size

hollow quartz
#

So the replication vs RPC issue is interesting to me, why would I not want to use replication? All the docs say to use RPC for cosmetic stuff

#

I know I might be able to force faster transfers thru RPC but would that have side effects

heady merlin
#

socket is best honestly

#

rpc has some overhead

#

which is why for normal game play variable replication is better

#

but its also more flexible in a way

hollow quartz
#

So for a socket, i'd have the main world actor keep a connection open with each client and push the array chunks as necessary?

heady merlin
#

yea

#

the array rep only reps what has changed over

#

so thats nice

#

but its harder to detect what changed

hollow quartz
#

Easy enough to keep an array of changes that frame

heady merlin
#

if you plan on fully compressing the data all of the time

#

the entire array will likely be different

#

so if you don't compress, it would likely work better

#

but your memory load is far higher then

#

also iteration is actually faster on a RLE compressed voxel array than an uncompressed one

hollow quartz
#

interesting

heady merlin
#

you get pretty good meshing speed

#

if you get the iteration as fast as possible

hollow quartz
#

damn

#

So you suggest having a single world actor, with subcomponents dervied from URuntimeMeshComponent, manually replicated via RPC or socket, and I guess the client would be spawning their own mesh subcomponents as they receive them and destroying them as they go out of range?

heady merlin
#

reuse

#

just shift them around

hollow quartz
#

true

heady merlin
#

keep a component pool

hollow quartz
#

based on draw distance

heady merlin
#

initialization of components is actually pretty heavy in engine

hollow quartz
#

ah ok

#

fair enough then

#

well that gives me a healthy amount to go and learn

#

I really appreciate it @heady merlin

heady merlin
#

GL

hollow quartz
#

Mind if I bug you again in the future?

heady merlin
#

nah its cool

hollow quartz
#

tyvm

pearl pollen
#

Hi, would anybody be willing to quickly run me through the general ideology of how client-server relations work in ue4? It's pretty confusing even though I know how to do things in theory. I just don't have any idea on how to implement these principles practically.

true peak
#

I can host/join sessions when I run two instances of the game on the same computer, but when I go to a different device on the same network it cant find sessions. Anyone know why that might be?

potent prairie
#

Tiled landscapes/world composition works fine as long as you use a dedicated server right?

summer rivet
#

So general question. Starting up a listen server with a client in the editor if I ask for the Player State -> Player ID on begin play I get a 0. if I wait a few seconds and ask I get a valid #. Any reason why?

versed socket
#

@summer rivet the answer is i love your videos

summer rivet
#

heh ๐Ÿ˜ƒ

#

glad to hear that!

balmy gazelle
#

@potent prairie from what I know world composition don't work in multiplayer

thin stratus
#

@summer rivet on which beginplay?

#

PlayerStates?

orchid cairn
#

if you're calling the state from the client PC beginplay, the state may not have replicated yet... you can do a simple isValid loop, with a 0.2s delay in there (which just makes sure everything has had time to sync)

thin stratus
#

Is the id replicated?

#

Maybe it comes with a cpp onrep function

native axle
#

Whew 5 hours later and I've got the character movement running on all characters (usually it doesn't update state on non-owning ones, though that may be cause I turned off bReplicatesMovement). Now I just gotta pray that my dodgy code doesn't cause any bugs.

summer rivet
#

@thin stratus was in the characters begin play. Was simply trying to make a reliable way of storing that ID from the player state in the character without using a delay but I cant seem to get a function that's reliable for that lol

thin stratus
#

Why would you move it to the character?

#

Just query it from the PlayerState

#

Character has a Pointer to it anyway

#

Also keep in mind that this ID is only unique during that one map/level

#

If you servertravel or rejoin you'll have a new ID

wise depot
#

if any of you guys have ever packaged to consoles or multiple devices, would you mind checking my question over on UE-General please? โค

summer rivet
#

So the problem is recreating group health bars on UMG widgets. Each player has a bar that represents another player and themselves. When the server deals damage to a player I'm having a hard time IDing that player to tell everyone which bar to change in their UI

thin stratus
#

@summer rivet GameState has a PlayerArray with all PlayerStates

#

You can use that to always try to retrieve PlayerStates

#

If you have a group you would want to have that bay saving PlayerState refs

#

The owner of the PlayerState is the PlayerController

#

If the Character gets hurt you only have change the health on him

summer rivet
#

yeah I think I am not handling some things properly is what it is

thin stratus
#

Then you go to your UI

#

Get the PlayerStates

#

Get their owner

#

Cast thaz to playercontroller

#

Get the controlled pawn and his health

wise depot
#

Client's dont have access to other players controllers, only the server does, remember that

thin stratus
#

Ah

#

Right

#

My bad

#

Eeeehm

summer rivet
#

heh

thin stratus
#

Does the PlayerState have a pointer to character?

summer rivet
#

nopers

wise depot
#

if your player state stores health, (that's what we do) have your widget keep a reference to the state that owns it

thin stratus
#

Then just push the health to playerstate

wise depot
#

you can send pointers over an RPC just fine, don't ask me how 'cause that's some black magic bullshit but it works

summer rivet
#

my first pass at this was having the player state store it yes but I am trying other ways to learn this stuff

wise depot
#

so you can send a reference to who owns wat over an RPC

thin stratus
#

@summer rivet You could have a reference of the character inside of the PlayerState

#

But in the end you wanna use the PlayerState to share information between users

summer rivet
#

yep trying other ways of doing this without adding things to the stuff ๐Ÿ˜ƒ

sacred ether
thin stratus
#

@wise depot replicated actors are linked via netids afaik

wise depot
#

so you could, for instance,

in your player state create a reference to pawn that is replicated,

on the server, in your pawn, do pawn->PlayerState->PawnReference = this

or along those lines

thin stratus
#

If you pass a reference of a replicated actor you actually pass the id

wise depot
#

then your clients can all be given references to who owns what

summer rivet
#

the current idea is store the player ID on character creation and replicate that so the ID is always persistent on each character. When I create the UMG layout I store a map of the ID -> health bar widget. Whenever I replicate damage I can then tell all the character to update their UMG with that ID and the new value. It works fine but I really hate the fact I can't easily tell when the player state is valid without delaying or looping

#

so the issue is not really the health or anything just trying to make sure I only do stuff when stuff is valid lol ๐Ÿ˜ƒ

thin stratus
#

You can by using the BeginPlay of the PlayerState

summer rivet
#

on a client will that only fire when its valid on that clients version then?

#

I thought I had it licked with the possessed function but thats server only lol

thin stratus
#

BeginPlay fires on each instance ones it's spawned and ready

summer rivet
#

yeah that might work, playerstate can talk to it's owner and tell that character to store the ID then

thin stratus
#

So if the client lags it's delayd for him of course

#

Yeah for example

summer rivet
#

I had a few instances of the player state->Id still returning null after 2 seconds spin up time

thin stratus
#

But just linking the widget to the PlayerState would be way easier

summer rivet
#

as in?

thin stratus
#

Array of PlayerStats that resemble your Group. Loop over it in the main widget and spawn group widget per entry. Pass that the reference of the PlayerState. Then have health on the PlayerState replicated so you can just use the PlayerState variable in each widget to get the health

#

If character gets damaged it's handled on the server anyway so he forwards the health to the PlayerState

#

And everything else updates automatically

summer rivet
#

yeah that's what I did the first time

#

was trying to learn to avoid modifying the player state for this time ๐Ÿ˜ƒ

#

basically just redoing this idea a few times in different ways to learn networking

thin stratus
#

Makes no sense as that's how it should be done afaik

#

You are complicating things otherwise

#

Don't make your life harder than it is xD

summer rivet
#

not making it harder, using it to learn

#

I had the other way working for example without using RPC and would have never gotten a handle on RPC without it

#

same with learning that PlayerState isn't valid on Begin Play in a client ๐Ÿ˜ƒ Got to break shit to learn how it works

#

appreciate all the answers tho. Networking has been making me it's bitch for the last few days lol

thin stratus
#

You could set a rep notify variable on the Server Version

#

That should replicate etc one everything is valid

#

But not 100% sure

#

But yeah just keep asking if something is up

#

And, in advance make sure to understand ownership

#

To avoid headache when a rpc doesn't work

summer rivet
#

yep been learning ownership the hard way heh

native axle
#

@thin stratus somewhat related question to what you guys are talking about, in your pdf you said to wait for AGameMode::PostLogin to be called before doing rpc stuff.

#

I made a custom kinda 'begin play' for networked stuff and also disabled actors tick until this is ready, thoughts on that?

thin stratus
#

PostLogin is called when the client has a valid PlayerController

#

I think i simply meant that at this point you are save to call rpcs on that playercontroller

summer rivet
#

and yeah @thin stratus using rep notify was what I used for the first test as well ๐Ÿ˜ƒ seems like the first version might have been the "sane" way heh

native axle
#

Hmm maybe I had a call to the player controller in my character then. Otherwise it should be fine to call rpc stuff in the character on begin play?

thin stratus
#

You are fine to call rpc everytime, it's more about having an entry point at which the server can start interacting with the client

#

Such as spawning a pawn for him

#

I might need to rephrase that if it causes confusion

native axle
#

I might have to relook at what I'm doing then. It's cause a bunch of people mentioned trying to put a delay to wait for things to replicate.

#

Which usually fixed the problem for me

#

so I thought beginplay was unsafe

#

and that your postlogin thing was the solution

#

Though I had to put a delay after post login anyhow ๐Ÿ˜›

summer rivet
#

yeah I used post login to talk to the player and that was fine it's just some variables are not replicated yet on the client side was the issue I ran into. Delay ftw lol ๐Ÿ˜›

#

just because you have a valid player controller doesn't mean you have a valid character as well lol ๐Ÿ˜›

#

networking basically goes "all the stuff you learned before? Fuck you, it's wrong"

thin stratus
#

Na it's just not excusing as much wrong stuff as singleplayer

hollow quartz
#

I feel like I'm going crazy: I started a blank C++ project, added an actor class with the following:

void ATestActor::BeginPlay()
{
    Super::BeginPlay();

    if (HasAuthority())
    {
        GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Red, FString("Authority"));
    }
    return;

And inserted it into the level. But both the server and clients display "Authority". It works properly if I switch Play mode to a seperate process, whats going on?

#

I'm suspecting GEngine->AddOnScreenDebugMessage is global when using single process for playing

verbal slate
#

Any easy way to respawn pawns in C++ multiplayer game?

#

And where should I place code for respawning players? PlayerController or GameMode?

thin stratus
#

@hollow quartz single process is displaying it to both screens

#

That doesn't mean both call it

#

If both call it you would see it twice

#

@verbal slate Up to you. Could do it in the PlayerController

#

And no, you might need to destroy the old pawn and spawn a new one by hand

verbal slate
#

@thin stratus I'm trying to call GetWorld()->GetAuthGameMode()->RestartPlayer(this); on button press but that just resets camera

#

And if I try to respawn on client it crashes game

thin stratus
#

Yeah well check what restart player does :D

#

Well client can't get the gamemode

verbal slate
#

I see, forgot about that

thin stratus
#

Restart Player is probably just doing stuff with the PlayerController

#

You might really handle that stuff yourself

verbal slate
#

Yep, thought that this might be the case

#

I was checking out ShooterGame project and spawn system there's pretty extensive

thin stratus
#

ShooterGame is overdoing it a lot

#

Good to learn but a bit too much for most simple things

verbal slate
#

Yeah, trying to find middle ground between shitload of code in ShooterGame and GetWorld()->GetAuthGameMode()->RestartPlayer(this); ๐Ÿ˜†

#

If someone is looking for same thing I just solved it (only for server though, clients will come later)

#

Here's the code:

#

APlayerPawn* PlayerPawn= Cast<APlayerPawn>(GetPawn());
PlayerPawn->Destroy();
GetWorld()->GetAuthGameMode()->RestartPlayer(this);

dawn glen
#

im thinking im not understanding how player controlled objects are replicated. I have an airship, It moves on the players screen but not on anyone elses. Two things im not understanding. #1 i would of thought the server would snap the airship back to where it is on the server instead of letting the client fly away on it and #2 why http://prntscr.com/e6om55 doesnt work replicated in the airship but http://prntscr.com/e6omfh is replicated in 3rd person character. I have the components set to replicate but obviously its not sending the movement to the server. When i try to run the inputaxis events through a run on server event before add controller input nothing still happens for the other player http://prntscr.com/e6op2q

Lightshot

Captured with Lightshot

Lightshot

Captured with Lightshot

Lightshot

Captured with Lightshot

verbal slate
#

Though it will probably have something to do with checking if player is authority or not

dawn glen
#

well the input has to come from the client

#

then it has to go to the server and teh server perform the movements

#

but if i dont allow the client to calc the rotation it wont rotate for the client either. Its like the server is ignoring and not replicating at all

verbal slate
#

Do you have both bReplicate and bReplicateMovement set to true?

dawn glen
#

and for some reason my player is replicating but when im testing the blueprint and set it to dedicated server there is no server instance of the thirdpersoncharacter yet with 2 clients connected its showing 6 instances in all worlds with none of them being server

dawn glen
#

i reparented to character instead of pawn and it solved most of my problems and created new ones lol, thanks for the document i will read it through after work.

verbal slate
#

Didn't help much but I'm glad you got it working

thin stratus
#

@dawn glen does you thing there have a charactermovementcomponent?

#

Iirc default replication of the yaw input etc needs that

#

So a pawn doesn't do that by default and needs you to handle that themselves

#

Is that maybe the issue?

#

@dawn glen okay yeah im certain it's that as pawn didn't work but character does now

#

Pawn doesn't have the component while the character has it

fringe dove
#

does UE4 support in-app purchases on steam, or only ios/android?

fossil spoke
#

The Steam SDK handles the actual purchasing, though you need to add hooks into that in your game where you want people to buy stuff.

true peak
#

I can't find game sessions when I use lan on different computers, but it works when I run two instances of the game on the same computer? anyone have any ideas

#

can't figure it out at all

brittle sinew
#

Could you possibly check out your log file? It might give hints as to why the connection failed (e.g. different builds of the game)

#

Though I believe that issue specifically will still return the session, just the join itself won't work

#

Either way, it's a starting location

orchid zinc
#

You might also want to make sure you're outputting session info for found sessions to your log. That's always useful for seeing what sessions your game is actually finding, if any.

true peak
#

how do you check the log file for a game when you right click the uproject file and launch?

brittle sinew
#

Through Saved -> Logs

#

But I believe right clicking launch game effectively runs an editor instance of the game without the editor itself, and editor MP never seems to work

#

You might have more luck packaging and distributing

true peak
#

thanks for the information, ill try to package and run it

thin stratus
#

Yeah you don't want to start 2 editors

thin stratus
#

Though you also don't need to package it as long as the engine is installed on both pcs

#

There should be some information in my compendium about how to start a listen server and client etc just through cmd

#

For you that would be 2 non clients i guess as you have a menu?

true peak
#

ya i have a menu, I can't connect over cmd on different computers but I can on the same one

#

I am using unreal 4.13 and thinking that is the issue

#

becuase no example projects work on that version

brittle sinew
#

Just to confirm, you can see the other PC on the network, correct?

#

(ping, nmap, etc.)

#

Because no example projects working seems quite odd

true peak
#

how would I confirm taht I can see them?

brittle sinew
#

Get the internal IP of PC 1 using ifconfig, go to the other PC and try to ping <IPofPC1>

#

Oops, ipconfig

#

If you're on Windows

#

You should be able to see it, but I'm just trying to rule out something like AP isolation being on (which is mainly for public WiFi anyways)

true peak
#

it keeps timeing out actually

#

nvm it does work

thin stratus
#

What exactly does work

#

Session searching?

true peak
#

no that doesnt work, i am able to ping my laptop and computer

#

and see each other

#

but it still cant find the sessions

thin stratus
#

Alright, what subsystem do you use

#

How are you starting the games

true peak
#

right clicking the launcher and launch games or a packaged version

thin stratus
#

Can you share screenshots of the code you use to host and join

true peak
#

im using subsystem null

#

this is what im using

thin stratus
#

Wรคhh

#

That's mine

true peak
#

haha o really?

#

its the only good resources i could find doing it in c++

thin stratus
#

Ya and I'm not sure if that still works in the newest versions

#

Can you try to hookup the session nodes

#

And make sure that that works?

true peak
#

like blueprint?

thin stratus
#

Cause then we can pin point it to my outdated tutorial

#

Yes

#

If the session nodes work then we know that something is wrong with the cpp code

#

I'm currently not home (till sunday) but others might be able to work you through fixing that if you go step by step and check what doesn't work and what does

#

Maybe the hosting already doesn't work. So you might want to add some onscreenmessages to the callbacks

#

And see if they return successful etc

true peak
#

I think i already do based on your tutorial, the deleagtes print debug messages when boolean results

thin stratus
#

Alright, that should help to get some information what fails

#

I mean atm it's only a part of hosting and finding

true peak
#

when I run the game on the same pc, it host/finds/joins correctly

#

but when I switch to two different pc's on same networok

#

it can't find any sessions

thin stratus
#

Okay you might want to google how to enable logverbose for the logonline

#

And then check the logs

#

Maybe they have something in them

#

Can you make sure that you can connect like this:

#

open MapName?listen

#

On the server and

#

open LocalIPAddress

#

On the client?

#

You can see the ip of the server by simply doing the ipconfig thing in your cmd

#

The open command is a console command

#

So you have to open the console on your games

#

Gnah my phone is at 2%...

true peak
#

trying it now

thin stratus
#

Just make sure you can connect

#

Then check if you are actually hosting (delegate debug texts etc) maybe enabling logverbose for logonline (google)

true peak
#

that doesnt seem to work

#

again it works if I run two instaces of the game on the same computer

thin stratus
#

Then the issue seems to be in the network

true peak
#

but not on different computers

thin stratus
#

And not directly with ue4

true peak
#

pacakged version of my game

thin stratus
#

If you have two packaged versions then it should work

#

You added the Subsystem dependencies to the build.cs file?

#

Should be part of my wiki entry

true peak
#

DynamicallyLoadedModuleNames.Add("OnlineSubsystemNull");

thin stratus
#

Make sure both games are either launched through the engine (not editor) or packaged

#

And check the logs files for any errors/warnings or so like timeouts

#

Or maybe even non working online features

#

Can't be much if it's working on the same pc

#

Although open commands should work without subsystem

#

So that's not even needed. Yeah try to get the open MapName?listen thingy working first

#

If that works you can test the session stuff again

true peak
#

okay ill try my school labs computers

#

thanks so much for the help man

thin stratus
#

No biggie (:

true peak
#

working on this for my capstone project and have been comptely lost

thin stratus
#

Ya, Multiplayer is a bitch sometimes

#

There might be some additional good resources pinned to this discord channel

true peak
#

everything seems to be in blueprint though

#

really wanted to do this with code

#

but might have to switch

thin stratus
#

Moss's project shouldn't be Blueprints

#

Also BPs remove tons of online features

#

Such as your own keys for hosting (servername and such)

#

Or updating a running session

#

So stick with cpp if you are on it already

true peak
#

where is moss project?

thin stratus
#

Should be pinned too

#

Lemme check

#

Yeah it's the lowest

#

Maybe he has hosting etc in there

#

Other project would be ShooterGame

#

Though that's tough to dig through

true peak
#

ya lol i've been looking at the shooter game for a while

#

confusing as fuck

thin stratus
#

Yeah, the wiki is made from me digging through it for hours and stripping away all the unnecessary stuff. Anyway, phone dying soon. Should also sleep. Good luck buddy!

true peak
#

thanks, appreciate it!

twin juniper
obtuse zinc
#

So im trying to setup the simple example on page 23/24 of cedric's network compendium and when i add score everything is crashing

#

it happens right when I try to do TeamAScore++ or TeamBScore++

versed socket
#

Shoutouts to cedric_exi's Networking Compendium thing -- it's a gem and blows the official documentation out of the water.

native axle
#

Is it possible to possess a pawn that exists only on client-side?

versed socket
#

@native axle My understanding is that Pawns cannot exist client-side only, so I think the answer might be no. I could be wrong, though.

obtuse zinc
#

Yeah the network compendium is fucking god tier

balmy gazelle
pine sentinel
#

I cant download this compendium and I need this desperately.

#

"This site canโ€™t be reached

cedric.bnslv.de took too long to respond."

#

I need help understanding if its possible to make an "avatar" on spectator class pawn and be visual on server side (the spectator is on the client).

#

Did someone tried this before?

#

One yes/no would be enough for me, I want just to know if by design this is going to work.

brittle sinew
#

By avatar do you mean something that flies around in the world? Or just a UI representation of it

#

Becuase you can always override ASpectatorPawn and add your own functionality to it

pine sentinel
#

Something that flies around.

#

for example one cube

#

very simple

brittle sinew
#

Yeah, you shouldn't have much trouble implementing a mesh onto it, I'm not exactly sure how ASpectatorPawn is networked so you might have to do a decent amount of it on your own

#

I'm not at my computer to look at the source at the moment, but I'd just look at some of the spawning methods to see where they're spawned and things like that

pine sentinel
#

it gets spawned with the argument SpectatorOnly=1

#

btw I am not programmer, and I use mainly blueprints

#

I got the info about this agrument from here

#

the last answer

#

cd C:\Program Files\Epic Games\4.10\Engine\Binaries\Win64
UE4Editor.exe C:\Path\to\project\NetTest.uproject 10.0.0.5?SpectatorOnly=1 -game

#

this is how I get the spectator spawned

#

So I was thinking that this is not working because its just spectator (invisible pawn)

brittle sinew
#

Well, that's just a command line argument that tells the game to spawn a spectator pawn, I would look at how the actual spawning occurs

pine sentinel
#

mhm

brittle sinew
#

Spectator pawns are invisible by default yeah, but you can always make your own class ๐Ÿ˜›

pine sentinel
#

the problem is that I dont know how to spawn this new class the same way with the command line

#

as I said I am not a programmer XD

#

Is it possible to get the spectator pawn transformations from inside the server character pawn?

brittle sinew
#

Looking at the source now, it looks like the spectator pawn is only spawned locally, so you would have to do pretty much a rewrite of how the spectator pawn is created

pine sentinel
#

Something like a event dispatcher

brittle sinew
#

Which, unfortunately there really isn't a great way to do in BP

pine sentinel
#

ahh

#

hmm

#

ok, then I will do this as it should be done, spawning one char (vive) and another one which will be a normal character pawn.

#

I just liked a lot the command line thingy because I can debug stuff really fast like this

#

๐Ÿ˜ƒ

#

THanks for the info @brittle sinew

summer rivet
#

Player health, name, other important stuff for a networked game. Assume you want other players to have access to this info on demand. What would be the best place to store this for later? PlayerState or something else?

brittle sinew
#

IMO, you have to create a distiction between what's pawn information and non-pawn information

#

Like I would put health on the pawn, because it depends on the pawn currently being used by the player, but player name usually wouldn't depend on the current pawn

#

Though it may be easier to consolidate things onto the PlayerState, that's up to you

summer rivet
#

Gotcha

versed socket
#

@summer rivet PlayerState is what you want -- check out pages 25 thru 33 on that Networking Compendium thing the cedric_exi guy made. It's a gold mine of info like what you're asking about. It's the 3rd thing in the pinned list for this channel

summer rivet
#

Cool

summer rivet
#

oh no, the cedric networking guide is down. Abort Abort! Everyone to their shelters the world is going to end, we have no info! I repeat we have no info!

fierce birch
#

yeah, site is down :/

#

good thing we all made backups though

#

@thin stratus ^

wary willow
#

Someone give him money so he can turn on the lights again

fierce birch
#

he did get devgrant for it I think

#

(although it's no strings attached deal)

wary willow
#

Like I said before

#

9/10 devs who get those things blow it in the first few weeks

raven viper
#

Anybody has idea about direct mobile connection for online games?

wary willow
#

@raven viper define "direct"

#

You mean IP to IP ?

raven viper
#

More or less, yes.

wary willow
#

Does GooglePlay or AppStore allow that?

#

Actually, it might not even be an issue with them

#

(I don't do mobile dev)

raven viper
#

We are working on a mobile game, and cross-platform would be nice. But implementing a custom online subsystem with dedicated server instances and stuff would take a LOOONG time.

#

So we were thinking about an easier method, running the same game version on each platforms with direct connection to eachother. Works perfectly on local in mobile-mobile or pc-mobile but no idea about direct IP connections (or more like port restrictions)

#

Since it would be ideal if people could play against eachother even if they are not on the same local network ๐Ÿ˜„

tropic kiln
#

@thin stratus and @minimpoun I got a question you guys could probably answer. So I am trying to setup gun skins in my game, so I have a data table with all the different types of skins. When the player is in the menu and picks a skin, I have the skin ID (a three digit int32, example 001) get sent to the server and I take out X amount of credits from their account which is stored on my PHP server thanks to minim โค But sadly, I have yet another problem. When the player logs into the game I have a RPC that gets the skin ID from the server and sets it as the material override. But for some reason, whoever is the first to load into the game sets every ones skin as their skin. So if I load in first with skin ID 018, everyone loads in with skin 018 even if they don't have the gun skin 018 uses.... Not sure what I am doing wrong here, any help would be spot on!

#

wait, @minimpoun

#

what

wary willow
#

lol

#

Pretty sure I know what happened to him

brittle sinew
#

Hahahaha

wary willow
#

He is sleeping

fierce birch
#

well, he had that coming for a long time

#

he just didn't care

tropic kiln
#

He left didn't he? He was telling me he was thinking about leaving cause all the noobs where making him waste his time ๐Ÿ˜‚ Anyways, I can PM him later, anyone know what I might be doing wrong?

wary willow
#

You can PM him

thin stratus
#

We didn't ban him.

wary willow
#

No you didn't

fierce birch
#

you didn't?

wary willow
#

But somehow

#

You can't search for him on this server

#

BUT

#

I do see him

#

orange

fierce birch
#

just because someone knows something doesn't make it acceptable that one acts like he did

tropic kiln
#

He was a really good guy once you got to know him... He was just.... uhhh.... rough around the edges ๐Ÿ˜‚

thin stratus
#

He wad totally not nice in programming today

wary willow
#

Everyone is a good guy once you get to know him ๐Ÿ˜ƒ

thin stratus
#

/shrug

fierce birch
#

good? he practically made fun of every new person here and keps spamming memes to them, laughing at them

#

in my books, that's not ok

thin stratus
#

@tropic kiln cannot say what you do wrong as i don't know your code. Sorry

fierce birch
#

@thin stratus is your site permanently down?

thin stratus
#

@fierce birch is it offline?

fierce birch
#

yeah

#

timeout

thin stratus
#

Hm it will be off for quite a while, yes

#

It wa shosted on a friends server

tropic kiln
#

@fierce birch I can understand that, but he helped me learn by doing that. He made it clear he wasn't going to, as he puts it, "spoon feed" me. Once I realized he was helping me, I stopped trying to be defensive. He walked me through setting up my own server and creating a PHP database. Even walked me through setting up the slate code for my menu UI. Maybe he just liked me

#

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

thin stratus
#

There is an easy rule

fierce birch
#

@tropic kiln yeah, I still stick to my original point, even if you know stuff, you can't be a jerk to people

thin stratus
#

If you don't want to help, stay quiet

#

No one forces him to spoon feed people here or help them at all

wary willow
#

TBH, even people who don't know anything are jerks around here

#

As far as being spoonfed

#

I sadly have to agree to that

#

But, then again, everyone learns differently

#

Some people will actually learn something by being spoonfed, while others, can't/won't

#

Mentorship is the best way to learn something imho

tropic kiln
#

Yeah, but you could argue that if he had stayed quiet he wouldn't have helped me. Not trying to say what he did was okay, but I do have to defend him a little, cause he helped me a lot. And I know I am not the only one, he has helped a lot of people, he just does it in PMs. And I agree Victor, everyone is different. Some people don't learn the way he teaches. Nothing wrong with that

wary willow
#

Some people can learn a lot from tutorials, but others just watch them and are like zombies

#

Copy pasting stuff and then they come on here and cry about not understanding or the tutorial not working

#

The underlying issue is the "understanding" part

#

That and never wanting to use Google...

tropic kiln
#

When I would ask him how to do something he wouldn't tell me, his idea of teaching was telling someone how it works and then them figuring it out. He would tell me if he just told me how to do it I wouldn't learn how it works

wary willow
#

which is what a lot of people will do

fierce birch
#

I don't say the way he helped people here was bad, I'm only complaining of his attitude agains people who didn't know much to begin with and making fun of those people

#

he is a bully

tropic kiln
#

fair enough, and I do agree with that.

#

But like I said earlier, the reason he helped me was because I didn't get mad at his "bullying"

wary willow
#

Yeah see

#

We all come from different walks of life ยฏ_(ใƒ„)_/ยฏ

#

Everyone's views on things are going to be "skewed" depending on their own life experiences.

#

Also, not many people on here have a sense of humor IMHO

tropic kiln
#

I have noticed that...

wary willow
#

Which boggles my mind

#

I think it must be my good looks that get me all the bad attention

#

@stiff wasp can't compete with this smile

tropic kiln
#

Who was the guy minimpoun was always hanging around? Koko or kroko something like that, he seems really nice/helpful. Which is kind of funny seeing how oppositeminimpoun is

stiff wasp
#

you rang?

wary willow
#

@severe widget

stiff wasp
#

koko?

#

K

#

@severe widget new nick name

fierce birch
#

@stiff wasp just read few pages up and you'll be on the same page

stiff wasp
#

@tropic kiln if I had to guess on what you did wrong, you are probably setting the skin ID as the default. Remember, I told you NOT to do that. Just a guess

#

I really don't care enough @fierce birch

#

I can probably guess

fierce birch
#

yeah, I've noticed

stiff wasp
#

It doesn't take a genius to notice

fierce birch
#

I still wonder why mods tolerate your behavior here, I'd kicked you out months ago

tropic kiln
#

@stiff wasp default as in the material override?

stiff wasp
#

Maybe they have a sense of humor unlike someone with a 0 in their name

#

and yeah @tropic kiln

tropic kiln
#

hmm

stiff wasp
#

wait, it could also be where you are getting the data table row name.

#

I don't think you setup that function

#

unless you did it while I was offline

tropic kiln
#

I am just getting it and setting it

stiff wasp
#

as in?

tropic kiln
#

like I am getting the row name and setting the material directly

stiff wasp
#

oh

#

ohhh

#

why

tropic kiln
#

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

stiff wasp
#

ugh

#

hang on

#

sent it to you @tropic kiln

dawn glen
#

having an issue i dont understand. I have a UI that is popping up on all the clients screens for some reason i cant seem to see.

This is my Tick event to run a trace which is run on client only (will never be a listen server always dedicated) http://prntscr.com/e742jr

Lightshot

Captured with Lightshot

thin stratus
#

@fierce birch It's not like we tolerate it. We simply check if it's a general behavior or just a bad day. Also, as we are multiple mods, we like to discuss things first. I don't like removing people right away.

#

@dawn glen hard to tell

#

Only thing i see is that you might want to set the curmount on the client too

dawn glen
#

it should be replicated from server

#

should it not?

thin stratus
#

Correct

#

But in addition letting the client set it so he doesn't wait for the replication

#

Your ui gets only added if the variable is valid aka replicated correctly

dawn glen
#

i can do that and drop the isvalid

#

but the ui pops up on both players in a 2 player dedicated server PIE

thin stratus
#

This causes delays for the local client if the ping is a bit higher

#

Yeah that's another thing

dawn glen
#

ive made tons of changes and cant figure it out

thin stratus
#

Not really seeing why yet

#

Is that variable repnotify or so?

dawn glen
#

the currMount? no

thin stratus
#

Is the UI popping up if you disconnect the add to viewport node

dawn glen
#

made teh curmount change so it sets server and client

thin stratus
#

?

#

(just to check you don't call it somewhere else by accident)

dawn glen
#

it isnt displaying

#

i turned currMount replication off

#

still both players get UI

thin stratus
#

Don't directly have to turn the replication off if the server should still hold authority about it. Setting it on the local client is just lag prevention

dawn glen
#

i use this same code on chests

thin stratus
#

Hmm both get it... Character. Tick. Remote. LineTrace. When hit spawning UI for each hit on that remote client. Hm

dawn glen
#

and the chests show only the right player the ui lol

thin stratus
#

Really? Weird

dawn glen
#

yea

wary willow
#

You dun sumting wrung bro

dawn glen
#

obviously, cant see what though, it eludes me, sorry i have to go back to work, be back in 5 hours

wary willow
#

@dawn glen That is the whole logic for it that you shared?

thin stratus
#

Then I'll sleep though. Just compare both functions.

#

Maybe the widget itself is doing something weird

wary willow
#

I noticed that textrender don't update on begin play

#

unless you had a delay on it

#

even a 0.0 delay

#

It was the strangest bug (I was getting score from Playerstate)

thin stratus
#

Don't see the connection

#

Or just random fact stating @wary willow?

wary willow
#

Yeah, you just never know

thin stratus
#

Sometimes engine is weird. Always woth digging into the source code to see what's causing it

#

Had a problem with the combobox where setting it in its own "onset" call was getting overridden by the previous selection

#

Cause cpp code was calling the BP event first and then set it. Sent a PR to fix it

#

/shrug

dawn glen
#

@wary willow it is

#

I'm going to redo it all as a function after work and try to streamline it a bit

wide hamlet
#

@thin stratus Is your site down? ๐Ÿ˜ƒ

wide hamlet
#

@fierce birch Ah, good to know.

thin stratus
#

Yes, sorry

#

Friends server went down and I forgot about it as I'm not home atm

#

Lemme pin that:

#

Cedric.bnslv.de is offline. Example projects as well as the Multiplayer Compendium will be available soon under a new domain.
If you need the PDF, try to ask around a bit as a lot of people already downloaded it.

wide hamlet
#

You could just drop the PDF on Google Drive and copy a public link from it there. ๐Ÿ˜ƒ

summer rivet
#

ok so maybe I've been approaching learning this the wrong way. For Networking in UE4 is there alot of "I did something on the client, so I need to tell the server what I did" then the server "I was told somebody did something, let me make sure it's ok and then update my local copy of that with this info" and then "everyone else who should know about this change needs to be notified of this, so let me tell them"

brittle sinew
#

Well, if you're already multicasting to other clients, multicast covers the owning client as well

#

So you wouldn't need to directly send a client RPC back in that situation, unless there's a differentiation in what type of data is transferred

#

But otherwise, that flow looks generally fine

summer rivet
#

well in the case of a variable changing, lets say the client changes his name to bob because why the hell not.

#

I would tell the server the client did/wants to do this, the server does the change locally, and then it tells everyone else about the change (assuming they need to know and it's not just a replicated var)

#

sound about right?

dawn glen
#

you need the right RPCs

#

but yea

brittle sinew
#

Well, in that situation you should really consider making it a replicated variable

summer rivet
#

yeah have been having some interesting conversations about how this seems like way too much crap to do but it seems like its correct

brittle sinew
#

Simplfies a lot of the back and forth, you just have to call up to the server to do the change and it gets sent out automatically

summer rivet
#

yeah @brittle sinew I was being a little generic to try and keep the flow generic

wary willow
#

@summer rivet So I am assuming your next big series is on Networking?

#

Or did Epic ask you to fix up what they did wrong?

summer rivet
#

but in the case of what I was having the issue with earlier; Text Renderer on the character. I change the Text property on the Text Renderer and then I need to tell the server about the change and then multicast that change event as well since Component replication did not seem to propagate that change as expected

#

yeah my next big big is networking. been spending the last few stream with viewers hammering our heads into the desks trying to learn it lol

wary willow
#

right so

#

There is a bug with Text Renderer

#

Depends on when you are calling that event though

#

@brittle sinew Just because a variable is replicated, doesn't mean that everyone will see the change?

summer rivet
#

well it worked fine when I multicast the event to change the text. We just assumed changing the Text property on the Text Renderer Component and having it replicated should have worked but it did not heh

brittle sinew
#

If the actor itself is replicated, I believe it will?

summer rivet
#

yeah theres some definitely "do it the right way or shit don't work" when it comes to networking

brittle sinew
#

As long as you're changing it on the server

wary willow
#

Right

#

And you shouldn't multicast everything @summer rivet

summer rivet
#

yeah I just have to do more research to test it on components

brittle sinew
#

So what do you mean? AFAIK replicated variables will at least eventually change everywhere @wary willow

wary willow
#

You shouldn't just let the clients know everything about replicated variables is what I am trying to say I guess

summer rivet
#

yeah replicating vars seemed ok so far if I did it right, and oh boy did I keep forgetting to call those nodes on the server lol...

wary willow
#

And it should only be modified by the Server

brittle sinew
#

Well I meant when you said just because it's replicated doesn't mean that everyone will see it, unless you're saying that not everything should be replicated

wary willow
#

Well that too

#

Not everything should or needs to be

summer rivet
#

oh yeah for sure

#

just understanding the flow of when things should be and how to do it is the kick in the balls right now

wary willow
#

Yup and unless you're god's gift to earth, you'll be still crying months later

#

(even years?)

#

maybe not years

summer rivet
#

oh I know. I've remade the same project 3 times? maybe 4 times, just learning all the ways to get info passed around and I still forget half the things I have to do after just doing it a day before

#

the flow is just so damned weird to me right now

wary willow
#

Also, make sure @thin stratus has an advance copy of the tutorials lol

#

I think the biggest challenge (still is) is how one player is the listen server

#

trips me up quite a bit

#

Using Is Local Controller and the like is like whoa

thin stratus
#

@wide hamlet I'm a still not home. The file was on the server and is only on my local drive at home. Would need someone else to pass it to me but also only on phone atm so i rather to that all once I'm back

arctic egret
#

about this replication business, if I've got a board game and the board along with the pieces that concern both players are represented with widgets, will I have trouble replicating those parts?

summer rivet
#

widgets dont seem to be too much of an issue, the command to do X with widget can just be replicated so everyone sees the action

arctic egret
#

ok sweet thanks

native axle
dawn glen
#

OnRep is called on clients only right? anything i run in that will not run on server im assuming?

#

docs seem to say it will run on server as well. i cant get an auth node in the function though it seems

dawn glen
#

im using blueprints for this particular issue im having. i set a boolean on server with rep notify and when that boolean is true it updates an aspect of the ui. Im getting an assertion error i dont understand and im thinking its the server trying to do the ui function in the rep notify with a null pointer. if this is completely wrong then i need to look elsewhere but from what i can see the UI reference is being set on the clients but when it tries to update it gets the error and the variable is blank. The engine is giving me an issue where it wont let me select dedicated server or clients since the clients list is empty and all the instances of this BP on client and server are all mixed up under the dedicated server section and they all are saying client on the bp window...

#

just did an isvalid? and assume if its not valid its the server i guess. works for now.

wary willow
#

context sensitive?

dawn glen
#

maybe because its a component? it works fine in other BPs but this is a component added to the player

#

wont show anywhere in graph on this component

wary willow
#

?

#

I see it in a comp

#

I use it in a com

#

comp

#

Like I said

dawn glen
#

wierd...

wary willow
#

Not really

#

Like I said, uncheck context sensitivity

dawn glen
#

i did

#

i can get a function with a bool but not the auth node

wary willow
#

...

#

That's the one you need

#

๐Ÿ˜ƒ

#

Just use a branch

#

create a macro if you need one

dawn glen
wary willow
#

double click in it

dawn glen
#

oh i see

#

its a macro that is premade in the ACharacter... i thought it was default engine node

#

sorry AActor

#

it wont take self so i assume i have to check its parent?

wary willow
#

huh?

#

You ever use a component before?

#

You gotta Get Owner ๐Ÿ˜ƒ

dawn glen
#

first time

wary willow
#

Hmm

#

I guess that's really not much to them

dawn glen
#

thanks for that

wary willow
#

But, anyway, Get Owner is what you need

#

But if you have time, do some research into them

dawn glen
#

i thought they were just actors that were attached to other actors. guess i read wrong

#

this multiplayer UI issue im having is gonna kill me though. I moved the Use UI into a function and the use on my chests works fine but on the airship it shows to all players. I dont get it. i redid the whole thing.

wary willow
#

Can you explain what you want to happen from start to finish?

#

Use paragraphs if it gets too long ๐Ÿ˜ƒ

#

Or pictures ๐Ÿ˜ƒ

dawn glen
#

i will use pictures. i failed grammar lol. gimme a few to put it all together

#

so on tick the function is called on client that runs a trace http://prntscr.com/e78w16

That trace checks for other pawns and chests then loops through them and sends them one at a time to the display ui function http://prntscr.com/e78w5z

The Display UI checks the tag name to decide how to spawn the UI http://prntscr.com/e78wju

If its a chest it sets a reference variable on server and client, checks if a use widget is already open and if it isnt creates one with info passed to the Widget Then breaks the loop so no more traces are done http://prntscr.com/e78wop

If its a mount it makes sure its "Walking" aka not in flying mode, sets the reference to the mount on server and client, checks if a use widget is already open and if not creates the widget with basic info passed on then breaks the loop to stop more traces http://prntscr.com/e78x29

Lightshot

Captured with Lightshot

Lightshot

Captured with Lightshot

Lightshot

Captured with Lightshot

Lightshot

Captured with Lightshot

Lightshot

Captured with Lightshot

#

When it traces a chest it shows the UI on the player tracing the chest only as expected

#

but when it traces a mount it displays the UI on every player on the server

#

and it isnt supposed to

silk snow
thin stratus
#

@dawn glen you still have that issue?

#

@dawn glen can, just for sanity check , change the widget class in the mount logic to the chest ui?

#

I just wanna know if the widget is the bad guy here

fierce birch
#

hmmm

#

I'm wondering about network relevancy, by design it's distance based but I'd really need something that more working in the line of sight

#

so I'm guessing this means server has to solve relevancy with my own code instead of using any of the unreals own code for this?

#

I'm now thinking of a straight on a racetrack where you need to see all cars in the straight (which can be long) but you don't have to see past the corners on both ends

#

for example, you can think the track is shapes like a square, so distance check wouldn't really work

#

I guess I could do overlapping trigger volumes that server could just use to determine which clients pawns should be able to see eachothers and only update them accordingly

dawn glen
#

@sedric@thin stratus its the same widget for both. i just call it with diferent info plugged in for name desc and instructions

fierce birch
#

Hmmm.. I guess I could just use distance at spline too.. Anyway just curious if there's nothing but distance check built in

thin stratus
#

@fierce birch Override the IsNetRelevantFor function

#

And add your view trace check

#

@dawn glen I srsly have no idea :O

#

Oh wait

#

I do maybe

#

This is running on tick on a character

#

Means it runs on all clients

#

Try this: In addition to the SwitchHasAuthority check , try to add a branch with something like "IsLocallyControlled"

#

Or simply use an is valid check on "GetController"

#

Cause this is null on all but local client and server

#

You want it to only happen on the Character of that one local client. Your current setup calls it on all instances that are on the other clients too. It's only filtering the server

#

No idea why that doesn't happen on the Chest thing though

fierce birch
#

@thin stratus oh, that sounds good

#

Just started with with ue4 networking a week ago, still figuring out things

rain coral
#

hey. my movement is only replicated from server to clients (server doesn't see clients moving, clients only see server moving). tutorials everywhere says that it's enough to check off the 'replicated' and 'replicate movement' checkbox, but that only makes it the way it is now

#

am I missing something?

fierce birch
#

is ue4 replication only received/sent during Tick?

#

or actually, real question is, do I need to use sockets instead if I want to fire off (and receive) data from a separate thread?

#

I'd rather have network packets sending + receiving done at fixed interval on separate thread instead of doing it on gamethread (where everything is tied to your framerate)

wary willow
#

@fierce birch Isn't that what Net Update Freq is for?

#

And/or conditions

fierce birch
#

I haven't checked the engine code yet but almost everything related to game logic is run in single thread

#

there's no new data until next tick usually

#

so it would make sense for ue4 to deal the replication there as well

wary willow
#

Aye, (the new audio "engine" is on its separate thread now though?)

#

not related but, wondering

fierce birch
#

yeah, I'm going to multithread my physics and input, I don't want to leave networking behind after all that trouble

wary willow
#

ah

#

check this out

fierce birch
#

I just doubt any docs cover things what I'm facing now

wary willow
heady delta
#

Ahh multithreading

fierce birch
#

yeah, I'm aware of the update frequency setting

#

but I suspect it only works that 100Hz which it's been set by default only if the game ticks that speed

wary willow
#

I'm almost positive not

#

Not everyone is going to reach 100hz

fierce birch
#

it could be more of a clamp in case someone can play the game faster than that

#

I'm just guessing since I haven't touched the engine code for networking + havent actually examined the traffic yet

wary willow
#

Some good tidbits there too

#

I wonder if anyone's used the Adaptive NUF

fierce birch
#

NetUpdateFrequency indicates the maximum number of times per second that the Actor will attempt to update itself

#

that really sounds like it's just for clamping

heady delta
#

@fierce birch why do you need it to update so much

fierce birch
#

I don't

#

I need to update at fixed intervals

wary willow
#

You want to put it in a separate thread?

heady delta
#

O

fierce birch
#

doing it on tick will mess up the physics

wary willow
#

You can update on fixed

fierce birch
#

I don't want to lock the rendering

heady delta
#

You could try messing with the physxerrorcorrection stuff

fierce birch
#

oh, I don't worry about physx now

#

I have physics sim aspect pretty much figured out

#

if I do things UE4 way in single thread, I may end up having various number of physics steps between tick on client and they are not same amount as with other clients/server

#

and I still get input only from tick (by default)

#

I can work that out, figure which physics steps had which input on clients by buffering them on servers end

#

but that'll mean additional delay before I can send the data to other clients/corrections

#

having everything going at fixed intervals would stabilize the system and require smaller delay from servers end

dawn glen
#

@thin stratus do I have an engine bug then?

hollow quartz
#

Whats up with the authority of newly created player characters? I am seeing that the server still has authority over them when BeginPlay and PostLogin are called:

https://gyazo.com/56284d9d4d1d776b90a4a03fb0658335

Prints:

Server: I have authority over:PlayerCharacterBP
Server: I have authority over:PlayerCharacterBP1
#

Single process multiplayer is disabled, and the second print comes when the second client connects. It also prints its own I have authority over:PlayerCharacterBP1 but it seems the server thinks it has authority too at the start. Can someone clarify for me? When can I safely do client-side initialization of the character?

brittle sinew
#

Does the server not have authority over the character after the start?

#

I believe the macro lumps autonomous proxy in with authority, though I could be wrong

#

Either way, I think the server should always have authority, but at the hand of the proxy the client does as well

hollow quartz
#

Seems like I should be using IsLocallyControlled, not sure though

#

I thought the client had authority over its character?

brittle sinew
#

Yes, it does, through an autonomous proxy only

#

The server still holds authority always though, at least I believe

hollow quartz
#

With the exception being actors spawned by the client?

brittle sinew
#

Well yeah, if it's not replicated then whoever spawns it has control over it

#

Hmm, it doesn't look like HasAuthority should return true on a proxy, I'm not quite sure why it would say it does have authority on the client

#

If it's spawned on the server

hollow quartz
#

Do actor components have a NetCullDistanceSquared equivalent? Or are they always replicated if the actor is replicated (and the component has replication enabled)?

thin stratus
#

@dawn glen no?

#

Did you do what i suggested?

wise depot
#

Hey, have any of you guys played around with dedicated servers for android games? or can point me in the direction of where I can look up how that all works with google playservices?

wary willow
#

so someone tried it weeks ago. Search for it on here @wise depot

wise depot
#

do you know which channel?

#

i can't find anything searching for "android" in here

dawn glen
#

@thin stratus sorry i seen where you said you had no idea and didnt notice you said more. its strange because it should only be running on the client that actually gets a successful trace on the airship. The chest trace is handled in the same function as the airship.

I tried the isvalid and that didnt work, it still shows on both clients but the locally controlled branch seems to be stopping it form going to other clients.

Just makes no sense to me that the engine sends a trace and if it hits a chest it calls DisplayUseUI on that client only. that function if its a chest shows the exact same ui for the chest as the airship, if it traces nothing it should terminate in about 4 different places long before it ever displays the airship UI.

thin stratus
#

Well that's because you don't understand what is happening

#

ClientA and B have a Pawn/Character, right?

#

Both of these are replicated and exist on each other

#
  • the Server
#

Means in a Setup of Server and two Clients we have 3 instances of client As pawn and 3 instances of client Bs pawn

#

Let's concentrate on client As pawn

#

You filter with Switch Has Authority

#

That calls Remote for the Pawn on Client As game and the replicated copy on client Bs game

#

(not on client Bs pawn!)

#

That means the trace fires two times

#

The trace IS hitting twice as the replicated pawn of ClientA in the Game of clientB is also looking at the mount

#

Using locally controlled makes sure the replicated copy of PawnA in client Bs game is also getting filtered

#

@dawn glen

dawn glen
#

ok, so if player A traces the airship it runs the Trace code on all clients not just his own

#

then why does the chest not do the same?

thin stratus
#

That is something i don't know

#

But you could simply print the displayname of the pawn the trace happens in

#

And see if it traces one or two times

dawn glen
#

so anything i do with UI i need to check if locally controlled

thin stratus
#

Technically yes

dawn glen
#

that is SOP

thin stratus
#

You wouldn't need to if it was in the PlayerController

#

As that one only exists on Server and owning client

#

But then again that's no reason to move logic to it which should go into the pawn

dawn glen
#

just seems wierd if it creates the widget on the player controller and pawn b doesnt have one in pawn a's client yet it somehow is valid and displays the ui on pawn b

#

not only that but sends the ui somehow from client to client

thin stratus
#

Why wouldn't it? The you never did GetController

#

It's not sending from client to client

#

The whole trace etc happens on the clientB too

dawn glen
#

i get controller 0

thin stratus
#

Yeah but that's a local call

dawn glen
#

and when client b traces it should trace from his location forward where there is no airship

thin stratus
#

No

#

Get into the mindset that it's not client bs pawn

#

It's the replicated clone of client as pawn

dawn glen
#

so should i check locally controlled all the way back at the start so that the traces arent happening on 100 clients later on if i have that many?

thin stratus
#

Correct

dawn glen
#

wow, i knew that other players in my client were replicated pawns but i didnt think their code ran on my client also unless that was sent to the server and back to me....

#

so since ALL my stuff is supposed to be on the client's own pawn i need to check locally controlled at the start of everything to save processing.... right down to updating the stats in the main hud...

#

and instead of Has Auth should i be using a branch with isDedicatedServer instead?

thin stratus
#

Hm no, authority just checks if you are on the server or client version of it

#

Authority calls for ListenServer and DedicatedServer

dawn glen
#

i wont be allowing listen servers

thin stratus
#

The it doesn't really matter

#

The code will never execute on the server as long as you use remote

#

After remote you just need to further filter the other clients

dawn glen
#

ok, it sort of makes sense, thanks Exi. i will have to divide my stuff up between what i want to run only on my client owned pawn and what i want to allow run on replicated pawns on my client. I suppose its done this way to avoid lag?

thin stratus
#

No it's just that each pawn or actor in general calls the event tick

#

Doesn't directly have something to do with replication

dawn glen
#

so maybe i should move my stuff off tick and onto a timer

wary willow
#

Timers are OP

thin stratus
#

Well you would start the timer with what?

wary willow
#

But it might not solve your issue

thin stratus
#

:P BeginPlay?

dawn glen
#

from begin play

wary willow
#

You might have some logic bug

thin stratus
#

@dawn glen Surprise, guess what each Actor calls

wary willow
#

๐ŸŽ

thin stratus
#

You don't get around filtering the call with locally controlled

dawn glen
#

i guess when a player comes into replication range on my client it will run begin play... damnit

wary willow
#

?

dawn glen
#

ok, i gotcha

thin stratus
#

Just use the branch with locally controlled

#

It's totally normal

dawn glen
#

i didnt see that in any tutorials i watched

#

good to know

wary willow
#

yeah sadly

thin stratus
#

My compendium has that in it i think

#

But it's offline atm

wary willow
#

Maybe, but no one really reads that whoel thing ๐Ÿ˜‰

thin stratus
#

-_-

wary willow
#

they skim

thin stratus
#

@wary willowpssr

wary willow
#

You need more pictures

#

๐Ÿ˜ƒ

rain coral
#

oh, that's your compendium. read over half of it today

wary willow
#

You gotta read it all

dawn glen
#

honestly.... i skimmed it... stopped where there was something new to me but this was likely under a header i thought i knew everything about lol

wary willow
#

Or I win

#

Yeah, it's not really meant to be read from start to finish

#

Or if that's the intention, then...

thin stratus
#

Well it's technically not "new"

#

Pawns that are replicated and spawned by the server

#

Get created on everyone

dawn glen
#

i know its not new

#

but new to me stuff

#

is all i stopped to read

thin stratus
#

After that they naturally call begin play, tick, end play etc

dawn glen
#

have to read it more thoroughly

wary willow
#

@thin stratus In Comp2.0 can you have a quiz at the end of each section?

thin stratus
#

Sure (:

wary willow
#

You teach right?

thin stratus
#

Ehm

wary willow
#

So you should know

dawn glen
#

make ue4 networking only work if you get a success code from it lol

wary willow
#

What gets "student's" attention"

dawn glen
#

so people have to pass to use networking

thin stratus
#

Students attention

#

You never get that

#

Good luck

dawn glen
#

i kid

wary willow
#

lo

thin stratus
#

I will think about it

#

Won't be any 2.0 in awhile though

#

Busy with projects and freelancing

rain coral
#

quick question: the server won't read the player's input axis values, they are always 0 on the server. how is that supposed to be done?

thin stratus
#

Woot

#

Input is local

#

You RPC it over to the server

#

Pass it with a float input

#

Shouldn't be hard (:

rain coral
#

aah, let me try

thin stratus
#

Anyway, off to bed

#

o7

rain coral
#

(it worked, thanks and GN)

heady delta
#

Bit of a design question I'm tackling here. At the moment, things like attaching a weapon to a player, or attaching a player to a seat is handled by a multicast to let alll current clients perform the event, and a rep notify to let players know if they connect after the event. Is this the way to do things? I was considering changing it so that a newly connected player receives a reliable RPC with all the information they need to know when they first connect instead of leaving it to individual rep notifies

spring oxide
#

if your weapons are actors i'm pretty sure attachments are networked by default

#

what i did though is override SetOwner to attach to the new owner if there is one and detach from the old one. there's an onrep for the owner you can also override for client side

dawn glen
#

Anyone have any idea why this might be happening? https://youtu.be/peeHP1veW9A

when a player hits F it triggers a trace and checks if its a instanced foliage mesh component. it then loops through an array of structs and checks against mesh http://prntscr.com/e7o4v2

When it finds a match it stops the loop and sends the needed information to the server. The server then executes a multicast event to remove the instance of the foliage. This is working it seems as intended. I get one print for the server and one per client saying Foliage Removed. Then on the server it spawns the actor which only atm has a destructable mesh on it. After a couple seconds (for testing), it applies a force and breaks.
http://prntscr.com/e7o5j6
http://prntscr.com/e7o3zi

The wierd issue is that if on dedicated server the actor flashes wierd and the mesh destructs wierd (sometimes the debris flys around like being caught in a dust devil). If i run as listen server and client the server sees it how it should look and the client gets the wierd flashing actor and destruct. This is set up for a rock and a tree type. The trees are working 100%. They remove the instance, tree falls and after 15 seconds is destroyed. The rock uses the exact same setup but doesnt work right on clients.

Lightshot

Captured with Lightshot

Lightshot

Captured with Lightshot

Lightshot

Captured with Lightshot

true peak
#

do you still need to download steam sdk and move dll's into unreal in 4.13? or does enabling the steam plugin do that

thin stratus
#

@true peak Try it :P

nocturne hedge
#

AdvancedIdentityLog:Warning: GetUserAccount Failed to get the account!

#

any ideas?

thin stratus
#

@dawn glen First thing is: I assume that StoneBP is replicated?

#

That calls BeginPlay on every version of it

#

So there is no need to use a server rpc and then a multicast

#

You can do directly hook up the logic of explode with beginplan

#

The other thing is: The actor you spawn when you found the correct staticmesh. I would make it non replicated and spawn it inside the multicast when you remove the instance of the mesh. That makes sure that the mesh is remove at the same time that the actor is spawned. Otherwise you spawn the actor inside of the stone which might cause z fighting

#

Everyone would spawn their own local tree/stone and simulate the destruction themselves. After all it's a visual feature. Nothing that the server needs authority over

dull tapir
#

Hey everyone, I'm fairly confident when it comes to using blueprints in UE4, however I am still lacking when it comes to multiplayer. I've done quite a bit of research already but I still don't quite fully understand it. Is anyone here willing to mentor me for a bit and maybe provide some examples so that I can understand it a bit better?

thin stratus
#

Have you read my compendium?

#

I'm not in reach of it as my server is off and I'm not home but maybe someone can upload it here agaib

dull tapir
#

I have not. Would be grateful if someone could post it here ๐Ÿ˜ƒ

#

Looking at the pinned posts if anyone has the example projects as well that would be great!

fierce birch
#

<deleted the link as he has the site up again>

#

@dull tapir ^

dull tapir
#

Thanks

thin stratus
#

All fine, thanks mate

#

Will change it once I got my server up

dawn glen
#

@thin stratus i tried multicasting it in that first. I want the object to be multicast because eventually it will have values like how much stone or wood in in it. How much it left of multiple players hit it.

#

when i multicast spawn it did same thing, if i shut off replicated would it still work? just run replicated variables instead?

#

when i do it this way also when a new client connects the old foliage is back on his client which it shouldnt be and it gives a ghost collision. He gets stalled on it like it collides then server says you didnt collide and he jumps to the other side.

dawn glen
#

maybe i will just use actors for harvestable nodes

spring oxide
#

if you don't want to use actors you'll have to push a full update to the player when they join

hollow quartz
#

Anyone know whats required to use the tear off functionality? I want an actor to replicate once and then become owned by each client. bTearOff seems to be related but not sure how it should be used

native moth
#

Can anyone help me out here, it seems like there might be some networking stuff going on. I have a level with some placed blueprint actors. When i preview the level with my editor, no problem. When I launch the level with my menu system(using a simple Load Level node) my placed actor double spawns. 1 copy that works, and one that doesnt

#

ive tried ticking off replication everywhere

#

no luck

native axle
#

@native moth Go to play settings, untick "auto-connect to server"

versed socket
#

Stupid question: I'm trying to figure out how the pattern for handling win conditions work. My current idea is to start with the obvious, that the GM, after figuring out the win condition is satisfied, multicasts an event on the GS and then both clients & server each react however they need to. Is there a better way of going about it or am I trying to reinvent the whell here?

thin stratus
#

@versed socket hm sounds fine

#

There is a gamestate system in place but that's more for engine intern handling

#

Afaik

verbal slate
#

Can anyone help me out with simple respawn system for multiplayer game in C++?

#

I currently use something like this

#

AMinigolfBall* OldMinigolfBall = Cast<AMinigolfBall>(GetPawn());

if (OldMinigolfBall != NULL)
    OldMinigolfBall->Destroy();

GetWorld()->GetAuthGameMode()->RestartPlayer(this);