#multiplayer

1 messages ยท Page 328 of 1

sweet spire
#

did i type log wrong?

#

or am i lacking brain cells or what because the log window wont pop up

#

NVM

#

figured it out omg

#

the shame

hasty adder
#

Oh your doing this in editor lol

sweet spire
#

forgot to uncheck use single process oops

#

i wonder if u can filter the log ;o

sweet spire
#

is there not away to stop clients auto connecting when ur not using single process mode?

hasty adder
#

What are you testing?

#

You can simulate

#

And the posses

#

Working at a help desk I find it's always best to know what someone is trying to accomplish before going down a rabbit hole to assist as sometimes they are asking the wrong question ๐Ÿ˜‰

sweet spire
#

Sorry haha

#

Im just testing having two servers running

#

MAP_1 and the other on MAP_2

#

being able to join MAP_1 from lobby level

#

and transition between MAP_1 and MAP_2

#

Apologise for slow reply ^^

#

some reason when im booting up though im automatically connecting to the sever hmm

#

I think ima just have to package them as dedicated servers i dont think i can test it out the editor haha

orchid cairn
#

you cant change maps when you PIE, need to test as standalone for that

sweet spire
#

Running two dedicated servers seams to not be happening haha

#

Unless im doing it wrong

hasty adder
#

You trying to use a non source version and run them? Like still trying to figure out the overall concept here for testing this

sweet spire
#

Yeah

#

Thats the nail on the head

#

Im updating my source version as we speak from git

hasty adder
#

trying to lobby from one but use another for game?

sweet spire
#

Yeah kinda

#

its really just the concept

#

of traveling from 1 server to another

#

Im just intrested to test it my self, and see what its like,and then see how my server machine takes some stupid load

hasty adder
#

Ah

sweet spire
#

Iv got a dual Xeon 2670 with ugh

#

i think its just over 1tb of ram

#

in it

#

So im just setting up some dynamic logic

#

and i want too see how far i can push it

hasty adder
#

Dedicated servers are pretty light like gig ram

sweet spire
#

Yeah true

#

But you can only have 1 map running at same time right?

#

So a intresting work around for say something that uses instances for example

#

would be having a master server control and launch maps by starting up another server with the required map

#

It would be really intresting too see what u could do

#

Even have the dynamic server index and boot up maps when needed

#

and even control Server core assignment and priority depending on the maps server load

hasty adder
#

So one player can be on one level and another on another?

sweet spire
#

Im really just pushing and testing too see what can be done

#

Yeah pretty much

#

There not in the same world, but there in the same cluster

#

if u get me

#

Its really just testinh things and pushing stuff too its limit, i think im also going to use this and write a small article on it for my college exam & post it on the ue4 for people to know about

#

Iv got a feeling the bottle neck is most likely going to end up being ram speed

#

Moving so much information around

#

the nice thing is though if its all on a local machine or cluster, if the database u store information on for example is on the same machine/cluster

#

Retriving and saving data would be very fast

#

Currently the OS runs on raid speed setup

#

Then the basic storage and database runs on raid backup

#

and then the storage from where servers launch run on m.2 drive

#

sorry if im getting carried away haha

#

Iv just super curious to test this for ages and see where the limits come in

#

I feel like as well, if u split the servers up in to chunks the processing power would be WAY better than just 1 big map for example

#

Because of threading limit issues right?

#

np with xeon 8 core x2

#

lower load on each server.exe tends to be better than huge single thread load on one

#

But this is all speculation until i actually try it haha

#

intresting though right? ๐Ÿ˜„

hasty adder
#

Yeah more then I ever design for

#

I'm a small scale party game kinda guy

sweet spire
#

Well i mean it might be a super cheap ef way to handle it

#

It could be used on tiny scale or hugw

hasty adder
#

I wonder tho a lot of overhead in games comes on a local scale unless there's a billion objects to replicate and cull

sweet spire
#

If it works il happily hand it out least i can do

hasty adder
#

It's all transforms numbers crunching

sweet spire
#

As alot of people help me in here

#

Hmm

#

Good point

hasty adder
#

Main cpu gpu use is local to render stuff

#

I just gotta figure out the right way to get this ball to move from local to interopt with servers version in an acceptable rate

sweet spire
#

true true

#

luckily for me, i have setup my project so i bearly have to replicate animation

hasty adder
#

Almost like it should only fire the interopt when it's interacted with and go with the simulation till an event

sweet spire
#

its all handled on the client side

#

yeah makes sense

hasty adder
#

Sports games man

#

Simple concept complicated execution

sweet spire
#

yeah haha

#

well

#

think of it this way

#

u only need to replicate the first point really

#

let the interp do the rest of the work to point 2

#

to some degree

hasty adder
#

Yeah that's what I'm thinking

sweet spire
#

heres an example i guess

#

Say your running and kicking ur ball

#

and u kick ur ball to ur mate

hasty adder
#

Everything works good other then feeling the jnitial lag of interaction

sweet spire
#

then u keep running

#

and your char decided to slow down and u have a slow down animation

#

like the client handle it

#

when the server updates velocity of there char

#

the client can say

#

Okay this pawn is slowing down

#

Lets start blending the foot break animation in

#

not the best example but u get me

hasty adder
#

Yeah

sweet spire
#

no need to realyl say

#

lets replicate this animation over!

#

who cares if the breaking animation is 0.2 out of sync?

#

it a int important

#

is is not*

#

Im no expert though, so dont listen to me LOL

hasty adder
#

Yeah mine is positikn really since all I'm doing is changing velocity of an object and it's simulating the rest

sweet spire
#

i cant really advise you too mush though as i dont use root motion

#

and i RARELY use animation bp

hasty adder
#

So at impact and for a second after it has a point things could be misaligned

sweet spire
#

i handle all my animation with a custom system

hasty adder
#

This isn't even animation it's a non animating actor that is simulating physics

sweet spire
#

ah

#

could u not have a slightly larger hit box on ur object our of ur normal object

#

and when it goes close to interfaction

#

rep notify and update

hasty adder
#

A ball so getting a local version to move when a llayer interacts with it with lag and then sync up smoothly with the server version is then tough part

sweet spire
#

so u send extra information when its about to have an important event

#

so u make sure the angle wont be off

#

u gotta believe man

hasty adder
#

Because if you use normal movment replication you click and .3 seconds or depending on ping then you see it move

sweet spire
#

im guessing u cant simulate on client and then kick the ball on the server

#

and update from server to clients?

hasty adder
#

But if I can make the client version move local and it's accurate enough it can interopt to where the server is and proceed

sweet spire
#

everyone will get a gist of the same thing

#

iv got no idea if this is relevent to your situation but it kinda reminds me of something i do

#

So i have these flying ships right, and when u fly around in third person they use inturp on client side only right for them swinging slightly left, right, up down, rotation left and right and up and down etc

#

to give really nice movement

#

right

#

but i dont replicate most of it

#

only hit box stuff

#

then this issue comes in to play

#

there body of the ships rotation

hasty adder
#

I think what compounds the problem is there is a trail emitter and you see it go jagged on first interaction because for the moment you hit it on your side it moves forward then corrects and you see the matrix rewind lol

sweet spire
#

is never in sync with the server right

#

so line traces are gonna be off?

#

but what i do is

#

I fire the guns from the front of the ship to the center of the screen cross hair

#

on the client

#

but on the server

#

it fires directly from there camera center to the cross hair

#

my point being

#

visually its totally off

#

But it dosent matter because

#

its only slightly off

#

but the effect the end result matches up

#

not sure if iv exaplined that very well

hasty adder
#

Yeah it's all smoke n mirrors to give the illusion of correct in close proximity

sweet spire
#

but its something iv come to understand recently

#

Yeah haha

#

U got it

#

as long as we get a same end result

#

the start can be slightly off

#

im guessing rocketleague

#

does something like

#

finturp updates the ball

#

on peoples screens

#

thats why the ball when people play

#

does not really when u think about it

#

work even close

#

to how it world work on just the client side

hasty adder
#

Iike swapping B between first person and third person two different skeltons

sweet spire
#

the physics are like

#

kinda not right if u get me?

#

when they boot the ball around

#

so guessing why its slightly off is some sort of inturpsmoothing

#

maybe

hasty adder
#

I'm gonna try and get some inside info from my bud there to see what they do.

sweet spire
#

Dont forget though man most important thing iv learned

#

is there many ways to do things

hasty adder
#

He's a level designer tho so he prolly doesn't even mnow

#

Know

sweet spire
#

wait dude

#

haveu ever seen the post umm

#

the multiplayer physics setup

#

on the forums?

hasty adder
#

Maybe

sweet spire
#

that game thats like

#

4 arms

#

and u wack balls

#

or some crap

#

its just basics of physics replication

hasty adder
#

Haha maybe not

sweet spire
#

hmmm

#

are u using actual physics in game?

#

or just adding velocity

#

with gravity

hasty adder
#

Using physics

#

But for the interaction no just changing velocity

sweet spire
#

have u not tried using add velocity instead with gravity and stuff etc

#

Thats it

hasty adder
#

I set linear velocity and add angular if I want to change its soin

sweet spire
#

Scroll all the way to like his last post with the full project

hasty adder
#

Oh I've seen thatb

#

Flying ships around toot!

#

Woot

sweet spire
#

u see i orignally used physics

#

for my flying ships right

#

and i just ended up sacking it off

hasty adder
#

My game does this though you have a range and it is basic overlap sphere click a button gets overlapping actors if actor is in angle and between distance sends message to that actor to volley

#

The volley sends the forward vector and players velocity

sweet spire
#

ahh thats good idea

#

honestly man

#

whats it gonna be like

#

8v8 game?

hasty adder
#

It uses that to then set its new linear velocity

sweet spire
#

dedicated or host player?

hasty adder
#

Nah 2v2-5v5

#

Depdends on the mode one mode is designed around peer to peer the other desicated

sweet spire
#

tbh man with such little players

#

u can prob just go fucking ham

#

on the math caculation

#

just make it all work and forget about everything else

#

then profile

#

Because its some huge range project, u wont have much backlash changing things

#

because its not*

#

but also on another note dont listen to me

hasty adder
#

Lol

sweet spire
#

if im planning to spaawn 500 servers and idk wtf im doin

#

and ur kicking a ball

#

i think u got this fam

hasty adder
#

I'm not selling anything so I don't care bout backlash lol passion project someone doesn't like my vision well ue4 is free to try and program the game you want ๐Ÿ˜‰

#

ahh ok on the comp lets get to work

sweet spire
#

gotcha man

#

btw whats the correct command to join a session already in progression? and is there any presetup to let people join in progression

#

just thought id get point in the right direction before i dive in ^^

hasty adder
#

unsure on that, i use open ip for things

sweet spire
#

i tried open 127.0.0.1

#

but it does not seam to be working

#

i did preset the other client to Lobby?Listen

#

hmm

hasty adder
#

port will be different per instance.

#

umm

sweet spire
#

yeah, i only 1 instance open rn

#

im prob doing it wrong haha

#

wheres that wiki page gone >.>

hasty adder
#

So I got a bunchs code to rewrite as I'm doing no dedicated and watching things client vs authority. Need to make sure it matches ๐Ÿ˜ƒ nap time first!

sweet spire
#

haha okay!

#

Is there anyway to erm

#

a server to tell a client to join another server?

#

so they cant cheat it

#

when u join and excute it on the server, obviously the client does not run it, but they need too

sweet spire
#

or when u run on owning client, can that not be cheated?

timid pendant
#

Does anyone know how I can have code only appear on the dedicated server but not the client?

pale vapor
#

#if UE_SERVER

pale vapor
#

For Server RPCs, does _Validate get called, even if the Server is calling the RPC?

proven meteor
#

I'm studying how to use UE Network Profiler, but didnt find good sources yet.
How did you guys manage to learn and start working with NP along with the development of multiplayer crucial features? Any blogs, threads, useful documentation/books to start looking at?

timid pendant
#

#if UE_Server doesnt work. Instead the code is shown only on the client and not the server

pale vapor
#

what.

timid pendant
#

Yeah i dont know why its happening only on the client

proud hemlock
#

Is is possible to set replication per connection? Or by demand?

elder ravine
#

hey guys, anyone in here that can really make complete games like Tower Unite for instance, but then a lot simpeler gameplay wise? with databases and log in systems, and saving high scores and saving user data on a database and everything like that?

wary willow
#

@elder ravine yup

fossil spoke
#

@proud hemlock You can control what conditions an variable will consider before replicating.

#

OwnerOnly

#

SkipOwner

#

SimulatedProxyOnly

#

Etc etc

#

@proven meteor Try looking at Exis Networking Compendium. It should be pinned to this channel.

#

@pale vapor _Validate is called by the server for any RPC call regardless of where it came from.

regal hazel
#

Has anyone here managed to get find sessions to respond on a per server basis rather then in a giant array when it's completed? The Squad guys have done it, and from my conversations with them last year it was a giant pain. Trying to get as much info as I can before I go down this rabbit hole.

#

From the look of it, it will be on a per OnlineSubSystem implementation as well.

fossil spoke
#

There is no out of the box way to achieve this. Id imagine you would need to intercept the servers responses in the OSS individually in order to return them as they do so. No doubt it would be an pain to do. Havent looked into it myself but it is an feature ive been meaning to implement for my own use at some point.

regal hazel
#

Thanks @fossil spoke, seems to be the case. If I do end up doing it I'll probably do a write up about it

#

and @deep orbit that's more for #work-in-progress then here

deep orbit
#

Lol

proud hemlock
#

@fossil spoke I searched online but couldn't find any potential info really so thought asking here

#

The problem was really with GameState replicating an array to clients. Since it does it once per second, the data was outdated by the time client had to use it. So I made a workaround by telling the server to send the data manually

tacit hazel
#

how do I find in blueprints if something is owned by the clinet or server?

wary willow
#

@tacit hazel ? As in during runtime or like looking at BPs?

#

You would know what is what if you designed it correctly.

#

Start with the Network Compendium that is pinned in this channel. You should be able to answer this question and more after it. If not, watch the UE4 Networking video tutorials

#

(2014)

tacit hazel
#

yah I dont see anything about ownership in there @wary willow I dopn't use bluueprints I just had to make a quick inventory with ui and I can't get a server RPC in C++ to function properly so I assume that my blueprint is owned by the clinet

#

hence the server rpc being dropped

#

I don't fully comprehend networking with blueprints or what the ownershup of UActorComponents or stuff manually spanwed in the editor

#

as I reread that it sounds hateful but its not

tacit hazel
#

ok on further inspection I believe I see the problem, but I dont know how to resolve it as I don't use blueprints as I previously stated

#

the person playing is a client, who is calling a function made in the character blueprint, so it is a client that is owned by the server calling a server rpc so it is being dropped

#

so I am going to try to add it to my C++ player controller

regal hazel
#

Would anyone know why a worlds ActiveNetDrivers would be empty?

regal hazel
#

Game always seems to be opening port 0 instead of 7777 and it appears to be caused by the ActiveNetDrivers being empty. No idea why that is :/

thin stratus
#

@tacit hazel Clients can only call RPCs in ClientOwned Actors

#

So a ServerRPC in the possessed PlayerCharacter should not get dropped

slim holly
#

hmm, radial damage event is not passing the origin properly

tall mirage
#

I have a dedicated server and i need data to be saved after server restart(this happens for each server because i want individual player data on each server), how would i do this?

wary willow
#

@tall mirage SaveGame or External Site

#

When you state restart as in machine or just session?

tall mirage
#

ok

#

so ive been at this for a while

#

i have a system to find players last location before server shutdown and before player leaving

#

when the player joins i want to teleport him to his last location but i dont know which player to teleport there

#

i need a way of asigning a special user id

#

idk how to do user id's

#

the id would need to be saved locally to the player when he leaves

pale vapor
#

^I'm also looking for a good solution to that

tall mirage
#

ok

#

i found a idea

#

but, idk how to save the player ID

brittle sinew
#

Are you using any sort of online framework like Steam? Any of them should give you unique identifiers for each client

tall mirage
#

the player ID needs to be loaded every time the player joins and re-asigned to that player

#

also saved on server

#

idk how to do this

wary willow
#

@tall mirage using a backend like GameSparks would be one way to handle this

#

Unless you are going to do the backend yourself

#

But it is as simple as having the unique player id assigned and then having it record the location data whenever you want. And then on load, you can set up a simple script that will TP the player to that exact location

tall mirage
#

how do i save the location data

#

i have variables contanining it

#

do i make a save game with the data?

pale vapor
#

yes.

twin juniper
#

@tall mirage you are looking for UniqueID instead of PlayerID, for onlinesubsystemNULL the id changes each time, for STEAM the UniqueID changes to the steamid64 of the players steam account.. idk bout other onlinesubsystems

tall mirage
#

ok

twin juniper
#

i know for sure for subNULL the id remains the same as long as the game stays running, so you can prototype disconnecting/reconnecting to a server without having to load a real subsystem like steam

tall mirage
#

ok

#

it took me 6 hours

#

but i figured out how

#

i constantly check players position and i am constantyly saving it

#

when player joins it looks at save file and sees all players last position

#

then it takes the last position and moves itself there

#

then continues saving

pale vapor
#

You save constantly?

tall mirage
#

yes

#

to the same file

#

so that the file is overwritten each time

pale vapor
#

That performance though

tall mirage
#

its fine

#

ive had no issues

pale vapor
#

And your poor drive

tall mirage
#

lmfao

pale vapor
#

How many players you planning for?

tall mirage
#

4 per match

#

each player saves their own location

#

its for friends

wet lion
slim holly
#

please dont write it into a file at least constanty

#

every 30sec, or upon exit should be sufficient for any open world game to save locations

#
  • you can tell server to save the location based on say, steam ID
#

along with progress saving

#

leaving the file to clients hands will expose it to cheating

twin juniper
#

it sounds like his multiplayer structure has no central authority, where any one of the four friends can host

#

so keeping such data locally may be a better idea, although im not sure filewrites is the best option

#

reminds me of civilization multiplayer resume's where you trust one of the four friends to keep their local saves legit

#

could prob do something cool with a cloudbackend owel

slim holly
#

Im not sure, steam can probably save directly to cloud

#

but that could get complicated

#

or you could encrypt the save file

#

to prevent tampering

tall mirage
#

i just want to have my dedicated server to save not just variables

#

BUT THE WHOLE WORLD

#

along with player locations and inventory and such

#

i want the save on the dedicated server not each player

#

any help?

twin juniper
#

game saves? idk bout multiplayer. my first approach would be to have each individual important object saved in someway... example: Apple each time Apple is placed in the world Apple would query something... maybe it tells GameMode save Apple's location and other important stats to 'Fruit.txt' or sql fruits table? And you got your PlayerCharacter's constantly telling GameMode every 5-10 sec to save their location as well.......

So then eventually GameMode dumps its memory into a file or database and its time for everything to close. When server comes backup GameMode's StartPlay() reads fruits.txt/table players.txt/table into memory... maybe arrays?? Then GameMode simply just spawns all the fruit into the world... PlayerCharacter's that connect to the game will ask GameMode did i ever exist? from GameMode's PostLogin(PlayerController) maybe you can order the playercontroller to tell its first possesed PlayerCharacter to instantly teleport to last location

idk im just spouting nonsense but thats how i would start

wary willow
#

@tall mirage hire someone to do this for you

tall mirage
#

lmao

#

im making a sql database

wary willow
#

If you are just going to keep struggling

#

Good start

pale vapor
#

@tall mirage I'm in the same boat as you right now. For each class type I want to save, I have a struct with the necessart data to recreate it. Then on save I build an array of the data for each type in a SaveGame object and the server saves it.

tall mirage
#

im going to upload to sql database

pale vapor
#

Just as a sort of cloud storage?

tall mirage
#

yep

lost inlet
#

i always cringe a little bit when i see someone directly connecting to a database, though if it's just a private dedicated server that might be ok

#

though you have to be concerned about possible sql injection attacks in your game server code

#

also if you're using mysql, libmysqlclient is licensed under the GPL and the UE4 EULA is not compatible with this license as it requires source code disclosure

slim holly
#

because ip connect is a console command "open 127.0.0.1"

#

open level picks local map file

crisp maple
#

I'm generating a multiplayer map by spawning a grid of instanced tiles. The gamemode spawns the InstancedTiles actor, and the instanced tiles creates a random grid of instances that makes the map

#

How can I change this setup to allow all of the clients to have the same grid spawn? Is there a way to set a seed that each InstancedTiles actor would then use to create the map grid?

#

The instances are spawned based on a get random int in range node

hasty adder
#

Use gamestate to generate the seed into a var and pass it on post logon to generate it locally?

hasty adder
#

Should just read: open 127.0.0.1 if it's local machine. If it's lab you'll need the lab up such as 10.0.0.20

#

And be sure the session is even listening on the client with the session using the ?listen flag

#

Oh

#

Dedicated aerver

#

Are you running this on your own network or a provider of some kind?

real olive
#

anyone tried using FRootMotionSource_MoveToForce to do something like a knockback within CharacterMovementComponent? I get good results when the player initiates the root motion, but if a different player or the server initiates I'm getting tons of corrections when there's a bit of lag.

hasty adder
#

Well 127.0.0.1 is your computer so chances are it's using your session try by computer up address and put the port in

#

Default should be 7777

#

If you have the dedicated server running -log you should see the interaction on the window

eternal anchor
#

if (mode == ENetMode::NM_Standalone
|| role >= ENetRole::ROLE_Authority)
{
MulticastApplyEffectCue(CueParams);
}

called from server

#

runs in remote client which in editor, but does no work on other client

#

when other client makes server it doesn't work on it, but works on client in editor

#

wtf

stoic maple
#

Anyone know if RepNotify replication works in replays?

hasty adder
#

Replicated information should be captured so it should

hasty adder
#

How's your progress been with replay @stoic maple

eternal anchor
#

for future reference

#

testing multiplayer in single process if we have any kind of UObject singleton

#

is bad idea

#

it will not work

#

i just wasted 4h to learn it;d

charred condor
#

Hey all, Trying a make a local top down multiplayer game with 6 players but can't get more than 4 to work....is there somewhere to increase the max number of players you can create

brittle sinew
#

Are you doing this off of a template project? It might have a limit, but AFAIK there's no inherent engine limit present of 4 people

#

What functionality do you receive when trying to go over 4?

#

Thanks app -_-

charred condor
#

just no ability to control anything over 4 even though player 5 and 6 are setup just like the other 4

#

I did start with the twin stick template

#

@brittle sinew thanks for the help by the way will check back in a bit on the road

brittle sinew
#

Alright, I would go through a basic debugging procedure here

#

Make sure each pawn is getting a valid controller assigned to it. If so, check if the inputs are making it to the controller, and the same to the pawn. Etc.

#

You'll probably eventually find the breaking point, and even if you don't know how to solve it immediately, knowing exactly what is failing (or at least the symptoms) is a huge help

wary willow
#

@brittle sinew @charred condor 4 is max

#

Definitely from BP. But you can change it from source. But good luck, probably will break it.

#

This limit is due to game consoles

brittle sinew
#

On the template? Or is this in the engine and I'm just boneheaded lol?

wary willow
#

In engine

#

You can only create player x 4

brittle sinew
#

Huh, I guess I never really tried over 4 now that I think about it, I just kinda assumed that didn't exist rofl

wary willow
#

But it IS settable in CPP, however I don't think it is supported past 4

#

TBH. 4 is plenty for local.

#

And makes sense the max.

crisp maple
#

I just got 5 to work in PIE

#

From a project built off of Third Person Template

#

Number six was a blackscreen, not sure if it was a bad spawn location or just too many

wary willow
#

@crisp maple ??

#

You changed the multiplayer count and hit play I assume?

brittle sinew
#

Oh, now that I think of it, by 4 max do you only mean local?

#

I took that to mean all MP, didn't read carefully

wary willow
#

We were talking local

#

I am assuming @crisp maple did MP

brittle sinew
#

Ah yeah, I screwed up lol

#

Was gonna say, that's a fairly weird limit

wary willow
#

And changed player #

severe widget
#

you can sim quite a few players in PIE MP, but I think only 4 of them can be splitscreen

#

If you can even mix them

wary willow
#

Yeah, which is what I think @crisp maple did

inner iris
#

Quick question regarding RPCs- after looking at the official docs, it says that RPCs should be used for "unreliable gameplay events that are transient or cosmetic in nature. These could include events that do things such as play sounds, spawn particles, or do other temporary effects that are not crucial to the Actor functioning". They are still used for gameplay important things such as calculating bullet line traces and if damage was dealt etc. through custom events (run on server) right?

warm pagoda
#

In an indeal world, I think the idea is that you'd find a way to use variable replication for this purpose.

#

In as much as possible.

#

But I wouldn't stress it too much.

#

I recall Smite having some crazy system of using variable replication to trigger things, don't recall enough about it.

#

There was an integer variable we'd increment that was replicated, I think, and we'd do that after a change to the contents of an array, and the array contained structs that contained all the possible information for any of the "flash" events.

#

We'd use RepNotify to then have the clients respond to that integer changing, look at the array, and process whatever.

#

That is my vague recollection of something done in UE3 for Smite almost 6 or 7 years ago.

#

That was also a clusterfuck, so I have no idea if it was a totally misguided over engineering effort someone made or a frustratingly necessary but super unfriendly optimization that was needed (redundant qualifications are redundant).

inner iris
#

Ah thanks for the response!

warm pagoda
#

NP. Sorry it's nothing more than theorizing, though.

#

Not the first time someone has brought up that particular line of the documentation.

inner iris
#

My poor nooby brain can't understand how that works as for me right now I always imagine the server firing off events and replicating the results to the clients

warm pagoda
#

Smite's code was a clusterfuck, because it was actually Global Agenda's code.

#

And because almost no one who worked on Global Agenda's code had a lick of game dev experience, but most were familiar with regular old software development, so a lot of stuff was torn out or bolted on based on familiarity, not best practices.

inner iris
#

Ah sounds like a horrible combination haha!

warm pagoda
#

That said, GA was also vaguely MMO-ish, so perhaps that "flash event" variable replication thing was a smart optimization for a higher player count system.

crisp maple
#

@wary willow Yeah, I just increased players and hit play

warm pagoda
#

Really hard to say.

inner iris
#

Would you say using RPCs for critical gameplay events in a faster pace setting (shooter with not as many players as an MMO) is ideal, or would it be more "correct" to find a way to do it with replicated properties instead?

#

Gotta keep learning I think, lots and lots to understand with networking ๐Ÿ˜ƒ

wary willow
#

@inner iris Just look at ShooterGame

#

Lots of treasure there to be found

inner iris
#

Doing it in Blueprints for now to understand there, then tackling big boy C++ networking ๐Ÿ˜„

wary willow
#

Basic principles are the same for the most part

#

Nicely commented

inner iris
#

Yeah the code in ShooterGame is amazing

#

A great reference

wary willow
#

But, you could check out that 1v1 "shoot-out" game

#

whatever it's called

#

That was based in BP and has some stuff in there

inner iris
#

I've seen on the forums that there is a bunch of not best practice stuff done there, but still definitely good to reference- just hard to know what is a good practice and not

#

I have things working as I'd like with custom events run on server, but just that line in the docs threw me off

wary willow
#

I wouldn't be focusing on best practices right now

#

I would try to focus on fundamentals

#

Once you've gotten your head around RPCs, Replication, Ownership

#

And built a thing or two

#

Then you can start worrying about good practice/optimization

inner iris
#

Yeah that makes complete sense

wary willow
#

I do suggest reading everybit of the documentation

#

And obviously exi's network compedium

inner iris
#

Yep filling up a large notebook the last few weeks

wary willow
#

it's stickied on here

#

pinned

inner iris
#

So in short- is a custom event run on server considered an RPC?

wary willow
#

Well, that's only one

#

of three RPCs

#

And all RPCs are custom events

inner iris
#

So run on server, multicast and run on client are the 3?

wary willow
#

Yup

#

Plus you have RepNotifies

inner iris
#

Those are on vars right?

wary willow
#

Which is what Sion was talking about

#

Yes, variable rep

inner iris
#

So they trigger the event on changed

#

So for something like shooting a gun and having the server calculate where the bullet goes, I can't think of any other way to do it other than a custom event run on server

wary willow
#

I would really focus on ownership, once you've nailed that, you are on a smooth sailing

#

I had some issues with that in the beginning

#

It seems simple enough, but you can get tricked rather easily.

#

Are you talking about physics ?

#

Or just line trace?

inner iris
#

Awesome, I'll make sure to read everything I can

#

No just line trace

#

Simple line trace event

wary willow
#

Yeah, that's almost always done on server

#

Don't know a case right now why it wouldn't be.

#

But I am sure there's got to be one

inner iris
#

So doing it on an event is correct? Even though the docs say RPCs are more for cosmetic "other temporary effects that are not crucial to the Actor functioning"

wary willow
#

Right, um, so, while I said read all the docs, reading it doesn't always make sense. Practice makes perfect.

inner iris
#

Haha yeah I had thought I understood things at a basic level but that line really threw me off

wary willow
#

the funny thing is

#

Most people will tell you that EVERY important gameplay event will be done using an RPC+reliable

#

Any cosmetic will be either local/unreplicated or replicated+unreliable

#

But, again, it's a case by case basis

#

Sometimes, "cosmetic" things like sound/particles are essential to gameplay experience in MP

inner iris
#

Yeah from any of the examples or forum posts I've seen, any kind of gameplay event that needs to be done on the server to prevent cheating uses a reliable RPC. So I guess I'll ignore that line of the docs and continue doing things like that through events and then have the cosmetic sound / fx stuff be on an unreliable multicast event.

#

Thanks for helping clear that up- the line about RPCs not being used for critical gameplay events pretty much was the opposite of every example I'd previously seen

drowsy notch
#

What's the best way to validate that an RPC received by the server has come from the client that owns the object (say a pawn) and not another client? Or does Unreal do something about this already?
i.e. if server receives "jump" command for a pawn, it shouldn't execute if it came from a client that doesn't own the pawn

pale vapor
#

unreal does that for you

#

It drops the RPC

#

'RPC invoked from a client'

drowsy notch
#

ah, helpful

#

cheers

sweet spire
#

can u not cast too and get the game mode in multiplayer? mine always fails

stone lintel
#

@sweet spire could you explain more? did you mean, GetWorld()->GetAuthGameMode()?

#

this always returns NULL if called from client side

sweet spire
#

Hmmm

#

i store a list of other servers

#

in my gamemode

#

best way to give that too the client?

#

stupid question

#

gamestate.

stone lintel
#

i think list of server should be put inside session search

sweet spire
#

Its not for searching

#

It connects my cluster of 500 servers together

stone lintel
#

ah i see

sweet spire
#

predefined servers by ID map u see

#

i really only need to replicate it once

#

or on updates

#

hmmm

#

wondering where would be the most efficient place too store it.

#

Actually

#

a better question would be

#

Is there away to call a ugh

#

Open level on the server

#

then make the client run it

#

Im asking best practices basically ^^

stone lintel
#

if the client connected to server, the server can call specific client via PlayerController->ClientTravel

#

inside ClientTravel would be the URL for the map

sweet spire
#

Oh? ๐Ÿ˜ฎ

#

wait i thought that makes

#

everyone jump

stone lintel
#

if you want everyone jumps, you should call GetWorld->ServerTravel

sweet spire
#

gotcha

#

wahts the node for clienttravel called?

stone lintel
#

BP node?

sweet spire
#

yeah

stone lintel
#

soory mate i hve no idea if it's BP ๐Ÿ˜…

sweet spire
#

i guess i can just expose it

#

APlayerController::ClientTravel right?

stoic maple
#

@hasty adder Sorry about the late response. I have it working, somewhat, but if I scrub backwards/forwards it does not replicate things correctly.

stone lintel
#

@sweet spire yes that one

sweet spire
#

gotcha

#

do u have an example skiffers?

#

im gonna guess ugh

stone lintel
#

shootergame is the best example IMHO

sweet spire
#

ClientTravel( 127.0.0.1, false, false,);

#

something like that?

stone lintel
#

yes

sweet spire
#

UFUNCTION(BlueprintCallable, Category = "Networking")
void ClientTravelCN(Fstring url, enum ETravelType traveltype, bool bSeamless);

#

am i missing something?

stone lintel
#

@sweet spire should be enough

stoic maple
#

I am trying to implement a replay system, and I have a portion of code that uses RepNotify in order to execute a specific segment of code. The system works on a single play-through, but if I rewind or scrub, RepNotifys that have already played will not fire a second time.
I suspect this is by design, since Replicated Functions also do not play during demo record, since they're not bi-directional. I was under the assumption that I could still use this for RepNotify, though.

hasty adder
#

Hmmmm I'm very interest in your code lol

#

@stoic maple

sweet spire
#

can u make functions u call server only or client only like u can with customs

brittle sinew
#

Like RPCs?

#

Or do you mean you can only call it on the server or client?

sweet spire
#

Yeah i noticed there is no option so

#

My guess is

#

You call the RPC say server only

#

then have it call your function

inner iris
#

If you use switch has authority on a function, how does that differ from a run on server custom RPC event? Just curious

brittle sinew
#

Well switch authority only checks if you're on client or server

#

It doesn't do anything to actually call the function on the server

#

Certain functions like BeginPlay or Tick are run on both instances of the object, but if you just call a function locally (on client), even if you have a switch in there it'll still only be called on the client

#

The RPC is what does the actual handshake with the server and tells it to call the function on the server version of the object

inner iris
#

So you'd just have switch has authority as a safeguard in case it's called elsewhere?

sweet spire
#

ey lethal heres a question for you, as i was unable to find the information on the network compodium

#

GameInstance? is that replicated? can everyone access this? whats the deal with it.

brittle sinew
#

Sure, I would only use it in a situation where the function is called on both server and client and you only want the action to occur on one of them @inner iris

#

@sweet spire no, it's unique to each client and persists throughout their game's execution

inner iris
#

Ok thanks for clarifying, much appreciated!

brittle sinew
#

It's irrespective of what server they're connected (or not connected) to

#

Yep ๐Ÿ˜ƒ @inner iris

sweet spire
#

Gotcha

#

Last question for you then for good practice

#

Say i have a list of servers on a server(derp?) and my client triggers an event

#

to travel to another server

#

Should i just server side call the event fron the controller?

#

originally i was passing it to gamemode to get the correct server address from an array but

#

Isent that just a waste?

#

why not call it directly from the controller and have the control grab the list from gamemode

brittle sinew
#

That sounds fine

#

You can't really call RPCs on the GameMode anyways; it only exists on the server

sweet spire
#

So just forget about the gamemode

#

Do it all in the controller?

brittle sinew
#

I wouldn't say that really, no

#

A server list probably doesn't fit residing on a controller

#

You can still access the GameMode from the controller, just not from the client version of it

sweet spire
#

I was thinking this

#

ignore the non connected cast, will fix in abit

brittle sinew
#

Yeah, that would work fine

sweet spire
#

crap i need to grab server ip fron the game instance too

#

as that grabs the ip rom a serverphp call

brittle sinew
#

(given "Client Travel CN" is a client RPC)

sweet spire
#

Was just checking for best practice

#

well i rpc the call server side only

#

and client travel cn

#

is just ClientTravel

#

exposed to bp

#

So it should get called server only right?

brittle sinew
#

You should be fine; ClientTravelInternal is already a client RPC

#

(which is called by ClientTravel)

sweet spire
#

okay awesome

#

Was just checking

#

just trying to fine tune as i go along

#

save all them little bits of server cpu!

brittle sinew
#

Just wondering, since you were talking about running 500 instances, I have doubts in that lol

#

Are you going to ram-cache the assets manually?

#

Your disks aren't going to be able to handle all of that IMO

sweet spire
#

no idea, i was just wanting too push it hard and see what bottle necks

#

i got m.2 drivers and some raid at my disposal

#

x2 2670's

#

800gb of ram

#

2.1 ram speed

#

just really wondering whats gonna be the bottle neck, so i thought id give it a wack

brittle sinew
#

SATA or PCIe m.2s?

sweet spire
#

PCIE

brittle sinew
#

Hmm, I still don't see a world where you'll get 500 instances running hahaha, maybe it's just me but that sounds like it'll bring anything to its knees easily

#

Guess the only real way to find out is try it though

sweet spire
#

more for fun and learning i guess u know?

#

i think ima get some better raid controllers

#

push for more speed

#

ugh i wish i had the ddr4 2.4 speed ram

#

but i only hve 2.1

#

the 2.4 is soooo expensive

#

But it be intresting too see how far u can go with dedicated servers

stoic maple
#

I didn't make the tutorial, just used it.

brittle sinew
#

Wait what @sweet spire? Online it looks like that cpu runs ddr3

sweet spire
#

wait what

#

let me check my board

#

i might be thinking of wrong server

#

i have 5

#

1 sec

#

my bad

#

got my boards mixed up

#

mixed my dd60 ddr4 board up with ddr3 one

#

ye sorry i dont have 800gb of ddr4 lmao, its 600gb of ddr3

#

800gb of ddr3*

#

i have habbit of buying server stuff when big companies through it out, so i mix my crap up sometimes

#

@brittle sinew do u think il need to roll high amounts of ddr4?

stoic maple
#

800gb of RAM?!?

sweet spire
#

cus that stuff is super expensive and i dont have alot of it

#

ye its not that much

brittle sinew
#

No idea really, everything is really expensive ATM

sweet spire
#

if u know where too look u can pick up 32gb sticks for 100$

#

example a z9pe is good cheap board for what it does

#

they can hold 256gb of ram

#

i think

#

i mean if i split my crappy ram equally

#

I have like

#

4 servers with dual xeon 2670's 230gb ish of ram each

#

and raid SSD's

#

but no m.2 to split around

#

There hard to pick up cheap

sweet spire
#

@brittle sinew you there? apologise for bugging you

brittle sinew
#

Yeah, what's up

sweet spire
#

Remember few days ago you taught me the difference between controller and player controller right

#

if i wanted to get the player controller owner of say a UI

#

i would cast to owning controller than get player controller right?

brittle sinew
#

Why would you need to?

#

Widgets have a get owning player function that returns a PlayerController

sweet spire
#

im inside a widget, and im trying tocall a function on the player controller.

#

wait crap

#

UMG's are not on the server

hasty adder
#

@stoic maple oh I recall you having problems thought maybe you had modified what's happening there. I'm going to hafta make a project of my own and dig into that

sweet spire
#

im an idiot

#

stops what im doing

#

wait

#

i can RPC from a widget to server right?

hasty adder
#

What's are you trying to call?

sweet spire
#

I would like to call a function inside the player controller on the server side

brittle sinew
#

I don't see the issue here

sweet spire
brittle sinew
#

The cast is unnecessary, the function already returns a PC

sweet spire
#

Its just an RPC inside the controller

#

ah

brittle sinew
#

Just because the widget exists on the client only doesn't mean you can't use it to call RPCs on other replicated objects

sweet spire
#

ita asking for a target

hasty adder
#

So you want player to tell the server to travel

brittle sinew
#

Which is the PlayerController you got from the getter

sweet spire
#

ahh okay

brittle sinew
#

If it's your custom BP, you need to cast it

sweet spire
#

gotcha

#

i tried this before but was getting failed for the object type

#

i tried get owner and get player controller

hasty adder
#

If the server travels the clients will follow

sweet spire
#

i only want a client to travel.

brittle sinew
#

How do you spawn the widget?

sweet spire
#

via a temp actor since its only for that level, it hands the owner to the player controller

brittle sinew
#

I would check if the PC you're getting out of the getter is valid at all

#

It could be null

sweet spire
#

The controller game mode settings is set correct

#

ah okay

#

i think it fixed

#

im not getting failed cast anymore

dusk spire
#

Hi im wondering about, if the clients character/controller stays valid after it lost connection, or it automatically invalidates it after a period of time? or i should handle the dropping of the timed out characters?

fallen goblet
#

Hey guys, a question about OnPostLogin on GameMode; when spawning an actor and immediately possesing it, calling a PlayerController RPC using the possesed pawn doesn't work. The PC's 'GetControlledPawn' function is invalid. I tried playing around with some delays which returns random results (sometimes it works, sometimes it doesn't; the higher the player count, the more random it gets). Why isn't a simple SpawnActor->Posses on the server side not working; there must be a better approach to this?

brittle sinew
#

Replication of variables and actors has no guarantee of orderโ€”I'm pretty sure you can just use a function on the PlayerController to see when it possesses a new pawn

#

Yep, try OnRep_Pawn

fallen goblet
#

Oh interesting

#

let me check

#

doesn't seem to be available in blueprint? there must be an equivalent

brittle sinew
#

Hmm, not sure then, I don't really see anything else that is exposed or implementable in BP

fallen goblet
#

yeah, google isn't helping me much either; kind of a bummer this

#

so what's basically happening is, the CreateActor node creates the actor on the server (which hasn't been notified to the clients yet). The posses gets called, but seeing as the actor isn't on any of the clients yet it doesn't possess anything. When the Actor finally reaches the clients due to replication, the possess already failed and t he client's PlayerController didn't posses anything.

brittle sinew
#

Not quite, no

#

The possess only occurs on the server, and the effects of that possess will eventually propagate to the client

fallen goblet
#

ahh okay

brittle sinew
#

Nothing about possession is failing here.

severe widget
#

OnRep should be possible in BP

brittle sinew
#

It's just that the RPC occurs before the pawn is synced to the client

fallen goblet
#

ahh like so, yeah that makes sense

brittle sinew
#

@severe widget not when it's already defined in C++

severe widget
#

Ah

#

True, true.

fallen goblet
#

alright, that furthers my understanding a bit; thank you

severe widget
#

You have to add that in C++ but you can call a BPImplementable

brittle sinew
#

Yeah, that might be necessary

fallen goblet
#

Yeah

#

Currently tried doing something hacky like this:

brittle sinew
#

shudders

fallen goblet
#

interestingly enough though, the RPC is now only called on Client PlayerControllers; ignoring the Server's PlayerController alltogether

#

yeah I don't like doing this :p

brittle sinew
#

The issue with using delays in MP is you have no guarantee the replication will happen in 5 seconds

#

Sure, 99% of the time it will

#

But when it doesn't, things will break

fallen goblet
#

Yeah, but still the issue I'm having right now is weird nonetheless

#

I'll probably delegate the OnRep_Possess from C++ to BP as PlaceholderName mentioned as the 'proper' solution

brittle sinew
#

VorkuKeren kappa

fallen goblet
#

The 'RunOnOwningClient' should also run on the Server's PlayerController right? (When the first player also hosts the game/acts as the server)

#

It's weird the RPC then doesn't fire when introducing a delay on the server

severe widget
#

@brittle sinew shh is k

fallen goblet
#

Even weirder, when running it on 4 players; it only calls the PC RPC on a single client.

#

As if the newPlayer pointer of OnPostLogin used to call the RPC is always the latest player after the delay (not sure how UE handles that behind the scenes)

brittle sinew
#

Oh, you pointed out the problem ๐Ÿ˜„

#

Events on the event graph aren't instanced; the nodes that are present are the same nodes called each time the event runs

fallen goblet
#

That's really it? hmm, interesting; thought BP would've managed most pointer shinenagens like this

severe widget
#

And the other issues with using delays presents itself

brittle sinew
#

When you retrigger a delay, the old one isn't called anymore

fallen goblet
#

interesting

#

so if I want to get something like this working, I'd have to store the actual pointers in an array and later loop over them

#

yeah, delays are getting more horrible by the minute

#

ooooh

severe widget
#

You lose subsequent calls to the delay node, and then it looks for the value of the wire, which is the latter one

fallen goblet
#

it's actually not the pointer thing, it's the delay that gets re-triggered

#

yeahh

#

that makes sense

#

man :p

#

the C++ PlayerController as parent is definitely the way to go

#

Thanks guys, I really need to get used to some of these little UE tidbits

#

This helps a lot ๐Ÿ˜ƒ

regal hazel
#

Would anyone know why the ActiveNetDrivers Array in Engine.h would be empty?

#

In my default engine.ini i've written

!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemUtils.IpNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")

As per every every bit of online documentation I can find, including shooter game

twin juniper
#

prob not intentionally there to go along with their "engine for everything" philosophy. where if you need online subsystems you would just add them as you go

ripe cypress
#

Anyone know why I can't call a respawn widget again after its been called once before

wary willow
#

@ripe cypress rephrase please

#

Like a regular UMG widget?

#

That you use to respawn items?

twin juniper
#

i have an actor thats far far away in another galaxy, so obviously its not in network relevancy range. the actor has no netowner because if it did then the netowner would be the designated pawn its gameplay relevant to and if that pawn dies so does the object... so it cant have a netowner. this actor being so far away but referenced by the pawn as a variable `faractor* thing;' to be accessed fails to work on any sort of clientside operation since the actor is too far to be network relevant. everything works fine if the actor is in net relevancy range however...

my question is, how do i get actors to be network relevant if they are referenced in a replicated variable in a different actor, but they are too far away from clients to be replicated?
or
is it possible to have an actor's networkOwner's death not cause itself to be removed from game?

hasty adder
#

what the possess thing, i hafta read whats being attempted here

#

why are you using this postlogin to possess a pawn mate? @JoeyDeVries#3168 whats the problem and goal here?

#

because it looks like you could use a override on default pawn class in gameinstance(?) instead to choose different pawn when a player joins

#

gamestate

stone lintel
#

@twin juniper have you tried bAlwaysRelevant flag?

twin juniper
#

What exactly do these functions like AddAdmin, KickUser, BanUser do

#

is there a list of admins? a list of banned users?

#

that can be accessed/modified

#

Could I modify it to load from a .ini config file

#

instead of doing this

#

it looks like its loading from just memory

#

.-.

fallen goblet
#

@Inphidel I usually ike to have a lot of control over things, including creating a player's pawn in this instance. I could probably do it by the default pawn as well (which I assume would then automatically be possessed by each client?), but I'd still have to do the OnRep_Possess which barely makes a difference for my case.

#

@hasty adder

hasty adder
#

Yell depends on your needs so you are trying to change the pawn before its possessed? Or after? And what's being changed. It will auto possess but there are ways around this like a dummie default pawn like spec

fallen goblet
#

I'm trying to do some init logic on a pawn after its created/possessed, but there's no way in blueprint to get an event for when a pawn is possesed. So doing it right away will fail as getting the controlled pawn is null at that time (using a delay could work, but that's super hacky). There is a C++ delegate called OnRep_Possess on PlayerControlled that I can use for that exact purpose. So I'll have to re-delegate that to blueprint, and then use that delegate to fix it.

hasty adder
#

In the pawn itself there is a override for possessed

fallen goblet
#

there is?

hasty adder
#

Yup

fallen goblet
#

that would be great then, what's it called?

hasty adder
#

Possess I think it's in the list of overrides which younger to mouse over the events? Or functions area and you should see overrides

fallen goblet
#

alright, let me boot up Unreal and check

#

hmm can't find it

#

I am on version 4.14 if that matters

hasty adder
#

Hmm try searching the normal event list

#

Wait

#

This is the pawn/character right?

fallen goblet
#

Oh no, my bad; it's the player controller

#

Pawn would be fine as well actually

#

let me check

hasty adder
#

Yup it feeds over the controllwr posessing

fallen goblet
#

Oh

#

you're right

#

For pawn there is a Possessed event

#

That would work just as fine

#

even if I do need PC specific functionality, I can always call it from 'getOwner'

#

oeh awesome

#

Let me try and work something out, see fi it works as I'd expect ๐Ÿ˜ƒ

#

Alright, I think it works

#

it does seem like it's getting called twice; maybe UE automatically posseses any pawn that's created if PC is still without any pawn?

#

no, nevermind; that doesn't seem to be the case

hasty adder
#

Think it's just client and server runs itL

fallen goblet
#

Hmm, I'd expect this to work

#

with the RPC being a simple 'print display name of possessed pawn'

twin juniper
fallen goblet
#

but it prints nothing, indicating it didn't properly possess it

#

it's also still printing twice per pawn, with the server check

brittle sinew
#

@twin juniper no idea, maybe check the source before cold tagging? :p

hasty adder
#

I use it for a bunch of things tho I'm not sure what controller it sends class wise so I use the pin to cast to my controller class to get info playerstate

fallen goblet
#

yeah, I'll do some further experiments and see how far I can work something in my main project ๐Ÿ˜ƒ thanks!

hasty adder
#

Yups

wary willow
#

@brittle sinew What does A do inside B? Anyway that you could C your way out of it?

fallen goblet
#

Ugh, I can't get it to work; I have no idea why this doesn't work:

#

With the print function:

#

It simply prints out empty strings for both the client and server, which doesn't make sense. The Get Controlled Pawn thus returns an empty pawn, as if it didn't possess at all o.O

hasty adder
#

Is valid the PC

#

Check it's calid

#

We wait

fallen goblet
#

Well, the RPC gets called (twice though), so the cast did succeed and it must be valid right?

hasty adder
#

Yeah

#

It's the info it's trying to print is null because it's not rellicated

brittle sinew
#

Like I said yesterday, you have no guarantees in the order of replication

#

Just because the possessed event occurs on the server doesn't mean the client has the actor replicated yet

hasty adder
#

Controller isn't replicated , are you trying to get the llayer name or what?

twin juniper
#

so these functions

#

dont actually do anything

#

rofl

fallen goblet
#

oh, that would explain the situation, but isn't that weird? You'd expect when something succesfully posseses it actually has something to possess right?

brittle sinew
#

And the possessed event fires right before the controlled pawn is set

fallen goblet
#

hmm that would explain it

brittle sinew
#
InPawn->PossessedBy(this);
SetPawn(InPawn);
fallen goblet
#

but, that unfortunately does mean the possessed event wouldn't be useful in my case ๐Ÿ˜ฆ

brittle sinew
#

Within AController::Possess ^

hasty adder
#

Yeah I delay .5 on my casts

fallen goblet
#

Ahh yeah, but then we're back where we started

#

If I override the OnRep_Notify, that would have right order, right?

#

As in that does ensure me the actor is replicated as well? Or same storY?

brittle sinew
#

Yes, that is fired when the pawn is replicated to the client

hasty adder
#

Much cleaner way to handle it. But why you trying to avoid a split second delay?

fallen goblet
#

because it can't give me any guarentees

brittle sinew
#

The problem with delays is you don't know it's a split second

fallen goblet
#

if a client is lagging far behind, it would completely miss the call

brittle sinew
#

^

fallen goblet
#

it'll probably work, and I'll consider it as a backup if all else fails, but if possible I'll still try to do it as accurate as possible ;p

hasty adder
#

If someone's laggin hard playing the wrong game ๐Ÿ˜‰ kek

fallen goblet
#

Do you have some document @brittle sinew about all the different exectuion orders of UE's (network) functions? The documentation doesn't seem to mention these things that often

brittle sinew
#

Not really, I just look at the source most of the time

#

Get the most direct and correct answer out there ๐Ÿ˜„

fallen goblet
#

ahh yeah

#

yeah exactly :p

#

I'm in the process of starting to learn to use Unreal's C++ side; I tried to do my current project in Blueprint only, but I keep hitting limitations; next project will definitely be as much C++ as I can afford (with blueprint where it makes sense)

hasty adder
#

I spawn my players in a fake spec class and the have a menu load to pick a tick works spiffy

#

Teams

fallen goblet
#

Yeah ๐Ÿ˜ƒ

hasty adder
#

I got an example of it on foruns

#

4.14 tho I think or 15

#

Had to stop work on it, limited time my game is more important! ๐Ÿ˜ƒ

#

Oh wrong link

fallen goblet
#

sweet

#

I'm off for tonight, thanks for all the help again guys, much appreciated ๐Ÿ˜ƒ

hasty adder
#

No proba

twin juniper
#

instancedstaticmeshes

#

have to be one of the least documented classess in ue4

#

and a lot of the functionality isnt even exposed to bps

#

GetInstanceCount() does not even correlate to the index of the instances

#

its not 0 = 0, 1 = 1 in the array, its something else

#

because if u try to loop through the instacnes and remove them by count, it just doesnt work

eternal anchor
#

how can I run dedicated server with console log ?

twin juniper
#

@eternal anchor add -LOG

eternal anchor
#

thanks

twin juniper
#

it might need to be lower case

eternal anchor
#

afaik case is ignored with arguments/console commands

twin juniper
#

yeah its literally impossible to loop through instancedstaticmeshes

#

and remove instances

#

or get all instances and their IDs and assign something to them

#

the functionality jsut does not exist

slim holly
#

ISMs aren't that complex really

#

no documents because no features

twin juniper
#

@slim holly it is when u are trying to rpeplicate the instances on a per instance basis and make sure that players who login later do not see the instances

#

in single player, yeah its completely simple

wet lion
#

Hi I have a question about replication, authority, etc. Say I have a multiplayer setup and a key is bound to the pawn toggling a flashlight on/off. I'm not sure which way is bet to go about it.

Approach 1:

  1. client playercontroller sends an rpc to server: toggle light.
  2. server playercontroller executes the rpc, toggling a repnotify bool in its pawn.
  3. server pawn turns light on based off repnotify on bool.
  4. client pawn turns light on based off repnotify on bool.

This seems to work, but I notice a delay in the client between pressing the key and the light toggling.
On the server there is no delay.

Approach 2:

  1. client playercontroller sends an rpc to server: toggle light.
  2. server playercontroller executes the rpc, which executes a multicast rpc on its pawn.
  3. server pawn turns light on based off multicast rpcs.
  4. client pawn turns light on based off multicast rpcs.

No noticeable delay either on server or client.
But I think this has the disadvantage of being subject to net relevancy and update time.
For example if a pawn toggles their light and then another player joins the game,
the new player won't see the current flashlight state of the other player if it was toggled
before the new player joined.

So, is approach 1 the way to go? And if so, what about the noticeable delay on client?

#

another approach I guess could be to have the client controller itself turn its light on and then tell the server via rpc to change it's verson of the bool but with repnotify-no-owning-client. So that the client instigating the change sees it immediately but all other clients get the update "whenever". Though this means the client now has some sort of authority

regal hazel
#

Would anyone know why ServerTravel does not appear to be applying the ?listen parameter? The reuslt of which is my clients cannot join. OpenLevel works fine however and clients can join with no issues

wary willow
#

@regal hazel Dedicated or no?

regal hazel
#

Nope, basically just following along similarly to shooter game, their ServerTravel appears to work fine, however mine does not (in the sense clients can't join)

#

They can see the session, just not join

#

Somewhere in ShooterGame it's correctly setting the url with the right port number, my game for what ever reason is not

#

Trying to track it down is a real pain haha

wary willow
#

@regal hazel Maybe not in code, maybe in .ini settings ?

regal hazel
#

Thought the same thing but can't seem to find anything specific

regal hazel
#

Fixed it by calling GetWorld()->Listen() directly, just feels dodgy

jolly siren
#

So the ReturnToMainMenuHost and ClientReturnToMainMenu stuff isn't hooked up ootb. Anyone dealt with it? ShooterGame's implementation is pretty complex around that. Just want to destroy the session on clients when they return to the main menu. I guess I can just destroy it when the main menu map loads or before trying to join a new one.

regal hazel
#

CleanupSessionOnReturnToMenu Is the goods to look at @jolly siren

#

In shootergame

jolly siren
#

yeah I looked at that, it seems convoluted

regal hazel
#

I also have another check going on in case the session wasn't destroyed (mostly due to unstable-ness in PIE) just before I create I check if it already exists and destroy it

if (Session->GetNamedSession(InSessionName))
{
       Session->DestroySession(InSessionName);
}
jolly siren
#

DestroySession <- GameInstance::CleanupSessionOnReturnToMenu <- HandleReturnToMenu <- RequestFinishAndExitToMainMenu <- EndPlayingState <- EndCurrentState <- MaybeChangeState <- Tick()

#

tracked it back from their destroysession call

regal hazel
#

Yeah I completely reworked how all that stuff works but in regards to destroying the sessions CleanupSessionOnReturnToMenu does the job

jolly siren
#

where do you call CleanupSessionOnReturnToMenu tho?

regal hazel
#

If im the authority I end the game mode, if im a client I clean up some ui, call clean up sessions, then finally load the level

#

Ohh sorry didn't see your edit

#

I call a function that calls the above functionality (ExitAndReturnToMainMenu)

jolly siren
#

okay, I'm just looking for the ootb function to connect to

#

I guess it would be either on main menu load or disconnect

regal hazel
#

Ohh I see didn't realise those functions existed (just googled them lol)

#

Just been writing my exit flow explictly so I know what is going on

jolly siren
#

yeah the two I listed are ootb functions

#

yeah it's weird they are there but aren't actually called

#

How do you listen for client disconnect? I'm wanting to destroy the session on the client when the server turns off

regal hazel
#

Sorry for the delay @jolly siren! I catch it in HandleNetworkFailure in a custom GameEngineClass I have

drowsy notch
#

When spawning a replicated actor, is there anywhere the server can process properties before the initial bunch is replicated to the client?

wet lion
#

Hi, I am noticing that when travelling to a level after connecting to a server (->ClientTravel), the pawn or camera is wrong for about 1 sec. That is, my pawn is 3rd person with a spring arm so the camera always hovers above the player. But when the level starts, after joining the server, I first see what appears to be the expectator pawn or some pawn with 1st person view for 2nds. Any thoughts?

dull island
#

hi everyone

#

I'm attempting to implement an online subsystem

#

when I run the game in the editor however, it appears to fire Login on the identity service twice

#

which generates two sessions

#

it looks like this in the log:

#

it doesn't seem to call Shutdown on the first online subsystem

#

not sure where the best place to upload code is for this kind of thing

#

I can pastebin if that would assist in diagnosis, but I get the feeling this is something the engine is supposed to do, even though it results in two sessions in our online system

#

oh hmm

#

I think the engine expects me to allocate the unique net ID before returning from Login

#

even though the user ID isn't known until after the asynchronous login task finishes

jolly siren
#

thank you @regal hazel ๐Ÿ˜ƒ

hasty adder
#

So here's a replication question. If I have non reolicated values such as impulse speed hard coded as variables. And rather then replicating the variable and setting it. If I replicate the bool that drives say max impulse -> select true thisvar or false other value will this be picked up by other actors since the logic overall should be replicated by the book?

#

Bool

hasty adder
#

So take character class has defaultskinred powerupskin. And bISPowerup_rep that will on rep use set skin material by select of that book true material is powerupskin false defaultskin - rather then replicate the skin in a rpc event just the bool changing will notify other players because of the bool change his skin should be that var in the class

#

If that makes sense

twin juniper
#

How do I replicate USTRUCT() prpoperties

#

there is no DOREPLIFETIME()

#

for structs

hasty adder
#

Google ustruct replicate ue4 :: found some code there otherwise I've no clue

twin juniper
#

oh i did

#

it says u can do it like rgular uproperties

#

but where do i put doreplifeitme

hasty adder
#

Wiki - "remember that only UPROPERTY variables of ustructs are considered for replication"

wary wyvern
#

Hey guys! Is it possible to do a serverTravel using BP? I've tried to call "Console execute" with "ServerTravel Map", but no result..

hasty adder
#

I thought there was a node

#

Hmm

wary wyvern
#

It travels, but I do not know for sure, as you do need to check it in standalone game

#

Doesn't work in PIE

hasty adder
#

Doesn't sound like it works with steam either

#

Single process sounds like needs to be enabled

brittle sinew
#

@drowsy notch yes, either use deferred spawning in C++ or expose parameters as "expose on spawn" in BP so you can have them available in the construction script

twin juniper
#

hey guys, I have a struct which has some values in it, but when i change them they are constantly being reset for some reason

#
USTRUCT(BlueprintType)
struct FFoliageInfo
{
    GENERATED_BODY()

    UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Foliage)
        int32 IndexID;

    UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Foliage)
        int32 AmountOfResource;

    UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = Foliage)
        FString ResourceToGive;

    void TakeResource(int32 AmountToRemove)
    {
        AmountOfResource -= AmountToRemove;
    }


};
#

But when I call TakeResource() and then glog->log "AmountOfResource" its the same

#

is this because my struct is inside of a tmap

brittle sinew
#

How are you accessing the struct from the map?

twin juniper
#

TMap<int32 MyFoliageKey, FFoliageInfo> MyFoliage;

FFoliageInfo Info = MyFoliage[hitTrace.Item];

#

then im trying to do Info.TakeResource(amounttoRemove);

#

im wondering if there is a step i need to be taking after chaning the struct, like do i need to push the changes or something?

brittle sinew
#

Try changing it to ```cpp
FFoliageInfo& Info = MyFoliage[hitTrace.Item];

#

The lack of an ampersand may implicitly turn it into a copy rather than a reference

twin juniper
#

yeah

#

thats what i was ust thinking

#

lemme try

#

yep looks like it worked

crisp maple
#

Does anyone know how I can iterate through each connected player only once at the start of a multiplayer level?

#

I cant seem to find a way to do it on a spawn or begin play without hitting each character multiple times