#multiplayer

1 messages ยท Page 533 of 1

gleaming vector
#

ya

#

this way you can issue your servers an api key or something

#

and reject any request that doesn't have an api key

#

this way random people can find your api... but they can't do anything because you outright reject things that come through

#

and if an API key leaks, you can just regenerate it

#

it gives you a fairly powerful layer of security

#

that you don't get if you are just accepting direct connections to the SQL server

nocturne roost
#

I'm sorry but I don't know much about web server stuff for HTTPS, but are API keys dynamically generated or are they static where I go onto the webserver, manually generate it, and copy and paste it into the UE4 dedicated server code?

gleaming vector
#

it depends on your implementation

#

I'm sure there are some free, open source implementations of a basic rest api framework

#

in a language of your choice

nocturne roost
#

I would do that if I wanted a static amount of Dedicated Servers?

gleaming vector
#

uhm

#

are you absolutely 100% sure you are doing a static number of servers?

#

like "this is the decision i'm doing and will never go back on it"

nocturne roost
#

No, I'm just talking generally. I want a dynamic amount of servers. But I want to limit the amount of servers on at will (for testing purposes and closed access or something, so there are never more than 3-4 servers online at a given moment)

gleaming vector
#

then do the api method

#

it's flexible and doesn't add that much work over just doing an sql server

ocean geyser
#

does UE offer any framework for sending/receiving http requests for this sort of thing?

nocturne roost
#

That's a good question

gleaming vector
#

yes

ocean geyser
#

like im literally building a dedi server right now (for learning)

nocturne roost
#

And for this "rest api" what exactly is that? Is this something implemented into the dedicated server or the webserver that connects to the database?

ocean geyser
nocturne roost
#

I've tinkered with ASP but never really dove into it

#

I'm more into C# so I'll probably use that for the web server portion

gleaming vector
#

REST is a style of web api

#

it's relatively trivial to implement

#

asp.net is a good way to get started

#

just google like "ASP.NET REST Api tutorial"

nocturne roost
gleaming vector
#

thats pretty old (from 2013

nocturne roost
#

So the picture it shows is exactly what I'm trying to achieve? The Client being the Dedicated Servers, controller being the web server, and the data access layer being the database?

gleaming vector
#

yes

#

the client here is your dedicated server, yeah

ocean geyser
#

if i recall this is the video i watched that helped me understand how to implement what i was trying to do
https://www.youtube.com/watch?v=bIiEv__QNxw

nocturne roost
#

if I were to use an SQL database (what I'm going for unless if you think there is a better alternative) I would put the SQL query code in the web API code?

ocean geyser
#

i made procedures on my database and use the web api to call those procedures and not access the DB stuff directly

#

such as a procedure to check if a certain string exists in a table or something and one to retrieve data and such. just very specific things

gleaming vector
#

if you are using C#, there is a really good connector to SQL

#

that you don't have to write SQL queries

#

it's absurdly good

nocturne roost
#

So I could make a procedure that fetches player inventory information

#

@gleaming vector What's it called? And it's for ASP.NET?

gleaming vector
#

entity framework

#

it's for C# in general

ocean geyser
#

yes, a procedure that takes in a player ID or something to identify them, search through the DB until it finds the data and returns it back

gleaming vector
#

for C#, if you add "core" to your google searches you get modern C# tutorials and tools

nocturne roost
#

This was made about a year ago

gleaming vector
#

yeah

#

that's modern ef

#

old EF is bad

#

new EF is incredibly good

nocturne roost
#

The one I posted is modern or old?

#

But looking at this

#
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            optionsBuilder.UseSqlServer(
                @"Server=(localdb)\mssqllocaldb;Database=Blogging;Integrated Security=True");
        }
gleaming vector
#

EF 6 is new

#

EF6 and EF Core are basically the same thing

nocturne roost
#

It's basically using a SQL server but does a lot of the querying statements for you?

gleaming vector
#

yep

#

it has a few connectors too

#

so you can use mysql, postgres, mongo, etc

#

it defaults to MS SQL

#

nuget has all the connectors

nocturne roost
#

This is really cool ngl. Should the SQL server be on the same thing as the web server so it's just a local database according to the web server or should the SQL server be hosted off in another place?

gleaming vector
#

your call

nocturne roost
#

Is there any downside to having it local? Since the website will only be accessible by me and the dedicated servers

gleaming vector
#

simply putting it behind a ASP page (or other rest implementation) gives you flexibility and security

#

you can move it later if you want

nocturne roost
#

And having the SQL server somewhere else would just increase latency

gleaming vector
#

so it really doesn't matter

nocturne roost
#

Fair enough

gleaming vector
#

you just move the server, migrate the data, and then change the connect string

ocean geyser
#

so far EF looks literally effortless

timid moss
#

if it were me i would not use EF

gleaming vector
#

EF has issues scaling

timid moss
#

dapper never has issues scaling

gleaming vector
#

but, for small scale like you are targeting and the fact that you don't really know what you are doing, it's pretty great

timid moss
#

if you want to make sure you have a solid system, don't use EF. its dangerous for beginners that are trying to make large scale stuff

gleaming vector
#

i dont think he's going large scale, i'm just trying to recommend against directly connecting to a SQL database from a dedicated server ๐Ÿ˜›

nocturne roost
#

So the general work flow would look something like this?
Client picks item up and sends RPC to server -> Dedicated Server then validates if pickup is legite using server knowledge such as location, if true sends an HTTP request to ASP server -> ASP server then uses EF to add item to players inventory in the DB

gleaming vector
#

yes

#

so, if you want to get real fancy

#

servers send the request with some API key

#

but you can have a Get Inventory http call that returns the player's inventory

#

and let clients access it

#

since they dont have the server API key, they wont be able to change things

#

so like your server could do something like

#

yourservice.com/api/push/inventory?apikey=abc123&inventorydata=whatever

#

and clients can do
yourservice.com/api/get/inventory?playerid=123

nocturne roost
#

Are API keys basically just, keys to allow the dedicated servers to send modification requests?

gleaming vector
#

yeah

#

it's just a param you check

#

for your inventory endpoint

#

if it's invalid, reject

nocturne roost
#

How would you dynamically assign API keys? So that when a new dedicated server is started by Steamworks or something to act as the master server it says "yes this is a valid server"?

#

Wait no

#

The ASP is the master server, so it would just spin off the UE4 server with an API key?

gleaming vector
#

just put them in the database

#

ie, create the api key, toss it in the db

#

when a server makes a request, check to see if the api key is a valid api key

#

by checking it against all keys

#

quick and dirty simple solution

ocean geyser
#

quick question, in your push functions (methods or whatever) do you do a normal check like if apikey == blablabla the push data and on the client dont do the check for an api key since its just a getter function to get the inventory?

nocturne roost
#

But the ASP server is technically the master server, and that is what creates new UE4 Dedicated Servers for gameplay?

gleaming vector
#

uh, no

nocturne roost
#

Wait no, there needs to be another server in here somewhere

gleaming vector
#

it's just an interface for your sql server

#

you can make it do that

#

but, you are on your own for that, i've never done orchestration like that

#

there is a good service for that

#

that is open source

#

i forget what it's called tho

#

starts with a k

nocturne roost
#

So the optimal thing would be

  1. Dedicated Server
  2. Master Server (the one players connect to upon launch, matchmaking, etc.)
  3. ASP.NET server for database queries
gleaming vector
#

thats it

nocturne roost
#

Something needs to be responsible in spinning up new UE4 servers, and therefore assigning an API key to that server, and probably other stuff such as heartbeat so it knows when to remove the API key from the DB

gleaming vector
#

honestly

#

to get started

#

just hardcode it

#

you can deal with the dynamic part later

nocturne roost
#

That's true, but what I said with the master server upon client launching the game seems to be the best case, because that master server would monitor the dedicated servers

gleaming vector
#

like, make a guid, remove the dashes, and voila, hardcoded api key thats hard to guess

nocturne roost
gleaming vector
#

you can do something like that

nocturne roost
#

The master server creates and monitors gameplay servers, and when it is created it asks ASP for a new API key to assign to the new gameplay server

#

The main drawback that I can see is that the master server will have one static API key

#

But anyway, I can't thank you enough for how helpful you've been, but thank you. It's a huge help

fading birch
#

I'm using a dedicated server for multiplayer. However, I want to have people be able to group up before they start match making and join a dedicated server. What's the best way to go about this?

#

When the client starts up the game, they aren't connected to any server, and only connect to one when they begin match making. Do I need to have a dedicated server for groups prior to that or can I just have them join the client which acts as a sort of listen server?

ocean geyser
#

why not create a multicast when the host tries to join the other server that has all the connected clients connect to the new server and then the host connects? just a thought for something similar

fading birch
#

That's what i'm not sure about. Is the best way of building a group before connecting to a dedicated server just setting the group leader (all clients initially) as a self listen server?

#

we're using Gamelift, which supports group match making easily enough, i'm just curious about best practices.

fossil spoke
#

@fading birch Probably PartyBeacons

fading birch
#

I had looked into those actually

#

wasn't sure if that was the best solution

#

i've never used them before.

fossil spoke
#

PartyBeacons are just Actors that enable RPCs between Players essentially.

#

Or at least, RPCs between the BeaconHost and the BeaconClients

fading birch
fossil spoke
#

Yeah PartyBeacons = OnlineBeacons

fading birch
#

neat

fossil spoke
#

The Player that is "hosting" (your group leader) will be the BeaconHost, other Players that want to join his party will become BeaconClients.

fossil spoke
#

The BeaconClients just let the BeaconHost know what their Unique Data is relevant to MatchMaking and then when the BeaconHost is ready, you send that stuff off to GameLift to get a Match result.

#

The BeaconHost can then let each of the BeaconClients know when to travel to the Server they were Matched into.

fading birch
#

are you experienced in using gamelift?

#

i'm currently reading through all of the documentation, but I had some UE4 specific questions

fossil spoke
#

Ive integrated it before yes.

fading birch
#

mind if I DM you some questions about it?

fossil spoke
#

Just ask me here.

fading birch
#

it's not really on topic, at least I don't think so

fossil spoke
#

Its ontopic.

fading birch
#

true lol

#

What are your thoughts on the GameLift Client SDK plugin?

#

it seems to be missing some key functionality

fossil spoke
#

We used to use that.

#

We dont anymore.

#

We use Lambda instead for calls into GameLift.

fading birch
#

ah ok

fossil spoke
#

Only the Dedicated Server interfaces with the GameLiftServerSDK

#

For obvious reasons.

#

We heavily modified the GameLiftClientSDK plugin but then said stuff it and went to Lambda.

#

It was much easier.

#

And safer.

fading birch
#

i've not worked with Lambda

fossil spoke
#

Lambda is really easy to work with.

#

Its online interface is quite easy to pick up, your writing the functions in JavaScript.

#

Its got some good documentation.

#

But you are right, the GameLiftClientSDK was lacking in functionality.

#

Its very bare bones.

#

Gives you the bare minimum to get sessions setup and joining them.

#

If your game isnt complex, you could probably get away with using it.

#

But if you want the more advanced match making stuff that GameLift offers you wont get far with the GameLiftClientSDK plugin.

timid moss
#

isn't matchmaking already provided by the OnlineSubsystem interfaces (ie. Steam/Xbox Online Subsystem)?

fading birch
#

I'm not using those

#

gamelift has it's own version of match making, called Flex Matchmaking

#

which looks over all of the fleets and game sessions you have

#

and i'll look into Lambda

#

is there a UE4 flavored guide for it?

#

i'm familiar with http protocols and the like, our backend is actually java and mysql entirely

fossil spoke
#

Nope, your completely on your own when it comes to anything else other than GameLift itself haha.

timid moss
#

Why not use the online subsystem matchmaking? Im thinking about what im going to do so curious why you decided not to use those

fossil spoke
#

Once you compile the Lambda binaries your good to go.

#

Well not quite good to go, you have to link those .dlls into the plugin your using to expose them to UE4.

#

There is a tutorial on that somewhere on the Web

#

@timid moss Depends on what your games complexity is like i guess and other systems you are using.

#

We use GameLift because we are using other AWS Services for Player Data Storage etc etc and other things.

timid moss
#

im just wondering if using online subsystem limits you. like it should work fine right?

#

i feel like it might be more complicated not using them

fossil spoke
#

If your using it now and it works then sure?

timid moss
#

o i havnt used them yet

#

im just trying to figure out what im going to do

bitter oriole
#

OSS works fine, if you use Steam

#

If you don't want to ship on Steam, it's problematic

ocean geyser
timid moss
#

lets say i want to ship on steam and console platforms. is that problematic then?

fading birch
#

it depends entirely on what you're trying to do

#

we're choosing to use gamelift because it's cheap

bitter oriole
#

You'll need to look at which features each platform OSS supports

fading birch
#

and we need scaling servers

#

to meet the needs

#

@fossil spoke thanks for the info, i'll look into Lambda

fossil spoke
#

๐Ÿ‘

fading birch
#

I have very little experience with node js, but i'm sure i'll figure it out.

fossil spoke
#

I was the same, but its piss easy once you have a bit of a go at it.

fading birch
#

atm we're just throwing our build on gamelift and i'm throwing the manually created gamelift session arn into our backend database.

#

yeah, we're actually using socketio for our chat

#

granted, I have one of our other developers working on that, since he's far more experienced with node js than I lol

fossil spoke
#

Why do you need to store the ARN for the fleet?

#

Your not using an Alias?

fading birch
#

we're just manually creating a game session at this point in time

#

I kind of had the gamelift stuff dumped into my lap

#

so i'm figuring it out as I go

fossil spoke
#

Oh ok

fading birch
#

i know it's not the most elegant solution lol

#

but it works for quick dirty tests that aren't locally hosted.

fossil spoke
#

Baby steps. There are alot of undocumented "gotchas" that i ran into as well just FYI.

fading birch
#

mmhmm

#

ran into a few of those myself already

#

the documentation for gamelift is also pretty shit

#

it says you should do xyz but not what xyz actually is or how

fossil spoke
#

Yeah, we have an Amazon Rep we keep in touch with. I usually let him know when stuff isnt right. We have found multiple bugs across their systems lol

fading birch
#

mmhmm

#

unfortunately my friend who works at amazon doesn't work in that department

#

he's in the echo dot area >>

fossil spoke
#

Its a large company lol

fading birch
#

some of the code that he's gone through is yikes

fossil spoke
#

Anyway, moving a bit offtopic. If you have anymore questions just ping me here.

fading birch
#

will do!

cloud apex
#

hello guys
does anyone know how often I can call FlushNetDormancy without losing performance?
Will it be fine to call it 2-3 times during one second or should i just switch dormancy for this second?

chrome bay
#

Doesn't matter because it won't go back to dormant state until clients acknowledge the last-sent state anyway

#

Should definitely avoid switching too often though.

#

If an actor is dormant for a short while it closes the actor channel, then you have to open up a new one which sends all properties again.

#

Including COND_Initial properties, etc.

#

@cloud apex

#

Dormancy can end up being more expensive if you don't use it correctly.

cloud apex
#

@chrome bay
Thank you. I didn't know about resending properties. Gonna do some refactor now

meager spade
#

dormancy is for things that maybe idle the entire game, like in Fortnite, the trees are all dormant, pickups are dormant once they are on the ground (don't need to be replicated anymore as they don't move/dont change)

#

kinda thing

timid moss
#

Hello guys. I was wondering how dedicated server management works when your game is published. Specifically the part where you choose a hosting service to host your servers like on Azure or something. So what I'm confused about is when your server isn't hosting any UE4 Dedicated server instances, does it shut down so that you won't be billed for any inactive moments? Or does it just stay on even though it's not running any Dedicated servers?

bitter oriole
#

You probably should build such a system, yes

#

Starting and stopping UE4 servers on your hosting provider is likely a service you need to build yourself

timid moss
#

I understand but I'm confused about what happens when, for example you close all of the UE4 Servers that were being ran on that computer server. Does the computer server stay on? And you still get billed for that time?

#

Like do you get charged even though the server isn't currently runnng any UE4 Serrvers?

chrome bay
#

I think it depends on the provider to be honest, but I wanna say probably yes

#

I would imagine that you'll always have to have a few servers running anyway, otherwise players won't be able to find any games.

#

I think Gamelift has some auto-scaling system where it spools up new instances as existing ones get full, but I don't know much more than that.

timid moss
#

It just bothers me that even though there are no ue4 servers running you are still being charged for the ACTUAL server that isn't running any UE4 servers. Is this just a widely accepted reality or something?

woeful ferry
#

Is there any way to see what the simulated ping is?

chrome bay
#

Yep, accepted reality. You will always need some servers running anyway

#

Even if nobody is playing.

timid moss
#

The bill probalby won't be as much though if it's not using as much CPU though right?

glad wharf
#

on basic server offers, you pay for a specific config, so yes you pay the same even if it's idle.

#

Amazon, Azure etc have offers with automatic scale for games, don't know how it works / how much it costs though

chrome bay
#

Yeah you just pay for a server spec AFAIK, and it's running all the time. They don't bill you based on how much the machine is being used because that's still a machine and/or a bunch of resources they set aside for you either way.

glad wharf
#

(Playfab, Gamelift...)

chrome bay
#

I think all of those automatic scaling things you have to manually do some scripting/interfacing with UE4 to get them fully working anyway.

glad wharf
#

However some are billed on the hour and monthly, meaning there is a maximum, but if you are careful about when you shut down the server, it will cost you less

chrome bay
#

Also this is why dedicated servers for indie games are overkill

#

If you must have them, pay to host a few official servers then use a third-party service to let players "rent" them

#

That seems to have worked out well for us

timid moss
#

intresting

glad wharf
#

which third party do you recommend for this kind of stuff?

chrome bay
#

Well we're using G-Portal and Nitrado. I've not had much to do with dealing with them directly, but the process seems pretty straightforward

glad wharf
#

good to know, thanks ๐Ÿ™‚

chrome bay
#

I think tbh it depends on your community as well, some cost more than others etc.

#

Unfortunately a 100 player game needs beefy servers ๐Ÿ˜ฆ

glad wharf
#

sure

timid moss
#

anyone know much about Agones? I started looking at it a little.

#

i still am kind of confused on what it's for but it looks kind of important

rain coral
#

Is there a way to extend FClientAdjustment and put additional info about the state of the character that the server sends back? What is the recommended way of doing this, and is there any guide that covers this?
In my case, resetting the position and moventmode of the character isn't enough, I also need to know the state relevant to climbing etc so that I can resimulate from the correct state

chrome bay
#

Don't think so. you'll need to create your own Server network data type, and override SendClientAdjustment to call some custom RPC's instead of the existing ones

bitter oriole
#

@timid moss Basically here is my opinion as a commercial indie : designing your game so that it never needs dedicated server, removes an immense amount of work to be done, and avoids costs that could possibly end up larger than the game revenue at some point in its lifetime. Specifically when it sells only a few copies every week buyt some players keep playing. Building instead a cooperative game, where you can simply play with friends without a dedicated server, is a much more reliable way.

rain coral
#

@chrome bay I see. Seems doable, thanks

timid moss
#

@bitter oriole I can see that. but going the method of a listening server doesn't seam secure when using a database to store player stats/progression. because if the player is the server it leaves room for potential database exploits since the server read/writes to the database right? It makes it easier for them to basically modify their player level/stats.

dull jasper
#

u can manage data with coud functions

bitter oriole
#

If you have a single centralized server for all player stats, then yes, you need dedicated servers to talk to that server

#

The point I'm making is that this kind of game design is not practical for indies

#

Singleplayer, or coop multiplayer games, are way, way less dangerous

#

(Technically and financially)

glad wharf
#

How do you manage Player discoveries NAT punch through etc with listening servers?

dull jasper
#

a database cost basically nothing tho

glad wharf
#

does Steam handle that for you?

bitter oriole
#

Yes, Steam handles that stuff

glad wharf
#

cool, good to know

dull jasper
#

cloud functions can also handle a lot, so u wont need to have a server up 24/7

bitter oriole
#

The database server isn't the tricky part, really. The tricky part is dedicated servers.

#

Database server that clients can write to is... not a great design

#

Unless all of the database data is easy to check for fraud, of course. Some games work well for that.

glad wharf
#

the database would need to be exposed through a REST or GraphQL like API to be accessed by a client securely

#

(on the server side, can be achieved relativly quickly with hasura.io and the likes)

bitter oriole
#

It's still not going to be very secure if you have no way to verify the gameplay

#

The technology is not the issue here

glad wharf
#

yes indeed

timid moss
#

If you market your game and hype it up correctly you could get patrons to help support the servers if your going dedicated server route.

#

i feel l ike thats a possibility

bitter oriole
#

Yes, it is. But think clearly about the likely sales of your game

#

Do a min sales, max sales estimate

#

Calculate your costs over a year

#

And do the math

timid moss
#

I just really like the idea of games with large player count. and that's really only possible with dedicated server since it doesn't render stuff. So thats kind of my inspiration

bitter oriole
#

Of course the problem with large player counts is that you need large sales

timid moss
#

very true

bitter oriole
#

If you sell say 1,000 copies at $20 on Steam, which is quite nice, you'll make $10k before tax, and you'll have between 10 and 50 online players, so only a few dedicated server instances to pay for during ~2 years. Calculate the cost of that, and see it if works out. It probably does. Do it for if you sell 10 copies, too.

#

Basically check that GamePrice / 2 is very much larger than InstanceCostPerHour * 24 * 365 / PlayerCountPerMap

rose egret
#

wait a minute. is there any indie out there trying to make dedicated server game ? lol

hazy siren
#

warframe manages to do authoritative rewards with the game itself being hosted on the players computer somehow

bitter oriole
#

All of them for some reason.

hazy siren
#

I'm not sure exactly what they do

bitter oriole
#

@hazy siren It's possible that a spectating client connects to the game to check what happens. AFAIK, Destiny does the same, with no dedicated servers other than to serve this kind of authoritative stuff.

#

It's definitely much harder

hazy siren
#

they do something to verify the gameplay but it's not live

#

you can start a game, disconnect your internet, play the entire mission, complete it, then re-activate your internet and receive your rewards

#

and because the rewards includes drops you have to physically run over there's some level of trusting the hosting player

#

a few years ago there was some issue with people being able to send forged messages and claim stuff without actually playing but it doesn't seem to happen at any noticeable scale now, I've always been a little curious about what they do maybe I'll dig into it

bitter oriole
#

Then they probably upload a replay of sorts

hazy siren
#

it's really forgiving on the time, too, I had my internet go out mid game once, it stayed out for a couple hours and when it came back on it completed normally

#

and yet theres a robust player economy without any of the signs that people are able to just magic up loot

stoic nimbus
#

I'm trying to wrap my head around the NetworkPrediction plugin, so far I've implemented my own basic simulation/movecomponent based on the flyingmovement, it's working fine but the "RepProxy_Simulated.bAllowSimulatedExtrapolation" flag seems to be producing weird behaviours for remote pawn. Either I turn extrapolation on and my movement keeps on going for a long time (like 0.5s) before teleporting back to it's final destination, or I turn it off and I see a lot of acceleration/deceleration during movements. Is there a good way to reduce those ? Would you recommend turning the flag on or off ?

fleet raven
#

you are not supposed to use it yet

#

they are still writing the thing

rose egret
#

guys how you write pickup for a fast peace FPS game ?
do I need to apply the pick up locally or just send an rpc to server and wait for result ?

grand lance
#

has anyone gotten steam to work with gamelift?

#

i get incompatible_net_id warning when a client that uses steam to connect to a gamelift server. but i dont know if gamelift can host a game with steam enable

eternal anchor
#

@bitter oriole or do it Conan Exiles way, where they bundle dedicated server with game and when you want to play coop it simply run the instance of server locally ? (;

#

i found that making game to use listen servers extremly painful compared to dedicated/standalone

#

you get issues of both, for no quantifiable benefit at least for me.

rare gyro
#

Is there a ticks per second counter for dedicated servers? Looking for the variable.

fleet raven
#

running a dedicated server locally will double your memory usage

#

and increase cpu load

rose egret
#

is there any article , document , .. to show the usage of net dormancy ?

winged badger
#

won't be noticeable if you have enough cores and RAM

final thicket
#

Reliable (TCP) are assessed in the order they are sent right? ๐Ÿ™‚

bitter oriole
#

@eternal anchor IMHO listen server is way easier than dedicated. Players launch the game, can seamlessly join or be joined by a friend, no setup of any kind required ; and for developers it's literally zero effort.

#

@final thicket Reliable is not using TCP AFAIK

#

But yes order should be maintained

final thicket
#

Oh, what protocol is it using?

bitter oriole
#

Everything is UDP

#

Except "Reliable" implements cheap TCP-like features on top

final thicket
#

That's really interesting, so they just added the functionality in engine

winged badger
#

@bitter oriole it can get tricky keeping the game thread on listen server down to acceptable time

bitter oriole
#

Compared to running a full dedicated server on the same machine ? please

winged badger
#

it does do everything clients and server do on a single gamethread

#

3 years in, it accumulates

bitter oriole
#

But then your dedicated server still needs to run the entire server code for every player, which will dwarf the client game code

winged badger
#

compared to running all server code for every player + additional 7-8ms to run client code

#

in that aspect, at least, dedis are easier

rose egret
#

๐Ÿค”

winged badger
#

probably the only aspect in which its easier to do dedi then listen though

rose egret
#

what if the map is so big and listen server cant load that much graphical assets ?

bitter oriole
#

Same issue on dedicated then

#

Dedicated loads everything too

rose egret
#

but not mesh and texures

bitter oriole
#

Textures are stream based on the client so that won't change anything, listen or not

final thicket
#

Unseen graphical assets are not very expensive no?

#

Doesn't dedicated server only load hitbox's as well?

bitter oriole
#

Dedicated loads full meshes

#

Just like the client really

winged badger
#

complex trace would fail with only hitboxes

bitter oriole
#

The difference is null on GPU

rose egret
#

if its listen server I cant load the map practically by level streaming ?

final thicket
#

Only for CCD?

bitter oriole
#

No, anywhere

final thicket
#

Really seems wasteful

bitter oriole
#

No, it's required

final thicket
#

To load the mesh's without collisions?

bitter oriole
#

Weapon fire will usually trace for visibility

#

So you need the full mesh

winged badger
#

dedi could get away with not loading textures though

bitter oriole
#

^ but the client playing on the same machine, won't

#

So it changes nothing

rose egret
#

huuum you solved one of my future problems ๐Ÿ™‚ I wanned a listen server open world ๐Ÿ™‚

winged badger
#

well, if you're running both on same machine, you wouldn't end up loading the textures twice

#

since 2 unreal processes don't share resources

bitter oriole
#

As to CPU - Let's assume your 5 players all need 3ms on server, and the client needs 8ms - then you just lost 60fps alright, down to 40fps. Separate dedi instance would fit just right for 60fps. But then again, the dedicated server alone was 15ms on game thread to start with, very close to not running 60fps either...

#

So yeah, it is a possible optimization

#

At the cost of much worse user experience imho

#

As in, sure, people will do it - but the barrier of entry makes it less likely

eternal anchor
#

you don't need full mesh

#

just collision data

#

either way I have unfortunete pleasure of working on listen server now

#

and from development point of view

#

NEVER AGAN

#

AGAIN*

#

won't touch it wil mile long stick

bitter oriole
#

What's complicated about it ?

#

(been doing it for a year or so)

eternal anchor
#

can't logically split behavior

bitter oriole
#

Split how ?

eternal anchor
#

with client-server model I can assume somet things run on either but never on both, for example server will always handle loading player data

#

on listen server well not that obvious who should have authority about it

bitter oriole
#

I really don't see the issue here. The host has authority, so you just send all the data there, handle the spawning there just like a regular dedicated

#

In my game the client save data is RPC'd to the server on login, the host spawn assets for the new client, and that's it

#

I don't see how different it would be for a dedi

eternal anchor
#

yeah I ended up doing the same

#

but I don't like it

#

;p

bitter oriole
#

... okay ? That doesn't sound like "NEVER AGAIN" stuff to me

#

Compared to say, having to work from engine source, shipping two different executables, etc

eternal anchor
#

well for me it is way easier

#

compile in few minutes

#

deploy and run

#

and I have server and two exactly the same clients without client + server in one executable

bitter oriole
#

๐Ÿคทโ€โ™‚๏ธ vs nothing to compile at all

#

Anyway, perspectives I guess

#

I did both for a few years and imho listen is incredibly easier

eternal anchor
#

unimaginable for me, there is always some creeping gameplay issue behind corner -;-

#

or maybe

#

i just have way more experience creating dedicated servers

bitter oriole
#

The only additional listen-specific behaviour I see in my game is needing to smooth movement on the server when client input runs at a much lower framerate

#

But I'm skeptical as to whether the dedi could work without

#

Plus it's literally 10 lines

rose egret
#

how do I draw debug NetCullDistance ?

fleet raven
#

all my stuff works with both listen server and dedicated, it doesn't really seem any more complex than not

#

sure there is a few extra branches here and there but that's not a major problem

cedar finch
#

So I hide bones on my zombies such as arms and legs, for my dismemberment system. It works but If I shoot a shotgun into a horde of zombies it's just too much to handle and clients desync for a few seconds. What's the proper way and place to handle this system? In the zombie blueprint I simply check for the closest bone to where he was just shot and then hide it if it's not already hidden. It's all ran on a OnServer event. As you can see in the graph, It spikes really high when I shoot into the horde of zombies. It's just too much for the network to handle.
https://i.gyazo.com/02a21e1a1476a2a0b72343279275321d.png

cedar finch
#

If anyone out there with more experience can tell me if the second graph is acceptable I would greatly appreciate it. ๐Ÿ™‚

eternal anchor
#

reliable RPC are limited per frame

#

once you hit limit it blockes other packets until reliable RPCs are processed

chrome bay
#

If you drop reliables you get kicked instantly IIRC

cerulean escarp
#

hey guys, just a quick question. I'm setting up a points system for my game and I wanted to know if simply setting the player's points variable to replicated could prevent cheaters

chrome bay
#

It won't prevent cheats no

cerulean escarp
#

where and how should I store it then?

chrome bay
#

preventing cheats mean architecting the game in such a way where the server is authoritative over the state of the game.

#

Whether a variable is replicated or not isn't really in the same vein

bitter oriole
#

Preventing cheats require a complex balance of client-side anticheat measures, server-side validation and authority over data, and reporting & banning systems.

chrome bay
#

Imagine that all data you get from the client is complete nonsense, and have the server deal with it.

cerulean escarp
#

by preventing cheaters, I just meant preventing them from changing that one variable

chrome bay
#

You can't stop cheaters changing a value on their local machine

#

totally impossible

#

What you do is just make sure that if the client ever tells that value to the Server, the Server doesn't blindly accept it.

bitter oriole
#

You can't prevent cheaters from doing absolutely anything on their local machine, if we're being real

chrome bay
#

Yeah exactly

bitter oriole
#

Cheaters cheat by changing things on the server too

cerulean escarp
#

let's say I have an array of player's points in the game state. If a player kills another player, the server detects that the killed player is dead and retrieves a reference to the killer. if the server then changes the point value in the array (at the killer's index) would that work to prevent someone from just changing their points client side?

bitter oriole
#

They can always change whatever they like on the client

#

It just shouldn't matter.

chrome bay
#

Yep. The trick is to make sure it only ever affects them, and not the server nor anyone else

cerulean escarp
#

I mean changing it on client side and then that gets put on the server

#

I am fully aware that people can change anything clientside

chrome bay
#

You can't change any server-side values unless you're sending RPC's to it asking it to do so

#

So everything the client does should be validated

#

How you handle that is entirely up to the game

bitter oriole
#

Clients do not have the authority to change GameState

#

Or server-side data

#

Clients can only call RPCs

#

So secure that and you'll be fine

ocean geyser
#

a quick example, lets use health. lets set health to replicate. since we know we dont want a player to be able to change their health (like with a memory editor like cheat engine) we know that the server must have authority over our health. this means we should only change our health from the server. so lets say our health is at 10 and we open cheat engine to change it to 100. the client that did this will see their health as 100 until the server changes their health value (for example if we got shot) in which case their health gets set back to what its suppose to be which would be a value less than 10. the client can alter the value all he likes but the server has authority over it. just a quick example

#

someone correct me if i made a mistake

chrome bay
#

Think of the client as toddlers asking an adult to do something for them.

#

The adult says yes or no, and if it has to say no too many times, it boots the little shit.

cerulean escarp
#

one more question, is there a way to know on a client (specifically inside the playercontroller) when it has joined a session?

#

oh wait I guess beginPlay does that in a way

fading birch
#

@cerulean escarp there is on post login in the game mode.

cerulean escarp
#

oh that works even better, thank you!

analog rover
#

Does anyone know if there is an event that triggers when PlayerState is created in multiplayer?

#

Right now I have a UI widget created on PlayerController::BeginPlay(), and it tries to pull information from PlayerState, but the PlayerState is coming back null initially

fossil spoke
#

@analog rover Both the PlayerController and the Pawn classes have an OnRep_PlayerState function as their PlayerState properties are Replicated.

#

That would be a safe time to access the PlayerState.

analog rover
#

@fossil spoke will that get replicated on the initial creation of the PlayerState?

fossil spoke
#

Yes

analog rover
#

Will it also happen for the player running the server? (In the case of a listen server)

fossil spoke
#

Most likely, the Server should also be calling OnRep_PlayerState itself i assume. Would have to check the code.

analog rover
#

Great! Thanks for the help!

chrome bay
#

The Server doesn't call OnRep_PlayerState itself, In C++ you have to manually call OnReps on the Server and AFAIK none of the game framework does that.

#

But yeah, OnRep_PlayerState() will be called on clients when the player state pointer changes (not when the properties of said playerstate change though)

glad wharf
#

Hi everyone, I'm using a SpectatorPawn, I was sure that it worked out of the box with networking, however I'm not so sure anymore as if I play as standalone editor + dedicated server, I can't make it move, as if the server was overriding my inputs

#

or at least something strange is happening, as even by sending my local transform to the server with a RPC, nothing happen.

#

(it's a child spectatorpawn so not handled as a "spectator")

#

ok it seems to be a bug with VR being involved in the mix.

rose egret
#

if I destroy replicated actors on server, will the server take net relevancy into account or it just destroys the actor even if they aren't in the net cull distance ?

winged badger
#

if they are spawned at runtime, they won't even exist unless they were in net relevancy range

#

on clients

#

client doesn't keep out of data actor around, it destroys it when its not relevant

#

not sure for actors loaded from the package and explicitly destroying them while out of range

rose egret
#

wait. client destroys the replicated actor if its outside of relevancy ? why ! I don't want that

winged badger
#

it spawns it again when it enters the relevancy range again

rose egret
#

then I have to change my whole design. is there any reason that client destroys the actor ? doesn't make sense for me

#

btw my pawn has references to actors that are outside of relevancy ! so they become null ?

#

๐Ÿ˜ฐ

winged badger
#

you should override the IsNetRelevantFor then

#

to keep them alive if they happen to be referenced by the pawn

chrome bay
#

Yeah the client will destroy them if they aren't relevant anymore, that's pretty much the whole point of relevancy.

bitter oriole
#

Once ever for each client.

#

You will receive it on late joining

chrome bay
#

You'll also receive it if the actor goes out of relevancy range and comes back again, or if the actor "wakes" from dormancy

zinc garden
#

Is there any way to simulate a large-scale multiplayer battle and how player numbers would affect ping/performance without hosting a stress test with real players?

#

I have a game idea but it hinges on having decent performance at around 100 players per server, so I want to be able to test out things as I keep developing the game, and at each step of the way make sure what I implement doesn't tank network performance

fleet raven
#

run 100 clients on cloud servers

zinc garden
#

Yeah that's what I imagine would have to be done too :/

#

Wonder if there's a service that offers that

bitter oriole
#

A service that would run your UE4 game clients, have them connect in some automated way to your game server everytime you update the game ?

#

This is going to have to be part of your company's continuous integration setup

zinc garden
#

Yeah, it would be rather tricky to get the clients on the cloud updated each time you'd make a change, so a SaaS for that would probably not work.

#

Guess the only choice is to get 20 computers to run 5 clients each. :/

bitter oriole
#

100 players per level is dumb anyway

fleet raven
#

yeah, if the game requires 100 players to work, you better have fortnite-level marketing to ensure there are enough players for matchmaking to not take 3 hours...

bitter oriole
#

Reminder than less than 5% of all Steam games ever reach 100 online players

#

Reminder than 100 online players usually mean 10,000 launch sales at least

tiny relic
#

That doesn't make it "dumb".

bitter oriole
#

You don't think it's dumb to bank your entire game on being a breakthrough hit ?

chrome bay
#

Launched 100 player game (continues to be relatively successful)
Would absolutely never do it again

#

Without a good size team, QA, a publisher and somebody else's money, forget about it.

#

I mean if you're doing it for fun good for you, but don't remortage your house for it, that's all.

fleet raven
#

somebody else's money

chrome bay
#

๐Ÿ˜„

bitter oriole
#

Maybe "dumb" is a bit agressive - I'm not saying people trying something are being stupid. What I mean to say is - any mistake instantly kills such a game, and it's going to be a high investment effort.

zinc garden
#

I know that getting 100 concurrent players in matches tends to be an issue and that dead indie multiplayer games are common.

#

It's not 2003 any more where all players in the world either played Q3, UT2k3, Tribes or CS 1.6 ๐Ÿ˜›

#

Being free to play and with fornitesy graphics ought to help a bit though hopefully.

#

But yeah, I think having "100 player servers" as a marketing thing can be a good thing though. With survival games and battle royales, you're kind of expected to be able to reach those numbers at this point

#

Even if realistically people would just play with up to say 20 players on a server, just the fact that it could reach 100 is a selling point

rough iron
#

Does anyone know why i can't join a session through steam? I have two different steam accounts but no matter how much i click on the server i have hosted, i can't join it!

#

I have set everything in the ini file and in the .build files. I am also using the advanced Sessions plugin

jolly siren
#

Are you testing from two different machines? Or a vm?

rough iron
#

two different machines. On different networks

jolly siren
#

What is the error that join session is giving you?

rough iron
#

though one of them is mobile data. It doesn't give me any but when i try it locally without steam it does work

#

but if steam was working i wouldn't be able to find any servers, which means steam is set correctly, no?

jolly siren
#

So there is nothing in your logs after clicking join?

rough iron
#

how do i bring the log up?

#

because i was using print

jolly siren
#

It will be under Saved/Logs

rough iron
#

that seems to be the log in the engine i am referring to a build version

jolly siren
#

Saved/Logs

#

Is this a shipping build?

#

Did you distribute it via steam?

#

Or just packaged and copied the directory over?

rough iron
#

i selected development as i always do and no i had to upload it to google drive and then send it over to my friend!

bitter oriole
#

Saved/Logs then

#

On your friend's machine

#

In the game dir

rough iron
#

what should i be looking for? Errors?

jolly siren
#

yeah any warnings or errors around the session joining

bitter oriole
#

You probably want to log everything that happens, on both sides. Add logs everywhere in your code, and then you can read them

rough iron
#

i get a lot of these

#

LogOnlineSession: Warning: STEAM: Unknown or unsupported data type from Steam key data type 04109775241103101258

#

I googled it and it has to do with dedicated servers where mine is not a dedicated server. Host is the player

rose egret
#

does UE4 sort replication of actors by distance ?

#

given the assumption I have 1000 relevant actors all with the same config and a changed property. how are they replicated ?

hoary lark
#

@zinc garden if a game is advertised with "up to 100 player battles" and most players go and only see 15 people online you get a lot of negative reviews saying "no actual players". self destruct mode initiated.

shy kelp
#

since inventory is mainly in UMG, do u need to secure that?

bitter oriole
#

UI in general should not have anything to do with multiplayer

#

Use an actor or a component for the inventory data, and show what's locally on the client in UI

spring ingot
#

@rose egret Look up Replication Graph

rose egret
#

complicated ๐Ÿ™‚

spring ingot
#

There's a relevancy and dormancy system as well

rose egret
#

are root scene component's properties replicated by default ?

rich cradle
#

up to how much of a ping do you guys usually test your movement replication?

hasty adder
#

Just a quick question - refresh my memory. ue4 steam stuff does not auto do a nat punch type thing in ue4 as in.. you still need to configure and open ports right?

#

as far as you r computer firewall and router.

ocean geyser
#

afaik yes i always port forward 7777 and it seems to be good to know. i think steam does it for you though if you go that route

normal jacinth
#

Hi, I have a Character that is replicating, and I want it to send a message to another actor without that replicating. I've tried creating custom events that 'do not replicate' and 'run only on client' but the message is still always replicated to all clients. Does anyone know of a way around this?

#

(i'm using blueprints)

royal abyss
#

how do I make games with local/online multiplayer work

meager spade
#

@royal abyss that is very broad. Much like asking how do I make game

royal abyss
#

hold on

#

So it's mainly Local mutliplayer that i'm confused on

#

How do I make it look good? Do I just do the traditional 4 player split screen

meager spade
#

Local is broad aswell

#

Local could be lan or split screen or both

royal abyss
#

Lan kinda falls into online for me

#

since the screens are seperate

spring ingot
#

Has anyone here worked on a custom OnlineSubsystem or net driver in UE? Docs from Epic are pretty thin, so been reading through the code.

ocean geyser
#

^would like to gather info on this as well

spring ingot
#

Thinking about ways to setup a distributed server architecture. I do IaaS/PaaS and low-level networking for a living, that part's easy for me, but trying to figure out a decent strategy for steering clients on the UE side

#

I see the Steam net driver is basically a pretend socket driver that just uses the Steam relay tunnels underneath

#

That might be overkill for what I have in mind though. I think distributed servers/client steering can work with just orchestrating the client/server session management

#

Since servers don't talk to each other or know about each other, I'm just thinking something along the lines of overlapping transition area between two maps on two servers, client connects to second server when approaching, streams in new map, starts replicating to new server in parallel, unload old map after passing through area, disconnect from first server

#

Origin rebasing and world positions in theory wouldn't be a concern until the authority handoff

#

This is very similar to how Destiny handles changing zones.

#

Another option is a session proxy that all clients go through, that handles the server session handshakes, and can multiplex to multiple servers, so clients don't know they've changed servers, just maps/origins

#

A reference for the server session protocol would be handy there :P

shy kelp
#

oops wrong channel

ocean geyser
#

looking for a little guidance here on where to get started. im familiar with the online subsystem with creating/find/joining sessions as well as through steam. im trying to have it so a player can host their own listen server (outside of steam, just on their own) and have others be able to find the session hosted. im trying to figure out how people generally go about this with UE, are they creating their own online subsystem? are they modifying the NULL subsystem? i understand that i need to create a master server to have the servers advertise themselves which i can probably do without to much trouble, but what im not quite sure on is what the general way is that people go about creating these sessions to advertise on their master server

spring ingot
#

The default online subsystem doesn't provide any matchmaking capability, so you'll have to provide your own. The Online Subsystem provides the basic building blocks necessary to match players up to active sessions. It does not provide any specific type of matchmaking built-in with the base implementation. However, implementations on platforms that provide matchmaking services do expose access to those services. from https://docs.unrealengine.com/en-US/Programming/Online/SessionInterface/#matchmaking-findingsessions

#

So you could run a web service that provides a list of ip/port combos

#

And query it in your custom subsystem

ocean geyser
#

never actually saw that page, reading now. thank you

spring ingot
#

It's also possible it will pickup LAN servers automatically, if you enable the option

ocean geyser
#

@spring ingot thank you but im not using blueprint or hosting via steam as i already know how to do all of that. what im trying to do is setup a master server (probably using asp.net as thats what i used before to create a simple web api for my client applications) and when a player tries to host a listen server from in the game have it advertise the server on my master server so that other players can find it, pull info necessary info from it, and connect to it.

spring ingot
#

Sure. So then yeah, you could use simple HTTP verbs to POST/DELETE servers from the list, and have the clients GET to find ip/port combos

ocean geyser
#

the part im confused on is where/how do people normally implement this functionality inside of their game. thats why i was wondering if people make their own online subsystem or modify the null subsystem and that sort of thing

spring ingot
#

So you can make a custom session and add in your functionality, and tie it to your game mode

#

That looks like the way it's intended to be customized

ocean geyser
spring ingot
#

While the session interface performs all of the session handling, the game doesn't generally interact directly with it. Instead, the Game Session, AGameSession, acts as a game-specific wrapper around the session interface and the game code makes calls to it when it needs to interact with the session. The game session is created and owned by the game mode, AGameModeBase, and also only exists on the server when running an online game.

ocean geyser
#

thats good to know

cedar finch
#

I'm making a dismemberment system similiar to call of duty zombies. The only part I'm not sure about is the spawning of the dismembered limb. Should I spawn it on server? Or is that too much? From my calculations it "could" possibly have to spawn 100 limbs at one time if a player somehow managed to shoot a horde of zombies and blast each of their limbs off. Ideas? I just want it optimized

ocean geyser
#

well what in the world could the player be shooting in order to it detach 100 limbs? is this a dedi server?

cedar finch
#

It's a listen server. So here's the worst case scenario. A player gathers up a horde of 25 zombies (which is the max I allow). Then he gets an upgraded shotgun that shoots 8 pellets aka linetraces, and the shotgun has penetration. So he unloads the full auto shotgun into the horde of zombies and manages to dismember all of the limbs for each zombie in the horde. That would overload the network ๐Ÿ˜ฆ How can I spawn the limbs but not replicate it? Is that possible. It's not a necessary thing for gameplay, it just looks cool

ocean geyser
#

what about replicating the event and spawning them on the client instead? such as create a struct containing a reference to the zombie and an array of limbs to be dismembered, figure out what zombies and what limbs need to be dismembered from the line traces, send that info over the network and have the clients do all of the spawning/dismembering?

cedar finch
#

Hmmm So I'm still confused. So this is the way I've got it so far, The player shoots the linetrace, the linetrace calls the "was hit interface". The zombie recieves the was hit interface which let the zombie know where he was shot and who shot him. Then the zombie dismembers himself accordingly and give the person points.

ocean geyser
#

need the source version of UE4, need visual studio installed. must create a c++ class (just an empty class as there doesnt need to be any code in it) and compile it with visual studio. from there you need to do other settings but theres a full tutorial on it on youtube with blueprint

cloud ledge
#

@twin juniper what are we calling an online game - how many players, 2-10, 10-30, 30-100, or more than 100?

#

2-10 you can do with blueprints

#

You're likely gonna have to touch on a bit C++ for something like that, but it sounds do-able in just the blueprints for most of the work

cedar finch
#

@ocean geyser So since my linetrace is runOnServer the zombie does his dismembering onServer as well so I just simply set a few OnRep boolean variables such as "hasHead?", "hasLeftLeg?" etc. and hide the bones in the OnRep for clients. I just can't figure out how to do the spawning of the limbs like you said. It makes sense to let clients do their own spawning I just don't know how to get off of the Server event i'm on and
make every client spawn a limb

cloud ledge
#

I don't think so

#

4 players is very manageable

#

UE is written in C++ and you'll encounter it for anything non-trivial

#

You can do most things with blueprints

ocean geyser
cloud ledge
#

It won't give you same performance as C++, but it can get close enough if we're talking about a 4 player game

ocean geyser
#

@cedar finch create the struct containing the reference to the zombie and an array of bones to dismember. create an OnRep array of that struct. on the server when the line trace hits the zombies and such have it fill that array with the required info. in the onrep have it loop through that array and do what it needs to to dismember the bones and such for each hit zombie

cedar finch
#

I don't want the limbs to spawn later though. The OnRep is more for a state of something and spawning the limbs that go flying off is just an aesthetic one time feature. If I spawn them in the OnRep then a player that's not network relevant that becomes network relevant would see tons of limbs start spawning all over the place lol.

ocean geyser
#

multicast and pass in that array then for a one time event

cedar finch
#

So doing that should only use one multicast RPC and then spawn the limbs locally for each client correct? Instead of 100 RPC's right?

ocean geyser
#

pretty much since your just spawning everything on the client instead of the server. when you spawn them for the host you will want to figure out how to make it so that the limbs dont spawn on the connected clients (only spawn them for the host)

cedar finch
#

Thanks Cody ๐Ÿ™‚ I'll give it a try.

cedar finch
#

Anyone know why today my netprofiler is not creating files? It worked yesterday but today when I enter the console command "netprofile enable" and "netprofile disable" nothing is created. ๐Ÿ˜ฆ I only have files from 4/9/2020 and nothing from today ๐Ÿ˜ฆ

meager spade
#

1010? that long ago

#

geez

cedar finch
#

Hahahahaha whoops

#

But foreal why is it not working? I tried restarting ue4 and everything ๐Ÿ˜ฆ

meager spade
#

no idea :/

cedar finch
#

Wait.............

#

It moved them to the top because of the naming convention

#

4/10 gets put to the top of the list so I have a bunch of 4/4, 4/5, --->> 4/9 then I couldn't figure out where 4/10 was. Turns out it was at the very top. ๐Ÿคฆโ€โ™‚๏ธ

cerulean escarp
#

hey guys, I'm using AdvancedSessions in my game and I'm having an issue where when I press the "refresh" button to find sessions it can never find my server (this only happens on packaged builds). I am running the server on an AWS server. I am able to connect to it if I type open <ipaddress> into the console. I don't have this problem when running a dedicated server through PIE. I am also running the server with -nosteam, and I do not have steam open when attempting to connect on my computer. any ideas?

ocean geyser
#

@spring ingot question, i made a small webapi to test with and in UE when you create the server and travel to the new map i have the gamemode call a custom function i made called Register, that function sends a few things to the webapi (server name, max players, and test ip 127.0.0.1) and i was able to retrieve it just fine. my question is what information should be send as connection info? should i go the route of sending the ip address of the server to the webapi so clients connect to that?

spring ingot
#

I'd think so. Not sure how else you intend to get clients to connect if not. Other than custom DNS or some kind of proxying, that is

ocean geyser
#

figured, wasnt sure if there was something special but i figured id check. thank you

spring ingot
#

Nah, if it's internet connections, that's how you'll have to do it

chilly mason
#

nothing more annoying than having to fix desynch bugs

weak dawn
swift cargo
#

Can someone lead me to a video or something that could help me with lowering another clients "health" variable using the server? i tried everything and im so lost, how do you even reference someone you hit? you can only cast to a blueprint but that blueprint is the one ALL clients use.

thin stratus
#

Not every actor exists on all players. And a reference is always based on where you are right now.

Usually you want to go to the server already when the player executes input. E.g. via a server rpc.

#

@weak dawn looks like they don't like that floor? Does that happen on other surfaces too.

swift cargo
#

What do you mean not all actors exist on all players? @thin stratus

weak dawn
#

Yeah

thin stratus
#

@tall pine you can check things like "HasBegunPlay" if that helps

weak dawn
#

No, only the elevator surface bugs out. I'm new to all the replication events but it works fine on the server...

#

That could be because the server owns the actor or something.

thin stratus
#

@swift cargo Well you wrote that the actor you reference and then cast to is the one all clients use. That's maybe true, but things like PlayerController or GameMode have special rules. They don't exists on all players equally. Server and Clients have each their own bubble with actor instances. Some replicated some not. Did you read the compendium that is attached to this channel?

#

@weak dawn looks more like they are fighting over falling/walking

#

The surface might be slightly lower on the client

#

Client says he is falling, then server corrects him back upwards

#

Then he says he's falling again

weak dawn
#

Yeah....

thin stratus
#

Make sure the elevator surface is in sync

weak dawn
#

It's odd because some times it works fine

swift cargo
#

I feel stepped on for even asking. why am I here?

weak dawn
thin stratus
#

I simply asked if you read the compendium. @swift cargo

#

@weak dawn yeah

#

That could get out of sync

weak dawn
#

Yeah, it could. But what would be more effective/safe?

thin stratus
#

You should try to move the whole actor on server and client and in addition enable replicated movement on it

#

Still not pretty with higher pings, but we don't really have something for that problem in bps

swift cargo
#

I haven't read it. I don't know of it.

thin stratus
#

Then please check the pinned messages of this channel. It should help you getting started

#

I won't link a heath reducing tutorial. You should be able to find that yourself if it exists. I'm more for learning the basics so you don't need that tutorial.

tall pine
#

@thin stratus : so we should still go with replication, but just check to see if we have initialized yet?

normal jacinth
#

Hi, I'm wondering if anyone can help with a hopefully simple question. I'm trying to get objects to highlight if a player looks at them, but currently the objects highlight for ALL players because the player characters are replicated. How can I call a function from a replicated player character, without that message replicating for everyone? I've tried running it through custom events that don't replicate, or only run on server, but these don't work. Any help massively appreciated ๐Ÿ™‚

tall pine
#

@normal jacinth : why would a function on a replicated player would be broadcast to everyone? Unless you're the server and the function is multi-cast, that function call shouldn't be broadcasted to everyone

normal jacinth
#

That was just an assumption of mine; the object is highlighting for everyone, even though the function is not replicating

#

I've set the object not to replicate either, even though I do need it to

tall pine
#

you can set the breakpoint on the function on one of the client and see why it gets called?

#

The client that you don't want to see the highlight

normal jacinth
#

I'll look into that; I'm not experienced with debugging in multiplayer

normal jacinth
#

it seems to work fine in PIE, but breaks in Standalone

#

I've made some progress; if I set the function to 'Run on Owning Client' it doesn't replicate from the client, but it does still replicate if it's from the server

normal jacinth
#

I narrowed the problem down to the first person camera, which is replicating, as it need it to for something else

swift cargo
#

Any ideas why this isnt working?

#

When event anydamage is hooked up to a printString it DOES NOT print anything. so i dont know what i did wrong, im hitting just fine.

normal jacinth
#

are APPLYDamage and ANYDamage different functions?

swift cargo
#

Aren't they made for each other?

#

@normal jacinth

normal jacinth
#

I'm not sure, but that would seem to be where your issue is

#

try making a custom function

swift cargo
#

all the tutorials done on multiplayer damage use this format

normal jacinth
#

ApplyDamage is being set on the actor your trace hits, but AnyDamage is being called on the actor that is dealing the damage

#

so unless you're damaging yourself I wouldn't expect that to print anything

#

not sure how your project is set up though

swift cargo
#

Anydamage is called when you take damage from apply damage. so if im shooting another player it triggers THIER "anydamage".

#

right?

normal jacinth
#

oh they're all the same class, ok

#

not sure then, sorry

swift cargo
#

"RAT" is the player, all players use "RAT"

#

Anything wrong with this? because it dont work... @normal jacinth

normal jacinth
#

does the line trace succeed?

swift cargo
#

The Server prints "Hello" with each connecting hit. so i assume so

#

@normal jacinth

meager spade
#

you cant access a node across RPC's

swift cargo
meager spade
#

you need to pass that into the RPC

normal jacinth
#

yeah you need to plug the actor that you hit into the custom event

meager spade
#

Server Damage should have a input pin Actor

#

and your function call should take the hit actor

swift cargo
#

"cant add pins on this type of event node!" @meager spade

meager spade
#

?

#

you can add pins to a RPC node

swift cargo
#

i cant add the object reference

#

it just wont take it

meager spade
#

why can't you?

swift cargo
#

i dunno, it just says i cant.

meager spade
#

click on the RPC node

#

in the details panel

#

click + next to input

#

select Actor as the type

swift cargo
#

"Actor Layer"?

meager spade
#

no

#

Actor

swift cargo
#

the fruck

#

it takes it now

#

ok good

#

It works now, i have no idea how it works so imma go stare for a while.

#

thanks for your patience and help @meager spade

meager spade
#

np

swift cargo
#

So wait, when im casting to something, im not really acting as that object?

meager spade
#

?

#

casting is letting the engine know what that object should be

swift cargo
#

i see

#

ok

meager spade
#

so for example

#

Rat is a Character, which is based on Pawn, which is based Actor, which is based on Object

#

you can store Rat in a Object reference, but when you access that Object reference, you can't access any of Rat's functions/properties, cause the engine only knows is as Object. This is what casting does, it tells the engine, this Object is a Rat.

swift cargo
#

my brain just grew

meager spade
#

so that HitResult

#

stores an Actor

#

for the reason, you can hit ANY actor

#

it doesn't care

#

but you care cause you want to call a function on a specific Actor

#

so you cast that Actor to Rat, so you can access its stuff.

#

if that Actor was NOT a Rat, the cast will fail.

swift cargo
#

I see.

meager spade
#

also with regards to your bp above

#

when you call a RPC

#

it runs on a different copy of that blueprint

#

thats why it didn't work

swift cargo
#

ah

meager spade
#

so the Server didn't have that hit result

swift cargo
#

also, one thing. the hit goes through 1 or 2 times and then ceases.

meager spade
#

could be anything :/

swift cargo
#

im running 2 windows in the engine

#

with dedicated server on

#

๐Ÿค”

meager spade
#

yeah without any context, that's like asking me what the colour of your hair is ๐Ÿ˜„

#

or if you have hair.. :/

swift cargo
#

heck

normal jacinth
#

I solved my earlier problem if anyone is interested; I'm replicating the First Person Camera as others need to see your camera's position. So when I call it for line traces, the server was actually using EVERYONE'S camera for that trace. To work around this, I pull the camera's reference from the player's controller, which is unique, so I only get that person's camera and not everyone else's. I'm sure this is messy, but it works.

twin juniper
#

hi all! dunno if this is the right channel to ask,, but.
When trying to run my level in the editor I get the following "Couldn't spawn player. Failed to find PlayerStart"(dedicated server off). With dedicated server on, it works fine. I have spawn as spectators set to true. But either value there does not seem to matter.

Just to note, I have overridden ChoosePlayerStart in blueprints where I select a PlayerStart based on tags (RedTeam, BlueTeam). I gather all the PlayerStarts into RedTeam/BlueTeam arrays in the BeginPlay event. Can it be that ChoosePlayerStart runs before BeginPlay when I have dedicated server off? Setting any breakpoints does not seem to work.

normal jacinth
#

I think you need to add a delay of about 2-3 seconds after a Begin play, I've seen that in a few tutorials

odd iron
#

Goodday Guys ...
Im trying this event on 2 Clients
client 1 : Working normally
client 2 : When its jumping the client 1 Also Jumping
When Client 2 Fire this Event Both Players Effect this

twin juniper
#

@normal jacinth thanks! I really hate using timing delays though! Feels too unstable when accounting for latency. It seems (using breakpoints) that FindPlayerStart runs before BeginPlay and that probably has something to do with it. Breakpoints in my ConstructionScripts are not hit either

twin juniper
#

seems that was indeed the case. I managed to fix it in an ugly way by using a one time check on the first FindPlayerStart invocation to populate my PlayerStart arrays

#

@odd iron I'm no expert on this, but it seems that you are always using Player Index 0 for "launch character" for one. You want to have an input event on each client that invokes an event that runs on the server that launches the correct player based on who invoked it

#

"Client WallJump" says that it is run on server

odd iron
#

Hello

#

The thing is even if you are using GetPlayerCharacter index 0 in Multiplayer Method the engine automatically will handle the other player's indexes ,,,
about the Wall Jump run on server i've tried all of the replication Options

kindred widget
#

On the server. Character 0 is the character possessed by PlayerController0, which is the first player controller spawned in the server. On the Client, Character0 is always a reference to the character that that client's Player Controller is possessing.

#

If you leave your event the same as it is when you posted it, and change that to Character 1, player two's character would launch

odd iron
#

but in my other project im using index 0 and i have no problem with replication

kindred widget
#

I don't know what you're doing differently in your other project, but GetPlayerPawn, GetPlayerController, GetPlayerCharacter, all work differently based on whether it's ran on client or server. Since that event is ran on Server, it will always reference the character possesed by PlayerController0, which the server knows as the first player controller spawned. Which would be player 1.

odd iron
#

So in this case how can i the correct index

kindred widget
#

I'm not sure of the correct way to implement stuff like that. Still learning multiplayer aspects myself. You might be able to use GetCharacter0 from an event ran on the client, and pass that character reference to an event ran on the server, which then uses that reference to launch the character.

odd iron
#

oh now i see

#

on my other project im using the Character_BP for this events thats why its replicating without any issue

#

in this project im using player controller so im getting reference for character 0 index

#

thats why

kindred widget
#

Ah, yeah, much easier to get a reference to self.

odd iron
#

yes because its will get a copy from every client

#

i mean its will get the correct one

#

I'm not sure of the correct way to implement stuff like that. Still learning multiplayer aspects myself. You might be able to use GetCharacter0 from an event ran on the client, and pass that character reference to an event ran on the server, which then uses that reference to launch the character.
@kindred widget This might work i will give it a try

#

nope its didnt work Authaer

twin juniper
#

@odd iron When you are running the game in the editor, one of the clients is usually the server also. You can use the little 'run dedicated server' checkbox in the play settings to make sure no client is also the server

#

that way all the clients you are testing with will have the same behaviour

odd iron
#

Yes that what i'm Doing

twin juniper
#

Something I found out the hard way myself ๐Ÿ˜„

odd iron
#

I have 2nd game almost done still looking for environmental .. All Replication stuff working finally

#

But the thing is movement events and its own replication im doing that locally in Character_BP not in Controller

#

so thats why i have no issue with movement

#

and thats what i will do

odd iron
#

Ok Guys thanks i found the problem i was force setting the Index of Jump function 0 thats why

lethal gate
#

Guys can anyone help when I try to play game in multiplayer if i move client its movement are not shown in server

ocean geyser
#

is the client set to replicate

lethal gate
#

How to do so

ocean geyser
#

the actor I mean

#

open it, I'm assuming your using blueprint, search for replicate and look at the options

lethal gate
#

If i am not wrong movement component is replicated by default

ocean geyser
#

it is

lethal gate
#

No, I am using cpp

ocean geyser
#

any custom movement work?

lethal gate
ocean geyser
#

that's weird. I'd close the editor, compile and re-open it and try again just to see if it's one of those things

lethal gate
#

Done already

#

Also tried disabling other replicated component

#

How can i know, which components of game should i replicate?

ocean geyser
#

only one that need it, such as if you have a replicated variable in a component that you want replicated

lethal gate
#

Weapon swap is working weirdly in client should i replicate it

ocean geyser
#

depends on how you do it. I'd do an onrep event on the weapon variable. when you switch weapons tell the server to change the weapon in hand which will fire the onrep event and change. jn the onrep put your code to change the weapon

tall pine
#

Question about replication:

  • I follow the Shooter MP example from UE, and I replicate the health state to have OnHit or OnDeath()
  • I run into a bug today that the AI on client became irrelevant, and the last state on the server is OnDeath
  • As soon as the client becomes relevant again, the state is synced, and we call OnDeath() on the client, before its BeginPlay() get called. This results in a crash

So my question is: what's a good way to address this? Do we check to see if we haven't initialized in OnDeath and don't proceed with the logic?
Or do we only sync the state within a certain amount of time, so that if too long has passed, then I skip the sync?

normal jacinth
#

.45.0

tall pine
#

?

normal jacinth
#

sorry! my infant grabbed the keyboard...

tall pine
#

ha ha ha he / she wants to learn how to code

ocean geyser
#

he/she should know by now that floats dont have 2 decimal points, teach them early

rose egret
#

if I call this on server. what happens to the client RPC in the clients ? would it get null pointer ?
pPawn->ClientPickItem(pItemActor);
pItemActor->Destroy();

normal jacinth
#

Quick question; I'm trying to carry over data (the player character's static mesh) across a server travel command. But it looks like the player controller is deleted and loaded up again, even though the documentation says this should persist. Does anyone know how I can carry across data?

#

I have a different GameMode in the lobby to the map, which might be why this is happening

ocean geyser
#

@rose egret its a risk that it will be destroyed to early. i would instead create a boolean on the class for pItemActor called ispickedup. to be safe i would make another rpc call to the server after ClientPickItem is finished running to let it know that youve finished doing everything you want to with the item and to go ahead and destroy it

#

@normal jacinth are you using seamless travel?

normal jacinth
#

yes

ocean geyser
#

im pretty sure the info on the player controller (thats on the server) carries over

#

or is that failing to carry over for you as well?

normal jacinth
#

yes but the game mode is changing, could that be it?

ocean geyser
#

not sure, try without changing the game mode and test to see?

normal jacinth
#

oh it works if I use game instance ๐Ÿ™‚

ocean geyser
#

yea, game instance is persistent from the start to end of the game so that will work. idk if it can be replicated from the server so idk how safe it will be to prevent cheating if you have all the data in there (depending on the data)

normal jacinth
#

not fussed on cheating ๐Ÿ™‚ thanks tho!

fleet raven
#

is there some way to get world time that is at least roughly equal on server and client ?

#

the ServerWorldTimeSecondsDelta on game state jitters slightly which makes it a non starter for animation based on it

rich cradle
#

Hello there, I have a question on how to properly debug network code. I have looked at literally ever pinned item on this channel, read documentation and other stuff but I still don't understand how to actually test if the code I am writing is any good.

#

There is the profiler, but even if I use that, how do I know if the result is good or bad?

#

I have yet to find any information for example on the speed at which the server or client for that matter send updates to eachother

meager spade
#

@fleet raven there is no proper synched time

#

i have seen many posts of people trying to get a nice synched value between server/client

#

but the engine ServerWorldTimeSeconds is just garbage

fleet raven
#

well I want to make a weapon pickup that spins, and has at least somewhat the same rotation on the server and client

meager spade
#

the closest you can get is asking the server for his time, adjust it by ping time / 2

#

for the closest, its not accurate, but close

#

but i tend not to bother with visualization things like that

#

cause its uncommon for people to know that is not spinning the same as someone else

oblique mountain
#

I want to create a multiplayer with the pawn class. How should I do this? Should the client press w and then the server moves the player and replicates the movement or should the client move the player and the server replicates the new transform or what is the best way to do this in Blueprints

#

Its a lan multiplayer

shut gyro
#

Does anyone have any recommendations when trying to get cross-play working. My current plan is to use either AWS or SpatialOS to host the backend and session + player data for people to connect to a match and have beacon ports available for people to connect through and get information cross platform in the lobby, perhaps with the UParty class and/or PartyBeacons and then the game session will be instantiated by AWS/SpatialOS with authentication tokens.

#

Is that a good way in going about it or do people have a different way in going about it? Also, is it possible to do crossplay with a solely Steam dedicated server or nah

tawny raven
#

hi there friends! trying to figure out the best place, i posted in #blueprint but someone said I should come here but basically we have these zones where you can walk into it and open up UI Widgets and this causes some issues. we're currently just using the ThirdPersonCharacter for this but if multiple players are in the session; they can also get the prompt whilst not being in the zone

ocean geyser
#

show how you setup the overlap event

tawny raven
#

so basically when player step into the zone i just show a little bit of text letting them know they can buy(while also setting the variable so they can actually buy) and when they leave i just remove it and undo the variable

#

and then in the player character blueprint we just have the widget that they can pull up to actually buy

#

and more than obviously i would just like for the player that's actually in the zone to be able to buy

ocean geyser
#

@tawny raven your using GetPlayerCharacter at index 0 for the overlap event, this is causing the event to fire for each client when a player overlaps/stops overlapping. you can drag off of the OtherActor pin and cast it to third person character, then do IsLocallyControlled. if it is then do what you need with the widget

tawny raven
ocean geyser
#

and then check if its locally controlled

tawny raven
#

oh that works amazingly, thanks!

ocean geyser
#

good

tawny raven
#

alright so that is for green zone i had, i have another zone which is red and that will just automatically sell and then give another currency from the backend i have in-place. how would I go about having just the person in the zone selling?

#

try the is locally controlled as well?

ocean geyser
#

same thing

tawny raven
#

alrighty, i'll get my friend to test it out with me and then report the results back geisAYAYA

ocean geyser
#

sweet, goodluck

tawny raven
#

thanks a million! it's really appreciated

ocean geyser
#

np

rough iron
#

Hey everyone,
i have got an error with the advanced sessions plugin. Advanced sessions plugin won't work for me, i get an error like this any ideas? logOnlineSession: Warning: STEAM: Unknown or unsupported data type from Steam key data mod Stellaris

#

I have setup everything in the .ini file and the build.cs file

ocean geyser
#

does this occur when just CreateSession fires?

rough iron
#

no when i try to join the session

#

and also i get a parsing error

ocean geyser
#

so the session is created correctly?

rough iron
#

Yes!

ocean geyser
#

can i see where you try to join the session

rough iron
#

what do you mean?

#

The log?

ocean geyser
#

the blueprint around where the error occurs

rough iron
#

just a moment

ocean geyser
#

and the error occurs just on the findsession node? for example if you disconnect the OnSuccess exec pin does the same errors show? is it getting any of the values from the server?

rough iron
#

well if i remove the pin then the list doesn't get updated and i can't click on the server i want to join so i don't think the error is in the find advanced sessions

ocean geyser
#

so it does infact find the session then?

rough iron
#

yes!

tawny raven
#

alrighty so when testing with my friend most things work great! however, i noticed that when either of us step into the zone it does still pop-up the text even though i do have that. but if we aren't in the zone we can't buy so that's good

crystal crag
#

All of the sudden, I can only see that method being called on the client. This makes zero sense.

#

I am not running the dedicated server under the same process

ocean geyser
#

@tawny raven im not sure if AActor has the function IsLocallyControlled on it so thats why i said to do it after the cast, but you can find out easy. it shouldnt matter if its infront of behind the cast

crystal crag
#

Yet I still get the message output in the PIE output window and not the server window

#

The method is super complex. Here it is

#
void ARaevinPlayerController::ServerPrintDebugInventory2_Implementation()
{
    UE_LOG(LogTemp, Warning, TEXT("%s() called"), TEXT(__FUNCTION__));
}
#

I tried with both DebugEditor and Development Editor configuration.

ocean geyser
#

ive had some weird behavior before when i didnt include the validate/implementation in the header, might be worth seeing on the odd chance if thats the cause?

crystal crag
#

By header, do you mean the metadata specifying WithValidation?

#

Or do you mean I need to include a .h file

ocean geyser
#

try including it in the .h

rough iron
#

@ocean geyser I take it you don't have any idea either? This has been going on for some days and no one seems to know the answer!

ocean geyser
#

no clue, never used advanced sessions before and never had that issue via steam

rough iron
#

ok

oblique mountain
#

What is the best way to move a pawn in a lan multiplayer game? Move on client and set transfrom on server to replicate or move directly on the server and replicate?

crystal crag
#

No luck. I already had the _WithValidation method implemented. I tried moving it to the header file and it still executes the method on the client.

#

I've tried re-generating the VS files from the uproject and building the project again

#

still same behavior. I never have run into this problem before. On my other project, I have used a bunch of Server and Client RPC calls..

#

Maybe I have to delete all intermediates and try again

ocean geyser
#

@oblique mountain its more snappy to move the pawn on the client and then server for replication. if you move the pawn only on the server then you might feel some latency between the movements

tawny raven
#

thanks again!

oblique mountain
#

@ocean geyser but if I move the pawn on the client and then replicate to the server it is also laggy. Maybe because the server then sets the transform for the client again even if the client moves in the meantime? How can I avoid the laggy movement?

ocean geyser
#

character movement component should already bet setup for this, depending on the style of movement your looking for its worth looking into before writing it yourself

oblique mountain
#

but I'm using a pawn because its a none human player

crystal crag
#

at a basic level

#

and covers lag and position tolerance / etc.

#

Deleted my intermediates folder, built the project, and I still am getting the same behavior - the server rpc is only being executed on the client

#

arg

ocean geyser
#

that makes 0 sense

oblique mountain
#

why?

#

you probably mean sathenzar

ocean geyser
#

was talking to him

crystal crag
#

oh

#

sorry

#

I know it does

#

Maybe me installing Origin / Apex / Wolcen broke the engine since each one of them installed a VC++ Redist?

#

Granted I have the build config (I have the source build on my machine) pointed at a specific C++ version, so I don't know why that would matter...

#

Ok

#

going full nuclear

#

I deleted the intermediate, derived data, and binaries folder. Regenerated the sln, and now I am doing an actual Build -> Rebuild All

crystal crag
#

Ok. Here is to hoping this works; finally finished building.

#

sigh same thing

ocean geyser
#

do you have any other server RPC's in that class?

crystal crag
#

I just created one that is super basic

#

I'm about to test it

#

First trying without the WithValidation and then I'll try with it if that doesn't work

#

same thing without the WithValidation

#

now trying with the _WithValidation

#

same deal

#

Server process doesn't show that method being fired off

#

and the last one, finally, is the cpp file

#

I'm calling Super from the constructor and in begin play, so I'm not hitting that particular pitfall that devs sometimes run into

#

oh ffs

#

It was because I was calling _Implementation

#

I thought you had to call that within the C++ code anytime there was an _Implementation method generated

ocean geyser
#

ServerPrintTestMessage() lol

crystal crag
#

otherwise you would hit a never ending loop

ocean geyser
#

that fires the validation, if validation is false it diconnects caller, if true it runs implementation

crystal crag
#

I guess that is just with NativeImplementedEvent

ocean geyser
#

always call the normal function, not implementation

rich cradle
#

nah, just call the regular Server function. That will call implementation and validation

#

its an amazing system...10 out of 10

crystal crag
#

Well with NativeImplementedEvent or whatever it is, I have always had to call the _Implementation method

#

otherwise the game will freeze

rich cradle
#

or yeah..thats differnet

crystal crag
#

and not unfreeze

fossil spoke
#

You shouldnt be calling _Implementation functions unless you know why you need to, always call the UFUNCTION() declaration function signature.

#

The Engine will always manage calling the _Implementation and _Validate functions on your behalf.

crystal crag
#

Ok. Will do in the future. Thanks for all of your help everyone.

#

Ok, so now the reason why I was trying to do a server call in the first place... maybe someone can help me with my original problem. I'm not quite sure how to describe the issue without using a giant wall of text. I'm going to try though.

#

I am replicating custom UObjects

#

This appears to work out just fine with one major catch

#

Basically, an inventory component, when HasAuthority() == true, will grab a list of these custom objects from the inventory actor.

#

then the inventory component stores the array of references of these uobjects in its own class, which in turn fires off the OnRep_ methods on the client. I can see the objects in the OnRep methods are populated correctly

#
 UCLASS(BlueprintType)
 class RAEVIN_API URaevinInventorySlotSet : public URaevinNetworkObject
 {
     GENERATED_BODY()
 
 public:
 
     UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Replicated)
     int32 SlotNumber = -1;

    UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Replicated)
    bool IsPrimarySlot = false;

    // The column number of the grid in which this set currently belongs
    UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Replicated)
    int32 ColumnNumber = 0;

    // The row number of the grid in which this set currently belongs
    UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Replicated)
    int32 RowNumber = 0;

    UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Replicated)
    class URaevinInventorySlot* ItemSlot;

    UFUNCTION(BlueprintPure, BlueprintCallable)
    bool IsValidItemSlot() const { return (ItemSlot != nullptr && !ItemSlot->IsPendingKill()); }
 
 protected:
 
 private:
 
 public:
 
     void GetLifetimeReplicatedProps(TArray<class FLifetimeProperty>& OutLifetimeProps) const override;
 
 protected:
 
 private:
 
 };
#
UCLASS(BlueprintType)
class RAEVIN_API URaevinInventorySlot : public URaevinNetworkObject
{
    GENERATED_BODY()
    
public:

    UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Replicated)
    int32 Quantity = 0;

    UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Replicated)
    FGuid UniqueItemId;

    UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Replicated)
    FGuid ItemTypeId;

    UPROPERTY(EditAnywhere, BlueprintReadWrite, Replicated)
    int32 ColumnIndex;

    UPROPERTY(EditAnywhere, BlueprintReadWrite, Replicated)
    int32 RowIndex;

    UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Replicated)
    class URaevinWorldItemDefinition* ItemDefinition;

protected:

private:

    UPROPERTY(Replicated)
    bool bNeedsDumped = false;

public:

    void SetNeedsDumped(bool InNeedsDumped);

    UFUNCTION(BlueprintPure, BlueprintCallable)
    bool NeedsDumped() const { return bNeedsDumped; }

    void GetLifetimeReplicatedProps(TArray<class FLifetimeProperty>& OutLifetimeProps) const override;

protected:

private:

};
#

Immediately after the OnRep_ methods fire off, I call the client version of DebugPrintInventory method, and the top-level URaevinItemSlotSet is there and valid, the child object ItemSlot property is nullptr

#

I don't understand

#

For there to be an X in the grid cell, the ItemSlot property cannot be nullptr

#

so there you can see (and in debugging I can see) that the item slot prop is not nullptr

#

Immediately after the OnRep_ is fired off, the client shows all of the child item slots nullptr

#

If I call the server version of the PrintDebugInventory method, it still shows all of the items are there and valid

#

So they were not garbage collected...

#

not on the server anyways

#

I don't know, that was still a wall of text. Hopefully I didn't melt everyone's brain.

winged badger
#

i just skimmed that

#

but if your inventory is replicating an array of references to replicated actors that were just spawned

#

there is no guarantee, whatsoever, that those actors will have replicated by the time your inventory array does

#

@crystal crag

crystal crag
#

I think I found a much better way to convey my problem

winged badger
#

you can replace the Actor in the above statement with any kind of replicated UObject really

crystal crag
#

let me try it again

winged badger
#

side note, its easier to make an UMG widget then to get those logs to print like a table

crystal crag
#

As shown in that screenshot, the On_Rep method being called on the client, the parent / child object are both valid

#

this is being replicated from the server to the client

#

UPROPERTY(ReplicatedUsing = OnRep_InventorySlotsChanged)

#

So on the client it see the valid objects

meager spade
#

how do you know it does?

#

it just sees the number

#

doesn't mean the objects are on the client yet

winged badger
#

if you spawn an object on the server