#multiplayer

1 messages Β· Page 615 of 1

bitter oriole
#

@granite galleon What kind of asset ?

granite galleon
#

Simple asset like traps and stuff

bitter oriole
#

I'm not asking the complexity, I'm asking which kind of asset, are they textures, meshes, Blueprints

twin juniper
#

Does anyone know a good solution to assign Audio to a specific gun in multiplayer with replication? I Managed to do it, But it's probably the dirtiest blueprint I've ever made

bitter oriole
#

Your base gun class should have a "play firing effects" method fired on all clients and it could simply play a sound cue property that every gun overrides

odd iron
#

Hi Guys
How can i make the Advanced Session Public? ..
I have An Advanced Session Creating on PC and i can join it through Android but Local how can i make it public ?

bitter oriole
#

What's the OSS used

odd iron
#

i'm using Playfab Service im registering the Session but its need the Server or the host IP and i can't get the IP of the host

#

Playfab Services @bitter oriole

bitter oriole
#

Alright, not familiar with that

odd iron
#

the Secret Key was exist in photo xD

chrome quest
#

Hello guys, advice please.
Would you go with a data table or a data assets for inventory items database in a multiplayer environment?
Thanks

winged badger
#

as usual, the answer is "it depends"

#

and not on if its MP or not

chrome quest
winged badger
#

datatables are trivial to work with from c++

#

with external data, probably not so much

chrome quest
#

Like trying to set the default data table in a struct.

winged badger
#

i use singleton

#
if (GEngine && GEngine->GameSingleton)
{
  UMySingleton* Singleton = Cast<UMySingleton>(GEngine->GameSingleton);
  MyDatatable = Singleton->MyDatatable;
}```
#

can go into a struct constructor

#

and it will work

potent cradle
#

Smooth experience

chrome quest
chrome quest
winged badger
#

you just make a UObject derived c++ class, derive a BP from it to assign references

#

and assign it (BP class) as GameSingletonClass in your project settings

chrome quest
potent cradle
#

The singleton approach is flying over my head a bit Zlo, could you explain why you'd use it?

winged badger
#

its a singleton engine will instantiate for you

#

very early in its startup process

#

so for anything except the CDOs its safe to access it from constructors

chrome quest
#

I'll give it a try.

violet sentinel
#

can TakeDamage be called on clients? I need to make projectile to produce effects based on TakeDamage result (different actor types), i.e projectile hits body part => calculate and apply damage based on body part armour
if body part still ok => add decal, play blood splats
if body part destroyed => play splats, detach body part and other stuff
it was previously triggered by multicasts from server, but body part data was not replicated properly when rpc is received on client
or is there a better way of doing it?

silent valley
#

TakeDamage should only be called on server. Calling RPC or OnRep function when damage is applied is usually the way to do this stuff, but there will be latency as the client sends the shot to the server, then the server sends the RPC back.
From this you can improve by predicting the hit on the client and adding fx/decals etc, but the server may reject the hit so you may need to rollback.

violet sentinel
#

also the issue if character has a "barrier" bubble, rocket projectile calculates chance to pierce barrier in it may or may not hit actor and possibly explode inside it. so one takedamage event (projectile hit character's barrier) may produce more damage events. where should it be? in projectile onhit or character takedamage? @silent valley

silent valley
#

I've not implemented projectile weapons yet, but I expect the projectile OnHit is what ultimately calls TakeDamage and this would also be the place to decide if it needs to spawn other projectiles, etc.

#

but you need to make sure this is done on server, and prediction in this case will be quite difficult

stoic acorn
#

Is it bad practice to have functions inside functions?

pallid mesa
#

no

stoic acorn
#

That's music to my ears

#

I guess you'd need to be careful not to end up in an infinite loop right?

pallid mesa
#

and yes, recursion is a thing and you need to be careful with it

stoic acorn
#

apologies, I spend most of my time lurking in here

eternal citrus
#

what is the difference between having higher or lower tickrate?

bitter oriole
#

Tickrate is the framerate of the server

#

Except servers don't render frames so we call it tickrate

#

Higher tick rate = needs better hardware, but lowers the lag for all players, improves consistency, physics, etc

eternal citrus
#

ok

#

so what tickrate would you recommend for average hardware

#

i mean

bitter oriole
#

You should buy servers based on the tickrate you want to reach

#

It's a performance metric, not a setting

eternal canyon
#

playfab took me 2 weeks to setup

#

tho its very cheap

#

for the specs u can get

dark edge
#

Cant know till you test

eternal citrus
#

yea

#

i set my tickrate to 60 and my game was lagging

#

assuming my hardware couldn't handle 60 ticks

bitter oriole
#

How did you do that

dark edge
#

Your clients view was laggy or the server itself was? I'm assuming you're running both on the same machine in PIE

eternal citrus
#

yea

#

i am

eternal citrus
dark edge
#

It'll be fucky, you gotta build the dedicated server to even see what it can do.

bitter oriole
#

So how

#

What's the command you used

eternal citrus
#

i was trying really hard to optimize

bitter oriole
#

Tick rate is not just a setting

#

It's really a function of performance

eternal citrus
#

yea i see

dark edge
#

IF you're doing your testing in PIE you're flying blind anyway, at least put the project on another computer and launch it as a server

#

that'll be closer to the real dedicated server perf

#

thatll at least get you closer

bitter oriole
#

Still wondering which setting was used to set tickrate

#

NetServerMaxTickRate ?

eternal citrus
#

aaa

#

NetServerMaxTickRate=xx

#

yea

#

that

chrome bay
#

There's a few settings you can tweak:

MaxNetTickRate=60
NetServerMaxTickRate=60
LanServerMaxTickRate=60
NetClientTicksPerSecond=60
bClampListenServerTickRates=true
MaxClientRate=10000
MaxInternetClientRate=10000
ReplicationDriverClassName=/Script/HTCore.HT_ReplicationGraph```
eternal citrus
#

oo

chrome bay
#

Quite a few more but those are the main ones I use

#

Can find most them in NetDriver.h usually

eternal citrus
#

thanks!

chrome bay
#

I actually had to clamp because in test maps in editor, it would try to run at like 200 frames and saturate really quickly

#

Although that in itself was probably something caused by me

woven sinew
#

Hi, anyone use playfab ? I don't understand how the OnlineSubsystems and PlayFab work together, or if they shouldn't

eternal canyon
#

Playfab isnt an OSS

#

and yes I do

woven sinew
#

yeah I know it's completely separate but

#

I don't understand the stuff with sessions, online subsystems

#

I want to make a cross platform game

eternal canyon
#

They dont use sessions for playfab

#

they use their own stuff

woven sinew
#

so you don't use session and/or the online subsystem ?

#

just playfab ?

eternal canyon
#

not really

#

I mean kinda

#

U cant connect to their servers directly through IP

#

as it has to go through their stuff

woven sinew
#

yeah it's through the API right ?

chrome bay
#

It's not really any different to how Steam or any other OSS handles it

#

Playfab is just a different service

#

You could probably quite easily write an OSS for Playfab. You can use more than one OSS at once as of a few builds ago.

woven sinew
#

wdym write an oss, there's an official plugin on the markeplace

chrome bay
#

There's an SDK but I doubt they bothered to do it in OSS format

woven sinew
#

wdym oss format

chrome bay
#

OSS is just a platform-agnostic interface for whatever online service you're using

#

The idea being that game-code doesn't have to care what online service you use - and all of that logic can be identical no matter what

#

Engine comes with implementations for Steam, Xbox, PS etc

#

You don't have to do it that way, but it's much more convenient than trying to integrate platform API calls directly into game code (IMO)

woven sinew
#

but PlayFab is cross platform too so..

chrome bay
#

It is, but lets say you want to just use Steam later - you can just change OSS without having to rewrite half your game

#

And you can use all the existing session / achievement etc. code the engine comes with and use it in a backend-agnostic way

woven sinew
#

so you're saying OSS + PlayFab functions

chrome bay
#

That's just how I'd do it anyway, but you don't have to

woven sinew
#

I just don't understand how the two work yet

chrome bay
#

The OSS (online subsystem) is an engine-level interface between your gamecode and your backend service API

#

It's designed to be totally platform-agnostic, so it doesn't matter if the game goes on Steam or goes on Playfab or Xbox or whatever, the idea is that the game portion of code can be the same.

woven sinew
#

so in c++ it's like I implement some oss interfaces and put api calls to playfab for example inside

chrome bay
#

yeah exactly

woven sinew
#

ok thx

chrome bay
#

same way as the other ones are done like the Steam one

woven sinew
#

alright

chrome bay
#

All API's have different features and different implementations, but that's the general idea

woven sinew
#

cool thanks

chrome bay
#

It could be that the PlayFab SDK plugin does it that way (haven't looked at it) - but I've seen more than enough questionable online stuff on Marketplace at this point.

woven sinew
#

yeah but it's not some random dude it's MS

chrome bay
#

The original GameSparks implementation was pretty shocking, to put it lightly

woven sinew
#

oh ok

#

what do you use ?

lilac raven
#

I tried this but it didnt work unfortunately, how can i get pre login via bp or must i use c++?

chrome bay
#

Steam πŸ˜„

eternal canyon
#

whats great about it not being an OSS and the reason why playfab didnt

chrome bay
#

Cross-Platform development is no joke

eternal canyon
#

as that they rely on other platforms for logins sometimes

#

like if u want to login with steam

#

or facebook

#

or apple

chrome bay
#

You could still do that via the OSS if you had to

eternal canyon
#

or android device id im pretty sure

chrome bay
#

It's just more about exposing the API the the game in a way where the game doesn't have to care what the backend service is

#

It's more of a code-design thing really

woven sinew
#

there is 0 doc on c++ ue + playfab

#

apart from the basic playfab guide

chrome bay
#

My advice tbh, just make the game for now - worry about the platform later

#

Chances of it being big enough to matter about being cross-platform are slim anyway.

woven sinew
#

no I need to host the server and know how difficult all that stuff is

chrome bay
#

That's what I'm saying though, you can host a server anywhere at anytime, you don't want to add a dependency on some third-party before you even have a game running.

woven sinew
chrome bay
#

Just after having some experience on this, it pays dividends to keep your game code separate from any third-party stuff you rely on.

#

Because otherwise the minute that third-party becomes a barrier, you're screwed

#

The more easily you can hot-swap stuff, or just plain cut it out, the better

#

MP development is hard enough without other companies getting in your way too πŸ˜„

#

GameSparks used to be very popular here with folks with cross-platform ambitions until Amazon bought them out and suddenly jacked prices through the roof.

woven sinew
#

right thanks for the advice

chrome bay
#

Suddenly everybody with a GameSparks implementation had to rewrite half their game

#

But yeah just generally, the game is the hard bit, backend can always come later πŸ‘

woven sinew
#

but what if you want to release fast to iterate

#

I agree with the 3rd party-agnostic argument but I think backend should be taken into account early

chrome bay
#

well the backend you can change at anytime, unless for some reason your dependent on a feature it provides

#

cross-platform dev really is no joke though

woven sinew
#

is it, even with ue ?

#

with the oss

chrome bay
#

Well it's not just the online side of it, it's the game itself too

woven sinew
#

can't I just build & package for other platforms

#

change some optimization settings before

#

idk I never tried

chrome bay
#

no πŸ˜„

#

Just take a simple example - getting a UI to work both with KB & Mouse and a Controller

woven sinew
#

right that's the main concern besides optimization

#

what else

chrome bay
#

you won't really find out until you do it

#

But just be prepared for XYZ works on Platform A but Z doesn't work on Platform B etc.

woven sinew
#

yeah

chrome bay
#

As an indie doing multiplayer, the biggest two challenges are making the game, and getting people to care about it

#

The latter of which is wayyyyyyyyyy harder than it sounds

woven sinew
#

it seems to me many indies are too ambitious or not ambitious enough

chrome bay
#

most are unrealistically ambitious

dark edge
#

If you can't realistically sell like 100,000 copies, just use listen servers. I would never even think about trying to build out a back end for a first game

chrome bay
#

Stranger has the go-to figues, but you have to be in the top 1% of games on Steam to even have 1,000 players, ever - something depressing like that.

dark edge
#

Also most games on Steam look like hot garbage too so that definitely doesn't help. Not that there aren't any objectively really good games that didn't sell, but there aren't a whole lot of really bad ones that did

chrome bay
#

Players will forgive you if you launch a decent game that isn't cross-platform, they won't care about a terrible game that is cross-platform πŸ˜„

woven sinew
#

true hah

#

not trying to build back end myself, just picking a premade one

woven sinew
#

I wanna see those stats

chrome bay
#

@bitter oriole πŸ˜„ Another resident of #multiplayer who discourages people getting too big with ideas early on πŸ˜„

#

So I don't have actual figures, but our game was a global #1 seller on steam for a couple of days when we launched. All it really showed me is how low the bar is to reach that spot.

#

Trends come and go ofc, but the figures aren't impressive at all

#

Feel like we got off topic but anyway, I hope this wasn't too overwhelmingly negative πŸ˜„

eternal canyon
#

thats the best feeling prob

woven sinew
#

how many are you in your team ?

eternal canyon
#

when u put in a ton of effort and it ACTUALLY DOES WELL

chrome bay
#

At the time there was 6 of us I think, but we have/had Publisher support too (and still do)

woven sinew
#

maybe if indies teamed up more often the games would be better

eternal canyon
#

and people appreciate the work

woven sinew
#

k

chrome bay
#

But we had a decent following before launch thanks to Kickstarter and the like, so that helped. Building a community around a game before you launch is critical nowadays

#

For Indie, at least

woven sinew
#

I think my main problem is art

chrome bay
#

Everyone has a different route tbh

#

Just play to your strengths and don't go too crazy

#

Keep your goals in check

#

etc etc..

dark edge
chrome bay
#

yeah been there too

#

community projects only work out well when their non-profit IMO

vocal cargo
#

Hey guys, is it possible to have two controllers controlling the same pawn?

chrome bay
#

like mods and such

dark edge
vocal cargo
#

Got any examples I could look into?

#

I'm trying to get two players to control the same pawn (one controls movement, the other controls rotation)

dark edge
#

I don't have any examples but you can very easily have multiple controllers have a reference to an actor, and just send it things like aim direction or control variables etc.

#

Local prediction might get dicey

vocal cargo
#

what about owners? won't that be a problem too?

dark edge
#

Not right away. If you don't want any specific controller to have a higher priority, have neither one possess the actor and just have both of them be sending it commands.

chrome bay
#

have each controller possess a proxy pawn, have that proxy object route the input to the "real" object

dark edge
#

Yeah exactly.

chrome bay
#

Assuming we're talking multiplayer

vocal cargo
#

yep, multiplayer

#

so how would that look like?

#

two helms, each one is a pawn?

#

controlling the same actor?

chrome bay
#

So spawn a non-visible pawn of some kind, could just use the APawn class

#

Then bind whatever inputs you want

#

Then just use their input functions to send the input to the "real" object

#

Or send via RPC or whatever for MP

#

Wouldn't even have to go through a pawn really, could just route any network calls via the controller

vocal cargo
#

hmm I see

#

this is helpful

chrome bay
#

Can't promise the results will be good πŸ˜„

vocal cargo
#

ohno

dark edge
#

Yeah input still one of the things I haven't exactly wrap my head around completely. for weird situation like this I usually just consume the input in the controller and have the controller past whatever data over to wherever it needs to go

vocal cargo
#

Why wouldn't they be?

dark edge
# vocal cargo ohno

Don't worry about it, just try to make it work. This is definitely not Unreal engine 101 level material, but you can make it work. My first week messing with the engine I did something similar, made a mirror image ability that made a copy of your character that mirrored your actions

vocal cargo
#

I mean, if I'm sending controller input and run the movement code on server, why would that be any different than regular movement?

#

Won't know until I try though

dark edge
#

It'd be no different besides local prediction.

#

So you'll have a lag before you move

chrome bay
#

this is all assuming you aren't using a character pawn btw

vocal cargo
#

what do you mean? My 'main' player is a ACharacter and the helms would be APawn

dark edge
#

You can do this with a character pond, I've controlled multiple character pawns at once just by RPC

chrome bay
#

kk I've never tried, can just picture it being not so great

dark edge
#

@vocal cargo all right spell it out exactly. what exactly exists in the scene, do players only ever possess half of this character or are there other characters?

vocal cargo
#

Right now there are multiple Characters (Regular humanoid players) and multiple spaceships (Pawns)

dark edge
#

Do the players possess spaceships or are they only AI driven?

vocal cargo
#

I want to have two helms to control the ship: one controls movement, the other one controls rotation

dark edge
#

So I walk up to the helm, possess it was presumed play some sort of sit-down animation, so now they are driving the helm instead of driving the character, just like Grand theft Auto when you get in the car

vocal cargo
#

they do need to be possessed by an AIController after we unpossess I think

#

to keep the speed variables

#

yep yep

dark edge
#

No they don't need to be. The variable should exist on the pawn

#

Okay then this is easy. In a two-person setup, you would have five things at play. The two characters, the two helms, and the ship.

#

So when you possess the helm, all of your input is now going to the hell. you implement whichever input actions you want.

#

What the helm needs to do is continuously send some sort of data to the ship. The aiming helm will send a rotation or an aim direction vector, and the driving home will send the flight data.

#

So when you are sitting at the aiming helm, the aiming helm is continuously getting your control rotation and passing it to the ship actor.

#

And when you are sitting at the flight help, the flight home is continuously getting your wasd inputs and sending them to the ship actor as thrust and turning or whatever

vocal cargo
#

I think this will work pretty well

#

wouldn't be so sure if it was something more fast paced because of the input lag

#

but since it's a slow moving ship, I don't see why it wouldn't work

dark edge
#

Yeah it'll work great. yes you're going to get input lag because you can't predict the actions of something that is shared between the many people that are controlling it. But that's fine, how fast does a spaceship respond

vocal cargo
#

it's not even direct input for movement/rotation

#

it should just increase the speed of the movement or rotation

dark edge
#

I've implemented the exact same system in the context of a sailing ship. what you will want to do is make a base class for all of your stations, and that class would implement the logic regarding popping in and out of the station. Make sure that works before proceeding.

#

Then you subclass that bass class into various things like weapon stations or navigation stations etc, and in those stations you implement the input handling

#

The Base class should also get a reference to the ship it's attached to and save that so sub classes could just directly talk to the ship

#

The stations can have their own cameras etc. As well

vocal cargo
#

isn't that base class just the PlayerController?

#

that can handle possessing/unpossessing helm/player

#

could even have an enum or bool specifying the time of helm it is

#

so we send different data depending on that value

dark edge
#

You can do The possession and unpossession in the controller, sure.

#

But I would make a base helm the handles setting a reference to the ship actor.

#

The player controller would have to hold a reference to your old body so it knows what to possess when you want to get out of the helm

#

The player controller doesn't even need to know that the ship even exists. that's how you end up with spaghetti, with everything having references to everything else

vocal cargo
#

how would you set that reference?

#

just in-editor select?

dark edge
#

Set which reference?

vocal cargo
#

to the ship actor

hollow oasis
#

i did same think (this is my). Cast to gamemode which is set in project and level. but it fail (for client) every time

#

and this is in course in same blueprint (playercontroller) but it works for client and server

#

what can i do wrong

dark edge
#

@hollow oasis game mode only exists on the server.

hollow oasis
#

i know, but dont understand why this works on second screenshot

dark edge
#

there are two copies of your player controller, the one on the server and the one on the client. It is only succeeding in the one on the server.

#

If the current game mode is not BP _ game mode, then it'll always fail. Which is probably the case if the top one always fails on both

hollow oasis
#

ok i am dump πŸ˜›

dark edge
#

Wait a second, how many game mode classes do you have?

hollow oasis
#

its in course where i have 1 Base gamemode and 1 for "round" base game and "tdm" base game

#

round and tdm is child of base gamemode

#

in first ss i have one gamemode

#

and right now i know what i did wrong πŸ˜„

eternal canyon
#

What exactly does Force Net Update do?

#

I have looked at it and the documentation

#

and I thought it meant that the server will change its values to match the clients

#

but obviously thats not it

#

Does anyone know?

dark edge
# eternal canyon but obviously thats not it

It probably just forces a net update. So something is only updating very slowly, you can force it to update. like if a value only replicates five times a second but you want it to replicate instantly when you change it, you would call Force net update.

eternal canyon
#

ah

hollow eagle
#

You cannot make the server change its properties to match a client's, that's not how replication works. Replication is exclusively Server -> Client.
If you want to update something on the server, you need to RPC from the client and update it manually on the server.

eternal canyon
#

I knoq

#

know

#

its just what it sounded like

#

πŸ˜…

#

in the docs

hollow oasis
#

Still need help 😦

#

but when i use Game mode variable it doesnt work

#

i am doing it on server i think πŸ˜›

#

i do the cast in playercontroller

#

same blueprint

kindred widget
#

You're doing it on both the server and the client. However, that variable setting is kind of a waste. Getting GameMode and casting it to the right one is cheap, don't bother making upkeep by making a new pointer for it.

#

Just get the game mode and cast it in that server event.

hollow oasis
#

yey it works with cast to server event

#

but why this variable dont work ?

open wadi
#

Alrihgt -- I need a BASIC "for dummies" tutorial on how to make Text Render correctly display a character's name above their pawn's head in a multiplayer environment for everyone else to see. Caveat is that the data comes from a widget editable text box. Has anyone come across any such thing?
Heck, if anyone knows an amazon book that covers this, ill buy it. I will throw money at this BUT I need to learn it, not just use someone else's work.

bitter oriole
#

@woven sinew @chrome bay invoked me so here it goes - 90% of all Steam games have less than 15 online players right now, 95% have less than 75 players online right now, 99% have less than 1,000 online players right now.
So consider your player count for a typical session, the % of time spent waiting for a match vs actually playing it, and your target sales - you can see if it makes sense or not.

open wadi
#

Thank you Vision. I think this is twice you may have helped me.
I understand it at a basic level but i'm missing the bigger picture.

#

This is exactly what i want. and exactly the issues. lol

#

I wonder if my two days of stress is due to using the TextRender component instead of adding a widget to the character (which i did not know was a thing) lol

pallid mesa
eternal citrus
#

it looks cooler

dark edge
#

@open wadi you got to figure out where the problem lies. Instead of trying to do it all at once, make sure each piece works.

open wadi
dark edge
#

@open wadi

  1. make sure you can get the text from input widget to the playerstate ON THE SERVER

  2. Make sure you can pull the text from the playerstate into the display. This is local, never touches the server.

#

So to start, I'd have 2 clients printing the names in the PlayerStates on tick and confirm that I can change them and it all works out.

#

I'm pretty sure player name is already a playerstate variable so don't make your own if so.

#

For step 1 you'll need a run on server event somewhere. Either in the Playerstate or Player controller or Pawn.

open wadi
dark edge
#

Are you trying to have the name live on the pawn or on the player state?

open wadi
#

The desired intent is to have the variable live on the player state and pass it back and forth to the game instance when i need to change levels.

open wadi
#

Im very appreciative of the help you both are trying to provide. You both deserve medals for even touching this!

terse prawn
#

I have sounds playing during my walking animations (they are used on a blendspace)
The server can hear the footsteps normaly
but the client's have 2 of each footstep playing, How can I go about fixing this?

wise zephyr
#

Do child actors replicate? all the options for replication are checked and its not replicating

bitter oriole
#

Is the actor class set to replicate, is it created on server ?

terse prawn
open wadi
wheat magnet
#

is behavior tree replicated?

#

or in other words, the Behavior tree task blueprint is replicated?

#

or should do RPC inside bt_tasks?

meager spade
#

no

#

and no

#

and no

#

πŸ™‚

wheat magnet
#

to make this event replicated

wise zephyr
#

Hey guys I am trying to rotate an object on my tank and its laggy as fuck in multiplayer as the client i need some help please

meager spade
#

well there is no smoothing

#

updates do not happen every frame, so in between updates, you need to smooth

wise zephyr
#

how do i smooth?? thanks man

meager spade
#

use interpolation

wise zephyr
#

but its only lagy during multiplayer

meager spade
#

ofc it is..

wise zephyr
#

ok great! thanks man

meager spade
#

updates do not happen every frame, so in between updates, you need to smooth

wise zephyr
#

awesome

#

ok great!

#

thank you!!!

meager spade
#

it will be fine on single player

#

check out the free Smooth Sync plugin

#

it might be what you need

wise zephyr
#

LOL i am using that haha its great!

#

but

#

its only working on the main movement of the tank

#

not the components of the tank

#

like the turret and cannon

#

but the main tank body moves great with smooth sync

meager spade
#

yeah we use Rotating movement component

#

for rotating things

#

but rotation is all done locally, we never replicate, but that is design/system choice

wise zephyr
#

is there a blueprint function for smoothing on a component?

#

that smooth sync has

#

like that i can put inside the movement float axis value

meager spade
#

not that i know off

#

we did all stuff ourself in c++

open wadi
#

One last question and I'll stop pestering the channel for the next 24 hours, i promise.
Currently, I have a dedicated server. Client starts up in its own level, where you enter an IP, name a character, etc.
Once you connect, you join the server map level.
That all works fine.
MY question is, can I duplicate this set up at all through play in the editor without packaging each time to start a dedicated server?

wise zephyr
wise zephyr
#

can someone please help me on how to make a smooth rotation of an object that rotates with the mouse?

#

its a separate component that i want to rotate inside the class

#

i posed a picture of it

#

up above

pallid mesa
#

make the rotation client authorative and rinterp for the simulated proxies

pallid mesa
#

if your pawn is owned by a controller

#

you would only run your input code in the locally controlled pawn

#

where as you'd replicate to all clients except your own client the rotation delta

#

that you can interpolate using rinterp

#

you can also perform server validation in case you detect an ilegal movement in the client so you can roll it back

rocky topaz
#

is there a way to set a max player count in C++?

pallid mesa
#

I believe that that's a session intrinsic, isnt it?

wheat magnet
#

does event begin play replicated event? or it only run on server

meager spade
#

its run on all.

rocky topaz
#

is PostLogin guaranteed to run after PostInitializeComponents?

#

I'm trying to figure out if I should be registering an array to playerstates or if I should be fine using GameState->PlayerState[NumberOfPlayers]

#

knowing that NumberOfPlayers gets stored for each PlayerState in PostLogin then incremented

fossil spoke
#

PostLogin is well after the PlayerState is added to the GameStates Players array.

#

So you should be fine.

rocky topaz
#

@fossil spoke PostInitializeComponents of the player state I think is where it gets added to the game state

rocky topaz
#

For instance player 1 starts to log in, has a player state but didn't call on login yet and then a player 2 joins and logs in therefore getting the index 0 even though the player state of player 2 is at index 1

fossil spoke
#

PostInitializeComponents on the PlayerState will be called before PostLogin for that Player on the Server.

rocky topaz
#

My question is, can these two be called by another player in between the two themselves

#

PIC for p1, then PIC for p2 then PostLogin for p2 then PL for p1

#

Iirc now that I think if it if there is level streaming or data to be downloaded then post login is only called afterwards

#

So I assume it's a yes

#

I thought the player state was only created right before post login is called

#

Which means what I assumed is false and I need to create a new array that would respect the post login order (to keep the index valid)

cosmic trail
#

@peak sentinel yeah actually it does hit the smooth function still after simulatemovement(), will check it out more with the jitters I saw last time. It wasn't even a lot of movement, like 1-2 cm Z discrepency just in opposing directions up and down after the smooth which was very discernable

eternal canyon
#

if a value doesnt need to be replicated

#

is it ok to do the calculations for that value on another thread on the server

#

if say its a float

#

or a vector

twin juniper
#

Is it possible to choose specifically who I want to replicate to?

#

I can't use Multicast as not everyone needs to know this information.

eternal canyon
#

u can do a server rpc

#

and go through each player

#

in a for each loop

#

and if it matches certain things

twin juniper
#

Oh So that's the only way?

eternal canyon
#

then send them it maybe]

twin juniper
#

I was hoping I could have the AI cycle through all the players

#

And then send the result to the server

eternal canyon
#

u realize that unreal has a sound thing for this right?

twin juniper
#

From there the server would tell the clients what to do

eternal canyon
#

like distance radius for sounds

twin juniper
#

And it replicates?

#

I had no idea

#

I thought base movement was the only thing that auto replicated

eternal canyon
#

it doesnt auto replicate

#

but u can play sound at location

#

and then the distance radius should kick in

twin juniper
#

I'm confused, So where does the replication come in

#

The goal is to not have to cast to every zombie

eternal canyon
#

u dont need too

#

just play the sound

#

might need multicast or it might need a server rpc

#

dont really do sounds

#

and when I do we use Wwise

#

so the audio guy does it

twin juniper
#

O

eternal canyon
#

but still

twin juniper
#

I think you just gave me an idea

eternal canyon
#

play sound at location should work

twin juniper
#

I get what your saying and it would work. I am worried though that if there are too many zombies playing sound from the server, it could cause the server to lag

#

which is why I want to tell the server/host, to tell the client to run the sound itself

twilit stump
#

Audio doesn’t play on the server. Also AI only simulates on the server

#

What is the audio you’re trying to play?

twin juniper
#

Zombie groans

twilit stump
#

Is it music or is this like the sounds of the zombie attacking?

twin juniper
#

zombie attacking and groaning

#

the solution I have now is to get all actors who are nearby

#

cast to them, and then rpc cast the sound

twilit stump
#

So typically you would not use networking at all for this, if the zombie is already replicating and playing animations, you would add your audio cues in the animation sequence

#

And let the client decide when to play the audio. So if you have a zombie attack animation, you would put your audio ques in there

twin juniper
#

I actually thought of doing that from the start, but I didn't know AI's ran on the server

#

But common sense should have told me it only ran on server

#

not like it's gonna build it's own pc and run on a client

twilit stump
#

AI thread only runs on dedicated server in multiplayer settings

twin juniper
#

right... hahaha

#

That really should have been common sense for me

#

Thank you

#

@twilit stump I actually just realized, groans don't have an animation. It just groans on a random timer

#

wait it worked...

twilit stump
#

That’s fine, put the groan on an audio component on your zombie

twin juniper
#

wtf

#

I'm so pissed

#

3 hours of my time for something I could have done in 30 seconds

twilit stump
#

If you’re worried about audio overlap, look into audio concurrency to control how instances playing will overlap

twin juniper
#

That was a concern down the road, I can control that in the audio cue's right?

twilit stump
#

Nope, in the configuration of the audio asset

twin juniper
#

oh okay, sounds good. Thanks

#

I can't believe how much time I just wasted

potent cradle
#

πŸ˜†

#

Happens to all of us

spring swift
#

I got a random out of blue question? Do customs events usually get delayed when they are mulicasting across all clients from the server? Cozz I got a true and false statement that Varies from 0.1 to 1.5 seconds delay between the cast. The server updates instantly but the client will take just a second or 2. Is that normal?

eternal citrus
#

depends on ur script

#

there is microsecond latency between the server and the client

spring swift
#

Is there a way to make them more important to make it go faster. Give it higher priority?

twin juniper
#

Is there any reason why this only works for the server and not the clients?

#

Zombies Alive, and Round integers aren't updating to the other widgets it finds

#

This is Happening in GameMode, and I know GameMode only runs on server

#

I tried using a rep notifier but no luck

errant lance
#

Move that logic to GameState.

hollow oasis
#

i Have my weapon (sword) blueprint. i attached it to component in my player blueprint
on sword i have box collision
how can i make it to ignore player that have this sword?
and i want to do it in multiplayer

eternal parrot
#

Give a collision channel to your player mesh and set the sword to ignore this channel.

twin juniper
stoic acorn
#

What is the best way to detect if a player has collided with another player from the opposite team?

#

I have two arrays on my GameState which stores each playercontroller on each team. I also have a string variable on my playerstate which stores which team that player is on

hollow oasis
#

i want only to ignor player that is using that sword

grizzled stirrup
#

@meager spade Sorry for ping, just wanted to ask while on the topic: would you in general lean towards sublevels and streaming them in rather than seamless traveling from map to map in the case of players playing many small maps using shared assets?

#

The load times even with the rebuilding navmesh seem to be WAY faster in general

#

With seamless travel there's at least a 3 / 4 second delay for everyone to reconnect

#

Just curious if there's any downsides to streaming other than the navmesh having to rebuild

#

Especially with multiplayer, though it seems the server automatically streams in the correct level on the client which is amazing

#

No need to keep random streams in sync or replicate level names to the client

open wadi
#

Good morning.
I have the nameplates of characters logging into a dedicated server properly displaying their name of their character over their heads upon login.
Characters can also correctly see the names of characters that log in after them.
However, they do not see the names of any characters that were already logged on to the client.
Anyone have advice on what I'm overlooking? I'm very close now on figuring this all out. Thanks again to everyone for all the help so far.

chrome bay
#

Use your HUD's BeginPlay() function to iterate over all existing characters and create nameplates for them too

open wadi
#

Thank you.

waxen socket
#

Good morning. I'm back to reading about projectile replication. What a subject it is! So many different techniques to choose from.

I have a couple questions for those that have time to answer. For my game, which is a fixed-camera, shared-camera, 4-player co-op SHMUP in which I expect to have up to 100 slow projectiles on screen at a time:

  1. Should I use the dummy-on-client, collisions-on-server method?
  2. Would spawning particles instead of actors save much bandwidth/memory?
  3. Are overlaps really so inaccurate/costly that I should only detect collisions with traces?

Cheers.

long willow
#

@waxen socket You def dont wanna spawn individual actors. They will have to be instanced or else the GPU wont be happy. Using particles would work, otherwise instanced static meshes

And yeah, I would use line traces personally.

waxen socket
#

Thanks, Daniel. I see so many examples in tutorials and guides that just spawn actors for grenades, projectiles, and more but I guess that's not best practice.

chrome bay
#

Actors for projectiles is fine

#

So long as you aren't spawning thousands

waxen socket
#

Jambax. My king. It's good to hear from you.

chrome bay
#

If you are you might want to consider a pooling system, but that can get complicated when multiplayer is involved...

waxen socket
#

I won't have thousands. Just a hundred or fewer.

chrome bay
#

Yeah that's not a problem then

#

I would consider making a pooling system so you reuse them instead of spawning new ones constantly, especially if they are spawned in quick succession

waxen socket
chrome bay
#

Always depends though, there are many ways of handling projectiles

#

Oh that's pretty old now, I do things differently

waxen socket
#

Oh... I've been spending the week implementing that. Keeping in mind, that my projectiles are always relevant to everyone since the camera is fixed.

chrome bay
#

If all the projectiles are just the same thing (i.e, bullets) and they don't have any complex behaviour, then you might not want the full overhead of an actor

waxen socket
#

They're glowy blaster shots with three different forms depending on how long the player charges before releasing fire.

#

And then they shrink as they travel.

chrome bay
#

Yeah, there's no single answer for projectiles really

waxen socket
#

πŸ˜“ I know. It's been one of the most confusing topics.

#

I guess my main point of indecision is whether I should spawn a projectile and replicate it, or if I should spawn a dummy on the client.

And then, if I'm only applying damage on the server, I'm worried that the enemy's death will be too delayed on the client to feel responsive.

unkempt tiger
#

What I ended up doing for things to feel responsive is broke up the impact effect into 2: a preliminary 'probably hit' effect that's predicted, which is followed by the server's confirmation

#

The preliminary hit can be a puff of dust or the character slightly twitching, where the confirmation effect can be actual blood splatter or whatnot

waxen socket
#

That's my current approach too. I have the enemy flash red when it's been overlapped on the client but only explode if it's been reduced to zero health on the server.

unkempt tiger
#

Did you test how responsive things feel? I found that with that approach, even a 200 ms delay feels quite good

potent cradle
#

Can always tweak it/try a new approach

waxen socket
#

No, I've only imagined how it could go wrong, I haven't tested.

unkempt tiger
waxen socket
#

Thanks, guys.

waxen socket
chrome bay
#

I don't think so. I'm using client prediction in both cases atm, whether actor projectiles or "data" ones... but the methods are different for each. Actors are pretty difficult to predict and sync-up client side

waxen socket
#

Sorry, what do you mean by "client prediction"?

chrome bay
#

For actor-based ones, I have two pools - one pool that is local-only for the owning client, and another pool that is replicated

#

The client fires and uses one of their local projectiles until they receive one a new from the server, then they try to sync them up

#

But how you handle that is game specific and pretty complicated

unkempt tiger
chrome bay
#

That's the eternal question πŸ˜„

waxen socket
#

Yeah, that was my question.

#

Some kind of ID?

chrome bay
#

An ID is one way you can do it, which works if you are sending an RPC for every shot you fire

waxen socket
#

But I imagine you've got it working with your beloved burst counters.

chrome bay
#

Burst counter is a separate thing, that's just for handling fire FX

waxen socket
#

Oh, sorry.

chrome bay
#

But yeah assigning a synchronized handle to each shot is one way of doing it

#

I also use that same handle for any RNG-seeding

#

I've made life extra hard for myself by trying to move away from sending reliable RPC's for every shot and trying to just sync the whole weapon state, in which case a handle doesn't work

waxen socket
chrome bay
#

Yeah it would πŸ˜„

#

Long write up...

#

And aside from HLL's implementation it's not that proven yet

#

Still have to trial the hovertank stuff in the real world

#

HLL's ballistics is pretty solid now though

#

But costly

unkempt tiger
#

What makes it costly?

chrome bay
#

Potentially two reliable RPC's for every shot

waxen socket
#

That's cool. I'm happy you've been able to see and get so far. πŸ‘

chrome bay
#

One for the shot, another for a possible hit

#

x100 players, adds up quickly πŸ˜„

unkempt tiger
#

πŸ˜…

waxen socket
#

I do take comfort in that my game is 4-player coop. I don't have to worry about cheating, too many projectiles, or relevancy.

potent cradle
#

And I don't even have projectiles, but it'd be very interesting

waxen socket
#

And what do you guys think of the school of thought that says overlaps are inaccurate and costly and projectiles should rely on traces instead?

unkempt tiger
#

I don't know about costly, but I don't see a reason for it to use overlaps (depending on the game design of course)

#

A sweep of a sphere or a single trace should be more robust imo

#

I assume that by overlaps you mean check for overlaps every tick?

waxen socket
#

Even for slow-moving projectiles?

unkempt tiger
#

Personally I'd still default to traces

#

and reserve overlaps for entering zones, or other non-blocking interactions

#

But it really depends on your projectile and what you want to do with it

waxen socket
#

I see. Well, that would be a big refactor of my code, but I do see that being suggested here and there.

potent cradle
#

Don't optimise before you know it's a problem

#

Test & profile it first

#

Especially if it's a big change like that

waxen socket
#

Okay, thanks guys. It's such a complicated subject. πŸ˜…

potent cradle
#

Part of the fun πŸ˜„

limber gyro
#

hey guys, i just ran into some random disconect issues

#

does any one have tips on how to debug that?

potent cradle
#

Nothing in your log?

limber gyro
#

well its first time i am tackling this

potent cradle
#

Packaged game?

limber gyro
#

i see a connection timed out right before a logout if called

#

yes its a packaged game

potent cradle
limber gyro
#

well i did lol

#

theres nothing much

potent cradle
#

Oh 😦

limber gyro
#

i did add the network error callback now

potent cradle
#

You checked both server and client?

limber gyro
#

so in the next test i will probably have better logs

#

i only have acesss to the server logs for now unfortunately

potent cradle
#

Run your exe with -log

#

The client exe

#

Shortcut to exe, in target add -log

limber gyro
#

the logs are with my friends

potent cradle
#

ahhhhh

#

Okay

limber gyro
#

it only happens when i have more than 5 people

#

so theres that too

potent cradle
#

It's always the same player, too?

limber gyro
#

nop

potent cradle
#

Or different folks?

#

Ah

limber gyro
#

diferent random players

potent cradle
#

I'd personally try to get the logs from the folks who are disconnecting first, to see if that brings you any closer

#

Tricky to diagnose otherwise

#

But perhaps people with more experience can give you an educated guess

unkempt tiger
#

check your net serializers, if they don't map fully without returning false that can lead to disconnects afair

lilac raven
#

does anyone know why 'get current players' and 'get max players' nodes dont seem to work for me? they top out at 1 person, so if my session has 4 people in, it still just says 1

wise zephyr
#

guys for some reason child actors arnt replicating i have checked everybox for replication im at a fucking loss....when i select client in the editor it shows the mesh that doesnt replicate on EOS

#

everything else in the game is replicating but if its a child actor it doesnt replicate on EOS

kindred widget
#

@wise zephyr ChildActorComponents really aren't that great. You can get the same functionality by just attaching a spawned actor to the actor that would have the component and setting it's Owner variable. Then you even have one less scene component to update on movements, and your actor with the other actor attached can have a direct pointer instead of GetChildActorComponent->GetChildActor->CastToCorrectType->Finally have access.

wise zephyr
#

i like it though when i drag a class out into the editor it brings the child actor with it

#

is there a way to do that

#

like put it in the construction script or something

#

i mean it makes no sense that its not replicating

#

btw this is blueprint right now

kindred widget
#

I dunno. Don't use the component. I'm not even sure if the component itself would need to replicate if it's a default component in that class. Probably just the two actor classes. The one with the component, and the one being spawned by the component.

wise zephyr
#

i mean i guess i could make a dummy child actor then when the game starts spawn the actor with the child actor transform

kindred widget
#

Maybe the component would need to replicate. I'm not sure how the component would handle only spawning that actor on the server though.

#

Are you just not seeing it on clients? Or what's the problem with it.

wise zephyr
#

yeah not seeing it on the client when i use EOS but if i choose client in the simulate multiplayer i can see it

#

makes no sense

#

u know like the drop down under the play button where u simulate 2 players...i choose client and i can see it but when i test on EOS the client cant see it

kindred widget
#

I'm not sure that choosing client makes it a multiplayer game though?

#

I have to double check. I'm used to using Listenserver.

wise zephyr
#

ah i thought when u choose client it just test them as clients

wise zephyr
#

EVERY FUCKING CHECKBOX IS CHECKED AND IT WONT FUCKING REPLICATE!!!! WHAT THE FUCKKKKK

winged badger
#

it doesn't matter which OSS you are using, replication works the same

dark edge
#

@wise zephyr just don't use child actor components, they are bad news

wise zephyr
#

no i want to use them

#

this is unacceptable

#

ok so

#

think about this

#

i got a turret...and i want them in two separate pieces i want the stand and the top part...i want them separate for my reasons that i will not get into

#

when i drag the actor into the world it brings the child actor with it

#

also i am using blueprint btw not c++ not yet

winged badger
#

i have a ton of Actors that spawn additional Actors

#

would never use a ChildActorComponent to do it

#

even if it wasn't full of bugs

#

as it doesn't really allow me to inject data and dependencies into "child actors" elegantly

dark edge
wise zephyr
#

its all checked man haha

#

i wonder if its the smooth sync plugin that i downloaded that fucked with it

ancient scarab
#

How do people get around the problem of having to build everytime you have to setup a dedicated server for your game?

wise zephyr
#

when i get back to my computer im going to disable smooth sync see if that fucked with the replication of the child actors for some reason...i have no fucking clue

ancient scarab
#

in short, i want my changes to be reflected in my server

wise zephyr
#

thats a good question syrup

dark edge
#

@ancient scarab just fire up the engine as server

ancient scarab
#

so install ue4 on server?

dark edge
#

Do you have a physical server or cloud one?

ancient scarab
#

a cloud server

#

AWS

dark edge
#

You can test it with just a laptop. It's doable on AWS but you will have to actually build the editor or at least the engine on it

bitter oriole
#

You don't need to actually run on your actual server hardware

#

Just run the server and game on your machine

dark edge
#

You can do it on another machine, I do it all the time on my laptop. Just like this, I have a batch file to do it. It would be something similar under Linux.
@Starkmax This is what works for me.

"C:\Program Files\Epic Games\UE_4.20\Engine\Binaries\Win64\UE4Editor.exe" "%CD%\ShotInTheDark.uproject" TestMap -server -log -nosteam

#

That's old but you get it, just fires up the project headless

#

No need to build anything

#

I pulled it off once on my cloud Server but it took like 12 hours to compile the engine on my $5 digitalocean box LMAO

#

But basically, however you do it, it's just like you're developing on that machine.

#

If you have a Linux desktop handy to build the editor with would be a lot easier.

potent cradle
# wise zephyr this is unacceptable

Sometimes it helps more to just work around things the engine doesn't like, by taking a path that it does properly support. Child actors is one of those times.

#

You can still spawn and attach afterwards, as mentioned

wise zephyr
#

i fixed it dean setting the child actor's class on a custom event that runs on the server fixed my issue

#

this is fucking hilarious

#

so its not working with this other class that i have a child actor in lmfao

wise zephyr
#

ok i got one of the child actors to replicate

#

so

#

only the last set child actor class works for some reason

#

the other children do not replicate

#

child actors*

#

ok now the just the first one replicated

#

now none of them

#

WHAT THE FUCK

#

THERE IS ALWAYS A FUCKING PROBLEM LMFAO I HATE CODING

meager spade
#

@wise zephyr ditch child actors, before you loose your sanity even more. and please calm down with the caps and language πŸ˜‰

wise zephyr
#

kaos i need the child actors the way i have this class set up

#

if i dont use child actors its going to be bs

#

so set class to child actors worked to show the child actor on the client

#

for one class that had a child actor

#

now that same fucking code

#

doesnt work for this class

#

it just makes 0 sense!

#

hahaha

#

so

#

i swaped out the set child actor class

#

to another actor and it worked

#

so there is a problem somewhere with the correct child actor class

ancient scarab
dark edge
#

Then do what I said. Instead of the dedicated server launching a built and cooked project, it launches just like if you were firing up a server locally

#

@ancient scarab

#

You'll have to build the actual editor on Linux afaik. I'm no genius about the particulars of this approach but I know it works.

ancient scarab
#

Yeah I think so.. which sucks haha.

#

Im using free AWS so that's no good either

dark edge
#

Do you have a local Linux box for building the engine?

#

Or can you put Windows server on your AWS?

ancient scarab
#

you can put Windows server

dark edge
#

Then you can just do that. I'm not sure if it'd be the smartest way to do it but it would be possible

ancient scarab
#

I was planning to go with Linux though because it's less expensive but I could be wrong

#

Yeah! thanks

dark edge
#

It's definitely a lot better supported for dedicated servers.

#

Even when six or seven people a local server would work just fine. just put the project and engine on your laptop, fire up the headless server, and make sure the ports are forwarded.

wise zephyr
#

ok so i made a copy of the class i needed and it works now...i referenced the copy

#

fucking buged!

dark edge
#

Or on whatever extra computer you have hanging around. I was using an old busted ass i3 with two gigs of RAM and it worked just fine.

ancient scarab
dark edge
#

It depends on what you're doing, but not necessarily.

ancient scarab
#

ah I see, didn't know that actually xqcT

#

that sounds like a much better option than setting up the engine on a dedicated server

dark edge
#

I would just take a spare computer, slap Ubuntu on it, have it build the binaries that are needed to fire up the game project, and upload all of that to your cloud server.

potent cradle
#

I did a linux dedicated server build on windows the other day

#

Then uploaded to my cloud instance

#

Worked fine

dark edge
potent cradle
#

Oh πŸ€”

ancient scarab
#

mine starts with 172.19

dark edge
#

I'm sure it's possible but from how clueless me you both are on this, I wouldn't bet on pulling it off.

hollow eagle
#

Are you sure that's your public ip

#

Search "what's my ip" on google

ancient scarab
#

ipconfig

hollow eagle
#

Yeah that's not how you get your public ip

dark edge
#

If you don't know the difference between a public and private IP, I 100% cannot recommend tackling dedicated servers at this time lol

#

Hey I don't know anything about networking either, that's why I'm not touching dedicated servers with a 10-ft pole

twilit radish
#

How are you supposed to learn something if you don’t use it though? πŸ‘€

potent cradle
#

I think it's more that listen servers would offer a softer learning curve

#

So you don't have to worry about managing your own server instances

dark edge
#

And also needing dedicated servers implies a game design that will rely on a rather large population. That sounds like a recipe for too large of a scope

ancient scarab
#

running a server on my local machine, opening port 7777 and just let people connect using my public IP would not work?

twilit radish
#

Dedicated servers are not necessarily only for big scale if you ask me. Why can’t I use them as small studio to provide a couple of official servers along with other solutions like for example community hosted servers? I understand it doesn’t fit for everyone, but there are definitely cases smaller games can benefit from them as well.

potent cradle
#

Valid, yes

#

Already demonstrably the case for a bunch of indie games

dark edge
lost inlet
#

should work with forwarded ports and the null online subsystem

#

if you use the steam OSS, then you might also need to forward the steam query port

ancient scarab
#

almost all my ports even default ones are "stealth"

#

think I would rather just build the engine on my AWS server, sounds much more convenient than local

lost inlet
#

I don't know what that means, I hope you didn't setup a DMZ on a home network

#

you can also do that, not sure how it's more convenient

ancient scarab
#

ppl can still test when im unavailable

lost inlet
#

well you said the word build

#

building is a bit different from running

ancient scarab
#

and i already have public ip and port opened on it

lost inlet
#

so basic router configuration stuff then

#

I've not heard of this happening, do some ISPs share public IPs between multiple customers or something?

ancient scarab
#

i dont know how recent it was but i do remember being told to contact my ISP if i needed a dedicated public IP

lost inlet
#

though to me that sounds more like having a static IP more than having your own public IP

#

but that sucks

#

I suppose if you went the listen server route you could use steam or EOS p2p, since that relays everything to get around NAT

stoic acorn
#

can you not Cast to your GameState from your Character Blueprint Construction Script?

ancient scarab
#

is EOS P2P good for long term? we moved away from Steam because we were unsure about future options

lost inlet
#

well it's one service that offers p2p, which I believe does work on relay servers

ancient scarab
#

so it's paid?

lost inlet
#

I'm not sure why you'd move away from steam since you can still use its online subsystem for platform-native features

stoic acorn
#

Actually, it's in my Event Graph on the Event BeginPlay

ancient scarab
#

if we decide to publish, we'd need to pay for a steam app + host a dedicated server, right?

lost inlet
#

yes. or if you rely on listen servers either through direct IP or p2p then you can also get away with that

ancient scarab
#

Steam + P2P is possible?

lost inlet
#

if your game is steam and only ever will be steam, then you can use its p2p features that are provided as part of the steam online subsystem

ancient scarab
#

is it completely independent of servers? dont even need their test spacewar server?

hollow eagle
#

using steam networking and choosing between listen or dedicated servers are completely unrelated. You can use steam networking with either.

#

"spacewar" is just an example of using steam features

#

and an appid that developers can use before they have their own

#

you don't need to use any code related to spacewar

ancient scarab
#

ah.. so steam subsystem is the better option seems like..

lost inlet
#

I'm not sure if you fully understand what an online subsystem is

#

as well as listen/dedicated

ancient scarab
#

yeah im still new to this. thanks for all the help

stoic acorn
#

How can you trigger something on your GameMode from a character Blueprint EventHit?

lost inlet
#

get the gamemode and call the event?

#

the gamemode will only be valid on the server

stoic acorn
#

I don't like how much code I'm putting onto my character bp

dark edge
dark edge
lost inlet
#

I'm not even interested in the use case, you can get the game mode from any BP actor

#

so the thing being asked is a very trivial thing

#

in C++ GetWorld()->GetAuthGameMode() will get your the game mode

shadow arch
#

could someone tell me what this error means Warning LogNet UNetDriver::ProcessRemoteFunction: No owning connection for actor MobSpawner_9. Function Server_SpawnMobs will not be processed.

#

or rather why is this error even there?

lost inlet
#

whatever client is calling Server_SpawnMobs doesn't have net ownership

shadow arch
#

i simply grabbed the actor and placed it into the world in the editor

#

didn't spawn it from the gamemode, is that why?

grizzled stirrup
#

Is it correct that loading a single streaming level via Load Stream Level is replicated automatically but loading instances via Load Level Instance or Create Instance must be manually loaded on the client also?

lost inlet
#

well I don't know what is calling Server_SpawnMobs, if the client is calling it anywhere then it's going to cause problems unless they own the actor

#

you can add a breakpoint to whatever produces that message if you want a better idea on what might be calling it

stoic acorn
dark edge
stoic acorn
#

Thankyou man, I'm going to give that a bash. I've already done the logic of determining whether a player is being captured or not

dark edge
lost inlet
#

does this guy have me on mute or something?

stoic acorn
lost inlet
#

going for yes then

stoic acorn
#

sorry, was that to me sswires?

lost inlet
#

yes because I was discussing this with you like 15 minutes ago

stoic acorn
#

sorry man, I had to attend to my baby who had woken.. not great at multi tasking so I think I missed your reply.. Thanks for the response

dark edge
#

@gritty lodge you can't call them from the client. You got a call on the server side.

lost inlet
#

if it's running on the server, you can get the game mode

gritty lodge
#

Oh I see, of course

dark edge
#

In your case, the pawn should tell the game mode itself. How would the player controller know that the pawn died?

gritty lodge
#

Okay sounds good, thanks!

rocky topaz
#

is there any way to get a return value from an RPC (client calling something on the server) ?

lost inlet
#

no

#

you'd have to have an RPC that sends the value back

rocky topaz
#

oof

#

or a replicated value that the server changes

jolly siren
#

Can you create an OnRep for a replicated engine variable without modifying engine?

#
    UPROPERTY(Replicated, BlueprintReadOnly, Category=PlayerState)
    uint8 bIsSpectator:1;
#

Wanted an OnRep for this

winged badger
#

possibly with new macros

jolly siren
#

yeah I was hoping so

winged badger
#

mirroring it wouldn't be too horrible

#

have the spectator controller push a new boolean for it into PS

#

and just replicate that

jolly siren
#

I'll probably just change the engine if there is no macro

winged badger
#

if you already have the modified source version

#

its not a big deal

jolly siren
#

yeah not at all. Was just hoping to learn something new πŸ˜›

winged badger
#

its possible the new macro will tolerate adding OnRep and it will get called

#

i haven't modified network code much since they added those

#

but i think they are for when OnRep gets called

#

not for if

jolly siren
#

Right, that makes sense

rocky topaz
#

how would you implement a rule of the game that could be changed depending on the game is played?

#

atm I'm putting all of them in GameMode but it sucks to not be able to preview the rules while not being the authority

eager pine
#

are multicasts broken in 4.26? working fine in 4.25, then i upgrade to 4.26 and they stopped working. Just runs on server, not clients

lost inlet
#

no? and I don't think the engine would ship with a major part of the replication system not working

eager pine
#

definitely not working in my project, tried a bunch of multicasts everywhere, but only the server has it. Yeah its crazy dunno whats going on

#

even repnotifys run on server only

lost inlet
#

so this is in blueprint then, which I usually don't do, but I would make sure your actor is actually replicating

eager pine
#

ive been doing multiplayer for years thats why im confused. Never had this issues before :/ ill revert back to 4.25

steel vault
#

Steam multiplayer is giving me a hell of a time. I packaged my game and sent it to a friend. When they log in they click a host button and it server travels them to the new level where they wait on others to join. The other player (me) has a server list that can clearly see the name of the player and the name of their created server (through steam OSS). When I select the server press join, to travel to their server, it says it succeeds, but nothing happens. The client eventually times out in the logs, but I don't quite understand why it's failing. I am at a bit of an impasse without getting this to work. Any help would be greatly appreciated! https://pastebin.com/70DdQzpU

#

For more information, I'm using the default app ID 480 and the list has other servers not related to my game, but they are filtered out so only mine shows.

fringe matrix
#

Has anyone run into a problem with late join where a value replicated in blueprints just doesn't replicate on join? It's strange I have a bunch of characters spawn on server start, and when the client joins some of them have all their replicated values and others don't, the only difference between them is the data table entry that initializes them. I'm really confused.

winged badger
#

relevancy?

fringe matrix
#

not sure how, the character spawns, just doesn't have the correct state for one specific variable 😦

winged badger
#

right, if it spawns its relevant

#

how do you initialize the character?

fringe matrix
#

I have a C++ character subclass and then I subclass that with a blueprint. The data table row is read in C++ and initializes the character. The variable in question is on the blueprint, it listens for a callback from one of my components and then sets the value. I added some print strings and see that it is set correctly on the server. On the client, when I connect there is one of the characters that it works fine, I have a client only print in begin play that displays the correct value. For the characters that are failing, the value output here is not correct. The only differences between the characters is their entry in the data table. Originally they had different names and such but I even tried setting each entry to be exactly the same and it was still busted. If I do something in game that causes the value to change on the server while connected, it replicates as expected, it's only this initial state that seems to be broken.

winged badger
#

callback from one of your components...

#

that is not a component on the character i take it?

#

what replicates the rowname?

fringe matrix
#

it is, but only the server cares about the callback and then it sets the variable which is set to replicate.

#

the rowname is replicated in C++ by a variable

winged badger
#

in character class?

#

with replication callback?

fringe matrix
#

yes, the C++ character class replicates the data table row. the callback is not replicated

#

it is setup to call on the server in one place and then on the clients I check state and call in in postrepnotifies

#

but the client ignores that callback

winged badger
#

you do have at least one rep notify fire for postrepnotify to happen

fringe matrix
#

my setter code in BP is doing swtichauthority and setting the bp variable that is supposed to replicate

winged badger
#

or did you mean PostNetReceive?

fringe matrix
#

no, postrepnotifies

winged badger
#

any replicated member that is set on server in the frame the actor is spawned

#

gets sent in the same package as the instructions to spawn the actor

fringe matrix
#

what is postnetreceive for? is that a new function?

#

it's several frames after the character i s spawned on the server that the client joins, the server state is stable at that time

winged badger
#

all of those will get set to server values and their rep notifies will fire before Actor calls BeginPlay on clients

#

if the net driver gets a hold of the actor before you set that variable

#

you really need to add a replication callback for it

#

note that there is no guarantee whatsoever that net driver will replicate the Actor in the frame its spawned

fringe matrix
#

hmmm, interesting. I'm just surprised it worked at all then πŸ˜„

winged badger
#

it might be a second later, depending on how many Actors there are to replicate

fringe matrix
#

I guess I can change the var to repnotify to and print to see if it ever changes, the thing using it is checking it every frame so I should have seen a change eventually if it arrived

winged badger
#

ideally, you'd get the Rowname set immediately

fringe matrix
#

the rowname stuff shouldn't actually have any bearing on the problem though, that's why it is so baffling to me

winged badger
#

i generally don't like the idea of Actors calling BeginPlay before they have all the data they need to setup

fringe matrix
#

is there a way to control that? I just always thought UE just did it when it wanted

winged badger
#

deferred spawn on server

#

calling FinishSpawning only after you set the data

#

client's won't call BeginPlay before they handle their initial replication + callbacks

fringe matrix
#

yeah that's what I thought. Which is why the one that works has the correct value in my beginplay print

#

well, I will keep poking at it and see if I can determine what part of it is causing it to behave strangely and write back if I discover what happened. Thanks for listening πŸ™‚

winged badger
#

why is there a delay before the Rowname is set?

#

i can't think of a good reason for that

fringe matrix
#

there isn't, the spawner does the deferred spawn and sets the rowname and then calls finish

#

oh in my component I do some initialization in beginplay, maybe I need to move that somewhere earlier

peak sentinel
#

Is overriding OnRep functions as virtual void YourFunctionName_Implementation() override; safe?

heady python
#

When a client walks a certain distance away from an actor, the actor permanently disappears for that client. Actors are never disappearing on the server. My network settings for these actors are unedited. Any reason this would happen?

fathom grotto
#

What is the net cull distance squared of the actor?

#

If it's the default of 22,500,000, that means the the actor will be culled when the client gets 150 meters from the actor.

heady python
#

oh okay. Ill try raising it. thanks @fathom grotto

fathom grotto
#

πŸ‘

fringe matrix
velvet brook
#

What do you guys think is the best way to sort a leaderboard? Should i use bubble sort?

random nymph
#

Is it possible to use steamnetdriver and ipnetdriver at the same time?

#

I'm thinking of a setup where we would have dedicated servers for our ranked/main gamemode and connecting to that would happen with ipnetdrivers. And then we would have user hosted casual lobbies using steamnetdriver

#

Or would it just be wisest to store the lobbies to some external database and use that database to transfer the lobby/connection info to other clients?

uncut knot
#

Hello! I have an issue where after seamless travel, the server side (listen server) doesn't recognize GetPlayerController(GetWorld(), 0)) as the local player controller. Does anyone have any idea why this would be?

lament sinew
uncut knot
#

They seem to return the same thing, so didn't fix my issue unfortunately

#

In short, I want the floating health bars above each player's head to be re-initialized post seamless travel. It works for the client, and I can see that the init function is called on the server, but the player controller isn't considered local

twin juniper
#

im in a bit of a confusing bind, i have a tick event running where if locally controlled it sets the flashlight to rotate towards the mouse, and it works fine

#

but i want the character to look in the direction of the mouse and its replicated through all of the clients but nothing happens on server

#

so in all clients, theyll all see each other and even the server change facing depending on if their mouse is on left or right of them

#

but the server wont change at all or even see the clients change

twin juniper
#

figured out my own shit, nvm lol

odd iron
#

hi hi still can't make the advanced session public without using Steam subsystem 😦

#

i want the players of mobile also can see the session if i add steam subsystem it will register in steam just PC players can see it

bitter oriole
#

Which other OSS have you been trying ?

#

Out of the box there's only NULL (LAN) and Steam

odd iron
#

Playfab

#

also idont know if there is another OSS can set the sessions public

bitter oriole
#

OSS depend on a service that a company is running with their own server

#

So there aren't 50 of them

#

If you want a cross-platform, cross-store service, EOS does that

#

Maybe Playfab does too, no idea about that

#

Sounds like right now you need to fix your Playfab setup

odd iron
#

oh so if i set the Defaultplatformservice empty it wont show on other devices ??

bitter oriole
#

Well yeah, that's the LAN-only NULL OSS

#

Means you have no online services except LAN matchmaking

#

Can't find or create sessions other than LAN, no achievements, friends etc

odd iron
#

well i added Playfab there i hope its work

#

on Android its crashing the game when finding a session

#

i can see nothing heavy or wrong why its crashing

bitter oriole
#

Keep it simple, just print the number of sessions found to log

#

Get the sessions to work and do your UI later

odd iron
#

i will try

#

thanks thanks ❀️

twin juniper
#

quick question, if i wanted to set up a dodge mechanic, how would i add velocity for a short time in the direction they are going

#

then slow down greatly

#

add impulse?

#

well its a 2d character in a 3d world

#

so like paper mario

#

but id like for him to dodge in a direction if he hits space while moving

grizzled stirrup
#

I see a "Replicated Sublevel Instances" plugin on the marketplace for $120 but I'm wondering if there's a need for it compared to just replicating an int32 and choosing the same sequence of random sublevels to load on the client?

#

Am I missing a downside to this approach or something that the plugin would handle?

twin juniper
#

Isn't there a way to go from one thing to another in a timer kinda thing? Like a spleen or a tween or something? Where it'd go from one thing to another in a specific amount of time?

grizzled stirrup
#

Great thanks!

#

What benefit would the store plugin give?

twin juniper
#

Yeah idk what it's called to pull up the node.

grizzled stirrup
#

Ah so it's more convenience if you don't want to sync a seed etc.

#

Thanks!

#

I was thinking there might be some linking problem from the server to client

#

As I had that problem when spawning HISMs

#

They had to be named exactly the same etc.

#

Do you know if this kind of issue exists with sublevels too?

twin juniper
#

What was the node called? Idr.

#

Oh no it's like spleen or tween or. Something

#

Hm. Idk if that's it. I'll try to find it.

grizzled stirrup
#

Is there much of a difference between Create Instance better than Load Level Instance in terms of performance if loading in a sublevel at runtime on clients / server?

#

The main difference I can see is that Load Level Instance can load in any sublevel but Create Instance can only load sublevels contained in the persistent level

wheat magnet
#

how to replicate entire behavior tree

grizzled stirrup
#

You normally wouldn't

#

Usually the AI's brain only runs on the server and clients just see the results of its actions

wheat magnet
#

so what is the solution, becuase in my client side the behavior logic run different

grizzled stirrup
#

It shouldn't run at all on the client

wheat magnet
#

i want to run behavior tree for client

twilit radish
#

What’s your use case for it having to be client side? Because to my knowledge that opens up a ton of exploits. What if for example a modified client would say that all AI that client controls can’t attack that client? Your clients should pass information to the server, the server should validate that and then change AI behavior if needed. Clients should not be able to directly influence AI, as in controlling them.

meager spade
#

@wheat magnet Behaviour trees have 0 replication. They only run locally. If you want to run a BT on client, then have that client create an AI Controller, and run a BT. but you can not replicate BT's, BT Tasks, etc. I think your main issue is you have a design fault.

wheat magnet
#

got it, so is there any way to communicate from Ai controller to BT task

meager spade
#

no

#

BTTask > AI Controller, not AIController -> BTTask

#

task can ask or get anything from AI Controller it needs

wheat magnet
#

thanks, so it mean bt task only run in behavior tree, i can't able to cast to bt task from any other blueprint

meager spade
#

nope

uncut knot
#

Still can't wrap my head around why the server side (listen server) doesn't recognize its player controller as local after seamless travel. Any ideas?

#

Nvm, I'm an idiot

twilit radish
#

Hello, I have a question. Does anyone know if there are any multiplayer games that have melee combat with a mixture of physics against AI? I was wondering if it's even possible to make such a game, I was not able to find any games that really have this and seem to work good as well.

#

With "a mixture of physics" I mean something like: Hit an enemy -> The enemy gets knocked back a bit and plays an animation of getting hit.

meager spade
#

that is normally animations, with some kinda knockback root motion

twilit radish
#

But what about things like prediction? I would imagine that being a mess with and without. What if an AI gets hit by 2 players at the same time or what if 1 player hits it while close to it. It seems really complicated, hence why I was asking if there were any real games that did it πŸ™‚

#

Or if it's even possible at all.

pallid mesa
#

destruction allstars

#

also yes, it is complicated